"].indexOf(p[0])>-1?void 0:p[0];return new e({functionName:f,fileName:y,lineNumber:p[1],columnNumber:p[2],source:c})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:i(function(s){var l=s.stack.split(`\n`).filter(function(c){return!c.match(o)},this);return l.map(function(c){if(c.indexOf(" > eval")>-1&&(c=c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),c.indexOf("@")===-1&&c.indexOf(":")===-1)return new e({functionName:c});var u=/((.*".+"[^@]*)?[^@]*)(?:@)/,d=c.match(u),p=d&&d[1]?d[1]:void 0,f=this.extractLocation(c.replace(u,""));return new e({functionName:p,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:c})},this)},"ErrorStackParser$$parseFFOrSafari"),parseOpera:i(function(s){return!s.stacktrace||s.message.indexOf(`\n`)>-1&&s.message.split(`\n`).length>s.stacktrace.split(`\n`).length?this.parseOpera9(s):s.stack?this.parseOpera11(s):this.parseOpera10(s)},"ErrorStackParser$$parseOpera"),parseOpera9:i(function(s){for(var l=/Line (\d+).*script (?:in )?(\S+)/i,c=s.message.split(`\n`),u=[],d=2,p=c.length;d/,"$2").replace(/\([^)]*\)/g,"")||void 0,y;p.match(/\(([^)]*)\)/)&&(y=p.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var _=y===void 0||y==="[arguments not available]"?void 0:y.split(",");return new e({functionName:f,args:_,fileName:d[0],lineNumber:d[1],columnNumber:d[2],source:c})},this)},"ErrorStackParser$$parseOpera11")}},"ErrorStackParser"))});var Or=E(er());function Fr(r){if(typeof r=="string")r=new Error(r);else if(r&&typeof r=="object"&&r.name==="ExitStatus"){let e=r.status;r=new $(r.message),r.status=e}else if(typeof r!="object"||r===null||typeof r.stack!="string"||typeof r.message!="string"){let e=API.getTypeTag(r),t=`A value of type ${typeof r} with tag ${e} was thrown as an error!`;try{t+=`\nString interpolation of the thrown value gives """${r}""".`}catch{t+=`\nString interpolation of the thrown value fails.`}try{t+=`\nThe thrown value's toString method returns """${r.toString()}""".`}catch{t+=`\nThe thrown value's toString method fails.`}r=new Error(t)}return r}i(Fr,"ensureCaughtObjectIsError");var G=class extends Error{constructor(t,n,o){n||(n=`The exception is an object of type ${t} at address ${o} which does not inherit from std::exception`);super(n);this.ty=t}};i(G,"CppException");Object.defineProperty(G.prototype,"name",{get(){return`${this.constructor.name} ${this.ty}`}});var Ct=WebAssembly.Exception||function(){},Nr=i(r=>r instanceof Ct,"isWasmException");function Tr(r){if(Nr(r))if(r.is(Module.jsWrapperTag))r=r.getArg(Module.jsWrapperTag,0);else return r;let[e,t]=Module.getExceptionMessage(r);return new G(e,t,r)}i(Tr,"convertCppException");Tests.convertCppException=Tr;var kr=!1;API.fatal_error=function(r){if(r&&r.pyodide_fatal_error)return;if(kr){console.error("Recursive call to fatal_error. Inner error was:"),console.error(r);return}if(r instanceof L)throw r;typeof r=="number"||Nr(r)?r=Tr(r):r=Fr(r),r.pyodide_fatal_error=!0,kr=!0;let e=r instanceof $;e||(console.error("Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers."),console.error("The cause of the fatal error was:"),API.inTestHoist?(console.error(r.toString()),console.error(r.stack)):console.error(r));try{e||_dump_traceback();let n=`Pyodide already ${e?"exited":"fatally failed"} and can no longer be used.`;for(let o of Reflect.ownKeys(API.public_api))typeof o=="string"&&o.startsWith("_")||o==="version"||Object.defineProperty(API.public_api,o,{enumerable:!0,configurable:!0,get:()=>{throw new Error(n)}});API.on_fatal&&API.on_fatal(r)}catch(t){console.error("Another error occurred while handling the fatal error:"),console.error(t)}throw r};API.maybe_fatal_error=function(r){API._skip_unwind_fatal_error&&r==="unwind"||API.fatal_error(r)};var rr=[];API.capture_stderr=function(){rr=[],FS.createDevice("/dev","capture_stderr",null,r=>rr.push(r)),FS.closeStream(2),FS.open("/dev/capture_stderr",1)};API.restore_stderr=function(){return FS.closeStream(2),FS.unlink("/dev/capture_stderr"),FS.open("/dev/stderr",1),(new TextDecoder).decode(new Uint8Array(rr))};API.fatal_loading_error=function(...r){let e=r.join(" ");if(_PyErr_Occurred()){API.capture_stderr(),_PyErr_Print();let t=API.restore_stderr();e+=`\n`+t}throw new z(e)};function tr(r){if(!r)return!1;let e=r.fileName||"";if(e.includes("wasm-function"))return!0;if(!e.includes("pyodide.asm.js"))return!1;let t=r.functionName||"";return t.startsWith("Object.")&&(t=t.slice(7)),API.public_api&&t in API.public_api&&t!=="PythonError"?(r.functionName=t,!1):!0}i(tr,"isPyodideFrame");function Mr(r){return tr(r)&&r.functionName==="new_error"}i(Mr,"isErrorStart");Module.handle_js_error=function(r){if(r&&r.pyodide_fatal_error)throw r;if(r instanceof A)return;let e=!1;r instanceof O&&(e=_restore_sys_last_exception(r.__error_address));let t,n;try{t=Or.default.parse(r)}catch{n=!0}if(n&&(r=Fr(r)),!e){let o=_JsProxy_create(r);_set_error(o),_Py_DecRef(o)}if(!n){if(Mr(t[0])||Mr(t[1]))for(;tr(t[0]);)t.shift();for(let o of t){if(tr(o))break;let a=stringToNewUTF8(o.functionName||"???"),s=stringToNewUTF8(o.fileName||"???.js");__PyTraceback_Add(a,s,o.lineNumber),_free(a),_free(s)}}};var O=class extends Error{constructor(t,n,o){let a=Error.stackTraceLimit;Error.stackTraceLimit=1/0;super(n);Error.stackTraceLimit=a,this.type=t,this.__error_address=o}};i(O,"PythonError");API.PythonError=O;var A=class extends Error{constructor(){super("If you are seeing this message, an internal Pyodide error has occurred. Please report it to the Pyodide maintainers.")}};i(A,"_PropagatePythonError");function Ut(r){Object.defineProperty(r.prototype,"name",{value:r.name})}i(Ut,"setName");var z=class extends Error{};i(z,"FatalPyodideError");var $=class extends Error{};i($,"Exit");var L=class extends Error{};i(L,"NoGilError");[A,z,$,O,L].forEach(Ut);API.NoGilError=L;API.errorConstructors=new Map([EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(r=>r).map(r=>[r.constructor.name,r]));API.deserializeError=function(r,e,t){let n=API.errorConstructors.get(r)||Error,o=new n(e);return API.errorConstructors.has(r)||(o.name=r),o.message=e,o.stack=t,o};function jt(r){let e=0,t=0;for(let a of r){t++;let s=a.codePointAt(0);e=s>e?s:e}let n=_PyUnicode_New(t,e);if(n===0)throw new A;let o=_PyUnicode_Data(n);if(e>65535)for(let a of r)HEAPU32[o/4]=a.codePointAt(0),o+=4;else if(e>255)for(let a of r)HEAPU16[o/2]=a.codePointAt(0),o+=2;else for(let a of r)HEAPU8[o]=a.codePointAt(0),o+=1;return n}i(jt,"js2python_string");function Bt(r){let e=r,t=0;for(r<0&&(r=-r),r<<=BigInt(1);r;)t++,r>>=BigInt(32);let n=stackSave(),o=stackAlloc(t*4);r=e;for(let s=0;s>2)+s]=Number(r&BigInt(4294967295)),r>>=BigInt(32);let a=__PyLong_FromByteArray(o,t*4,!0,!0);return stackRestore(n),a}i(Bt,"js2python_bigint");function K(r){let e=Ht(r);if(e===0)throw new A;return e}i(K,"js2python_convertImmutable");Module.js2python_convertImmutable=K;function Ht(r){let e=typeof r;if(e==="string")return jt(r);if(e==="number")return Number.isSafeInteger(r)?_PyLong_FromDouble(r):_PyFloat_FromDouble(r);if(e==="bigint")return Bt(r);if(r==null)return __js2python_none();if(r===!0)return __js2python_true();if(r===!1)return __js2python_false();if(API.isPyProxy(r)){let{props:t,shared:n}=Module.PyProxy_getAttrs(r);return t.roundtrip?_JsProxy_create(r):__js2python_pyproxy(n.ptr)}}i(Ht,"js2python_convertImmutableInner");function Wt(r,e){let t=_PyList_New(r.length);if(t===0)return 0;let n=0;try{e.cache.set(r,t);for(let o=0;oModule.pyproxy_new(he(o,n)),cacheConversion(o,a){if(API.isPyProxy(a))n.cache.set(o,Module.PyProxy_getPtr(a));else throw new Error("Second argument should be a PyProxy!")}};return he(r,n)}i(Kt,"js2python_convert");Module.js2python_convert=Kt;Module.processBufferFormatString=function(r,e=""){if(r.length>2)throw new Error(`Expected format string to have length <= 2, got '${r}'.`+e);let t=r.slice(-1),n=r.slice(0,-1),o;switch(n){case"!":case">":o=!0;break;case"<":case"@":case"=":case"":o=!1;break;default:throw new Error(`Unrecognized alignment character ${n}.`+e)}let a;switch(t){case"b":a=Int8Array;break;case"s":case"p":case"c":case"B":case"?":a=Uint8Array;break;case"h":a=Int16Array;break;case"H":a=Uint16Array;break;case"i":case"l":case"n":a=Int32Array;break;case"I":case"L":case"N":case"P":a=Uint32Array;break;case"q":if(globalThis.BigInt64Array===void 0)throw new Error("BigInt64Array is not supported on this browser."+e);a=BigInt64Array;break;case"Q":if(globalThis.BigUint64Array===void 0)throw new Error("BigUint64Array is not supported on this browser."+e);a=BigUint64Array;break;case"f":a=Float32Array;break;case"d":a=Float64Array;break;case"e":throw new Error("Javascript has no Float16 support.");default:throw new Error(`Unrecognized format character '${t}'.`+e)}return[a,o]};Module.python2js_buffer_1d_contiguous=function(r,e,t){let n=e*t;return HEAP8.slice(r,r+n).buffer};Module.python2js_buffer_1d_noncontiguous=function(r,e,t,n,o){let a=o*n,s=new Uint8Array(a);for(let l=0;l=0&&(c=HEAPU32[(c>>2)+0]+t),s.set(HEAP8.subarray(c,c+o),l*o)}return s.buffer};Module._python2js_buffer_recursive=function(r,e,t){let n=HEAPU32[(t.shape>>2)+e],o=HEAP32[(t.strides>>2)+e],a=-1;if(t.suboffsets!==0&&(a=HEAP32[(t.suboffsets>>2)+e]),e===t.ndim-1){let l;return o===t.itemsize&&a<0?l=Module.python2js_buffer_1d_contiguous(r,o,n):l=Module.python2js_buffer_1d_noncontiguous(r,o,a,n,t.itemsize),t.converter(l)}let s=[];for(let l=0;l=0&&(curptr=HEAPU32[(curptr>>2)+0]+a),s.push(Module._python2js_buffer_recursive(c,e+1,t))}return s};Module.get_converter=function(r,e){let t=UTF8ToString(r),[n,o]=Module.processBufferFormatString(t);switch(t.slice(-1)){case"s":let u=new TextDecoder("utf8",{ignoreBOM:!0});return d=>u.decode(d);case"?":return d=>Array.from(new Uint8Array(d),p=>!!p)}if(!o)return u=>new n(u);let s,l;switch(e){case 2:s="getUint16",l="setUint16";break;case 4:s="getUint32",l="setUint32";break;case 8:s="getFloat64",l="setFloat64";break;default:throw new Error(`Unexpected size ${e}`)}function c(u){let d=new DataView(u),p=d[s].bind(d),f=d[l].bind(d);for(let y=0;ynew n(c(u))};function Jt(r){try{return r instanceof g}catch{return!1}}i(Jt,"isPyProxy");API.isPyProxy=Jt;globalThis.FinalizationRegistry?Module.finalizationRegistry=new FinalizationRegistry(({ptr:r,cache:e})=>{e&&(e.leaked=!0,Wr(e));try{_check_gil();let t=Module.validSuspender.value;Module.validSuspender.value=!1,_Py_DecRef(r),Module.validSuspender.value=t}catch(t){API.fatal_error(t)}}):Module.finalizationRegistry={register(){},unregister(){}};var nr=new Map;Module.pyproxy_alloc_map=nr;var ar,ir;Module.enable_pyproxy_allocation_tracing=function(){ar=i(function(r){nr.set(r,Error().stack)},"trace_pyproxy_alloc"),ir=i(function(r){nr.delete(r)},"trace_pyproxy_dealloc")};Module.disable_pyproxy_allocation_tracing=function(){ar=i(function(r){},"trace_pyproxy_alloc"),ir=i(function(r){},"trace_pyproxy_dealloc")};Module.disable_pyproxy_allocation_tracing();var jr=Symbol("pyproxy.attrs");function Vt(r,e){_check_gil();let t=Module.validSuspender.value;Module.validSuspender.value=!1;try{return _pyproxy_getflags(r,e)}finally{Module.validSuspender.value=t}}i(Vt,"pyproxy_getflags");function de(r,{flags:e,cache:t,props:n,shared:o,gcRegister:a,jsonAdaptor:s}={}){a===void 0&&(a=!0);let l=e!==void 0?e:Vt(r,!!s);l===-1&&_pythonexc2js();let c=l&8192,u=l&32768,d=Module.getPyProxyClass(l),p;l&256?(p=i(function(){},"target"),Object.setPrototypeOf(p,d.prototype),delete p.length,delete p.name,p.prototype=void 0):p=Object.create(d.prototype);let f=!!o;o||(t||(t={map:new Map,json_adaptor_map:new Map,refcnt:0}),t.refcnt++,o={ptr:r,cache:t,flags:l,promise:void 0,destroyed_msg:void 0,gcRegistered:!1},_Py_IncRef(r)),n=Object.assign({isBound:!1,captureThis:!1,boundArgs:[],roundtrip:!1},n);let y;u?y=or:c?y=on:y=T;let _=new Proxy(p,y);!f&&a&&Br(o),f||ar(_);let S={shared:o,props:n};return p[jr]=S,_}i(de,"pyproxy_new");Module.pyproxy_new=de;function Br(r){let e=Object.assign({},r);r.gcRegistered=!0,Module.finalizationRegistry.register(r,e,r)}i(Br,"gc_register_proxy");Module.gc_register_proxy=Br;function De(r){return r[jr]}i(De,"_getAttrsQuiet");Module.PyProxy_getAttrsQuiet=De;function I(r){let e=De(r);if(!e.shared.ptr)throw new Error(e.shared.destroyed_msg);return e}i(I,"_getAttrs");Module.PyProxy_getAttrs=I;function m(r){return I(r).shared.ptr}i(m,"_getPtr");function b(r){return Object.getPrototypeOf(r).$$flags}i(b,"_getFlags");function Hr(r){return!!(b(r)&98304)}i(Hr,"isJsonAdaptor");function $r(r,e,t){let{captureThis:n,boundArgs:o,boundThis:a,isBound:s}=I(r).props;return n?s?[a].concat(o,t):[e].concat(t):s?o.concat(t):t}i($r,"_adjustArgs");var Lr=new Map;Module.getPyProxyClass=function(r){let e=[[1,ve],[2,D],[4,F],[8,C],[16,we],[32,Ae],[2048,Ie],[512,Se],[1024,Ee],[4096,ke],[64,Fe],[128,Ne],[256,le],[8192,Me],[16384,Oe]],t=Lr.get(r);if(t)return t;let n={};for(let[l,c]of e)r&l&&Object.assign(n,Object.getOwnPropertyDescriptors(c.prototype));(r&8192||r&2)&&Object.assign(n,Object.getOwnPropertyDescriptors(xe.prototype)),n.constructor=Object.getOwnPropertyDescriptor(g.prototype,"constructor"),Object.assign(n,Object.getOwnPropertyDescriptors({$$flags:r}));let o=r&256?zr:Gr,a=Object.create(o,n);function s(){}return i(s,"NewPyProxyClass"),s.prototype=a,Lr.set(r,s),s};Module.PyProxy_getPtr=m;var Cr="This borrowed attribute proxy was automatically destroyed in the process of destroying the proxy it was borrowed from. Try using the 'copy' method.";function Wr(r){if(r&&(r.refcnt--,!r.leaked&&r.refcnt===0)){for(let e of r.map.values())Module.pyproxy_destroy(e,Cr,!0);for(let e of r.json_adaptor_map.values())Module.pyproxy_destroy(e,Cr,!0)}}i(Wr,"pyproxy_decref_cache");function qt(r,e){if(e=e||"Object has already been destroyed",API.debug_ffi){let t=r.type,n;try{n=r.toString()}catch(o){if(o.pyodide_fatal_error)throw o}e+=`\nThe object was of type "${t}" and `,n?e+=`had repr "${n}"`:e+="an error was raised when trying to generate its repr"}else e+="\nFor more information about the cause of this error, use `pyodide.setDebug(true)`";return e}i(qt,"generateDestroyedMessage");Module.pyproxy_destroy=function(r,e,t){let{shared:n,props:o}=De(r);if(!n.ptr||!t&&o.roundtrip)return;n.destroyed_msg=qt(r,e);let a=n.ptr;n.ptr=0,n.gcRegistered&&Module.finalizationRegistry.unregister(n),Wr(n.cache);try{_check_gil();let s=Module.validSuspender.value;Module.validSuspender.value=!1,_Py_DecRef(a),ir(r),Module.validSuspender.value=s}catch(s){API.fatal_error(s)}};function Te(r,e,t){let n=e.length,o=Object.keys(t),a=Object.values(t),s=o.length;e.push(...a);let l;try{_check_gil();let c=Module.validSuspender.value;Module.validSuspender.value=!1,l=__pyproxy_apply(r,e,n,o,s),Module.validSuspender.value=c}catch(c){API.maybe_fatal_error(c);return}if(l===null&&_pythonexc2js(),l&&l.type==="coroutine"&&l._ensure_future){_check_gil();let c=Module.validSuspender.value;Module.validSuspender.value=!1;let u=__iscoroutinefunction(r);Module.validSuspender.value=c,u&&l._ensure_future()}return l}i(Te,"callPyObjectKwargs");async function Pe(r,e,t){if(!Module.jspiSupported)throw new Error("WebAssembly stack switching not supported in this JavaScript runtime");let n=e.length,o=Object.keys(t),a=Object.values(t),s=o.length;e.push(...a);let l=stackSave(),c=stackAlloc(4),u;try{_check_gil();let d=Module.validSuspender.value;Module.validSuspender.value=!1,u=await Module.promisingApply(r,e,n,o,s,c),Module.validSuspender.value=d}catch(d){API.fatal_error(d)}if(u===null){_PyErr_SetRaisedException(HEAPU32[c/4]);try{_pythonexc2js()}finally{stackRestore(l)}}if(u&&u.type==="coroutine"&&u._ensure_future){_check_gil();let d=Module.validSuspender.value;Module.validSuspender.value=!1;let p=__iscoroutinefunction(r);Module.validSuspender.value=d,p&&u._ensure_future()}return u}i(Pe,"callPyObjectKwargsPromising");Module.callPyObjectMaybePromising=async function(r,e){return Module.jspiSupported?await Pe(r,e,{}):Te(r,e,{})};Module.callPyObject=function(r,e){return Te(r,e,{})};var g=class{static[Symbol.hasInstance](e){return[g,Kr].some(t=>Function.prototype[Symbol.hasInstance].call(t,e))}constructor(){throw new TypeError("PyProxy is not a constructor")}get[Symbol.toStringTag](){return"PyProxy"}get type(){let e=m(this);return __pyproxy_type(e)}toString(){let e=m(this),t;try{_check_gil();let n=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxy_repr(e),Module.validSuspender.value=n}catch(n){API.fatal_error(n)}return t===null&&_pythonexc2js(),t}destroy(e={}){e=Object.assign({message:"",destroyRoundtrip:!0},e);let{message:t,destroyRoundtrip:n}=e;Module.pyproxy_destroy(this,t,n)}copy(){let e=I(this);return de(e.shared.ptr,{flags:b(this),cache:e.shared.cache,props:e.props})}toJs({depth:e=-1,pyproxies:t=void 0,create_pyproxies:n=!0,dict_converter:o=void 0,default_converter:a=void 0}={}){let s=m(this),l,c;n?t?c=t:c=[]:c=null;try{_check_gil();let u=Module.validSuspender.value;Module.validSuspender.value=!1,l=_python2js_custom(s,e,c,o||null,a||null),Module.validSuspender.value=u}catch(u){API.fatal_error(u)}return l===null&&_pythonexc2js(),l}};i(g,"PyProxy");var Gr=g.prototype;Tests.Function=Function;var zr=Object.create(Function.prototype,Object.getOwnPropertyDescriptors(Gr));function Kr(){}i(Kr,"PyProxyFunction");Kr.prototype=zr;var J=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&1)}};i(J,"PyProxyWithLength");var ve=class{get length(){let e=m(this),t;try{_check_gil();let n=Module.validSuspender.value;Module.validSuspender.value=!1,t=_PyObject_Size(e),Module.validSuspender.value=n}catch(n){API.fatal_error(n)}return t===-1&&_pythonexc2js(),t}};i(ve,"PyLengthMethods");var V=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&2)}};i(V,"PyProxyWithGet");var xe=class{asJsJson(){let{shared:e,props:t}=I(this),n=b(this);return n&8192?n|=65536:n|=32768,de(e.ptr,{shared:e,flags:n,props:t})}};i(xe,"PyAsJsonAdaptorMethods");var D=class{get(e){let{shared:t}=I(this),n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,n=__pyproxy_getitem(t.ptr,e,t.cache.json_adaptor_map,Hr(this)),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}if(n===null)if(_PyErr_Occurred())_pythonexc2js();else return;return n}asJsJson(){throw new Error("Should not happen")}};i(D,"PyGetItemMethods");var q=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&4)}};i(q,"PyProxyWithSet");var F=class{set(e,t){let n=m(this),o;try{_check_gil();let a=Module.validSuspender.value;Module.validSuspender.value=!1,o=__pyproxy_setitem(n,e,t),Module.validSuspender.value=a}catch(a){API.fatal_error(a)}o===-1&&_pythonexc2js()}delete(e){let t=m(this),n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,n=__pyproxy_delitem(t,e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}n===-1&&_pythonexc2js()}};i(F,"PySetItemMethods");var Y=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&8)}};i(Y,"PyProxyWithHas");var C=class{has(e){let t=m(this),n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,n=__pyproxy_contains(t,e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}return n===-1&&_pythonexc2js(),n===1}};i(C,"PyContainsMethods");function*Yt(r,e,t,n){let o=[];try{for(;;){_check_gil();let a=Module.validSuspender.value;Module.validSuspender.value=!1;let s=__pyproxy_iter_next(r,t,n);if(s===null)break;Module.validSuspender.value=a,yield s,!n&&API.isPyProxy(s)&&o.push(s)}}catch(a){API.fatal_error(a)}finally{Module.finalizationRegistry.unregister(e),_Py_DecRef(r)}try{o.forEach(a=>Module.pyproxy_destroy(a,"This borrowed proxy was automatically destroyed when an iterator was exhausted."))}catch{}_PyErr_Occurred()&&_pythonexc2js()}i(Yt,"iter_helper");var X=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&48)}};i(X,"PyIterable");var we=class{[Symbol.iterator](){let{shared:e}=I(this),t={},n;try{_check_gil();let a=Module.validSuspender.value;Module.validSuspender.value=!1,n=_PyObject_GetIter(e.ptr),Module.validSuspender.value=a}catch(a){API.fatal_error(a)}n===0&&_pythonexc2js();let o=Yt(n,t,e.cache.json_adaptor_map,Hr(this));return Module.finalizationRegistry.register(o,[n,void 0],t),o}};i(we,"PyIterableMethods");async function*Xt(r,e){try{for(;;){let t;try{_check_gil();let n=Module.validSuspender.value;if(Module.validSuspender.value=!1,t=__pyproxy_aiter_next(r),Module.validSuspender.value=n,t===null)break}catch(n){API.fatal_error(n)}try{yield await t}catch(n){if(n&&typeof n=="object"&&n.type==="StopAsyncIteration")return;throw n}finally{t.destroy()}}}finally{Module.finalizationRegistry.unregister(e),_Py_DecRef(r)}_PyErr_Occurred()&&_pythonexc2js()}i(Xt,"aiter_helper");var Q=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&1536)}};i(Q,"PyAsyncIterable");var Se=class{[Symbol.asyncIterator](){let e=m(this),t={},n;try{_check_gil();let a=Module.validSuspender.value;Module.validSuspender.value=!1,n=_PyObject_GetAIter(e),Module.validSuspender.value=a}catch(a){API.fatal_error(a)}n===0&&_pythonexc2js();let o=Xt(n,t);return Module.finalizationRegistry.register(o,[n,void 0],t),o}};i(Se,"PyAsyncIterableMethods");var Z=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&32)}};i(Z,"PyIterator");var Ae=class{[Symbol.iterator](){return this}next(e=void 0){let t,n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxyGen_Send(m(this),e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}return t===null&&_pythonexc2js(),t}};i(Ae,"PyIteratorMethods");var ee=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&2048)}};i(ee,"PyGenerator");var Ie=class{throw(e){let t;try{_check_gil();let n=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxyGen_throw(m(this),e),Module.validSuspender.value=n}catch(n){API.fatal_error(n)}return t===null&&_pythonexc2js(),t}return(e){let t;try{_check_gil();let n=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxyGen_return(m(this),e),Module.validSuspender.value=n}catch(n){API.fatal_error(n)}return t===null&&_pythonexc2js(),t}};i(Ie,"PyGeneratorMethods");var re=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&1024)}};i(re,"PyAsyncIterator");var Ee=class{[Symbol.asyncIterator](){return this}async next(e=void 0){let t;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxyGen_asend(m(this),e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}t===null&&_pythonexc2js();let n;try{n=await t}catch(o){if(o&&typeof o=="object"&&o.type==="StopAsyncIteration")return{done:!0,value:n};throw o}finally{t.destroy()}return{done:!1,value:n}}};i(Ee,"PyAsyncIteratorMethods");var te=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&4096)}};i(te,"PyAsyncGenerator");var ke=class{async throw(e){let t;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxyGen_athrow(m(this),e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}t===null&&_pythonexc2js();let n;try{n=await t}catch(o){if(o&&typeof o=="object"){if(o.type==="StopAsyncIteration")return{done:!0,value:n};if(o.type==="GeneratorExit")return{done:!0,value:n}}throw o}finally{t.destroy()}return{done:!1,value:n}}async return(e){let t;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxyGen_areturn(m(this)),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}t===null&&_pythonexc2js();let n;try{n=await t}catch(o){if(o&&typeof o=="object"){if(o.type==="StopAsyncIteration")return{done:!0,value:n};if(o.type==="GeneratorExit")return{done:!0,value:e}}throw o}finally{t.destroy()}return{done:!1,value:n}}};i(ke,"PyAsyncGeneratorMethods");var ne=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&8192)}};i(ne,"PySequence");function Qt(r,e){let t=r.toString(),n=e.toString();return t===n?0:t{this.insert(n,t)}),this.length}copyWithin(...e){return Array.prototype.copyWithin.apply(this,e),this}fill(...e){return Array.prototype.fill.apply(this,e),this}};i(Oe,"PyMutableSequenceMethods");function Zt(r,e){let t=m(r),n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,n=__pyproxy_hasattr(t,e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}return n===-1&&_pythonexc2js(),n!==0}i(Zt,"python_hasattr");function en(r,e){let{shared:t}=I(r),n=t.cache.map,o;try{_check_gil();let a=Module.validSuspender.value;Module.validSuspender.value=!1,o=__pyproxy_getattr(t.ptr,e,n),Module.validSuspender.value=a}catch(a){API.fatal_error(a)}if(o===null){_PyErr_Occurred()&&_pythonexc2js();return}return o}i(en,"python_getattr");function rn(r,e,t){let n=m(r),o;try{_check_gil();let a=Module.validSuspender.value;Module.validSuspender.value=!1,o=__pyproxy_setattr(n,e,t),Module.validSuspender.value=a}catch(a){API.fatal_error(a)}o===-1&&_pythonexc2js()}i(rn,"python_setattr");function tn(r,e){let t=m(r),n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,n=__pyproxy_delattr(t,e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}n===-1&&_pythonexc2js()}i(tn,"python_delattr");function nn(r,e,t,n){let o=m(r),a;try{_check_gil();let s=Module.validSuspender.value;Module.validSuspender.value=!1,a=__pyproxy_slice_assign(o,e,t,n),Module.validSuspender.value=s}catch(s){API.fatal_error(s)}return a===null&&_pythonexc2js(),a}i(nn,"python_slice_assign");function Ur(r,e){let t=m(r),n;try{_check_gil();let o=Module.validSuspender.value;Module.validSuspender.value=!1,n=__pyproxy_pop(t,e),Module.validSuspender.value=o}catch(o){API.fatal_error(o)}return n===null&&_pythonexc2js(),n}i(Ur,"python_pop");function be(r,e,t){return r instanceof Function?e in r&&!["name","length","caller","arguments",t?"prototype":void 0].includes(e):e in r}i(be,"filteredHasKey");var T={isExtensible(){return!0},has(r,e){return be(r,e,!1)?!0:typeof e=="symbol"?!1:(e.startsWith("$")&&(e=e.slice(1)),Zt(r,e))},get(r,e){return typeof e=="symbol"||be(r,e,!0)?Reflect.get(r,e):(e.startsWith("$")&&(e=e.slice(1)),en(r,e))},set(r,e,t){let n=Object.getOwnPropertyDescriptor(r,e);return n&&!n.writable&&!n.set?!1:typeof e=="symbol"||be(r,e,!0)?Reflect.set(r,e,t):(e.startsWith("$")&&(e=e.slice(1)),rn(r,e,t),!0)},deleteProperty(r,e){let t=Object.getOwnPropertyDescriptor(r,e);return t&&!t.configurable?!1:typeof e=="symbol"||be(r,e,!0)?Reflect.deleteProperty(r,e):(e.startsWith("$")&&(e=e.slice(1)),tn(r,e),!0)},ownKeys(r){let e=m(r),t;try{_check_gil();let n=Module.validSuspender.value;Module.validSuspender.value=!1,t=__pyproxy_ownKeys(e),Module.validSuspender.value=n}catch(n){API.fatal_error(n)}return t===null&&_pythonexc2js(),t.push(...Reflect.ownKeys(r)),t},apply(r,e,t){return r.apply(e,t)}};function ae(r){return r&&typeof r=="object"&&r.constructor&&r.constructor.name==="PythonError"}i(ae,"isPythonError");var on={isExtensible(){return!0},has(r,e){return typeof e=="string"&&/^[0-9]*$/.test(e)?Number(e)n.toString())),e.push("length"),e}},or={isExtensible(){return!0},has(r,e){return!!(C.prototype.has.call(r,e)||(typeof e=="string"&&/^[0-9]*$/.test(e)&&(e=Number(e)),C.prototype.has.call(r,e)))},get(r,e){let t;return["copy","constructor","$$flags","toString","destroy"].includes(e)||typeof e=="symbol"?Reflect.get(...arguments):(typeof e=="string"&&(t=D.prototype.get.call(r,e)),t||(typeof e=="string"&&/^[0-9]*$/.test(e)&&(e=Number(e),t=D.prototype.get.call(r,e)),t)?t:Reflect.get(...arguments))},set(r,e,t){if(typeof e=="string")try{return F.prototype.set.call(r,Number(e),t),!0}catch(n){if(ae(n))return!1;throw n}return!1},deleteProperty(r,e){if(typeof e=="string"&&/^[0-9]*$/.test(e))try{return F.prototype.delete.call(r,Number(e)),!0}catch(t){if(ae(t))return!1;throw t}return!1},getOwnPropertyDescriptor(r,e){return or.has(r,e)?{configurable:!0,enumerable:!0,value:or.get(r,e),writable:!0}:void 0},ownKeys(r){let e;e=T.get(r,"keys")();let t=Array.from(e);return e.destroy(),t}},ie=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&64)}};i(ie,"PyAwaitable");var Fe=class{_ensure_future(){let{shared:e}=De(this);if(e.promise)return e.promise;let t=e.ptr;t||I(this);let n,o,a=new Promise((l,c)=>{n=l,o=c}),s;try{_check_gil();let l=Module.validSuspender.value;Module.validSuspender.value=!1,s=__pyproxy_ensure_future(t,n,o),Module.validSuspender.value=l}catch(l){API.fatal_error(l)}return s===-1&&_pythonexc2js(),e.promise=a,this.destroy(),a}then(e,t){return this._ensure_future().then(e,t)}catch(e){return this._ensure_future().catch(e)}finally(e){return this._ensure_future().finally(e)}};i(Fe,"PyAwaitableMethods");var se=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&256)}};i(se,"PyCallable");var le=class{apply(e,t){return t=function(...n){return n}.apply(void 0,t),t=$r(this,e,t),Module.callPyObject(m(this),t)}call(e,...t){return t=$r(this,e,t),Module.callPyObject(m(this),t)}callWithOptions({relaxed:e,kwargs:t,promising:n},...o){let a={};if(t){if(o.length===0)throw new TypeError("callWithOptions with 'kwargs: true' requires at least one argument (the key word argument object)");if(a=o.pop(),a.constructor!==void 0&&a.constructor.name!=="Object")throw new TypeError("kwargs argument is not an object")}let s=e?API.pyodide_code.relaxed_call:this;return e&&o.unshift(this),(n?Pe:Te)(m(s),o,a)}callKwargs(...e){if(e.length===0)throw new TypeError("callKwargs requires at least one argument (the key word argument object)");let t=e.pop();if(t.constructor!==void 0&&t.constructor.name!=="Object")throw new TypeError("kwargs argument is not an object");return Te(m(this),e,t)}callRelaxed(...e){return API.pyodide_code.relaxed_call(this,...e)}callKwargsRelaxed(...e){return API.pyodide_code.relaxed_call.callKwargs(this,...e)}callPromising(...e){return Pe(m(this),e,{})}callPromisingKwargs(...e){if(e.length===0)throw new TypeError("callKwargs requires at least one argument (the key word argument object)");let t=e.pop();if(t.constructor!==void 0&&t.constructor.name!=="Object")throw new TypeError("kwargs argument is not an object");return Pe(m(this),e,t)}bind(e,...t){let{shared:n,props:o}=I(this),{boundArgs:a,boundThis:s,isBound:l}=o,c=e;l&&(c=s);let u=a.concat(t);return o=Object.assign({},o,{boundArgs:u,isBound:!0,boundThis:c}),de(n.ptr,{shared:n,flags:b(this),props:o})}captureThis(){let{props:e,shared:t}=I(this);return e=Object.assign({},e,{captureThis:!0}),de(t.ptr,{shared:t,flags:b(this),props:e})}};i(le,"PyCallableMethods");le.prototype.prototype=Function.prototype;var an=new Map([["i8",Int8Array],["u8",Uint8Array],["u8clamped",Uint8ClampedArray],["i16",Int16Array],["u16",Uint16Array],["i32",Int32Array],["u32",Uint32Array],["i32",Int32Array],["u32",Uint32Array],["i64",globalThis.BigInt64Array],["u64",globalThis.BigUint64Array],["f32",Float32Array],["f64",Float64Array],["dataview",DataView]]),ce=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&!!(b(e)&128)}};i(ce,"PyBuffer");var Ne=class{getBuffer(e){let t;if(e&&(t=an.get(e),t===void 0))throw new Error(`Unknown type ${e}`);let n=m(this),o;try{_check_gil();let x=Module.validSuspender.value;Module.validSuspender.value=!1,o=__pyproxy_get_buffer(n),Module.validSuspender.value=x}catch(x){API.fatal_error(x)}o===null&&_pythonexc2js();let{start_ptr:a,smallest_ptr:s,largest_ptr:l,readonly:c,format:u,itemsize:d,shape:p,strides:f,view:y,c_contiguous:_,f_contiguous:S}=o,M=!1;try{let x=!1;t===void 0&&([t,x]=Module.processBufferFormatString(u," In this case, you can pass an explicit type argument."));let k=parseInt(t.name.replace(/[^0-9]/g,""))/8||1;if(x&&k>1)throw new Error("Javascript has no native support for big endian buffers. In this case, you can pass an explicit type argument. For instance, `getBuffer('dataview')` will return a `DataView`which has native support for reading big endian data. Alternatively, toJs will automatically convert the buffer to little endian.");let N=l-s;if(N!==0&&(a%k!==0||s%k!==0||l%k!==0))throw new Error(`Buffer does not have valid alignment for a ${t.name}`);let H=N/k,Ye=(a-s)/k,W;N===0?W=new t:W=new t(HEAPU32.buffer,s,H);for(let Ft of f.keys())f[Ft]/=k;return M=!0,Object.create(U.prototype,Object.getOwnPropertyDescriptors({offset:Ye,readonly:c,format:u,itemsize:d,ndim:p.length,nbytes:N,shape:p,strides:f,data:W,c_contiguous:_,f_contiguous:S,_view_ptr:y,_released:!1}))}finally{if(!M)try{_check_gil();let x=Module.validSuspender.value;Module.validSuspender.value=!1,_PyBuffer_Release(y),_PyMem_Free(y),Module.validSuspender.value=x}catch(x){API.fatal_error(x)}}}};i(Ne,"PyBufferMethods");var ue=class extends g{static[Symbol.hasInstance](e){return API.isPyProxy(e)&&e.type==="dict"}};i(ue,"PyDict");var U=class{constructor(){throw new TypeError("PyBufferView is not a constructor")}release(){if(!this._released){try{_check_gil();let e=Module.validSuspender.value;Module.validSuspender.value=!1,_PyBuffer_Release(this._view_ptr),_PyMem_Free(this._view_ptr),Module.validSuspender.value=e}catch(e){API.fatal_error(e)}this._released=!0,this.data=null}}};i(U,"PyBufferView");var Jr={PyProxy:g,PyProxyWithLength:J,PyProxyWithGet:V,PyProxyWithSet:q,PyProxyWithHas:Y,PyDict:ue,PyIterable:X,PyAsyncIterable:Q,PyIterator:Z,PyAsyncIterator:re,PyGenerator:ee,PyAsyncGenerator:te,PyAwaitable:ie,PyCallable:se,PyBuffer:ce,PyBufferView:U,PythonError:O,PySequence:ne,PyMutableSequence:oe};var Vr=i(r=>{r.id!=="canvas"&&console.warn("If you are using canvas element for SDL library, it should have id 'canvas' to work properly."),Module.canvas=r},"setCanvas2D"),qr=i(()=>Module.canvas,"getCanvas2D"),sn=i(r=>{Vr(r)},"setCanvas3D"),ln=i(()=>qr(),"getCanvas3D"),Yr={setCanvas2D:Vr,getCanvas2D:qr,setCanvas3D:sn,getCanvas3D:ln};var h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&typeof process.browser>"u",sr=h&&typeof module<"u"&&typeof module.exports<"u"&&typeof v<"u"&&typeof __dirname<"u",Xr=h&&!sr,Qr=typeof Deno<"u",lr=!h&&!Qr,j=lr&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&typeof sessionStorage=="object"&&typeof importScripts!="function",ye=lr&&typeof importScripts=="function"&&typeof self=="object",cr=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1;function Zr(){return{IN_NODE:h,IN_NODE_COMMONJS:sr,IN_NODE_ESM:Xr,IN_DENO:Qr,IN_BROWSER:lr,IN_BROWSER_MAIN_THREAD:j,IN_BROWSER_WEB_WORKER:ye,IN_SAFARI:cr}}i(Zr,"detectEnvironment");var cn=E(er());var et,dr,rt,Re,B;async function tt(){if(!h||(et=(await import("node:url")).default,Re=await import("node:fs"),B=await import("node:fs/promises"),rt=(await import("node:vm")).default,dr=await import("node:path"),nt=dr.sep,typeof v<"u"))return;let r=Re,e=await import("node:crypto"),t=await import("ws"),n=await import("node:child_process"),o={fs:r,crypto:e,ws:t,child_process:n};globalThis.require=function(a){return o[a]}}i(tt,"initNodeModules");function un(r,e){return dr.resolve(e||".",r)}i(un,"node_resolvePath");function dn(r,e){return e===void 0&&(e=location),new URL(r,e).toString()}i(dn,"browser_resolvePath");var $e;h?$e=un:$e=dn;var nt;h||(nt="/");function yn(r,e){return r.startsWith("file://")&&(r=r.slice(7)),r.includes("://")?{response:fetch(r)}:{binary:B.readFile(r).then(t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}}i(yn,"node_getBinaryResponse");function pn(r,e){let t=new URL(r,location);return{response:fetch(t,e?{integrity:e}:{})}}i(pn,"browser_getBinaryResponse");var yr;h?yr=yn:yr=pn;async function pe(r,e){let{response:t,binary:n}=yr(r,e);if(n)return n;let o=await t;if(!o.ok)throw new Error(`Failed to load '${r}': request failed.`);return new Uint8Array(await o.arrayBuffer())}i(pe,"loadBinaryFile");var ur;if(j)ur=i(async r=>await import(r),"loadScript");else if(ye)ur=i(async r=>{try{globalThis.importScripts(r)}catch(e){if(e instanceof TypeError)await import(r);else throw e}},"loadScript");else if(h)ur=fn;else throw new Error("Cannot determine runtime environment");async function fn(r){r.startsWith("file://")&&(r=r.slice(7)),r.includes("://")?rt.runInThisContext(await(await fetch(r)).text()):await import(et.pathToFileURL(r).href)}i(fn,"nodeLoadScript");function Le(){let r=Promise.resolve();async function e(){let t=r,n;return r=new Promise(o=>n=o),await t,n}return i(e,"acquireLock"),e}i(Le,"createLock");var ot=i(r=>{let e={};return(...t)=>{let n=t[0];if(n in e)return e[n];{let o=r(n);return e[n]=o,o}}},"memoize");function _n(r,e,t){let n=r.substring(0,r.lastIndexOf("/")),o=e||[];o=o.concat(API.defaultLdLibraryPath,[n]);let a=i(c=>{for(let u of o){let d=Module.PATH.join2(u,c);if(Module.FS.findObject(d)!==null)return d}return c},"resolvePath"),s=i(c=>Module.FS.readFile(a(c)),"readFile");return t!==void 0&&(s=i(c=>t(a(c)),"readFile")),{findObject:(c,u)=>Module.FS.findObject(a(c),u),readFile:s}}i(_n,"createDynlibFS");var mn=Le();async function at(r,e,t,n){let o=await mn(),a=_n(r,t,n);try{if(await Module.loadDynamicLibrary(r,{loadAsync:!0,nodelete:!0,allowUndefined:!0,global:e,fs:a}),e&&Module.PATH.isAbs(r)){let s=Module.PATH.basename(r);Module.LDSO.loadedLibsByName[s]||(Module.LDSO.loadedLibsByName[s]=Module.LDSO.loadedLibsByName[r])}}catch(s){if(s&&s.message&&s.message.includes("need to see wasm magic number")){console.warn(`Failed to load dynlib ${r}. We probably just tried to load a linux .so file or something.`);return}throw s}finally{o()}}i(at,"loadDynlib");async function pr(r,e){let t=`${API.sitepackages}/${r.file_name.split("-")[0]}.libs`,n=ot(Module.FS.readFile),o=!!r.shared_library,a;if(o)a=e.map(s=>({path:s,global:!0}));else{let s=gn(e,n);a=e.map(l=>{let c=s.has(Module.PATH.basename(l));return{path:l,global:c||!!r.shared_library}})}a.sort((s,l)=>Number(l.global)-Number(s.global));for(let{path:s,global:l}of a)await at(s,l,[t],n)}i(pr,"loadDynlibsFromPackage");function gn(r,e){let t=Module.FS.readFile;e!==void 0&&(t=e);let n=new Set;return r.forEach(o=>{let a=t(o);Module.getDylinkMetadata(a).neededDynlibs.forEach(l=>{n.add(l)})}),n}i(gn,"calculateGlobalLibs");API.loadDynlib=at;API.loadDynlibsFromPackage=pr;var hn=/[-_.]+/g;function it(r){return r.replace(hn,"-").toLowerCase()}i(it,"canonicalizePackageName");var bn=/^.*?([^\/]*)\.whl$/;function st(r){let e=bn.exec(r);if(e){let t=e[1].toLowerCase().split("-");return{name:t[0],version:t[1],fileName:t.join("-")+".whl"}}}i(st,"uriToPackageData");function lt(r){return btoa(r.match(/\w{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""))}i(lt,"base16ToBase64");async function Pn(r){await tt();let e=await r;if(!e.packages)throw new Error("Loaded pyodide lock file does not contain the expected key 'packages'.");if(e.info.version!==API.version)throw new Error(`Lock file version doesn't match Pyodide version.\n lockfile version: ${API.lockfile_info.version}\n pyodide version: ${API.version}`);API.lockfile_info=e.info,API.lockfile_packages=e.packages,API.lockfile_unvendored_stdlibs_and_test=[],API.repodata_info=e.info,API.repodata_packages=e.packages,API._import_name_to_package_name=new Map;for(let o of Object.keys(API.lockfile_packages)){let a=API.lockfile_packages[o];for(let s of a.imports)API._import_name_to_package_name.set(s,o);a.package_type==="cpython_module"&&API.lockfile_unvendored_stdlibs_and_test.push(o)}API.lockfile_unvendored_stdlibs=API.lockfile_unvendored_stdlibs_and_test.filter(o=>o!=="test");let t=API.config.packages;API.config.fullStdLib&&(t=[...t,...API.lockfile_unvendored_stdlibs]),await Ue(t,{messageCallback(){}}),await API.bootstrapFinalizedPromise,API._pyodide._importhook.register_module_not_found_hook(API._import_name_to_package_name,API.lockfile_unvendored_stdlibs_and_test),API.package_loader.init_loaded_packages()}i(Pn,"initializePackageIndex");API.lockFilePromise&&(API.packageIndexReady=Pn(API.lockFilePromise));var Ce;API.setCdnUrl=function(r){Ce=r};var fe="default channel";function ct(){let r=i(()=>{},"_resolve"),e=i(()=>{},"_reject"),t=new Promise((n,o)=>{r=n,e=o});return t.resolve=r,t.reject=e,t}i(ct,"createDonePromise");function ut(r,e){let t=it(r);if(e.has(t))return;let n=API.lockfile_packages[t];if(!n)throw new Error(`No known package with name '${r}'`);if(e.set(t,{name:n.name,normalizedName:t,channel:fe,depends:n.depends,installPromise:void 0,done:ct(),packageData:n}),R[n.name]===void 0)for(let o of n.depends)ut(o,e)}i(ut,"addPackageToLoad");function dt(r,e){let t=new Map;for(let n of r){let o=st(n);if(o===void 0){ut(n,t);continue}let{name:a,version:s,fileName:l}=o,c=n;if(t.has(a)&&t.get(a).channel!==c){e(`Loading same package ${a} from ${c} and ${t.get(a).channel}`);continue}t.set(a,{name:a,normalizedName:a,channel:c,depends:[],installPromise:void 0,done:ct(),packageData:{name:a,version:s,file_name:l,install_dir:"site",sha256:"",package_type:"package",imports:[],depends:[],shared_library:!1}})}return t}i(dt,"recursiveDependencies");API.recursiveDependencies=dt;async function vn(r,e=!0){let t;if(h){t=API.config.packageCacheDir;try{await B.stat(t)}catch{await B.mkdir(t,{recursive:!0})}}else t=API.config.indexURL;let n,o,a;if(r.channel===fe){if(!(r.normalizedName in API.lockfile_packages))throw new Error(`Internal error: no entry for package named ${name}`);let l=API.lockfile_packages[r.normalizedName];n=l.file_name,o=$e(n,t),a="sha256-"+lt(l.sha256)}else o=r.channel,a=void 0;e||(a=void 0);try{return await pe(o,a)}catch(l){if(!h||r.channel!==fe)throw l}console.log(`Didn't find package ${n} locally, attempting to load from ${Ce}`);let s=await pe(Ce+n);return console.log(`Package ${n} loaded from ${Ce}, caching the wheel in node_modules for future use.`),await B.writeFile(o,s),s}i(vn,"downloadPackage");async function xn(r,e,t){let n=API.lockfile_packages[r];n||(n={name:"",version:"",file_name:".whl",install_dir:"site",sha256:"",package_type:"package",imports:[],depends:[],shared_library:!1});let o=n.file_name,a=API.package_loader.unpack_buffer.callKwargs({buffer:e,filename:o,target:n.install_dir,calculate_dynlibs:!0,installer:"pyodide.loadPackage",source:t===fe?"pyodide":t});await pr(n,a)}i(xn,"installPackage");async function wn(r,e,t,n,o=!0){if(R[r.name]===void 0)try{let a=await vn(r,o),s=r.depends.map(l=>e.has(l)?e.get(l).done:Promise.resolve());await API.bootstrapFinalizedPromise,await Promise.all(s),await xn(r.normalizedName,a,r.channel),t.add(r.packageData),R[r.name]=r.channel}catch(a){n.set(r.name,a)}finally{r.done.resolve()}}i(wn,"downloadAndInstall");var Sn=Le();function An({name:r,version:e,file_name:t,package_type:n}){return{name:r,version:e,fileName:t,packageType:n}}i(An,"filterPackageData");async function Ue(r,e={checkIntegrity:!0}){let t=new Set,n=e.messageCallback||console.log,o=e.errorCallback||console.error;r instanceof g&&(r=r.toJs()),Array.isArray(r)||(r=[r]);let a=dt(r,o);for(let[u,{name:d,normalizedName:p,channel:f}]of a){let y=R[d];y!==void 0&&(a.delete(p),y===f||f===fe?n(`${d} already loaded from ${y}`):o(`URI mismatch, attempting to load package ${d} from ${f} while it is already loaded from ${y}. To override a dependency, load the custom package first.`))}if(a.size===0)return n("No new packages to load"),[];let s=Array.from(a.values(),({name:u})=>u).sort().join(", "),l=new Map,c=await Sn();try{n(`Loading ${s}`);for(let[u,d]of a){if(R[d.name]){a.delete(d.normalizedName);continue}d.installPromise=wn(d,a,t,l,e.checkIntegrity)}if(await Promise.all(Array.from(a.values()).map(({installPromise:u})=>u)),Module.reportUndefinedSymbols(),t.size>0){let u=Array.from(t,d=>d.name).sort().join(", ");n(`Loaded ${u}`)}if(l.size>0){let u=Array.from(l.keys()).sort().join(", ");n(`Failed to load ${u}`);for(let[d,p]of l)o(`The following error occurred while loading ${d}:`),o(p.message)}return API.importlib.invalidate_caches(),Array.from(t,An)}finally{c()}}i(Ue,"loadPackage");var R={};var yt="0.26.0";var mr=h?v("node:fs"):void 0,mt=h?v("node:tty"):void 0;function gt(r){try{mr.fsyncSync(r)}catch(e){if(e&&e.code==="EINVAL")return;throw e}}i(gt,"nodeFsync");var ht=!1,ze={},w={};function _r(r){ze[w.stdin]=r}i(_r,"_setStdinOps");function In(r){ze[w.stdout]=r}i(In,"_setStdoutOps");function En(r){ze[w.stderr]=r}i(En,"_setStderrOps");function kn(r){return r&&typeof r=="object"&&"errno"in r}i(kn,"isErrnoError");var Mn=new Int32Array(new WebAssembly.Memory({shared:!0,initial:1,maximum:1}).buffer);function On(r){try{return Atomics.wait(Mn,0,0,r),!0}catch{return!1}}i(On,"syncSleep");function Fn(r){for(;;)try{return r()}catch(e){if(e&&e.code==="EAGAIN"&&On(100))continue;throw e}}i(Fn,"handleEAGAIN");function pt(r,e,t){let n;try{n=Fn(e)}catch(o){throw o&&o.code&&Module.ERRNO_CODES[o.code]?new FS.ErrnoError(Module.ERRNO_CODES[o.code]):kn(o)?o:(console.error("Error thrown in read:"),console.error(o),new FS.ErrnoError(29))}if(n===void 0)throw console.warn(`${t} returned undefined; a correct implementation must return a number`),new FS.ErrnoError(29);return n!==0&&(r.node.timestamp=Date.now()),n}i(pt,"readWriteHelper");var ft=i((r,e,t)=>API.typedArrayAsUint8Array(r).subarray(e,e+t),"prepareBuffer"),fr={open:function(r){let e=ze[r.node.rdev];if(!e)throw new FS.ErrnoError(43);r.devops=e,r.tty=r.devops.isatty,r.seekable=!1},close:function(r){r.stream_ops.fsync(r)},fsync:function(r){let e=r.devops;e.fsync&&e.fsync()},read:function(r,e,t,n,o){return e=ft(e,t,n),pt(r,()=>r.devops.read(e),"read")},write:function(r,e,t,n,o){return e=ft(e,t,n),pt(r,()=>r.devops.write(e),"write")}};function Ke(){ht&&(FS.closeStream(0),FS.closeStream(1),FS.closeStream(2),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1))}i(Ke,"refreshStreams");API.initializeStreams=function(r,e,t){let n=FS.createDevice.major++;w.stdin=FS.makedev(n,0),w.stdout=FS.makedev(n,1),w.stderr=FS.makedev(n,2),FS.registerDevice(w.stdin,fr),FS.registerDevice(w.stdout,fr),FS.registerDevice(w.stderr,fr),FS.unlink("/dev/stdin"),FS.unlink("/dev/stdout"),FS.unlink("/dev/stderr"),FS.mkdev("/dev/stdin",w.stdin),FS.mkdev("/dev/stdout",w.stdout),FS.mkdev("/dev/stderr",w.stderr),me({stdin:r}),gr({batched:e}),hr({batched:t}),ht=!0,Ke()};function Nn(){me(h?new Be(process.stdin.fd):{stdin:()=>prompt()})}i(Nn,"setDefaultStdin");function Tn(){_r(new je),Ke()}i(Tn,"setStdinError");function me(r={}){let{stdin:e,error:t,isatty:n,autoEOF:o,read:a}=r,s=+!!e+ +!!t+ +!!a;if(s>1)throw new TypeError("At most one of stdin, read, and error must be provided.");if(!e&&o!==void 0)throw new TypeError("The 'autoEOF' option can only be used with the 'stdin' option");if(s===0){Nn();return}t&&Tn(),e&&(o=o===void 0?!0:o,_r(new He(e.bind(r),!!n,o))),a&&_r(r),Ke()}i(me,"setStdin");function bt(r,e,t){let{raw:n,isatty:o,batched:a,write:s}=r,l=+!!n+ +!!a+ +!!s;if(l===0&&(r=t(),({raw:n,isatty:o,batched:a,write:s}=r)),l>1)throw new TypeError("At most one of 'raw', 'batched', and 'write' must be passed");if(!n&&!s&&o)throw new TypeError("Cannot set 'isatty' to true unless 'raw' or 'write' is provided");n&&e(new We(n.bind(r),!!o)),a&&e(new Ge(a.bind(r))),s&&e(r),Ke()}i(bt,"_setStdwrite");function Dn(){return h?new _e(process.stdout.fd):{batched:r=>console.log(r)}}i(Dn,"_getStdoutDefaults");function Rn(){return h?new _e(process.stderr.fd):{batched:r=>console.warn(r)}}i(Rn,"_getStderrDefaults");function gr(r={}){bt(r,In,Dn)}i(gr,"setStdout");function hr(r={}){bt(r,En,Rn)}i(hr,"setStderr");var $n=new TextEncoder,_t=new TextDecoder,je=class{read(e){throw new FS.ErrnoError(29)}};i(je,"ErrorReader");var Be=class{constructor(e){this.fd=e,this.isatty=mt.isatty(e)}read(e){try{return mr.readSync(this.fd,e)}catch(t){if(t.toString().includes("EOF"))return 0;throw t}}fsync(){gt(this.fd)}};i(Be,"NodeReader");var He=class{constructor(e,t,n){this.infunc=e,this.isatty=t,this.autoEOF=n,this.index=0,this.saved=void 0,this.insertEOF=!1}_getInput(){if(this.saved)return this.saved;let e=this.infunc();if(typeof e=="number")return e;if(e!=null){if(ArrayBuffer.isView(e)){if(e.BYTES_PER_ELEMENT!==1)throw console.warn(`Expected BYTES_PER_ELEMENT to be 1, infunc gave ${e.constructor}`),new FS.ErrnoError(29);return e}if(typeof e=="string")return e.endsWith(`\n`)||(e+=`\n`),e;if(Object.prototype.toString.call(e)==="[object ArrayBuffer]")return new Uint8Array(e);throw console.warn("Expected result to be undefined, null, string, array buffer, or array buffer view"),new FS.ErrnoError(29)}}read(e){if(this.insertEOF)return this.insertEOF=!1,0;let t=0;for(;;){let n=this._getInput();if(typeof n=="number"){e[0]=n,e=e.subarray(1),t++;continue}let o;if(n&&n.length>0)if(typeof n=="string"){let{read:a,written:s}=$n.encodeInto(n,e);this.saved=n.slice(a),t+=s,o=e[s-1],e=e.subarray(s)}else{let a;n.length>e.length?(e.set(n.subarray(0,e.length)),this.saved=n.subarray(e.length),a=e.length):(e.set(n),this.saved=void 0,a=n.length),t+=a,o=e[a-1],e=e.subarray(a)}if(!(n&&n.length>0)||this.autoEOF||e.length===0)return this.insertEOF=t>0&&this.autoEOF&&o!==10,t}}fsync(){}};i(He,"LegacyReader");var We=class{constructor(e,t){this.out=e,this.isatty=t}write(e){for(let t of e)this.out(t);return e.length}};i(We,"CharacterCodeWriter");var Ge=class{constructor(e){this.isatty=!1;this.out=e,this.output=[]}write(e){for(let t of e)t===10?(this.out(_t.decode(new Uint8Array(this.output))),this.output=[]):t!==0&&this.output.push(t);return e.length}fsync(){this.output&&this.output.length>0&&(this.out(_t.decode(new Uint8Array(this.output))),this.output=[])}};i(Ge,"StringWriter");var _e=class{constructor(e){this.fd=e,this.isatty=mt.isatty(e)}write(e){return mr.writeSync(this.fd,e)}fsync(){gt(this.fd)}};i(_e,"NodeWriter");var Pr="sched$"+Math.random().toString(36).slice(2)+"$",vr={},br=0;function Ln(){if(!j)return;let r=i(e=>{if(typeof e.data=="string"&&e.data.indexOf(Pr)===0){let t=+e.data.slice(Pr.length),n=vr[t];if(!n)return;try{n()}finally{delete vr[t]}}},"onGlobalMessage");globalThis.addEventListener("message",r,!1)}i(Ln,"installPostMessageHandler");Ln();function Cn(r){if(h)setImmediate(r);else if(j&&typeof globalThis.postMessage=="function")vr[br]=r,globalThis.postMessage(Pr+br,"*"),br++;else if(ye&&!cr&&typeof MessageChannel=="function"){let e=new MessageChannel;e.port1.onmessage=()=>r(),e.port2.postMessage("")}else setTimeout(r,0)}i(Cn,"scheduleCallbackImmediate");function Je(r,e=0){e<=2?Cn(r):setTimeout(r,e)}i(Je,"scheduleCallback");var{get:Un,getOwnPropertyDescriptor:jn,ownKeys:Bn}=Reflect,Hn=i(r=>({value:r,enumerable:!0,writable:!0,configurable:!0}),"getPropertyDescriptor"),vt=Symbol(),Pt="prototype",Wn={deleteProperty:(r,e)=>r.has(e)?r.delete(e):delete r[e],get(r,e,t){if(e===vt)return r;let n=r[e];return typeof n=="function"&&e!=="constructor"&&(n=n.bind(r)),n||(n=r.get(e)),n},getOwnPropertyDescriptor(r,e){if(r.has(e))return Hn(r.get(e));if(e in r)return jn(r,e)},has:(r,e)=>r.has(e)||e in r,ownKeys:r=>[...r.keys(),...Bn(r)].filter(e=>["string","symbol"].includes(typeof e)),set:(r,e,t)=>(r.set(e,t),!0)};API.LiteralMap=new Proxy(i(class extends Map{constructor(...e){return new Proxy(super(...e),Wn)}},"LiteralMap"),{get(r,e,...t){return e!==Pt&&e in r[Pt]?(n,...o)=>{let a=n[vt],s=a[e];return typeof s=="function"&&(s=s.apply(a,o)),s===a?n:s}:Un(r,e,...t)}});function wt(){return[null,xr,API.config.jsglobals,API.public_api,API,Je,API,{}]}i(wt,"getExpectedKeys");var St=Symbol("getAccessorList");function Ve(r,e=[]){return new Proxy(r,{get(t,n,o){if(n===St)return e;let a=Reflect.get(...arguments),s=Reflect.getOwnPropertyDescriptor(t,n);return s&&s.writable===!1&&!s.configurable||s&&s.set&&!s.get||!["object","function"].includes(typeof a)?a:Ve(a,[...e,n])},getPrototypeOf(){return Ve(Reflect.getPrototypeOf(...arguments),[...e,"[getProtoTypeOf]"])}})}i(Ve,"makeGlobalsProxy");var At=1886286592,It=0,qe=4*4,ge=5;API.makeSnapshot=function(){if(!API.config._makeSnapshot)throw new Error("makeSnapshot only works if you passed the makeSnapshot option to loadPyodide");let r=[],e=wt();for(let p=0;pxt(o,n)),e.hiwireKeys.forEach((n,o)=>{let a=n?.reduce((s,l)=>s[l],r)||null;xt(t.length+o,a)}),e.immortalKeys.forEach(n=>Module.__hiwire_immortal_add(n))}i(kt,"syncUpSnapshotLoad2");API.loadBinaryFile=pe;API.rawRun=i(function(e){let t=Module.stringToNewUTF8(e);Module.API.capture_stderr();let n=_PyRun_SimpleString(t);_free(t);let o=Module.API.restore_stderr().trim();return[n,o]},"rawRun");API.runPythonInternal=function(r){return API._pyodide._base.eval_code(r,API.runPythonInternal_dict)};API.setPyProxyToStringMethod=function(r){Module.HEAP8[Module._compat_to_string_repr]=+r};API.saveState=()=>API.pyodide_py._state.save_state();API.restoreState=r=>API.pyodide_py._state.restore_state(r);API.scheduleCallback=Je;API.detectEnvironment=Zr;function Mt(r){Module.FS.mkdirTree(r);let{node:e}=Module.FS.lookupPath(r,{follow_mount:!1});if(FS.isMountpoint(e))throw new Error(`path '${r}' is already a file system mount point`);if(!FS.isDir(e.mode))throw new Error(`path '${r}' points to a file not a directory`);for(let t in e.contents)throw new Error(`directory '${r}' is not empty`)}i(Mt,"ensureMountPathExists");var P=class{static async loadPackagesFromImports(e,t={checkIntegrity:!0}){let n=API.pyodide_code.find_imports(e),o;try{o=n.toJs()}finally{n.destroy()}if(o.length===0)return[];let a=API._import_name_to_package_name,s=new Set;for(let l of o)a.has(l)&&s.add(a.get(l));return s.size?await Ue(Array.from(s),t):[]}static runPython(e,t={}){return t.globals||(t.globals=API.globals),API.pyodide_code.eval_code.callKwargs(e,t)}static async runPythonAsync(e,t={}){return t.globals||(t.globals=API.globals),await API.pyodide_code.eval_code_async.callKwargs(e,t)}static registerJsModule(e,t){API.pyodide_ffi.register_js_module(e,t)}static unregisterJsModule(e){API.pyodide_ffi.unregister_js_module(e)}static toPy(e,{depth:t,defaultConverter:n}={depth:-1}){switch(typeof e){case"string":case"number":case"boolean":case"bigint":case"undefined":return e}if(!e||API.isPyProxy(e))return e;let o=0,a=0;try{o=Module.js2python_convert(e,{depth:t,defaultConverter:n})}catch(s){throw s instanceof Module._PropagatePythonError&&_pythonexc2js(),s}try{if(_JsProxy_Check(o))return e;a=_python2js(o),a===null&&_pythonexc2js()}finally{_Py_DecRef(o)}return a}static pyimport(e){return API.pyodide_base.pyimport_impl(e)}static unpackArchive(e,t,n={}){if(!ArrayBuffer.isView(e)&&API.getTypeTag(e)!=="[object ArrayBuffer]")throw new TypeError("Expected argument 'buffer' to be an ArrayBuffer or an ArrayBuffer view");API.typedArrayAsUint8Array(e);let o=n.extractDir;API.package_loader.unpack_buffer.callKwargs({buffer:e,format:t,extract_dir:o,installer:"pyodide.unpackArchive"})}static async mountNativeFS(e,t){if(t.constructor.name!=="FileSystemDirectoryHandle")throw new TypeError("Expected argument 'fileSystemHandle' to be a FileSystemDirectoryHandle");return Mt(e),Module.FS.mount(Module.FS.filesystems.NATIVEFS_ASYNC,{fileSystemHandle:t},e),await new Promise((n,o)=>Module.FS.syncfs(!0,n)),{syncfs:async()=>new Promise((n,o)=>Module.FS.syncfs(!1,n))}}static mountNodeFS(e,t){if(!h)throw new Error("mountNodeFS only works in Node");Mt(e);let n;try{n=Re.lstatSync(t)}catch{throw new Error(`hostPath '${t}' does not exist`)}if(!n.isDirectory())throw new Error(`hostPath '${t}' is not a directory`);Module.FS.mount(Module.FS.filesystems.NODEFS,{root:t},e)}static registerComlink(e){API._Comlink=e}static setInterruptBuffer(e){Module.HEAP8[Module._Py_EMSCRIPTEN_SIGNAL_HANDLING]=+!!e,Module.Py_EmscriptenSignalBuffer=e}static checkInterrupt(){if(_PyGILState_Check()){__PyErr_CheckSignals()&&_pythonexc2js();return}else{let e=Module.Py_EmscriptenSignalBuffer;if(e&&e[0]===2)throw new Module.FS.ErrnoError(27)}}static setDebug(e){let t=!!API.debug_ffi;return API.debug_ffi=e,t}static makeMemorySnapshot(){if(!API.config._makeSnapshot)throw new Error("Can only use pyodide.makeMemorySnapshot if the _makeSnapshot option is passed to loadPyodide");return API.makeSnapshot()}};i(P,"PyodideAPI"),P.version=yt,P.loadPackage=Ue,P.loadedPackages=R,P.ffi=Jr,P.setStdin=me,P.setStdout=gr,P.setStderr=hr,P.globals={},P.FS={},P.PATH={},P.canvas=Yr,P.ERRNO_CODES={},P.pyodide_py={};function Gn(){let r=Object.getOwnPropertyDescriptors(P);delete r.prototype;let e=Object.create({},r);return API.public_api=e,e.FS=Module.FS,e.PATH=Module.PATH,e.ERRNO_CODES=Module.ERRNO_CODES,e._module=Module,e._api=API,e}i(Gn,"makePublicAPI");function zn(r,e){return new Proxy(r,{get(t,n){return n==="get"?o=>{let a=t.get(o);return a===void 0&&(a=e.get(o)),a}:n==="has"?o=>t.has(o)||e.has(o):Reflect.get(t,n)}})}i(zn,"wrapPythonGlobals");var Ot;API.bootstrapFinalizedPromise=new Promise(r=>Ot=r);function xr(r){"__all__"in r||Object.defineProperty(r,"__all__",{get:()=>API.public_api.toPy(Object.getOwnPropertyNames(r).filter(e=>e!=="__all__")),enumerable:!1,configurable:!0})}i(xr,"jsFinderHook");API.finalizeBootstrap=function(r){r&&Et();let[e,t]=API.rawRun("import _pyodide_core");e&&API.fatal_loading_error(`Failed to import _pyodide_core\n`,t),API.runPythonInternal_dict=API._pyodide._base.eval_code("{}"),API.importlib=API.runPythonInternal("import importlib; importlib");let n=API.importlib.import_module;API.sys=n("sys"),API.os=n("os");let o=API.runPythonInternal("import __main__; __main__.__dict__"),a=API.runPythonInternal("import builtins; builtins.__dict__");API.globals=zn(o,a);let s=API._pyodide._importhook,l=Gn();API.config._makeSnapshot&&(API.config.jsglobals=Ve(API.config.jsglobals));let c=API.config.jsglobals;return r?kt(c,r):(s.register_js_finder.callKwargs({hook:xr}),s.register_js_module("js",c),s.register_js_module("pyodide_js",l)),API.pyodide_py=n("pyodide"),API.pyodide_code=n("pyodide.code"),API.pyodide_ffi=n("pyodide.ffi"),API.package_loader=n("pyodide._package_loader"),API.pyodide_base=n("_pyodide._base"),API.sitepackages=API.package_loader.SITE_PACKAGES.__str__(),API.dsodir=API.package_loader.DSO_DIR.__str__(),API.defaultLdLibraryPath=[API.dsodir,API.sitepackages],API.os.environ.__setitem__("LD_LIBRARY_PATH",API.defaultLdLibraryPath.join(":")),l.pyodide_py=API.pyodide_py,l.globals=API.globals,Ot(),l}})()}var StackSwitching=(()=>{var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var __toBinary=(()=>{var table=new Uint8Array(128);for(var i=0;i<64;i++)table[i<26?i+65:i<52?i+71:i<62?i-4:i*4-205]=i;return base64=>{var n=base64.length,bytes=new Uint8Array((n-(base64[n-1]=="=")-(base64[n-2]=="="))*3/4|0);for(var i2=0,j=0;i2>4;bytes[j++]=c1<<4|c2>>2;bytes[j++]=c2<<6|c3}return bytes}})();var stack_switching_exports={};__export(stack_switching_exports,{createPromising:()=>createPromising,jsWrapperTag:()=>jsWrapperTag,promisingApply:()=>promisingApply});var WASM_PRELUDE=[0,97,115,109,1,0,0,0];function insertSectionPrefix(sectionCode,sectionBody){var section=[sectionCode];uleb128Encode(sectionBody.length,section);section.push(...sectionBody);return section}var typeCodes={i32:127,i64:126,f32:125,f64:124,externref:111,void:64};var constCodes={i32:65,i64:66,f32:67,f64:68};function emscriptenSigToWasm(sig){const lookup={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",v:""};const parameters=sig.split("").map(x=>lookup[x]);const result=parameters.shift();const results=result?[result]:[];return{parameters:parameters,results:results}}var TypeSection=class{constructor(){this._numTypes=0;this._section=[0]}addEmscripten(sig){return this.addWasm(emscriptenSigToWasm(sig))}addWasm({parameters:parameters,results:results}){this._section.push(96);uleb128Encode(parameters.length,this._section);for(let p of parameters){this._section.push(typeCodes[p])}uleb128Encode(results.length,this._section);for(let p of results){this._section.push(typeCodes[p])}return this._numTypes++}generate(){this._section[0]=this._numTypes;return insertSectionPrefix(1,this._section)}};function encodeStr(s){const buf=(new TextEncoder).encode(s);return[buf.length,...buf]}var ImportSection=class{constructor(){this._numImports=0;this.numGlobals=0;this.numFuncs=0;this._section=[0]}_addName(name){this._section.push(...ImportSection._module);this._section.push(...encodeStr(name))}addFunction(name,sig){this._addName(name);this._section.push(ImportSection.descr.func,sig);this._numImports++;return this.numFuncs++}addTable(name){this._addName(name);this._section.push(ImportSection.descr.table,112,0,0);this._numImports++}addGlobal(name,type){this._addName(name);this._section.push(ImportSection.descr.global,typeCodes[type],1);this._numImports++;return this.numGlobals++}addTag(name,sig){this._addName(name);this._section.push(ImportSection.descr.tag,0,sig);this._numImports++}generate(){this._section[0]=this._numImports;return insertSectionPrefix(2,this._section)}};ImportSection._module=encodeStr("e");ImportSection.descr={func:0,table:1,mem:2,global:3,tag:4};var CodeSection=class{constructor(...locals){this._section=[];this.add(locals.length);for(let l of locals){this.add(1,typeCodes[l])}}add(...args){this._section.push(...args)}local_get(idx){this.add(32,idx)}local_set(idx){this.add(33,idx)}local_tee(idx){this.add(34,idx)}global_get(idx){this.add(35,idx)}global_set(idx){this.add(36,idx)}call(func){this.add(16,func)}call_indirect(func){this.add(17,func,0)}const(type,...val){this.add(constCodes[type],...val)}end(){this.add(11)}generate(){this.end();return insertSectionPrefix(10,insertSectionPrefix(1,this._section))}};var WasmModule=class{constructor(){this._sections=[WASM_PRELUDE]}addSection(section){this._sections.push(section.generate())}addSectionBody(sectionCode,sectionBody){this._sections.push(insertSectionPrefix(sectionCode,sectionBody))}addImportSection(imports){this.addSection(imports);this._numImportFuncs=imports.numFuncs}setExportType(type){const functionSection=[1,type];this.addSectionBody(3,functionSection);const exportSection=[1,...encodeStr("o"),0,this._numImportFuncs];this.addSectionBody(7,exportSection)}generate(){const bytes=new Uint8Array(this._sections.flat());return new WebAssembly.Module(bytes)}};function createInvokeModule(sig){const mod=new WasmModule;const types=new TypeSection;const invoke_sig=emscriptenSigToWasm(sig);const export_sig=structuredClone(invoke_sig);export_sig.parameters.unshift("i32");const invoke_tidx=types.addWasm(invoke_sig);const export_tidx=types.addWasm(export_sig);const try_tidx=typeCodes[invoke_sig.results[0]||"void"];const tag_tidx=types.addEmscripten("ve");const save_tidx=types.addEmscripten("i");const restore_tidx=types.addEmscripten("vi");const setThrew_tidx=types.addEmscripten("vii");mod.addSection(types);const imports=new ImportSection;imports.addTable("t");imports.addTag("tag",tag_tidx);const save_stack_func=imports.addFunction("s",save_tidx);const restore_stack_func=imports.addFunction("r",restore_tidx);const set_threw_func=imports.addFunction("q",setThrew_tidx);mod.addImportSection(imports);mod.setExportType(export_tidx);const code=new CodeSection(["i32"]);const stackLocal=export_sig.parameters.length;code.call(save_stack_func);code.local_set(stackLocal);code.add(6,try_tidx);for(let i=1;inew WebAssembly.Exception(jsWrapperTag,[e]);function createInvoke(sig){if(!jsWrapperTag){return createInvokeFunction(sig)}const module=createInvokeModule(sig);const instance=new WebAssembly.Instance(module,{e:{t:wasmTable,s:()=>stackSave(),r:x=>stackRestore(x),q:(x,y)=>_setThrew(x,y),tag:jsWrapperTag}});return instance.exports["o"]}function adjustWasmImports(wasmImports){const i="invoke_";for(let name of Object.keys(wasmImports.env)){if(!name.startsWith(i)){continue}wasmImports.env[name]=createInvoke(name.slice(i.length))}}var wrap_syncifying_exports={};__export(wrap_syncifying_exports,{default:()=>wrap_syncifying_default});var wrap_syncifying_default=__toBinary("AGFzbQEAAAABFARgAm9vAW9gAAFvYAFvAGABbwFvAioFAWUBcwNvAQFlAWMDfwEBZQFpAAABZQRzYXZlAAEBZQdyZXN0b3JlAAIDAgEDBwUBAW8AAwodARsBAW8jAUUEQNBvDwsQASEBIwAgABAAIAEQAgs=");var stackStates=[];var StackState=class{constructor(){this.start=stackSave();this.stop=Module.stackStop;this._copy=new Uint8Array(0);if(this.start!==this.stop){stackStates.push(this)}}restore(){let total=0;while(stackStates.length>0&&stackStates[stackStates.length-1].stop{try{return nullToUndefined(await x)}catch(e){if(e&&e.pyodide_fatal_error){throw e}Module.syncify_error=e;return null}},{suspending:"first"});const module=new WebAssembly.Module(new Uint8Array(wrap_syncifying_default));const instance=new WebAssembly.Instance(module,{e:{s:suspenderGlobal,i:suspending_f,c:validSuspender,save:save_state,restore:restore_state}});HEAP32[_syncifyHandler/4]=addFunction(instance.exports.o)}var promisingApplyHandler;function promisingApply(...args){validSuspender.value=true;Module.stackStop=stackSave();Module.origCframe=_get_cframe();return promisingApplyHandler(...args)}function wasmTypeToString(ty){return`params:${ty.parameters};results:${ty.results}`}function createPromisingModule(orig_type){const mod=new WasmModule;const ts=new TypeSection;const wrapped_type=structuredClone(orig_type);wrapped_type.parameters.unshift("externref");const orig_sig=ts.addWasm(orig_type);const wrapped_sig=ts.addWasm(wrapped_type);mod.addSection(ts);const imports=new ImportSection;imports.addGlobal("s","externref");const orig=imports.addFunction("i",orig_sig);mod.addImportSection(imports);mod.setExportType(wrapped_sig);const code=new CodeSection;code.local_get(0);code.global_set(0);for(let i=1;i!!Module.PyProxy_getAttrsQuiet(px).shared.ptr;API.pyproxyIsAlive=pyproxyIsAlive;const errNoRet=()=>{throw new Error("Assertion error: control reached end of function without return")};Module.reportUndefinedSymbols=()=>{};const nullToUndefined=x=>x===null?undefined:x;function isPromise(obj){try{return!!obj&&typeof obj.then==="function"}catch(e){return false}}API.isPromise=isPromise;function bufferAsUint8Array(arg){if(ArrayBuffer.isView(arg)){return new Uint8Array(arg.buffer,arg.byteOffset,arg.byteLength)}else{return new Uint8Array(arg)}}API.typedArrayAsUint8Array=bufferAsUint8Array;Module.iterObject=function*(object){for(let k in object){if(Object.prototype.hasOwnProperty.call(object,k)){yield k}}};function wasmFunctionType(wasm_func){if(!WebAssembly.Function){throw new Error("No type reflection")}if(WebAssembly.Function.type){return WebAssembly.Function.type(wasm_func)}return wasm_func.type()}pyodide_js_init();pyodide_js_init.sig="v";function _PyImport_InitFunc_TrampolineCall(func){return wasmTable.get(func)()}_PyImport_InitFunc_TrampolineCall.sig="ii";function _Py_emscripten_runtime(){var info;if(typeof navigator=="object"){info=navigator.userAgent}else if(typeof process=="object"){info="Node.js ".concat(process.version)}else{info="UNKNOWN"}var len=lengthBytesUTF8(info)+1;var res=_malloc(len);if(res)stringToUTF8(info,res,len);return res}_Py_emscripten_runtime.sig="i";function _Py_CheckEmscriptenSignals_Helper(){if(!Module.Py_EmscriptenSignalBuffer){return 0}try{let result=Module.Py_EmscriptenSignalBuffer[0];Module.Py_EmscriptenSignalBuffer[0]=0;return result}catch(e){return 0}}_Py_CheckEmscriptenSignals_Helper.sig="i";function _PyEM_detect_type_reflection(){return"Function"in WebAssembly}_PyEM_detect_type_reflection.sig="i";function _PyEM_TrampolineCall_JS(func,arg1,arg2,arg3){return wasmTable.get(func)(arg1,arg2,arg3)}_PyEM_TrampolineCall_JS.sig="iiiii";function _PyEM_CountFuncParams(func){let n=_PyEM_CountFuncParams.cache.get(func);if(n!==undefined){return n}n=wasmFunctionType(wasmTable.get(func)).parameters.length;_PyEM_CountFuncParams.cache.set(func,n);return n}_PyEM_CountFuncParams.cache=new Map;_PyEM_CountFuncParams.sig="ii";function unbox_small_structs(type_ptr){var type_id=HEAPU16[(type_ptr+6>>1)+0];while(type_id===13){var elements=HEAPU32[(type_ptr+8>>2)+0];var first_element=HEAPU32[(elements>>2)+0];if(first_element===0){type_id=0;break}else if(HEAPU32[(elements>>2)+1]===0){type_ptr=first_element;type_id=HEAPU16[(first_element+6>>1)+0]}else{break}}return[type_ptr,type_id]}function ffi_call_js(cif,fn,rvalue,avalue){var abi=HEAPU32[(cif>>2)+0];var nargs=HEAPU32[(cif>>2)+1];var nfixedargs=HEAPU32[(cif>>2)+6];var arg_types_ptr=HEAPU32[(cif>>2)+2];var rtype_unboxed=unbox_small_structs(HEAPU32[(cif>>2)+3]);var rtype_ptr=rtype_unboxed[0];var rtype_id=rtype_unboxed[1];var orig_stack_ptr=stackSave();var cur_stack_ptr=orig_stack_ptr;var args=[];var ret_by_arg=false;if(rtype_id===15){throw new Error("complex ret marshalling nyi")}if(rtype_id<0||rtype_id>15){throw new Error("Unexpected rtype "+rtype_id)}if(rtype_id===4||rtype_id===13){args.push(rvalue);ret_by_arg=true}for(var i=0;i>2)+i];var arg_unboxed=unbox_small_structs(HEAPU32[(arg_types_ptr>>2)+i]);var arg_type_ptr=arg_unboxed[0];var arg_type_id=arg_unboxed[1];switch(arg_type_id){case 1:case 10:case 9:case 14:args.push(HEAPU32[(arg_ptr>>2)+0]);break;case 2:args.push(HEAPF32[(arg_ptr>>2)+0]);break;case 3:args.push(HEAPF64[(arg_ptr>>3)+0]);break;case 5:args.push(HEAPU8[arg_ptr+0]);break;case 6:args.push(HEAP8[arg_ptr+0]);break;case 7:args.push(HEAPU16[(arg_ptr>>1)+0]);break;case 8:args.push(HEAP16[(arg_ptr>>1)+0]);break;case 11:case 12:args.push(HEAPU64[(arg_ptr>>3)+0]);break;case 4:args.push(HEAPU64[(arg_ptr>>3)+0]);args.push(HEAPU64[(arg_ptr>>3)+1]);break;case 13:var size=HEAPU32[(arg_type_ptr>>2)+0];var align=HEAPU16[(arg_type_ptr+4>>1)+0];cur_stack_ptr-=size,cur_stack_ptr&=~(align-1);HEAP8.subarray(cur_stack_ptr,cur_stack_ptr+size).set(HEAP8.subarray(arg_ptr,arg_ptr+size));args.push(cur_stack_ptr);break;case 15:throw new Error("complex marshalling nyi");default:throw new Error("Unexpected type "+arg_type_id)}}if(nfixedargs!=nargs){var struct_arg_info=[];for(var i=nargs-1;i>=nfixedargs;i--){var arg_ptr=HEAPU32[(avalue>>2)+i];var arg_unboxed=unbox_small_structs(HEAPU32[(arg_types_ptr>>2)+i]);var arg_type_ptr=arg_unboxed[0];var arg_type_id=arg_unboxed[1];switch(arg_type_id){case 5:case 6:cur_stack_ptr-=1,cur_stack_ptr&=~(1-1);HEAPU8[cur_stack_ptr+0]=HEAPU8[arg_ptr+0];break;case 7:case 8:cur_stack_ptr-=2,cur_stack_ptr&=~(2-1);HEAPU16[(cur_stack_ptr>>1)+0]=HEAPU16[(arg_ptr>>1)+0];break;case 1:case 9:case 10:case 14:case 2:cur_stack_ptr-=4,cur_stack_ptr&=~(4-1);HEAPU32[(cur_stack_ptr>>2)+0]=HEAPU32[(arg_ptr>>2)+0];break;case 3:case 11:case 12:cur_stack_ptr-=8,cur_stack_ptr&=~(8-1);HEAPU32[(cur_stack_ptr>>2)+0]=HEAPU32[(arg_ptr>>2)+0];HEAPU32[(cur_stack_ptr>>2)+1]=HEAPU32[(arg_ptr>>2)+1];break;case 4:cur_stack_ptr-=16,cur_stack_ptr&=~(8-1);HEAPU32[(cur_stack_ptr>>2)+0]=HEAPU32[(arg_ptr>>2)+0];HEAPU32[(cur_stack_ptr>>2)+1]=HEAPU32[(arg_ptr>>2)+1];HEAPU32[(cur_stack_ptr>>2)+2]=HEAPU32[(arg_ptr>>2)+2];HEAPU32[(cur_stack_ptr>>2)+3]=HEAPU32[(arg_ptr>>2)+3];break;case 13:cur_stack_ptr-=4,cur_stack_ptr&=~(4-1);struct_arg_info.push([cur_stack_ptr,arg_ptr,HEAPU32[(arg_type_ptr>>2)+0],HEAPU16[(arg_type_ptr+4>>1)+0]]);break;case 15:throw new Error("complex arg marshalling nyi");default:throw new Error("Unexpected argtype "+arg_type_id)}}args.push(cur_stack_ptr);for(var i=0;i>2)+0]=cur_stack_ptr}}stackRestore(cur_stack_ptr);stackAlloc(0);var result=(0,getWasmTableEntry(fn).apply(null,args));stackRestore(orig_stack_ptr);if(ret_by_arg){return}switch(rtype_id){case 0:break;case 1:case 9:case 10:case 14:HEAPU32[(rvalue>>2)+0]=result;break;case 2:HEAPF32[(rvalue>>2)+0]=result;break;case 3:HEAPF64[(rvalue>>3)+0]=result;break;case 5:case 6:HEAPU8[rvalue+0]=result;break;case 7:case 8:HEAPU16[(rvalue>>1)+0]=result;break;case 11:case 12:HEAPU64[(rvalue>>3)+0]=result;break;case 15:throw new Error("complex ret marshalling nyi");default:throw new Error("Unexpected rtype "+rtype_id)}}ffi_call_js.sig="viiii";function ffi_closure_alloc_js(size,code){var closure=_malloc(size);var index=getEmptyTableSlot();HEAPU32[(code>>2)+0]=index;HEAPU32[(closure>>2)+0]=index;return closure}ffi_closure_alloc_js.sig="iii";function ffi_closure_free_js(closure){var index=HEAPU32[(closure>>2)+0];freeTableIndexes.push(index);_free(closure)}ffi_closure_free_js.sig="vi";function ffi_prep_closure_loc_js(closure,cif,fun,user_data,codeloc){var abi=HEAPU32[(cif>>2)+0];var nargs=HEAPU32[(cif>>2)+1];var nfixedargs=HEAPU32[(cif>>2)+6];var arg_types_ptr=HEAPU32[(cif>>2)+2];var rtype_unboxed=unbox_small_structs(HEAPU32[(cif>>2)+3]);var rtype_ptr=rtype_unboxed[0];var rtype_id=rtype_unboxed[1];var sig;var ret_by_arg=false;switch(rtype_id){case 0:sig="v";break;case 13:case 4:sig="vi";ret_by_arg=true;break;case 1:case 5:case 6:case 7:case 8:case 9:case 10:case 14:sig="i";break;case 2:sig="f";break;case 3:sig="d";break;case 11:case 12:sig="j";break;case 15:throw new Error("complex ret marshalling nyi");default:throw new Error("Unexpected rtype "+rtype_id)}var unboxed_arg_type_id_list=[];var unboxed_arg_type_info_list=[];for(var i=0;i>2)+i]);var arg_type_ptr=arg_unboxed[0];var arg_type_id=arg_unboxed[1];unboxed_arg_type_id_list.push(arg_type_id);unboxed_arg_type_info_list.push([HEAPU32[(arg_type_ptr>>2)+0],HEAPU16[(arg_type_ptr+4>>1)+0]])}for(var i=0;i>2)+carg_idx]=cur_ptr;HEAPU8[cur_ptr+0]=cur_arg;break;case 7:case 8:cur_ptr-=2,cur_ptr&=~(4-1);HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;HEAPU16[(cur_ptr>>1)+0]=cur_arg;break;case 1:case 9:case 10:case 14:cur_ptr-=4,cur_ptr&=~(4-1);HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;HEAPU32[(cur_ptr>>2)+0]=cur_arg;break;case 13:cur_ptr-=arg_size,cur_ptr&=~(arg_align-1);HEAP8.subarray(cur_ptr,cur_ptr+arg_size).set(HEAP8.subarray(cur_arg,cur_arg+arg_size));HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;break;case 2:cur_ptr-=4,cur_ptr&=~(4-1);HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;HEAPF32[(cur_ptr>>2)+0]=cur_arg;break;case 3:cur_ptr-=8,cur_ptr&=~(8-1);HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;HEAPF64[(cur_ptr>>3)+0]=cur_arg;break;case 11:case 12:cur_ptr-=8,cur_ptr&=~(8-1);HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;HEAPU64[(cur_ptr>>3)+0]=cur_arg;break;case 4:cur_ptr-=16,cur_ptr&=~(8-1);HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr;HEAPU64[(cur_ptr>>3)+0]=cur_arg;cur_arg=args[jsarg_idx++];HEAPU64[(cur_ptr>>3)+1]=cur_arg;break}}var varargs=args[args.length-1];for(;carg_idx>2)+0];cur_ptr-=arg_size,cur_ptr&=~(arg_align-1);HEAP8.subarray(cur_ptr,cur_ptr+arg_size).set(HEAP8.subarray(struct_ptr,struct_ptr+arg_size));HEAPU32[(args_ptr>>2)+carg_idx]=cur_ptr}else{HEAPU32[(args_ptr>>2)+carg_idx]=varargs}varargs+=4}stackRestore(cur_ptr);stackAlloc(0);0;getWasmTableEntry(HEAPU32[(closure>>2)+2])(HEAPU32[(closure>>2)+1],ret_ptr,args_ptr,HEAPU32[(closure>>2)+3]);stackRestore(orig_stack_ptr);if(!ret_by_arg){switch(sig[0]){case"i":return HEAPU32[(ret_ptr>>2)+0];case"j":return HEAPU64[(ret_ptr>>3)+0];case"d":return HEAPF64[(ret_ptr>>3)+0];case"f":return HEAPF32[(ret_ptr>>2)+0]}}}try{var wasm_trampoline=convertJsFunctionToWasm(trampoline,sig)}catch(e){return 1}setWasmTableEntry(codeloc,wasm_trampoline);HEAPU32[(closure>>2)+1]=cif;HEAPU32[(closure>>2)+2]=fun;HEAPU32[(closure>>2)+3]=user_data;return 0}ffi_prep_closure_loc_js.sig="iiiiii";function __hiwire_deduplicate_new(){return new Map}__hiwire_deduplicate_new.sig="e";function __hiwire_deduplicate_get(map,value){return map.get(value)}__hiwire_deduplicate_get.sig="iee";function __hiwire_deduplicate_set(map,value,ref){map.set(value,ref)}__hiwire_deduplicate_set.sig="veei";function __hiwire_deduplicate_delete(map,value){map.delete(value)}__hiwire_deduplicate_delete.sig="vee";function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}Module["ExitStatus"]=ExitStatus;var GOT={};Module["GOT"]=GOT;var currentModuleWeakSymbols=new Set([]);Module["currentModuleWeakSymbols"]=currentModuleWeakSymbols;var GOTHandler={get(obj,symName){var rtn=GOT[symName];if(!rtn){rtn=GOT[symName]=new WebAssembly.Global({"value":"i32","mutable":true})}if(!currentModuleWeakSymbols.has(symName)){rtn.required=true}return rtn}};Module["GOTHandler"]=GOTHandler;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};Module["callRuntimeCallbacks"]=callRuntimeCallbacks;var decrementExceptionRefcount=ptr=>___cxa_decrement_exception_refcount(ptr);Module["decrementExceptionRefcount"]=decrementExceptionRefcount;var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;Module["UTF8Decoder"]=UTF8Decoder;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};Module["UTF8ArrayToString"]=UTF8ArrayToString;var getDylinkMetadata=binary=>{var offset=0;var end=0;function getU8(){return binary[offset++]}function getLEB(){var ret=0;var mul=1;while(1){var byte=binary[offset++];ret+=(byte&127)*mul;mul*=128;if(!(byte&128))break}return ret}function getString(){var len=getLEB();offset+=len;return UTF8ArrayToString(binary,offset-len,len)}function failIf(condition,message){if(condition)throw new Error(message)}var name="dylink.0";if(binary instanceof WebAssembly.Module){var dylinkSection=WebAssembly.Module.customSections(binary,name);if(dylinkSection.length===0){name="dylink";dylinkSection=WebAssembly.Module.customSections(binary,name)}failIf(dylinkSection.length===0,"need dylink section");binary=new Uint8Array(dylinkSection[0]);end=binary.length}else{var int32View=new Uint32Array(new Uint8Array(binary.subarray(0,24)).buffer);var magicNumberFound=int32View[0]==1836278016;failIf(!magicNumberFound,"need to see wasm magic number");failIf(binary[8]!==0,"need the dylink section to be first");offset=9;var section_size=getLEB();end=offset+section_size;name=getString()}var customSection={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(name=="dylink"){customSection.memorySize=getLEB();customSection.memoryAlign=getLEB();customSection.tableSize=getLEB();customSection.tableAlign=getLEB();var neededDynlibsCount=getLEB();for(var i=0;i_emscripten_stack_get_current();Module["stackSave"]=stackSave;var stackRestore=val=>__emscripten_stack_restore(val);Module["stackRestore"]=stackRestore;var stackAlloc=sz=>__emscripten_stack_alloc(sz);Module["stackAlloc"]=stackAlloc;var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";Module["UTF8ToString"]=UTF8ToString;var getExceptionMessageCommon=ptr=>{var sp=stackSave();var type_addr_addr=stackAlloc(4);var message_addr_addr=stackAlloc(4);___get_exception_message(ptr,type_addr_addr,message_addr_addr);var type_addr=HEAPU32[type_addr_addr>>2];var message_addr=HEAPU32[message_addr_addr>>2];var type=UTF8ToString(type_addr);_free(type_addr);var message;if(message_addr){message=UTF8ToString(message_addr);_free(message_addr)}stackRestore(sp);return[type,message]};Module["getExceptionMessageCommon"]=getExceptionMessageCommon;var getExceptionMessage=ptr=>getExceptionMessageCommon(ptr);Module["getExceptionMessage"]=getExceptionMessage;function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP64[ptr>>3];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}Module["getValue"]=getValue;var incrementExceptionRefcount=ptr=>___cxa_increment_exception_refcount(ptr);Module["incrementExceptionRefcount"]=incrementExceptionRefcount;var newDSO=(name,handle,syms)=>{var dso={refcount:Infinity,name:name,exports:syms,global:true};LDSO.loadedLibsByName[name]=dso;if(handle!=undefined){LDSO.loadedLibsByHandle[handle]=dso}return dso};Module["newDSO"]=newDSO;var LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}};Module["LDSO"]=LDSO;var ___heap_base=9878512;Module["___heap_base"]=___heap_base;var zeroMemory=(address,size)=>{HEAPU8.fill(0,address,address+size);return address};Module["zeroMemory"]=zeroMemory;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;Module["alignMemory"]=alignMemory;var getMemory=size=>{if(runtimeInitialized){return zeroMemory(_malloc(size),size)}var ret=___heap_base;var end=ret+alignMemory(size,16);___heap_base=end;GOT["__heap_base"].value=end;return ret};Module["getMemory"]=getMemory;var isInternalSym=symName=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(symName)||symName.startsWith("__em_js__");Module["isInternalSym"]=isInternalSym;var uleb128Encode=(n,target)=>{if(n<128){target.push(n)}else{target.push(n%128|128,n>>7)}};Module["uleb128Encode"]=uleb128Encode;var sigToWasmTypes=sig=>{var typeNames={"i":"i32","j":"i64","f":"f32","d":"f64","e":"externref","p":"i32"};var type={parameters:[],results:sig[0]=="v"?[]:[typeNames[sig[0]]]};for(var i=1;i{var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={"i":127,"p":127,"j":126,"f":125,"d":124,"e":111};target.push(96);uleb128Encode(sigParam.length,target);for(var i=0;i{if(typeof WebAssembly.Function=="function"){return new WebAssembly.Function(sigToWasmTypes(sig),func)}var typeSectionBody=[1];generateFuncType(sig,typeSectionBody);var bytes=[0,97,115,109,1,0,0,0,1];uleb128Encode(typeSectionBody.length,bytes);bytes.push(...typeSectionBody);bytes.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(new Uint8Array(bytes));var instance=new WebAssembly.Instance(module,{"e":{"f":func}});var wrappedFunc=instance.exports["f"];return wrappedFunc};Module["convertJsFunctionToWasm"]=convertJsFunctionToWasm;var wasmTableMirror=[];Module["wasmTableMirror"]=wasmTableMirror;var wasmTable=new WebAssembly.Table({"initial":6639,"element":"anyfunc"});Module["wasmTable"]=wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};Module["getWasmTableEntry"]=getWasmTableEntry;var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};Module["getFunctionAddress"]=getFunctionAddress;var freeTableIndexes=[];Module["freeTableIndexes"]=freeTableIndexes;var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1};Module["getEmptyTableSlot"]=getEmptyTableSlot;var setWasmTableEntry=(idx,func)=>{wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)};Module["setWasmTableEntry"]=setWasmTableEntry;var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};Module["addFunction"]=addFunction;var updateGOT=(exports,replace)=>{for(var symName in exports){if(isInternalSym(symName)){continue}var value=exports[symName];GOT[symName]||=new WebAssembly.Global({"value":"i32","mutable":true});if(replace||GOT[symName].value==0){if(typeof value=="function"){GOT[symName].value=addFunction(value)}else if(typeof value=="number"){GOT[symName].value=value}else{err(`unhandled export type for '${symName}': ${typeof value}`)}}}};Module["updateGOT"]=updateGOT;var relocateExports=(exports,memoryBase,replace)=>{var relocated={};for(var e in exports){var value=exports[e];if(typeof value=="object"){value=value.value}if(typeof value=="number"){value+=memoryBase}relocated[e]=value}updateGOT(relocated,replace);return relocated};Module["relocateExports"]=relocateExports;var isSymbolDefined=symName=>{var existing=wasmImports[symName];if(!existing||existing.stub){return false}return true};Module["isSymbolDefined"]=isSymbolDefined;var dynCall=(sig,ptr,args=[])=>{var rtn=getWasmTableEntry(ptr)(...args);return rtn};Module["dynCall"]=dynCall;var createInvokeFunction=sig=>function(){var sp=stackSave();try{return dynCall(sig,arguments[0],Array.prototype.slice.call(arguments,1))}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);if(sig[0]=="j")return 0n}};Module["createInvokeFunction"]=createInvokeFunction;var resolveGlobalSymbol=(symName,direct=false)=>{var sym;if(isSymbolDefined(symName)){sym=wasmImports[symName]}else if(symName.startsWith("invoke_")){sym=wasmImports[symName]=Module.createInvoke(symName.split("_")[1])}else if(symName.startsWith("__cxa_find_matching_catch_")){sym=wasmImports[symName]=function(){var args=Array.from(arguments);var rtn=findMatchingCatch(args);return rtn}}return{sym:sym,name:symName}};Module["resolveGlobalSymbol"]=resolveGlobalSymbol;var loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0;var tableBase=metadata.tableSize?wasmTable.length:0;if(handle){HEAP8[handle+8]=1;HEAPU32[handle+12>>2]=memoryBase;HEAP32[handle+16>>2]=metadata.memorySize;HEAPU32[handle+20>>2]=tableBase;HEAP32[handle+24>>2]=metadata.tableSize}}else{memoryBase=HEAPU32[handle+12>>2];tableBase=HEAPU32[handle+20>>2]}var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;if(tableGrowthNeeded>0){wasmTable.grow(tableGrowthNeeded)}var moduleExports;function resolveSymbol(sym){var resolved=resolveGlobalSymbol(sym).sym;if(!resolved&&localScope){resolved=localScope[sym]}if(!resolved){resolved=moduleExports[sym]}return resolved}var proxyHandler={get(stubs,prop){switch(prop){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(prop in wasmImports&&!wasmImports[prop].stub){return wasmImports[prop]}if(!(prop in stubs)){var resolved;stubs[prop]=(...args)=>{resolved||=resolveSymbol(prop);if(!resolved){throw new Error(`Dynamic linking error: cannot resolve symbol ${prop}`)}return resolved(...args)}}return stubs[prop]}};var proxy=new Proxy({},proxyHandler);var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),"env":proxy,"wasi_snapshot_preview1":proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize);moduleExports=relocateExports(instance.exports,memoryBase);if(!flags.allowUndefined){reportUndefinedSymbols()}function addEmAsm(addr,body){var args=[];var arity=0;for(;arity<16;arity++){if(body.indexOf("$"+arity)!=-1){args.push("$"+arity)}else{break}}args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports){var start=moduleExports["__start_em_asm"];var stop=moduleExports["__stop_em_asm"];while(start ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports){if(name.startsWith("__em_js__")){var start=moduleExports[name];var jsString=UTF8ToString(start);var parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]);delete moduleExports[name]}}var applyRelocs=moduleExports["__wasm_apply_data_relocs"];if(applyRelocs){if(runtimeInitialized){applyRelocs()}else{__RELOC_FUNCS__.push(applyRelocs)}}var init=moduleExports["__wasm_call_ctors"];if(init){if(runtimeInitialized){init()}else{__ATINIT__.push(init)}}return moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(result=>postInstantiation(result.module,result.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary);var instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}if(flags.loadAsync){return metadata.neededDynlibs.reduce((chain,dynNeeded)=>chain.then(()=>loadDynamicLibrary(dynNeeded,flags)),Promise.resolve()).then(loadModule)}metadata.neededDynlibs.forEach(needed=>loadDynamicLibrary(needed,flags,localScope));return loadModule()};Module["loadWebAssemblyModule"]=loadWebAssemblyModule;var mergeLibSymbols=(exports,libName)=>{for(var[sym,exp]of Object.entries(exports)){const setImport=target=>{if(!isSymbolDefined(target)){wasmImports[target]=exp}};setImport(sym);const main_alias="__main_argc_argv";if(sym=="main"){setImport(main_alias)}if(sym==main_alias){setImport("main")}if(sym.startsWith("dynCall_")&&!Module.hasOwnProperty(sym)){Module[sym]=exp}}};Module["mergeLibSymbols"]=mergeLibSymbols;var asyncLoad=(url,onload,onerror,noRunDep)=>{var dep=!noRunDep?getUniqueRunDependency(`al ${url}`):"";readAsync(url,arrayBuffer=>{onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw`Loading data file "${url}" failed.`}});if(dep)addRunDependency(dep)};Module["asyncLoad"]=asyncLoad;var preloadPlugins=Module["preloadPlugins"]||[];Module["preloadPlugins"]=preloadPlugins;var registerWasmPlugin=()=>{var wasmPlugin={"promiseChainEnd":Promise.resolve(),"canHandle":name=>!Module.noWasmDecoding&&name.endsWith(".so"),"handle":(byteArray,name,onload,onerror)=>{wasmPlugin["promiseChainEnd"]=wasmPlugin["promiseChainEnd"].then(()=>loadWebAssemblyModule(byteArray,{loadAsync:true,nodelete:true},name)).then(exports=>{preloadedWasm[name]=exports;onload(byteArray)},error=>{err(`failed to instantiate wasm: ${name}: ${error}`);onerror()})}};preloadPlugins.push(wasmPlugin)};Module["registerWasmPlugin"]=registerWasmPlugin;var preloadedWasm={};Module["preloadedWasm"]=preloadedWasm;function loadDynamicLibrary(libName,flags={global:true,nodelete:true},localScope,handle){var dso=LDSO.loadedLibsByName[libName];if(dso){if(!flags.global){if(localScope){Object.assign(localScope,dso.exports)}}else if(!dso.global){dso.global=true;mergeLibSymbols(dso.exports,libName)}if(flags.nodelete&&dso.refcount!==Infinity){dso.refcount=Infinity}dso.refcount++;if(handle){LDSO.loadedLibsByHandle[handle]=dso}return flags.loadAsync?Promise.resolve(true):true}dso=newDSO(libName,handle,"loading");dso.refcount=flags.nodelete?Infinity:1;dso.global=flags.global;function loadLibData(){var libData;if(handle){var data=HEAPU32[handle+28>>2];var dataSize=HEAPU32[handle+32>>2];if(data&&dataSize){libData=HEAP8.slice(data,data+dataSize)}}if(!libData&&flags.fs&&flags.fs.findObject(libName)){libData=flags.fs.readFile(libName,{encoding:"binary"});if(!(libData instanceof Uint8Array)){libData=new Uint8Array(libData)}}if(libData){return flags.loadAsync?Promise.resolve(libData):libData}var libFile=locateFile(libName);if(flags.loadAsync){return new Promise(function(resolve,reject){asyncLoad(libFile,resolve,reject)})}if(!readBinary){throw new Error(`${libFile}: file not found, and synchronous loading of external files is not available`)}return readBinary(libFile)}function getExports(){var preloaded=preloadedWasm[libName];if(preloaded){return flags.loadAsync?Promise.resolve(preloaded):preloaded}if(flags.loadAsync){return loadLibData().then(libData=>loadWebAssemblyModule(libData,flags,libName,localScope,handle))}return loadWebAssemblyModule(loadLibData(),flags,libName,localScope,handle)}function moduleLoaded(exports){if(dso.global){mergeLibSymbols(exports,libName)}else if(localScope){Object.assign(localScope,exports)}dso.exports=exports}if(flags.loadAsync){return getExports().then(exports=>{moduleLoaded(exports);return true})}moduleLoaded(getExports());return true}Module["loadDynamicLibrary"]=loadDynamicLibrary;var reportUndefinedSymbols=()=>{for(var[symName,entry]of Object.entries(GOT)){if(entry.value==0){var value=resolveGlobalSymbol(symName,true).sym;if(!value&&!entry.required){continue}if(typeof value=="function"){entry.value=addFunction(value,value.sig)}else if(typeof value=="number"){entry.value=value}else{throw new Error(`bad export type for '${symName}': ${typeof value}`)}}}};Module["reportUndefinedSymbols"]=reportUndefinedSymbols;var loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");dynamicLibraries.reduce((chain,lib)=>chain.then(()=>loadDynamicLibrary(lib,{loadAsync:true,global:true,nodelete:true,allowUndefined:true})),Promise.resolve()).then(()=>{reportUndefinedSymbols();removeRunDependency("loadDylibs")})};Module["loadDylibs"]=loadDylibs;var noExitRuntime=Module["noExitRuntime"]||true;Module["noExitRuntime"]=noExitRuntime;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":HEAP64[ptr>>3]=BigInt(value);break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}Module["setValue"]=setValue;var ___assert_fail=(condition,filename,line,func)=>{abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])};Module["___assert_fail"]=___assert_fail;___assert_fail.sig="vppip";var ___call_sighandler=(fp,sig)=>getWasmTableEntry(fp)(sig);Module["___call_sighandler"]=___call_sighandler;___call_sighandler.sig="vpi";var exceptionCaught=[];Module["exceptionCaught"]=exceptionCaught;var uncaughtExceptionCount=0;Module["uncaughtExceptionCount"]=uncaughtExceptionCount;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(info.excPtr);return info.get_exception_ptr()};Module["___cxa_begin_catch"]=___cxa_begin_catch;___cxa_begin_catch.sig="pp";var ___cxa_current_primary_exception=()=>{if(!exceptionCaught.length){return 0}var info=exceptionCaught[exceptionCaught.length-1];___cxa_increment_exception_refcount(info.excPtr);return info.excPtr};Module["___cxa_current_primary_exception"]=___cxa_current_primary_exception;___cxa_current_primary_exception.sig="p";var exceptionLast=0;Module["exceptionLast"]=exceptionLast;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};Module["___cxa_end_catch"]=___cxa_end_catch;___cxa_end_catch.sig="v";class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}Module["ExceptionInfo"]=ExceptionInfo;var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr}throw Module.wrapException(exceptionLast)};Module["___resumeException"]=___resumeException;___resumeException.sig="vp";var setTempRet0=val=>__emscripten_tempret_set(val);Module["setTempRet0"]=setTempRet0;var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var arg in args){var caughtType=args[arg];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};Module["findMatchingCatch"]=findMatchingCatch;var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);Module["___cxa_find_matching_catch_2"]=___cxa_find_matching_catch_2;___cxa_find_matching_catch_2.sig="p";var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);Module["___cxa_find_matching_catch_3"]=___cxa_find_matching_catch_3;___cxa_find_matching_catch_3.sig="pp";var ___cxa_rethrow=()=>{var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw Module.wrapException(exceptionLast)};Module["___cxa_rethrow"]=___cxa_rethrow;___cxa_rethrow.sig="v";var ___cxa_rethrow_primary_exception=ptr=>{if(!ptr)return;var info=new ExceptionInfo(ptr);exceptionCaught.push(info);info.set_rethrown(true);___cxa_rethrow()};Module["___cxa_rethrow_primary_exception"]=___cxa_rethrow_primary_exception;___cxa_rethrow_primary_exception.sig="vp";var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw Module.wrapException(exceptionLast)};Module["___cxa_throw"]=___cxa_throw;___cxa_throw.sig="vppp";var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;Module["___cxa_uncaught_exceptions"]=___cxa_uncaught_exceptions;___cxa_uncaught_exceptions.sig="i";var ___memory_base=new WebAssembly.Global({"value":"i32","mutable":false},1024);Module["___memory_base"]=___memory_base;var ___stack_high=9878512;Module["___stack_high"]=___stack_high;var ___stack_low=4635632;Module["___stack_low"]=___stack_low;var ___stack_pointer=new WebAssembly.Global({"value":"i32","mutable":true},9878512);Module["___stack_pointer"]=___stack_pointer;var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:(...paths)=>PATH.normalize(paths.join("/")),join2:(l,r)=>PATH.normalize(l+"/"+r)};Module["PATH"]=PATH;var initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")};Module["initRandomFill"]=initRandomFill;var randomFill=view=>(randomFill=initRandomFill())(view);Module["randomFill"]=randomFill;var PATH_FS={resolve:(...args)=>{var resolvedPath="",resolvedAbsolute=false;for(var i=args.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?args[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};Module["lengthBytesUTF8"]=lengthBytesUTF8;var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};Module["stringToUTF8Array"]=stringToUTF8Array;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};Module["FS_stdin_getChar"]=FS_stdin_getChar;var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}},ioctl_tcgets(tty){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(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};Module["TTY"]=TTY;var mmapAlloc=size=>{size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size);if(!ptr)return 0;return zeroMemory(ptr,size)};Module["mmapAlloc"]=mmapAlloc;var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}MEMFS.ops_table||={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){throw FS.genericErrors[44]},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir(node){var entries=[".",".."];for(var key of Object.keys(node.contents)){entries.push(key)}return entries},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn)};Module["FS_createDataFile"]=FS_createDataFile;var FS_handledByPreloadPlugin=(byteArray,fullname,finish,onerror)=>{if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled};Module["FS_handledByPreloadPlugin"]=FS_handledByPreloadPlugin;var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){preFinish?.();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}onload?.();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{onerror?.();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,processData,onerror)}else{processData(url)}};Module["FS_createPreloadedFile"]=FS_createPreloadedFile;var FS_modeStringToFlags=str=>{var flagModes={"r":0,"r+":2,"w":512|64|1,"w+":512|64|2,"a":1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};Module["FS_modeStringToFlags"]=FS_modeStringToFlags;var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};Module["FS_getMode"]=FS_getMode;var IDBFS={dbs:{},indexedDB:()=>{if(typeof indexedDB!="undefined")return indexedDB;var ret=null;if(typeof window=="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;return ret},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:(...args)=>MEMFS.mount(...args),syncfs:(mount,populate,callback)=>{IDBFS.getLocalSet(mount,(err,local)=>{if(err)return callback(err);IDBFS.getRemoteSet(mount,(err,remote)=>{if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)})})},quit:()=>{Object.values(IDBFS.dbs).forEach(value=>value.close());IDBFS.dbs={}},getDB:(name,callback)=>{var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}if(!req){return callback("Unable to connect to IndexedDB")}req.onupgradeneeded=e=>{var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}};req.onsuccess=()=>{db=req.result;IDBFS.dbs[name]=db;callback(null,db)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},getLocalSet:(mount,callback)=>{var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return p=>PATH.join2(root,p)}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push(...FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={"timestamp":stat.mtime}}return callback(null,{type:"local",entries:entries})},getRemoteSet:(mount,callback)=>{var entries={};IDBFS.getDB(mount.mountpoint,(err,db)=>{if(err)return callback(err);try{var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=e=>{callback(e.target.error);e.preventDefault()};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=event=>{var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={"timestamp":cursor.key};cursor.continue()}}catch(e){return callback(e)}})},loadLocalEntry:(path,callback)=>{var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{"timestamp":stat.mtime,"mode":stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{"timestamp":stat.mtime,"mode":stat.mode,"contents":node.contents})}else{return callback(new Error("node type not supported"))}},storeLocalEntry:(path,entry,callback)=>{try{if(FS.isDir(entry["mode"])){FS.mkdirTree(path,entry["mode"])}else if(FS.isFile(entry["mode"])){FS.writeFile(path,entry["contents"],{canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry["mode"]);FS.utime(path,entry["timestamp"],entry["timestamp"])}catch(e){return callback(e)}callback(null)},removeLocalEntry:(path,callback)=>{try{var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)},loadRemoteEntry:(store,path,callback)=>{var req=store.get(path);req.onsuccess=event=>callback(null,event.target.result);req.onerror=e=>{callback(e.target.error);e.preventDefault()}},storeRemoteEntry:(store,path,entry,callback)=>{try{var req=store.put(entry,path)}catch(e){callback(e);return}req.onsuccess=event=>callback();req.onerror=e=>{callback(e.target.error);e.preventDefault()}},removeRemoteEntry:(store,path,callback)=>{var req=store.delete(path);req.onsuccess=event=>callback();req.onerror=e=>{callback(e.target.error);e.preventDefault()}},reconcile:(src,dst,callback)=>{var total=0;var create=[];Object.keys(src.entries).forEach(function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e["timestamp"].getTime()!=e2["timestamp"].getTime()){create.push(key);total++}});var remove=[];Object.keys(dst.entries).forEach(function(key){if(!src.entries[key]){remove.push(key);total++}});if(!total){return callback(null)}var errored=false;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err&&!errored){errored=true;return callback(err)}}transaction.onerror=transaction.onabort=e=>{done(e.target.error);e.preventDefault()};transaction.oncomplete=e=>{if(!errored){callback(null)}};create.sort().forEach(path=>{if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(err,entry)=>{if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)})}else{IDBFS.loadLocalEntry(path,(err,entry)=>{if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)})}});remove.sort().reverse().forEach(path=>{if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}})}};Module["IDBFS"]=IDBFS;var ERRNO_CODES={"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};Module["ERRNO_CODES"]=ERRNO_CODES;var NODEFS={isWindows:false,staticInit(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process.binding("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={1024:flags["O_APPEND"],64:flags["O_CREAT"],128:flags["O_EXCL"],256:flags["O_NOCTTY"],0:flags["O_RDONLY"],2:flags["O_RDWR"],4096:flags["O_SYNC"],512:flags["O_TRUNC"],1:flags["O_WRONLY"],131072:flags["O_NOFOLLOW"]}},convertNodeCode(e){var code=e.code;return ERRNO_CODES[code]},mount(mount){return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)},createNode(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(28)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node},getMode(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}return stat.mode},realPath(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join(...parts)},flagsForNode(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;flags&=~65536;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(flags){throw new FS.ErrnoError(28)}return newFlags},node_ops:{getattr(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}},setattr(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},lookup(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)},mknod(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}return node},rename(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}oldNode.name=newName},unlink(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},rmdir(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},readdir(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},symlink(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},readlink(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=nodePath.relative(nodePath.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;if(e.code==="UNKNOWN")throw new FS.ErrnoError(28);throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}}},stream_ops:{open(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.shared.refcount=1;stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},close(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd&&--stream.shared.refcount===0){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},dup(stream){stream.shared.refcount++},read(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,new Int8Array(buffer.buffer,offset,length),{position:position})}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},write(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,new Int8Array(buffer.buffer,offset,length),{position:position})}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},llseek(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}}}if(position<0){throw new FS.ErrnoError(28)}return position},mmap(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}var ptr=mmapAlloc(length);NODEFS.stream_ops.read(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}},msync(stream,buffer,offset,length,mmapFlags){NODEFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0}}};Module["NODEFS"]=NODEFS;var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size},write(stream,buffer,offset,length,position){throw new FS.ErrnoError(29)},llseek(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(28)}return position}}};Module["WORKERFS"]=WORKERFS;var PROXYFS={mount(mount){return PROXYFS.createNode(null,"/",mount.opts.fs.lstat(mount.opts.root).mode,0)},createNode(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=PROXYFS.node_ops;node.stream_ops=PROXYFS.stream_ops;return node},realPath(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join(...parts)},node_ops:{getattr(node){var path=PROXYFS.realPath(node);var stat;try{stat=node.mount.opts.fs.lstat(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}},setattr(node,attr){var path=PROXYFS.realPath(node);try{if(attr.mode!==undefined){node.mount.opts.fs.chmod(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);node.mount.opts.fs.utime(path,date,date)}if(attr.size!==undefined){node.mount.opts.fs.truncate(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},lookup(parent,name){try{var path=PATH.join2(PROXYFS.realPath(parent),name);var mode=parent.mount.opts.fs.lstat(path).mode;var node=PROXYFS.createNode(parent,name,mode);return node}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},mknod(parent,name,mode,dev){var node=PROXYFS.createNode(parent,name,mode,dev);var path=PROXYFS.realPath(node);try{if(FS.isDir(node.mode)){node.mount.opts.fs.mkdir(path,node.mode)}else{node.mount.opts.fs.writeFile(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node},rename(oldNode,newDir,newName){var oldPath=PROXYFS.realPath(oldNode);var newPath=PATH.join2(PROXYFS.realPath(newDir),newName);try{oldNode.mount.opts.fs.rename(oldPath,newPath);oldNode.name=newName;oldNode.parent=newDir}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},unlink(parent,name){var path=PATH.join2(PROXYFS.realPath(parent),name);try{parent.mount.opts.fs.unlink(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},rmdir(parent,name){var path=PATH.join2(PROXYFS.realPath(parent),name);try{parent.mount.opts.fs.rmdir(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readdir(node){var path=PROXYFS.realPath(node);try{return node.mount.opts.fs.readdir(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},symlink(parent,newName,oldPath){var newPath=PATH.join2(PROXYFS.realPath(parent),newName);try{parent.mount.opts.fs.symlink(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readlink(node){var path=PROXYFS.realPath(node);try{return node.mount.opts.fs.readlink(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}},stream_ops:{open(stream){var path=PROXYFS.realPath(stream.node);try{stream.nfd=stream.node.mount.opts.fs.open(path,stream.flags)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},close(stream){try{stream.node.mount.opts.fs.close(stream.nfd)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},read(stream,buffer,offset,length,position){try{return stream.node.mount.opts.fs.read(stream.nfd,buffer,offset,length,position)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},write(stream,buffer,offset,length,position){try{return stream.node.mount.opts.fs.write(stream.nfd,buffer,offset,length,position)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},llseek(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=stream.node.node_ops.getattr(stream.node);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position}}};Module["PROXYFS"]=PROXYFS;var LZ4={DIR_MODE:16895,FILE_MODE:33279,CHUNK_SIZE:-1,codec:null,init(){if(LZ4.codec)return;LZ4.codec=function(){var MiniLZ4=function(){var exports={};exports.uncompress=function(input,output,sIdx,eIdx){sIdx=sIdx||0;eIdx=eIdx||input.length-sIdx;for(var i=sIdx,n=eIdx,j=0;i>4;if(literals_length>0){var l=literals_length+240;while(l===255){l=input[i++];literals_length+=l}var end=i+literals_length;while(ij)return-(i-2);var match_length=token&15;var l=match_length+240;while(l===255){l=input[i++];match_length+=l}var pos=j-offset;var end=j+match_length+4;while(jmaxInputSize?0:isize+isize/255+16|0};exports.compress=function(src,dst,sIdx,eIdx){hashTable.set(empty);return compressBlock(src,dst,0,sIdx||0,eIdx||dst.length)};function compressBlock(src,dst,pos,sIdx,eIdx){var dpos=sIdx;var dlen=eIdx-sIdx;var anchor=0;if(src.length>=maxInputSize)throw new Error("input too large");if(src.length>mfLimit){var n=exports.compressBound(src.length);if(dlen>>hashShift;var ref=hashTable[hash]-1;hashTable[hash]=pos+1;if(ref<0||pos-ref>>>16>0||((src[ref+3]<<8|src[ref+2])!=sequenceHighBits||(src[ref+1]<<8|src[ref])!=sequenceLowBits)){step=findMatchAttempts++>>skipStrength;pos+=step;continue}findMatchAttempts=(1<=runMask){dst[dpos++]=(runMask<254;len-=255){dst[dpos++]=255}dst[dpos++]=len}else{dst[dpos++]=(literals_length<>8;if(match_length>=mlMask){match_length-=mlMask;while(match_length>=255){match_length-=255;dst[dpos++]=255}dst[dpos++]=match_length}anchor=pos}}if(anchor==0)return 0;literals_length=src.length-anchor;if(literals_length>=runMask){dst[dpos++]=runMask<254;ln-=255){dst[dpos++]=255}dst[dpos++]=ln}else{dst[dpos++]=literals_length<0){assert(compressedSize<=bound);compressed=compressed.subarray(0,compressedSize);compressedChunks.push(compressed);total+=compressedSize;successes.push(1);if(verify){var back=exports.uncompress(compressed,temp);assert(back===chunk.length,[back,chunk.length]);for(var i=0;i{var dir=PATH.dirname(file.filename);var name=PATH.basename(file.filename);FS.createPath("",dir,true,true);var parent=FS.analyzePath(dir).object;LZ4.createNode(parent,name,LZ4.FILE_MODE,0,{compressedData:compressedData,start:file.start,end:file.end})});if(preloadPlugin){Browser.init();pack["metadata"].files.forEach(file=>{var handled=false;var fullname=file.filename;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){var dep=getUniqueRunDependency("fp "+fullname);addRunDependency(dep);var finish=()=>removeRunDependency(dep);var byteArray=FS.readFile(fullname);plugin["handle"](byteArray,fullname,finish,finish);handled=true}})})}},createNode(parent,name,mode,dev,contents,mtime){var node=FS.createNode(parent,name,mode);node.mode=mode;node.node_ops=LZ4.node_ops;node.stream_ops=LZ4.stream_ops;node.timestamp=(mtime||new Date).getTime();assert(LZ4.FILE_MODE!==LZ4.DIR_MODE);if(mode===LZ4.FILE_MODE){node.size=contents.end-contents.start;node.contents=contents}else{node.size=4096;node.contents={}}if(parent){parent.contents[name]=node}return node},node_ops:{getattr(node){return{dev:1,ino:node.id,mode:node.mode,nlink:1,uid:0,gid:0,rdev:0,size:node.size,atime:new Date(node.timestamp),mtime:new Date(node.timestamp),ctime:new Date(node.timestamp),blksize:4096,blocks:Math.ceil(node.size/4096)}},setattr(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}},lookup(parent,name){throw new FS.ErrnoError(44)},mknod(parent,name,mode,dev){throw new FS.ErrnoError(63)},rename(oldNode,newDir,newName){throw new FS.ErrnoError(63)},unlink(parent,name){throw new FS.ErrnoError(63)},rmdir(parent,name){throw new FS.ErrnoError(63)},readdir(node){throw new FS.ErrnoError(63)},symlink(parent,newName,oldPath){throw new FS.ErrnoError(63)}},stream_ops:{read(stream,buffer,offset,length,position){length=Math.min(length,stream.node.size-position);if(length<=0)return 0;var contents=stream.node.contents;var compressedData=contents.compressedData;var written=0;while(written=0){currChunk=compressedData["cachedChunks"][found]}else{compressedData["cachedIndexes"].pop();compressedData["cachedIndexes"].unshift(chunkIndex);currChunk=compressedData["cachedChunks"].pop();compressedData["cachedChunks"].unshift(currChunk);if(compressedData["debug"]){out("decompressing chunk "+chunkIndex);Module["decompressedChunks"]=(Module["decompressedChunks"]||0)+1}var compressed=compressedData["data"].subarray(compressedStart,compressedStart+compressedSize);var originalSize=LZ4.codec.uncompress(compressed,currChunk);if(chunkIndex8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?`${mount}/${path}`:mount+path}path=path?`${node.name}/${path}`:node.name;node=node.parent}},hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},dupStream(origStream,fd=-1){var stream=FS.createStream(origStream,fd);stream.stream_ops?.dup?.(stream);return stream},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;stream.stream_ops.open?.(stream)},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push(...m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;iFS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},staticInit(){[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack=""});FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS,"PROXYFS":PROXYFS}},init(input,output,error){FS.init.initialized=true;Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit(){FS.init.initialized=false;_fflush(0);for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]}setDataGetter(getter){this.getter=getter}cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true}get length(){if(!this.lengthKnown){this.cacheLength()}return this._length}get chunkSize(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=(...args)=>{FS.forceLoadFile(node);return fn(...args)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node}};Module["FS"]=FS;var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat(func,path,buf){var stat=func(path);HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAP32[buf+12>>2]=stat.uid;HEAP32[buf+16>>2]=stat.gid;HEAP32[buf+20>>2]=stat.rdev;HEAP64[buf+24>>3]=BigInt(stat.size);HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();HEAP64[buf+40>>3]=BigInt(Math.floor(atime/1e3));HEAPU32[buf+48>>2]=atime%1e3*1e3;HEAP64[buf+56>>3]=BigInt(Math.floor(mtime/1e3));HEAPU32[buf+64>>2]=mtime%1e3*1e3;HEAP64[buf+72>>3]=BigInt(Math.floor(ctime/1e3));HEAPU32[buf+80>>2]=ctime%1e3*1e3;HEAP64[buf+88>>3]=BigInt(stat.ino);return 0},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream},varargs:undefined,getStr(ptr){var ret=UTF8ToString(ptr);return ret}};Module["SYSCALLS"]=SYSCALLS;function ___syscall__newselect(nfds,readfds,writefds,exceptfds,timeout){try{var total=0;var srcReadLow=readfds?HEAP32[readfds>>2]:0,srcReadHigh=readfds?HEAP32[readfds+4>>2]:0;var srcWriteLow=writefds?HEAP32[writefds>>2]:0,srcWriteHigh=writefds?HEAP32[writefds+4>>2]:0;var srcExceptLow=exceptfds?HEAP32[exceptfds>>2]:0,srcExceptHigh=exceptfds?HEAP32[exceptfds+4>>2]:0;var dstReadLow=0,dstReadHigh=0;var dstWriteLow=0,dstWriteHigh=0;var dstExceptLow=0,dstExceptHigh=0;var allLow=(readfds?HEAP32[readfds>>2]:0)|(writefds?HEAP32[writefds>>2]:0)|(exceptfds?HEAP32[exceptfds>>2]:0);var allHigh=(readfds?HEAP32[readfds+4>>2]:0)|(writefds?HEAP32[writefds+4>>2]:0)|(exceptfds?HEAP32[exceptfds+4>>2]:0);var check=function(fd,low,high,val){return fd<32?low&val:high&val};for(var fd=0;fd>2]:0,tv_usec=readfds?HEAP32[timeout+4>>2]:0;timeoutInMillis=(tv_sec+tv_usec/1e6)*1e3}flags=stream.stream_ops.poll(stream,timeoutInMillis)}if(flags&1&&check(fd,srcReadLow,srcReadHigh,mask)){fd<32?dstReadLow=dstReadLow|mask:dstReadHigh=dstReadHigh|mask;total++}if(flags&4&&check(fd,srcWriteLow,srcWriteHigh,mask)){fd<32?dstWriteLow=dstWriteLow|mask:dstWriteHigh=dstWriteHigh|mask;total++}if(flags&2&&check(fd,srcExceptLow,srcExceptHigh,mask)){fd<32?dstExceptLow=dstExceptLow|mask:dstExceptHigh=dstExceptHigh|mask;total++}}if(readfds){HEAP32[readfds>>2]=dstReadLow;HEAP32[readfds+4>>2]=dstReadHigh}if(writefds){HEAP32[writefds>>2]=dstWriteLow;HEAP32[writefds+4>>2]=dstWriteHigh}if(exceptfds){HEAP32[exceptfds>>2]=dstExceptLow;HEAP32[exceptfds+4>>2]=dstExceptHigh}return total}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall__newselect"]=___syscall__newselect;___syscall__newselect.sig="iipppp";var SOCKFS={mount(mount){Module["websocket"]=Module["websocket"]&&"object"===typeof Module["websocket"]?Module["websocket"]:{};Module["websocket"]._callbacks={};Module["websocket"]["on"]=function(event,callback){if("function"===typeof callback){this._callbacks[event]=callback}return this};Module["websocket"].emit=function(event,param){if("function"===typeof this._callbacks[event]){this._callbacks[event].call(this,param)}};return FS.createNode(null,"/",16384|511,0)},createSocket(family,type,protocol){type&=~526336;var streaming=type==1;if(streaming&&protocol&&protocol!=6){throw new FS.ErrnoError(66)}var sock={family:family,type:type,protocol:protocol,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops};var name=SOCKFS.nextname();var node=FS.createNode(SOCKFS.root,name,49152,0);node.sock=sock;var stream=FS.createStream({path:name,node:node,flags:2,seekable:false,stream_ops:SOCKFS.stream_ops});sock.stream=stream;return sock},getSocket(fd){var stream=FS.getStream(fd);if(!stream||!FS.isSocket(stream.node.mode)){return null}return stream.node.sock},stream_ops:{poll(stream){var sock=stream.node.sock;return sock.sock_ops.poll(sock)},ioctl(stream,request,varargs){var sock=stream.node.sock;return sock.sock_ops.ioctl(sock,request,varargs)},read(stream,buffer,offset,length,position){var sock=stream.node.sock;var msg=sock.sock_ops.recvmsg(sock,length);if(!msg){return 0}buffer.set(msg.buffer,offset);return msg.buffer.length},write(stream,buffer,offset,length,position){var sock=stream.node.sock;return sock.sock_ops.sendmsg(sock,buffer,offset,length)},close(stream){var sock=stream.node.sock;sock.sock_ops.close(sock)}},nextname(){if(!SOCKFS.nextname.current){SOCKFS.nextname.current=0}return"socket["+SOCKFS.nextname.current+++"]"},websocket_sock_ops:{createPeer(sock,addr,port){var ws;if(typeof addr=="object"){ws=addr;addr=null;port=null}if(ws){if(ws._socket){addr=ws._socket.remoteAddress;port=ws._socket.remotePort}else{var result=/ws[s]?:\/\/([^:]+):(\d+)/.exec(ws.url);if(!result){throw new Error("WebSocket URL must be in the format ws(s)://address:port")}addr=result[1];port=parseInt(result[2],10)}}else{try{var runtimeConfig=Module["websocket"]&&"object"===typeof Module["websocket"];var url="ws:#".replace("#","//");if(runtimeConfig){if("string"===typeof Module["websocket"]["url"]){url=Module["websocket"]["url"]}}if(url==="ws://"||url==="wss://"){var parts=addr.split("/");url=url+parts[0]+":"+port+"/"+parts.slice(1).join("/")}var subProtocols="binary";if(runtimeConfig){if("string"===typeof Module["websocket"]["subprotocol"]){subProtocols=Module["websocket"]["subprotocol"]}}var opts=undefined;if(subProtocols!=="null"){subProtocols=subProtocols.replace(/^ +| +$/g,"").split(/ *, */);opts=subProtocols}if(runtimeConfig&&null===Module["websocket"]["subprotocol"]){subProtocols="null";opts=undefined}var WebSocketConstructor;if(ENVIRONMENT_IS_NODE){WebSocketConstructor=require("ws")}else{WebSocketConstructor=WebSocket}ws=new WebSocketConstructor(url,opts);ws.binaryType="arraybuffer"}catch(e){throw new FS.ErrnoError(23)}}var peer={addr:addr,port:port,socket:ws,dgram_send_queue:[]};SOCKFS.websocket_sock_ops.addPeer(sock,peer);SOCKFS.websocket_sock_ops.handlePeerEvents(sock,peer);if(sock.type===2&&typeof sock.sport!="undefined"){peer.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(sock.sport&65280)>>8,sock.sport&255]))}return peer},getPeer(sock,addr,port){return sock.peers[addr+":"+port]},addPeer(sock,peer){sock.peers[peer.addr+":"+peer.port]=peer},removePeer(sock,peer){delete sock.peers[peer.addr+":"+peer.port]},handlePeerEvents(sock,peer){var first=true;var handleOpen=function(){Module["websocket"].emit("open",sock.stream.fd);try{var queued=peer.dgram_send_queue.shift();while(queued){peer.socket.send(queued);queued=peer.dgram_send_queue.shift()}}catch(e){peer.socket.close()}};function handleMessage(data){if(typeof data=="string"){var encoder=new TextEncoder;data=encoder.encode(data)}else{assert(data.byteLength!==undefined);if(data.byteLength==0){return}data=new Uint8Array(data)}var wasfirst=first;first=false;if(wasfirst&&data.length===10&&data[0]===255&&data[1]===255&&data[2]===255&&data[3]===255&&data[4]==="p".charCodeAt(0)&&data[5]==="o".charCodeAt(0)&&data[6]==="r".charCodeAt(0)&&data[7]==="t".charCodeAt(0)){var newport=data[8]<<8|data[9];SOCKFS.websocket_sock_ops.removePeer(sock,peer);peer.port=newport;SOCKFS.websocket_sock_ops.addPeer(sock,peer);return}sock.recv_queue.push({addr:peer.addr,port:peer.port,data:data});Module["websocket"].emit("message",sock.stream.fd)}if(ENVIRONMENT_IS_NODE){peer.socket.on("open",handleOpen);peer.socket.on("message",function(data,isBinary){if(!isBinary){return}handleMessage(new Uint8Array(data).buffer)});peer.socket.on("close",function(){Module["websocket"].emit("close",sock.stream.fd)});peer.socket.on("error",function(error){sock.error=14;Module["websocket"].emit("error",[sock.stream.fd,sock.error,"ECONNREFUSED: Connection refused"])})}else{peer.socket.onopen=handleOpen;peer.socket.onclose=function(){Module["websocket"].emit("close",sock.stream.fd)};peer.socket.onmessage=function peer_socket_onmessage(event){handleMessage(event.data)};peer.socket.onerror=function(error){sock.error=14;Module["websocket"].emit("error",[sock.stream.fd,sock.error,"ECONNREFUSED: Connection refused"])}}},poll(sock){if(sock.type===1&&sock.server){return sock.pending.length?64|1:0}var mask=0;var dest=sock.type===1?SOCKFS.websocket_sock_ops.getPeer(sock,sock.daddr,sock.dport):null;if(sock.recv_queue.length||!dest||dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=64|1}if(!dest||dest&&dest.socket.readyState===dest.socket.OPEN){mask|=4}if(dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=16}return mask},ioctl(sock,request,arg){switch(request){case 21531:var bytes=0;if(sock.recv_queue.length){bytes=sock.recv_queue[0].data.length}HEAP32[arg>>2]=bytes;return 0;default:return 28}},close(sock){if(sock.server){try{sock.server.close()}catch(e){}sock.server=null}var peers=Object.keys(sock.peers);for(var i=0;i{var socket=SOCKFS.getSocket(fd);if(!socket)throw new FS.ErrnoError(8);return socket};Module["getSocketFromFD"]=getSocketFromFD;var Sockets={BUFFER_SIZE:10240,MAX_BUFFER_SIZE:10485760,nextFd:1,fds:{},nextport:1,maxport:65535,peer:null,connections:{},portmap:{},localAddr:4261412874,addrPool:[33554442,50331658,67108874,83886090,100663306,117440522,134217738,150994954,167772170,184549386,201326602,218103818,234881034]};Module["Sockets"]=Sockets;var inetPton4=str=>{var b=str.split(".");for(var i=0;i<4;i++){var tmp=Number(b[i]);if(isNaN(tmp))return null;b[i]=tmp}return(b[0]|b[1]<<8|b[2]<<16|b[3]<<24)>>>0};Module["inetPton4"]=inetPton4;var jstoi_q=str=>parseInt(str);Module["jstoi_q"]=jstoi_q;var inetPton6=str=>{var words;var w,offset,z,i;var valid6regx=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i;var parts=[];if(!valid6regx.test(str)){return null}if(str==="::"){return[0,0,0,0,0,0,0,0]}if(str.startsWith("::")){str=str.replace("::","Z:")}else{str=str.replace("::",":Z:")}if(str.indexOf(".")>0){str=str.replace(new RegExp("[.]","g"),":");words=str.split(":");words[words.length-4]=jstoi_q(words[words.length-4])+jstoi_q(words[words.length-3])*256;words[words.length-3]=jstoi_q(words[words.length-2])+jstoi_q(words[words.length-1])*256;words=words.slice(0,words.length-2)}else{words=str.split(":")}offset=0;z=0;for(w=0;w{switch(family){case 2:addr=inetPton4(addr);zeroMemory(sa,16);if(addrlen){HEAP32[addrlen>>2]=16}HEAP16[sa>>1]=family;HEAP32[sa+4>>2]=addr;HEAP16[sa+2>>1]=_htons(port);break;case 10:addr=inetPton6(addr);zeroMemory(sa,28);if(addrlen){HEAP32[addrlen>>2]=28}HEAP32[sa>>2]=family;HEAP32[sa+8>>2]=addr[0];HEAP32[sa+12>>2]=addr[1];HEAP32[sa+16>>2]=addr[2];HEAP32[sa+20>>2]=addr[3];HEAP16[sa+2>>1]=_htons(port);break;default:return 5}return 0};Module["writeSockaddr"]=writeSockaddr;var DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(name){var res=inetPton4(name);if(res!==null){return name}res=inetPton6(name);if(res!==null){return name}var addr;if(DNS.address_map.addrs[name]){addr=DNS.address_map.addrs[name]}else{var id=DNS.address_map.id++;assert(id<65535,"exceeded max address mappings of 65535");addr="172.29."+(id&255)+"."+(id&65280);DNS.address_map.names[addr]=name;DNS.address_map.addrs[name]=addr}return addr},lookup_addr(addr){if(DNS.address_map.names[addr]){return DNS.address_map.names[addr]}return null}};Module["DNS"]=DNS;function ___syscall_accept4(fd,addr,addrlen,flags,d1,d2){try{var sock=getSocketFromFD(fd);var newsock=sock.sock_ops.accept(sock);if(addr){var errno=writeSockaddr(addr,newsock.family,DNS.lookup_name(newsock.daddr),newsock.dport,addrlen)}return newsock.stream.fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_accept4"]=___syscall_accept4;___syscall_accept4.sig="iippiii";var inetNtop4=addr=>(addr&255)+"."+(addr>>8&255)+"."+(addr>>16&255)+"."+(addr>>24&255);Module["inetNtop4"]=inetNtop4;var inetNtop6=ints=>{var str="";var word=0;var longest=0;var lastzero=0;var zstart=0;var len=0;var i=0;var parts=[ints[0]&65535,ints[0]>>16,ints[1]&65535,ints[1]>>16,ints[2]&65535,ints[2]>>16,ints[3]&65535,ints[3]>>16];var hasipv4=true;var v4part="";for(i=0;i<5;i++){if(parts[i]!==0){hasipv4=false;break}}if(hasipv4){v4part=inetNtop4(parts[6]|parts[7]<<16);if(parts[5]===-1){str="::ffff:";str+=v4part;return str}if(parts[5]===0){str="::";if(v4part==="0.0.0.0")v4part="";if(v4part==="0.0.0.1")v4part="1";str+=v4part;return str}}for(word=0;word<8;word++){if(parts[word]===0){if(word-lastzero>1){len=0}lastzero=word;len++}if(len>longest){longest=len;zstart=word-longest+1}}for(word=0;word<8;word++){if(longest>1){if(parts[word]===0&&word>=zstart&&word{var family=HEAP16[sa>>1];var port=_ntohs(HEAPU16[sa+2>>1]);var addr;switch(family){case 2:if(salen!==16){return{errno:28}}addr=HEAP32[sa+4>>2];addr=inetNtop4(addr);break;case 10:if(salen!==28){return{errno:28}}addr=[HEAP32[sa+8>>2],HEAP32[sa+12>>2],HEAP32[sa+16>>2],HEAP32[sa+20>>2]];addr=inetNtop6(addr);break;default:return{errno:5}}return{family:family,addr:addr,port:port}};Module["readSockaddr"]=readSockaddr;var getSocketAddress=(addrp,addrlen,allowNull)=>{if(allowNull&&addrp===0)return null;var info=readSockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info};Module["getSocketAddress"]=getSocketAddress;function ___syscall_bind(fd,addr,addrlen,d1,d2,d3){try{var sock=getSocketFromFD(fd);var info=getSocketAddress(addr,addrlen);sock.sock_ops.bind(sock,info.addr,info.port);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_bind"]=___syscall_bind;___syscall_bind.sig="iippiii";function ___syscall_chdir(path){try{path=SYSCALLS.getStr(path);FS.chdir(path);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_chdir"]=___syscall_chdir;___syscall_chdir.sig="ip";function ___syscall_chmod(path,mode){try{path=SYSCALLS.getStr(path);FS.chmod(path,mode);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_chmod"]=___syscall_chmod;___syscall_chmod.sig="ipi";function ___syscall_connect(fd,addr,addrlen,d1,d2,d3){try{var sock=getSocketFromFD(fd);var info=getSocketAddress(addr,addrlen);sock.sock_ops.connect(sock,info.addr,info.port);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_connect"]=___syscall_connect;___syscall_connect.sig="iippiii";function ___syscall_dup(fd){try{var old=SYSCALLS.getStreamFromFD(fd);return FS.dupStream(old).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_dup"]=___syscall_dup;___syscall_dup.sig="ii";function ___syscall_dup3(fd,newfd,flags){try{var old=SYSCALLS.getStreamFromFD(fd);if(old.fd===newfd)return-28;var existing=FS.getStream(newfd);if(existing)FS.close(existing);return FS.dupStream(old,newfd).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_dup3"]=___syscall_dup3;___syscall_dup3.sig="iiii";function ___syscall_faccessat(dirfd,path,amode,flags){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(amode&~7){return-28}var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_faccessat"]=___syscall_faccessat;___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(fd,offset,len,advice)=>0;Module["___syscall_fadvise64"]=___syscall_fadvise64;___syscall_fadvise64.sig="iijji";var MAX_INT53=9007199254740992;Module["MAX_INT53"]=MAX_INT53;var MIN_INT53=-9007199254740992;Module["MIN_INT53"]=MIN_INT53;var bigintToI53Checked=num=>numMAX_INT53?NaN:Number(num);Module["bigintToI53Checked"]=bigintToI53Checked;function ___syscall_fallocate(fd,mode,offset,len){offset=bigintToI53Checked(offset);len=bigintToI53Checked(len);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.allocate(stream,offset,len);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fallocate"]=___syscall_fallocate;___syscall_fallocate.sig="iiijj";function ___syscall_fchdir(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.chdir(stream.path);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fchdir"]=___syscall_fchdir;___syscall_fchdir.sig="ii";function ___syscall_fchmod(fd,mode){try{FS.fchmod(fd,mode);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fchmod"]=___syscall_fchmod;___syscall_fchmod.sig="iii";function ___syscall_fchmodat2(dirfd,path,mode,flags){try{var nofollow=flags&256;path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);FS.chmod(path,mode,nofollow);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fchmodat2"]=___syscall_fchmodat2;___syscall_fchmodat2.sig="iipii";function ___syscall_fchown32(fd,owner,group){try{FS.fchown(fd,owner,group);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fchown32"]=___syscall_fchown32;___syscall_fchown32.sig="iiii";function ___syscall_fchownat(dirfd,path,owner,group,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;flags=flags&~256;path=SYSCALLS.calculateAt(dirfd,path);(nofollow?FS.lchown:FS.chown)(path,owner,group);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fchownat"]=___syscall_fchownat;___syscall_fchownat.sig="iipiii";function syscallGetVarargI(){var ret=HEAP32[+SYSCALLS.varargs>>2];SYSCALLS.varargs+=4;return ret}Module["syscallGetVarargI"]=syscallGetVarargI;var syscallGetVarargP=syscallGetVarargI;Module["syscallGetVarargP"]=syscallGetVarargP;function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=syscallGetVarargI();if(arg<0){return-28}while(FS.streams[arg]){arg++}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=syscallGetVarargI();stream.flags|=arg;return 0}case 12:{var arg=syscallGetVarargP();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0}return-28}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fcntl64"]=___syscall_fcntl64;___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fdatasync"]=___syscall_fdatasync;___syscall_fdatasync.sig="ii";function ___syscall_fstat64(fd,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fstat64"]=___syscall_fstat64;___syscall_fstat64.sig="iip";function ___syscall_statfs64(path,size,buf){try{path=SYSCALLS.getStr(path);HEAP32[buf+4>>2]=4096;HEAP32[buf+40>>2]=4096;HEAP32[buf+8>>2]=1e6;HEAP32[buf+12>>2]=5e5;HEAP32[buf+16>>2]=5e5;HEAP32[buf+20>>2]=FS.nextInode;HEAP32[buf+24>>2]=1e6;HEAP32[buf+28>>2]=42;HEAP32[buf+44>>2]=2;HEAP32[buf+36>>2]=255;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_statfs64"]=___syscall_statfs64;___syscall_statfs64.sig="ippp";function ___syscall_fstatfs64(fd,size,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return ___syscall_statfs64(0,size,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_fstatfs64"]=___syscall_fstatfs64;___syscall_fstatfs64.sig="iipp";function ___syscall_ftruncate64(fd,length){length=bigintToI53Checked(length);try{if(isNaN(length))return 61;FS.ftruncate(fd,length);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_ftruncate64"]=___syscall_ftruncate64;___syscall_ftruncate64.sig="iij";var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);Module["stringToUTF8"]=stringToUTF8;function ___syscall_getcwd(buf,size){try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size>3]=BigInt(id);HEAP64[dirp+pos+8>>3]=BigInt((idx+1)*struct_size);HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_getdents64"]=___syscall_getdents64;___syscall_getdents64.sig="iipp";function ___syscall_getpeername(fd,addr,addrlen,d1,d2,d3){try{var sock=getSocketFromFD(fd);if(!sock.daddr){return-53}var errno=writeSockaddr(addr,sock.family,DNS.lookup_name(sock.daddr),sock.dport,addrlen);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_getpeername"]=___syscall_getpeername;___syscall_getpeername.sig="iippiii";function ___syscall_getsockname(fd,addr,addrlen,d1,d2,d3){try{var sock=getSocketFromFD(fd);var errno=writeSockaddr(addr,sock.family,DNS.lookup_name(sock.saddr||"0.0.0.0"),sock.sport,addrlen);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_getsockname"]=___syscall_getsockname;___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(fd,level,optname,optval,optlen,d1){try{var sock=getSocketFromFD(fd);if(level===1){if(optname===4){HEAP32[optval>>2]=sock.error;HEAP32[optlen>>2]=4;sock.error=null;return 0}}return-50}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_getsockopt"]=___syscall_getsockopt;___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=syscallGetVarargP();HEAP32[argp>>2]=termios.c_iflag||0;HEAP32[argp+4>>2]=termios.c_oflag||0;HEAP32[argp+8>>2]=termios.c_cflag||0;HEAP32[argp+12>>2]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17]=termios.c_cc[i]||0}return 0}return 0}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=syscallGetVarargP();var c_iflag=HEAP32[argp>>2];var c_oflag=HEAP32[argp+4>>2];var c_cflag=HEAP32[argp+8>>2];var c_lflag=HEAP32[argp+12>>2];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17])}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc})}return 0}case 21519:{if(!stream.tty)return-59;var argp=syscallGetVarargP();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=syscallGetVarargP();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=syscallGetVarargP();HEAP16[argp>>1]=winsize[0];HEAP16[argp+2>>1]=winsize[1]}return 0}case 21524:{if(!stream.tty)return-59;return 0}case 21515:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_ioctl"]=___syscall_ioctl;___syscall_ioctl.sig="iiip";function ___syscall_listen(fd,backlog){try{var sock=getSocketFromFD(fd);sock.sock_ops.listen(sock,backlog);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_listen"]=___syscall_listen;___syscall_listen.sig="iiiiiii";function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_lstat64"]=___syscall_lstat64;___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(dirfd,path,mode){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_mkdirat"]=___syscall_mkdirat;___syscall_mkdirat.sig="iipi";function ___syscall_mknodat(dirfd,path,mode,dev){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_mknodat"]=___syscall_mknodat;___syscall_mknodat.sig="iipii";function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_newfstatat"]=___syscall_newfstatat;___syscall_newfstatat.sig="iippi";function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?syscallGetVarargI():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_openat"]=___syscall_openat;___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(mount){return FS.createNode(null,"/",16384|511,0)},createPipe(){var pipe={buckets:[],refcnt:2};pipe.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var rName=PIPEFS.nextname();var wName=PIPEFS.nextname();var rNode=FS.createNode(PIPEFS.root,rName,4096,0);var wNode=FS.createNode(PIPEFS.root,wName,4096,0);rNode.pipe=pipe;wNode.pipe=pipe;var readableStream=FS.createStream({path:rName,node:rNode,flags:0,seekable:false,stream_ops:PIPEFS.stream_ops});rNode.stream=readableStream;var writableStream=FS.createStream({path:wName,node:wNode,flags:1,seekable:false,stream_ops:PIPEFS.stream_ops});wNode.stream=writableStream;return{readable_fd:readableStream.fd,writable_fd:writableStream.fd}},stream_ops:{poll(stream){var pipe=stream.node.pipe;if((stream.flags&2097155)===1){return 256|4}if(pipe.buckets.length>0){for(var i=0;i0){return 64|1}}}return 0},ioctl(stream,request,varargs){return 28},fsync(stream){return 28},read(stream,buffer,offset,length,position){var pipe=stream.node.pipe;var currentLength=0;for(var i=0;i=dataLen){currBucket.buffer.set(data,currBucket.offset);currBucket.offset+=dataLen;return dataLen}else if(freeBytesInCurrBuffer>0){currBucket.buffer.set(data.subarray(0,freeBytesInCurrBuffer),currBucket.offset);currBucket.offset+=freeBytesInCurrBuffer;data=data.subarray(freeBytesInCurrBuffer,data.byteLength)}var numBuckets=data.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0;var remElements=data.byteLength%PIPEFS.BUCKET_BUFFER_SIZE;for(var i=0;i0){var newBucket={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:data.byteLength,roffset:0};pipe.buckets.push(newBucket);newBucket.buffer.set(data)}return dataLen},close(stream){var pipe=stream.node.pipe;pipe.refcnt--;if(pipe.refcnt===0){pipe.buckets=null}}},nextname(){if(!PIPEFS.nextname.current){PIPEFS.nextname.current=0}return"pipe["+PIPEFS.nextname.current+++"]"}};Module["PIPEFS"]=PIPEFS;function ___syscall_pipe(fdPtr){try{if(fdPtr==0){throw new FS.ErrnoError(21)}var res=PIPEFS.createPipe();HEAP32[fdPtr>>2]=res.readable_fd;HEAP32[fdPtr+4>>2]=res.writable_fd;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_pipe"]=___syscall_pipe;___syscall_pipe.sig="ip";function ___syscall_poll(fds,nfds,timeout){try{var nonzero=0;for(var i=0;i>2];var events=HEAP16[pollfd+4>>1];var mask=32;var stream=FS.getStream(fd);if(stream){mask=SYSCALLS.DEFAULT_POLLMASK;if(stream.stream_ops.poll){mask=stream.stream_ops.poll(stream,-1)}}mask&=events|8|16;if(mask)nonzero++;HEAP16[pollfd+6>>1]=mask}return nonzero}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_poll"]=___syscall_poll;___syscall_poll.sig="ipii";function ___syscall_readlinkat(dirfd,path,buf,bufsize){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_readlinkat"]=___syscall_readlinkat;___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(fd,buf,len,flags,addr,addrlen){try{var sock=getSocketFromFD(fd);var msg=sock.sock_ops.recvmsg(sock,len);if(!msg)return 0;if(addr){var errno=writeSockaddr(addr,sock.family,DNS.lookup_name(msg.addr),msg.port,addrlen)}HEAPU8.set(msg.buffer,buf);return msg.buffer.byteLength}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_recvfrom"]=___syscall_recvfrom;___syscall_recvfrom.sig="iippipp";function ___syscall_recvmsg(fd,message,flags,d1,d2,d3){try{var sock=getSocketFromFD(fd);var iov=HEAPU32[message+8>>2];var num=HEAP32[message+12>>2];var total=0;for(var i=0;i>2]}var msg=sock.sock_ops.recvmsg(sock,total);if(!msg)return 0;var name=HEAPU32[message>>2];if(name){var errno=writeSockaddr(name,sock.family,DNS.lookup_name(msg.addr),msg.port)}var bytesRead=0;var bytesRemaining=msg.buffer.byteLength;for(var i=0;bytesRemaining>0&&i>2];var iovlen=HEAP32[iov+(8*i+4)>>2];if(!iovlen){continue}var length=Math.min(iovlen,bytesRemaining);var buf=msg.buffer.subarray(bytesRead,bytesRead+length);HEAPU8.set(buf,iovbase+bytesRead);bytesRead+=length;bytesRemaining-=length}return bytesRead}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_recvmsg"]=___syscall_recvmsg;___syscall_recvmsg.sig="iipiiii";function ___syscall_renameat(olddirfd,oldpath,newdirfd,newpath){try{oldpath=SYSCALLS.getStr(oldpath);newpath=SYSCALLS.getStr(newpath);oldpath=SYSCALLS.calculateAt(olddirfd,oldpath);newpath=SYSCALLS.calculateAt(newdirfd,newpath);FS.rename(oldpath,newpath);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_renameat"]=___syscall_renameat;___syscall_renameat.sig="iipip";function ___syscall_rmdir(path){try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_rmdir"]=___syscall_rmdir;___syscall_rmdir.sig="ip";function ___syscall_sendmsg(fd,message,flags,d1,d2,d3){try{var sock=getSocketFromFD(fd);var iov=HEAPU32[message+8>>2];var num=HEAP32[message+12>>2];var addr,port;var name=HEAPU32[message>>2];var namelen=HEAP32[message+4>>2];if(name){var info=readSockaddr(name,namelen);if(info.errno)return-info.errno;port=info.port;addr=DNS.lookup_addr(info.addr)||info.addr}var total=0;for(var i=0;i>2]}var view=new Uint8Array(total);var offset=0;for(var i=0;i>2];var iovlen=HEAP32[iov+(8*i+4)>>2];for(var j=0;jHEAPU32[ptr>>2]+HEAP32[ptr+4>>2]*4294967296;Module["readI53FromI64"]=readI53FromI64;function ___syscall_utimensat(dirfd,path,times,flags){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path,true);if(!times){var atime=Date.now();var mtime=atime}else{var seconds=readI53FromI64(times);var nanoseconds=HEAP32[times+8>>2];atime=seconds*1e3+nanoseconds/(1e3*1e3);times+=16;seconds=readI53FromI64(times);nanoseconds=HEAP32[times+8>>2];mtime=seconds*1e3+nanoseconds/(1e3*1e3)}FS.utime(path,atime,mtime);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["___syscall_utimensat"]=___syscall_utimensat;___syscall_utimensat.sig="iippi";var ___table_base=new WebAssembly.Global({"value":"i32","mutable":false},1);Module["___table_base"]=___table_base;var ENV={};Module["ENV"]=ENV;var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};Module["stringToUTF8OnStack"]=stringToUTF8OnStack;var dlSetError=msg=>{var sp=stackSave();var cmsg=stringToUTF8OnStack(msg);___dl_seterr(cmsg,0);stackRestore(sp)};Module["dlSetError"]=dlSetError;var dlopenInternal=(handle,jsflags)=>{var filename=UTF8ToString(handle+36);var flags=HEAP32[handle+4>>2];filename=PATH.normalize(filename);var searchpaths=[];var global=Boolean(flags&256);var localScope=global?null:{};var combinedFlags={global:global,nodelete:Boolean(flags&4096),loadAsync:jsflags.loadAsync};if(jsflags.loadAsync){return loadDynamicLibrary(filename,combinedFlags,localScope,handle)}try{return loadDynamicLibrary(filename,combinedFlags,localScope,handle)}catch(e){dlSetError(`Could not load dynamic lib: ${filename}\n${e}`);return 0}};Module["dlopenInternal"]=dlopenInternal;var __dlopen_js=handle=>dlopenInternal(handle,{loadAsync:false});Module["__dlopen_js"]=__dlopen_js;__dlopen_js.sig="pp";var __dlsym_js=(handle,symbol,symbolIndex)=>{symbol=UTF8ToString(symbol);var result;var newSymIndex;var lib=LDSO.loadedLibsByHandle[handle];if(!lib.exports.hasOwnProperty(symbol)||lib.exports[symbol].stub){dlSetError(`Tried to lookup unknown symbol "${symbol}" in dynamic lib: ${lib.name}`);return 0}newSymIndex=Object.keys(lib.exports).indexOf(symbol);result=lib.exports[symbol];if(typeof result=="function"){var addr=getFunctionAddress(result);if(addr){result=addr}else{result=addFunction(result,result.sig);HEAPU32[symbolIndex>>2]=newSymIndex}}return result};Module["__dlsym_js"]=__dlsym_js;__dlsym_js.sig="pppp";var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};Module["handleException"]=handleException;var runtimeKeepaliveCounter=0;Module["runtimeKeepaliveCounter"]=runtimeKeepaliveCounter;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;Module["keepRuntimeAlive"]=keepRuntimeAlive;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){Module["onExit"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))};Module["_proc_exit"]=_proc_exit;_proc_exit.sig="vi";var exitJS=(status,implicit)=>{EXITSTATUS=status;_proc_exit(status)};Module["exitJS"]=exitJS;var _exit=exitJS;Module["_exit"]=_exit;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}};Module["maybeExit"]=maybeExit;var callUserCallback=func=>{if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}};Module["callUserCallback"]=callUserCallback;var __emscripten_dlopen_js=(handle,onsuccess,onerror,user_data)=>{function errorCallback(e){var filename=UTF8ToString(handle+36);dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`);callUserCallback(()=>getWasmTableEntry(onerror)(handle,user_data))}function successCallback(){callUserCallback(()=>getWasmTableEntry(onsuccess)(handle,user_data))}var promise=dlopenInternal(handle,{loadAsync:true});if(promise){promise.then(successCallback,errorCallback)}else{errorCallback()}};Module["__emscripten_dlopen_js"]=__emscripten_dlopen_js;__emscripten_dlopen_js.sig="vpppp";var nowIsMonotonic=1;Module["nowIsMonotonic"]=nowIsMonotonic;var __emscripten_get_now_is_monotonic=()=>nowIsMonotonic;Module["__emscripten_get_now_is_monotonic"]=__emscripten_get_now_is_monotonic;__emscripten_get_now_is_monotonic.sig="i";var __emscripten_get_progname=(str,len)=>{stringToUTF8(thisProgram,str,len)};Module["__emscripten_get_progname"]=__emscripten_get_progname;__emscripten_get_progname.sig="vpi";var __emscripten_lookup_name=name=>{var nameString=UTF8ToString(name);return inetPton4(DNS.lookup_name(nameString))};Module["__emscripten_lookup_name"]=__emscripten_lookup_name;__emscripten_lookup_name.sig="ip";var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=false;runtimeKeepaliveCounter=0};Module["__emscripten_runtime_keepalive_clear"]=__emscripten_runtime_keepalive_clear;__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_system=command=>{if(ENVIRONMENT_IS_NODE){if(!command)return 1;var cmdstr=UTF8ToString(command);if(!cmdstr.length)return 0;var cp=require("child_process");var ret=cp.spawnSync(cmdstr,[],{shell:true,stdio:"inherit"});var _W_EXITCODE=(ret,sig)=>ret<<8|sig;if(ret.status===null){var signalToNumber=sig=>{switch(sig){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15}return 2};return _W_EXITCODE(0,signalToNumber(ret.signal))}return _W_EXITCODE(ret.status,0)}if(!command)return 0;return-52};Module["__emscripten_system"]=__emscripten_system;__emscripten_system.sig="ip";var __emscripten_throw_longjmp=()=>{throw Module.wrapException(Infinity)};Module["__emscripten_throw_longjmp"]=__emscripten_throw_longjmp;__emscripten_throw_longjmp.sig="v";function __gmtime_js(time,tmPtr){time=bigintToI53Checked(time);var date=new Date(time*1e3);HEAP32[tmPtr>>2]=date.getUTCSeconds();HEAP32[tmPtr+4>>2]=date.getUTCMinutes();HEAP32[tmPtr+8>>2]=date.getUTCHours();HEAP32[tmPtr+12>>2]=date.getUTCDate();HEAP32[tmPtr+16>>2]=date.getUTCMonth();HEAP32[tmPtr+20>>2]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getUTCDay();var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday}Module["__gmtime_js"]=__gmtime_js;__gmtime_js.sig="vjp";var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);Module["isLeapYear"]=isLeapYear;var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];Module["MONTH_DAYS_LEAP_CUMULATIVE"]=MONTH_DAYS_LEAP_CUMULATIVE;var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];Module["MONTH_DAYS_REGULAR_CUMULATIVE"]=MONTH_DAYS_REGULAR_CUMULATIVE;var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};Module["ydayFromDate"]=ydayFromDate;function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);var date=new Date(time*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst}Module["__localtime_js"]=__localtime_js;__localtime_js.sig="vjp";var __mktime_js=function(tmPtr){var ret=(()=>{var date=new Date(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0);var dst=HEAP32[tmPtr+32>>2];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[tmPtr+32>>2]=Number(summerOffset!=winterOffset&&dstOffset==guessedOffset)}else if(dst>0!=(dstOffset==guessedOffset)){var nonDstOffset=Math.max(winterOffset,summerOffset);var trueOffset=dst>0?dstOffset:nonDstOffset;date.setTime(date.getTime()+(trueOffset-guessedOffset)*6e4)}HEAP32[tmPtr+24>>2]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getYear();var timeMs=date.getTime();if(isNaN(timeMs)){return-1}return timeMs/1e3})();return BigInt(ret)};Module["__mktime_js"]=__mktime_js;__mktime_js.sig="jp";function __mmap_js(len,prot,flags,fd,offset,allocated,addr){offset=bigintToI53Checked(offset);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);var res=FS.mmap(stream,len,offset,prot,flags);var ptr=res.ptr;HEAP32[allocated>>2]=res.allocated;HEAPU32[addr>>2]=ptr;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["__mmap_js"]=__mmap_js;__mmap_js.sig="ipiiijpp";function __msync_js(addr,len,prot,flags,fd,offset){offset=bigintToI53Checked(offset);try{if(isNaN(offset))return 61;SYSCALLS.doMsync(addr,SYSCALLS.getStreamFromFD(fd),len,flags,offset);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["__msync_js"]=__msync_js;__msync_js.sig="ippiiij";function __munmap_js(addr,len,prot,flags,fd,offset){offset=bigintToI53Checked(offset);try{var stream=SYSCALLS.getStreamFromFD(fd);if(prot&2){SYSCALLS.doMsync(addr,stream,len,flags,offset)}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}Module["__munmap_js"]=__munmap_js;__munmap_js.sig="ippiiij";var timers={};Module["timers"]=timers;var _emscripten_get_now;_emscripten_get_now=()=>performance.now();Module["_emscripten_get_now"]=_emscripten_get_now;_emscripten_get_now.sig="d";var __setitimer_js=(which,timeout_ms)=>{if(timers[which]){clearTimeout(timers[which].id);delete timers[which]}if(!timeout_ms)return 0;var id=setTimeout(()=>{delete timers[which];callUserCallback(()=>__emscripten_timeout(which,_emscripten_get_now()))},timeout_ms);timers[which]={id:id,timeout_ms:timeout_ms};return 0};Module["__setitimer_js"]=__setitimer_js;__setitimer_js.sig="iid";var __timegm_js=function(tmPtr){var ret=(()=>{var time=Date.UTC(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0);var date=new Date(time);HEAP32[tmPtr+24>>2]=date.getUTCDay();var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;return date.getTime()/1e3})();return BigInt(ret)};Module["__timegm_js"]=__timegm_js;__timegm_js.sig="jp";var __tzset_js=(timezone,daylight,std_name,dst_name)=>{var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>2]=stdTimezoneOffset*60;HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);var extractZone=date=>date.toLocaleTimeString(undefined,{hour12:false,timeZoneName:"short"}).split(" ")[1];var winterName=extractZone(winter);var summerName=extractZone(summer);if(summerOffset{abort("")};Module["_abort"]=_abort;_abort.sig="v";var readEmAsmArgsArray=[];Module["readEmAsmArgsArray"]=readEmAsmArgsArray;var readEmAsmArgs=(sigPtr,buf)=>{readEmAsmArgsArray.length=0;var ch;while(ch=HEAPU8[sigPtr++]){var wide=ch!=105;wide&=ch!=112;buf+=wide&&buf%8?4:0;readEmAsmArgsArray.push(ch==112?HEAPU32[buf>>2]:ch==106?HEAP64[buf>>3]:ch==105?HEAP32[buf>>2]:HEAPF64[buf>>3]);buf+=wide?8:4}return readEmAsmArgsArray};Module["readEmAsmArgs"]=readEmAsmArgs;var runEmAsmFunction=(code,sigPtr,argbuf)=>{var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code](...args)};Module["runEmAsmFunction"]=runEmAsmFunction;var _emscripten_asm_const_int=(code,sigPtr,argbuf)=>runEmAsmFunction(code,sigPtr,argbuf);Module["_emscripten_asm_const_int"]=_emscripten_asm_const_int;_emscripten_asm_const_int.sig="ippp";var _emscripten_console_error=str=>{console.error(UTF8ToString(str))};Module["_emscripten_console_error"]=_emscripten_console_error;_emscripten_console_error.sig="vp";var _emscripten_console_log=str=>{console.log(UTF8ToString(str))};Module["_emscripten_console_log"]=_emscripten_console_log;_emscripten_console_log.sig="vp";var _emscripten_console_warn=str=>{console.warn(UTF8ToString(str))};Module["_emscripten_console_warn"]=_emscripten_console_warn;_emscripten_console_warn.sig="vp";var _emscripten_date_now=()=>Date.now();Module["_emscripten_date_now"]=_emscripten_date_now;_emscripten_date_now.sig="d";var _emscripten_err=str=>err(UTF8ToString(str));Module["_emscripten_err"]=_emscripten_err;_emscripten_err.sig="vp";var _emscripten_exit_with_live_runtime=()=>{throw"unwind"};Module["_emscripten_exit_with_live_runtime"]=_emscripten_exit_with_live_runtime;_emscripten_exit_with_live_runtime.sig="v";var getHeapMax=()=>2147483648;Module["getHeapMax"]=getHeapMax;var _emscripten_get_heap_max=()=>getHeapMax();Module["_emscripten_get_heap_max"]=_emscripten_get_heap_max;_emscripten_get_heap_max.sig="p";var _emscripten_get_now_res=()=>{if(ENVIRONMENT_IS_NODE){return 1}return 1e3};Module["_emscripten_get_now_res"]=_emscripten_get_now_res;_emscripten_get_now_res.sig="d";var webgl_enable_ANGLE_instanced_arrays=ctx=>{var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=(index,divisor)=>ext["vertexAttribDivisorANGLE"](index,divisor);ctx["drawArraysInstanced"]=(mode,first,count,primcount)=>ext["drawArraysInstancedANGLE"](mode,first,count,primcount);ctx["drawElementsInstanced"]=(mode,count,type,indices,primcount)=>ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount);return 1}};Module["webgl_enable_ANGLE_instanced_arrays"]=webgl_enable_ANGLE_instanced_arrays;var webgl_enable_OES_vertex_array_object=ctx=>{var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=()=>ext["createVertexArrayOES"]();ctx["deleteVertexArray"]=vao=>ext["deleteVertexArrayOES"](vao);ctx["bindVertexArray"]=vao=>ext["bindVertexArrayOES"](vao);ctx["isVertexArray"]=vao=>ext["isVertexArrayOES"](vao);return 1}};Module["webgl_enable_OES_vertex_array_object"]=webgl_enable_OES_vertex_array_object;var webgl_enable_WEBGL_draw_buffers=ctx=>{var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=(n,bufs)=>ext["drawBuffersWEBGL"](n,bufs);return 1}};Module["webgl_enable_WEBGL_draw_buffers"]=webgl_enable_WEBGL_draw_buffers;var webgl_enable_WEBGL_multi_draw=ctx=>!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"));Module["webgl_enable_WEBGL_multi_draw"]=webgl_enable_WEBGL_multi_draw;var getEmscriptenSupportedExtensions=ctx=>{var supportedExtensions=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"];return(ctx.getSupportedExtensions()||[]).filter(ext=>supportedExtensions.includes(ext))};Module["getEmscriptenSupportedExtensions"]=getEmscriptenSupportedExtensions;var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:errorCode=>{if(!GL.lastError){GL.lastError=errorCode}},getNewId:table=>{var ret=GL.counter++;for(var i=table.length;i{for(var i=0;i>2]=id}},getSource:(shader,count,string,length)=>{var source="";for(var i=0;i>2]:undefined;source+=UTF8ToString(HEAPU32[string+i*4>>2],len)}return source},createContext:(canvas,webGLContextAttributes)=>{var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:(ctx,webGLContextAttributes)=>{var handle=GL.getNewId(GL.contexts);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault=="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:contextHandle=>{GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext?.GLctx;return!(contextHandle&&!GLctx)},getContext:contextHandle=>GL.contexts[contextHandle],deleteContext:contextHandle=>{if(GL.currentContext===GL.contexts[contextHandle]){GL.currentContext=null}if(typeof JSEvents=="object"){JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas)}if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas){GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined}GL.contexts[contextHandle]=null},initExtensions:context=>{context||=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;webgl_enable_ANGLE_instanced_arrays(GLctx);webgl_enable_OES_vertex_array_object(GLctx);webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}webgl_enable_WEBGL_multi_draw(GLctx);getEmscriptenSupportedExtensions(GLctx).forEach(ext=>{if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};Module["GL"]=GL;var _glActiveTexture=x0=>GLctx.activeTexture(x0);Module["_glActiveTexture"]=_glActiveTexture;_glActiveTexture.sig="vi";var _emscripten_glActiveTexture=_glActiveTexture;Module["_emscripten_glActiveTexture"]=_emscripten_glActiveTexture;_emscripten_glActiveTexture.sig="vi";var _glAttachShader=(program,shader)=>{GLctx.attachShader(GL.programs[program],GL.shaders[shader])};Module["_glAttachShader"]=_glAttachShader;_glAttachShader.sig="vii";var _emscripten_glAttachShader=_glAttachShader;Module["_emscripten_glAttachShader"]=_emscripten_glAttachShader;_emscripten_glAttachShader.sig="vii";var _glBeginQueryEXT=(target,id)=>{GLctx.disjointTimerQueryExt["beginQueryEXT"](target,GL.queries[id])};Module["_glBeginQueryEXT"]=_glBeginQueryEXT;_glBeginQueryEXT.sig="vii";var _emscripten_glBeginQueryEXT=_glBeginQueryEXT;Module["_emscripten_glBeginQueryEXT"]=_emscripten_glBeginQueryEXT;var _glBindAttribLocation=(program,index,name)=>{GLctx.bindAttribLocation(GL.programs[program],index,UTF8ToString(name))};Module["_glBindAttribLocation"]=_glBindAttribLocation;_glBindAttribLocation.sig="viip";var _emscripten_glBindAttribLocation=_glBindAttribLocation;Module["_emscripten_glBindAttribLocation"]=_emscripten_glBindAttribLocation;_emscripten_glBindAttribLocation.sig="viip";var _glBindBuffer=(target,buffer)=>{GLctx.bindBuffer(target,GL.buffers[buffer])};Module["_glBindBuffer"]=_glBindBuffer;_glBindBuffer.sig="vii";var _emscripten_glBindBuffer=_glBindBuffer;Module["_emscripten_glBindBuffer"]=_emscripten_glBindBuffer;_emscripten_glBindBuffer.sig="vii";var _glBindFramebuffer=(target,framebuffer)=>{GLctx.bindFramebuffer(target,GL.framebuffers[framebuffer])};Module["_glBindFramebuffer"]=_glBindFramebuffer;_glBindFramebuffer.sig="vii";var _emscripten_glBindFramebuffer=_glBindFramebuffer;Module["_emscripten_glBindFramebuffer"]=_emscripten_glBindFramebuffer;_emscripten_glBindFramebuffer.sig="vii";var _glBindRenderbuffer=(target,renderbuffer)=>{GLctx.bindRenderbuffer(target,GL.renderbuffers[renderbuffer])};Module["_glBindRenderbuffer"]=_glBindRenderbuffer;_glBindRenderbuffer.sig="vii";var _emscripten_glBindRenderbuffer=_glBindRenderbuffer;Module["_emscripten_glBindRenderbuffer"]=_emscripten_glBindRenderbuffer;_emscripten_glBindRenderbuffer.sig="vii";var _glBindTexture=(target,texture)=>{GLctx.bindTexture(target,GL.textures[texture])};Module["_glBindTexture"]=_glBindTexture;_glBindTexture.sig="vii";var _emscripten_glBindTexture=_glBindTexture;Module["_emscripten_glBindTexture"]=_emscripten_glBindTexture;_emscripten_glBindTexture.sig="vii";var _glBindVertexArray=vao=>{GLctx.bindVertexArray(GL.vaos[vao])};Module["_glBindVertexArray"]=_glBindVertexArray;_glBindVertexArray.sig="vi";var _glBindVertexArrayOES=_glBindVertexArray;Module["_glBindVertexArrayOES"]=_glBindVertexArrayOES;_glBindVertexArrayOES.sig="vi";var _emscripten_glBindVertexArrayOES=_glBindVertexArrayOES;Module["_emscripten_glBindVertexArrayOES"]=_emscripten_glBindVertexArrayOES;_emscripten_glBindVertexArrayOES.sig="vi";var _glBlendColor=(x0,x1,x2,x3)=>GLctx.blendColor(x0,x1,x2,x3);Module["_glBlendColor"]=_glBlendColor;_glBlendColor.sig="vffff";var _emscripten_glBlendColor=_glBlendColor;Module["_emscripten_glBlendColor"]=_emscripten_glBlendColor;_emscripten_glBlendColor.sig="vffff";var _glBlendEquation=x0=>GLctx.blendEquation(x0);Module["_glBlendEquation"]=_glBlendEquation;_glBlendEquation.sig="vi";var _emscripten_glBlendEquation=_glBlendEquation;Module["_emscripten_glBlendEquation"]=_emscripten_glBlendEquation;_emscripten_glBlendEquation.sig="vi";var _glBlendEquationSeparate=(x0,x1)=>GLctx.blendEquationSeparate(x0,x1);Module["_glBlendEquationSeparate"]=_glBlendEquationSeparate;_glBlendEquationSeparate.sig="vii";var _emscripten_glBlendEquationSeparate=_glBlendEquationSeparate;Module["_emscripten_glBlendEquationSeparate"]=_emscripten_glBlendEquationSeparate;_emscripten_glBlendEquationSeparate.sig="vii";var _glBlendFunc=(x0,x1)=>GLctx.blendFunc(x0,x1);Module["_glBlendFunc"]=_glBlendFunc;_glBlendFunc.sig="vii";var _emscripten_glBlendFunc=_glBlendFunc;Module["_emscripten_glBlendFunc"]=_emscripten_glBlendFunc;_emscripten_glBlendFunc.sig="vii";var _glBlendFuncSeparate=(x0,x1,x2,x3)=>GLctx.blendFuncSeparate(x0,x1,x2,x3);Module["_glBlendFuncSeparate"]=_glBlendFuncSeparate;_glBlendFuncSeparate.sig="viiii";var _emscripten_glBlendFuncSeparate=_glBlendFuncSeparate;Module["_emscripten_glBlendFuncSeparate"]=_emscripten_glBlendFuncSeparate;_emscripten_glBlendFuncSeparate.sig="viiii";var _glBufferData=(target,size,data,usage)=>{GLctx.bufferData(target,data?HEAPU8.subarray(data,data+size):size,usage)};Module["_glBufferData"]=_glBufferData;_glBufferData.sig="vippi";var _emscripten_glBufferData=_glBufferData;Module["_emscripten_glBufferData"]=_emscripten_glBufferData;_emscripten_glBufferData.sig="vippi";var _glBufferSubData=(target,offset,size,data)=>{GLctx.bufferSubData(target,offset,HEAPU8.subarray(data,data+size))};Module["_glBufferSubData"]=_glBufferSubData;_glBufferSubData.sig="vippp";var _emscripten_glBufferSubData=_glBufferSubData;Module["_emscripten_glBufferSubData"]=_emscripten_glBufferSubData;_emscripten_glBufferSubData.sig="vippp";var _glCheckFramebufferStatus=x0=>GLctx.checkFramebufferStatus(x0);Module["_glCheckFramebufferStatus"]=_glCheckFramebufferStatus;_glCheckFramebufferStatus.sig="ii";var _emscripten_glCheckFramebufferStatus=_glCheckFramebufferStatus;Module["_emscripten_glCheckFramebufferStatus"]=_emscripten_glCheckFramebufferStatus;_emscripten_glCheckFramebufferStatus.sig="ii";var _glClear=x0=>GLctx.clear(x0);Module["_glClear"]=_glClear;_glClear.sig="vi";var _emscripten_glClear=_glClear;Module["_emscripten_glClear"]=_emscripten_glClear;_emscripten_glClear.sig="vi";var _glClearColor=(x0,x1,x2,x3)=>GLctx.clearColor(x0,x1,x2,x3);Module["_glClearColor"]=_glClearColor;_glClearColor.sig="vffff";var _emscripten_glClearColor=_glClearColor;Module["_emscripten_glClearColor"]=_emscripten_glClearColor;_emscripten_glClearColor.sig="vffff";var _glClearDepthf=x0=>GLctx.clearDepth(x0);Module["_glClearDepthf"]=_glClearDepthf;_glClearDepthf.sig="vf";var _emscripten_glClearDepthf=_glClearDepthf;Module["_emscripten_glClearDepthf"]=_emscripten_glClearDepthf;_emscripten_glClearDepthf.sig="vf";var _glClearStencil=x0=>GLctx.clearStencil(x0);Module["_glClearStencil"]=_glClearStencil;_glClearStencil.sig="vi";var _emscripten_glClearStencil=_glClearStencil;Module["_emscripten_glClearStencil"]=_emscripten_glClearStencil;_emscripten_glClearStencil.sig="vi";var _glColorMask=(red,green,blue,alpha)=>{GLctx.colorMask(!!red,!!green,!!blue,!!alpha)};Module["_glColorMask"]=_glColorMask;_glColorMask.sig="viiii";var _emscripten_glColorMask=_glColorMask;Module["_emscripten_glColorMask"]=_emscripten_glColorMask;_emscripten_glColorMask.sig="viiii";var _glCompileShader=shader=>{GLctx.compileShader(GL.shaders[shader])};Module["_glCompileShader"]=_glCompileShader;_glCompileShader.sig="vi";var _emscripten_glCompileShader=_glCompileShader;Module["_emscripten_glCompileShader"]=_emscripten_glCompileShader;_emscripten_glCompileShader.sig="vi";var _glCompressedTexImage2D=(target,level,internalFormat,width,height,border,imageSize,data)=>{GLctx.compressedTexImage2D(target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)};Module["_glCompressedTexImage2D"]=_glCompressedTexImage2D;_glCompressedTexImage2D.sig="viiiiiiip";var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;Module["_emscripten_glCompressedTexImage2D"]=_emscripten_glCompressedTexImage2D;_emscripten_glCompressedTexImage2D.sig="viiiiiiip";var _glCompressedTexSubImage2D=(target,level,xoffset,yoffset,width,height,format,imageSize,data)=>{GLctx.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)};Module["_glCompressedTexSubImage2D"]=_glCompressedTexSubImage2D;_glCompressedTexSubImage2D.sig="viiiiiiiip";var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;Module["_emscripten_glCompressedTexSubImage2D"]=_emscripten_glCompressedTexSubImage2D;_emscripten_glCompressedTexSubImage2D.sig="viiiiiiiip";var _glCopyTexImage2D=(x0,x1,x2,x3,x4,x5,x6,x7)=>GLctx.copyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7);Module["_glCopyTexImage2D"]=_glCopyTexImage2D;_glCopyTexImage2D.sig="viiiiiiii";var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;Module["_emscripten_glCopyTexImage2D"]=_emscripten_glCopyTexImage2D;_emscripten_glCopyTexImage2D.sig="viiiiiiii";var _glCopyTexSubImage2D=(x0,x1,x2,x3,x4,x5,x6,x7)=>GLctx.copyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7);Module["_glCopyTexSubImage2D"]=_glCopyTexSubImage2D;_glCopyTexSubImage2D.sig="viiiiiiii";var _emscripten_glCopyTexSubImage2D=_glCopyTexSubImage2D;Module["_emscripten_glCopyTexSubImage2D"]=_emscripten_glCopyTexSubImage2D;_emscripten_glCopyTexSubImage2D.sig="viiiiiiii";var _glCreateProgram=()=>{var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;program.maxUniformLength=program.maxAttributeLength=program.maxUniformBlockNameLength=0;program.uniformIdCounter=1;GL.programs[id]=program;return id};Module["_glCreateProgram"]=_glCreateProgram;_glCreateProgram.sig="i";var _emscripten_glCreateProgram=_glCreateProgram;Module["_emscripten_glCreateProgram"]=_emscripten_glCreateProgram;_emscripten_glCreateProgram.sig="i";var _glCreateShader=shaderType=>{var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id};Module["_glCreateShader"]=_glCreateShader;_glCreateShader.sig="ii";var _emscripten_glCreateShader=_glCreateShader;Module["_emscripten_glCreateShader"]=_emscripten_glCreateShader;_emscripten_glCreateShader.sig="ii";var _glCullFace=x0=>GLctx.cullFace(x0);Module["_glCullFace"]=_glCullFace;_glCullFace.sig="vi";var _emscripten_glCullFace=_glCullFace;Module["_emscripten_glCullFace"]=_emscripten_glCullFace;_emscripten_glCullFace.sig="vi";var _glDeleteBuffers=(n,buffers)=>{for(var i=0;i>2];var buffer=GL.buffers[id];if(!buffer)continue;GLctx.deleteBuffer(buffer);buffer.name=0;GL.buffers[id]=null}};Module["_glDeleteBuffers"]=_glDeleteBuffers;_glDeleteBuffers.sig="vip";var _emscripten_glDeleteBuffers=_glDeleteBuffers;Module["_emscripten_glDeleteBuffers"]=_emscripten_glDeleteBuffers;_emscripten_glDeleteBuffers.sig="vip";var _glDeleteFramebuffers=(n,framebuffers)=>{for(var i=0;i>2];var framebuffer=GL.framebuffers[id];if(!framebuffer)continue;GLctx.deleteFramebuffer(framebuffer);framebuffer.name=0;GL.framebuffers[id]=null}};Module["_glDeleteFramebuffers"]=_glDeleteFramebuffers;_glDeleteFramebuffers.sig="vip";var _emscripten_glDeleteFramebuffers=_glDeleteFramebuffers;Module["_emscripten_glDeleteFramebuffers"]=_emscripten_glDeleteFramebuffers;_emscripten_glDeleteFramebuffers.sig="vip";var _glDeleteProgram=id=>{if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null};Module["_glDeleteProgram"]=_glDeleteProgram;_glDeleteProgram.sig="vi";var _emscripten_glDeleteProgram=_glDeleteProgram;Module["_emscripten_glDeleteProgram"]=_emscripten_glDeleteProgram;_emscripten_glDeleteProgram.sig="vi";var _glDeleteQueriesEXT=(n,ids)=>{for(var i=0;i>2];var query=GL.queries[id];if(!query)continue;GLctx.disjointTimerQueryExt["deleteQueryEXT"](query);GL.queries[id]=null}};Module["_glDeleteQueriesEXT"]=_glDeleteQueriesEXT;_glDeleteQueriesEXT.sig="vip";var _emscripten_glDeleteQueriesEXT=_glDeleteQueriesEXT;Module["_emscripten_glDeleteQueriesEXT"]=_emscripten_glDeleteQueriesEXT;var _glDeleteRenderbuffers=(n,renderbuffers)=>{for(var i=0;i>2];var renderbuffer=GL.renderbuffers[id];if(!renderbuffer)continue;GLctx.deleteRenderbuffer(renderbuffer);renderbuffer.name=0;GL.renderbuffers[id]=null}};Module["_glDeleteRenderbuffers"]=_glDeleteRenderbuffers;_glDeleteRenderbuffers.sig="vip";var _emscripten_glDeleteRenderbuffers=_glDeleteRenderbuffers;Module["_emscripten_glDeleteRenderbuffers"]=_emscripten_glDeleteRenderbuffers;_emscripten_glDeleteRenderbuffers.sig="vip";var _glDeleteShader=id=>{if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null};Module["_glDeleteShader"]=_glDeleteShader;_glDeleteShader.sig="vi";var _emscripten_glDeleteShader=_glDeleteShader;Module["_emscripten_glDeleteShader"]=_emscripten_glDeleteShader;_emscripten_glDeleteShader.sig="vi";var _glDeleteTextures=(n,textures)=>{for(var i=0;i>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}};Module["_glDeleteTextures"]=_glDeleteTextures;_glDeleteTextures.sig="vip";var _emscripten_glDeleteTextures=_glDeleteTextures;Module["_emscripten_glDeleteTextures"]=_emscripten_glDeleteTextures;_emscripten_glDeleteTextures.sig="vip";var _glDeleteVertexArrays=(n,vaos)=>{for(var i=0;i>2];GLctx.deleteVertexArray(GL.vaos[id]);GL.vaos[id]=null}};Module["_glDeleteVertexArrays"]=_glDeleteVertexArrays;_glDeleteVertexArrays.sig="vip";var _glDeleteVertexArraysOES=_glDeleteVertexArrays;Module["_glDeleteVertexArraysOES"]=_glDeleteVertexArraysOES;_glDeleteVertexArraysOES.sig="vip";var _emscripten_glDeleteVertexArraysOES=_glDeleteVertexArraysOES;Module["_emscripten_glDeleteVertexArraysOES"]=_emscripten_glDeleteVertexArraysOES;_emscripten_glDeleteVertexArraysOES.sig="vip";var _glDepthFunc=x0=>GLctx.depthFunc(x0);Module["_glDepthFunc"]=_glDepthFunc;_glDepthFunc.sig="vi";var _emscripten_glDepthFunc=_glDepthFunc;Module["_emscripten_glDepthFunc"]=_emscripten_glDepthFunc;_emscripten_glDepthFunc.sig="vi";var _glDepthMask=flag=>{GLctx.depthMask(!!flag)};Module["_glDepthMask"]=_glDepthMask;_glDepthMask.sig="vi";var _emscripten_glDepthMask=_glDepthMask;Module["_emscripten_glDepthMask"]=_emscripten_glDepthMask;_emscripten_glDepthMask.sig="vi";var _glDepthRangef=(x0,x1)=>GLctx.depthRange(x0,x1);Module["_glDepthRangef"]=_glDepthRangef;_glDepthRangef.sig="vff";var _emscripten_glDepthRangef=_glDepthRangef;Module["_emscripten_glDepthRangef"]=_emscripten_glDepthRangef;_emscripten_glDepthRangef.sig="vff";var _glDetachShader=(program,shader)=>{GLctx.detachShader(GL.programs[program],GL.shaders[shader])};Module["_glDetachShader"]=_glDetachShader;_glDetachShader.sig="vii";var _emscripten_glDetachShader=_glDetachShader;Module["_emscripten_glDetachShader"]=_emscripten_glDetachShader;_emscripten_glDetachShader.sig="vii";var _glDisable=x0=>GLctx.disable(x0);Module["_glDisable"]=_glDisable;_glDisable.sig="vi";var _emscripten_glDisable=_glDisable;Module["_emscripten_glDisable"]=_emscripten_glDisable;_emscripten_glDisable.sig="vi";var _glDisableVertexAttribArray=index=>{GLctx.disableVertexAttribArray(index)};Module["_glDisableVertexAttribArray"]=_glDisableVertexAttribArray;_glDisableVertexAttribArray.sig="vi";var _emscripten_glDisableVertexAttribArray=_glDisableVertexAttribArray;Module["_emscripten_glDisableVertexAttribArray"]=_emscripten_glDisableVertexAttribArray;_emscripten_glDisableVertexAttribArray.sig="vi";var _glDrawArrays=(mode,first,count)=>{GLctx.drawArrays(mode,first,count)};Module["_glDrawArrays"]=_glDrawArrays;_glDrawArrays.sig="viii";var _emscripten_glDrawArrays=_glDrawArrays;Module["_emscripten_glDrawArrays"]=_emscripten_glDrawArrays;_emscripten_glDrawArrays.sig="viii";var _glDrawArraysInstanced=(mode,first,count,primcount)=>{GLctx.drawArraysInstanced(mode,first,count,primcount)};Module["_glDrawArraysInstanced"]=_glDrawArraysInstanced;_glDrawArraysInstanced.sig="viiii";var _glDrawArraysInstancedANGLE=_glDrawArraysInstanced;Module["_glDrawArraysInstancedANGLE"]=_glDrawArraysInstancedANGLE;var _emscripten_glDrawArraysInstancedANGLE=_glDrawArraysInstancedANGLE;Module["_emscripten_glDrawArraysInstancedANGLE"]=_emscripten_glDrawArraysInstancedANGLE;var tempFixedLengthArray=[];Module["tempFixedLengthArray"]=tempFixedLengthArray;var _glDrawBuffers=(n,bufs)=>{var bufArray=tempFixedLengthArray[n];for(var i=0;i>2]}GLctx.drawBuffers(bufArray)};Module["_glDrawBuffers"]=_glDrawBuffers;_glDrawBuffers.sig="vip";var _glDrawBuffersWEBGL=_glDrawBuffers;Module["_glDrawBuffersWEBGL"]=_glDrawBuffersWEBGL;var _emscripten_glDrawBuffersWEBGL=_glDrawBuffersWEBGL;Module["_emscripten_glDrawBuffersWEBGL"]=_emscripten_glDrawBuffersWEBGL;var _glDrawElements=(mode,count,type,indices)=>{GLctx.drawElements(mode,count,type,indices)};Module["_glDrawElements"]=_glDrawElements;_glDrawElements.sig="viiip";var _emscripten_glDrawElements=_glDrawElements;Module["_emscripten_glDrawElements"]=_emscripten_glDrawElements;_emscripten_glDrawElements.sig="viiip";var _glDrawElementsInstanced=(mode,count,type,indices,primcount)=>{GLctx.drawElementsInstanced(mode,count,type,indices,primcount)};Module["_glDrawElementsInstanced"]=_glDrawElementsInstanced;_glDrawElementsInstanced.sig="viiipi";var _glDrawElementsInstancedANGLE=_glDrawElementsInstanced;Module["_glDrawElementsInstancedANGLE"]=_glDrawElementsInstancedANGLE;var _emscripten_glDrawElementsInstancedANGLE=_glDrawElementsInstancedANGLE;Module["_emscripten_glDrawElementsInstancedANGLE"]=_emscripten_glDrawElementsInstancedANGLE;var _glEnable=x0=>GLctx.enable(x0);Module["_glEnable"]=_glEnable;_glEnable.sig="vi";var _emscripten_glEnable=_glEnable;Module["_emscripten_glEnable"]=_emscripten_glEnable;_emscripten_glEnable.sig="vi";var _glEnableVertexAttribArray=index=>{GLctx.enableVertexAttribArray(index)};Module["_glEnableVertexAttribArray"]=_glEnableVertexAttribArray;_glEnableVertexAttribArray.sig="vi";var _emscripten_glEnableVertexAttribArray=_glEnableVertexAttribArray;Module["_emscripten_glEnableVertexAttribArray"]=_emscripten_glEnableVertexAttribArray;_emscripten_glEnableVertexAttribArray.sig="vi";var _glEndQueryEXT=target=>{GLctx.disjointTimerQueryExt["endQueryEXT"](target)};Module["_glEndQueryEXT"]=_glEndQueryEXT;_glEndQueryEXT.sig="vi";var _emscripten_glEndQueryEXT=_glEndQueryEXT;Module["_emscripten_glEndQueryEXT"]=_emscripten_glEndQueryEXT;var _glFinish=()=>GLctx.finish();Module["_glFinish"]=_glFinish;_glFinish.sig="v";var _emscripten_glFinish=_glFinish;Module["_emscripten_glFinish"]=_emscripten_glFinish;_emscripten_glFinish.sig="v";var _glFlush=()=>GLctx.flush();Module["_glFlush"]=_glFlush;_glFlush.sig="v";var _emscripten_glFlush=_glFlush;Module["_emscripten_glFlush"]=_emscripten_glFlush;_emscripten_glFlush.sig="v";var _glFramebufferRenderbuffer=(target,attachment,renderbuffertarget,renderbuffer)=>{GLctx.framebufferRenderbuffer(target,attachment,renderbuffertarget,GL.renderbuffers[renderbuffer])};Module["_glFramebufferRenderbuffer"]=_glFramebufferRenderbuffer;_glFramebufferRenderbuffer.sig="viiii";var _emscripten_glFramebufferRenderbuffer=_glFramebufferRenderbuffer;Module["_emscripten_glFramebufferRenderbuffer"]=_emscripten_glFramebufferRenderbuffer;_emscripten_glFramebufferRenderbuffer.sig="viiii";var _glFramebufferTexture2D=(target,attachment,textarget,texture,level)=>{GLctx.framebufferTexture2D(target,attachment,textarget,GL.textures[texture],level)};Module["_glFramebufferTexture2D"]=_glFramebufferTexture2D;_glFramebufferTexture2D.sig="viiiii";var _emscripten_glFramebufferTexture2D=_glFramebufferTexture2D;Module["_emscripten_glFramebufferTexture2D"]=_emscripten_glFramebufferTexture2D;_emscripten_glFramebufferTexture2D.sig="viiiii";var _glFrontFace=x0=>GLctx.frontFace(x0);Module["_glFrontFace"]=_glFrontFace;_glFrontFace.sig="vi";var _emscripten_glFrontFace=_glFrontFace;Module["_emscripten_glFrontFace"]=_emscripten_glFrontFace;_emscripten_glFrontFace.sig="vi";var _glGenBuffers=(n,buffers)=>{GL.genObject(n,buffers,"createBuffer",GL.buffers)};Module["_glGenBuffers"]=_glGenBuffers;_glGenBuffers.sig="vip";var _emscripten_glGenBuffers=_glGenBuffers;Module["_emscripten_glGenBuffers"]=_emscripten_glGenBuffers;_emscripten_glGenBuffers.sig="vip";var _glGenFramebuffers=(n,ids)=>{GL.genObject(n,ids,"createFramebuffer",GL.framebuffers)};Module["_glGenFramebuffers"]=_glGenFramebuffers;_glGenFramebuffers.sig="vip";var _emscripten_glGenFramebuffers=_glGenFramebuffers;Module["_emscripten_glGenFramebuffers"]=_emscripten_glGenFramebuffers;_emscripten_glGenFramebuffers.sig="vip";var _glGenQueriesEXT=(n,ids)=>{for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.queries);query.name=id;GL.queries[id]=query;HEAP32[ids+i*4>>2]=id}};Module["_glGenQueriesEXT"]=_glGenQueriesEXT;_glGenQueriesEXT.sig="vip";var _emscripten_glGenQueriesEXT=_glGenQueriesEXT;Module["_emscripten_glGenQueriesEXT"]=_emscripten_glGenQueriesEXT;var _glGenRenderbuffers=(n,renderbuffers)=>{GL.genObject(n,renderbuffers,"createRenderbuffer",GL.renderbuffers)};Module["_glGenRenderbuffers"]=_glGenRenderbuffers;_glGenRenderbuffers.sig="vip";var _emscripten_glGenRenderbuffers=_glGenRenderbuffers;Module["_emscripten_glGenRenderbuffers"]=_emscripten_glGenRenderbuffers;_emscripten_glGenRenderbuffers.sig="vip";var _glGenTextures=(n,textures)=>{GL.genObject(n,textures,"createTexture",GL.textures)};Module["_glGenTextures"]=_glGenTextures;_glGenTextures.sig="vip";var _emscripten_glGenTextures=_glGenTextures;Module["_emscripten_glGenTextures"]=_emscripten_glGenTextures;_emscripten_glGenTextures.sig="vip";var _glGenVertexArrays=(n,arrays)=>{GL.genObject(n,arrays,"createVertexArray",GL.vaos)};Module["_glGenVertexArrays"]=_glGenVertexArrays;_glGenVertexArrays.sig="vip";var _glGenVertexArraysOES=_glGenVertexArrays;Module["_glGenVertexArraysOES"]=_glGenVertexArraysOES;_glGenVertexArraysOES.sig="vip";var _emscripten_glGenVertexArraysOES=_glGenVertexArraysOES;Module["_emscripten_glGenVertexArraysOES"]=_emscripten_glGenVertexArraysOES;_emscripten_glGenVertexArraysOES.sig="vip";var _glGenerateMipmap=x0=>GLctx.generateMipmap(x0);Module["_glGenerateMipmap"]=_glGenerateMipmap;_glGenerateMipmap.sig="vi";var _emscripten_glGenerateMipmap=_glGenerateMipmap;Module["_emscripten_glGenerateMipmap"]=_emscripten_glGenerateMipmap;_emscripten_glGenerateMipmap.sig="vi";var __glGetActiveAttribOrUniform=(funcName,program,index,bufSize,length,size,type,name)=>{program=GL.programs[program];var info=GLctx[funcName](program,index);if(info){var numBytesWrittenExclNull=name&&stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull;if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}};Module["__glGetActiveAttribOrUniform"]=__glGetActiveAttribOrUniform;var _glGetActiveAttrib=(program,index,bufSize,length,size,type,name)=>{__glGetActiveAttribOrUniform("getActiveAttrib",program,index,bufSize,length,size,type,name)};Module["_glGetActiveAttrib"]=_glGetActiveAttrib;_glGetActiveAttrib.sig="viiipppp";var _emscripten_glGetActiveAttrib=_glGetActiveAttrib;Module["_emscripten_glGetActiveAttrib"]=_emscripten_glGetActiveAttrib;_emscripten_glGetActiveAttrib.sig="viiipppp";var _glGetActiveUniform=(program,index,bufSize,length,size,type,name)=>{__glGetActiveAttribOrUniform("getActiveUniform",program,index,bufSize,length,size,type,name)};Module["_glGetActiveUniform"]=_glGetActiveUniform;_glGetActiveUniform.sig="viiipppp";var _emscripten_glGetActiveUniform=_glGetActiveUniform;Module["_emscripten_glGetActiveUniform"]=_emscripten_glGetActiveUniform;_emscripten_glGetActiveUniform.sig="viiipppp";var _glGetAttachedShaders=(program,maxCount,count,shaders)=>{var result=GLctx.getAttachedShaders(GL.programs[program]);var len=result.length;if(len>maxCount){len=maxCount}HEAP32[count>>2]=len;for(var i=0;i>2]=id}};Module["_glGetAttachedShaders"]=_glGetAttachedShaders;_glGetAttachedShaders.sig="viipp";var _emscripten_glGetAttachedShaders=_glGetAttachedShaders;Module["_emscripten_glGetAttachedShaders"]=_emscripten_glGetAttachedShaders;_emscripten_glGetAttachedShaders.sig="viipp";var _glGetAttribLocation=(program,name)=>GLctx.getAttribLocation(GL.programs[program],UTF8ToString(name));Module["_glGetAttribLocation"]=_glGetAttribLocation;_glGetAttribLocation.sig="iip";var _emscripten_glGetAttribLocation=_glGetAttribLocation;Module["_emscripten_glGetAttribLocation"]=_emscripten_glGetAttribLocation;_emscripten_glGetAttribLocation.sig="iip";var writeI53ToI64=(ptr,num)=>{HEAPU32[ptr>>2]=num;var lower=HEAPU32[ptr>>2];HEAPU32[ptr+4>>2]=(num-lower)/4294967296};Module["writeI53ToI64"]=writeI53ToI64;var emscriptenWebGLGet=(name_,p,type)=>{if(!p){GL.recordError(1281);return}var ret=undefined;switch(name_){case 36346:ret=1;break;case 36344:if(type!=0&&type!=1){GL.recordError(1280)}return;case 36345:ret=0;break;case 34466:var formats=GLctx.getParameter(34467);ret=formats?formats.length:0;break}if(ret===undefined){var result=GLctx.getParameter(name_);switch(typeof result){case"number":ret=result;break;case"boolean":ret=result?1:0;break;case"string":GL.recordError(1280);return;case"object":if(result===null){switch(name_){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:{ret=0;break}default:{GL.recordError(1280);return}}}else if(result instanceof Float32Array||result instanceof Uint32Array||result instanceof Int32Array||result instanceof Array){for(var i=0;i>2]=result[i];break;case 2:HEAPF32[p+i*4>>2]=result[i];break;case 4:HEAP8[p+i]=result[i]?1:0;break}}return}else{try{ret=result.name|0}catch(e){GL.recordError(1280);err(`GL_INVALID_ENUM in glGet${type}v: Unknown object returned from WebGL getParameter(${name_})! (error: ${e})`);return}}break;default:GL.recordError(1280);err(`GL_INVALID_ENUM in glGet${type}v: Native code calling glGet${type}v(${name_}) and it returns ${result} of type ${typeof result}!`);return}}switch(type){case 1:writeI53ToI64(p,ret);break;case 0:HEAP32[p>>2]=ret;break;case 2:HEAPF32[p>>2]=ret;break;case 4:HEAP8[p]=ret?1:0;break}};Module["emscriptenWebGLGet"]=emscriptenWebGLGet;var _glGetBooleanv=(name_,p)=>emscriptenWebGLGet(name_,p,4);Module["_glGetBooleanv"]=_glGetBooleanv;_glGetBooleanv.sig="vip";var _emscripten_glGetBooleanv=_glGetBooleanv;Module["_emscripten_glGetBooleanv"]=_emscripten_glGetBooleanv;_emscripten_glGetBooleanv.sig="vip";var _glGetBufferParameteriv=(target,value,data)=>{if(!data){GL.recordError(1281);return}HEAP32[data>>2]=GLctx.getBufferParameter(target,value)};Module["_glGetBufferParameteriv"]=_glGetBufferParameteriv;_glGetBufferParameteriv.sig="viip";var _emscripten_glGetBufferParameteriv=_glGetBufferParameteriv;Module["_emscripten_glGetBufferParameteriv"]=_emscripten_glGetBufferParameteriv;_emscripten_glGetBufferParameteriv.sig="viip";var _glGetError=()=>{var error=GLctx.getError()||GL.lastError;GL.lastError=0;return error};Module["_glGetError"]=_glGetError;_glGetError.sig="i";var _emscripten_glGetError=_glGetError;Module["_emscripten_glGetError"]=_emscripten_glGetError;_emscripten_glGetError.sig="i";var _glGetFloatv=(name_,p)=>emscriptenWebGLGet(name_,p,2);Module["_glGetFloatv"]=_glGetFloatv;_glGetFloatv.sig="vip";var _emscripten_glGetFloatv=_glGetFloatv;Module["_emscripten_glGetFloatv"]=_emscripten_glGetFloatv;_emscripten_glGetFloatv.sig="vip";var _glGetFramebufferAttachmentParameteriv=(target,attachment,pname,params)=>{var result=GLctx.getFramebufferAttachmentParameter(target,attachment,pname);if(result instanceof WebGLRenderbuffer||result instanceof WebGLTexture){result=result.name|0}HEAP32[params>>2]=result};Module["_glGetFramebufferAttachmentParameteriv"]=_glGetFramebufferAttachmentParameteriv;_glGetFramebufferAttachmentParameteriv.sig="viiip";var _emscripten_glGetFramebufferAttachmentParameteriv=_glGetFramebufferAttachmentParameteriv;Module["_emscripten_glGetFramebufferAttachmentParameteriv"]=_emscripten_glGetFramebufferAttachmentParameteriv;_emscripten_glGetFramebufferAttachmentParameteriv.sig="viiip";var _glGetIntegerv=(name_,p)=>emscriptenWebGLGet(name_,p,0);Module["_glGetIntegerv"]=_glGetIntegerv;_glGetIntegerv.sig="vip";var _emscripten_glGetIntegerv=_glGetIntegerv;Module["_emscripten_glGetIntegerv"]=_emscripten_glGetIntegerv;_emscripten_glGetIntegerv.sig="vip";var _glGetProgramInfoLog=(program,maxLength,length,infoLog)=>{var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};Module["_glGetProgramInfoLog"]=_glGetProgramInfoLog;_glGetProgramInfoLog.sig="viipp";var _emscripten_glGetProgramInfoLog=_glGetProgramInfoLog;Module["_emscripten_glGetProgramInfoLog"]=_emscripten_glGetProgramInfoLog;_emscripten_glGetProgramInfoLog.sig="viipp";var _glGetProgramiv=(program,pname,p)=>{if(!p){GL.recordError(1281);return}if(program>=GL.counter){GL.recordError(1281);return}program=GL.programs[program];if(pname==35716){var log=GLctx.getProgramInfoLog(program);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35719){if(!program.maxUniformLength){for(var i=0;i>2]=program.maxUniformLength}else if(pname==35722){if(!program.maxAttributeLength){for(var i=0;i>2]=program.maxAttributeLength}else if(pname==35381){if(!program.maxUniformBlockNameLength){for(var i=0;i>2]=program.maxUniformBlockNameLength}else{HEAP32[p>>2]=GLctx.getProgramParameter(program,pname)}};Module["_glGetProgramiv"]=_glGetProgramiv;_glGetProgramiv.sig="viip";var _emscripten_glGetProgramiv=_glGetProgramiv;Module["_emscripten_glGetProgramiv"]=_emscripten_glGetProgramiv;_emscripten_glGetProgramiv.sig="viip";var _glGetQueryObjecti64vEXT=(id,pname,params)=>{if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param;{param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname)}var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}writeI53ToI64(params,ret)};Module["_glGetQueryObjecti64vEXT"]=_glGetQueryObjecti64vEXT;_glGetQueryObjecti64vEXT.sig="viip";var _emscripten_glGetQueryObjecti64vEXT=_glGetQueryObjecti64vEXT;Module["_emscripten_glGetQueryObjecti64vEXT"]=_emscripten_glGetQueryObjecti64vEXT;var _glGetQueryObjectivEXT=(id,pname,params)=>{if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}HEAP32[params>>2]=ret};Module["_glGetQueryObjectivEXT"]=_glGetQueryObjectivEXT;_glGetQueryObjectivEXT.sig="viip";var _emscripten_glGetQueryObjectivEXT=_glGetQueryObjectivEXT;Module["_emscripten_glGetQueryObjectivEXT"]=_emscripten_glGetQueryObjectivEXT;var _glGetQueryObjectui64vEXT=_glGetQueryObjecti64vEXT;Module["_glGetQueryObjectui64vEXT"]=_glGetQueryObjectui64vEXT;var _emscripten_glGetQueryObjectui64vEXT=_glGetQueryObjectui64vEXT;Module["_emscripten_glGetQueryObjectui64vEXT"]=_emscripten_glGetQueryObjectui64vEXT;var _glGetQueryObjectuivEXT=_glGetQueryObjectivEXT;Module["_glGetQueryObjectuivEXT"]=_glGetQueryObjectuivEXT;var _emscripten_glGetQueryObjectuivEXT=_glGetQueryObjectuivEXT;Module["_emscripten_glGetQueryObjectuivEXT"]=_emscripten_glGetQueryObjectuivEXT;var _glGetQueryivEXT=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.disjointTimerQueryExt["getQueryEXT"](target,pname)};Module["_glGetQueryivEXT"]=_glGetQueryivEXT;_glGetQueryivEXT.sig="viip";var _emscripten_glGetQueryivEXT=_glGetQueryivEXT;Module["_emscripten_glGetQueryivEXT"]=_emscripten_glGetQueryivEXT;var _glGetRenderbufferParameteriv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getRenderbufferParameter(target,pname)};Module["_glGetRenderbufferParameteriv"]=_glGetRenderbufferParameteriv;_glGetRenderbufferParameteriv.sig="viip";var _emscripten_glGetRenderbufferParameteriv=_glGetRenderbufferParameteriv;Module["_emscripten_glGetRenderbufferParameteriv"]=_emscripten_glGetRenderbufferParameteriv;_emscripten_glGetRenderbufferParameteriv.sig="viip";var _glGetShaderInfoLog=(shader,maxLength,length,infoLog)=>{var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};Module["_glGetShaderInfoLog"]=_glGetShaderInfoLog;_glGetShaderInfoLog.sig="viipp";var _emscripten_glGetShaderInfoLog=_glGetShaderInfoLog;Module["_emscripten_glGetShaderInfoLog"]=_emscripten_glGetShaderInfoLog;_emscripten_glGetShaderInfoLog.sig="viipp";var _glGetShaderPrecisionFormat=(shaderType,precisionType,range,precision)=>{var result=GLctx.getShaderPrecisionFormat(shaderType,precisionType);HEAP32[range>>2]=result.rangeMin;HEAP32[range+4>>2]=result.rangeMax;HEAP32[precision>>2]=result.precision};Module["_glGetShaderPrecisionFormat"]=_glGetShaderPrecisionFormat;_glGetShaderPrecisionFormat.sig="viipp";var _emscripten_glGetShaderPrecisionFormat=_glGetShaderPrecisionFormat;Module["_emscripten_glGetShaderPrecisionFormat"]=_emscripten_glGetShaderPrecisionFormat;_emscripten_glGetShaderPrecisionFormat.sig="viipp";var _glGetShaderSource=(shader,bufSize,length,source)=>{var result=GLctx.getShaderSource(GL.shaders[shader]);if(!result)return;var numBytesWrittenExclNull=bufSize>0&&source?stringToUTF8(result,source,bufSize):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};Module["_glGetShaderSource"]=_glGetShaderSource;_glGetShaderSource.sig="viipp";var _emscripten_glGetShaderSource=_glGetShaderSource;Module["_emscripten_glGetShaderSource"]=_emscripten_glGetShaderSource;_emscripten_glGetShaderSource.sig="viipp";var _glGetShaderiv=(shader,pname,p)=>{if(!p){GL.recordError(1281);return}if(pname==35716){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var logLength=log?log.length+1:0;HEAP32[p>>2]=logLength}else if(pname==35720){var source=GLctx.getShaderSource(GL.shaders[shader]);var sourceLength=source?source.length+1:0;HEAP32[p>>2]=sourceLength}else{HEAP32[p>>2]=GLctx.getShaderParameter(GL.shaders[shader],pname)}};Module["_glGetShaderiv"]=_glGetShaderiv;_glGetShaderiv.sig="viip";var _emscripten_glGetShaderiv=_glGetShaderiv;Module["_emscripten_glGetShaderiv"]=_emscripten_glGetShaderiv;_emscripten_glGetShaderiv.sig="viip";var stringToNewUTF8=str=>{var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8(str,ret,size);return ret};Module["stringToNewUTF8"]=stringToNewUTF8;var webglGetExtensions=function $webglGetExtensions(){var exts=getEmscriptenSupportedExtensions(GLctx);exts=exts.concat(exts.map(e=>"GL_"+e));return exts};Module["webglGetExtensions"]=webglGetExtensions;var _glGetString=name_=>{var ret=GL.stringCache[name_];if(!ret){switch(name_){case 7939:ret=stringToNewUTF8(webglGetExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var s=GLctx.getParameter(name_);if(!s){GL.recordError(1280)}ret=s?stringToNewUTF8(s):0;break;case 7938:var glVersion=GLctx.getParameter(7938);{glVersion=`OpenGL ES 2.0 (${glVersion})`}ret=stringToNewUTF8(glVersion);break;case 35724:var glslVersion=GLctx.getParameter(35724);var ver_re=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;var ver_num=glslVersion.match(ver_re);if(ver_num!==null){if(ver_num[1].length==3)ver_num[1]=ver_num[1]+"0";glslVersion=`OpenGL ES GLSL ES ${ver_num[1]} (${glslVersion})`}ret=stringToNewUTF8(glslVersion);break;default:GL.recordError(1280)}GL.stringCache[name_]=ret}return ret};Module["_glGetString"]=_glGetString;_glGetString.sig="pi";var _emscripten_glGetString=_glGetString;Module["_emscripten_glGetString"]=_emscripten_glGetString;_emscripten_glGetString.sig="pi";var _glGetTexParameterfv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAPF32[params>>2]=GLctx.getTexParameter(target,pname)};Module["_glGetTexParameterfv"]=_glGetTexParameterfv;_glGetTexParameterfv.sig="viip";var _emscripten_glGetTexParameterfv=_glGetTexParameterfv;Module["_emscripten_glGetTexParameterfv"]=_emscripten_glGetTexParameterfv;_emscripten_glGetTexParameterfv.sig="viip";var _glGetTexParameteriv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getTexParameter(target,pname)};Module["_glGetTexParameteriv"]=_glGetTexParameteriv;_glGetTexParameteriv.sig="viip";var _emscripten_glGetTexParameteriv=_glGetTexParameteriv;Module["_emscripten_glGetTexParameteriv"]=_emscripten_glGetTexParameteriv;_emscripten_glGetTexParameteriv.sig="viip";var webglGetLeftBracePos=name=>name.slice(-1)=="]"&&name.lastIndexOf("[");Module["webglGetLeftBracePos"]=webglGetLeftBracePos;var webglPrepareUniformLocationsBeforeFirstUse=program=>{var uniformLocsById=program.uniformLocsById,uniformSizeAndIdsByName=program.uniformSizeAndIdsByName,i,j;if(!uniformLocsById){program.uniformLocsById=uniformLocsById={};program.uniformArrayNamesById={};for(i=0;i