mjswan 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as Gn}from"./index-
|
|
1
|
+
import{_ as Gn}from"./index-DE0hoRFc.js";const Yn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var tc=(async function(De={}){var Tr,v=De,Ke=typeof window=="object",Z=typeof WorkerGlobalScope<"u",V=typeof process=="object"&&process.versions?.node&&process.type!="renderer",ct=!Ke&&!V&&!Z,A=Z&&self.name?.startsWith("em-pthread");if(A&&(p(!globalThis.moduleLoaded,"module should only be loaded once on each pthread worker"),globalThis.moduleLoaded=!0),V){const{createRequire:e}=await Gn(async()=>{const{createRequire:r}=await Promise.resolve().then(()=>Yn);return{createRequire:r}},void 0);var ve=e(import.meta.url),Xe=ve("worker_threads");global.Worker=Xe.Worker,Z=!Xe.isMainThread,A=Z&&Xe.workerData=="em-pthread"}var Fr="./this.program",Pr=(e,r)=>{throw r},Ar=import.meta.url,Je="";function Kn(e){return v.locateFile?v.locateFile(e,Je):Je+e}var Ze,Oe;if(V){if(!(typeof process=="object"&&process.versions?.node&&process.type!="renderer"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var lt=process.versions.node,Ie=lt.split(".").slice(0,3);if(Ie=Ie[0]*1e4+Ie[1]*100+Ie[2].split("-")[0]*1,Ie<160400)throw new Error("This emscripten-generated code requires node v16.04.4.0 (detected v"+lt+")");var Me=ve("fs");Ar.startsWith("file:")&&(Je=ve("path").dirname(ve("url").fileURLToPath(Ar))+"/"),Oe=r=>{r=Ne(r)?new URL(r):r;var t=Me.readFileSync(r);return p(Buffer.isBuffer(t)),t},Ze=async(r,t=!0)=>{r=Ne(r)?new URL(r):r;var n=Me.readFileSync(r,t?void 0:"utf8");return p(t?Buffer.isBuffer(n):typeof n=="string"),n},process.argv.length>1&&(Fr=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),Pr=(r,t)=>{throw process.exitCode=r,t}}else if(ct){if(typeof process=="object"&&process.versions?.node&&process.type!="renderer"||typeof window=="object"||typeof WorkerGlobalScope<"u")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)")}else if(Ke||Z){try{Je=new URL(".",Ar).href}catch{}if(!(typeof window=="object"||typeof WorkerGlobalScope<"u"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");V||(Z&&(Oe=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Ze=async e=>{if(Ne(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{if(i.status==200||i.status==0&&i.response){t(i.response);return}n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)})}else throw new Error("environment detection error");var ut=console.log.bind(console),dt=console.error.bind(console);if(V){var Xn=ve("util"),ft=e=>typeof e=="object"?Xn.inspect(e):e;ut=(...e)=>Me.writeSync(1,e.map(ft).join(" ")+`
|
|
2
2
|
`),dt=(...e)=>Me.writeSync(2,e.map(ft).join(" ")+`
|
|
3
3
|
`)}var ue=ut,C=dt;p(Ke||Z||V,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"),p(!ct,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var xe;typeof WebAssembly!="object"&&C("no native wasm support detected");var Cr,ke=!1,Se;function p(e,r){e||z("Assertion failed"+(r?": "+r:""))}var Ne=e=>e.startsWith("file://");function vt(){var e=tt();p((e&3)==0),e==0&&(e+=4),(d(),T)[e>>2]=34821223,(d(),T)[e+4>>2]=2310721022,(d(),T)[0]=1668509029}function Le(){if(!ke){var e=tt();e==0&&(e+=4);var r=(d(),T)[e>>2],t=(d(),T)[e+4>>2];(r!=34821223||t!=2310721022)&&z(`Stack overflow! Stack cookie has been overwritten at ${he(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${he(t)} ${he(r)}`),(d(),T)[0]!=1668509029&&z("Runtime error: The application has corrupted its heap memory area (address zero)!")}}class b extends Error{}class Jn extends b{}class $r extends b{constructor(r){super(r),this.excPtr=r;const t=Pn(r);this.name=t[0],this.message=t[1]}}(()=>{var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,r[0]!==115||r[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();function Qe(e){Object.getOwnPropertyDescriptor(v,e)||Object.defineProperty(v,e,{configurable:!0,set(){z(`Attempt to set \`Module.${e}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`)}})}function M(e){return()=>p(!1,`call to '${e}' via reference taken before Wasm module initialization`)}function Zn(e){Object.getOwnPropertyDescriptor(v,e)&&z(`\`Module.${e}\` was supplied but \`${e}\` not included in INCOMING_MODULE_JS_API`)}function _t(e){return e==="FS_createPath"||e==="FS_createDataFile"||e==="FS_createPreloadedFile"||e==="FS_unlink"||e==="addRunDependency"||e==="FS_createLazyFile"||e==="FS_createDevice"||e==="removeRunDependency"}function pt(e,r){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,e)&&Object.defineProperty(globalThis,e,{configurable:!0,get(){r()}})}function ht(e,r){pt(e,()=>{ae(`\`${e}\` is not longer defined by emscripten. ${r}`)})}ht("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),ht("asm","Please use wasmExports instead");function Qn(e){pt(e,()=>{var r=`\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,t=e;t.startsWith("_")||(t="$"+e),r+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${t}')`,_t(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ae(r)}),mt(e)}function mt(e){A||Object.getOwnPropertyDescriptor(v,e)||Object.defineProperty(v,e,{configurable:!0,get(){var r=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;_t(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),z(r)}})}function d(){Q.buffer!=B.buffer&&er()}var Rr,Dr,gt;if(V&&A){var yt=Xe.parentPort;yt.on("message",e=>global.onmessage?.({data:e})),Object.assign(globalThis,{self:global,postMessage:e=>yt.postMessage(e)})}var ei=0;if(A){let e=function(r){try{var t=r.data,n=t.cmd;if(n==="load"){ei=t.workerID;let i=[];self.onmessage=a=>i.push(a),self.startWorker=a=>{postMessage({cmd:"loaded"});for(let s of i)e(s);self.onmessage=e};for(const a of t.handlers)(!v[a]||v[a].proxy)&&(v[a]=(...s)=>{postMessage({cmd:"callHandler",handler:a,args:s})},a=="print"&&(ue=v[a]),a=="printErr"&&(C=v[a]));Q=t.wasmMemory,er(),gt(t.wasmModule)}else if(n==="run"){p(t.pthread_ptr),vi(t.pthread_ptr),rt(t.pthread_ptr,0,0,1,0,0),$.threadInitTLS(),Yr(t.pthread_ptr),Or||(Cn(),Or=!0);try{_i(t.start_routine,t.arg)}catch(i){if(i!="unwind")throw i}}else t.target==="setimmediate"||(n==="checkMailbox"?Or&&wr():n&&(C(`worker: received unknown command ${n}`),C(t)))}catch(i){throw C(`worker: onmessage() captured an uncaught exception: ${i}`),i?.stack&&C(i.stack),$n(),i}};var Or=!1;self.onunhandledrejection=r=>{throw r.reason||r},self.onmessage=e}var Q,B,K,de,ie,S,T,wt,Ue,Y,Et,We=!1;function er(){var e=Q.buffer;B=new Int8Array(e),de=new Int16Array(e),K=new Uint8Array(e),ie=new Uint16Array(e),S=new Int32Array(e),T=new Uint32Array(e),wt=new Float32Array(e),Ue=new Float64Array(e),Y=new BigInt64Array(e),Et=new BigUint64Array(e)}function ri(){if(!A){if(v.wasmMemory)Q=v.wasmMemory;else{var e=v.INITIAL_MEMORY||16777216;p(e>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+e+"! (STACK_SIZE=65536)"),Q=new WebAssembly.Memory({initial:e/65536,maximum:32768,shared:!0})}er()}}p(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support");function ti(){if(p(!A),v.preRun)for(typeof v.preRun=="function"&&(v.preRun=[v.preRun]);v.preRun.length;)Ct(v.preRun.shift());Qe("preRun"),Pt(At)}function bt(){if(p(!We),We=!0,A)return startWorker(v);Le(),!v.noFSInit&&!o.initialized&&o.init(),Ee.__wasm_call_ctors(),o.ignorePermissions=!1}function ni(){if(Le(),!A){if(v.postRun)for(typeof v.postRun=="function"&&(v.postRun=[v.postRun]);v.postRun.length;)fi(v.postRun.shift());Qe("postRun"),Pt(Rt)}}var _e=0,je=null,Te={},pe=null;function rr(e){_e++,v.monitorRunDependencies?.(_e),e?(p(!Te[e]),Te[e]=1,pe===null&&typeof setInterval<"u"&&(pe=setInterval(()=>{if(ke){clearInterval(pe),pe=null;return}var r=!1;for(var t in Te)r||(r=!0,C("still waiting on run dependencies:")),C(`dependency: ${t}`);r&&C("(end of list)")},1e4))):C("warning: run dependency added without ID")}function Be(e){if(_e--,v.monitorRunDependencies?.(_e),e?(p(Te[e]),delete Te[e]):C("warning: run dependency removed without ID"),_e==0&&(pe!==null&&(clearInterval(pe),pe=null),je)){var r=je;je=null,r()}}function z(e){v.onAbort?.(e),e="Aborted("+e+")",C(e),ke=!0;var r=new WebAssembly.RuntimeError(e);throw Dr?.(r),r}function U(e,r){return(...t)=>{p(We,`native function \`${e}\` called before runtime initialization`);var n=Ee[e];return p(n,`exported native function \`${e}\` not found`),p(t.length<=r,`native function \`${e}\` called with ${t.length} args but expects ${r}`),n(...t)}}var ze;function ii(){return v.locateFile?Kn("mujoco.wasm"):new URL("/assets/mujoco-BrqJA_5D.wasm",import.meta.url).href}function ai(e){if(e==ze&&xe)return new Uint8Array(xe);if(Oe)return Oe(e);throw"both async and sync fetching of the wasm failed"}async function oi(e){if(!xe)try{var r=await Ze(e);return new Uint8Array(r)}catch{}return ai(e)}async function si(e,r){try{var t=await oi(e),n=await WebAssembly.instantiate(t,r);return n}catch(i){C(`failed to asynchronously prepare wasm: ${i}`),Ne(ze)&&C(`warning: Loading from a file URI (${ze}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),z(i)}}async function ci(e,r,t){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Ne(r)&&!V)try{var n=fetch(r,{credentials:"same-origin"}),i=await WebAssembly.instantiateStreaming(n,t);return i}catch(a){C(`wasm streaming compile failed: ${a}`),C("falling back to ArrayBuffer instantiation")}return si(r,t)}function kt(){return zo(),{env:ot,wasi_snapshot_preview1:ot}}async function li(){function e(s,c){return Ee=s.exports,pi(Ee._emscripten_tls_init),nr=Ee.__indirect_function_table,p(nr,"table not found in wasm exports"),Cr=c,Bo(Ee),Be("wasm-instantiate"),Ee}rr("wasm-instantiate");var r=v;function t(s){return p(v===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,e(s.instance,s.module)}var n=kt();if(v.instantiateWasm)return new Promise((s,c)=>{try{v.instantiateWasm(n,(l,u)=>{s(e(l,u))})}catch(l){C(`Module.instantiateWasm callback failed with error: ${l}`),c(l)}});if(A)return new Promise(s=>{gt=c=>{var l=new WebAssembly.Instance(c,kt());s(e(l,c))}});ze??=ii();var i=await ci(xe,ze,n),a=t(i);return a}class St{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var Tt=e=>{e.terminate(),e.onmessage=r=>{var t=r.data.cmd;C(`received "${t}" command from terminated worker: ${e.workerID}`)}},Ft=e=>{p(!A,"Internal Error! cleanupThread() can only ever be called from main application thread!"),p(e,"Internal Error! Null pthread_ptr in cleanupThread!");var r=$.pthreads[e];p(r),$.returnWorkerToPool(r)},Pt=e=>{for(;e.length>0;)e.shift()(v)},At=[],Ct=e=>At.push(e),ui=e=>{p(!A,"Internal Error! spawnThread() can only ever be called from main application thread!"),p(e.pthread_ptr,"Internal error, no pthread ptr!");var r=$.getNewWorker();if(!r)return 6;p(!r.pthread_ptr,"Internal error!"),$.runningWorkers.push(r),$.pthreads[e.pthread_ptr]=r,r.pthread_ptr=e.pthread_ptr;var t={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return V&&r.unref(),r.postMessage(t,e.transferList),0},He=0,tr=()=>ir||He>0,w=()=>it(),y=e=>Un(e),Ve=e=>Wn(e),G=(e,r,t,...n)=>{for(var i=n.length*2,a=w(),s=Ve(i*8),c=s>>3,l=0;l<n.length;l++){var u=n[l];typeof u=="bigint"?((d(),Y)[c+2*l]=1n,(d(),Y)[c+2*l+1]=u):((d(),Y)[c+2*l]=0n,(d(),Ue)[c+2*l+1]=u)}var f=Rn(e,r,i,s,t);return y(a),f};function Ir(e){if(A)return G(0,0,1,e);Se=e,tr()||($.terminateAllThreads(),v.onExit?.(e),ke=!0),Pr(e,new St(e))}function $t(e){if(A)return G(1,0,0,e);Mr(e)}var di=(e,r)=>{if(Se=e,ec(),A)throw p(!r),$t(e),"unwind";if(tr()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${He}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;Dr?.(t),C(t)}Ir(e)},Mr=di,he=e=>(p(typeof e=="number"),e>>>=0,"0x"+e.toString(16).padStart(8,"0")),$={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},nextWorkerID:1,init(){A||$.initMainThread()},initMainThread(){Ct(()=>{rr("loading-workers"),$.loadWasmModuleToAllWorkers(()=>Be("loading-workers"))})},terminateAllThreads:()=>{p(!A,"Internal Error! terminateAllThreads() can only ever be called from main application thread!");for(var e of $.runningWorkers)Tt(e);for(var e of $.unusedWorkers)Tt(e);$.unusedWorkers=[],$.runningWorkers=[],$.pthreads={}},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete $.pthreads[r],$.unusedWorkers.push(e),$.runningWorkers.splice($.runningWorkers.indexOf(e),1),e.pthread_ptr=0,Dn(r)},threadInitTLS(){$.tlsInitFunctions.forEach(e=>e())},loadWasmModuleToWorker:e=>new Promise(r=>{e.onmessage=a=>{var s=a.data,c=s.cmd;if(s.targetThread&&s.targetThread!=Zr()){var l=$.pthreads[s.targetThread];l?l.postMessage(s,s.transferList):C(`Internal error! Worker sent a message "${c}" to target pthread ${s.targetThread}, but that thread no longer exists!`);return}c==="checkMailbox"?wr():c==="spawnThread"?ui(s):c==="cleanupThread"?Ft(s.thread):c==="loaded"?(e.loaded=!0,r(e)):s.target==="setimmediate"?e.postMessage(s):c==="callHandler"?v[s.handler](...s.args):c&&C(`worker sent an unknown command ${c}`)},e.onerror=a=>{var s="worker sent an error!";throw e.pthread_ptr&&(s=`Pthread ${he(e.pthread_ptr)} sent an error!`),C(`${s} ${a.filename}:${a.lineno}: ${a.message}`),a},V&&(e.on("message",a=>e.onmessage({data:a})),e.on("error",a=>e.onerror(a))),p(Q instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!"),p(Cr instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var t=[],n=["onExit","onAbort","print","printErr"];for(var i of n)v.propertyIsEnumerable(i)&&t.push(i);e.postMessage({cmd:"load",handlers:t,wasmMemory:Q,wasmModule:Cr,workerID:e.workerID})}),loadWasmModuleToAllWorkers(e){e()},allocateUnusedWorker(){var e;if(v.mainScriptUrlOrBlob){var r=v.mainScriptUrlOrBlob;typeof r!="string"&&(r=URL.createObjectURL(r)),e=new Worker(r,{type:"module",workerData:"em-pthread",name:"em-pthread-"+$.nextWorkerID})}else e=new Worker(new URL("/assets/mujoco-CTy7U9S1.js",import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread-"+$.nextWorkerID});e.workerID=$.nextWorkerID++,$.unusedWorkers.push(e)},getNewWorker(){return $.unusedWorkers.length==0&&(V||C("Tried to spawn a new thread, but the thread pool is exhausted.\nThis might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.\nIf you want to increase the pool size, use setting `-sPTHREAD_POOL_SIZE=...`.\nIf you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting `-sPTHREAD_POOL_SIZE_STRICT=2`."),$.allocateUnusedWorker(),$.loadWasmModuleToWorker($.unusedWorkers[0])),$.unusedWorkers.pop()}},Rt=[],fi=e=>Rt.push(e);function vi(e){var r=(d(),T)[e+52>>2],t=(d(),T)[e+56>>2],n=r-t;p(r!=0),p(n!=0),p(r>n,"stackHigh must be higher then stackLow"),Ln(r,n),y(r),vt()}var Dt=[],nr,E=e=>{var r=Dt[e];return r||(Dt[e]=r=nr.get(e)),p(nr.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r},_i=(e,r)=>{He=0,ir=0;var t=E(e)(r);Le();function n(i){tr()?Se=i:nt(i)}n(t)},ir=!0,pi=e=>$.tlsInitFunctions.push(e),ae=e=>{ae.shown||={},ae.shown[e]||(ae.shown[e]=1,V&&(e="warning: "+e),C(e))},Ot=typeof TextDecoder<"u"?new TextDecoder:void 0,Fe=(e,r=0,t=NaN)=>{for(var n=r+t,i=r;e[i]&&!(i>=n);)++i;if(i-r>16&&e.buffer&&Ot)return Ot.decode(e.buffer instanceof ArrayBuffer?e.subarray(r,i):e.slice(r,i));for(var a="";r<i;){var s=e[r++];if(!(s&128)){a+=String.fromCharCode(s);continue}var c=e[r++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|c);continue}var l=e[r++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:((s&248)!=240&&ae("Invalid UTF-8 leading byte "+he(s)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),s=(s&7)<<18|c<<12|l<<6|e[r++]&63),s<65536)a+=String.fromCharCode(s);else{var u=s-65536;a+=String.fromCharCode(55296|u>>10,56320|u&1023)}}return a},oe=(e,r)=>(p(typeof e=="number",`UTF8ToString expects a number (got ${typeof e})`),e?Fe((d(),K),e,r):""),hi=(e,r,t,n)=>z(`Assertion failed: ${oe(e)}, at: `+[r?oe(r):"unknown filename",t,n?oe(n):"unknown function"]),mi=(e,r)=>E(e)(r),se=[],ar=0,gi=e=>{var r=new or(e);return r.get_caught()||(r.set_caught(!0),ar--),r.set_rethrown(!1),se.push(r),Sr(e),zn(e)},yi=()=>{if(!se.length)return 0;var e=se[se.length-1];return Sr(e.excPtr),e.excPtr},ce=0,wi=()=>{k(0,0),p(se.length>0);var e=se.pop();at(e.excPtr),ce=0};class or{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){(d(),T)[this.ptr+4>>2]=r}get_type(){return(d(),T)[this.ptr+4>>2]}set_destructor(r){(d(),T)[this.ptr+8>>2]=r}get_destructor(){return(d(),T)[this.ptr+8>>2]}set_caught(r){r=r?1:0,(d(),B)[this.ptr+12]=r}get_caught(){return(d(),B)[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,(d(),B)[this.ptr+13]=r}get_rethrown(){return(d(),B)[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){(d(),T)[this.ptr+16>>2]=r}get_adjusted_ptr(){return(d(),T)[this.ptr+16>>2]}}var sr=e=>xn(e),xr=e=>{var r=ce?.excPtr;if(!r)return sr(0),0;var t=new or(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return sr(0),r;for(var i of e){if(i===0||i===n)break;var a=t.ptr+16;if(Bn(i,n,a))return sr(i),r}return sr(n),r},Ei=()=>xr([]),bi=e=>xr([e]),ki=(e,r)=>xr([e,r]),It=()=>{var e=se.pop();e||z("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(se.push(e),e.set_rethrown(!0),e.set_caught(!1),ar++),ce=new $r(r),ce},Si=e=>{if(e){var r=new or(e);se.push(r),r.set_rethrown(!0),It()}},Ti=(e,r,t)=>{var n=new or(e);throw n.init(r,t),ce=new $r(e),ar++,ce},Fi=()=>ar,Pi=e=>{throw ce||(ce=new $r(e)),ce},O={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,n=e.length-1;n>=0;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=O.isAbs(e),t=e.slice(-1)==="/";return e=O.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=O.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.slice(0,-1)),t+n)},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>O.normalize(e.join("/")),join2:(e,r)=>O.normalize(e+"/"+r)},Ai=()=>{if(V){var e=ve("crypto");return r=>e.randomFillSync(r)}return r=>r.set(crypto.getRandomValues(new Uint8Array(r.byteLength)))},Mt=e=>{(Mt=Ai())(e)},Pe={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var i=n>=0?e[n]:o.cwd();if(typeof i!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";r=i+"/"+r,t=O.isAbs(i)}return r=O.normalizeArray(r.split("/").filter(a=>!!a),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=Pe.resolve(e).slice(1),r=Pe.resolve(r).slice(1);function t(u){for(var f=0;f<u.length&&u[f]==="";f++);for(var h=u.length-1;h>=0&&u[h]==="";h--);return f>h?[]:u.slice(f,h-f+1)}for(var n=t(e.split("/")),i=t(r.split("/")),a=Math.min(n.length,i.length),s=a,c=0;c<a;c++)if(n[c]!==i[c]){s=c;break}for(var l=[],c=s;c<n.length;c++)l.push("..");return l=l.concat(i.slice(s)),l.join("/")}},Nr=[],Ae=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},xt=(e,r,t,n)=>{if(p(typeof e=="string",`stringToUTF8Array expects a string (got ${typeof e})`),!(n>0))return 0;for(var i=t,a=t+n-1,s=0;s<e.length;++s){var c=e.codePointAt(s);if(c<=127){if(t>=a)break;r[t++]=c}else if(c<=2047){if(t+1>=a)break;r[t++]=192|c>>6,r[t++]=128|c&63}else if(c<=65535){if(t+2>=a)break;r[t++]=224|c>>12,r[t++]=128|c>>6&63,r[t++]=128|c&63}else{if(t+3>=a)break;c>1114111&&ae("Invalid Unicode code point "+he(c)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|c>>18,r[t++]=128|c>>12&63,r[t++]=128|c>>6&63,r[t++]=128|c&63,s++}}return r[t]=0,t-i},Lr=(e,r,t)=>{var n=Ae(e)+1,i=new Array(n),a=xt(e,i,0,i.length);return i.length=a,i},Ci=()=>{if(!Nr.length){var e=null;if(V){var r=256,t=Buffer.alloc(r),n=0,i=process.stdin.fd;try{n=Me.readSync(i,t,0,r)}catch(a){if(a.toString().includes("EOF"))n=0;else throw a}n>0&&(e=t.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
4
4
|
`));if(!e)return null;Nr=Lr(e)}return Nr.shift()},fe={ttys:[],init(){},shutdown(){},register(e,r){fe.ttys[e]={input:[],output:[],ops:r},o.registerDevice(e,fe.stream_ops)},stream_ops:{open(e){var r=fe.ttys[e.node.rdev];if(!r)throw new o.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,n,i){if(!e.tty||!e.tty.ops.get_char)throw new o.ErrnoError(60);for(var a=0,s=0;s<n;s++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new o.ErrnoError(29)}if(c===void 0&&a===0)throw new o.ErrnoError(6);if(c==null)break;a++,r[t+s]=c}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,i){if(!e.tty||!e.tty.ops.put_char)throw new o.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch{throw new o.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char(e){return Ci()},put_char(e,r){r===null||r===10?(ue(Fe(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(ue(Fe(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?(C(Fe(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(C(Fe(e.output)),e.output=[])}}},Nt=e=>{z("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},P={ops_table:null,mount(e){return P.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(o.isBlkdev(t)||o.isFIFO(t))throw new o.ErrnoError(63);P.ops_table||={dir:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr,lookup:P.node_ops.lookup,mknod:P.node_ops.mknod,rename:P.node_ops.rename,unlink:P.node_ops.unlink,rmdir:P.node_ops.rmdir,readdir:P.node_ops.readdir,symlink:P.node_ops.symlink},stream:{llseek:P.stream_ops.llseek}},file:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr},stream:{llseek:P.stream_ops.llseek,read:P.stream_ops.read,write:P.stream_ops.write,mmap:P.stream_ops.mmap,msync:P.stream_ops.msync}},link:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr,readlink:P.node_ops.readlink},stream:{}},chrdev:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr},stream:o.chrdev_stream_ops}};var i=o.createNode(e,r,t,n);return o.isDir(i.mode)?(i.node_ops=P.ops_table.dir.node,i.stream_ops=P.ops_table.dir.stream,i.contents={}):o.isFile(i.mode)?(i.node_ops=P.ops_table.file.node,i.stream_ops=P.ops_table.file.stream,i.usedBytes=0,i.contents=null):o.isLink(i.mode)?(i.node_ops=P.ops_table.link.node,i.stream_ops=P.ops_table.link.stream):o.isChrdev(i.mode)&&(i.node_ops=P.ops_table.chrdev.node,i.stream_ops=P.ops_table.chrdev.stream),i.atime=i.mtime=i.ctime=Date.now(),e&&(e.contents[r]=i,e.atime=e.mtime=e.ctime=i.atime),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var i=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=o.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,o.isDir(e.mode)?r.size=4096:o.isFile(e.mode)?r.size=e.usedBytes:o.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.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&&P.resizeFileStorage(e,r.size)},lookup(e,r){throw new o.ErrnoError(44)},mknod(e,r,t,n){return P.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=o.lookupNode(r,t)}catch{}if(n){if(o.isDir(e.mode))for(var i in n.contents)throw new o.ErrnoError(55);o.hashRemoveNode(n)}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=o.lookupNode(e,r);for(var n in t.contents)throw new o.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var n=P.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!o.isLink(e.mode))throw new o.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,n);if(p(s>=0),s>8&&a.subarray)r.set(a.subarray(i,i+s),t);else for(var c=0;c<s;c++)r[t+c]=a[i+c];return s},write(e,r,t,n,i,a){if(p(!(r instanceof ArrayBuffer)),r.buffer===(d(),B).buffer&&(a=!1),!n)return 0;var s=e.node;if(s.mtime=s.ctime=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return p(i===0,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&i===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(i+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),i),n}if(P.expandFileStorage(s,i+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),i);else for(var c=0;c<n;c++)s.contents[i+c]=r[t+c];return s.usedBytes=Math.max(s.usedBytes,i+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&o.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new o.ErrnoError(28);return n},mmap(e,r,t,n,i){if(!o.isFile(e.node.mode))throw new o.ErrnoError(43);var a,s,c=e.node.contents;if(!(i&2)&&c&&c.buffer===(d(),B).buffer)s=!1,a=c.byteOffset;else{if(s=!0,a=Nt(),!a)throw new o.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)),(d(),B).set(c,a))}return{ptr:a,allocated:s}},msync(e,r,t,n,i){return P.stream_ops.write(e,r,0,n,t,!1),0}}},$i=async e=>{var r=await Ze(e);return p(r,`Loading data file "${e}" failed (no arrayBuffer).`),new Uint8Array(r)},Lt=(...e)=>o.createDataFile(...e),Ri=e=>{for(var r=e;;){if(!Te[e])return e;e=r+Math.random()}},Ut=[],Di=(e,r,t,n)=>{typeof Browser<"u"&&Browser.init();var i=!1;return Ut.forEach(a=>{i||a.canHandle(r)&&(a.handle(e,r,t,n),i=!0)}),i},Wt=(e,r,t,n,i,a,s,c,l,u)=>{var f=r?Pe.resolve(O.join2(e,r)):e,h=Ri(`cp ${f}`);function m(_){function g(F){u?.(),c||Lt(e,r,F,n,i,l),a?.(),Be(h)}Di(_,f,g,()=>{s?.(),Be(h)})||g(_)}rr(h),typeof t=="string"?$i(t).then(m,s):m(t)},Oi=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},Ur=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ii=e=>oe(In(e)),jt={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},o={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class extends Error{name="ErrnoError";constructor(e){super(We?Ii(e):""),this.errno=e;for(var r in jt)if(jt[r]===e){this.code=r;break}}},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,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=o.nextInode++,this.name=r,this.mode=t,this.rdev=n,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 o.isDir(this.mode)}get isDevice(){return o.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new o.ErrnoError(44);r.follow_mount??=!0,O.isAbs(e)||(e=o.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(u=>!!u),i=o.root,a="/",s=0;s<n.length;s++){var c=s===n.length-1;if(c&&r.parent)break;if(n[s]!=="."){if(n[s]===".."){if(a=O.dirname(a),o.isRoot(i)){e=a+"/"+n.slice(s+1).join("/");continue e}else i=i.parent;continue}a=O.join2(a,n[s]);try{i=o.lookupNode(i,n[s])}catch(u){if(u?.errno===44&&c&&r.noent_okay)return{path:a};throw u}if(o.isMountpoint(i)&&(!c||r.follow_mount)&&(i=i.mounted.root),o.isLink(i.mode)&&(!c||r.follow)){if(!i.node_ops.readlink)throw new o.ErrnoError(52);var l=i.node_ops.readlink(i);O.isAbs(l)||(l=O.dirname(a)+"/"+l),e=l+"/"+n.slice(s+1).join("/");continue e}}}return{path:a,node:i}}throw new o.ErrnoError(32)},getPath(e){for(var r;;){if(o.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,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%o.nameTable.length},hashAddNode(e){var r=o.hashName(e.parent.id,e.name);e.name_next=o.nameTable[r],o.nameTable[r]=e},hashRemoveNode(e){var r=o.hashName(e.parent.id,e.name);if(o.nameTable[r]===e)o.nameTable[r]=e.name_next;else for(var t=o.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=o.mayLookup(e);if(t)throw new o.ErrnoError(t);for(var n=o.hashName(e.id,r),i=o.nameTable[n];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===r)return i}return o.lookup(e,r)},createNode(e,r,t,n){p(typeof e=="object");var i=new o.FSNode(e,r,t,n);return o.hashAddNode(i),i},destroyNode(e){o.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 o.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(!o.isDir(e.mode))return 54;var r=o.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!o.isDir(e.mode))return 54;try{var t=o.lookupNode(e,r);return 20}catch{}return o.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=o.lookupNode(e,r)}catch(a){return a.errno}var i=o.nodePermissions(e,"wx");if(i)return i;if(t){if(!o.isDir(n.mode))return 54;if(o.isRoot(n)||o.getPath(n)===o.cwd())return 10}else if(o.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?o.isLink(e.mode)?32:o.isDir(e.mode)&&(o.flagsToPermissionString(r)!=="r"||r&576)?31:o.nodePermissions(e,o.flagsToPermissionString(r)):44},checkOpExists(e,r){if(!e)throw new o.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=o.MAX_OPEN_FDS;e++)if(!o.streams[e])return e;throw new o.ErrnoError(33)},getStreamChecked(e){var r=o.getStream(e);if(!r)throw new o.ErrnoError(8);return r},getStream:e=>o.streams[e],createStream(e,r=-1){return p(r>=-1),e=Object.assign(new o.FSStream,e),r==-1&&(r=o.nextfd()),e.fd=r,o.streams[r]=e,e},closeStream(e){o.streams[e]=null},dupStream(e,r=-1){var t=o.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,i=n?e:r;n??=r.node_ops.setattr,o.checkOpExists(n,63),n(i,t)},chrdev_stream_ops:{open(e){var r=o.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new o.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){o.devices[e]={stream_ops:r}},getDevice:e=>o.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),o.syncFSRequests++,o.syncFSRequests>1&&C(`warning: ${o.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=o.getMounts(o.root.mount),n=0;function i(s){return p(o.syncFSRequests>0),o.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,i(s));++n>=t.length&&i(null)}t.forEach(s=>{if(!s.type.syncfs)return a(null);s.type.syncfs(s,e,a)})},mount(e,r,t){if(typeof e=="string")throw e;var n=t==="/",i=!t,a;if(n&&o.root)throw new o.ErrnoError(10);if(!n&&!i){var s=o.lookupPath(t,{follow_mount:!1});if(t=s.path,a=s.node,o.isMountpoint(a))throw new o.ErrnoError(10);if(!o.isDir(a.mode))throw new o.ErrnoError(54)}var c={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(c);return l.mount=c,c.root=l,n?o.root=l:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),l},unmount(e){var r=o.lookupPath(e,{follow_mount:!1});if(!o.isMountpoint(r.node))throw new o.ErrnoError(28);var t=r.node,n=t.mounted,i=o.getMounts(n);Object.keys(o.nameTable).forEach(s=>{for(var c=o.nameTable[s];c;){var l=c.name_next;i.includes(c.mount)&&o.destroyNode(c),c=l}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);p(a!==-1),t.mount.mounts.splice(a,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=o.lookupPath(e,{parent:!0}),i=n.node,a=O.basename(e);if(!a)throw new o.ErrnoError(28);if(a==="."||a==="..")throw new o.ErrnoError(20);var s=o.mayCreate(i,a);if(s)throw new o.ErrnoError(s);if(!i.node_ops.mknod)throw new o.ErrnoError(63);return i.node_ops.mknod(i,a,r,t)},statfs(e){return o.statfsNode(o.lookupPath(e,{follow:!0}).node)},statfsStream(e){return o.statfsNode(e.node)},statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:o.nextInode,ffree:o.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,o.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,o.mknod(e,r,0)},mkdirTree(e,r){var t=e.split("/"),n="";for(var i of t)if(i){(n||O.isAbs(e))&&(n+="/"),n+=i;try{o.mkdir(n,r)}catch(a){if(a.errno!=20)throw a}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,o.mknod(e,r,t)},symlink(e,r){if(!Pe.resolve(e))throw new o.ErrnoError(44);var t=o.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new o.ErrnoError(44);var i=O.basename(r),a=o.mayCreate(n,i);if(a)throw new o.ErrnoError(a);if(!n.node_ops.symlink)throw new o.ErrnoError(63);return n.node_ops.symlink(n,i,e)},rename(e,r){var t=O.dirname(e),n=O.dirname(r),i=O.basename(e),a=O.basename(r),s,c,l;if(s=o.lookupPath(e,{parent:!0}),c=s.node,s=o.lookupPath(r,{parent:!0}),l=s.node,!c||!l)throw new o.ErrnoError(44);if(c.mount!==l.mount)throw new o.ErrnoError(75);var u=o.lookupNode(c,i),f=Pe.relative(e,n);if(f.charAt(0)!==".")throw new o.ErrnoError(28);if(f=Pe.relative(r,t),f.charAt(0)!==".")throw new o.ErrnoError(55);var h;try{h=o.lookupNode(l,a)}catch{}if(u!==h){var m=o.isDir(u.mode),_=o.mayDelete(c,i,m);if(_)throw new o.ErrnoError(_);if(_=h?o.mayDelete(l,a,m):o.mayCreate(l,a),_)throw new o.ErrnoError(_);if(!c.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(u)||h&&o.isMountpoint(h))throw new o.ErrnoError(10);if(l!==c&&(_=o.nodePermissions(c,"w"),_))throw new o.ErrnoError(_);o.hashRemoveNode(u);try{c.node_ops.rename(u,l,a),u.parent=l}catch(g){throw g}finally{o.hashAddNode(u)}}},rmdir(e){var r=o.lookupPath(e,{parent:!0}),t=r.node,n=O.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!0);if(a)throw new o.ErrnoError(a);if(!t.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.rmdir(t,n),o.destroyNode(i)},readdir(e){var r=o.lookupPath(e,{follow:!0}),t=r.node,n=o.checkOpExists(t.node_ops.readdir,54);return n(t)},unlink(e){var r=o.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new o.ErrnoError(44);var n=O.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!1);if(a)throw new o.ErrnoError(a);if(!t.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.unlink(t,n),o.destroyNode(i)},readlink(e){var r=o.lookupPath(e),t=r.node;if(!t)throw new o.ErrnoError(44);if(!t.node_ops.readlink)throw new o.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=o.lookupPath(e,{follow:!r}),n=t.node,i=o.checkOpExists(n.node_ops.getattr,63);return i(n)},fstat(e){var r=o.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,i=n?r:t;return n??=t.node_ops.getattr,o.checkOpExists(n,63),n(i)},lstat(e){return o.stat(e,!0)},doChmod(e,r,t,n){o.doSetAttr(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;if(typeof e=="string"){var i=o.lookupPath(e,{follow:!t});n=i.node}else n=e;o.doChmod(null,n,r,t)},lchmod(e,r){o.chmod(e,r,!0)},fchmod(e,r){var t=o.getStreamChecked(e);o.doChmod(t,t.node,r,!1)},doChown(e,r,t){o.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var i;if(typeof e=="string"){var a=o.lookupPath(e,{follow:!n});i=a.node}else i=e;o.doChown(null,i,n)},lchown(e,r,t){o.chown(e,r,t,!0)},fchown(e,r,t){var n=o.getStreamChecked(e);o.doChown(n,n.node,!1)},doTruncate(e,r,t){if(o.isDir(r.mode))throw new o.ErrnoError(31);if(!o.isFile(r.mode))throw new o.ErrnoError(28);var n=o.nodePermissions(r,"w");if(n)throw new o.ErrnoError(n);o.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new o.ErrnoError(28);var t;if(typeof e=="string"){var n=o.lookupPath(e,{follow:!0});t=n.node}else t=e;o.doTruncate(null,t,r)},ftruncate(e,r){var t=o.getStreamChecked(e);if(r<0||(t.flags&2097155)===0)throw new o.ErrnoError(28);o.doTruncate(t,t.node,r)},utime(e,r,t){var n=o.lookupPath(e,{follow:!0}),i=n.node,a=o.checkOpExists(i.node_ops.setattr,63);a(i,{atime:r,mtime:t})},open(e,r,t=438){if(e==="")throw new o.ErrnoError(44);r=typeof r=="string"?Oi(r):r,r&64?t=t&4095|32768:t=0;var n,i;if(typeof e=="object")n=e;else{i=e.endsWith("/");var a=o.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=a.node,e=a.path}var s=!1;if(r&64)if(n){if(r&128)throw new o.ErrnoError(20)}else{if(i)throw new o.ErrnoError(31);n=o.mknod(e,t|511,0),s=!0}if(!n)throw new o.ErrnoError(44);if(o.isChrdev(n.mode)&&(r&=-513),r&65536&&!o.isDir(n.mode))throw new o.ErrnoError(54);if(!s){var c=o.mayOpen(n,r);if(c)throw new o.ErrnoError(c)}r&512&&!s&&o.truncate(n,0),r&=-131713;var l=o.createStream({node:n,path:o.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),s&&o.chmod(n,t&511),v.logReadFiles&&!(r&1)&&(e in o.readFiles||(o.readFiles[e]=1)),l},close(e){if(o.isClosed(e))throw new o.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{o.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(o.isClosed(e))throw new o.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new o.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new o.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,i){if(p(t>=0),n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===1)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.read)throw new o.ErrnoError(28);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,i);return a||(e.position+=s),s},write(e,r,t,n,i,a){if(p(t>=0),n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===0)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.write)throw new o.ErrnoError(28);e.seekable&&e.flags&1024&&o.llseek(e,0,2);var s=typeof i<"u";if(!s)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var c=e.stream_ops.write(e,r,t,n,i,a);return s||(e.position+=c),c},mmap(e,r,t,n,i){if((n&2)!==0&&(i&2)===0&&(e.flags&2097155)!==2)throw new o.ErrnoError(2);if((e.flags&2097155)===1)throw new o.ErrnoError(2);if(!e.stream_ops.mmap)throw new o.ErrnoError(43);if(!r)throw new o.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,i)},msync(e,r,t,n,i){return p(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,i):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new o.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t=o.open(e,r.flags),n=o.stat(e),i=n.size,a=new Uint8Array(i);return o.read(t,a,0,i,0),r.encoding==="utf8"&&(a=Fe(a)),o.close(t),a},writeFile(e,r,t={}){t.flags=t.flags||577;var n=o.open(e,t.flags,t.mode);if(typeof r=="string"&&(r=new Uint8Array(Lr(r))),ArrayBuffer.isView(r))o.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");o.close(n)},cwd:()=>o.currentPath,chdir(e){var r=o.lookupPath(e,{follow:!0});if(r.node===null)throw new o.ErrnoError(44);if(!o.isDir(r.node.mode))throw new o.ErrnoError(54);var t=o.nodePermissions(r.node,"x");if(t)throw new o.ErrnoError(t);o.currentPath=r.path},createDefaultDirectories(){o.mkdir("/tmp"),o.mkdir("/home"),o.mkdir("/home/web_user")},createDefaultDevices(){o.mkdir("/dev"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(n,i,a,s,c)=>s,llseek:()=>0}),o.mkdev("/dev/null",o.makedev(1,3)),fe.register(o.makedev(5,0),fe.default_tty_ops),fe.register(o.makedev(6,0),fe.default_tty1_ops),o.mkdev("/dev/tty",o.makedev(5,0)),o.mkdev("/dev/tty1",o.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(Mt(e),r=e.byteLength),e[--r]);o.createDevice("/dev","random",t),o.createDevice("/dev","urandom",t),o.mkdir("/dev/shm"),o.mkdir("/dev/shm/tmp")},createSpecialDirectories(){o.mkdir("/proc");var e=o.mkdir("/proc/self");o.mkdir("/proc/self/fd"),o.mount({mount(){var r=o.createNode(e,"fd",16895,73);return r.stream_ops={llseek:P.stream_ops.llseek},r.node_ops={lookup(t,n){var i=+n,a=o.getStreamChecked(i),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path},id:i+1};return s.parent=s,s},readdir(){return Array.from(o.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?o.createDevice("/dev","stdin",e):o.symlink("/dev/tty","/dev/stdin"),r?o.createDevice("/dev","stdout",null,r):o.symlink("/dev/tty","/dev/stdout"),t?o.createDevice("/dev","stderr",null,t):o.symlink("/dev/tty1","/dev/stderr");var n=o.open("/dev/stdin",0),i=o.open("/dev/stdout",1),a=o.open("/dev/stderr",1);p(n.fd===0,`invalid handle for stdin (${n.fd})`),p(i.fd===1,`invalid handle for stdout (${i.fd})`),p(a.fd===2,`invalid handle for stderr (${a.fd})`)},staticInit(){o.nameTable=new Array(4096),o.mount(P,{},"/"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:P}},init(e,r,t){p(!o.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),o.initialized=!0,e??=v.stdin,r??=v.stdout,t??=v.stderr,o.createStandardStreams(e,r,t)},quit(){o.initialized=!1,et(0);for(var e of o.streams)e&&o.close(e)},findObject(e,r){var t=o.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=o.lookupPath(e,{follow:!r});e=t.path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=o.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=O.basename(e),t=o.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(i){n.error=i.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:o.getPath(e);for(var i=r.split("/").reverse();i.length;){var a=i.pop();if(a){var s=O.join2(e,a);try{o.mkdir(s)}catch(c){if(c.errno!=20)throw c}e=s}}return s},createFile(e,r,t,n,i){var a=O.join2(typeof e=="string"?e:o.getPath(e),r),s=Ur(n,i);return o.create(a,s)},createDataFile(e,r,t,n,i,a){var s=r;e&&(e=typeof e=="string"?e:o.getPath(e),s=r?O.join2(e,r):e);var c=Ur(n,i),l=o.create(s,c);if(t){if(typeof t=="string"){for(var u=new Array(t.length),f=0,h=t.length;f<h;++f)u[f]=t.charCodeAt(f);t=u}o.chmod(l,c|146);var m=o.open(l,577);o.write(m,t,0,t.length,0,a),o.close(m),o.chmod(l,c)}},createDevice(e,r,t,n){var i=O.join2(typeof e=="string"?e:o.getPath(e),r),a=Ur(!!t,!!n);o.createDevice.major??=64;var s=o.makedev(o.createDevice.major++,0);return o.registerDevice(s,{open(c){c.seekable=!1},close(c){n?.buffer?.length&&n(10)},read(c,l,u,f,h){for(var m=0,_=0;_<f;_++){var g;try{g=t()}catch{throw new o.ErrnoError(29)}if(g===void 0&&m===0)throw new o.ErrnoError(6);if(g==null)break;m++,l[u+_]=g}return m&&(c.node.atime=Date.now()),m},write(c,l,u,f,h){for(var m=0;m<f;m++)try{n(l[u+m])}catch{throw new o.ErrnoError(29)}return f&&(c.node.mtime=c.node.ctime=Date.now()),m}}),o.mkdev(i,a,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("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.");try{e.contents=Oe(e.url),e.usedBytes=e.contents.length}catch{throw new o.ErrnoError(29)}},createLazyFile(e,r,t,n,i){class a{lengthKnown=!1;chunks=[];get(_){if(!(_>this.length-1||_<0)){var g=_%this.chunkSize,F=_/this.chunkSize|0;return this.getter(F)[g]}}setDataGetter(_){this.getter=_}cacheLength(){var _=new XMLHttpRequest;if(_.open("HEAD",t,!1),_.send(null),!(_.status>=200&&_.status<300||_.status===304))throw new Error("Couldn't load "+t+". Status: "+_.status);var g=Number(_.getResponseHeader("Content-length")),F,I=(F=_.getResponseHeader("Accept-Ranges"))&&F==="bytes",D=(F=_.getResponseHeader("Content-Encoding"))&&F==="gzip",H=1024*1024;I||(H=g);var x=(q,le)=>{if(q>le)throw new Error("invalid range ("+q+", "+le+") or no bytes requested!");if(le>g-1)throw new Error("only "+g+" bytes available! programmer error!");var L=new XMLHttpRequest;if(L.open("GET",t,!1),g!==H&&L.setRequestHeader("Range","bytes="+q+"-"+le),L.responseType="arraybuffer",L.overrideMimeType&&L.overrideMimeType("text/plain; charset=x-user-defined"),L.send(null),!(L.status>=200&&L.status<300||L.status===304))throw new Error("Couldn't load "+t+". Status: "+L.status);return L.response!==void 0?new Uint8Array(L.response||[]):Lr(L.responseText||"")},be=this;be.setDataGetter(q=>{var le=q*H,L=(q+1)*H-1;if(L=Math.min(L,g-1),typeof be.chunks[q]>"u"&&(be.chunks[q]=x(le,L)),typeof be.chunks[q]>"u")throw new Error("doXHR failed!");return be.chunks[q]}),(D||!g)&&(H=g=1,g=this.getter(0).length,H=g,ue("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=g,this._chunkSize=H,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!Z)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a,c={isDevice:!1,contents:s}}else var c={isDevice:!1,url:t};var l=o.createFile(e,r,c,n,i);c.contents?l.contents=c.contents:c.url&&(l.contents=null,l.url=c.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={},f=Object.keys(l.stream_ops);f.forEach(m=>{var _=l.stream_ops[m];u[m]=(...g)=>(o.forceLoadFile(l),_(...g))});function h(m,_,g,F,I){var D=m.node.contents;if(I>=D.length)return 0;var H=Math.min(D.length-I,F);if(p(H>=0),D.slice)for(var x=0;x<H;x++)_[g+x]=D[I+x];else for(var x=0;x<H;x++)_[g+x]=D.get(I+x);return H}return u.read=(m,_,g,F,I)=>(o.forceLoadFile(l),h(m,_,g,F,I)),u.mmap=(m,_,g,F,I)=>{o.forceLoadFile(l);var D=Nt();if(!D)throw new o.ErrnoError(48);return h(m,(d(),B),D,_,g),{ptr:D,allocated:!0}},l.stream_ops=u,l},absolutePath(){z("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){z("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){z("FS.createLink has been removed; use FS.symlink instead")},joinPath(){z("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){z("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){z("FS.standardizePath has been removed; use PATH.normalize instead")}},N={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(O.isAbs(r))return r;var n;if(e===-100)n=o.cwd();else{var i=N.getStreamFromFD(e);n=i.path}if(r.length==0){if(!t)throw new o.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){(d(),S)[e>>2]=r.dev,(d(),S)[e+4>>2]=r.mode,(d(),T)[e+8>>2]=r.nlink,(d(),S)[e+12>>2]=r.uid,(d(),S)[e+16>>2]=r.gid,(d(),S)[e+20>>2]=r.rdev,(d(),Y)[e+24>>3]=BigInt(r.size),(d(),S)[e+32>>2]=4096,(d(),S)[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return(d(),Y)[e+40>>3]=BigInt(Math.floor(t/1e3)),(d(),T)[e+48>>2]=t%1e3*1e3*1e3,(d(),Y)[e+56>>3]=BigInt(Math.floor(n/1e3)),(d(),T)[e+64>>2]=n%1e3*1e3*1e3,(d(),Y)[e+72>>3]=BigInt(Math.floor(i/1e3)),(d(),T)[e+80>>2]=i%1e3*1e3*1e3,(d(),Y)[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){(d(),S)[e+4>>2]=r.bsize,(d(),S)[e+40>>2]=r.bsize,(d(),S)[e+8>>2]=r.blocks,(d(),S)[e+12>>2]=r.bfree,(d(),S)[e+16>>2]=r.bavail,(d(),S)[e+20>>2]=r.files,(d(),S)[e+24>>2]=r.ffree,(d(),S)[e+28>>2]=r.fsid,(d(),S)[e+44>>2]=r.flags,(d(),S)[e+36>>2]=r.namelen},doMsync(e,r,t,n,i){if(!o.isFile(r.node.mode))throw new o.ErrnoError(43);if(n&2)return 0;var a=(d(),K).slice(e,e+t);o.msync(r,a,i,t,n)},getStreamFromFD(e){var r=o.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=oe(e);return r}};function Bt(e,r,t){if(A)return G(2,0,1,e,r,t);try{var n=N.getStreamFromFD(e);if(p(!t),n.fd===r)return-28;if(r<0||r>=o.MAX_OPEN_FDS)return-8;var i=o.getStream(r);return i&&o.close(i),o.dupStream(n,r).fd}catch(a){if(typeof o>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}var cr=()=>{p(N.varargs!=null);var e=(d(),S)[+N.varargs>>2];return N.varargs+=4,e},Ce=cr;function zt(e,r,t){if(A)return G(3,0,1,e,r,t);N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 0:{var i=cr();if(i<0)return-28;for(;o.streams[i];)i++;var a;return a=o.dupStream(n,i),a.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var i=cr();return n.flags|=i,0}case 12:{var i=Ce(),s=0;return(d(),de)[i+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof o>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function Ht(e,r){if(A)return G(4,0,1,e,r);try{return N.writeStat(r,o.fstat(e))}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Vt(e,r,t){if(A)return G(5,0,1,e,r,t);N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var i=n.tty.ops.ioctl_tcgets(n),a=Ce();(d(),S)[a>>2]=i.c_iflag||0,(d(),S)[a+4>>2]=i.c_oflag||0,(d(),S)[a+8>>2]=i.c_cflag||0,(d(),S)[a+12>>2]=i.c_lflag||0;for(var s=0;s<32;s++)(d(),B)[a+s+17]=i.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var a=Ce(),c=(d(),S)[a>>2],l=(d(),S)[a+4>>2],u=(d(),S)[a+8>>2],f=(d(),S)[a+12>>2],h=[],s=0;s<32;s++)h.push((d(),B)[a+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:c,c_oflag:l,c_cflag:u,c_lflag:f,c_cc:h})}return 0}case 21519:{if(!n.tty)return-59;var a=Ce();return(d(),S)[a>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var a=Ce();return o.ioctl(n,r,a)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty),a=Ce();(d(),de)[a>>1]=m[0],(d(),de)[a+2>>1]=m[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(_){if(typeof o>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function Gt(e,r){if(A)return G(6,0,1,e,r);try{return e=N.getStr(e),N.writeStat(r,o.lstat(e))}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Yt(e,r,t,n){if(A)return G(7,0,1,e,r,t,n);try{r=N.getStr(r);var i=n&256,a=n&4096;return n=n&-6401,p(!n,`unknown flags in __syscall_newfstatat: ${n}`),r=N.calculateAt(e,r,a),N.writeStat(t,i?o.lstat(r):o.stat(r))}catch(s){if(typeof o>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function qt(e,r,t,n){if(A)return G(8,0,1,e,r,t,n);N.varargs=n;try{r=N.getStr(r),r=N.calculateAt(e,r);var i=n?cr():0;return o.open(r,t,i).fd}catch(a){if(typeof o>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}function Kt(e,r){if(A)return G(9,0,1,e,r);try{return e=N.getStr(e),N.writeStat(r,o.stat(e))}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}var Mi=()=>z("native code called abort()"),W=e=>{for(var r="";;){var t=(d(),K)[e++];if(!t)return r;r+=String.fromCharCode(t)}},$e={},me={},lr={},Ge=class extends Error{constructor(r){super(r),this.name="BindingError"}},R=e=>{throw new Ge(e)};function xi(e,r,t={}){var n=r.name;if(e||R(`type "${n}" must have a positive integer typeid pointer`),me.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;R(`Cannot register type '${n}' twice`)}if(me[e]=r,delete lr[e],$e.hasOwnProperty(e)){var i=$e[e];delete $e[e],i.forEach(a=>a())}}function X(e,r,t={}){if(r.argPackAdvance===void 0)throw new TypeError("registerType registeredInstance requires argPackAdvance");return xi(e,r,t)}var Xt=(e,r,t)=>{switch(r){case 1:return t?n=>(d(),B)[n]:n=>(d(),K)[n];case 2:return t?n=>(d(),de)[n>>1]:n=>(d(),ie)[n>>1];case 4:return t?n=>(d(),S)[n>>2]:n=>(d(),T)[n>>2];case 8:return t?n=>(d(),Y)[n>>3]:n=>(d(),Et)[n>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},ge=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Jt=(e,r,t,n)=>{if(r<t||r>n)throw new TypeError(`Passing a number "${ge(r)}" from JS side to C/C++ side to an argument of type "${e}", which is outside the valid range [${t}, ${n}]!`)},Ni=(e,r,t,n,i)=>{r=W(r);const a=n===0n;let s=c=>c;if(a){const c=t*8;s=l=>BigInt.asUintN(c,l),i=s(i)}X(e,{name:r,fromWireType:s,toWireType:(c,l)=>{if(typeof l=="number")l=BigInt(l);else if(typeof l!="bigint")throw new TypeError(`Cannot convert "${ge(l)}" to ${this.name}`);return Jt(r,l,n,i),l},argPackAdvance:ee,readValueFromPointer:Xt(r,t,!a),destructorFunction:null})},ee=8,Li=(e,r,t,n)=>{r=W(r),X(e,{name:r,fromWireType:function(i){return!!i},toWireType:function(i,a){return a?t:n},argPackAdvance:ee,readValueFromPointer:function(i){return this.fromWireType((d(),K)[i])},destructorFunction:null})},Ui=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Wr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}R(r(e)+" instance already deleted")},jr=!1,Zt=e=>{},Wi=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Qt=e=>{e.count.value-=1;var r=e.count.value===0;r&&Wi(e)},en=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=en(e,r,t.baseClass);return n===null?null:t.downcast(n)},rn={},ji={},Bi=(e,r)=>{for(r===void 0&&R("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},zi=(e,r)=>(r=Bi(e,r),ji[r]),Hi=class extends Error{constructor(r){super(r),this.name="InternalError"}},ur=e=>{throw new Hi(e)},dr=(e,r)=>{(!r.ptrType||!r.ptr)&&ur("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&ur("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Ye(Object.create(e,{$$:{value:r,writable:!0}}))};function tn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=zi(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?dr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):dr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(r),s=rn[a];if(!s)return i.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=en(r,this.registeredClass,c.registeredClass);return l===null?i.call(this):this.isSmartPointer?dr(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:e}):dr(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var Ye=e=>typeof FinalizationRegistry>"u"?(Ye=r=>r,e):(jr=new FinalizationRegistry(r=>{console.warn(r.leakWarning),Qt(r.$$)}),Ye=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t},a=t.ptrType.registeredClass,s=new Error(`Embind found a leaked C++ instance ${a.name} <${he(t.ptr)}>.
|
package/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
/>
|
|
12
12
|
<link rel="manifest" href="manifest.json" />
|
|
13
13
|
<title>mjswan</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DE0hoRFc.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-B4SJqdSr.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|