Remove stale build asset
Browse files
space_dist/assets/local-bengali-CniuMHoD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{_ as Hr}from"./index-suLLRbub.js";const Wr="/espeak-ng-data";var jr=class{module;source;dataPath;#e=new Map;constructor(u,s,d=Wr){this.module=u,this.source=s,this.dataPath=d}availableLanguages(){return Object.keys(this.source.manifest.dictionaries)}loadedLanguages(){return this.availableLanguages().filter(u=>this.hasDictionary(u))}hasDictionary(u){return this.module.FS.analyzePath(this.#t(u)).exists}async loadCore(){const{core:u}=this.source.manifest;this.#r(await this.source.read(u.file))}loadCoreSync(){if(!this.source.readSync)throw new Error("This data source cannot read synchronously.");const{core:u}=this.source.manifest;this.#r(this.source.readSync(u.file))}loadDictionary(u){if(this.hasDictionary(u))return Promise.resolve();const s=this.#e.get(u);if(s)return s;const d=this.#n(u),h=this.source.read(d.file).then(v=>{this.#o(this.#t(u),v)}).finally(()=>{this.#e.delete(u)});return this.#e.set(u,h),h}loadDictionarySync(u){if(this.hasDictionary(u))return!0;if(!this.source.readSync)return!1;const s=this.#n(u);return this.#o(this.#t(u),this.source.readSync(s.file)),!0}#n(u){const s=this.source.manifest.dictionaries[u];if(!s)throw new Error(`espeak-ng has no dictionary for "${u}". Available: ${this.availableLanguages().join(", ")}`);return s}#t(u){return`${this.dataPath}/${u}_dict`}#r(u){const{core:s}=this.source.manifest;if(u.length!==s.size)throw new Error(`${s.file} is ${u.length} bytes, the manifest expects ${s.size}. The data files and manifest.json do not match.`);let d=0;for(const h of s.entries)this.#o(`${this.dataPath}/${h.path}`,u.subarray(d,d+h.size)),d+=h.size}#o(u,s){const d=u.slice(0,u.lastIndexOf("/"));this.module.FS.mkdirTree(d),this.module.FS.writeFile(u,s)}};async function Vr(u,s){if(s==="identity")return u;const d=new Blob([u]).stream().pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(d).arrayBuffer())}function Gr(u){return u[0]===31&&u[1]===139}async function Xr(u,s=fetch,d=Vr){let h=String(u);if(h.endsWith("/")||(h+="/"),!/^[a-z][a-z0-9+.-]*:/i.test(h)){const S=globalThis.location?.href;if(!S)throw new Error(`The espeak-ng data URL must be absolute outside a browser context: ${h}`);h=new URL(h,S).href}const v=async S=>{const D=await s(new URL(S,h));if(!D.ok)throw new Error(`Failed to fetch espeak-ng data file ${S} from ${h}: ${D.status} ${D.statusText}`);return new Uint8Array(await D.arrayBuffer())},m=await s(new URL("manifest.json",h));if(!m.ok)throw new Error(`Failed to fetch espeak-ng data manifest from ${h}: ${m.status} ${m.statusText}`);const _=await m.json();if(_.version!==1)throw new Error(`Unsupported espeak-ng data manifest version ${String(_.version)} at ${h}`);return{manifest:_,read:async S=>{const D=await v(S),z=_.encoding==="gzip"&&!Gr(D)?"identity":_.encoding;try{return await d(D,z)}catch(L){throw new Error(`Failed to decode espeak-ng data file ${S} from ${h}: ${String(L)}`,{cause:L})}}}}function xr(u){return`https://cdn.jsdelivr.net/npm/@spelling-creator/spellophone@${u}/espeak-ng-data/`}function Kr(u,s){const v=u.length*2,m=new ArrayBuffer(44+v),_=new DataView(m),S=(D,z)=>{for(let L=0;L<z.length;L++)_.setUint8(D+L,z.charCodeAt(L))};S(0,"RIFF"),_.setUint32(4,36+v,!0),S(8,"WAVE"),S(12,"fmt "),_.setUint32(16,16,!0),_.setUint16(20,1,!0),_.setUint16(22,1,!0),_.setUint32(24,s,!0),_.setUint32(28,s*1*2,!0),_.setUint16(32,2,!0),_.setUint16(34,16,!0),S(36,"data"),_.setUint32(40,v,!0);for(let D=0;D<u.length;D++)_.setInt16(44+D*2,u[D]??0,!0);return new Uint8Array(m)}const Yr="0.2.1",Ce={rate:1,volume:2,pitch:3,range:4,punctuation:5,capitals:6,wordGap:7},qr=16,Qr=256,Jr=4096,Zr=1,et=2,rt=2,tt=128,nt=1,ot=2,at=3,it=4,st=5,lt=7;var se=class extends Error{name="EspeakError";code;constructor(u,s){super(u),this.code=s}},Ue=class extends se{name="DictionaryNotLoadedError";language;constructor(u){super(`The "${u}" dictionary is not loaded. Load it with espeak.loadLanguages(["${u}"]) or pass it in the languages option.`,-1),this.language=u}};function ct(u){const s={printErr:d=>{d.startsWith("Can't read dictionary file:")||console.error(d)}};if(u!==void 0){const d=String(u);s.locateFile=(h,v)=>h.endsWith(".wasm")?d:v+h}return s}function ee(u,s,d){const h=u.lengthBytesUTF8(s)+1,v=u._malloc(h);try{return u.stringToUTF8(s,v,h),d(v)}finally{u._free(v)}}function Be(u,s){const d=[];if(s===0)return d;let h=s;for(;;){const v=u.HEAPU8[h]??0;if(v===0)break;const m=u.UTF8ToString(h+1);d.push({priority:v,name:m}),h+=1+u.lengthBytesUTF8(m)+1}return d}function dt(u){if(u===1)return"male";if(u===2)return"female"}var ut=class Ie{module;sampleRate;version;dataPath;#e;#n=!1;#t;constructor(s,d,h,v){this.module=s,this.sampleRate=d,this.dataPath=h,this.#e=v;const m=s.UTF8ToString(s._sp_version());this.version=m.split(/\s+/)[0]??m}static create(s,d={}){const h=d.dataPath??d.loader?.dataPath??"/espeak-ng-data";let v=0;d.phonemeEvents&&(v|=Zr),d.phonemeEvents==="ipa"&&(v|=et);const m=ee(s,h,_=>s._sp_initialize(_,v));if(m<=0)throw new se(`espeak-ng failed to initialize with data at ${h} (status ${m}). Is the data loaded, including the English dictionary?`,m);return new Ie(s,m,h,d.loader)}listVoices(){this.#r();const s=this.module,d=[],h=s._sp_voice_count();for(let v=0;v<h;v++){const m={name:s.UTF8ToString(s._sp_voice_name(v)),identifier:s.UTF8ToString(s._sp_voice_identifier(v)),languages:Be(s,s._sp_voice_languages(v))},_=dt(s._sp_voice_gender(v));_&&(m.gender=_);const S=s._sp_voice_age(v);S>0&&(m.age=S),d.push(m)}return d}get voice(){this.#r();const s=this.module,d=s._sp_current_voice_name();return d===0?null:{name:s.UTF8ToString(d),languages:Be(s,s._sp_current_voice_languages())}}setVoice(s){if(this.#r(),this.#o(s),this.module._sp_dictionary_loaded())return;const d=this.module.UTF8ToString(this.module._sp_dictionary_name());if(!(this.#e?.loadDictionarySync(d)&&(this.#o(s),this.module._sp_dictionary_loaded())))throw new Ue(d)}async loadVoice(s){try{this.setVoice(s)}catch(d){if(!(d instanceof Ue)||!this.#e)throw d;await this.#e.loadDictionary(d.language),this.setVoice(s)}}loadedLanguages(){return this.#e?.loadedLanguages()??[]}availableLanguages(){return this.#e?.availableLanguages()??[]}async loadLanguages(s){if(!this.#e)throw new Error("This Espeak instance has no data loader.");await Promise.all(s.map(d=>this.#e.loadDictionary(d)))}getParameter(s,d=!0){return this.#r(),this.module._sp_get_parameter(Ce[s],d?1:0)}setParameter(s,d,h=!1){this.#r();const v=this.module._sp_set_parameter(Ce[s],d,h?1:0);if(v!==0)throw new se(`Could not set ${s} to ${d}`,v)}synthesize(s,d={}){this.#r(),d.voice!==void 0&&this.setVoice(d.voice);const h=this.#i(d);try{let v=0;d.ssml&&(v|=qr),d.phonemes&&(v|=Qr),d.endPause&&(v|=Jr);const m=ee(this.module,s,_=>this.module._sp_synthesize(_,v));if(m!==0)throw new se(`Synthesis failed (status ${m})`,m);return this.#s()}finally{h()}}phonemes(s,d={}){this.#r(),d.voice!==void 0&&this.setVoice(d.voice);let h=d.ipa===!1?0:rt;if(d.tie&&(h|=tt),d.separator){const m=d.separator.codePointAt(0)??0;if(m>65535)throw new RangeError("The phoneme separator must be a single BMP character.");h|=m<<8}const v=ee(this.module,s,m=>this.module._sp_text_to_phonemes(m,h));return this.module.UTF8ToString(v)}dispose(){this.#n||(this.#n=!0,this.module._sp_terminate())}#r(){if(this.#n)throw new Error("This Espeak instance has been disposed.")}#o(s){const d=this.module,h=m=>ee(d,m,_=>d._sp_set_voice_by_name(_));let v;if(typeof s=="string"){if(v=h(s),v!==0){const m=s.indexOf("+"),_=m<0?s:s.slice(0,m),S=this.#a(_);S!==void 0&&(v=h(S+s.slice(_.length)))}}else{const m=s.gender==="male"?1:s.gender==="female"?2:0;v=ee(d,s.name??"",_=>ee(d,s.language??"",S=>d._sp_set_voice_by_properties(_,S,m,s.age??0,s.variant??0)))}if(v!==0)throw new se(`No voice matches ${typeof s=="string"?`"${s}"`:JSON.stringify(s)} (status ${v})`,v)}#a(s){if(!this.#t){const d=new Map;for(const h of this.listVoices())for(const{name:v,priority:m}of h.languages){const _=v.toLowerCase(),S=d.get(_);(!S||m<S.priority)&&d.set(_,{identifier:h.identifier,priority:m})}this.#t=new Map([...d].map(([h,{identifier:v}])=>[h,v]))}return this.#t.get(s.toLowerCase())}#i(s){const d=[];for(const h of["rate","volume","pitch","range","wordGap"]){const v=s[h];v!==void 0&&(d.push([h,this.getParameter(h)]),this.setParameter(h,v))}return()=>{for(const[h,v]of d)this.setParameter(h,v)}}#s(){const s=this.module,d=s._sp_audio_samples(),h=s._sp_audio_data(),v=new Int16Array(s.HEAP16.buffer,h,d).slice(),m=[],_=s._sp_events_count(),S=s._sp_event_size(),D=s._sp_events_data(),z=s._sp_strings_data();for(let L=0;L<_;L++){const B=D+L*S>>2,C=s.HEAP32,N=C[B]??0,$={textPosition:C[B+1]??0,length:C[B+2]??0,audioPosition:C[B+3]??0,sample:C[B+4]??0},H=C[B+5]??0,x=C[B+6]??-1,q=x>=0?s.UTF8ToString(z+x):"";switch(N){case nt:m.push({type:"word",...$,number:H});break;case ot:m.push({type:"sentence",...$,number:H});break;case at:m.push({type:"mark",...$,name:q});break;case it:m.push({type:"play",...$,name:q});break;case lt:m.push({type:"phoneme",...$,phoneme:q});break;case st:m.push({type:"end",...$})}}return{samples:v,sampleRate:this.sampleRate,duration:d/this.sampleRate,events:m}}};async function ft(u={}){var s=u,d=!!globalThis.window,h=!!globalThis.WorkerGlobalScope,v=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(v){const{createRequire:e}=await Hr(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]);var m=e(import.meta.url)}var _="./this.program",S=(e,r)=>{throw r},D=import.meta.url,z="";function L(e){return s.locateFile?s.locateFile(e,z):z+e}var B,C;if(v){var N=m("node:fs");D.startsWith("file:")&&(z=m("node:path").dirname(m("node:url").fileURLToPath(D))+"/"),C=e=>{e=ge(e)?new URL(e):e;var r=N.readFileSync(e);return r},B=async(e,r=!0)=>{e=ge(e)?new URL(e):e;var t=N.readFileSync(e,r?void 0:"utf8");return t},process.argv.length>1&&(_=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),S=(e,r)=>{throw process.exitCode=e,r}}else if(d||h){try{z=new URL(".",D).href}catch{}h&&(C=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),B=async e=>{var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)}}var $=console.log.bind(console),H=console.error.bind(console),x,q=!1,ge=e=>e.startsWith("file://");function ze(){return ce.buffer}function ke(){if(!I?.buffer?.resizable){var e=ze();I=new Int8Array(e),s.HEAP16=ne=new Int16Array(e),s.HEAPU8=Y=new Uint8Array(e),s.HEAP32=U=new Int32Array(e),P=new Uint32Array(e),R=new BigInt64Array(e)}}function $e(){!s.noFSInit&&!n.initialized&&n.init(),ae.t(),n.ignorePermissions=!1}function W(e){e=`Aborted(${e})`,H(e),q=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw r}var ue;function He(){return s.locateFile?L("espeak-ng.wasm"):new URL("/reader/assets/espeak-ng-Dm2Ws3KF.wasm",import.meta.url).href}function We(e){if(e==ue&&x)return new Uint8Array(x);if(C)return C(e);throw"both async and sync fetching of the wasm failed"}async function je(e){if(!x)try{var r=await B(e);return new Uint8Array(r)}catch{}return We(e)}async function Ve(e,r){try{var t=await je(e),o=await WebAssembly.instantiate(t,r);return o}catch(a){H(`failed to asynchronously prepare wasm: ${a}`),W(a)}}async function Ge(e,r,t){if(!e&&!v)try{var o=fetch(r,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(o,t);return a}catch(i){H(`wasm streaming compile failed: ${i}`),H("falling back to ArrayBuffer instantiation")}return Ve(r,t)}function Xe(){var e={a:zr};return e}async function xe(){function e(l){return ae=l.exports,Ir(ae),ke(),ae}function r(l){return e(l.instance)}var t=Xe(),o=s.instantiateWasm;if(o)return new Promise(l=>{o(t,c=>l(e(c)))});ue??=He();var a=await Ge(x,ue,t),i=r(a);return i}class Ke{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var I,U,le=()=>{var e=U[+O.varargs>>2];return O.varargs+=4,e},Q=le,k={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,o=e.length-1;o>=0;o--){var a=e[o];a==="."?e.splice(o,1):a===".."?(e.splice(o,1),t++):t&&(e.splice(o,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=k.isAbs(e),t=e.slice(-1)==="/";return e=k.normalizeArray(e.split("/").filter(o=>!!o),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=k.splitPath(e),t=r[0],o=r[1];return!t&&!o?".":(o&&(o=o.slice(0,-1)),t+o)},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>k.normalize(e.join("/")),join2:(e,r)=>k.normalize(e+"/"+r)},Ye=()=>e=>(crypto.getRandomValues(e),0),Se=e=>(Se=Ye())(e),J={resolve:(...e)=>{for(var r="",t=!1,o=e.length-1;o>=-1&&!t;o--){var a=o>=0?e[o]:n.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";r=a+"/"+r,t=k.isAbs(a)}return r=k.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=J.resolve(e).slice(1),r=J.resolve(r).slice(1);function t(E){for(var F=0;F<E.length&&E[F]==="";F++);for(var b=E.length-1;b>=0&&E[b]==="";b--);return F>b?[]:E.slice(F,b-F+1)}for(var o=t(e.split("/")),a=t(r.split("/")),i=Math.min(o.length,a.length),l=i,c=0;c<i;c++)if(o[c]!==a[c]){l=c;break}for(var f=[],c=l;c<o.length;c++)f.push("..");return f=f.concat(a.slice(l)),f.join("/")}},be=new TextDecoder,Ne=(e,r,t,o)=>{var a=r+t;if(o)return a;for(;e[r]&&!(r>=a);)++r;return r},re=(e,r=0,t,o)=>{var a=Ne(e,r,t,o);return be.decode(e.buffer?e.subarray(r,a):new Uint8Array(e.slice(r,a)))},fe=[],he=e=>{for(var r=0,t=0;t<e.length;++t){var o=e.charCodeAt(t);o<=127?r++:o<=2047?r+=2:o>=55296&&o<=57343?(r+=4,++t):r+=3}return r},Fe=(e,r,t,o)=>{if(!(o>0))return 0;for(var a=t,i=t+o-1,l=0;l<e.length;++l){var c=e.codePointAt(l);if(c<=127){if(t>=i)break;r[t++]=c}else if(c<=2047){if(t+1>=i)break;r[t++]=192|c>>6,r[t++]=128|c&63}else if(c<=65535){if(t+2>=i)break;r[t++]=224|c>>12,r[t++]=128|c>>6&63,r[t++]=128|c&63}else{if(t+3>=i)break;r[t++]=240|c>>18,r[t++]=128|c>>12&63,r[t++]=128|c>>6&63,r[t++]=128|c&63,l++}}return r[t]=0,t-a},ve=(e,r,t)=>{var o=he(e)+1,a=new Array(o),i=Fe(e,a,0,a.length);return a.length=i,a},qe=()=>{if(!fe.length){var e=null;if(v){var r=256,t=Buffer.alloc(r),o=0;try{o=N.readSync(process.stdin.fd,t,0,r)}catch(a){if(a.toString().includes("EOF"))o=0;else throw a}o>0&&(e=t.toString("utf-8",0,o))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
| 2 |
-
`));if(!e)return null;fe=ve(e)}return fe.shift()},K={ttys:[],init(){},shutdown(){},register(e,r){K.ttys[e]={input:[],output:[],ops:r},n.registerDevice(e,K.stream_ops)},stream_ops:{open(e){var r=K.ttys[e.node.rdev];if(!r)throw new n.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,o,a){if(!e.tty||!e.tty.ops.get_char)throw new n.ErrnoError(60);for(var i=0,l=0;l<o;l++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new n.ErrnoError(29)}if(c===void 0&&!i)throw new n.ErrnoError(6);if(c==null||(i++,r[t+l]=c,c===10))break}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){if(!e.tty||!e.tty.ops.put_char)throw new n.ErrnoError(60);try{for(var i=0;i<o;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch{throw new n.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}},default_tty_ops:{get_char(e){return qe()},put_char(e,r){r===null||r===10?($(re(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&($(re(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(H(re(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(H(re(e.output)),e.output=[])}}},me=e=>{W()},w={ops_table:null,mount(e){return w.createNode(null,"/",16895,0)},createNode(e,r,t,o){if(n.isBlkdev(t)||n.isFIFO(t))throw new n.ErrnoError(63);w.ops_table||={dir:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr,lookup:w.node_ops.lookup,mknod:w.node_ops.mknod,rename:w.node_ops.rename,unlink:w.node_ops.unlink,rmdir:w.node_ops.rmdir,readdir:w.node_ops.readdir,symlink:w.node_ops.symlink},stream:{llseek:w.stream_ops.llseek}},file:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr},stream:{llseek:w.stream_ops.llseek,read:w.stream_ops.read,write:w.stream_ops.write,mmap:w.stream_ops.mmap,msync:w.stream_ops.msync}},link:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr,readlink:w.node_ops.readlink},stream:{}},chrdev:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr},stream:n.chrdev_stream_ops}};var a=n.createNode(e,r,t,o);return n.isDir(a.mode)?(a.node_ops=w.ops_table.dir.node,a.stream_ops=w.ops_table.dir.stream,a.contents={}):n.isFile(a.mode)?(a.node_ops=w.ops_table.file.node,a.stream_ops=w.ops_table.file.stream,a.usedBytes=0,a.contents=w.emptyFileContents??=new Uint8Array(0)):n.isLink(a.mode)?(a.node_ops=w.ops_table.link.node,a.stream_ops=w.ops_table.link.stream):n.isChrdev(a.mode)&&(a.node_ops=w.ops_table.chrdev.node,a.stream_ops=w.ops_table.chrdev.stream),a.atime=a.mtime=a.ctime=Date.now(),e&&(e.contents[r]=a,e.atime=e.mtime=e.ctime=a.atime),a},getFileDataAsTypedArray(e){return e.contents.subarray(0,e.usedBytes)},expandFileStorage(e,r){var t=e.contents.length;if(!(t>=r)){var o=1024*1024;r=Math.max(r,t*(t<o?2:1.125)>>>0),t&&(r=Math.max(r,256));var a=w.getFileDataAsTypedArray(e);e.contents=new Uint8Array(r),e.contents.set(a)}},resizeFileStorage(e,r){if(e.usedBytes!=r){var t=e.contents;e.contents=new Uint8Array(r),e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=n.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,n.isDir(e.mode)?r.size=4096:n.isFile(e.mode)?r.size=e.usedBytes:n.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.atimeMs=e.atime,r.mtimeMs=e.mtime,r.ctimeMs=e.ctime,r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&w.resizeFileStorage(e,r.size)},lookup(e,r){throw w.doesNotExistError||(w.doesNotExistError=new n.ErrnoError(44),w.doesNotExistError.stack="<generic error, no stack>"),w.doesNotExistError},mknod(e,r,t,o){return w.createNode(e,r,t,o)},rename(e,r,t){var o;try{o=n.lookupNode(r,t)}catch{}if(o&&n.isDir(e.mode))for(var a in o.contents)throw new n.ErrnoError(55);delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=n.lookupNode(e,r);for(var o in t.contents)throw new n.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var o=w.createNode(e,r,41471,0);return o.link=t,o},readlink(e){if(!n.isLink(e.mode))throw new n.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,o,a){var i=e.node.contents;if(a>=e.node.usedBytes)return 0;var l=Math.min(e.node.usedBytes-a,o);return r.set(i.subarray(a,a+l),t),l},write(e,r,t,o,a,i){if(r.buffer===I.buffer&&(i=!1),!o)return 0;var l=e.node;return l.mtime=l.ctime=Date.now(),i?(l.contents=r.subarray(t,t+o),l.usedBytes=o):!l.usedBytes&&!a?(l.contents=r.slice(t,t+o),l.usedBytes=o):(w.expandFileStorage(l,a+o),l.contents.set(r.subarray(t,t+o),a),l.usedBytes=Math.max(l.usedBytes,a+o)),o},llseek(e,r,t){var o=r;if(t===1?o+=e.position:t===2&&n.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new n.ErrnoError(28);return o},mmap(e,r,t,o,a){if(!n.isFile(e.node.mode))throw new n.ErrnoError(43);var i,l,c=e.node.contents;if(!(a&2)&&c.buffer===I.buffer)l=!1,i=c.byteOffset;else{if(l=!0,i=me(),!i)throw new n.ErrnoError(48);c&&((t>0||t+r<c.length)&&(c.subarray?c=c.subarray(t,t+r):c=Array.prototype.slice.call(c,t,t+r)),I.set(c,i))}return{ptr:i,allocated:l}},msync(e,r,t,o,a){return w.stream_ops.write(e,r,0,o,t,!1),0}}},Qe=e=>{if(typeof e!="string")return e;var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},Pe=e=>(typeof e=="string"&&(e=ve(e)),e.subarray||(e=new Uint8Array(e)),e),Ee=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Je={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},p={isWindows:!1,staticInit(){p.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants").fs;p.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,256:e.O_NOCTTY,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY,131072:e.O_NOFOLLOW}},convertNodeCode(e){var r=e.code;return Je[r]},tryFSOperation(e){try{return e()}catch(r){throw r.code?r.code==="UNKNOWN"?new n.ErrnoError(28):new n.ErrnoError(p.convertNodeCode(r)):r}},mount(e){return p.createNode(null,"/",p.getMode(e.opts.root),0)},createNode(e,r,t,o){if(!n.isDir(t)&&!n.isFile(t)&&!n.isLink(t))throw new n.ErrnoError(28);var a=n.createNode(e,r,t);return a.node_ops=p.node_ops,a.stream_ops=p.stream_ops,a},getMode(e){return p.tryFSOperation(()=>{var r=N.lstatSync(e).mode;return p.isWindows&&(r|=(r&292)>>2),r})},realPath(e){for(var r=[];e.parent!==e;)r.push(e.name),e=e.parent;return r.push(e.mount.opts.root),r.reverse(),k.join(...r)},flagsForNode(e){e&=-2097153,e&=-2049,e&=-32769,e&=-524289,e&=-65537;var r=0;for(var t in p.flagsForNodeMap)e&t&&(r|=p.flagsForNodeMap[t],e^=t);if(e)throw new n.ErrnoError(28);return r},doGetAttr(e,r){var t=p.tryFSOperation(e);return p.isWindows&&(t.blksize||(t.blksize=4096),t.blocks||(t.blocks=(t.size+t.blksize-1)/t.blksize|0),t.mode|=(t.mode&292)>>2),{dev:t.dev,ino:r.id,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,atimeMs:t.atimeMs,mtimeMs:t.mtimeMs,ctimeMs:t.ctimeMs,blksize:t.blksize,blocks:t.blocks}},doSetAttr(e,r,t,o,a,i,l){p.tryFSOperation(()=>{if(t.mode!==void 0){var c=t.mode;p.isWindows&&(c&=384),o(e,c),r.mode=t.mode}if(typeof(t.atime??t.mtime)=="number"){var f=t.atime,E=t.mtime;if(f==null||E==null){var F=l(e);f??=F.atimeMs,E??=F.mtimeMs}a(e,f/1e3,E/1e3)}t.size!==void 0&&i(e,t.size)})},node_ops:{getattr(e){var r=p.realPath(e);return p.doGetAttr(()=>N.lstatSync(r),e)},setattr(e,r){var t=p.realPath(e);if(r.mode!=null&&r.dontFollow)throw new n.ErrnoError(52);var o=r.dontFollow?N.lutimesSync:N.utimesSync;p.doSetAttr(t,e,r,N.chmodSync,o,N.truncateSync,N.lstatSync)},lookup(e,r){var t=k.join2(p.realPath(e),r),o=p.getMode(t);return p.createNode(e,r,o)},mknod(e,r,t,o){var a=p.createNode(e,r,t,o),i=p.realPath(a);return p.tryFSOperation(()=>{n.isDir(a.mode)?N.mkdirSync(i,a.mode):N.writeFileSync(i,"",{mode:a.mode})}),a},rename(e,r,t){var o=p.realPath(e),a=k.join2(p.realPath(r),t);p.tryFSOperation(()=>N.renameSync(o,a)),e.name=t},unlink(e,r){var t=k.join2(p.realPath(e),r);p.tryFSOperation(()=>N.unlinkSync(t))},rmdir(e,r){var t=k.join2(p.realPath(e),r);p.tryFSOperation(()=>N.rmdirSync(t))},readdir(e){var r=p.realPath(e);return p.tryFSOperation(()=>N.readdirSync(r))},symlink(e,r,t){var o=k.join2(p.realPath(e),r);p.tryFSOperation(()=>N.symlinkSync(t,o))},readlink(e){var r=p.realPath(e);return p.tryFSOperation(()=>N.readlinkSync(r))},statfs(e){var r=p.tryFSOperation(()=>N.statfsSync(e));return r.frsize=r.bsize,r}},stream_ops:{getattr(e){return p.doGetAttr(()=>N.fstatSync(e.nfd),e.node)},setattr(e,r){p.doSetAttr(e.nfd,e.node,r,N.fchmodSync,N.futimesSync,N.ftruncateSync,N.fstatSync)},open(e){var r=p.realPath(e.node);p.tryFSOperation(()=>{e.shared.refcount=1,e.nfd=N.openSync(r,p.flagsForNode(e.flags))})},close(e){p.tryFSOperation(()=>{e.nfd&&!--e.shared.refcount&&N.closeSync(e.nfd)})},dup(e){e.shared.refcount++},read(e,r,t,o,a){return p.tryFSOperation(()=>N.readSync(e.nfd,r,t,o,a))},write(e,r,t,o,a){return p.tryFSOperation(()=>N.writeSync(e.nfd,r,t,o,a))},llseek(e,r,t){var o=r;if(t===1?o+=e.position:t===2&&n.isFile(e.node.mode)&&p.tryFSOperation(()=>{var a=N.fstatSync(e.nfd);o+=a.size}),o<0)throw new n.ErrnoError(28);return o},mmap(e,r,t,o,a){if(!n.isFile(e.node.mode))throw new n.ErrnoError(43);var i=me();return p.stream_ops.read(e,I,i,r,t),{ptr:i,allocated:!0}},msync(e,r,t,o,a){return p.stream_ops.write(e,r,0,o,t),0}}},Ze=async e=>{var r=await B(e);return new Uint8Array(r)},Te=(...e)=>n.createDataFile(...e),De=null,er=async()=>De,te=0,Oe=null,Ae=e=>{te--,te||Oe()},Me=e=>{te||(De=new Promise(r=>Oe=r)),te++},rr=[],tr=async(e,r)=>{typeof Browser<"u"&&Browser.init();for(var t of rr)if(t.canHandle(r))return t.handle(e,r);return e},pe=async(e,r,t,o,a,i,l,c)=>{var f=r?J.resolve(k.join2(e,r)):e;Me();try{var E=t;typeof t=="string"&&(E=await Ze(t)),E=await tr(E,f),c?.(),i||Te(e,r,E,o,a,l)}finally{Ae()}},nr=(e,r,t,o,a,i,l,c,f,E)=>{pe(e,r,t,o,a,c,f,E).then(i).catch(l)},n={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:[],currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,o){e||(e=this),this.parent=e,this.mount=e.mount,this.id=n.nextInode++,this.name=r,this.mode=t,this.rdev=o,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return n.isDir(this.mode)}get isDevice(){return n.isChrdev(this.mode)}addListener(e,r=!1){var t={cb:e,exclusive:r},o=this.listeners??=new Set;return o.add(t),{listeners:o,entry:t}}notifyListeners(e){if(this.listeners){var r;for(var t of this.listeners)t.exclusive?(r||=[]).push(t):t.cb(e);if(r){var o=(this.exclTurn||0)%r.length;this.exclTurn=o+1,r[o].cb(e)}}}},lookupPath(e,r={}){if(!e)throw new n.ErrnoError(44);r.follow_mount??=!0,k.isAbs(e)||(e=n.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var o=e.split("/").filter(E=>!!E),a=n.root,i="/",l=0;l<o.length;l++){var c=l===o.length-1;if(c&&r.parent)break;if(o[l]!=="."){if(o[l]===".."){if(i=k.dirname(i),n.isRoot(a)){e=i+"/"+o.slice(l+1).join("/"),t--;continue e}else a=a.parent;continue}i=k.join2(i,o[l]);try{a=n.lookupNode(a,o[l])}catch(E){if(E?.errno===44&&c&&r.noent_okay)return{path:i};throw E}if(n.isMountpoint(a)&&(!c||r.follow_mount)&&(a=a.mounted.root),n.isLink(a.mode)&&(!c||r.follow)){if(!a.node_ops.readlink)throw new n.ErrnoError(52);var f=a.node_ops.readlink(a);k.isAbs(f)||(f=k.dirname(i)+"/"+f),e=f+"/"+o.slice(l+1).join("/");continue e}}}return{path:i,node:a}}throw new n.ErrnoError(32)},getPath(e){for(var r;;){if(n.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,o=0;o<r.length;o++)t=(t<<5)-t+r.charCodeAt(o)|0;return(e+t>>>0)%n.nameTable.length},hashAddNode(e){var r=n.hashName(e.parent.id,e.name);e.name_next=n.nameTable[r],n.nameTable[r]=e},hashRemoveNode(e){var r=n.hashName(e.parent.id,e.name);if(n.nameTable[r]===e)n.nameTable[r]=e.name_next;else for(var t=n.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=n.mayLookup(e);if(t)throw new n.ErrnoError(t);for(var o=n.hashName(e.id,r),a=n.nameTable[o];a;a=a.name_next){var i=a.name;if(a.parent.id===e.id&&i===r)return a}return n.lookup(e,r)},createNode(e,r,t,o){var a=new n.FSNode(e,r,t,o);return n.hashAddNode(a),a},destroyNode(e){n.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return n.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!n.isDir(e.mode))return 54;var r=n.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!n.isDir(e.mode))return 54;try{var t=n.lookupNode(e,r);return 20}catch{}return n.nodePermissions(e,"wx")},mayDelete(e,r,t){var o;try{o=n.lookupNode(e,r)}catch(i){return i.errno}var a=n.nodePermissions(e,"wx");if(a)return a;if(t){if(!n.isDir(o.mode))return 54;if(n.isRoot(o)||n.getPath(o)===n.cwd())return 10}else if(n.isDir(o.mode))return 31;return 0},mayOpen(e,r){if(!e)return 44;if(n.isLink(e.mode))return 32;var t=n.flagsToPermissionString(r);return n.isDir(e.mode)&&(t!=="r"||r&576)?31:n.nodePermissions(e,t)},checkOpExists(e,r){if(!e)throw new n.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=n.MAX_OPEN_FDS;e++)if(!n.streams[e])return e;throw new n.ErrnoError(33)},getStreamChecked(e){var r=n.getStream(e);if(!r)throw new n.ErrnoError(8);return r},getStream:e=>n.streams[e],createStream(e,r=-1){return e=Object.assign(new n.FSStream,e),r==-1&&(r=n.nextfd()),e.fd=r,n.streams[r]=e,e},closeStream(e){n.streams[e]=null},dupStream(e,r=-1){var t=n.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var o=e?.stream_ops.setattr,a=o?e:r;o??=r.node_ops.setattr,n.checkOpExists(o,63);try{o(a,t)}catch(i){throw i instanceof RangeError?new n.ErrnoError(22):i}},chrdev_stream_ops:{open(e){var r=n.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new n.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){n.devices[e]={stream_ops:r}},getDevice:e=>n.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var o=t.pop();r.push(o),t.push(...o.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),n.syncFSRequests++,n.syncFSRequests>1&&H(`warning: ${n.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=n.getMounts(n.root.mount),o=0;function a(c){return n.syncFSRequests--,r(c)}function i(c){if(c)return i.errored?void 0:(i.errored=!0,a(c));++o>=t.length&&a(null)}for(var l of t)l.type.syncfs?l.type.syncfs(l,e,i):i(null)},mount(e,r,t){var o=t==="/",a=!t,i;if(o&&n.root)throw new n.ErrnoError(10);if(!o&&!a){var l=n.lookupPath(t,{follow_mount:!1});if(t=l.path,i=l.node,n.isMountpoint(i))throw new n.ErrnoError(10);if(!n.isDir(i.mode))throw new n.ErrnoError(54)}var c={type:e,opts:r,mountpoint:t,mounts:[]},f=e.mount(c);return f.mount=c,c.root=f,o?n.root=f:i&&(i.mounted=c,i.mount&&i.mount.mounts.push(c)),f},unmount(e){var r=n.lookupPath(e,{follow_mount:!1});if(!n.isMountpoint(r.node))throw new n.ErrnoError(28);var t=r.node,o=t.mounted,a=n.getMounts(o);for(var[i,l]of Object.entries(n.nameTable))for(;l;){var c=l.name_next;a.includes(l.mount)&&n.destroyNode(l),l=c}t.mounted=null;var f=t.mount.mounts.indexOf(o);t.mount.mounts.splice(f,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var o=n.lookupPath(e,{parent:!0}),a=o.node,i=k.basename(e);if(!i)throw new n.ErrnoError(28);if(i==="."||i==="..")throw new n.ErrnoError(20);var l=n.mayCreate(a,i);if(l)throw new n.ErrnoError(l);if(!a.node_ops.mknod)throw new n.ErrnoError(63);return a.node_ops.mknod(a,i,r,t)},statfs(e){return n.statfsNode(n.lookupPath(e,{follow:!0}).node)},statfsStream(e){return n.statfsNode(e.node)},statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:n.nextInode,ffree:n.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,n.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,n.mknod(e,r,0)},mkdirTree(e,r=511){var t=e.split("/"),o="";for(var a of t)if(a){(o||k.isAbs(e))&&(o+="/"),o+=a;try{n.mkdir(o,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,n.mknod(e,r,t)},symlink(e,r){if(!J.resolve(e))throw new n.ErrnoError(44);var t=n.lookupPath(r,{parent:!0}),o=t.node;if(!o)throw new n.ErrnoError(44);var a=k.basename(r),i=n.mayCreate(o,a);if(i)throw new n.ErrnoError(i);if(!o.node_ops.symlink)throw new n.ErrnoError(63);return o.node_ops.symlink(o,a,e)},link(e,r,t){var o=n.lookupPath(r,{parent:!0}),a=o.node;if(!a)throw new n.ErrnoError(44);var i=k.basename(r),l=n.mayCreate(a,i);if(l)throw new n.ErrnoError(l);if(!a.node_ops.link)throw new n.ErrnoError(34);return a.node_ops.link(a,i,e,t)},rename(e,r){var t=k.dirname(e),o=k.dirname(r),a=k.basename(e),i=k.basename(r),l,c,f;if(l=n.lookupPath(e,{parent:!0}),c=l.node,l=n.lookupPath(r,{parent:!0}),f=l.node,!c||!f)throw new n.ErrnoError(44);if(c.mount!==f.mount)throw new n.ErrnoError(75);var E=n.lookupNode(c,a),F=J.relative(e,o);if(F.charAt(0)!==".")throw new n.ErrnoError(28);if(F=J.relative(r,t),F.charAt(0)!==".")throw new n.ErrnoError(55);var b;try{b=n.lookupNode(f,i)}catch{}if(E!==b){var y=n.isDir(E.mode),g=n.mayDelete(c,a,y);if(g)throw new n.ErrnoError(g);if(g=b?n.mayDelete(f,i,y):n.mayCreate(f,i),g)throw new n.ErrnoError(g);if(!c.node_ops.rename)throw new n.ErrnoError(63);if(n.isMountpoint(E)||b&&n.isMountpoint(b))throw new n.ErrnoError(10);if(f!==c&&(g=n.nodePermissions(c,"w"),g))throw new n.ErrnoError(g);n.hashRemoveNode(E);try{c.node_ops.rename(E,f,i),b&&n.hashRemoveNode(b),E.parent=f}catch(T){throw T}finally{n.hashAddNode(E)}}},rmdir(e){var r=n.lookupPath(e,{parent:!0}),t=r.node,o=k.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!0);if(i)throw new n.ErrnoError(i);if(!t.node_ops.rmdir)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.rmdir(t,o),n.destroyNode(a)},readdir(e){var r=n.lookupPath(e,{follow:!0}),t=r.node,o=n.checkOpExists(t.node_ops.readdir,54);return o(t)},unlink(e){var r=n.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new n.ErrnoError(44);var o=k.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!1);if(i)throw new n.ErrnoError(i);if(!t.node_ops.unlink)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.unlink(t,o),n.destroyNode(a)},readlink(e){var r=n.lookupPath(e),t=r.node;if(!t)throw new n.ErrnoError(44);if(!t.node_ops.readlink)throw new n.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r=!1){var t=n.lookupPath(e,{follow:!r}),o=t.node,a=n.checkOpExists(o.node_ops.getattr,63);return a(o)},fstat(e){var r=n.getStreamChecked(e),t=r.node,o=r.stream_ops.getattr,a=o?r:t;return o??=t.node_ops.getattr,n.checkOpExists(o,63),o(a)},lstat(e){return n.stat(e,!0)},doChmod(e,r,t,o=!1){n.doSetAttr(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),dontFollow:o})},chmod(e,r,t=!1){var o;if(typeof e=="string"){var a=n.lookupPath(e,{follow:!t});o=a.node}else o=e;n.doChmod(null,o,r,t)},lchmod(e,r){n.chmod(e,r,!0)},fchmod(e,r){var t=n.getStreamChecked(e);n.doChmod(t,t.node,r,!1)},doChown(e,r,t=!1){n.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,o=!1){var a;if(typeof e=="string"){var i=n.lookupPath(e,{follow:!o});a=i.node}else a=e;n.doChown(null,a,o)},lchown(e,r,t){n.chown(e,r,t,!0)},fchown(e,r,t){var o=n.getStreamChecked(e);n.doChown(o,o.node,!1)},doTruncate(e,r,t){if(n.isDir(r.mode))throw new n.ErrnoError(31);if(!n.isFile(r.mode))throw new n.ErrnoError(28);var o=n.nodePermissions(r,"w");if(o)throw new n.ErrnoError(o);n.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new n.ErrnoError(28);var t;if(typeof e=="string"){var o=n.lookupPath(e,{follow:!0});t=o.node}else t=e;n.doTruncate(null,t,r)},ftruncate(e,r){var t=n.getStreamChecked(e);if(r<0||(t.flags&2097155)===0)throw new n.ErrnoError(28);n.doTruncate(t,t.node,r)},utime(e,r,t,o=!1){var a=n.lookupPath(e,{follow:!o});n.doSetAttr(null,a.node,{atime:r,mtime:t,dontFollow:o})},open(e,r,t=438){if(e==="")throw new n.ErrnoError(44);r=Qe(r),r&64?t=t&4095|32768:t=0;var o,a;if(typeof e=="object")o=e;else{a=e.endsWith("/");var i=n.lookupPath(e,{follow:!(r&131072),noent_okay:!0});o=i.node,e=i.path}var l=!1;if(r&64)if(o){if(r&128)throw new n.ErrnoError(20)}else{if(a)throw new n.ErrnoError(31);o=n.mknod(e,t|511,0),l=!0}if(!o)throw new n.ErrnoError(44);if(n.isChrdev(o.mode)&&(r&=-513),r&65536&&!n.isDir(o.mode))throw new n.ErrnoError(54);if(!l){var c=n.mayOpen(o,r);if(c)throw new n.ErrnoError(c)}r&512&&!l&&n.truncate(o,0),r&=-131713;var f=n.createStream({node:o,path:n.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return f.stream_ops.open&&f.stream_ops.open(f),l&&n.chmod(o,t&511),f},close(e){if(n.isClosed(e))throw new n.ErrnoError(8);e.getdents&&(e.getdents=null),e.node?.notifyListeners(32);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{n.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new n.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new n.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,o,a){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===1)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.read)throw new n.ErrnoError(28);var i=typeof a<"u";if(!i)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var l=e.stream_ops.read(e,r,t,o,a);return i||(e.position+=l),l},write(e,r,t,o,a,i){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===0)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.write)throw new n.ErrnoError(28);e.seekable&&e.flags&1024&&n.llseek(e,0,2);var l=typeof a<"u";if(!l)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var c=e.stream_ops.write(e,r,t,o,a,i);return l||(e.position+=c),c},mmap(e,r,t,o,a){if(o&2&&!(a&2)&&(e.flags&2097155)!==2)throw new n.ErrnoError(2);if((e.flags&2097155)===1)throw new n.ErrnoError(2);if(!e.stream_ops.mmap)throw new n.ErrnoError(43);if(!r)throw new n.ErrnoError(28);return e.stream_ops.mmap(e,r,t,o,a)},msync(e,r,t,o,a){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,o,a):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new n.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){r.flags??=0,r.encoding??="binary",r.encoding!=="utf8"&&r.encoding!=="binary"&&W(`Invalid encoding type "${r.encoding}"`);var t=n.open(e,r.flags),o=n.stat(e),a=o.size,i=new Uint8Array(a);return n.read(t,i,0,a,0),r.encoding==="utf8"&&(i=re(i)),n.close(t),i},writeFile(e,r,t={}){t.flags??=577;var o=n.open(e,t.flags,t.mode);r=Pe(r),n.write(o,r,0,r.byteLength,void 0,t.canOwn),n.close(o)},cwd:()=>n.currentPath,chdir(e){var r=n.lookupPath(e,{follow:!0});if(r.node===null)throw new n.ErrnoError(44);if(!n.isDir(r.node.mode))throw new n.ErrnoError(54);var t=n.nodePermissions(r.node,"x");if(t)throw new n.ErrnoError(t);n.currentPath=r.path},createDefaultDirectories(){n.mkdir("/tmp"),n.mkdir("/home"),n.mkdir("/home/web_user")},createDefaultDevices(){n.mkdir("/dev"),n.registerDevice(n.makedev(1,3),{read:()=>0,write:(o,a,i,l,c)=>l,llseek:()=>0}),n.mkdev("/dev/null",n.makedev(1,3)),K.register(n.makedev(5,0),K.default_tty_ops),K.register(n.makedev(6,0),K.default_tty1_ops),n.mkdev("/dev/tty",n.makedev(5,0)),n.mkdev("/dev/tty1",n.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r||(Se(e),r=e.byteLength),e[--r]);n.createDevice("/dev","random",t),n.createDevice("/dev","urandom",t),n.mkdir("/dev/shm"),n.mkdir("/dev/shm/tmp")},createSpecialDirectories(){n.mkdir("/proc");var e=n.mkdir("/proc/self");n.mkdir("/proc/self/fd"),n.mount({mount(){var r=n.createNode(e,"fd",16895,73);return r.stream_ops={llseek:w.stream_ops.llseek},r.node_ops={lookup(t,o){var a=+o,i=n.getStreamChecked(a),l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path},id:a+1};return l.parent=l,l},readdir(){return Array.from(n.streams.entries()).filter(([t,o])=>o).map(([t,o])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?n.createDevice("/dev","stdin",e):n.symlink("/dev/tty","/dev/stdin"),r?n.createDevice("/dev","stdout",null,r):n.symlink("/dev/tty","/dev/stdout"),t?n.createDevice("/dev","stderr",null,t):n.symlink("/dev/tty1","/dev/stderr"),n.open("/dev/stdin",0),n.open("/dev/stdout",1),n.open("/dev/stderr",1)},staticInit(){n.nameTable.length=4096,n.mount(w,{},"/"),n.createDefaultDirectories(),n.createDefaultDevices(),n.createSpecialDirectories(),n.filesystems={MEMFS:w,NODEFS:p}},init(e,r,t){n.initialized=!0,n.createStandardStreams(e,r,t)},quit(){n.initialized=!1;for(var e of n.streams)e&&n.close(e)},analyzePath(e,r=!1){try{var t=n.lookupPath(e,{follow:!r});e=t.path}catch{}var o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=n.lookupPath(e,{parent:!0});o.parentExists=!0,o.parentPath=t.path,o.parentObject=t.node,o.name=k.basename(e),t=n.lookupPath(e,{follow:!r}),o.exists=!0,o.path=t.path,o.object=t.node,o.name=t.node.name,o.isRoot=t.path==="/"}catch(a){o.error=a.errno}return o},createPath(e,r,t,o){e=typeof e=="string"?e:n.getPath(e);for(var a=r.split("/").reverse();a.length;){var i=a.pop();if(i){var l=k.join2(e,i);try{n.mkdir(l)}catch(c){if(c.errno!=20)throw c}e=l}}return l},createFile(e,r,t,o,a){var i=k.join2(typeof e=="string"?e:n.getPath(e),r),l=Ee(o,a);return n.create(i,l)},createDataFile(e,r,t,o,a,i){var l=r;e&&(e=typeof e=="string"?e:n.getPath(e),l=r?k.join2(e,r):e);var c=Ee(o,a),f=n.create(l,c);if(t){t=Pe(t),n.chmod(f,c|146);var E=n.open(f,577);n.write(E,t,0,t.length,0,i),n.close(E),n.chmod(f,c)}},createDevice(e,r,t,o){var a=k.join2(typeof e=="string"?e:n.getPath(e),r),i=Ee(!!t,!!o);n.createDevice.major??=64;var l=n.makedev(n.createDevice.major++,0);return n.registerDevice(l,{open(c){c.seekable=!1},close(c){o?.buffer?.length&&o(10)},read(c,f,E,F,b){for(var y=0,g=0;g<F;g++){var T;try{T=t()}catch{throw new n.ErrnoError(29)}if(T===void 0&&!y)throw new n.ErrnoError(6);if(T==null)break;y++,f[E+g]=T}return y&&(c.node.atime=Date.now()),y},write(c,f,E,F,b){for(var y=0;y<F;y++)try{o(f[E+y])}catch{throw new n.ErrnoError(29)}return F&&(c.node.mtime=c.node.ctime=Date.now()),y}}),n.mkdev(a,i,l)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(globalThis.XMLHttpRequest)W("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{e.contents=C(e.url)}catch{throw new n.ErrnoError(29)}},createLazyFile(e,r,t,o,a){class i{lengthKnown=!1;chunks=[];get(y){if(!(y>this.length-1||y<0)){var g=y%this.chunkSize,T=y/this.chunkSize|0;return this.getter(T)[g]}}setDataGetter(y){this.getter=y}cacheLength(){var y=new XMLHttpRequest;y.open("HEAD",t,!1),y.send(null),y.status>=200&&y.status<300||y.status===304||W(`Couldn't load ${t}. Status: ${y.status}`);var g=Number(y.getResponseHeader("Content-length")),T,A=(T=y.getResponseHeader("Accept-Ranges"))&&T==="bytes",j=(T=y.getResponseHeader("Content-Encoding"))&&T==="gzip",V=1024*1024;A||(V=g);var G=(X,Z)=>{X>Z&&W(`invalid range (${X}, ${Z}) or no bytes requested!`),Z>g-1&&W(`only ${g} bytes available! programmer error!`);var M=new XMLHttpRequest;return M.open("GET",t,!1),g!==V&&M.setRequestHeader("Range",`bytes=${X}-${Z}`),M.responseType="arraybuffer",M.overrideMimeType&&M.overrideMimeType("text/plain; charset=x-user-defined"),M.send(null),M.status>=200&&M.status<300||M.status===304||W(`Couldn't load ${t}. Status: ${M.status}`),M.response!==void 0?new Uint8Array(M.response||[]):ve(M.responseText??"")},ie=this;ie.setDataGetter(X=>{var Z=X*V,M=(X+1)*V-1;return M=Math.min(M,g-1),typeof ie.chunks[X]>"u"&&(ie.chunks[X]=G(Z,M)),typeof ie.chunks[X]>"u"&&W("doXHR failed!"),ie.chunks[X]}),(j||!g)&&(V=g=1,g=this.getter(0).length,V=g,$("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=g,this._chunkSize=V,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){h||W("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var l=new i,c={isDevice:!1,contents:l}}else var c={isDevice:!1,url:t};var f=n.createFile(e,r,c,o,a);c.contents?f.contents=c.contents:c.url&&(f.contents=null,f.url=c.url),Object.defineProperties(f,{usedBytes:{get:function(){return this.contents.length}}});var E={};for(const[b,y]of Object.entries(f.stream_ops))E[b]=(...g)=>(n.forceLoadFile(f),y(...g));function F(b,y,g,T,A){var j=b.node.contents;if(A>=j.length)return 0;var V=Math.min(j.length-A,T);if(j.slice)for(var G=0;G<V;G++)y[g+G]=j[A+G];else for(var G=0;G<V;G++)y[g+G]=j.get(A+G);return V}return E.read=(b,y,g,T,A)=>(n.forceLoadFile(f),F(b,y,g,T,A)),E.mmap=(b,y,g,T,A)=>{n.forceLoadFile(f);var j=me();if(!j)throw new n.ErrnoError(48);return F(b,I,j,y,g),{ptr:j,allocated:!0}},f.stream_ops=E,f}},Y,Re=(e,r,t)=>{if(!e)return"";var o=Ne(Y,e,r,t);return be.decode(Y.subarray(e,o))},P,R,O={currentUmask:18,calculateAt(e,r,t=!1){if(k.isAbs(r))return r;var o;if(e===-100)o=n.cwd();else{var a=O.getStreamFromFD(e);o=a.path}if(r.length==0){if(!t)throw new n.ErrnoError(44);return o}return o+"/"+r},writeStat(e,r){P[e>>2]=r.dev,P[e+4>>2]=r.mode,P[e+8>>2]=r.nlink,P[e+12>>2]=r.uid,P[e+16>>2]=r.gid,P[e+20>>2]=r.rdev,R[e+24>>3]=BigInt(r.size),U[e+32>>2]=4096,U[e+36>>2]=r.blocks;var t=r.atimeMs??r.atime.getTime(),o=r.mtimeMs??r.mtime.getTime(),a=r.ctimeMs??r.ctime.getTime();return R[e+40>>3]=BigInt(Math.floor(t/1e3)),P[e+48>>2]=Math.floor(t%1e3*1e6),R[e+56>>3]=BigInt(Math.floor(o/1e3)),P[e+64>>2]=Math.floor(o%1e3*1e6),R[e+72>>3]=BigInt(Math.floor(a/1e3)),P[e+80>>2]=Math.floor(a%1e3*1e6),R[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){P[e+4>>2]=r.bsize,P[e+60>>2]=r.bsize,R[e+8>>3]=BigInt(r.blocks),R[e+16>>3]=BigInt(r.bfree),R[e+24>>3]=BigInt(r.bavail),R[e+32>>3]=BigInt(r.files),R[e+40>>3]=BigInt(r.ffree),P[e+48>>2]=r.fsid,P[e+64>>2]=r.flags,P[e+56>>2]=r.namelen},doMsync(e,r,t,o,a){if(!n.isFile(r.node.mode))throw new n.ErrnoError(43);if(o&2)return 0;var i=Y.subarray(e,e+t);n.msync(r,i,a,t,o)},getStreamFromFD(e){var r=n.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=Re(e);return r}},ne;function or(e,r,t){O.varargs=t;try{var o=O.getStreamFromFD(e);switch(r){case 0:{var a=le();if(a<0)return-28;for(;n.streams[a];)a++;var i;return i=n.dupStream(o,a),i.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var a=le(),l=289792;return o.flags=o.flags&~l|a&l,0}case 12:{var a=Q(),c=0;return ne[a+c>>1]=2,0}case 13:case 14:return 0}return-28}catch(f){if(typeof n>"u"||f.name!=="ErrnoError")throw f;return-f.errno}}var we=(e,r,t)=>Fe(e,Y,r,t);function ar(e,r,t){try{var o=O.getStreamFromFD(e);o.getdents||=n.readdir(o.path);for(var a=280,i=0,l=n.llseek(o,0,1),c=Math.floor(l/a),f=Math.min(o.getdents.length,c+Math.floor(t/a)),E=c;E<f;E++){var F,b,y=o.getdents[E];if(y===".")F=o.node.id,b=4;else if(y===".."){var g=n.lookupPath(o.path,{parent:!0});F=g.node.id,b=4}else{var T;try{T=n.lookupNode(o.node,y)}catch(A){if(A?.errno===28)continue;throw A}F=T.id,b=n.isChrdev(T.mode)?2:n.isDir(T.mode)?4:n.isLink(T.mode)?10:8}R[r+i>>3]=BigInt(F),R[r+i+8>>3]=BigInt((E+1)*a),ne[r+i+16>>1]=280,I[r+i+18]=b,we(y,r+i+19,256),i+=a}return n.llseek(o,E*a,0),i}catch(A){if(typeof n>"u"||A.name!=="ErrnoError")throw A;return-A.errno}}function ir(e,r,t){O.varargs=t;try{var o=O.getStreamFromFD(e);switch(r){case 21509:return o.tty?0:-59;case 21505:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var a=o.tty.ops.ioctl_tcgets(o),i=Q();U[i>>2]=a.c_iflag||0,U[i+4>>2]=a.c_oflag||0,U[i+8>>2]=a.c_cflag||0,U[i+12>>2]=a.c_lflag||0;for(var l=0;l<32;l++)I[i+l+17]=a.c_cc[l]||0;return 0}return 0}case 21510:case 21511:case 21512:return o.tty?0:-59;case 21506:case 21507:case 21508:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){for(var i=Q(),c=U[i>>2],f=U[i+4>>2],E=U[i+8>>2],F=U[i+12>>2],b=[],l=0;l<32;l++)b.push(I[i+l+17]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:c,c_oflag:f,c_cflag:E,c_lflag:F,c_cc:b})}return 0}case 21519:{if(!o.tty)return-59;var i=Q();return U[i>>2]=0,0}case 21520:return o.tty?-28:-59;case 21537:case 21531:{var i=Q();return n.ioctl(o,r,i)}case 21523:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var y=o.tty.ops.ioctl_tiocgwinsz(o.tty),i=Q();ne[i>>1]=y[0],ne[i+2>>1]=y[1]}return 0}case 21524:return o.tty?0:-59;case 21515:return o.tty?0:-59;default:return-28}}catch(g){if(typeof n>"u"||g.name!=="ErrnoError")throw g;return-g.errno}}function sr(e,r,t,o){O.varargs=o;try{r=O.getStr(r),r=O.calculateAt(e,r);var a=o?le():0;return t&64&&(a&=~O.currentUmask),n.open(r,t,a).fd}catch(i){if(typeof n>"u"||i.name!=="ErrnoError")throw i;return-i.errno}}function lr(e){try{return e=O.getStr(e),n.rmdir(e),0}catch(r){if(typeof n>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function cr(e,r){try{return e=O.getStr(e),O.writeStat(r,n.stat(e))}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function dr(e,r,t){try{if(r=O.getStr(r),r=O.calculateAt(e,r),!t)n.unlink(r);else if(t===512)n.rmdir(r);else return-28;return 0}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var ur=()=>W(""),fr=()=>performance.now(),Le=()=>Date.now(),hr=e=>e>=0&&e<=3,vr=9007199254740992,mr=-9007199254740992,Er=e=>e<mr||e>vr?NaN:Number(e);function pr(e,r,t){if(!hr(e))return 28;var o;e===0?o=Le():o=fr();var a=Math.round(o*1e6);return R[t>>3]=BigInt(a),0}var wr=()=>2147483648,yr=(e,r)=>Math.ceil(e/r)*r,_r=e=>{var r=ce.buffer.byteLength,t=(e-r+65535)/65536|0;try{return ce.grow(t),ke(),1}catch{}},gr=e=>{var r=Y.length;e>>>=0;var t=wr();if(e>t)return!1;for(var o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,yr(Math.max(e,a),65536)),l=_r(i);if(l)return!0}return!1},ye={},kr=()=>_,oe=()=>{if(!oe.strings){var e=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:kr()};for(var t in ye)ye[t]===void 0?delete r[t]:r[t]=ye[t];var o=[];for(var t in r)o.push(`${t}=${r[t]}`);oe.strings=o}return oe.strings},Sr=(e,r)=>{var t=0,o=0;for(var a of oe()){var i=r+t;P[e+o>>2]=i,t+=we(a,i,1/0)+1,o+=4}return 0},br=(e,r)=>{var t=oe();P[e>>2]=t.length;var o=0;for(var a of t)o+=he(a)+1;return P[r>>2]=o,0},Nr=e=>{S(e,new Ke(e))},Fr=(e,r)=>{Nr(e)},Pr=Fr;function Tr(e){try{var r=O.getStreamFromFD(e);return n.close(r),0}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var Dr=(e,r,t,o)=>{for(var a=0,i=0;i<t;i++){var l=P[r>>2],c=P[r+4>>2];r+=8;try{var f=n.read(e,I,l,c,o)}catch(E){if(a>0&&E instanceof n.ErrnoError&&(E.errno==6||E.errno==6))break;throw E}if(f<0)return-1;if(a+=f,f<c)break}return a};function Or(e,r,t,o){try{var a=O.getStreamFromFD(e),i=Dr(a,r,t);return P[o>>2]=i,0}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return l.errno}}function Ar(e,r,t,o){r=Er(r);try{if(isNaN(r))return 22;var a=O.getStreamFromFD(e);return n.llseek(a,r,t),R[o>>3]=BigInt(a.position),a.getdents&&!r&&t===0&&(a.getdents=null),0}catch(i){if(typeof n>"u"||i.name!=="ErrnoError")throw i;return i.errno}}var Mr=(e,r,t,o)=>{if(t==1)return n.write(e,I,P[r>>2],P[r+4>>2],o);for(var a=0,i=0,l=r;i<t;i++,l+=8)a+=P[l+4>>2];for(var c=new Uint8Array(a),f=0,i=0;i<t;i++,r+=8){var E=P[r>>2],F=P[r+4>>2];c.set(Y.subarray(E,E+F),f),f+=F}return n.write(e,c,0,a,o)};function Rr(e,r,t,o){try{var a=O.getStreamFromFD(e),i=Mr(a,r,t);return P[o>>2]=i,0}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var Lr=(...e)=>n.createPath(...e),Cr=(...e)=>n.unlink(...e),Ur=(...e)=>n.createLazyFile(...e),Br=(...e)=>n.createDevice(...e);n.createPreloadedFile=nr,n.preloadFile=pe,n.staticInit(),v&&p.staticInit(),s.print&&($=s.print),s.printErr&&(H=s.printErr),s.wasmBinary&&(x=s.wasmBinary),s.addRunDependency=Me,s.removeRunDependency=Ae,s.UTF8ToString=Re,s.stringToUTF8=we,s.lengthBytesUTF8=he,s.FS_preloadFile=pe,s.FS_unlink=Cr,s.FS_createPath=Lr,s.FS_createDevice=Br,s.FS=n,s.FS_createDataFile=Te,s.FS_createLazyFile=Ur,s.NODEFS=p;var ce;function Ir(e){s._sp_initialize=e.u,s._sp_sample_rate_get=e.v,s._sp_terminate=e.w,s._free=e.x,s._sp_version=e.y,s._sp_synthesize=e.z,s._sp_audio_data=e.A,s._sp_audio_samples=e.B,s._sp_events_data=e.C,s._sp_events_count=e.D,s._sp_event_size=e.E,s._sp_strings_data=e.F,s._sp_text_to_phonemes=e.G,s._sp_voice_count=e.H,s._sp_voice_name=e.I,s._sp_voice_identifier=e.J,s._sp_voice_languages=e.K,s._sp_voice_gender=e.L,s._sp_voice_age=e.M,s._sp_set_voice_by_name=e.N,s._sp_set_voice_by_properties=e.O,s._sp_current_voice_name=e.P,s._sp_current_voice_languages=e.Q,s._sp_dictionary_name=e.R,s._sp_dictionary_loaded=e.S,s._sp_set_parameter=e.T,s._sp_get_parameter=e.U,s._sp_set_punctuation_list=e.V,s._malloc=e.W,ce=e.s,e.__indirect_function_table}var zr={c:or,m:ar,g:ir,d:sr,k:lr,j:cr,l:dr,q:ur,n:pr,h:Le,i:gr,p:Sr,e:br,r:Pr,a:Tr,f:Or,o:Ar,b:Rr};async function $r(){te&&await er(),!q&&$e()}var ae;return ae=await xe(),await $r(),s}let de;function ht(){if(de===void 0)try{const u=Uint8Array.of(0,97,115,109,1,0,0,0);de=new WebAssembly.Module(u)instanceof WebAssembly.Module}catch{de=!1}return de}function vt(u){if(u.dataUrl!==void 0)return String(u.dataUrl);if(u.cdn==="jsdelivr")return xr(Yr);throw new Error("spellophone needs to know where espeak-ng-data is: pass { dataUrl } pointing at a copy of the package's espeak-ng-data directory, or { cdn: 'jsdelivr' } to fetch it from jsDelivr.")}async function mt(u,s,d){const[h,v]=await Promise.all([u,s]),m=new jr(h,v),_=d.languages==="all"?m.availableLanguages():[...new Set(["en",...d.languages??[]])];await Promise.all([m.loadCore(),..._.map(D=>m.loadDictionary(D))]);const S={loader:m};return d.phonemeEvents!==void 0&&(S.phonemeEvents=d.phonemeEvents),ut.create(h,S)}async function Et(u){const s=ct(u.wasmUrl);if(!u.fallback||ht())return ft(s);console.warn("spellophone: WebAssembly is unavailable here, using the slower wasm2js fallback.");const{createWasm2jsModule:d}=await u.fallback();return d(s)}async function pt(u={}){const s=vt(u);return mt(Et(u),Xr(s,u.fetch),u)}let _e;async function yt(u){_e??=pt({dataUrl:"/reader/reader-assets/",languages:["bn","en"]}).catch(v=>{throw _e=null,v});const s=await _e;s.setVoice("bn");const{samples:d,sampleRate:h}=s.synthesize(u);return new Blob([Kr(d,h)],{type:"audio/wav"})}export{yt as bengaliAudio};
|
|
|
|
|
|
|
|
|