mjswan 0.3.0 → 0.4.1
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.
- package/dist/assets/{index-IeKGIubE.js → index-BSeAJBAd.js} +605 -605
- package/dist/assets/mujoco-BK4bzMF-.js +24 -0
- package/dist/assets/{mujoco-PVgopJPs.wasm → mujoco-BrqJA_5D.wasm} +0 -0
- package/dist/assets/mujoco-CTy7U9S1.js +24 -0
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/mujoco-BWNvFdGl.js +0 -25
- package/dist/assets/mujoco-Bk22Ffnh.js +0 -25
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{_ as Gn}from"./index-BSeAJBAd.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
|
+
`),dt=(...e)=>Me.writeSync(2,e.map(ft).join(" ")+`
|
|
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
|
+
`));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)}>.
|
|
5
|
+
We'll free it automatically in this case, but this functionality is not reliable across various environments.
|
|
6
|
+
Make sure to invoke .delete() manually once you're done with the instance instead.
|
|
7
|
+
Originally allocated`);"captureStackTrace"in Error&&Error.captureStackTrace(s,tn),i.leakWarning=s.stack.replace(/^Error: /,""),jr.register(r,i,r)}return r},Zt=r=>jr.unregister(r),Ye(e)),Vi=()=>{let e=fr.prototype;Object.assign(e,{isAliasOf(t){if(!(this instanceof fr)||!(t instanceof fr))return!1;var n=this.$$.ptrType.registeredClass,i=this.$$.ptr;t.$$=t.$$;for(var a=t.$$.ptrType.registeredClass,s=t.$$.ptr;n.baseClass;)i=n.upcast(i),n=n.baseClass;for(;a.baseClass;)s=a.upcast(s),a=a.baseClass;return n===a&&i===s},clone(){if(this.$$.ptr||Wr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ye(Object.create(Object.getPrototypeOf(this),{$$:{value:Ui(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Wr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&R("Object already scheduled for deletion"),Zt(this),Qt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Wr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&R("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)};function fr(){}var vr=(e,r)=>Object.defineProperty(r,"name",{value:e}),Br=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...i){return e[r].overloadTable.hasOwnProperty(i.length)||R(`Function '${t}' called with an invalid number of arguments (${i.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[i.length].apply(this,i)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},zr=(e,r,t)=>{v.hasOwnProperty(e)?((t===void 0||v[e].overloadTable!==void 0&&v[e].overloadTable[t]!==void 0)&&R(`Cannot register public name '${e}' twice`),Br(v,e,e),v[e].overloadTable.hasOwnProperty(t)&&R(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),v[e].overloadTable[t]=r):(v[e]=r,v[e].argCount=t)},Gi=48,Yi=57,qi=e=>{p(typeof e=="string"),e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Gi&&r<=Yi?`_${e}`:e};function Ki(e,r,t,n,i,a,s,c){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=i,this.getActualType=a,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var _r=(e,r,t)=>{for(;r!==t;)r.upcast||R(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Xi(e,r){if(r===null)return this.isReference&&R(`null is not a valid ${this.name}`),0;r.$$||R(`Cannot pass "${ge(r)}" as a ${this.name}`),r.$$.ptr||R(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=_r(r.$$.ptr,t,this.registeredClass);return n}function Ji(e,r){var t;if(r===null)return this.isReference&&R(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&R(`Cannot pass "${ge(r)}" as a ${this.name}`),r.$$.ptr||R(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&R(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=_r(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&R("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:R(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var i=r.clone();t=this.rawShare(t,j.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:R("Unsupporting sharing policy")}return t}function Zi(e,r){if(r===null)return this.isReference&&R(`null is not a valid ${this.name}`),0;r.$$||R(`Cannot pass "${ge(r)}" as a ${this.name}`),r.$$.ptr||R(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&R(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=_r(r.$$.ptr,t,this.registeredClass);return n}function pr(e){return this.fromWireType((d(),T)[e>>2])}var Qi=()=>{Object.assign(hr.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:ee,readValueFromPointer:pr,fromWireType:tn})};function hr(e,r,t,n,i,a,s,c,l,u,f){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=f,!i&&r.baseClass===void 0?n?(this.toWireType=Xi,this.destructorFunction=null):(this.toWireType=Zi,this.destructorFunction=null):this.toWireType=Ji}var nn=(e,r,t)=>{v.hasOwnProperty(e)||ur("Replacing nonexistent public symbol"),v[e].overloadTable!==void 0&&t!==void 0?v[e].overloadTable[t]=r:(v[e]=r,v[e].argCount=t)},re=(e,r,t=!1)=>{p(!t,"Async bindings are only supported with JSPI."),e=W(e);function n(){var a=E(r);return a}var i=n();return typeof i!="function"&&R(`unknown function pointer with signature ${e}: ${r}`),i};class ea extends Error{}var an=e=>{var r=An(e),t=W(r);return ne(r),t},ye=(e,r)=>{var t=[],n={};function i(a){if(!n[a]&&!me[a]){if(lr[a]){lr[a].forEach(i);return}t.push(a),n[a]=!0}}throw r.forEach(i),new ea(`${e}: `+t.map(an).join([", "]))},J=(e,r,t)=>{e.forEach(c=>lr[c]=r);function n(c){var l=t(c);l.length!==e.length&&ur("Mismatched type converter count");for(var u=0;u<e.length;++u)X(e[u],l[u])}var i=new Array(r.length),a=[],s=0;r.forEach((c,l)=>{me.hasOwnProperty(c)?i[l]=me[c]:(a.push(c),$e.hasOwnProperty(c)||($e[c]=[]),$e[c].push(()=>{i[l]=me[c],++s,s===a.length&&n(i)}))}),a.length===0&&n(i)},ra=(e,r,t,n,i,a,s,c,l,u,f,h,m)=>{f=W(f),a=re(i,a),c&&=re(s,c),u&&=re(l,u),m=re(h,m);var _=qi(f);zr(_,function(){ye(`Cannot construct ${f} due to unbound types`,[n])}),J([e,r,t],n?[n]:[],g=>{g=g[0];var F,I;n?(F=g.registeredClass,I=F.instancePrototype):I=fr.prototype;var D=vr(f,function(...L){if(Object.getPrototypeOf(this)!==H)throw new Ge(`Use 'new' to construct ${f}`);if(x.constructor_body===void 0)throw new Ge(`${f} has no accessible constructor`);var Vn=x.constructor_body[L.length];if(Vn===void 0)throw new Ge(`Tried to invoke ctor of ${f} with invalid number of parameters (${L.length}) - expected (${Object.keys(x.constructor_body).toString()}) parameters instead!`);return Vn.apply(this,L)}),H=Object.create(I,{constructor:{value:D}});D.prototype=H;var x=new Ki(f,D,H,m,F,a,c,u);x.baseClass&&(x.baseClass.__derivedClasses??=[],x.baseClass.__derivedClasses.push(x));var be=new hr(f,x,!0,!1,!1),q=new hr(f+"*",x,!1,!1,!1),le=new hr(f+" const*",x,!1,!0,!1);return rn[e]={pointerType:q,constPointerType:le},nn(_,D),[be,q,le]})},Hr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function on(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function ta(e,r,t,n,i){if(e<r||e>t){var a=r==t?r:`${r} to ${t}`;i(`function ${n} called with ${e} arguments, expected ${a}`)}}function na(e,r,t,n){var i=on(e),a=e.length-2,s=[],c=["fn"];r&&c.push("thisWired");for(var l=0;l<a;++l)s.push(`arg${l}`),c.push(`arg${l}Wired`);s=s.join(","),c=c.join(",");var u=`return function (${s}) {
|
|
8
|
+
`;u+=`checkArgCount(arguments.length, minArgs, maxArgs, humanName, throwBindingError);
|
|
9
|
+
`,i&&(u+=`var destructors = [];
|
|
10
|
+
`);var f=i?"destructors":"null",h=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];r&&(u+=`var thisWired = classParam['toWireType'](${f}, this);
|
|
11
|
+
`);for(var l=0;l<a;++l)u+=`var arg${l}Wired = argType${l}['toWireType'](${f}, arg${l});
|
|
12
|
+
`,h.push(`argType${l}`);if(u+=(t||n?"var rv = ":"")+`invoker(${c});
|
|
13
|
+
`,i)u+=`runDestructors(destructors);
|
|
14
|
+
`;else for(var l=r?1:2;l<e.length;++l){var m=l===1?"thisWired":"arg"+(l-2)+"Wired";e[l].destructorFunction!==null&&(u+=`${m}_dtor(${m});
|
|
15
|
+
`,h.push(`${m}_dtor`))}return t&&(u+=`var ret = retType['fromWireType'](rv);
|
|
16
|
+
return ret;
|
|
17
|
+
`),u+=`}
|
|
18
|
+
`,h.push("checkArgCount","minArgs","maxArgs"),u=`if (arguments.length !== ${h.length}){ throw new Error(humanName + "Expected ${h.length} closure arguments " + arguments.length + " given."); }
|
|
19
|
+
${u}`,[h,u]}function ia(e){for(var r=e.length-2,t=e.length-1;t>=2&&e[t].optional;--t)r--;return r}function mr(e,r,t,n,i,a){var s=r.length;s<2&&R("argTypes array size mismatch! Must at least get return value and 'this' types!"),p(!a,"Async bindings are only supported with JSPI.");for(var c=r[1]!==null&&t!==null,l=on(r),u=r[0].name!=="void",f=s-2,h=ia(r),m=[e,R,n,i,Hr,r[0],r[1]],_=0;_<s-2;++_)m.push(r[_+2]);if(!l)for(var _=c?1:2;_<r.length;++_)r[_].destructorFunction!==null&&m.push(r[_].destructorFunction);m.push(ta,h,f);let[g,F]=na(r,c,u,a);var I=new Function(...g,F)(...m);return vr(e,I)}var gr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push((d(),T)[r+n*4>>2]);return t},Vr=e=>{e=e.trim();const r=e.indexOf("(");return r===-1?e:(p(e.endsWith(")"),"Parentheses for argument names should match."),e.slice(0,r))},aa=(e,r,t,n,i,a,s,c,l)=>{var u=gr(t,n);r=W(r),r=Vr(r),a=re(i,a,c),J([],[e],f=>{f=f[0];var h=`${f.name}.${r}`;function m(){ye(`Cannot call ${h} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var _=f.registeredClass.constructor;return _[r]===void 0?(m.argCount=t-1,_[r]=m):(Br(_,r,h),_[r].overloadTable[t-1]=m),J([],u,g=>{var F=[g[0],null].concat(g.slice(1)),I=mr(h,F,null,a,s,c);if(_[r].overloadTable===void 0?(I.argCount=t-1,_[r]=I):_[r].overloadTable[t-1]=I,f.registeredClass.__derivedClasses)for(const D of f.registeredClass.__derivedClasses)D.constructor.hasOwnProperty(r)||(D.constructor[r]=I);return[]}),[]})},oa=(e,r,t,n,i,a)=>{p(r>0);var s=gr(r,t);i=re(n,i),J([],[e],c=>{c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[r-1]!==void 0)throw new Ge(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[r-1]=()=>{ye(`Cannot construct ${c.name} due to unbound types`,s)},J([],s,u=>(u.splice(1,0,null),c.registeredClass.constructor_body[r-1]=mr(l,u,null,i,a),[])),[]})},sa=(e,r,t,n,i,a,s,c,l,u)=>{var f=gr(t,n);r=W(r),r=Vr(r),a=re(i,a,l),J([],[e],h=>{h=h[0];var m=`${h.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),c&&h.registeredClass.pureVirtualFunctions.push(r);function _(){ye(`Cannot call ${m} due to unbound types`,f)}var g=h.registeredClass.instancePrototype,F=g[r];return F===void 0||F.overloadTable===void 0&&F.className!==h.name&&F.argCount===t-2?(_.argCount=t-2,_.className=h.name,g[r]=_):(Br(g,r,m),g[r].overloadTable[t-2]=_),J([],f,I=>{var D=mr(m,I,h,a,s,l);return g[r].overloadTable===void 0?(D.argCount=t-2,g[r]=D):g[r].overloadTable[t-2]=D,[]}),[]})},sn=(e,r,t)=>(e instanceof Object||R(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||R(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||R(`cannot call emscripten binding method ${t} on deleted object`),_r(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),ca=(e,r,t,n,i,a,s,c,l,u)=>{r=W(r),i=re(n,i),J([],[e],f=>{f=f[0];var h=`${f.name}.${r}`,m={get(){ye(`Cannot access ${h} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return l?m.set=()=>ye(`Cannot access ${h} due to unbound types`,[t,s]):m.set=_=>R(h+" is a read-only property"),Object.defineProperty(f.registeredClass.instancePrototype,r,m),J([],l?[t,s]:[t],_=>{var g=_[0],F={get(){var D=sn(this,f,h+" getter");return g.fromWireType(i(a,D))},enumerable:!0};if(l){l=re(c,l);var I=_[1];F.set=function(D){var H=sn(this,f,h+" setter"),x=[];l(u,H,I.toWireType(x,D)),Hr(x)}}return Object.defineProperty(f.registeredClass.instancePrototype,r,F),[]}),[]})},la=(e,r,t)=>{e=W(e),J([],[r],n=>(n=n[0],v[e]=n.fromWireType(t),[]))},cn=[],te=[0,1,,1,null,1,!0,1,!1,1],Gr=e=>{e>9&&--te[e+1]===0&&(p(te[e]!==void 0,"Decref for unallocated handle."),te[e]=void 0,cn.push(e))},j={toValue:e=>(e||R(`Cannot use deleted val. handle = ${e}`),p(e===2||te[e]!==void 0&&e%2===0,`invalid handle: ${e}`),te[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=cn.pop()||te.length;return te[r]=e,te[r+1]=1,r}}}},ln={name:"emscripten::val",fromWireType:e=>{var r=j.toValue(e);return Gr(e),r},toWireType:(e,r)=>j.toHandle(r),argPackAdvance:ee,readValueFromPointer:pr,destructorFunction:null},un=e=>X(e,ln),ua=(e,r,t)=>{switch(r){case 1:return t?function(n){return this.fromWireType((d(),B)[n])}:function(n){return this.fromWireType((d(),K)[n])};case 2:return t?function(n){return this.fromWireType((d(),de)[n>>1])}:function(n){return this.fromWireType((d(),ie)[n>>1])};case 4:return t?function(n){return this.fromWireType((d(),S)[n>>2])}:function(n){return this.fromWireType((d(),T)[n>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},da=(e,r,t,n)=>{r=W(r);function i(){}i.values={},X(e,{name:r,constructor:i,fromWireType:function(a){return this.constructor.values[a]},toWireType:(a,s)=>s.value,argPackAdvance:ee,readValueFromPointer:ua(r,t,n),destructorFunction:null}),zr(r,i)},yr=(e,r)=>{var t=me[e];return t===void 0&&R(`${r} has unknown type ${an(e)}`),t},fa=(e,r,t)=>{var n=yr(e,"enum");r=W(r);var i=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:vr(`${n.name}_${r}`,function(){})}});i.values[t]=a,i[r]=a},va=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType((d(),wt)[t>>2])};case 8:return function(t){return this.fromWireType((d(),Ue)[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},_a=(e,r,t)=>{r=W(r),X(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>{if(typeof i!="number"&&typeof i!="boolean")throw new TypeError(`Cannot convert ${ge(i)} to ${this.name}`);return i},argPackAdvance:ee,readValueFromPointer:va(r,t),destructorFunction:null})},pa=(e,r,t,n,i,a,s,c)=>{var l=gr(r,t);e=W(e),e=Vr(e),i=re(n,i,s),zr(e,function(){ye(`Cannot call ${e} due to unbound types`,l)},r-1),J([],l,u=>{var f=[u[0],null].concat(u.slice(1));return nn(e,mr(e,f,null,i,a,s),r-1),[]})},ha=(e,r,t,n,i)=>{r=W(r);const a=n===0;let s=l=>l;if(a){var c=32-8*t;s=l=>l<<c>>>c,i=s(i)}X(e,{name:r,fromWireType:s,toWireType:(l,u)=>{if(typeof u!="number"&&typeof u!="boolean")throw new TypeError(`Cannot convert "${ge(u)}" to ${r}`);return Jt(r,u,n,i),u},argPackAdvance:ee,readValueFromPointer:Xt(r,t,n!==0),destructorFunction:null})},ma=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],i=n[r];function a(s){var c=(d(),T)[s>>2],l=(d(),T)[s+4>>2];return new i((d(),B).buffer,l,c)}t=W(t),X(e,{name:t,fromWireType:a,argPackAdvance:ee,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},ga=Object.assign({optional:!0},ln),ya=(e,r)=>{X(e,ga)},we=(e,r,t)=>(p(typeof t=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),xt(e,(d(),K),r,t)),wa=(e,r)=>{r=W(r),X(e,{name:r,fromWireType(t){for(var n=(d(),T)[t>>2],i=t+4,a,s,c=i,s=0;s<=n;++s){var l=i+s;if(s==n||(d(),K)[l]==0){var u=l-c,f=oe(c,u);a===void 0?a=f:(a+="\0",a+=f),c=l+1}}return ne(t),a},toWireType(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var i,a=typeof n=="string";a||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||R("Cannot pass non-string to std::string"),a?i=Ae(n):i=n.length;var s=Qr(4+i+1),c=s+4;return(d(),T)[s>>2]=i,a?we(n,c,i+1):(d(),K).set(n,c),t!==null&&t.push(ne,s),s},argPackAdvance:ee,readValueFromPointer:pr,destructorFunction(t){ne(t)}})},dn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Ea=(e,r)=>{p(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e>>1,n=t+r/2,i=t;!(i>=n)&&(d(),ie)[i];)++i;if(i-t>16&&dn)return dn.decode((d(),ie).buffer instanceof ArrayBuffer?(d(),ie).subarray(t,i):(d(),ie).slice(t,i));for(var a="",s=t;!(s>=n);++s){var c=(d(),ie)[s];if(c==0)break;a+=String.fromCharCode(c)}return a},ba=(e,r,t)=>{if(p(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),p(typeof t=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<2)return 0;t-=2;for(var n=r,i=t<e.length*2?t/2:e.length,a=0;a<i;++a){var s=e.charCodeAt(a);(d(),de)[r>>1]=s,r+=2}return(d(),de)[r>>1]=0,r-n},ka=e=>e.length*2,Sa=(e,r)=>{p(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t="",n=0;!(n>=r/4);n++){var i=(d(),S)[e+n*4>>2];if(!i)break;t+=String.fromCodePoint(i)}return t},Ta=(e,r,t)=>{if(p(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),p(typeof t=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<4)return 0;for(var n=r,i=n+t-4,a=0;a<e.length;++a){var s=e.codePointAt(a);if(s>65535&&a++,(d(),S)[r>>2]=s,r+=4,r+4>i)break}return(d(),S)[r>>2]=0,r-n},Fa=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.codePointAt(t);n>65535&&t++,r+=4}return r},Pa=(e,r,t)=>{t=W(t);var n,i,a,s;r===2?(n=Ea,i=ba,s=ka,a=c=>(d(),ie)[c>>1]):r===4&&(n=Sa,i=Ta,s=Fa,a=c=>(d(),T)[c>>2]),X(e,{name:t,fromWireType:c=>{for(var l=(d(),T)[c>>2],u,f=c+4,h=0;h<=l;++h){var m=c+4+h*r;if(h==l||a(m)==0){var _=m-f,g=n(f,_);u===void 0?u=g:(u+="\0",u+=g),f=m+r}}return ne(c),u},toWireType:(c,l)=>{typeof l!="string"&&R(`Cannot pass non-string to C++ string type ${t}`);var u=s(l),f=Qr(4+u+r);return(d(),T)[f>>2]=u/r,i(l,f+4,u+r),c!==null&&c.push(ne,f),f},argPackAdvance:ee,readValueFromPointer:pr,destructorFunction(c){ne(c)}})},Aa=(e,r)=>{un(e)},Ca=(e,r)=>{r=W(r),X(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},$a=e=>{rt(e,!Z,1,!Ke,65536,!1),$.threadInitTLS()},fn=e=>{if(e instanceof St||e=="unwind")return Se;Le(),e instanceof WebAssembly.RuntimeError&&it()<=0&&C("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"),Pr(1,e)},Ra=()=>{if(!tr())try{A?nt(Se):Mr(Se)}catch(e){fn(e)}},vn=e=>{if(ke){C("user callback triggered after runtime exited or application aborted. Ignoring.");return}try{e(),Ra()}catch(r){fn(r)}},Yr=e=>{if(typeof Atomics.waitAsync=="function"){var r=Atomics.waitAsync((d(),S),e>>2,e);p(r.async),r.value.then(wr);var t=e+128;Atomics.store((d(),S),t>>2,1)}},wr=()=>{var e=Zr();e&&(Yr(e),vn(Mn))},Da=(e,r)=>{if(e==r)setTimeout(wr);else if(A)postMessage({targetThread:e,cmd:"checkMailbox"});else{var t=$.pthreads[e];if(!t){C(`Cannot send message to thread with ID ${e}, unknown thread ID!`);return}t.postMessage({cmd:"checkMailbox"})}},Er=[],Oa=(e,r,t,n,i)=>{n/=2,Er.length=n;for(var a=i>>3,s=0;s<n;s++)(d(),Y)[a+2*s]?Er[s]=(d(),Y)[a+2*s+1]:Er[s]=(d(),Ue)[a+2*s+1];var c=r?Jr[r]:Wo[e];p(!(e&&r)),p(c.length==n,"Call args mismatch in _emscripten_receive_on_main_thread_js"),$.currentProxiedOperationCallerThread=t;var l=c(...Er);return $.currentProxiedOperationCallerThread=0,p(typeof l!="bigint"),l},Ia=()=>{ir=!1,He=0},Ma=e=>{A?postMessage({cmd:"cleanupThread",thread:e}):Ft(e)},xa=e=>{V&&$.pthreads[e].ref()},Na=()=>{throw new Jn},_n=(e,r,t)=>{var n=[],i=e.toWireType(n,t);return n.length&&((d(),T)[r>>2]=j.toHandle(n)),i},La=(e,r,t)=>(e=j.toValue(e),r=yr(r,"emval::as"),_n(r,t,e)),br=[],Ua=(e,r,t,n)=>(e=br[e],r=j.toValue(r),e(null,r,t,n)),Wa={},qr=e=>{var r=Wa[e];return r===void 0?W(e):r},ja=(e,r,t,n,i)=>(e=br[e],r=j.toValue(r),t=qr(t),e(r,r[t],n,i)),pn=()=>globalThis,Ba=e=>e===0?j.toHandle(pn()):(e=qr(e),j.toHandle(pn()[e])),za=e=>{var r=br.length;return br.push(e),r},Ha=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=yr((d(),T)[r+n*4>>2],`parameter ${n}`);return t},Va=(e,r,t)=>{var n=Ha(e,r),i=n.shift();e--;var a=`return function (obj, func, destructorsRef, args) {
|
|
20
|
+
`,s=0,c=[];t===0&&c.push("obj");for(var l=["retType"],u=[i],f=0;f<e;++f)c.push(`arg${f}`),l.push(`argType${f}`),u.push(n[f]),a+=` var arg${f} = argType${f}.readValueFromPointer(args${s?"+"+s:""});
|
|
21
|
+
`,s+=n[f].argPackAdvance;var h=t===1?"new func":"func.call";a+=` var rv = ${h}(${c.join(", ")});
|
|
22
|
+
`,i.isVoid||(l.push("emval_returnValue"),u.push(_n),a+=` return emval_returnValue(retType, destructorsRef, rv);
|
|
23
|
+
`),a+=`};
|
|
24
|
+
`;var m=new Function(...l,a)(...u),_=`methodCaller<(${n.map(g=>g.name).join(", ")}) => ${i.name}>`;return za(vr(_,m))},Ga=(e,r)=>(e=j.toValue(e),r=j.toValue(r),j.toHandle(e[r])),Ya=e=>{e>9&&(te[e+1]+=1)},qa=e=>(e=j.toValue(e),typeof e=="number"),Ka=e=>(e=j.toValue(e),typeof e=="string"),Xa=()=>j.toHandle([]),Ja=e=>j.toHandle(qr(e)),Za=e=>{var r=j.toValue(e);Hr(r),Gr(e)},Qa=(e,r)=>{e=yr(e,"_emval_take_value");var t=e.readValueFromPointer(r);return j.toHandle(t)},eo=e=>{throw e=j.toValue(e),e},ro=e=>e%4===0&&(e%100!==0||e%400===0),to=[0,31,60,91,121,152,182,213,244,274,305,335],no=[0,31,59,90,120,151,181,212,243,273,304,334],io=e=>{var r=ro(e.getFullYear()),t=r?to:no,n=t[e.getMonth()]+e.getDate()-1;return n},ao=9007199254740992,oo=-9007199254740992,hn=e=>e<oo||e>ao?NaN:Number(e);function so(e,r){e=hn(e);var t=new Date(e*1e3);(d(),S)[r>>2]=t.getSeconds(),(d(),S)[r+4>>2]=t.getMinutes(),(d(),S)[r+8>>2]=t.getHours(),(d(),S)[r+12>>2]=t.getDate(),(d(),S)[r+16>>2]=t.getMonth(),(d(),S)[r+20>>2]=t.getFullYear()-1900,(d(),S)[r+24>>2]=t.getDay();var n=io(t)|0;(d(),S)[r+28>>2]=n,(d(),S)[r+36>>2]=-(t.getTimezoneOffset()*60);var i=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),c=(a!=s&&t.getTimezoneOffset()==Math.min(s,a))|0;(d(),S)[r+32>>2]=c}var Re={},Kr=()=>performance.timeOrigin+performance.now();function mn(e,r){if(A)return G(10,0,1,e,r);if(Re[e]&&(clearTimeout(Re[e].id),delete Re[e]),!r)return 0;var t=setTimeout(()=>{p(e in Re),delete Re[e],vn(()=>On(e,Kr()))},r);return Re[e]={id:t,timeout_ms:r},0}var co=(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),s=new Date(i,6,1),c=a.getTimezoneOffset(),l=s.getTimezoneOffset(),u=Math.max(c,l);(d(),T)[e>>2]=u*60,(d(),S)[r>>2]=+(c!=l);var f=_=>{var g=_>=0?"-":"+",F=Math.abs(_),I=String(Math.floor(F/60)).padStart(2,"0"),D=String(F%60).padStart(2,"0");return`UTC${g}${I}${D}`},h=f(c),m=f(l);p(h),p(m),p(Ae(h)<=16,`timezone name truncated to fit in TZNAME_MAX (${h})`),p(Ae(m)<=16,`timezone name truncated to fit in TZNAME_MAX (${m})`),l<c?(we(h,t,17),we(m,n,17)):(we(h,n,17),we(m,t,17))},gn=()=>Date.now(),lo=e=>e>=0&&e<=3;function uo(e,r,t){if(!lo(e))return 28;var n;e===0?n=gn():n=Kr();var i=Math.round(n*1e3*1e3);return(d(),Y)[t>>3]=BigInt(i),0}var kr=[],fo=(e,r)=>{p(Array.isArray(kr)),p(r%16==0),kr.length=0;for(var t;t=(d(),K)[e++];){var n=String.fromCharCode(t),i=["d","f","i","p"];i.push("j"),p(i.includes(n),`Invalid character ${t}("${n}") in readEmAsmArgs! Use only [${i}], and do not specify "v" for void return argument.`);var a=t!=105;a&=t!=112,r+=a&&r%8?4:0,kr.push(t==112?(d(),T)[r>>2]:t==106?(d(),Y)[r>>3]:t==105?(d(),S)[r>>2]:(d(),Ue)[r>>3]),r+=a?8:4}return kr},vo=(e,r,t)=>{var n=fo(r,t);return p(Jr.hasOwnProperty(e),`No EM_ASM constant found at address ${e}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`),Jr[e](...n)},_o=(e,r,t)=>vo(e,r,t),po=()=>{V||Z||ae("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},ho=()=>{He+=1},mo=()=>{throw ho(),"unwind"},yn=()=>2147483648,go=()=>yn(),yo=()=>V?ve("os").cpus().length:navigator.hardwareConcurrency,wo=(e,r)=>(p(r,"alignment argument is required"),Math.ceil(e/r)*r),Eo=e=>{var r=Q.buffer,t=(e-r.byteLength+65535)/65536|0;try{return Q.grow(t),er(),1}catch(n){C(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},bo=e=>{var r=(d(),K).length;if(e>>>=0,e<=r)return!1;var t=yn();if(e>t)return C(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${t} bytes!`),!1;for(var n=1;n<=4;n*=2){var i=r*(1+.2/n);i=Math.min(i,e+100663296);var a=Math.min(t,wo(Math.max(e,i),65536)),s=Eo(a);if(s)return!0}return C(`Failed to grow the heap from ${r} bytes to ${a} bytes, not enough memory!`),!1},Xr={},ko=()=>Fr||"./this.program",qe=()=>{if(!qe.strings){var e=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:ko()};for(var t in Xr)Xr[t]===void 0?delete r[t]:r[t]=Xr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);qe.strings=n}return qe.strings};function wn(e,r){if(A)return G(11,0,1,e,r);var t=0,n=0;for(var i of qe()){var a=r+t;(d(),T)[e+n>>2]=a,t+=we(i,a,1/0)+1,n+=4}return 0}function En(e,r){if(A)return G(12,0,1,e,r);var t=qe();(d(),T)[e>>2]=t.length;var n=0;for(var i of t)n+=Ae(i)+1;return(d(),T)[r>>2]=n,0}function bn(e){if(A)return G(13,0,1,e);try{var r=N.getStreamFromFD(e);return o.close(r),0}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var So=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=(d(),T)[r>>2],c=(d(),T)[r+4>>2];r+=8;var l=o.read(e,(d(),B),s,c,n);if(l<0)return-1;if(i+=l,l<c)break}return i};function kn(e,r,t,n){if(A)return G(14,0,1,e,r,t,n);try{var i=N.getStreamFromFD(e),a=So(i,r,t);return(d(),T)[n>>2]=a,0}catch(s){if(typeof o>"u"||s.name!=="ErrnoError")throw s;return s.errno}}function Sn(e,r,t,n){if(A)return G(15,0,1,e,r,t,n);r=hn(r);try{if(isNaN(r))return 61;var i=N.getStreamFromFD(e);return o.llseek(i,r,t),(d(),Y)[n>>3]=BigInt(i.position),i.getdents&&r===0&&t===0&&(i.getdents=null),0}catch(a){if(typeof o>"u"||a.name!=="ErrnoError")throw a;return a.errno}}var To=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=(d(),T)[r>>2],c=(d(),T)[r+4>>2];r+=8;var l=o.write(e,(d(),B),s,c,n);if(l<0)return-1;if(i+=l,l<c)break}return i};function Tn(e,r,t,n){if(A)return G(16,0,1,e,r,t,n);try{var i=N.getStreamFromFD(e),a=To(i,r,t);return(d(),T)[n>>2]=a,0}catch(s){if(typeof o>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var Fo=e=>e,Po=e=>{var r=v["_"+e];return p(r,"Cannot call unknown function "+e+", make sure it is exported"),r},Ao=(e,r)=>{p(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),(d(),B).set(e,r)},Co=e=>{var r=Ae(e)+1,t=Ve(r);return we(e,t,r),t},Fn=(e,r,t,n,i)=>{var a={string:g=>{var F=0;return g!=null&&g!==0&&(F=Co(g)),F},array:g=>{var F=Ve(g.length);return Ao(g,F),F}};function s(g){return r==="string"?oe(g):r==="boolean"?!!g:g}var c=Po(e),l=[],u=0;if(p(r!=="array",'Return type should not be "array".'),n)for(var f=0;f<n.length;f++){var h=a[t[f]];h?(u===0&&(u=w()),l[f]=h(n[f])):l[f]=n[f]}var m=c(...l);function _(g){return u!==0&&y(u),s(g)}return m=_(m),m},$o=(e,r,t,n)=>(...i)=>Fn(e,r,t,i),Ro=(...e)=>o.createPath(...e),Do=(...e)=>o.unlink(...e),Oo=(...e)=>o.createLazyFile(...e),Io=(...e)=>o.createDevice(...e),Mo=e=>Sr(e),xo=e=>at(e),No=e=>{var r=w(),t=Ve(4),n=Ve(4);jn(e,t,n);var i=(d(),T)[t>>2],a=(d(),T)[n>>2],s=oe(i);ne(i);var c;return a&&(c=oe(a),ne(a)),y(r),[s,c]},Pn=e=>No(e);$.init(),o.createPreloadedFile=Wt,o.staticInit(),Vi(),Qi(),p(te.length===10),ri(),v.noExitRuntime&&(ir=v.noExitRuntime),v.preloadPlugins&&(Ut=v.preloadPlugins),v.print&&(ue=v.print),v.printErr&&(C=v.printErr),v.wasmBinary&&(xe=v.wasmBinary),jo(),v.arguments&&v.arguments,v.thisProgram&&(Fr=v.thisProgram),p(typeof v.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),p(typeof v.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),p(typeof v.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),p(typeof v.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),p(typeof v.read>"u","Module.read option was removed"),p(typeof v.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),p(typeof v.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),p(typeof v.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),p(typeof v.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),p(typeof v.ENVIRONMENT>"u","Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"),p(typeof v.STACK_SIZE>"u","STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),v.addRunDependency=rr,v.removeRunDependency=Be,v.ccall=Fn,v.cwrap=$o,v.FS_createPreloadedFile=Wt,v.FS_unlink=Do,v.FS_createPath=Ro,v.FS_createDevice=Io,v.FS=o,v.FS_createDataFile=Lt,v.FS_createLazyFile=Oo,v.MEMFS=P;var Lo=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getTempRet0","zeroMemory","withStackSave","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","runMainThreadEmAsm","jstoi_q","autoResumeAudioContext","getDynCaller","dynCall","runtimeKeepalivePop","asmjsMangle","HandleAllocator","getNativeTypeSize","addOnInit","addOnPostCtor","addOnPreMain","addOnExit","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","stringToAscii","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSizeCallingThread","setCanvasElementSizeMainThread","setCanvasElementSize","getCanvasSizeCallingThread","getCanvasSizeMainThread","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","safeSetTimeout","setImmediateWrapped","safeRequestAnimationFrame","clearImmediateWrapped","registerPostMainLoop","registerPreMainLoop","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","arraySum","addDays","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","webgl_enable_EXT_polygon_offset_clamp","webgl_enable_EXT_clip_control","webgl_enable_WEBGL_polygon_mode","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","emscripten_webgl_destroy_context_before_on_calling_thread","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","demangle","stackTrace","getFunctionArgsName","createJsInvokerSignature","PureVirtualError","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","setDelayFunction","count_emval_handles"];Lo.forEach(Qn);var Uo=["run","out","err","callMain","abort","wasmMemory","wasmExports","HEAPF32","HEAPF64","HEAP8","HEAPU8","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAP64","HEAPU64","writeStackCookie","checkStackCookie","INT53_MAX","INT53_MIN","bigintToI53Checked","stackSave","stackRestore","stackAlloc","setTempRet0","ptrToString","exitJS","getHeapMax","growMemory","ENV","ERRNO_CODES","strError","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","readEmAsmArgs","runEmAsmFunction","getExecutableName","handleException","keepRuntimeAlive","runtimeKeepalivePush","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","wasmTable","getUniqueRunDependency","noExitRuntime","addOnPreRun","addOnPostRun","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","AsciiToString","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","checkWasiClock","doReadv","doWritev","initRandomFill","randomFill","emSetImmediate","emClearImmediate_deps","emClearImmediate","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","Browser","requestFullscreen","requestFullScreen","setCanvasSize","getUserMedia","createContext","getPreloadedImageData__data","wget","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS_readFile","FS_root","FS_mounts","FS_devices","FS_streams","FS_nextInode","FS_nameTable","FS_currentPath","FS_initialized","FS_ignorePermissions","FS_filesystems","FS_syncFSRequests","FS_readFiles","FS_lookupPath","FS_getPath","FS_hashName","FS_hashAddNode","FS_hashRemoveNode","FS_lookupNode","FS_createNode","FS_destroyNode","FS_isRoot","FS_isMountpoint","FS_isFile","FS_isDir","FS_isLink","FS_isChrdev","FS_isBlkdev","FS_isFIFO","FS_isSocket","FS_flagsToPermissionString","FS_nodePermissions","FS_mayLookup","FS_mayCreate","FS_mayDelete","FS_mayOpen","FS_checkOpExists","FS_nextfd","FS_getStreamChecked","FS_getStream","FS_createStream","FS_closeStream","FS_dupStream","FS_doSetAttr","FS_chrdev_stream_ops","FS_major","FS_minor","FS_makedev","FS_registerDevice","FS_getDevice","FS_getMounts","FS_syncfs","FS_mount","FS_unmount","FS_lookup","FS_mknod","FS_statfs","FS_statfsStream","FS_statfsNode","FS_create","FS_mkdir","FS_mkdev","FS_symlink","FS_rename","FS_rmdir","FS_readdir","FS_readlink","FS_stat","FS_fstat","FS_lstat","FS_doChmod","FS_chmod","FS_lchmod","FS_fchmod","FS_doChown","FS_chown","FS_lchown","FS_fchown","FS_doTruncate","FS_truncate","FS_ftruncate","FS_utime","FS_open","FS_close","FS_isClosed","FS_llseek","FS_read","FS_write","FS_mmap","FS_msync","FS_ioctl","FS_writeFile","FS_cwd","FS_chdir","FS_createDefaultDirectories","FS_createDefaultDevices","FS_createSpecialDirectories","FS_createStandardStreams","FS_staticInit","FS_init","FS_quit","FS_findObject","FS_analyzePath","FS_createFile","FS_forceLoadFile","FS_absolutePath","FS_createFolder","FS_createLink","FS_joinPath","FS_mmapAlloc","FS_standardizePath","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr","jstoi_s","PThread","terminateWorker","cleanupThread","registerTLSInit","spawnThread","exitOnMainThread","proxyToMainThread","proxiedJSCallArgs","invokeEntryPoint","checkMailbox","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","checkArgCount","getRequiredArgCount","createJsInvoker","UnboundTypeError","GenericWireTypeSize","EmValType","EmValOptionalType","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","assertIntegerRange","readPointer","runDestructors","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_freelist","emval_handles","emval_symbols","getStringOrSymbol","Emval","emval_get_global","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller"];Uo.forEach(mt),v.incrementExceptionRefcount=Mo,v.decrementExceptionRefcount=xo,v.getExceptionMessage=Pn;var Wo=[Ir,$t,Bt,zt,Ht,Vt,Gt,Yt,qt,Kt,mn,wn,En,bn,kn,Sn,Tn];function jo(){Zn("fetchSettings")}var Jr={456728:()=>{typeof v<"u"&&"mjDISABLESTRING mjENABLESTRING mjFRAMESTRING mjLABELSTRING mjRNDSTRING mjTIMERSTRING mjVISSTRING".split(" ").forEach(function(e){Object.defineProperty(v,e,{get:function(){return v["get_"+e]()},set:function(r){},enumerable:!0,configurable:!0})})}},An=M("___getTypeName"),Cn=M("__embind_initialize_bindings"),Zr=M("_pthread_self"),Qr=M("_malloc"),et=M("_fflush"),ne=M("_free"),rt=M("__emscripten_thread_init"),$n=M("__emscripten_thread_crashed"),tt=M("_emscripten_stack_get_end"),Rn=M("__emscripten_run_on_main_thread_js"),Dn=M("__emscripten_thread_free_data"),nt=M("__emscripten_thread_exit"),On=M("__emscripten_timeout"),In=M("_strerror"),Mn=M("__emscripten_check_mailbox"),k=M("_setThrew"),xn=M("__emscripten_tempret_set"),Nn=M("_emscripten_stack_init"),Ln=M("_emscripten_stack_set_limits"),Un=M("__emscripten_stack_restore"),Wn=M("__emscripten_stack_alloc"),it=M("_emscripten_stack_get_current"),at=M("___cxa_decrement_exception_refcount"),Sr=M("___cxa_increment_exception_refcount"),jn=M("___get_exception_message"),Bn=M("___cxa_can_catch"),zn=M("___cxa_get_exception_ptr");function Bo(e){An=U("__getTypeName",1),Cn=U("_embind_initialize_bindings",0),Zr=e.pthread_self,Qr=U("malloc",1),et=U("fflush",1),ne=U("free",1),rt=U("_emscripten_thread_init",6),$n=U("_emscripten_thread_crashed",0),tt=e.emscripten_stack_get_end,e.emscripten_stack_get_base,Rn=U("_emscripten_run_on_main_thread_js",5),Dn=U("_emscripten_thread_free_data",1),nt=U("_emscripten_thread_exit",1),On=U("_emscripten_timeout",2),In=U("strerror",1),Mn=U("_emscripten_check_mailbox",0),k=U("setThrew",2),xn=U("_emscripten_tempret_set",1),Nn=e.emscripten_stack_init,Ln=e.emscripten_stack_set_limits,e.emscripten_stack_get_free,Un=e._emscripten_stack_restore,Wn=e._emscripten_stack_alloc,it=e.emscripten_stack_get_current,at=U("__cxa_decrement_exception_refcount",1),Sr=U("__cxa_increment_exception_refcount",1),jn=U("__get_exception_message",3),Bn=U("__cxa_can_catch",3),zn=U("__cxa_get_exception_ptr",1)}var ot;function zo(){ot={__assert_fail:hi,__call_sighandler:mi,__cxa_begin_catch:gi,__cxa_current_primary_exception:yi,__cxa_end_catch:wi,__cxa_find_matching_catch_2:Ei,__cxa_find_matching_catch_3:bi,__cxa_find_matching_catch_4:ki,__cxa_rethrow:It,__cxa_rethrow_primary_exception:Si,__cxa_throw:Ti,__cxa_uncaught_exceptions:Fi,__resumeException:Pi,__syscall_dup3:Bt,__syscall_fcntl64:zt,__syscall_fstat64:Ht,__syscall_ioctl:Vt,__syscall_lstat64:Gt,__syscall_newfstatat:Yt,__syscall_openat:qt,__syscall_stat64:Kt,_abort_js:Mi,_embind_register_bigint:Ni,_embind_register_bool:Li,_embind_register_class:ra,_embind_register_class_class_function:aa,_embind_register_class_constructor:oa,_embind_register_class_function:sa,_embind_register_class_property:ca,_embind_register_constant:la,_embind_register_emval:un,_embind_register_enum:da,_embind_register_enum_value:fa,_embind_register_float:_a,_embind_register_function:pa,_embind_register_integer:ha,_embind_register_memory_view:ma,_embind_register_optional:ya,_embind_register_std_string:wa,_embind_register_std_wstring:Pa,_embind_register_user_type:Aa,_embind_register_void:Ca,_emscripten_init_main_thread_js:$a,_emscripten_notify_mailbox_postmessage:Da,_emscripten_receive_on_main_thread_js:Oa,_emscripten_runtime_keepalive_clear:Ia,_emscripten_thread_cleanup:Ma,_emscripten_thread_mailbox_await:Yr,_emscripten_thread_set_strongref:xa,_emscripten_throw_longjmp:Na,_emval_as:La,_emval_call:Ua,_emval_call_method:ja,_emval_decref:Gr,_emval_get_global:Ba,_emval_get_method_caller:Va,_emval_get_property:Ga,_emval_incref:Ya,_emval_is_number:qa,_emval_is_string:Ka,_emval_new_array:Xa,_emval_new_cstring:Ja,_emval_run_destructors:Za,_emval_take_value:Qa,_emval_throw:eo,_localtime_js:so,_setitimer_js:mn,_tzset_js:co,clock_time_get:uo,emscripten_asm_const_int:_o,emscripten_check_blocking_allowed:po,emscripten_date_now:gn,emscripten_exit_with_live_runtime:mo,emscripten_get_heap_max:go,emscripten_get_now:Kr,emscripten_num_logical_cores:yo,emscripten_resize_heap:bo,environ_get:wn,environ_sizes_get:En,exit:Mr,fd_close:bn,fd_read:kn,fd_seek:Sn,fd_write:Tn,invoke_dddi:Ms,invoke_dddidi:gs,invoke_ddidi:Is,invoke_di:xs,invoke_dii:$s,invoke_diii:ns,invoke_diiii:Ko,invoke_diiiidd:ms,invoke_diiiidi:as,invoke_diiiii:Qo,invoke_diiiiii:us,invoke_diiiiiii:ys,invoke_diiiiiiiii:cs,invoke_diiiiiiiiiiii:ls,invoke_fiii:Xs,invoke_i:es,invoke_ii:Vo,invoke_iid:Ds,invoke_iif:Vs,invoke_iii:Yo,invoke_iiid:ps,invoke_iiididdddddd:_s,invoke_iiidiiiiiiii:vs,invoke_iiii:qo,invoke_iiiidddiiiii:Es,invoke_iiiii:Go,invoke_iiiiid:qs,invoke_iiiiii:Ws,invoke_iiiiiii:Ns,invoke_iiiiiiii:Rs,invoke_iiiiiiiiii:Ls,invoke_iiiiiiiiiiii:Js,invoke_iiji:js,invoke_ji:Bs,invoke_jiiii:Ks,invoke_v:Ho,invoke_vi:Xo,invoke_vid:Os,invoke_vidi:Gs,invoke_vidiii:fs,invoke_vii:Zo,invoke_viid:bs,invoke_viiddii:ws,invoke_viidi:Us,invoke_viidii:ks,invoke_viidiiid:As,invoke_viidiiiii:Fs,invoke_viidiiiiiiii:ds,invoke_viii:is,invoke_viiid:Ts,invoke_viiididdddddd:Cs,invoke_viiidiiiiiiii:Ps,invoke_viiii:ts,invoke_viiiii:Jo,invoke_viiiiid:Ss,invoke_viiiiii:rs,invoke_viiiiiii:os,invoke_viiiiiiii:hs,invoke_viiiiiiiiii:Hs,invoke_viiiiiiiiiiid:ss,invoke_viiiiiiiiiiiii:zs,invoke_viiiiiiiiiiiiiii:Zs,invoke_viiji:Ys,llvm_eh_typeid_for:Fo,memory:Q,proc_exit:Ir}}var Ee=await li();function Ho(e){var r=w();try{E(e)()}catch(t){if(y(r),!(t instanceof b))throw t;k(1,0)}}function Vo(e,r){var t=w();try{return E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;k(1,0)}}function Go(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Yo(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function qo(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Ko(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Xo(e,r){var t=w();try{E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;k(1,0)}}function Jo(e,r,t,n,i,a){var s=w();try{E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Zo(e,r,t){var n=w();try{E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Qo(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function es(e){var r=w();try{return E(e)()}catch(t){if(y(r),!(t instanceof b))throw t;k(1,0)}}function rs(e,r,t,n,i,a,s){var c=w();try{E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function ts(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function ns(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function is(e,r,t,n){var i=w();try{E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function as(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function os(e,r,t,n,i,a,s,c){var l=w();try{E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function ss(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function cs(e,r,t,n,i,a,s,c,l,u){var f=w();try{return E(e)(r,t,n,i,a,s,c,l,u)}catch(h){if(y(f),!(h instanceof b))throw h;k(1,0)}}function ls(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function us(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function ds(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function fs(e,r,t,n,i,a){var s=w();try{E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function vs(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function _s(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function ps(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function hs(e,r,t,n,i,a,s,c,l){var u=w();try{E(e)(r,t,n,i,a,s,c,l)}catch(f){if(y(u),!(f instanceof b))throw f;k(1,0)}}function ms(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function gs(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function ys(e,r,t,n,i,a,s,c){var l=w();try{return E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function ws(e,r,t,n,i,a,s){var c=w();try{E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function Es(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function bs(e,r,t,n){var i=w();try{E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function ks(e,r,t,n,i,a){var s=w();try{E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Ss(e,r,t,n,i,a,s){var c=w();try{E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function Ts(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Fs(e,r,t,n,i,a,s,c,l){var u=w();try{E(e)(r,t,n,i,a,s,c,l)}catch(f){if(y(u),!(f instanceof b))throw f;k(1,0)}}function Ps(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function As(e,r,t,n,i,a,s,c){var l=w();try{E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function Cs(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function $s(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Rs(e,r,t,n,i,a,s,c){var l=w();try{return E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function Ds(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Os(e,r,t){var n=w();try{E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Is(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Ms(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function xs(e,r){var t=w();try{return E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;k(1,0)}}function Ns(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function Ls(e,r,t,n,i,a,s,c,l,u){var f=w();try{return E(e)(r,t,n,i,a,s,c,l,u)}catch(h){if(y(f),!(h instanceof b))throw h;k(1,0)}}function Us(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Ws(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function js(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Bs(e,r){var t=w();try{return E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;return k(1,0),0n}}function zs(e,r,t,n,i,a,s,c,l,u,f,h,m,_){var g=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m,_)}catch(F){if(y(g),!(F instanceof b))throw F;k(1,0)}}function Hs(e,r,t,n,i,a,s,c,l,u,f){var h=w();try{E(e)(r,t,n,i,a,s,c,l,u,f)}catch(m){if(y(h),!(m instanceof b))throw m;k(1,0)}}function Vs(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Gs(e,r,t,n){var i=w();try{E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Ys(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function qs(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Ks(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;return k(1,0),0n}}function Xs(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Js(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function Zs(e,r,t,n,i,a,s,c,l,u,f,h,m,_,g,F){var I=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m,_,g,F)}catch(D){if(y(I),!(D instanceof b))throw D;k(1,0)}}var Hn;function Qs(){p(!A),Nn(),vt()}function st(){if(_e>0){je=st;return}if(A){Rr?.(v),bt();return}if(Qs(),ti(),_e>0){je=st;return}function e(){p(!Hn),Hn=!0,v.calledRun=!0,!ke&&(bt(),Rr?.(v),v.onRuntimeInitialized?.(),Qe("onRuntimeInitialized"),p(!v._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),ni())}v.setStatus?(v.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>v.setStatus(""),1),e()},1)):e(),Le()}function ec(){var e=ue,r=C,t=!1;ue=C=n=>{t=!0};try{et(0),["stdout","stderr"].forEach(n=>{var i=o.analyzePath("/dev/"+n);if(i){var a=i.object,s=a.rdev,c=fe.ttys[s];c?.output?.length&&(t=!0)}})}catch{}ue=e,C=r,t&&ae("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.")}function rc(){if(v.preInit)for(typeof v.preInit=="function"&&(v.preInit=[v.preInit]);v.preInit.length>0;)v.preInit.shift()();Qe("preInit")}rc(),st(),We?Tr=v:Tr=new Promise((e,r)=>{Rr=e,Dr=r});for(const e of Object.keys(v))e in De||Object.defineProperty(De,e,{configurable:!0,get(){z(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return Tr}),qn=globalThis.self?.name?.startsWith("em-pthread"),nc=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";nc&&(qn=(await Gn(async()=>{const{workerData:De}=await Promise.resolve().then(()=>Yn);return{workerData:De}},void 0)).workerData==="em-pthread");qn&&tc();export{tc as default};
|
|
Binary file
|