var createMediapipeSolutionsWasm=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r){var t,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise((function(e,r){t=e,n=r})),["_main","_fflush","___getTypeName","__embind_initialize_bindings","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(o.ready,e)||Object.defineProperty(o.ready,e,{get:()=>de("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>de("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var a=Object.assign({},o),i=[],s="./this.program",u=(e,r)=>{throw r},c="object"==typeof window,l="function"==typeof importScripts,d="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,f=!c&&!d&&!l;if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var m,p,g,v="";function h(e){if(e instanceof Ce)return;let r=e;e&&"object"==typeof e&&e.stack&&(r=[e,e.stack]),E("exiting due to exception: "+r)}if(d){if("undefined"==typeof process||!process.release||"node"!==process.release.name)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var y=require("fs"),b=require("path");v=l?b.dirname(v)+"/":__dirname+"/",m=(e,r)=>(e=ye(e)?new URL(e):b.normalize(e),y.readFileSync(e,r?void 0:"utf8")),g=e=>{var r=m(e,!0);return r.buffer||(r=new Uint8Array(r)),A(r.buffer),r},p=(e,r,t)=>{e=ye(e)?new URL(e):b.normalize(e),y.readFile(e,(function(e,n){e?t(e):r(n.buffer)}))},process.argv.length>1&&(s=process.argv[1].replace(/\\/g,"/")),i=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Ce))throw e})),process.on("unhandledRejection",(function(e){throw e})),u=(e,r)=>{if(ne())throw process.exitCode=e,r;h(r),process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}}else if(f){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(m=function(e){return read(e)}),g=function(e){let r;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(r=read(e,"binary"),A("object"==typeof r),r)},p=function(e,r,t){setTimeout((()=>r(g(e))),0)},"undefined"!=typeof scriptArgs?i=scriptArgs:void 0!==arguments&&(i=arguments),"function"==typeof quit&&(u=(e,r)=>{h(r),quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!c&&!l)throw new Error("environment detection error");if(l?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),e&&(v=e),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");m=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},l&&(g=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),p=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)},e=>document.title=e}var w,_=o.print||console.log.bind(console),E=o.printErr||console.warn.bind(console);Object.assign(o,a),a=null,w="fetchSettings",Object.getOwnPropertyDescriptor(o,w)&&de("`Module."+w+"` was supplied but `"+w+"` not included in INCOMING_MODULE_JS_API"),o.arguments&&(i=o.arguments),T("arguments","arguments_"),o.thisProgram&&(s=o.thisProgram),T("thisProgram","thisProgram"),o.quit&&(u=o.quit),T("quit","quit_"),A(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),A(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),A(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),A(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),A(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),A(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),A(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),A(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),A(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),T("read","read_"),T("readAsync","readAsync"),T("readBinary","readBinary"),T("setWindowTitle","setWindowTitle"),A(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var x,C=4;function T(e,r){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get:function(){de("Module."+e+" has been replaced with plain "+r+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function S(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}o.wasmBinary&&(x=o.wasmBinary),T("wasmBinary","wasmBinary");var P,k=o.noExitRuntime||!0;T("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&de("no native wasm support detected");var F,L=!1;function A(e,r){e||de("Assertion failed"+(r?": "+r:""))}var D,B,M,O,R,I,N,j,U,V="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&V)return V.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function z(e,r){return e?$(M,e,r):""}function G(e,r,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;s>1114111&&Ve("Invalid Unicode code point "+Ge(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function W(e,r,t){return A("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),G(e,M,r,t)}function H(e){for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r}function q(e){D=e,o.HEAP8=B=new Int8Array(e),o.HEAP16=O=new Int16Array(e),o.HEAP32=I=new Int32Array(e),o.HEAPU8=M=new Uint8Array(e),o.HEAPU16=R=new Uint16Array(e),o.HEAPU32=N=new Uint32Array(e),o.HEAPF32=j=new Float32Array(e),o.HEAPF64=U=new Float64Array(e)}var Y=65536;o.STACK_SIZE&&A(Y===o.STACK_SIZE,"the stack size can no longer be determined at runtime");var X,Q=o.INITIAL_MEMORY||16777216;function K(){if(!L){var e=Fn();0==e&&(e+=4);var r=N[e>>2],t=N[e+4>>2];34821223==r&&2310721022==t||de("Stack overflow! Stack cookie has been overwritten at "+Ge(e)+", expected hex dwords 0x89BACDFE and 0x2135467, but received "+Ge(t)+" "+Ge(r)),1668509029!==N[0]&&de("Runtime error: The application has corrupted its heap memory area (address zero)!")}}T("INITIAL_MEMORY","INITIAL_MEMORY"),A(Q>=Y,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+Q+"! (STACK_SIZE="+Y+")"),A("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),A(!o.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),A(16777216==Q,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var J=[],Z=[],ee=[],re=[],te=!1;function ne(){return k}A(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var oe=0,ae=null,ie=null,se={};function ue(e){for(var r=e;;){if(!se[e])return e;e=r+Math.random()}}function ce(e){oe++,o.monitorRunDependencies&&o.monitorRunDependencies(oe),e?(A(!se[e]),se[e]=1,null===ae&&"undefined"!=typeof setInterval&&(ae=setInterval((function(){if(L)return clearInterval(ae),void(ae=null);var e=!1;for(var r in se)e||(e=!0,E("still waiting on run dependencies:")),E("dependency: "+r);e&&E("(end of list)")}),1e4))):E("warning: run dependency added without ID")}function le(e){if(oe--,o.monitorRunDependencies&&o.monitorRunDependencies(oe),e?(A(se[e]),delete se[e]):E("warning: run dependency removed without ID"),0==oe&&(null!==ae&&(clearInterval(ae),ae=null),ie)){var r=ie;ie=null,r()}}function de(e){o.onAbort&&o.onAbort(e),E(e="Aborted("+e+")"),L=!0,F=1;var r=new WebAssembly.RuntimeError(e);throw n(r),r}var fe,me,pe,ge,ve="data:application/octet-stream;base64,";function he(e){return e.startsWith(ve)}function ye(e){return e.startsWith("file://")}function be(e,r){return function(){var t=e,n=r;return r||(n=o.asm),A(te,"native function `"+t+"` called before runtime initialization"),n[e]||A(n[e],"exported native function `"+t+"` not found"),n[e].apply(null,arguments)}}function we(e){try{if(e==fe&&x)return new Uint8Array(x);if(g)return g(e);throw"both async and sync fetching of the wasm failed"}catch(e){de(e)}}he(fe="selfie_segmentation_solution_wasm_bin.wasm")||(me=fe,fe=o.locateFile?o.locateFile(me,v):v+me);var _e,Ee={512868:e=>{const r=or.toValue(e).getContext("webgpu");return Yt.add(r.getCurrentTexture())},513003:(e,r,t,n,o)=>{const a=or.toValue(e),i=Yt.get(r),s=Yt.get(t),u=n,c=o;i.queue.copyExternalImageToTexture({source:a},{texture:s},[u,c])},513254:(e,r,t,n)=>{const o=or.toValue(e),a=Yt.get(r),i=Yt.get(t),s=Yt.get(n),u=a.createBindGroup({layout:s,entries:[{binding:0,resource:i},{binding:1,resource:o}]});return Yt.add(u)},513602:(e,r)=>{const t=or.toValue(e),n=or.toValue(r),o=n.getContext("2d"),a=new ImageData(t,n.width,n.height);o.putImageData(a,0,0)},513826:(e,r)=>{const t=or.toValue(e),n=or.toValue(r),o=t.getContext("2d").getImageData(0,0,t.width,t.height);n.set(o.data)},514030:(e,r)=>{const t=or.toValue(e);or.toValue(r).getContext("2d").drawImage(t,0,0)},514166:()=>!!o.preinitializedWebGPUDevice,514217:()=>{let e=!0;if(e){const r=Gt;if("function"!=typeof r)return void("undefined"!=typeof console&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.'));Gt=function(e){if(0==e){if(o&&o.canvas)return o.canvas;if(o&&o.canvasCssSelector)return r(o.canvasCssSelector);"undefined"!=typeof console&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return r(e)},e=!1}},515002:()=>"undefined"!=typeof wasmOffsetConverter};function xe(e,r){if($e.mainLoop.timingMode=e,$e.mainLoop.timingValue=r,!$e.mainLoop.func)return E("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if($e.mainLoop.running||($e.mainLoop.running=!0),0==e)$e.mainLoop.scheduler=function(){var e=0|Math.max(0,$e.mainLoop.tickStartTime+r-_e());setTimeout($e.mainLoop.runner,e)},$e.mainLoop.method="timeout";else if(1==e)$e.mainLoop.scheduler=function(){$e.requestAnimationFrame($e.mainLoop.runner)},$e.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var t=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),t.shift()())}),!0),setImmediate=function(e){t.push(e),l?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}$e.mainLoop.scheduler=function(){setImmediate($e.mainLoop.runner)},$e.mainLoop.method="immediate"}return 0}function Ce(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}_e=d?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var Te={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Te.isAbs(e),t="/"===e.substr(-1);return(e=Te.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Te.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Te.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Te.normalize(e.join("/"))},join2:(e,r)=>Te.normalize(e+"/"+r)};function Se(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(d)try{var r=require("crypto");return()=>r.randomBytes(1)[0]}catch(e){}return()=>de("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}var Pe={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:Oe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Te.isAbs(n)}return(r?"/":"")+(e=Te.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=Pe.resolve(e).substr(1),r=Pe.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s0?t:H(e)+1,o=new Array(n),a=G(e,o,0,o.length);return r&&(o.length=a),o}var Fe={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){Fe.ttys[e]={input:[],output:[],ops:r},Oe.registerDevice(e,Fe.stream_ops)},stream_ops:{open:function(e){var r=Fe.ttys[e.node.rdev];if(!r)throw new Oe.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Oe.ErrnoError(60);for(var a=0,i=0;i0?t.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(r=window.prompt("Input: "))&&(r+="\n"):"function"==typeof readline&&null!==(r=readline())&&(r+="\n");if(!r)return null;e.input=ke(r,!0)}return e.input.shift()},put_char:function(e,r){null===r||10===r?(_($(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(_($(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(E($(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(E($(e.output,0)),e.output=[])}}};function Le(e){e=function(e,r){return A(r,"alignment argument is required"),Math.ceil(e/r)*r}(e,65536);var r=Pn(65536,e);return r?function(e,r){return M.fill(0,e,e+r),e}(r,e):0}var Ae={ops_table:null,mount:function(e){return Ae.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(Oe.isBlkdev(t)||Oe.isFIFO(t))throw new Oe.ErrnoError(63);Ae.ops_table||(Ae.ops_table={dir:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr,lookup:Ae.node_ops.lookup,mknod:Ae.node_ops.mknod,rename:Ae.node_ops.rename,unlink:Ae.node_ops.unlink,rmdir:Ae.node_ops.rmdir,readdir:Ae.node_ops.readdir,symlink:Ae.node_ops.symlink},stream:{llseek:Ae.stream_ops.llseek}},file:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr},stream:{llseek:Ae.stream_ops.llseek,read:Ae.stream_ops.read,write:Ae.stream_ops.write,allocate:Ae.stream_ops.allocate,mmap:Ae.stream_ops.mmap,msync:Ae.stream_ops.msync}},link:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr,readlink:Ae.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr},stream:Oe.chrdev_stream_ops}});var o=Oe.createNode(e,r,t,n);return Oe.isDir(o.mode)?(o.node_ops=Ae.ops_table.dir.node,o.stream_ops=Ae.ops_table.dir.stream,o.contents={}):Oe.isFile(o.mode)?(o.node_ops=Ae.ops_table.file.node,o.stream_ops=Ae.ops_table.file.stream,o.usedBytes=0,o.contents=null):Oe.isLink(o.mode)?(o.node_ops=Ae.ops_table.link.node,o.stream_ops=Ae.ops_table.link.stream):Oe.isChrdev(o.mode)&&(o.node_ops=Ae.ops_table.chrdev.node,o.stream_ops=Ae.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr:function(e){var r={};return r.dev=Oe.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,Oe.isDir(e.mode)?r.size=4096:Oe.isFile(e.mode)?r.size=e.usedBytes:Oe.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&Ae.resizeFileStorage(e,r.size)},lookup:function(e,r){throw Oe.genericErrors[44]},mknod:function(e,r,t,n){return Ae.createNode(e,r,t,n)},rename:function(e,r,t){if(Oe.isDir(e.mode)){var n;try{n=Oe.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new Oe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=Oe.lookupNode(e,r);for(var n in t.contents)throw new Oe.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=Ae.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!Oe.isLink(e.mode))throw new Oe.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(A(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{if(!(e=Pe.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new Oe.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=Oe.root,o="/",a=0;a40)throw new Oe.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var r;;){if(Oe.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?t+"/"+r:t+r:t}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:(e,r)=>{for(var t=0,n=0;n>>0)%Oe.nameTable.length},hashAddNode:e=>{var r=Oe.hashName(e.parent.id,e.name);e.name_next=Oe.nameTable[r],Oe.nameTable[r]=e},hashRemoveNode:e=>{var r=Oe.hashName(e.parent.id,e.name);if(Oe.nameTable[r]===e)Oe.nameTable[r]=e.name_next;else for(var t=Oe.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,r)=>{var t=Oe.mayLookup(e);if(t)throw new Oe.ErrnoError(t,e);for(var n=Oe.hashName(e.id,r),o=Oe.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return Oe.lookup(e,r)},createNode:(e,r,t,n)=>{A("object"==typeof e);var o=new Oe.FSNode(e,r,t,n);return Oe.hashAddNode(o),o},destroyNode:e=>{Oe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var r=Oe.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:e=>{var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>Oe.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var r=Oe.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:(e,r)=>{try{Oe.lookupNode(e,r);return 20}catch(e){}return Oe.nodePermissions(e,"wx")},mayDelete:(e,r,t)=>{var n;try{n=Oe.lookupNode(e,r)}catch(e){return e.errno}var o=Oe.nodePermissions(e,"wx");if(o)return o;if(t){if(!Oe.isDir(n.mode))return 54;if(Oe.isRoot(n)||Oe.getPath(n)===Oe.cwd())return 10}else if(Oe.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?Oe.isLink(e.mode)?32:Oe.isDir(e.mode)&&("r"!==Oe.flagsToPermissionString(r)||512&r)?31:Oe.nodePermissions(e,Oe.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,r=Oe.MAX_OPEN_FDS)=>{for(var t=e;t<=r;t++)if(!Oe.streams[t])return t;throw new Oe.ErrnoError(33)},getStream:e=>Oe.streams[e],createStream:(e,r,t)=>{Oe.FSStream||(Oe.FSStream=function(){this.shared={}},Oe.FSStream.prototype={},Object.defineProperties(Oe.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new Oe.FSStream,e);var n=Oe.nextfd(r,t);return e.fd=n,Oe.streams[n]=e,e},closeStream:e=>{Oe.streams[e]=null},chrdev_stream_ops:{open:e=>{var r=Oe.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Oe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice:(e,r)=>{Oe.devices[e]={stream_ops:r}},getDevice:e=>Oe.devices[e],getMounts:e=>{for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:(e,r)=>{"function"==typeof e&&(r=e,e=!1),Oe.syncFSRequests++,Oe.syncFSRequests>1&&E("warning: "+Oe.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Oe.getMounts(Oe.root.mount),n=0;function o(e){return A(Oe.syncFSRequests>0),Oe.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount:(e,r,t)=>{if("string"==typeof e)throw e;var n,o="/"===t,a=!t;if(o&&Oe.root)throw new Oe.ErrnoError(10);if(!o&&!a){var i=Oe.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,Oe.isMountpoint(n))throw new Oe.ErrnoError(10);if(!Oe.isDir(n.mode))throw new Oe.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Oe.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var r=Oe.lookupPath(e,{follow_mount:!1});if(!Oe.isMountpoint(r.node))throw new Oe.ErrnoError(28);var t=r.node,n=t.mounted,o=Oe.getMounts(n);Object.keys(Oe.nameTable).forEach((e=>{for(var r=Oe.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&Oe.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);A(-1!==a),t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod:(e,r,t)=>{var n=Oe.lookupPath(e,{parent:!0}).node,o=Te.basename(e);if(!o||"."===o||".."===o)throw new Oe.ErrnoError(28);var a=Oe.mayCreate(n,o);if(a)throw new Oe.ErrnoError(a);if(!n.node_ops.mknod)throw new Oe.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,Oe.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,Oe.mknod(e,r,0)),mkdirTree:(e,r)=>{for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,Oe.mknod(e,r,t)),symlink:(e,r)=>{if(!Pe.resolve(e))throw new Oe.ErrnoError(44);var t=Oe.lookupPath(r,{parent:!0}).node;if(!t)throw new Oe.ErrnoError(44);var n=Te.basename(r),o=Oe.mayCreate(t,n);if(o)throw new Oe.ErrnoError(o);if(!t.node_ops.symlink)throw new Oe.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:(e,r)=>{var t,n,o=Te.dirname(e),a=Te.dirname(r),i=Te.basename(e),s=Te.basename(r);if(t=Oe.lookupPath(e,{parent:!0}).node,n=Oe.lookupPath(r,{parent:!0}).node,!t||!n)throw new Oe.ErrnoError(44);if(t.mount!==n.mount)throw new Oe.ErrnoError(75);var u,c=Oe.lookupNode(t,i),l=Pe.relative(e,a);if("."!==l.charAt(0))throw new Oe.ErrnoError(28);if("."!==(l=Pe.relative(r,o)).charAt(0))throw new Oe.ErrnoError(55);try{u=Oe.lookupNode(n,s)}catch(e){}if(c!==u){var d=Oe.isDir(c.mode),f=Oe.mayDelete(t,i,d);if(f)throw new Oe.ErrnoError(f);if(f=u?Oe.mayDelete(n,s,d):Oe.mayCreate(n,s))throw new Oe.ErrnoError(f);if(!t.node_ops.rename)throw new Oe.ErrnoError(63);if(Oe.isMountpoint(c)||u&&Oe.isMountpoint(u))throw new Oe.ErrnoError(10);if(n!==t&&(f=Oe.nodePermissions(t,"w")))throw new Oe.ErrnoError(f);Oe.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{Oe.hashAddNode(c)}}},rmdir:e=>{var r=Oe.lookupPath(e,{parent:!0}).node,t=Te.basename(e),n=Oe.lookupNode(r,t),o=Oe.mayDelete(r,t,!0);if(o)throw new Oe.ErrnoError(o);if(!r.node_ops.rmdir)throw new Oe.ErrnoError(63);if(Oe.isMountpoint(n))throw new Oe.ErrnoError(10);r.node_ops.rmdir(r,t),Oe.destroyNode(n)},readdir:e=>{var r=Oe.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new Oe.ErrnoError(54);return r.node_ops.readdir(r)},unlink:e=>{var r=Oe.lookupPath(e,{parent:!0}).node;if(!r)throw new Oe.ErrnoError(44);var t=Te.basename(e),n=Oe.lookupNode(r,t),o=Oe.mayDelete(r,t,!1);if(o)throw new Oe.ErrnoError(o);if(!r.node_ops.unlink)throw new Oe.ErrnoError(63);if(Oe.isMountpoint(n))throw new Oe.ErrnoError(10);r.node_ops.unlink(r,t),Oe.destroyNode(n)},readlink:e=>{var r=Oe.lookupPath(e).node;if(!r)throw new Oe.ErrnoError(44);if(!r.node_ops.readlink)throw new Oe.ErrnoError(28);return Pe.resolve(Oe.getPath(r.parent),r.node_ops.readlink(r))},stat:(e,r)=>{var t=Oe.lookupPath(e,{follow:!r}).node;if(!t)throw new Oe.ErrnoError(44);if(!t.node_ops.getattr)throw new Oe.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>Oe.stat(e,!0),chmod:(e,r,t)=>{var n;"string"==typeof e?n=Oe.lookupPath(e,{follow:!t}).node:n=e;if(!n.node_ops.setattr)throw new Oe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,r)=>{Oe.chmod(e,r,!0)},fchmod:(e,r)=>{var t=Oe.getStream(e);if(!t)throw new Oe.ErrnoError(8);Oe.chmod(t.node,r)},chown:(e,r,t,n)=>{var o;"string"==typeof e?o=Oe.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new Oe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,r,t)=>{Oe.chown(e,r,t,!0)},fchown:(e,r,t)=>{var n=Oe.getStream(e);if(!n)throw new Oe.ErrnoError(8);Oe.chown(n.node,r,t)},truncate:(e,r)=>{if(r<0)throw new Oe.ErrnoError(28);var t;"string"==typeof e?t=Oe.lookupPath(e,{follow:!0}).node:t=e;if(!t.node_ops.setattr)throw new Oe.ErrnoError(63);if(Oe.isDir(t.mode))throw new Oe.ErrnoError(31);if(!Oe.isFile(t.mode))throw new Oe.ErrnoError(28);var n=Oe.nodePermissions(t,"w");if(n)throw new Oe.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:(e,r)=>{var t=Oe.getStream(e);if(!t)throw new Oe.ErrnoError(8);if(0==(2097155&t.flags))throw new Oe.ErrnoError(28);Oe.truncate(t.node,r)},utime:(e,r,t)=>{var n=Oe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:(e,r,t)=>{if(""===e)throw new Oe.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?Oe.modeStringToFlags(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=Te.normalize(e);try{n=Oe.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new Oe.ErrnoError(20)}else n=Oe.mknod(e,t,0),a=!0;if(!n)throw new Oe.ErrnoError(44);if(Oe.isChrdev(n.mode)&&(r&=-513),65536&r&&!Oe.isDir(n.mode))throw new Oe.ErrnoError(54);if(!a){var i=Oe.mayOpen(n,r);if(i)throw new Oe.ErrnoError(i)}512&r&&!a&&Oe.truncate(n,0),r&=-131713;var s=Oe.createStream({node:n,path:Oe.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(Oe.readFiles||(Oe.readFiles={}),e in Oe.readFiles||(Oe.readFiles[e]=1)),s},close:e=>{if(Oe.isClosed(e))throw new Oe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Oe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,r,t)=>{if(Oe.isClosed(e))throw new Oe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Oe.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Oe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:(e,r,t,n,o)=>{if(n<0||o<0)throw new Oe.ErrnoError(28);if(Oe.isClosed(e))throw new Oe.ErrnoError(8);if(1==(2097155&e.flags))throw new Oe.ErrnoError(8);if(Oe.isDir(e.node.mode))throw new Oe.ErrnoError(31);if(!e.stream_ops.read)throw new Oe.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new Oe.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write:(e,r,t,n,o,a)=>{if(n<0||o<0)throw new Oe.ErrnoError(28);if(Oe.isClosed(e))throw new Oe.ErrnoError(8);if(0==(2097155&e.flags))throw new Oe.ErrnoError(8);if(Oe.isDir(e.node.mode))throw new Oe.ErrnoError(31);if(!e.stream_ops.write)throw new Oe.ErrnoError(28);e.seekable&&1024&e.flags&&Oe.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new Oe.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate:(e,r,t)=>{if(Oe.isClosed(e))throw new Oe.ErrnoError(8);if(r<0||t<=0)throw new Oe.ErrnoError(28);if(0==(2097155&e.flags))throw new Oe.ErrnoError(8);if(!Oe.isFile(e.node.mode)&&!Oe.isDir(e.node.mode))throw new Oe.ErrnoError(43);if(!e.stream_ops.allocate)throw new Oe.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:(e,r,t,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Oe.ErrnoError(2);if(1==(2097155&e.flags))throw new Oe.ErrnoError(2);if(!e.stream_ops.mmap)throw new Oe.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl:(e,r,t)=>{if(!e.stream_ops.ioctl)throw new Oe.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:(e,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var t,n=Oe.open(e,r.flags),o=Oe.stat(e).size,a=new Uint8Array(o);return Oe.read(n,a,0,o,0),"utf8"===r.encoding?t=$(a,0):"binary"===r.encoding&&(t=a),Oe.close(n),t},writeFile:(e,r,t={})=>{t.flags=t.flags||577;var n=Oe.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(H(r)+1),a=G(r,o,0,o.length);Oe.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");Oe.write(n,r,0,r.byteLength,void 0,t.canOwn)}Oe.close(n)},cwd:()=>Oe.currentPath,chdir:e=>{var r=Oe.lookupPath(e,{follow:!0});if(null===r.node)throw new Oe.ErrnoError(44);if(!Oe.isDir(r.node.mode))throw new Oe.ErrnoError(54);var t=Oe.nodePermissions(r.node,"x");if(t)throw new Oe.ErrnoError(t);Oe.currentPath=r.path},createDefaultDirectories:()=>{Oe.mkdir("/tmp"),Oe.mkdir("/home"),Oe.mkdir("/home/web_user")},createDefaultDevices:()=>{Oe.mkdir("/dev"),Oe.registerDevice(Oe.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),Oe.mkdev("/dev/null",Oe.makedev(1,3)),Fe.register(Oe.makedev(5,0),Fe.default_tty_ops),Fe.register(Oe.makedev(6,0),Fe.default_tty1_ops),Oe.mkdev("/dev/tty",Oe.makedev(5,0)),Oe.mkdev("/dev/tty1",Oe.makedev(6,0));var e=Se();Oe.createDevice("/dev","random",e),Oe.createDevice("/dev","urandom",e),Oe.mkdir("/dev/shm"),Oe.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Oe.mkdir("/proc");var e=Oe.mkdir("/proc/self");Oe.mkdir("/proc/self/fd"),Oe.mount({mount:()=>{var r=Oe.createNode(e,"fd",16895,73);return r.node_ops={lookup:(e,r)=>{var t=+r,n=Oe.getStream(t);if(!n)throw new Oe.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?Oe.createDevice("/dev","stdin",o.stdin):Oe.symlink("/dev/tty","/dev/stdin"),o.stdout?Oe.createDevice("/dev","stdout",null,o.stdout):Oe.symlink("/dev/tty","/dev/stdout"),o.stderr?Oe.createDevice("/dev","stderr",null,o.stderr):Oe.symlink("/dev/tty1","/dev/stderr");var e=Oe.open("/dev/stdin",0),r=Oe.open("/dev/stdout",1),t=Oe.open("/dev/stderr",1);A(0===e.fd,"invalid handle for stdin ("+e.fd+")"),A(1===r.fd,"invalid handle for stdout ("+r.fd+")"),A(2===t.fd,"invalid handle for stderr ("+t.fd+")")},ensureErrnoError:()=>{Oe.ErrnoError||(Oe.ErrnoError=function(e,r){this.node=r,this.setErrno=function(e){for(var r in this.errno=e,Be)if(Be[r]===e){this.code=r;break}},this.setErrno(e),this.message=De[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=Me(this.stack))},Oe.ErrnoError.prototype=new Error,Oe.ErrnoError.prototype.constructor=Oe.ErrnoError,[44].forEach((e=>{Oe.genericErrors[e]=new Oe.ErrnoError(e),Oe.genericErrors[e].stack=""})))},staticInit:()=>{Oe.ensureErrnoError(),Oe.nameTable=new Array(4096),Oe.mount(Ae,{},"/"),Oe.createDefaultDirectories(),Oe.createDefaultDevices(),Oe.createSpecialDirectories(),Oe.filesystems={MEMFS:Ae}},init:(e,r,t)=>{A(!Oe.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Oe.init.initialized=!0,Oe.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,Oe.createStandardStreams()},quit:()=>{Oe.init.initialized=!1,Tn(0);for(var e=0;e{var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:(e,r)=>{var t=Oe.analyzePath(e,r);return t.exists?t.object:null},analyzePath:(e,r)=>{try{e=(n=Oe.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Oe.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Te.basename(e),n=Oe.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath:(e,r,t,n)=>{e="string"==typeof e?e:Oe.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Te.join2(e,a);try{Oe.mkdir(i)}catch(e){}e=i}}return i},createFile:(e,r,t,n,o)=>{var a=Te.join2("string"==typeof e?e:Oe.getPath(e),r),i=Oe.getMode(n,o);return Oe.create(a,i)},createDataFile:(e,r,t,n,o,a)=>{var i=r;e&&(e="string"==typeof e?e:Oe.getPath(e),i=r?Te.join2(e,r):e);var s=Oe.getMode(n,o),u=Oe.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),l=0,d=t.length;l{var o=Te.join2("string"==typeof e?e:Oe.getPath(e),r),a=Oe.getMode(!!t,!!n);Oe.createDevice.major||(Oe.createDevice.major=64);var i=Oe.makedev(Oe.createDevice.major++,0);return Oe.registerDevice(i,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,r,n,o,a)=>{for(var i=0,s=0;s{for(var i=0;i{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!m)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ke(m(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Oe.ErrnoError(29)}},createLazyFile:(e,r,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ke(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,_("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!l)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=Oe.createFile(e,r,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(A(i>=0),a.slice)for(var s=0;s{var r=u.stream_ops[e];c[e]=function(){return Oe.forceLoadFile(u),r.apply(null,arguments)}})),c.read=(e,r,t,n,o)=>(Oe.forceLoadFile(u),d(e,r,t,n,o)),c.mmap=(e,r,t,n,o)=>{Oe.forceLoadFile(u);var a=Le(r);if(!a)throw new Oe.ErrnoError(48);return d(e,B,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(e,r,t,n,o,a,i,s,u,c)=>{var l=r?Pe.resolve(Te.join2(e,r)):e,d=ue("cp "+l);function f(t){function f(t){c&&c(),s||Oe.createDataFile(e,r,t,n,o,u),a&&a(),le(d)}$e.handledByPreloadPlugin(t,l,f,(()=>{i&&i(),le(d)}))||f(t)}ce(d),"string"==typeof t?function(e,r,t,n){var o=n?"":ue("al "+e);p(e,(t=>{A(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),r(new Uint8Array(t)),o&&le(o)}),(r=>{if(!t)throw'Loading data file "'+e+'" failed.';t()})),o&&ce(o)}(t,(e=>f(e)),i):f(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,r,t)=>{r=r||(()=>{}),t=t||(()=>{});var n=Oe.indexedDB();try{var o=n.open(Oe.DB_NAME(),Oe.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=()=>{_("creating db"),o.result.createObjectStore(Oe.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([Oe.DB_STORE_NAME],"readwrite"),a=n.objectStore(Oe.DB_STORE_NAME),i=0,s=0,u=e.length;function c(){0==s?r():t()}e.forEach((e=>{var r=a.put(Oe.analyzePath(e).object.contents,e);r.onsuccess=()=>{++i+s==u&&c()},r.onerror=()=>{s++,i+s==u&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:(e,r,t)=>{r=r||(()=>{}),t=t||(()=>{});var n=Oe.indexedDB();try{var o=n.open(Oe.DB_NAME(),Oe.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([Oe.DB_STORE_NAME],"readonly")}catch(e){return void t(e)}var i=a.objectStore(Oe.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?r():t()}e.forEach((e=>{var r=i.get(e);r.onsuccess=()=>{Oe.analyzePath(e).exists&&Oe.unlink(e),Oe.createDataFile(Te.dirname(e),Te.basename(e),r.result,!0,!0,!0),++s+u==c&&l()},r.onerror=()=>{u++,s+u==c&&l()}})),a.onerror=t},o.onerror=t},absolutePath:()=>{de("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:()=>{de("FS.createFolder has been removed; use FS.mkdir instead")},createLink:()=>{de("FS.createLink has been removed; use FS.symlink instead")},joinPath:()=>{de("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:()=>{de("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:()=>{de("FS.standardizePath has been removed; use PATH.normalize instead")}},Re={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(Te.isAbs(r))return r;var n;-100===e?n=Oe.cwd():n=Re.getStreamFromFD(e).path;if(0==r.length){if(!t)throw new Oe.ErrnoError(44);return n}return Te.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Te.normalize(r)!==Te.normalize(Oe.getPath(e.node)))return-54;throw e}return I[t>>2]=n.dev,I[t+8>>2]=n.ino,I[t+12>>2]=n.mode,N[t+16>>2]=n.nlink,I[t+20>>2]=n.uid,I[t+24>>2]=n.gid,I[t+28>>2]=n.rdev,ge=[n.size>>>0,(pe=n.size,+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],I[t+40>>2]=ge[0],I[t+44>>2]=ge[1],I[t+48>>2]=4096,I[t+52>>2]=n.blocks,ge=[Math.floor(n.atime.getTime()/1e3)>>>0,(pe=Math.floor(n.atime.getTime()/1e3),+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],I[t+56>>2]=ge[0],I[t+60>>2]=ge[1],N[t+64>>2]=0,ge=[Math.floor(n.mtime.getTime()/1e3)>>>0,(pe=Math.floor(n.mtime.getTime()/1e3),+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],I[t+72>>2]=ge[0],I[t+76>>2]=ge[1],N[t+80>>2]=0,ge=[Math.floor(n.ctime.getTime()/1e3)>>>0,(pe=Math.floor(n.ctime.getTime()/1e3),+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],I[t+88>>2]=ge[0],I[t+92>>2]=ge[1],N[t+96>>2]=0,ge=[n.ino>>>0,(pe=n.ino,+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],I[t+104>>2]=ge[0],I[t+108>>2]=ge[1],0},doMsync:function(e,r,t,n,o){if(!Oe.isFile(r.node.mode))throw new Oe.ErrnoError(43);if(2&n)return 0;var a=M.slice(e,e+t);Oe.msync(r,a,o,t,n)},varargs:void 0,get:function(){return A(null!=Re.varargs),Re.varargs+=4,I[Re.varargs-4>>2]},getStr:function(e){return z(e)},getStreamFromFD:function(e){var r=Oe.getStream(e);if(!r)throw new Oe.ErrnoError(8);return r}};function Ie(e){F=e,ne()||(o.onExit&&o.onExit(e),L=!0),u(e,new Ce(e))}var Ne=function(e,r){if(F=e,function(){var e=_,r=E,t=!1;_=E=e=>{t=!0};try{Tn(0),["stdout","stderr"].forEach((function(e){var r=Oe.analyzePath("/dev/"+e);if(r){var n=r.object.rdev,o=Fe.ttys[n];o&&o.output&&o.output.length&&(t=!0)}}))}catch(e){}_=e,E=r,t&&Ve("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}(),ne()&&!r){var t="program exited (with status: "+e+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";n(t),E(t)}Ie(e)};function je(e){if(L)E("user callback triggered after runtime exited or application aborted. Ignoring.");else try{e()}catch(e){!function(e){if(e instanceof Ce||"unwind"==e)return F;K(),e instanceof WebAssembly.RuntimeError&&Ln()<=0&&E("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to "+Y+")"),u(1,e)}(e)}}function Ue(e,r){return setTimeout((function(){je(e)}),r)}function Ve(e){Ve.shown||(Ve.shown={}),Ve.shown[e]||(Ve.shown[e]=1,d&&(e="warning: "+e),E(e))}var $e={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){$e.mainLoop.scheduler=null,$e.mainLoop.currentlyRunningMainloop++},resume:function(){$e.mainLoop.currentlyRunningMainloop++;var e=$e.mainLoop.timingMode,r=$e.mainLoop.timingValue,t=$e.mainLoop.func;$e.mainLoop.func=null,function(e,r,t,n,a){A(!$e.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),$e.mainLoop.func=e,$e.mainLoop.arg=n;var i=$e.mainLoop.currentlyRunningMainloop;function s(){return!(i<$e.mainLoop.currentlyRunningMainloop)}if($e.mainLoop.running=!1,$e.mainLoop.runner=function(){if(!L)if($e.mainLoop.queue.length>0){var r=Date.now(),t=$e.mainLoop.queue.shift();if(t.func(t.arg),$e.mainLoop.remainingBlockers){var n=$e.mainLoop.remainingBlockers,a=n%1==0?n-1:Math.floor(n);t.counted?$e.mainLoop.remainingBlockers=a:(a+=.5,$e.mainLoop.remainingBlockers=(8*n+a)/9)}if(_('main loop blocker "'+t.name+'" took '+(Date.now()-r)+" ms"),$e.mainLoop.updateStatus(),!s())return;setTimeout($e.mainLoop.runner,0)}else s()&&($e.mainLoop.currentFrameNumber=$e.mainLoop.currentFrameNumber+1|0,1==$e.mainLoop.timingMode&&$e.mainLoop.timingValue>1&&$e.mainLoop.currentFrameNumber%$e.mainLoop.timingValue!=0?$e.mainLoop.scheduler():(0==$e.mainLoop.timingMode&&($e.mainLoop.tickStartTime=_e()),Ut.newRenderingFrameStarted(),void 0!==Ut&&Ut.currentContext&&!Ut.currentContextIsProxied&&!Ut.currentContext.attributes.explicitSwapControl&&Ut.currentContext.GLctx.commit&&Ut.currentContext.GLctx.commit(),"timeout"===$e.mainLoop.method&&o.ctx&&(Ve("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),$e.mainLoop.method=""),$e.mainLoop.runIter(e),K(),s()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),$e.mainLoop.scheduler())))},a||(r&&r>0?xe(0,1e3/r):xe(1,1),$e.mainLoop.scheduler()),t)throw"unwind"}(t,0,!1,$e.mainLoop.arg,!0),xe(e,r),$e.mainLoop.scheduler()},updateStatus:function(){if(o.setStatus){var e=o.statusMessage||"Please wait...",r=$e.mainLoop.remainingBlockers,t=$e.mainLoop.expectedBlockers;r?r{A(s.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=s.width,n.height=s.height,n.getContext("2d").drawImage(s,0,0),mn[r]=n,$e.URLObject.revokeObjectURL(i),t&&t(e)},s.onerror=e=>{_("Image "+i+" could not be decoded"),n&&n()},s.src=i}};o.preloadPlugins.push(e);var r={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,t,n){var o=!1;function a(n){o||(o=!0,pn[r]=n,t&&t(e))}function i(){o||(o=!0,pn[r]=new Audio,n&&n())}if(!$e.hasBlobConstructor)return i();try{var s=new Blob([e],{type:$e.getMimetype(r)})}catch(e){return i()}var u=$e.URLObject.createObjectURL(s);A("string"==typeof u,"createObjectURL must return a url as a string");var c=new Audio;c.addEventListener("canplaythrough",(()=>a(c)),!1),c.onerror=function(t){o||(E("warning: browser could not fully decode audio "+r+", trying slower base64 approach"),c.src="data:audio/x-"+r.substr(-3)+";base64,"+function(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",n=0,o=0,a=0;a=6;){var i=n>>o-6&63;o-=6,t+=r[i]}return 2==o?(t+=r[(3&n)<<4],t+="=="):4==o&&(t+=r[(15&n)<<2],t+="="),t}(e),a(c))},c.src=u,Ue((function(){a(c)}),1e4)}};o.preloadPlugins.push(r);var t=o.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||(()=>{}),t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&t.addEventListener("click",(e=>{!$e.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){$e.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},handledByPreloadPlugin:function(e,r,t,n){$e.init();var a=!1;return o.preloadPlugins.forEach((function(o){a||o.canHandle(r)&&(o.handle(e,r,t,n),a=!0)})),a},createContext:function(e,r,t,n){if(r&&o.ctx&&e==o.canvas)return o.ctx;var a,i;if(r){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)s[u]=n[u];void 0!==Ut&&(i=Ut.createContext(e,s))&&(a=Ut.getContext(i).GLctx)}else a=e.getContext("2d");return a?(t&&(r||A(void 0===fn,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=a,r&&Ut.makeContextCurrent(i),o.useWebGL=r,$e.moduleContextCreatedCallbacks.forEach((function(e){e()})),$e.init()),a):null},destroyContext:function(e,r,t){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,r){$e.lockPointer=e,$e.resizeCanvas=r,void 0===$e.lockPointer&&($e.lockPointer=!0),void 0===$e.resizeCanvas&&($e.resizeCanvas=!1);var t=o.canvas;function n(){$e.isFullscreen=!1;var e=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.exitFullscreen=$e.exitFullscreen,$e.lockPointer&&t.requestPointerLock(),$e.isFullscreen=!0,$e.resizeCanvas?$e.setFullscreenCanvasSize():$e.updateCanvasDimensions(t)):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),$e.resizeCanvas?$e.setWindowedCanvasSize():$e.updateCanvasDimensions(t)),o.onFullScreen&&o.onFullScreen($e.isFullscreen),o.onFullscreen&&o.onFullscreen($e.isFullscreen)}$e.fullscreenHandlersInstalled||($e.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");t.parentNode.insertBefore(a,t),a.appendChild(t),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},requestFullScreen:function(){de("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen:function(){return!!$e.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var r=Date.now();if(0===$e.nextRAF)$e.nextRAF=r+1e3/60;else for(;r+2>=$e.nextRAF;)$e.nextRAF+=1e3/60;var t=Math.max($e.nextRAF-r,0);setTimeout(e,t)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,$e.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,r){return Ue(e,r)},safeRequestAnimationFrame:function(e){return $e.requestAnimationFrame((function(){je(e)}))},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail/3;break;case"mousewheel":r=e.wheelDelta/120;break;case"wheel":switch(r=e.deltaY,e.deltaMode){case 0:r/=100;break;case 1:r/=3;break;case 2:r*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if($e.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?$e.mouseMovementX=$e.mouseMovementY=0:($e.mouseMovementX=$e.getMovementX(e),$e.mouseMovementY=$e.getMovementY(e)),"undefined"!=typeof SDL?($e.mouseX=SDL.mouseX+$e.mouseMovementX,$e.mouseY=SDL.mouseY+$e.mouseMovementY):($e.mouseX+=$e.mouseMovementX,$e.mouseY+=$e.mouseMovementY);else{var r=o.canvas.getBoundingClientRect(),t=o.canvas.width,n=o.canvas.height,a=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(A(void 0!==a&&void 0!==i,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(a+r.left),c=s.pageY-(i+r.top),l={x:u*=t/r.width,y:c*=n/r.height};if("touchstart"===e.type)$e.lastTouches[s.identifier]=l,$e.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=$e.touches[s.identifier];d||(d=l),$e.lastTouches[s.identifier]=d,$e.touches[s.identifier]=l}return}var f=e.pageX-(a+r.left),m=e.pageY-(i+r.top);f*=t/r.width,m*=n/r.height,$e.mouseMovementX=f-$e.mouseX,$e.mouseMovementY=m-$e.mouseY,$e.mouseX=f,$e.mouseY=m}},resizeListeners:[],updateResizeListeners:function(){var e=o.canvas;$e.resizeListeners.forEach((function(r){r(e.width,e.height)}))},setCanvasSize:function(e,r,t){var n=o.canvas;$e.updateCanvasDimensions(n,e,r),t||$e.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=N[SDL.screen>>2];e|=8388608,I[SDL.screen>>2]=e}$e.updateCanvasDimensions(o.canvas),$e.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=N[SDL.screen>>2];e&=-8388609,I[SDL.screen>>2]=e}$e.updateCanvasDimensions(o.canvas),$e.updateResizeListeners()},updateCanvasDimensions:function(e,r,t){r&&t?(e.widthNative=r,e.heightNative=t):(r=e.widthNative,t=e.heightNative);var n=r,a=t;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/a0;)e.shift()(o)}function Ge(e){return"0x"+e.toString(16).padStart(8,"0")}function We(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){N[this.ptr+4>>2]=e},this.get_type=function(){return N[this.ptr+4>>2]},this.set_destructor=function(e){N[this.ptr+8>>2]=e},this.get_destructor=function(){return N[this.ptr+8>>2]},this.set_refcount=function(e){I[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,B[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=B[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,B[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=B[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=I[this.ptr>>2];I[this.ptr>>2]=e+1},this.release_ref=function(){var e=I[this.ptr>>2];return I[this.ptr>>2]=e-1,A(e>0),1===e},this.set_adjusted_ptr=function(e){N[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return N[this.ptr+16>>2]},this.get_exception_ptr=function(){if(An(this.get_type()))return N[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var He="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";var qe=48,Ye=57;function Xe(e){if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=qe&&r<=Ye?"_"+e:e}function Qe(e,r){return e=Xe(e),function(){"use strict";return r.apply(this,arguments)}}var Ke=[{},{value:void 0},{value:null},{value:!0},{value:!1}],Je=[];function Ze(e,r){var t=Qe(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},t}var er=void 0;function rr(e){throw new er(e)}function tr(){for(var e=0,r=5;r(e||rr("Cannot use deleted val. handle = "+e),Ke[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var r=Je.length?Je.pop():Ke.length;return Ke[r]={refcount:1,value:e},r}}},ar=void 0;var ir=void 0;function sr(e){for(var r="",t=e;M[t];)r+=ir[M[t++]];return r}function ur(){return Object.keys(pr).length}function cr(){var e=[];for(var r in pr)pr.hasOwnProperty(r)&&e.push(pr[r]);return e}var lr=[];function dr(){for(;lr.length;){var e=lr.pop();e.$$.deleteScheduled=!1,e.delete()}}var fr=void 0;function mr(e){fr=e,lr.length&&fr&&fr(dr)}var pr={};function gr(e,r){for(void 0===r&&rr("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}var vr={};function hr(e){var r=Sn(e),t=sr(r);return xn(r),t}function yr(e,r){var t=vr[e];return void 0===t&&rr(r+" has unknown type "+hr(e)),t}function br(e){}var wr=!1;function _r(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function Er(e,r,t){if(r===t)return e;if(void 0===t.baseClass)return null;var n=Er(e,r,t.baseClass);return null===n?null:t.downcast(n)}var xr={};var Cr=void 0;function Tr(e){throw new Cr(e)}function Sr(e,r){return r.ptrType&&r.ptr||Tr("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!==!!r.smartPtr&&Tr("Both smartPtrType and smartPtr must be specified"),r.count={value:1},kr(Object.create(e,{$$:{value:r}}))}function Pr(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=function(e,r){return r=gr(e,r),pr[r]}(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Sr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Sr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=xr[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var u=Er(r,this.registeredClass,a.registeredClass);return null===u?o.call(this):this.isSmartPointer?Sr(a.registeredClass.instancePrototype,{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}):Sr(a.registeredClass.instancePrototype,{ptrType:a,ptr:u})}function kr(e){return"undefined"==typeof FinalizationRegistry?(kr=e=>e,e):(wr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),_r(e.$$)})),kr=e=>{var r=e.$$;if(!!r.smartPtr){var t={$$:r},n=r.ptrType.registeredClass;t.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <"+Ge(r.ptr)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(t.leakWarning,Pr),wr.register(e,t,e)}return e},br=e=>wr.unregister(e),kr(e))}var Fr={};function Lr(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function Ar(e){return this.fromWireType(I[e>>2])}var Dr={},Br={};function Mr(e,r,t){function n(r){var n=t(r);n.length!==e.length&&Tr("Mismatched type converter count");for(var o=0;o{vr.hasOwnProperty(e)?o[r]=vr[e]:(a.push(e),Dr.hasOwnProperty(e)||(Dr[e]=[]),Dr[e].push((()=>{o[r]=vr[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)}function Or(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function Rr(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=r.name;if(e||rr('type "'+n+'" must have a positive integer typeid pointer'),vr.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;rr("Cannot register type '"+n+"' twice")}if(vr[e]=r,delete Br[e],Dr.hasOwnProperty(e)){var o=Dr[e];delete Dr[e],o.forEach((e=>e()))}}function Ir(e){if(!(this instanceof zr))return!1;if(!(e instanceof zr))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o}function Nr(e){rr(e.$$.ptrType.registeredClass.name+" instance already deleted")}function jr(){if(this.$$.ptr||Nr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=kr(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r}function Ur(){this.$$.ptr||Nr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&rr("Object already scheduled for deletion"),br(this),_r(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Vr(){return!this.$$.ptr}function $r(){return this.$$.ptr||Nr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&rr("Object already scheduled for deletion"),lr.push(this),1===lr.length&&fr&&fr(dr),this.$$.deleteScheduled=!0,this}function zr(){}function Gr(e,r,t){if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||rr("Function '"+t+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}}function Wr(e,r,t){o.hasOwnProperty(e)?((void 0===t||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[t])&&rr("Cannot register public name '"+e+"' twice"),Gr(o,e,e),o.hasOwnProperty(t)&&rr("Cannot register multiple overloads of a function with the same number of arguments ("+t+")!"),o[e].overloadTable[t]=r):(o[e]=r,void 0!==t&&(o[e].numArguments=t))}function Hr(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}function qr(e,r,t){for(;r!==t;)r.upcast||rr("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function Yr(e,r){if(null===r)return this.isReference&&rr("null is not a valid "+this.name),0;r.$$||rr('Cannot pass "'+ft(r)+'" as a '+this.name),r.$$.ptr||rr("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return qr(r.$$.ptr,t,this.registeredClass)}function Xr(e,r){var t;if(null===r)return this.isReference&&rr("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||rr('Cannot pass "'+ft(r)+'" as a '+this.name),r.$$.ptr||rr("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&rr("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var n=r.$$.ptrType.registeredClass;if(t=qr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&rr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:rr("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,or.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,t)}break;default:rr("Unsupporting sharing policy")}return t}function Qr(e,r){if(null===r)return this.isReference&&rr("null is not a valid "+this.name),0;r.$$||rr('Cannot pass "'+ft(r)+'" as a '+this.name),r.$$.ptr||rr("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&rr("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return qr(r.$$.ptr,t,this.registeredClass)}function Kr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Jr(e){this.rawDestructor&&this.rawDestructor(e)}function Zr(e){null!==e&&e.delete()}function et(e,r,t,n,o,a,i,s,u,c,l){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==r.baseClass?this.toWireType=Xr:n?(this.toWireType=Yr,this.destructorFunction=null):(this.toWireType=Qr,this.destructorFunction=null)}function rt(e,r,t){o.hasOwnProperty(e)||Tr("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==t?o[e].overloadTable[t]=r:(o[e]=r,o[e].argCount=t)}var tt=[];function nt(e){var r=tt[e];return r||(e>=tt.length&&(tt.length=e+1),tt[e]=r=X.get(e)),A(X.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r}function ot(e,r,t){return e.includes("j")?function(e,r,t){A("dynCall_"+e in o,"bad function pointer type - dynCall function not found for sig '"+e+"'"),t&&t.length?A(t.length===e.substring(1).replace(/j/g,"--").length):A(1==e.length);var n=o["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)}(e,r,t):(A(nt(r),"missing table entry in dynCall: "+r),nt(r).apply(null,t))}function at(e,r){var t=(e=sr(e)).includes("j")?function(e,r){A(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var t=[];return function(){return t.length=0,Object.assign(t,arguments),ot(e,r,t)}}(e,r):nt(r);return"function"!=typeof t&&rr("unknown function pointer with signature "+e+": "+r),t}var it=void 0;function st(e,r){var t=[],n={};throw r.forEach((function e(r){n[r]||vr[r]||(Br[r]?Br[r].forEach(e):(t.push(r),n[r]=!0))})),new it(e+": "+t.map(hr).join([", "]))}function ut(e,r,t,n,o){var a=r.length;a<2&&rr("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==r[1]&&null!==t,s=!1,u=1;u>2]);return t}function lt(e,r,t){return e instanceof Object||rr(t+' with invalid "this": '+e),e instanceof r.registeredClass.constructor||rr(t+' incompatible with "this" of type '+e.constructor.name),e.$$.ptr||rr("cannot call emscripten binding method "+t+" on deleted object"),qr(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)}function dt(e){e>4&&0==--Ke[e].refcount&&(Ke[e]=void 0,Je.push(e))}function ft(e){if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e}function mt(e,r){switch(r){case 2:return function(e){return this.fromWireType(j[e>>2])};case 3:return function(e){return this.fromWireType(U[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function pt(e,r,t){switch(r){case 0:return t?function(e){return B[e]}:function(e){return M[e]};case 1:return t?function(e){return O[e>>1]}:function(e){return R[e>>1]};case 2:return t?function(e){return I[e>>2]}:function(e){return N[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var gt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function vt(e,r){A(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&R[n];)++n;if((t=n<<1)-e>32&>)return gt.decode(M.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=O[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a}function ht(e,r,t){if(A(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),A("number"==typeof t,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=i,r+=2}return O[r>>1]=0,r-n}function yt(e){return 2*e.length}function bt(e,r){A(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t=0,n="";!(t>=r/4);){var o=I[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n}function wt(e,r,t){if(A(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),A("number"==typeof t,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a=55296&&i<=57343)i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a);if(I[r>>2]=i,(r+=4)+4>o)break}return I[r>>2]=0,r-n}function _t(e){for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r}var Et={};function xt(e){var r=Et[e];return void 0===r?sr(e):r}var Ct=[];function Tt(){if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var r="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&e(global)?$$$embind_global$$$=global:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")}var St=[];function Pt(e){return N[e>>2]+4294967296*I[e+4>>2]}function kt(e){return e%4==0&&(e%100!=0||e%400==0)}var Ft=[0,31,60,91,121,152,182,213,244,274,305,335],Lt=[0,31,59,90,120,151,181,212,243,273,304,334];function At(e){return(kt(e.getFullYear())?Ft:Lt)[e.getMonth()]+e.getDate()-1}function Dt(e){var r=H(e)+1,t=En(r);return t&&G(e,B,t,r),t}var Bt=[];function Mt(e,r,t){var n=function(e,r){var t;for(A(Array.isArray(Bt)),A(r%16==0),Bt.length=0,r>>=2;t=M[e++];){var n=String.fromCharCode(t),o=["d","f","i"];A(o.includes(n),"Invalid character "+t+'("'+n+'") in readEmAsmArgs! Use only ['+o+'], and do not specify "v" for void return argument.'),r+=105!=t&r,Bt.push(105==t?I[r]:U[r++>>1]),++r}return Bt}(r,t);return Ee.hasOwnProperty(e)||de("No EM_ASM constant found at address "+e),Ee[e].apply(null,n)}function Ot(e){try{return P.grow(e-D.byteLength+65535>>>16),q(P.buffer),1}catch(r){E("emscripten_realloc_buffer: Attempted to grow heap from "+D.byteLength+" bytes to "+e+" bytes, but got error: "+r)}}function Rt(e){return de("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0}var It={};function Nt(e){e.forEach((e=>{var r=Rt();r&&(It[r]=e)}))}function jt(){var e=new Error;if(!e.stack){try{throw new Error}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}var Ut={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Ut.lastError||(Ut.lastError=e)},getNewId:function(e){for(var r=Ut.counter++,t=e.length;t>1,c=new Uint16Array(u),l=(n=0,0);!(c[n++]=l,n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;r.GLctx.bufferData(34963,c,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function(e){var r=Ut.log2ceilLookup(e),t=Ut.currentContext.tempVertexBuffers1[r],n=Ut.currentContext.tempVertexBufferCounters1[r];Ut.currentContext.tempVertexBufferCounters1[r]=Ut.currentContext.tempVertexBufferCounters1[r]+1&Ut.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=fn.getParameter(34964);return t[n]=fn.createBuffer(),fn.bindBuffer(34962,t[n]),fn.bufferData(34962,1<>2]:-1;o+=z(I[t+4*a>>2],i<0?void 0:i)}return o},calcBufLength:function(e,r,t,n){return t>0?n*t:e*Ut.byteSizeByType[r-Ut.byteSizeByTypeRoot]*n},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function(e){Ut.resetBufferBinding=!1;for(var r=0;r1?e.getContext("webgl2",r):e.getContext("webgl",r);return t?Ut.registerContext(t,r):0},enableOffscreenFramebufferAttributes:function(e){e.renderViaOffscreenBackBuffer=!0,e.preserveDrawingBuffer=!0},createOffscreenFramebuffer:function(e){var r=e.GLctx,t=r.createFramebuffer();if(r.bindFramebuffer(36160,t),e.defaultFbo=t,e.defaultFboForbidBlitFramebuffer=!1,r.getContextAttributes().antialias)e.defaultFboForbidBlitFramebuffer=!0;else{var n=navigator.userAgent.toLowerCase().match(/firefox\/(\d\d)/);if(null!=n){var o=n[1];e.defaultFboForbidBlitFramebuffer=o<67}}e.defaultColorTarget=r.createTexture(),e.defaultDepthTarget=r.createRenderbuffer(),Ut.resizeOffscreenFramebuffer(e),r.bindTexture(3553,e.defaultColorTarget),r.texParameteri(3553,10241,9728),r.texParameteri(3553,10240,9728),r.texParameteri(3553,10242,33071),r.texParameteri(3553,10243,33071),r.texImage2D(3553,0,6408,r.canvas.width,r.canvas.height,0,6408,5121,null),r.framebufferTexture2D(36160,36064,3553,e.defaultColorTarget,0),r.bindTexture(3553,null);r.createRenderbuffer();r.bindRenderbuffer(36161,e.defaultDepthTarget),r.renderbufferStorage(36161,33189,r.canvas.width,r.canvas.height),r.framebufferRenderbuffer(36160,36096,36161,e.defaultDepthTarget),r.bindRenderbuffer(36161,null);var a=r.createBuffer();r.bindBuffer(34962,a),r.bufferData(34962,new Float32Array([-1,-1,-1,1,1,-1,1,1]),35044),r.bindBuffer(34962,null),e.blitVB=a;var i=r.createShader(35633);r.shaderSource(i,"attribute vec2 pos;varying lowp vec2 tex;void main() { tex = pos * 0.5 + vec2(0.5,0.5); gl_Position = vec4(pos, 0.0, 1.0); }"),r.compileShader(i);var s=r.createShader(35632);r.shaderSource(s,"varying lowp vec2 tex;uniform sampler2D sampler;void main() { gl_FragColor = texture2D(sampler, tex); }"),r.compileShader(s);var u=r.createProgram();r.attachShader(u,i),r.attachShader(u,s),r.linkProgram(u),e.blitProgram=u,e.blitPosLoc=r.getAttribLocation(u,"pos"),r.useProgram(u),r.uniform1i(r.getUniformLocation(u,"sampler"),0),r.useProgram(null),e.defaultVao=void 0,r.createVertexArray&&(e.defaultVao=r.createVertexArray(),r.bindVertexArray(e.defaultVao),r.enableVertexAttribArray(e.blitPosLoc),r.bindVertexArray(null))},resizeOffscreenFramebuffer:function(e){var r=e.GLctx;if(e.defaultColorTarget){var t=r.getParameter(32873);r.bindTexture(3553,e.defaultColorTarget),r.texImage2D(3553,0,6408,r.drawingBufferWidth,r.drawingBufferHeight,0,6408,5121,null),r.bindTexture(3553,t)}if(e.defaultDepthTarget){var n=r.getParameter(36007);r.bindRenderbuffer(36161,e.defaultDepthTarget),r.renderbufferStorage(36161,33189,r.drawingBufferWidth,r.drawingBufferHeight),r.bindRenderbuffer(36161,n)}},blitOffscreenFramebuffer:function(e){var r=e.GLctx,t=r.getParameter(3089);t&&r.disable(3089);var n=r.getParameter(36006);if(r.blitFramebuffer&&!e.defaultFboForbidBlitFramebuffer)r.bindFramebuffer(36008,e.defaultFbo),r.bindFramebuffer(36009,null),r.blitFramebuffer(0,0,r.canvas.width,r.canvas.height,0,0,r.canvas.width,r.canvas.height,16384,9728);else{r.bindFramebuffer(36160,null);var o=r.getParameter(35725);r.useProgram(e.blitProgram);var a=r.getParameter(34964);r.bindBuffer(34962,e.blitVB);var i=r.getParameter(34016);r.activeTexture(33984);var s=r.getParameter(32873);r.bindTexture(3553,e.defaultColorTarget);var u=r.getParameter(3042);u&&r.disable(3042);var c=r.getParameter(2884);c&&r.disable(2884);var l=r.getParameter(2929);l&&r.disable(2929);var d=r.getParameter(2960);function f(){r.vertexAttribPointer(e.blitPosLoc,2,5126,!1,0,0),r.drawArrays(5,0,4)}if(d&&r.disable(2960),e.defaultVao){var m=r.getParameter(34229);r.bindVertexArray(e.defaultVao),f(),r.bindVertexArray(m)}else{for(var p={buffer:r.getVertexAttrib(e.blitPosLoc,34975),size:r.getVertexAttrib(e.blitPosLoc,34339),stride:r.getVertexAttrib(e.blitPosLoc,34340),type:r.getVertexAttrib(e.blitPosLoc,34341),normalized:r.getVertexAttrib(e.blitPosLoc,34922),pointer:r.getVertexAttribOffset(e.blitPosLoc,34373)},g=r.getParameter(34921),v=[],h=0;h=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),function(e){e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")}(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},Vt={inEventHandler:0,removeAllEventListeners:function(){for(var e=Vt.eventHandlers.length-1;e>=0;--e)Vt._removeHandler(e);Vt.eventHandlers=[],Vt.deferredCalls=[]},registerRemoveEventListeners:function(){Vt.removeEventListenersRegistered||(ee.push(Vt.removeAllEventListeners),Vt.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,r,t){function n(e,r){if(e.length!=r.length)return!1;for(var t in e)if(e[t]!=r[t])return!1;return!0}for(var o in Vt.deferredCalls){var a=Vt.deferredCalls[o];if(a.targetFunction==e&&n(a.argsList,t))return}Vt.deferredCalls.push({targetFunction:e,precedence:r,argsList:t}),Vt.deferredCalls.sort((function(e,r){return e.precedence>2,n=I[t+6],o={alpha:!!I[t+0],depth:!!I[t+1],stencil:!!I[t+2],antialias:!!I[t+3],premultipliedAlpha:!!I[t+4],preserveDrawingBuffer:!!I[t+5],powerPreference:$t[n],failIfMajorPerformanceCaveat:!!I[t+7],majorVersion:I[t+8],minorVersion:I[t+9],enableExtensionsByDefault:I[t+10],explicitSwapControl:I[t+11],proxyContextToMainThread:I[t+12],renderViaOffscreenBackBuffer:I[t+13]},a=Gt(e);if(!a)return 0;if(a.offscreenCanvas&&(a=a.offscreenCanvas),o.explicitSwapControl&&(a.transferControlToOffscreen||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas||o.renderViaOffscreenBackBuffer||(o.renderViaOffscreenBackBuffer=!0),a.transferControlToOffscreen)){if(a.controlTransferredOffscreen){if(!Ut.offscreenCanvases[a.id])return 0}else Ut.offscreenCanvases[a.id]={canvas:a.transferControlToOffscreen(),canvasSharedPtr:En(12),id:a.id},a.controlTransferredOffscreen=!0;a=Ut.offscreenCanvases[a.id]}return Ut.createContext(a,o)};var Ht=function(){return Ut.currentContext?Ut.currentContext.handle:0};var qt={initManagers:function(){function e(){this.objects={},this.nextId=1,this.create=function(e,r){r=r||{};var t=this.nextId++;return A(void 0===this.objects[t]),r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e){var r=this.objects[e];return A(void 0!==r),r.object}},this.reference=function(e){var r=this.objects[e];A(void 0!==r),r.refcount++},this.release=function(e){var r=this.objects[e];A(void 0!==r),A(r.refcount>0),r.refcount--,r.refcount<=0&&delete this.objects[e]}}qt.mgrDevice||(qt.mgrSurface=qt.mgrSurface||new e,qt.mgrSwapChain=qt.mgrSwapChain||new e,qt.mgrAdapter=qt.mgrAdapter||new e,qt.mgrDevice=qt.mgrDevice||new e,qt.mgrQueue=qt.mgrQueue||new e,qt.mgrCommandBuffer=qt.mgrCommandBuffer||new e,qt.mgrCommandEncoder=qt.mgrCommandEncoder||new e,qt.mgrRenderPassEncoder=qt.mgrRenderPassEncoder||new e,qt.mgrComputePassEncoder=qt.mgrComputePassEncoder||new e,qt.mgrBindGroup=qt.mgrBindGroup||new e,qt.mgrBuffer=qt.mgrBuffer||new e,qt.mgrSampler=qt.mgrSampler||new e,qt.mgrTexture=qt.mgrTexture||new e,qt.mgrTextureView=qt.mgrTextureView||new e,qt.mgrQuerySet=qt.mgrQuerySet||new e,qt.mgrBindGroupLayout=qt.mgrBindGroupLayout||new e,qt.mgrPipelineLayout=qt.mgrPipelineLayout||new e,qt.mgrRenderPipeline=qt.mgrRenderPipeline||new e,qt.mgrComputePipeline=qt.mgrComputePipeline||new e,qt.mgrShaderModule=qt.mgrShaderModule||new e,qt.mgrRenderBundleEncoder=qt.mgrRenderBundleEncoder||new e,qt.mgrRenderBundle=qt.mgrRenderBundle||new e)},makeColor:function(e){return{r:U[e>>3],g:U[e+8>>3],b:U[e+16>>3],a:U[e+24>>3]}},makeExtent3D:function(e){return{width:N[e>>2],height:N[e+4>>2],depthOrArrayLayers:N[e+8>>2]}},makeOrigin3D:function(e){return{x:N[e>>2],y:N[e+4>>2],z:N[e+8>>2]}},makeImageCopyTexture:function(e){return A(e),A(0===N[e>>2]),{texture:qt.mgrTexture.get(N[e+4>>2]),mipLevel:N[e+8>>2],origin:qt.makeOrigin3D(e+12),aspect:qt.TextureAspect[N[e+24>>2]]}},makeTextureDataLayout:function(e){A(e),A(0===N[e>>2]);var r=N[e+16>>2],t=N[e+20>>2];return{offset:4294967296*N[e+4+8>>2]+N[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:function(e){A(e),A(0===N[e>>2]);var r=e+8,t=qt.makeTextureDataLayout(r);return t.buffer=qt.mgrBuffer.get(N[e+32>>2]),t},makePipelineConstants:function(e,r){if(e){for(var t={},n=0;n>2])]=U[o+8>>3]}return t}},makeProgrammableStageDescriptor:function(e){if(e)return A(e),A(0===N[e>>2]),{module:qt.mgrShaderModule.get(N[e+4>>2]),entryPoint:z(N[e+8>>2]),constants:qt.makePipelineConstants(N[e+12>>2],N[e+16>>2])}},DeviceLostReason:{undefined:0,destroyed:1},PreferredFormat:{rgba8unorm:18,bgra8unorm:23},AddressMode:["repeat","mirror-repeat","clamp-to-edge"],BlendFactor:["zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:["add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],CompareFunction:[,"never","less","less-equal","greater","greater-equal","equal","not-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],ComputePassTimestampLocation:["beginning","end"],CullMode:["none","front","back"],ErrorFilter:["validation","out-of-memory"],FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","pipeline-statistics-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance"],FilterMode:["nearest","linear"],FrontFace:["ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],PipelineStatisticName:["vertex-shader-invocations","clipper-invocations","clipper-primitives-out","fragment-shader-invocations","compute-shader-invocations"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:["point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:["occlusion","pipeline-statistics","timestamp"],RenderPassTimestampLocation:["beginning","end"],SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:["keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only"],StoreOp:[,"store","discard"],TextureAspect:["all","stencil-only","depth-only"],TextureComponentType:["float","sint","uint","depth-comparison"],TextureDimension:["1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4"],VertexStepMode:["vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","pipeline-statistics-query":"4","texture-compression-bc":"5","texture-compression-etc2":"6","texture-compression-astc":"7","indirect-first-instance":"8"}},Yt={values:{},next_id:1,add:function(e){var r;do{r=Yt.next_id++,Yt.next_id>2147483647&&(Yt.next_id=1)}while(r in Yt.values);return Yt.values[r]=e,r},remove:function(e){A(e in Yt.values),delete Yt.values[e]},get:function(e){return A(0===e||e in Yt.values),Yt.values[e]}};var Xt={};function Qt(){if(!Qt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(var r in Xt)void 0===Xt[r]?delete e[r]:e[r]=Xt[r];var t=[];for(var r in e)t.push(r+"="+e[r]);Qt.strings=t}return Qt.strings}var Kt=[];function Jt(e,r,t,n){for(var o=0;o>2]=i}}function Zt(e,r){N[e>>2]=r,N[e+4>>2]=(r-N[e>>2])/4294967296;var t=r>=0?function(e){return N[e>>2]+4294967296*N[e+4>>2]}(e):Pt(e);t!=r&&Ve("writeI53ToI64() out of range: serialized JS Number "+r+" to Wasm heap as bytes lo="+Ge(N[e>>2])+", hi="+Ge(N[e+4>>2])+", which deserializes back to "+t+" instead!")}function en(e){var r=H(e)+1,t=En(r);return W(e,t,r),t}function rn(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function tn(e){return 0==(e-=5120)?B:1==e?M:2==e?O:4==e?I:6==e?j:5==e||28922==e||28520==e||30779==e||30782==e?N:R}function nn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function on(e,r,t,n,o,a){var i=tn(e),s=nn(i),u=1<>s,o+l>>s)}function an(e){var r=fn.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=fn.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?"["+t+"]":""))),t}Ut.recordError(1282)}var sn=[];var un=[];var cn=[31,29,31,30,31,30,31,31,30,31,30,31],ln=[31,28,31,30,31,30,31,31,30,31,30,31];function dn(e,r,t,n){var o=I[n+40>>2],a={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:o?z(o):""},i=z(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=function(e,r){for(var t=new Date(e.getTime());r>0;){var n=kt(t.getFullYear()),o=t.getMonth(),a=(n?cn:ln)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=p(t),a=p(n);return m(o,r)<=0?m(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var v={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return f((e.tm_year+1900)/100|0,2)},"%d":function(e){return f(e.tm_mday,2)},"%e":function(e){return d(e.tm_mday,2," ")},"%g":function(e){return g(e).toString().substring(2)},"%G":function(e){return g(e)},"%H":function(e){return f(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),f(r,2)},"%j":function(e){return f(e.tm_mday+function(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}(kt(e.tm_year+1900)?cn:ln,e.tm_mon-1),3)},"%m":function(e){return f(e.tm_mon+1,2)},"%M":function(e){return f(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return f(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var r=e.tm_yday+7-e.tm_wday;return f(Math.floor(r/7),2)},"%V":function(e){var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&kt(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&kt(e.tm_year%400-1))&&r++}return f(r,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var r=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(r/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\0\0"),v)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),v[u](a)));var h=ke(i=i.replace(/\0\0/g,"%"),!1);return h.length>r?0:(function(e,r){A(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),B.set(e,r)}(h,e),h.length-1)}o.requestFullscreen=function(e,r){$e.requestFullscreen(e,r)},o.requestFullScreen=function(){$e.requestFullScreen()},o.requestAnimationFrame=function(e){$e.requestAnimationFrame(e)},o.setCanvasSize=function(e,r,t){$e.setCanvasSize(e,r,t)},o.pauseMainLoop=function(){$e.mainLoop.pause()},o.resumeMainLoop=function(){$e.mainLoop.resume()},o.getUserMedia=function(){$e.getUserMedia()},o.createContext=function(e,r,t,n){return $e.createContext(e,r,t,n)};var fn,mn={},pn={},gn=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Oe.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},vn=365,hn=146;Object.defineProperties(gn.prototype,{read:{get:function(){return(this.mode&vn)===vn},set:function(e){e?this.mode|=vn:this.mode&=-366}},write:{get:function(){return(this.mode&hn)===hn},set:function(e){e?this.mode|=hn:this.mode&=-147}},isFolder:{get:function(){return Oe.isDir(this.mode)}},isDevice:{get:function(){return Oe.isChrdev(this.mode)}}}),Oe.FSNode=gn,Oe.staticInit(),o.FS_createPath=Oe.createPath,o.FS_createDataFile=Oe.createDataFile,o.FS_createPreloadedFile=Oe.createPreloadedFile,o.FS_unlink=Oe.unlink,o.FS_createLazyFile=Oe.createLazyFile,o.FS_createDevice=Oe.createDevice,Be={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},er=o.BindingError=Ze(Error,"BindingError"),o.count_emval_handles=tr,o.get_first_emval=nr,ar=o.PureVirtualError=Ze(Error,"PureVirtualError"),function(){for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);ir=e}(),o.getInheritedInstanceCount=ur,o.getLiveInheritedInstances=cr,o.flushPendingDeletes=dr,o.setDelayFunction=mr,Cr=o.InternalError=Ze(Error,"InternalError"),zr.prototype.isAliasOf=Ir,zr.prototype.clone=jr,zr.prototype.delete=Ur,zr.prototype.isDeleted=Vr,zr.prototype.deleteLater=$r,et.prototype.getPointee=Kr,et.prototype.destructor=Jr,et.prototype.argPackAdvance=8,et.prototype.readValueFromPointer=Ar,et.prototype.deleteObject=Zr,et.prototype.fromWireType=Pr,it=o.UnboundTypeError=Ze(Error,"UnboundTypeError"),qt.initManagers();for(var yn=0;yn<32;++yn)Kt.push(new Array(yn));var bn=new Float32Array(288);for(yn=0;yn<288;++yn)sn[yn]=bn.subarray(0,yn+1);var wn=new Int32Array(288);for(yn=0;yn<288;++yn)un[yn]=wn.subarray(0,yn+1);"function"==typeof atob&&atob;var _n={HaveOffsetConverter:function(){return"undefined"!=typeof wasmOffsetConverter},__assert_fail:function(e,r,t,n){de("Assertion failed: "+z(e)+", at: "+[r?z(r):"unknown filename",t,n?z(n):"unknown function"])},__cxa_allocate_exception:function(e){return En(e+24)+24},__cxa_throw:function(e,r,t){throw new We(e).init(r,t),e,e+" - Exception catching is disabled, this exception cannot be caught. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch."},__syscall_dup:function(e){try{var r=Re.getStreamFromFD(e);return Oe.createStream(r,0).fd}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},__syscall_fcntl64:function(e,r,t){Re.varargs=t;try{var n=Re.getStreamFromFD(e);switch(r){case 0:return(o=Re.get())<0?-28:Oe.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Re.get();return n.flags|=o,0;case 5:o=Re.get();return O[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,I[Cn()>>2]=a,-1}}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}var a},__syscall_fstat64:function(e,r){try{var t=Re.getStreamFromFD(e);return Re.doStat(Oe.stat,t.path,r)}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},__syscall_ioctl:function(e,r,t){Re.varargs=t;try{var n=Re.getStreamFromFD(e);switch(r){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Re.get();return I[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=Re.get();return Oe.ioctl(n,r,o);default:return-28}}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},__syscall_lstat64:function(e,r){try{return e=Re.getStr(e),Re.doStat(Oe.lstat,e,r)}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},__syscall_newfstatat:function(e,r,t,n){try{r=Re.getStr(r);var o=256&n,a=4096&n;return A(!(n&=-6401),"unknown flags in __syscall_newfstatat: "+n),r=Re.calculateAt(e,r,a),Re.doStat(o?Oe.lstat:Oe.stat,r,t)}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},__syscall_openat:function(e,r,t,n){Re.varargs=n;try{r=Re.getStr(r),r=Re.calculateAt(e,r);var o=n?Re.get():0;return Oe.open(r,t,o).fd}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},__syscall_stat64:function(e,r){try{return e=Re.getStr(e),Re.doStat(Oe.stat,e,r)}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},_dlinit:function(e){},_dlopen_js:function(e,r){de(He)},_dlsym_js:function(e,r){de(He)},_embind_create_inheriting_constructor:function(e,r,t){e=sr(e),r=yr(r,"wrapper"),t=or.toValue(t);var n=[].slice,o=r.registeredClass,a=o.instancePrototype,i=o.baseClass.instancePrototype,s=o.baseClass.constructor,u=Qe(e,(function(){o.baseClass.pureVirtualFunctions.forEach(function(e){if(this[e]===i[e])throw new ar("Pure virtual function "+e+" must be implemented in JavaScript")}.bind(this)),Object.defineProperty(this,"__parent",{value:a}),this.__construct.apply(this,n.call(arguments))}));for(var c in a.__construct=function(){this===a&&rr("Pass correct 'this' to __construct");var e=s.implement.apply(void 0,[this].concat(n.call(arguments)));br(e);var r,t,i,u=e.$$;e.notifyOnDestruction(),u.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:u}}),kr(this),r=o,t=u.ptr,i=this,t=gr(r,t),pr.hasOwnProperty(t)?rr("Tried to register registered instance: "+t):pr[t]=i},a.__destruct=function(){var e,r;this===a&&rr("Pass correct 'this' to __destruct"),br(this),e=o,r=this.$$.ptr,r=gr(e,r),pr.hasOwnProperty(r)?delete pr[r]:rr("Tried to unregister unregistered instance: "+r)},u.prototype=Object.create(a),t)u.prototype[c]=t[c];return or.toHandle(u)},_embind_finalize_value_object:function(e){var r=Fr[e];delete Fr[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields;Mr([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,u=r.getterContext,c=e[t+o.length],l=r.setter,d=r.setterContext;a[n]={read:e=>i.fromWireType(s(u,e)),write:(e,r)=>{var t=[];l(d,e,c.toWireType(t,r)),Lr(t)}}})),[{name:r.name,fromWireType:function(e){var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:function(e,r){for(var o in a)if(!(o in r))throw new TypeError('Missing field: "'+o+'"');var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:Ar,destructorFunction:n}]}))},_embind_register_bigint:function(e,r,t,n,o){},_embind_register_bool:function(e,r,t,n,o){var a=Or(t);Rr(e,{name:r=sr(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===t)n=B;else if(2===t)n=O;else{if(4!==t)throw new TypeError("Unknown boolean type size: "+r);n=I}return this.fromWireType(n[e>>a])},destructorFunction:null})},_embind_register_class:function(e,r,t,n,o,a,i,s,u,c,l,d,f){l=sr(l),a=at(o,a),s&&(s=at(i,s)),c&&(c=at(u,c)),f=at(d,f);var m=Xe(l);Wr(m,(function(){st("Cannot construct "+l+" due to unbound types",[n])})),Mr([e,r,t],n?[n]:[],(function(r){var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:zr.prototype;var i=Qe(m,(function(){if(Object.getPrototypeOf(this)!==u)throw new er("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new er(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new er("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Hr(l,i,u,f,t,a,s,c),p=new et(l,d,!0,!1,!1),g=new et(l+"*",d,!1,!1,!1),v=new et(l+" const*",d,!1,!0,!1);return xr[e]={pointerType:g,constPointerType:v},rt(m,i),[p,g,v]}))},_embind_register_class_class_function:function(e,r,t,n,o,a,i){var s=ct(t,n);r=sr(r),a=at(o,a),Mr([],[e],(function(e){var n=(e=e[0]).name+"."+r;function o(){st("Cannot call "+n+" due to unbound types",s)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var u=e.registeredClass.constructor;return void 0===u[r]?(o.argCount=t-1,u[r]=o):(Gr(u,r,n),u[r].overloadTable[t-1]=o),Mr([],s,(function(e){var o=[e[0],null].concat(e.slice(1)),s=ut(n,o,null,a,i);return void 0===u[r].overloadTable?(s.argCount=t-1,u[r]=s):u[r].overloadTable[t-1]=s,[]})),[]}))},_embind_register_class_constructor:function(e,r,t,n,o,a){A(r>0);var i=ct(r,t);o=at(n,o),Mr([],[e],(function(e){var t="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new er("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[r-1]=()=>{st("Cannot construct "+e.name+" due to unbound types",i)},Mr([],i,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=ut(t,n,null,o,a),[]})),[]}))},_embind_register_class_function:function(e,r,t,n,o,a,i,s){var u=ct(t,n);r=sr(r),a=at(o,a),Mr([],[e],(function(e){var n=(e=e[0]).name+"."+r;function o(){st("Cannot call "+n+" due to unbound types",u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,l=c[r];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===t-2?(o.argCount=t-2,o.className=e.name,c[r]=o):(Gr(c,r,n),c[r].overloadTable[t-2]=o),Mr([],u,(function(o){var s=ut(n,o,e,a,i);return void 0===c[r].overloadTable?(s.argCount=t-2,c[r]=s):c[r].overloadTable[t-2]=s,[]})),[]}))},_embind_register_class_property:function(e,r,t,n,o,a,i,s,u,c){r=sr(r),o=at(n,o),Mr([],[e],(function(e){var n=(e=e[0]).name+"."+r,l={get:function(){st("Cannot access "+n+" due to unbound types",[t,i])},enumerable:!0,configurable:!0};return l.set=u?()=>{st("Cannot access "+n+" due to unbound types",[t,i])}:e=>{rr(n+" is a read-only property")},Object.defineProperty(e.registeredClass.instancePrototype,r,l),Mr([],u?[t,i]:[t],(function(t){var i=t[0],l={get:function(){var r=lt(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(u){u=at(s,u);var d=t[1];l.set=function(r){var t=lt(this,e,n+" setter"),o=[];u(c,t,d.toWireType(o,r)),Lr(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,l),[]})),[]}))},_embind_register_emval:function(e,r){Rr(e,{name:r=sr(r),fromWireType:function(e){var r=or.toValue(e);return dt(e),r},toWireType:function(e,r){return or.toHandle(r)},argPackAdvance:8,readValueFromPointer:Ar,destructorFunction:null})},_embind_register_float:function(e,r,t){var n=Or(t);Rr(e,{name:r=sr(r),fromWireType:function(e){return e},toWireType:function(e,r){if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError('Cannot convert "'+ft(r)+'" to '+this.name);return r},argPackAdvance:8,readValueFromPointer:mt(r,n),destructorFunction:null})},_embind_register_function:function(e,r,t,n,o,a){var i=ct(r,t);e=sr(e),o=at(n,o),Wr(e,(function(){st("Cannot call "+e+" due to unbound types",i)}),r-1),Mr([],i,(function(t){var n=[t[0],null].concat(t.slice(1));return rt(e,ut(e,n,null,o,a),r-1),[]}))},_embind_register_integer:function(e,r,t,n,o){r=sr(r),-1===o&&(o=4294967295);var a=Or(t),i=e=>e;if(0===n){var s=32-8*t;i=e=>e<>>s}var u=r.includes("unsigned"),c=(e,t)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+ft(e)+'" to '+t);if(eo)throw new TypeError('Passing a number "'+ft(e)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+n+", "+o+"]!")};Rr(e,{name:r,fromWireType:i,toWireType:u?function(e,r){return c(r,this.name),r>>>0}:function(e,r){return c(r,this.name),r},argPackAdvance:8,readValueFromPointer:pt(r,a,0!==n),destructorFunction:null})},_embind_register_memory_view:function(e,r,t){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=N,t=r[e>>=2],o=r[e+1];return new n(D,o,t)}Rr(e,{name:t=sr(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(e,r){var t="std::string"===(r=sr(r));Rr(e,{name:r,fromWireType:function(e){var r,n=N[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==M[s]){var u=z(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var c=new Array(n);for(i=0;i>2]=n,t&&o)W(r,i,n+1);else if(o)for(var s=0;s255&&(xn(i),rr("String has UTF-16 code units that do not fit in 8 bits")),M[i+s]=u}else for(s=0;sR,s=1):4===r&&(n=bt,o=wt,i=_t,a=()=>N,s=2),Rr(e,{name:t,fromWireType:function(e){for(var t,o=N[e>>2],i=a(),u=e+4,c=0;c<=o;++c){var l=e+4+c*r;if(c==o||0==i[l>>s]){var d=n(u,l-u);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),u=l+r}}return xn(e),t},toWireType:function(e,n){"string"!=typeof n&&rr("Cannot pass non-string to C++ string type "+t);var a=i(n),u=En(4+a+r);return N[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push(xn,u),u},argPackAdvance:8,readValueFromPointer:Ar,destructorFunction:function(e){xn(e)}})},_embind_register_value_object:function(e,r,t,n,o,a){Fr[e]={name:sr(r),rawConstructor:at(t,n),rawDestructor:at(o,a),fields:[]}},_embind_register_value_object_field:function(e,r,t,n,o,a,i,s,u,c){Fr[e].fields.push({fieldName:sr(r),getterReturnType:t,getter:at(n,o),getterContext:a,setterArgumentType:i,setter:at(s,u),setterContext:c})},_embind_register_void:function(e,r){Rr(e,{isVoid:!0,name:r=sr(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})},_emscripten_get_now_is_monotonic:function(){return true},_emval_as:function(e,r,t){e=or.toValue(e),r=yr(r,"emval::as");var n=[],o=or.toHandle(n);return N[t>>2]=o,r.toWireType(n,e)},_emval_call_void_method:function(e,r,t,n){(e=Ct[e])(r=or.toValue(r),t=xt(t),null,n)},_emval_decref:dt,_emval_get_global:function(e){return 0===e?or.toHandle(Tt()):(e=xt(e),or.toHandle(Tt()[e]))},_emval_get_method_caller:function(e,r){var t=function(e,r){for(var t=new Array(e),n=0;n>2],"parameter "+n);return t}(e,r),n=t[0],o=n.name+"_$"+t.slice(1).map((function(e){return e.name})).join("_")+"$",a=St[o];if(void 0!==a)return a;var i,s,u=new Array(e-1);return i=(r,o,a,i)=>{for(var s=0,c=0;c4&&(Ke[e].refcount+=1)},_emval_instanceof:function(e,r){return(e=or.toValue(e))instanceof(r=or.toValue(r))},_emval_new_cstring:function(e){return or.toHandle(xt(e))},_emval_run_destructors:function(e){Lr(or.toValue(e)),dt(e)},_emval_set_property:function(e,r,t){e=or.toValue(e),r=or.toValue(r),t=or.toValue(t),e[r]=t},_emval_take_value:function(e,r){var t=(e=yr(e,"_emval_take_value")).readValueFromPointer(r);return or.toHandle(t)},_emval_typeof:function(e){return e=or.toValue(e),or.toHandle(typeof e)},_gmtime_js:function(e,r){var t=new Date(1e3*Pt(e));I[r>>2]=t.getUTCSeconds(),I[r+4>>2]=t.getUTCMinutes(),I[r+8>>2]=t.getUTCHours(),I[r+12>>2]=t.getUTCDate(),I[r+16>>2]=t.getUTCMonth(),I[r+20>>2]=t.getUTCFullYear()-1900,I[r+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;I[r+28>>2]=o},_localtime_js:function(e,r){var t=new Date(1e3*Pt(e));I[r>>2]=t.getSeconds(),I[r+4>>2]=t.getMinutes(),I[r+8>>2]=t.getHours(),I[r+12>>2]=t.getDate(),I[r+16>>2]=t.getMonth(),I[r+20>>2]=t.getFullYear()-1900,I[r+24>>2]=t.getDay();var n=0|At(t);I[r+28>>2]=n,I[r+36>>2]=-60*t.getTimezoneOffset();var o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=0|(a!=i&&t.getTimezoneOffset()==Math.min(i,a));I[r+32>>2]=s},_mktime_js:function(e){var r=new Date(I[e+20>>2]+1900,I[e+16>>2],I[e+12>>2],I[e+8>>2],I[e+4>>2],I[e>>2],0),t=I[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)I[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var u=Math.max(i,a),c=t>0?s:u;r.setTime(r.getTime()+6e4*(c-n))}I[e+24>>2]=r.getDay();var l=0|At(r);return I[e+28>>2]=l,I[e>>2]=r.getSeconds(),I[e+4>>2]=r.getMinutes(),I[e+8>>2]=r.getHours(),I[e+12>>2]=r.getDate(),I[e+16>>2]=r.getMonth(),I[e+20>>2]=r.getYear(),r.getTime()/1e3|0},_mmap_js:function(e,r,t,n,o,a,i){try{var s=Re.getStreamFromFD(n),u=Oe.mmap(s,e,o,r,t),c=u.ptr;return I[a>>2]=u.allocated,N[i>>2]=c,0}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},_munmap_js:function(e,r,t,n,o,a){try{var i=Re.getStreamFromFD(o);2&t&&Re.doMsync(e,i,r,n,a),Oe.munmap(i)}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return-e.errno}},_tzset_js:function(e,r,t){var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}N[e>>2]=60*u,I[r>>2]=Number(i!=s);var l=c(o),d=c(a),f=Dt(l),m=Dt(d);s>2]=f,N[t+4>>2]=m):(N[t>>2]=m,N[t+4>>2]=f)},abort:function(){de("native code called abort()")},emscripten_asm_const_int:function(e,r,t){return Mt(e,r,t)},emscripten_date_now:function(){return Date.now()},emscripten_get_heap_max:function(){return 2147483648},emscripten_get_now:_e,emscripten_memcpy_big:function(e,r,t){M.copyWithin(e,r,r+t)},emscripten_pc_get_function:function(e){de("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER")},emscripten_resize_heap:function(e){var r=M.length;A((e>>>=0)>r);var t,n,o=2147483648;if(e>o)return E("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+o+" bytes!"),!1;for(var a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(o,(t=Math.max(e,i))+((n=65536)-t%n)%n);if(Ot(s))return!0}return E("Failed to grow the heap from "+r+" bytes to "+s+" bytes, not enough memory!"),!1},emscripten_stack_snapshot:function(){var e=jt().split("\n");return"Error"==e[0]&&e.shift(),Nt(e),It.last_addr=Rt(e[3]),It.last_stack=e,It.last_addr},emscripten_stack_unwind_buffer:function(e,r,t){var n;It.last_addr==e?n=It.last_stack:("Error"==(n=jt().split("\n"))[0]&&n.shift(),Nt(n));for(var o=3;n[o]&&Rt(n[o])!=e;)++o;for(var a=0;a>2]=Rt(n[a+o]);return a},emscripten_webgl_create_context:Wt,emscripten_webgl_destroy_context:function(e){Ut.currentContext==e&&(Ut.currentContext=0),Ut.deleteContext(e)},emscripten_webgl_get_context_attributes:function(e,r){if(!r)return-5;if(!(e=Ut.contexts[e]))return-3;var t=e.GLctx;if(!t)return-3;t=t.getContextAttributes(),I[r>>2]=t.alpha,I[r+4>>2]=t.depth,I[r+8>>2]=t.stencil,I[r+12>>2]=t.antialias,I[r+16>>2]=t.premultipliedAlpha,I[r+20>>2]=t.preserveDrawingBuffer;var n=t.powerPreference&&$t.indexOf(t.powerPreference);return I[r+24>>2]=n,I[r+28>>2]=t.failIfMajorPerformanceCaveat,I[r+32>>2]=e.version,I[r+36>>2]=0,I[r+40>>2]=e.attributes.enableExtensionsByDefault,0},emscripten_webgl_get_current_context:Ht,emscripten_webgl_init_context_attributes:function(e){A(e);for(var r=e>>2,t=0;t<14;++t)I[r+t]=0;I[r+0]=I[r+1]=I[r+3]=I[r+4]=I[r+8]=I[r+10]=1},emscripten_webgl_make_context_current:function(e){return Ut.makeContextCurrent(e)?0:-5},emscripten_webgpu_export_bind_group_layout:function(e){return Yt.add(qt.mgrBindGroupLayout.get(e))},emscripten_webgpu_export_device:function(e){return Yt.add(qt.mgrDevice.get(e))},emscripten_webgpu_export_sampler:function(e){return Yt.add(qt.mgrSampler.get(e))},emscripten_webgpu_export_texture:function(e){return Yt.add(qt.mgrTexture.get(e))},emscripten_webgpu_get_device:function(){if(A(o.preinitializedWebGPUDevice),void 0===qt.preinitializedDeviceId){var e=o.preinitializedWebGPUDevice,r={queueId:qt.mgrQueue.create(e.queue)};qt.preinitializedDeviceId=qt.mgrDevice.create(e,r)}return qt.mgrDevice.reference(qt.preinitializedDeviceId),qt.preinitializedDeviceId},emscripten_webgpu_import_bind_group:function(e){return qt.mgrBindGroup.create(Yt.get(e))},emscripten_webgpu_import_texture:function(e){return qt.mgrTexture.create(Yt.get(e))},emscripten_webgpu_release_js_handle:function(e){Yt.remove(e)},environ_get:function(e,r){var t=0;return Qt().forEach((function(n,o){var a=r+t;N[e+4*o>>2]=a,function(e,r,t){for(var n=0;n>0]=e.charCodeAt(n);t||(B[r>>0]=0)}(n,a),t+=n.length+1})),0},environ_sizes_get:function(e,r){var t=Qt();N[e>>2]=t.length;var n=0;return t.forEach((function(e){n+=e.length+1})),N[r>>2]=n,0},exit:Ne,fd_close:function(e){try{var r=Re.getStreamFromFD(e);return Oe.close(r),0}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return e.errno}},fd_read:function(e,r,t,n){try{var o=function(e,r,t,n){for(var o=0,a=0;a>2],s=N[r+4>>2];r+=8;var u=Oe.read(e,B,i,s,n);if(u<0)return-1;if(o+=u,u>2]=o,0}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return e.errno}},fd_seek:function(e,r,t,n,o){try{var a=(u=t,A((s=r)==s>>>0||s==(0|s)),A(u===(0|u)),u+2097152>>>0<4194305-!!s?(s>>>0)+4294967296*u:NaN);if(isNaN(a))return 61;var i=Re.getStreamFromFD(e);return Oe.llseek(i,a,n),ge=[i.position>>>0,(pe=i.position,+Math.abs(pe)>=1?pe>0?(0|Math.min(+Math.floor(pe/4294967296),4294967295))>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],I[o>>2]=ge[0],I[o+4>>2]=ge[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return e.errno}var s,u},fd_write:function(e,r,t,n){try{var o=function(e,r,t,n){for(var o=0,a=0;a>2],s=N[r+4>>2];r+=8;var u=Oe.write(e,B,i,s,n);if(u<0)return-1;o+=u}return o}(Re.getStreamFromFD(e),r,t);return N[n>>2]=o,0}catch(e){if(void 0===Oe||!(e instanceof Oe.ErrnoError))throw e;return e.errno}},getentropy:function e(r,t){e.randomDevice||(e.randomDevice=Se());for(var n=0;n>0]=e.randomDevice();return 0},glActiveTexture:function(e){fn.activeTexture(e)},glAttachShader:function(e,r){fn.attachShader(Ut.programs[e],Ut.shaders[r])},glBindAttribLocation:function(e,r,t){fn.bindAttribLocation(Ut.programs[e],r,z(t))},glBindBuffer:function(e,r){34962==e?fn.currentArrayBufferBinding=r:34963==e&&(fn.currentElementArrayBufferBinding=r),35051==e?fn.currentPixelPackBufferBinding=r:35052==e&&(fn.currentPixelUnpackBufferBinding=r),fn.bindBuffer(e,Ut.buffers[r])},glBindBufferBase:function(e,r,t){fn.bindBufferBase(e,r,Ut.buffers[t])},glBindFramebuffer:function(e,r){fn.bindFramebuffer(e,r?Ut.framebuffers[r]:Ut.currentContext.defaultFbo)},glBindTexture:function(e,r){fn.bindTexture(e,Ut.textures[r])},glBindVertexArray:function(e){fn.bindVertexArray(Ut.vaos[e]);var r=fn.getParameter(34965);fn.currentElementArrayBufferBinding=r?0|r.name:0},glBufferData:function(e,r,t,n){Ut.currentContext.version>=2?t&&r?fn.bufferData(e,M,n,t,r):fn.bufferData(e,r,n):fn.bufferData(e,t?M.subarray(t,t+r):r,n)},glClientWaitSync:function(e,r,t,n){return fn.clientWaitSync(Ut.syncs[e],r,(o=t,A((a=n)===(0|a)),(o>>>0)+4294967296*a));var o,a},glCompileShader:function(e){fn.compileShader(Ut.shaders[e])},glCreateProgram:function(){var e=Ut.getNewId(Ut.programs),r=fn.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,Ut.programs[e]=r,e},glCreateShader:function(e){var r=Ut.getNewId(Ut.shaders);return Ut.shaders[r]=fn.createShader(e),r},glDeleteBuffers:function(e,r){for(var t=0;t>2],o=Ut.buffers[n];o&&(fn.deleteBuffer(o),o.name=0,Ut.buffers[n]=null,n==fn.currentArrayBufferBinding&&(fn.currentArrayBufferBinding=0),n==fn.currentElementArrayBufferBinding&&(fn.currentElementArrayBufferBinding=0),n==fn.currentPixelPackBufferBinding&&(fn.currentPixelPackBufferBinding=0),n==fn.currentPixelUnpackBufferBinding&&(fn.currentPixelUnpackBufferBinding=0))}},glDeleteFramebuffers:function(e,r){for(var t=0;t>2],o=Ut.framebuffers[n];o&&(fn.deleteFramebuffer(o),o.name=0,Ut.framebuffers[n]=null)}},glDeleteProgram:function(e){if(e){var r=Ut.programs[e];r?(fn.deleteProgram(r),r.name=0,Ut.programs[e]=null):Ut.recordError(1281)}},glDeleteShader:function(e){if(e){var r=Ut.shaders[e];r?(fn.deleteShader(r),Ut.shaders[e]=null):Ut.recordError(1281)}},glDeleteSync:function(e){if(e){var r=Ut.syncs[e];r?(fn.deleteSync(r),r.name=0,Ut.syncs[e]=null):Ut.recordError(1281)}},glDeleteTextures:function(e,r){for(var t=0;t>2],o=Ut.textures[n];o&&(fn.deleteTexture(o),o.name=0,Ut.textures[n]=null)}},glDeleteVertexArrays:function(e,r){for(var t=0;t>2];fn.deleteVertexArray(Ut.vaos[n]),Ut.vaos[n]=null}},glDisable:function(e){fn.disable(e)},glDisableVertexAttribArray:function(e){Ut.currentContext.clientBuffers[e].enabled=!1,fn.disableVertexAttribArray(e)},glDrawArrays:function(e,r,t){Ut.preDrawHandleClientVertexAttribBindings(r+t),fn.drawArrays(e,r,t),Ut.postDrawHandleClientVertexAttribBindings()},glDrawBuffers:function(e,r){for(var t=Kt[e],n=0;n>2];fn.drawBuffers(t)},glEnableVertexAttribArray:function(e){Ut.currentContext.clientBuffers[e].enabled=!0,fn.enableVertexAttribArray(e)},glFenceSync:function(e,r){var t=fn.fenceSync(e,r);if(t){var n=Ut.getNewId(Ut.syncs);return t.name=n,Ut.syncs[n]=t,n}return 0},glFinish:function(){fn.finish()},glFlush:function(){fn.flush()},glFramebufferTexture2D:function(e,r,t,n,o){fn.framebufferTexture2D(e,r,t,Ut.textures[n],o)},glFramebufferTextureLayer:function(e,r,t,n,o){fn.framebufferTextureLayer(e,r,Ut.textures[t],n,o)},glGenBuffers:function(e,r){Jt(e,r,"createBuffer",Ut.buffers)},glGenFramebuffers:function(e,r){Jt(e,r,"createFramebuffer",Ut.framebuffers)},glGenTextures:function(e,r){Jt(e,r,"createTexture",Ut.textures)},glGenVertexArrays:function(e,r){Jt(e,r,"createVertexArray",Ut.vaos)},glGetAttribLocation:function(e,r){return fn.getAttribLocation(Ut.programs[e],z(r))},glGetError:function(){var e=fn.getError()||Ut.lastError;return Ut.lastError=0,e},glGetIntegerv:function(e,r){!function(e,r,t){if(r){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=t&&1!=t&&Ut.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=fn.getParameter(34467);n=o?o.length:0;break;case 33309:if(Ut.currentContext.version<2)return void Ut.recordError(1282);n=2*(fn.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(Ut.currentContext.version<2)return void Ut.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=fn.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void Ut.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Ut.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i>2]=a[i];break;case 2:j[r+4*i>>2]=a[i];break;case 4:B[r+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(r){return Ut.recordError(1280),void E("GL_INVALID_ENUM in glGet"+t+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+r+")")}}break;default:return Ut.recordError(1280),void E("GL_INVALID_ENUM in glGet"+t+"v: Native code calling glGet"+t+"v("+e+") and it returns "+a+" of type "+typeof a+"!")}}switch(t){case 1:Zt(r,n);break;case 0:I[r>>2]=n;break;case 2:j[r>>2]=n;break;case 4:B[r>>0]=n?1:0}}else Ut.recordError(1281)}(e,r,0)},glGetProgramiv:function(e,r,t){if(t)if(e>=Ut.counter)Ut.recordError(1281);else if(e=Ut.programs[e],35716==r){var n=fn.getProgramInfoLog(e);null===n&&(n="(unknown error)"),I[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=0;o>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength)for(o=0;o>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength)for(o=0;o>2]=e.maxUniformBlockNameLength}else I[t>>2]=fn.getProgramParameter(e,r);else Ut.recordError(1281)},glGetShaderInfoLog:function(e,r,t,n){var o=fn.getShaderInfoLog(Ut.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?W(o,n,r):0;t&&(I[t>>2]=a)},glGetShaderiv:function(e,r,t){if(t)if(35716==r){var n=fn.getShaderInfoLog(Ut.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;I[t>>2]=o}else if(35720==r){var a=fn.getShaderSource(Ut.shaders[e]),i=a?a.length+1:0;I[t>>2]=i}else I[t>>2]=fn.getShaderParameter(Ut.shaders[e],r);else Ut.recordError(1281)},glGetString:function(e){var r=Ut.stringCache[e];if(!r){switch(e){case 7939:var t=fn.getSupportedExtensions()||[];r=en((t=t.concat(t.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=fn.getParameter(e);n||Ut.recordError(1280),r=n&&en(n);break;case 7938:var o=fn.getParameter(7938);r=en(o=Ut.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")");break;case 35724:var a=fn.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),r=en(a);break;default:Ut.recordError(1280)}Ut.stringCache[e]=r}return r},glGetUniformBlockIndex:function(e,r){return fn.getUniformBlockIndex(Ut.programs[e],z(r))},glGetUniformLocation:function(e,r){if(r=z(r),e=Ut.programs[e]){!function(e){var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},r=0;r0?i.slice(0,u):i,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],t=0;t0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n=2)if(fn.currentPixelPackBufferBinding)fn.readPixels(e,r,t,n,o,a,i);else{var s=tn(a);fn.readPixels(e,r,t,n,o,a,s,i>>nn(s))}else{var u=on(a,o,t,n,i);u?fn.readPixels(e,r,t,n,o,a,u):Ut.recordError(1280)}},glShaderSource:function(e,r,t,n){var o=Ut.getSource(e,r,t,n);fn.shaderSource(Ut.shaders[e],o)},glTexImage2D:function(e,r,t,n,o,a,i,s,u){if(Ut.currentContext.version>=2)if(fn.currentPixelUnpackBufferBinding)fn.texImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=tn(s);fn.texImage2D(e,r,t,n,o,a,i,s,c,u>>nn(c))}else fn.texImage2D(e,r,t,n,o,a,i,s,null);else fn.texImage2D(e,r,t,n,o,a,i,s,u?on(s,i,n,o,u):null)},glTexParameterfv:function(e,r,t){var n=j[t>>2];fn.texParameterf(e,r,n)},glTexParameteri:function(e,r,t){fn.texParameteri(e,r,t)},glTexStorage2D:function(e,r,t,n,o){fn.texStorage2D(e,r,t,n,o)},glTexStorage3D:function(e,r,t,n,o,a){fn.texStorage3D(e,r,t,n,o,a)},glTexSubImage2D:function(e,r,t,n,o,a,i,s,u){if(Ut.currentContext.version>=2)if(fn.currentPixelUnpackBufferBinding)fn.texSubImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=tn(s);fn.texSubImage2D(e,r,t,n,o,a,i,s,c,u>>nn(c))}else fn.texSubImage2D(e,r,t,n,o,a,i,s,null);else{var l=null;u&&(l=on(s,i,o,a,u)),fn.texSubImage2D(e,r,t,n,o,a,i,s,l)}},glTexSubImage3D:function(e,r,t,n,o,a,i,s,u,c,l){if(fn.currentPixelUnpackBufferBinding)fn.texSubImage3D(e,r,t,n,o,a,i,s,u,c,l);else if(l){var d=tn(c);fn.texSubImage3D(e,r,t,n,o,a,i,s,u,c,d,l>>nn(d))}else fn.texSubImage3D(e,r,t,n,o,a,i,s,u,c,null)},glUniform1f:function(e,r){fn.uniform1f(an(e),r)},glUniform1i:function(e,r){fn.uniform1i(an(e),r)},glUniform2fv:function(e,r,t){if(Ut.currentContext.version>=2)r&&fn.uniform2fv(an(e),j,t>>2,2*r);else{if(r<=144)for(var n=sn[2*r-1],o=0;o<2*r;o+=2)n[o]=j[t+4*o>>2],n[o+1]=j[t+(4*o+4)>>2];else n=j.subarray(t>>2,t+8*r>>2);fn.uniform2fv(an(e),n)}},glUniform4fv:function(e,r,t){if(Ut.currentContext.version>=2)r&&fn.uniform4fv(an(e),j,t>>2,4*r);else{if(r<=72){var n=sn[4*r-1],o=j;t>>=2;for(var a=0;a<4*r;a+=4){var i=t+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=j.subarray(t>>2,t+16*r>>2);fn.uniform4fv(an(e),n)}},glUniform4iv:function(e,r,t){if(Ut.currentContext.version>=2)r&&fn.uniform4iv(an(e),I,t>>2,4*r);else{if(r<=72)for(var n=un[4*r-1],o=0;o<4*r;o+=4)n[o]=I[t+4*o>>2],n[o+1]=I[t+(4*o+4)>>2],n[o+2]=I[t+(4*o+8)>>2],n[o+3]=I[t+(4*o+12)>>2];else n=I.subarray(t>>2,t+16*r>>2);fn.uniform4iv(an(e),n)}},glUniformBlockBinding:function(e,r,t){e=Ut.programs[e],fn.uniformBlockBinding(e,r,t)},glUniformMatrix4fv:function(e,r,t,n){if(Ut.currentContext.version>=2)r&&fn.uniformMatrix4fv(an(e),!!t,j,n>>2,16*r);else{if(r<=18){var o=sn[16*r-1],a=j;n>>=2;for(var i=0;i<16*r;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=j.subarray(n>>2,n+64*r>>2);fn.uniformMatrix4fv(an(e),!!t,o)}},glUseProgram:function(e){e=Ut.programs[e],fn.useProgram(e),fn.currentProgram=e},glVertexAttribPointer:function(e,r,t,n,o,a){var i=Ut.currentContext.clientBuffers[e];if(!fn.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,fn.vertexAttribPointer(e,r,t,!!n,o,a)},glViewport:function(e,r,t,n){fn.viewport(e,r,t,n)},mediapipe_create_utility_canvas2d:function(){const e=document.createElement("canvas");return e.style.display="none",e.id="canvas_2d",document.body.appendChild(e),or.toHandle(e)},mediapipe_find_canvas_event_target:function(e){return or.toHandle(Gt(e))},mediapipe_import_external_texture:function(e,r){const t=qt.mgrDevice.get(e),n=or.toValue(r),o=t.importExternalTexture({source:n});return or.toHandle(o)},mediapipe_webgl_tex_image_drawable:function(e){const r=or.toValue(e);fn.texImage2D(fn.TEXTURE_2D,0,fn.RGBA,fn.RGBA,fn.UNSIGNED_BYTE,r)},proc_exit:Ie,strftime:dn,strftime_l:function(e,r,t,n,o){return dn(e,r,t,n)},wgpuBindGroupLayoutRelease:function(e){qt.mgrBindGroupLayout.release(e)},wgpuBindGroupRelease:function(e){qt.mgrBindGroup.release(e)},wgpuBufferGetMappedRange:function(e,r,t){var n,o=qt.mgrBuffer.objects[e];if(A(void 0!==o),0===t&&Ve("getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE"),4294967295===(t>>>=0)&&(t=void 0),2!==o.mapMode)return de("GetMappedRange called, but buffer not mapped for writing"),0;try{n=o.object.getMappedRange(r,t)}catch(e){return E("wgpuBufferGetMappedRange("+r+", "+t+") failed: "+e),0}var a=En(n.byteLength);return M.fill(0,a,n.byteLength),o.onUnmap.push((function(){new Uint8Array(n).set(M.subarray(a,a+n.byteLength)),xn(a)})),a},wgpuBufferReference:function(e){qt.mgrBuffer.reference(e)},wgpuBufferRelease:function(e){qt.mgrBuffer.release(e)},wgpuBufferUnmap:function(e){var r=qt.mgrBuffer.objects[e];if(A(void 0!==r),r.onUnmap){for(var t=0;t>2]),queryIndex:N[e+4>>2],location:qt.ComputePassTimestampLocation[N[e+8>>2]]}}if(r){A(r),A(0===N[r>>2]),t={};var o=N[r+4>>2];o&&(t.label=z(o));var a=N[r+8>>2];a&&(t.timestampWrites=function(e,r){for(var t=[],o=0;o>2]))}var i=qt.mgrCommandEncoder.get(e);return qt.mgrComputePassEncoder.create(i.beginComputePass(t))},wgpuCommandEncoderBeginRenderPass:function(e,r){function t(e){var r=N[e>>2];if(0!==r){var t=N[e+8>>2];A(0!==t);var n=N[e+12>>2];A(0!==n);var o=qt.makeColor(e+16);return{view:qt.mgrTextureView.get(r),resolveTarget:qt.mgrTextureView.get(N[e+4>>2]),clearValue:o,loadOp:qt.LoadOp[t],storeOp:qt.StoreOp[n]}}}function n(e,r){for(var n=[],o=0;o>2]),depthClearValue:j[e+12>>2],depthLoadOp:qt.LoadOp[N[e+4>>2]],depthStoreOp:qt.StoreOp[N[e+8>>2]],depthReadOnly:0!==B[e+16>>0],stencilClearValue:N[e+28>>2],stencilLoadOp:qt.LoadOp[N[e+20>>2]],stencilStoreOp:qt.StoreOp[N[e+24>>2]],stencilReadOnly:0!==B[e+32>>0]}}function a(e){return{querySet:qt.mgrQuerySet.get(N[e>>2]),queryIndex:N[e+4>>2],location:qt.RenderPassTimestampLocation[N[e+8>>2]]}}A(r);var i=function(e){A(e);var r=N[e>>2],t=void 0;if(0!==r){A(15===N[r+4>>2]),A(0===N[r>>2]);var i=r;A(i),A(0===N[i>>2]),t=4294967296*N[i+4+8>>2]+N[i+8>>2]}var s={label:void 0,colorAttachments:n(N[e+8>>2],N[e+12>>2]),depthStencilAttachment:o(N[e+16>>2]),occlusionQuerySet:qt.mgrQuerySet.get(N[e+20>>2]),maxDrawCount:t},u=N[e+4>>2];u&&(s.label=z(u));var c=N[e+24>>2];return c&&(s.timestampWrites=function(e,r){for(var t=[],n=0;n>2])),s}(r),s=qt.mgrCommandEncoder.get(e);return qt.mgrRenderPassEncoder.create(s.beginRenderPass(i))},wgpuCommandEncoderCopyBufferToTexture:function(e,r,t,n){var o=qt.mgrCommandEncoder.get(e),a=qt.makeExtent3D(n);o.copyBufferToTexture(qt.makeImageCopyBuffer(r),qt.makeImageCopyTexture(t),a)},wgpuCommandEncoderCopyTextureToTexture:function(e,r,t,n){var o=qt.mgrCommandEncoder.get(e),a=qt.makeExtent3D(n);o.copyTextureToTexture(qt.makeImageCopyTexture(r),qt.makeImageCopyTexture(t),a)},wgpuCommandEncoderFinish:function(e){var r=qt.mgrCommandEncoder.get(e);return qt.mgrCommandBuffer.create(r.finish())},wgpuCommandEncoderRelease:function(e){qt.mgrCommandEncoder.release(e)},wgpuComputePassEncoderDispatchWorkgroups:function(e,r,t,n){var o=qt.mgrComputePassEncoder.get(e);o.dispatchWorkgroups?o.dispatchWorkgroups(r,t,n):o.dispatch(r,t,n)},wgpuComputePassEncoderEnd:function(e){qt.mgrComputePassEncoder.get(e).end()},wgpuComputePassEncoderRelease:function(e){qt.mgrComputePassEncoder.release(e)},wgpuComputePassEncoderSetBindGroup:function(e,r,t,n,o){var a=qt.mgrComputePassEncoder.get(e),i=qt.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},wgpuComputePassEncoderSetPipeline:function(e,r){var t=qt.mgrComputePassEncoder.get(e),n=qt.mgrComputePipeline.get(r);t.setPipeline(n)},wgpuComputePipelineGetBindGroupLayout:function(e,r){var t=qt.mgrComputePipeline.get(e);return qt.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},wgpuComputePipelineRelease:function(e){qt.mgrComputePipeline.release(e)},wgpuDeviceCreateBindGroup:function(e,r){function t(e){A(e);var r=N[e+8>>2],t=N[e+32>>2],n=N[e+36>>2];A((0!==r)+(0!==t)+(0!==n)===1);var o=N[e+4>>2];if(r){var a=N[e+24>>2],i=N[e+28>>2],s=-1===i&&-1===a?void 0:(A(i<2097152),4294967296*i+a);return{binding:o,resource:{buffer:qt.mgrBuffer.get(r),offset:4294967296*N[e+4+16>>2]+N[e+16>>2],size:s}}}return t?{binding:o,resource:qt.mgrSampler.get(t)}:{binding:o,resource:qt.mgrTextureView.get(n)}}A(r),A(0===N[r>>2]);var n={label:void 0,layout:qt.mgrBindGroupLayout.get(N[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o>2],N[r+16>>2])},o=N[r+4>>2];o&&(n.label=z(o));var a=qt.mgrDevice.get(e);return qt.mgrBindGroup.create(a.createBindGroup(n))},wgpuDeviceCreateBuffer:function(e,r){A(r),A(0===N[r>>2]);var t=0!==B[r+24>>0],n={label:void 0,usage:N[r+8>>2],size:4294967296*N[r+4+16>>2]+N[r+16>>2],mappedAtCreation:t},o=N[r+4>>2];o&&(n.label=z(o));var a=qt.mgrDevice.get(e),i={},s=qt.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},wgpuDeviceCreateCommandEncoder:function(e,r){var t;if(r){A(r),A(0===N[r>>2]),t={label:void 0};var n=N[r+4>>2];n&&(t.label=z(n))}var o=qt.mgrDevice.get(e);return qt.mgrCommandEncoder.create(o.createCommandEncoder(t))},wgpuDeviceCreateComputePipeline:function(e,r){A(r),A(0===N[r>>2]);var t={label:void 0,layout:qt.mgrPipelineLayout.get(N[r+8>>2]),compute:qt.makeProgrammableStageDescriptor(r+12)},n=N[r+4>>2];n&&(t.label=z(n));var o=qt.mgrDevice.get(e);return qt.mgrComputePipeline.create(o.createComputePipeline(t))},wgpuDeviceCreateRenderPipeline:function(e,r){function t(e){if(e)return{operation:qt.BlendOperation[N[e>>2]],srcFactor:qt.BlendFactor[N[e+4>>2]],dstFactor:qt.BlendFactor[N[e+8>>2]]}}function n(e){if(e)return A(e),A(0===N[e>>2]),{alpha:t(e+12),color:t(e+0)}}function o(e){A(e),A(0===N[e>>2]);var r=N[e+4>>2];return 0===r?void 0:{format:qt.TextureFormat[r],blend:n(N[e+8>>2]),writeMask:N[e+12>>2]}}function a(e,r){for(var t=[],n=0;n>2]],failOp:qt.StencilOperation[N[e+4>>2]],depthFailOp:qt.StencilOperation[N[e+8>>2]],passOp:qt.StencilOperation[N[e+12>>2]]}}function s(e,r){for(var t,n=[],o=0;o>2]],offset:4294967296*N[t+4+8>>2]+N[t+8>>2],shaderLocation:N[t+16>>2]}));return n}function u(e){if(e){var r=N[e+8>>2];return 2===r?null:{arrayStride:4294967296*N[e+4>>2]+N[e>>2],stepMode:qt.VertexStepMode[r],attributes:s(N[e+12>>2],N[e+16>>2])}}}function c(e,r){if(e){for(var t=[],n=0;n>2]);var l={label:void 0,layout:qt.mgrPipelineLayout.get(N[r+8>>2]),vertex:function(e){if(e)return A(e),A(0===N[e>>2]),{module:qt.mgrShaderModule.get(N[e+4>>2]),entryPoint:z(N[e+8>>2]),constants:qt.makePipelineConstants(N[e+12>>2],N[e+16>>2]),buffers:c(N[e+20>>2],N[e+24>>2])}}(r+12),primitive:function(e){if(e)return A(e),A(0===N[e>>2]),{topology:qt.PrimitiveTopology[N[e+4>>2]],stripIndexFormat:qt.IndexFormat[N[e+8>>2]],frontFace:qt.FrontFace[N[e+12>>2]],cullMode:qt.CullMode[N[e+16>>2]]}}(r+40),depthStencil:function(e){if(e)return A(e),{format:qt.TextureFormat[N[e+4>>2]],depthWriteEnabled:0!==B[e+8>>0],depthCompare:qt.CompareFunction[N[e+12>>2]],stencilFront:i(e+16),stencilBack:i(e+32),stencilReadMask:N[e+48>>2],stencilWriteMask:N[e+52>>2],depthBias:N[e+56>>2],depthBiasSlopeScale:j[e+60>>2],depthBiasClamp:j[e+64>>2]}}(N[r+60>>2]),multisample:function(e){if(e)return A(e),A(0===N[e>>2]),{count:N[e+4>>2],mask:N[e+8>>2],alphaToCoverageEnabled:0!==B[e+12>>0]}}(r+64),fragment:function(e){if(e)return A(e),A(0===N[e>>2]),{module:qt.mgrShaderModule.get(N[e+4>>2]),entryPoint:z(N[e+8>>2]),constants:qt.makePipelineConstants(N[e+12>>2],N[e+16>>2]),targets:a(N[e+20>>2],N[e+24>>2])}}(N[r+80>>2])},d=N[r+4>>2];d&&(l.label=z(d));var f=qt.mgrDevice.get(e);return qt.mgrRenderPipeline.create(f.createRenderPipeline(l))},wgpuDeviceCreateSampler:function(e,r){A(r),A(0===N[r>>2]);var t={label:void 0,addressModeU:qt.AddressMode[N[r+8>>2]],addressModeV:qt.AddressMode[N[r+12>>2]],addressModeW:qt.AddressMode[N[r+16>>2]],magFilter:qt.FilterMode[N[r+20>>2]],minFilter:qt.FilterMode[N[r+24>>2]],mipmapFilter:qt.FilterMode[N[r+28>>2]],lodMinClamp:j[r+32>>2],lodMaxClamp:j[r+36>>2],compare:qt.CompareFunction[N[r+40>>2]]},n=N[r+4>>2];n&&(t.label=z(n));var o=qt.mgrDevice.get(e);return qt.mgrSampler.create(o.createSampler(t))},wgpuDeviceCreateShaderModule:function(e,r){A(r);var t=N[r>>2];A(0!==t);var n=N[t+4>>2],o={label:void 0,code:""},a=N[r+4>>2];switch(a&&(o.label=z(a)),n){case 5:var i=N[t+8>>2],s=N[t+12>>2];o.code=N.subarray(s>>2,(s>>2)+i);break;case 6:var u=N[t+8>>2];u&&(o.code=z(u));break;default:de("unrecognized ShaderModule sType")}var c=qt.mgrDevice.get(e);return qt.mgrShaderModule.create(c.createShaderModule(o))},wgpuDeviceCreateTexture:function(e,r){A(r),A(0===N[r>>2]);var t={label:void 0,size:qt.makeExtent3D(r+16),mipLevelCount:N[r+32>>2],sampleCount:N[r+36>>2],dimension:qt.TextureDimension[N[r+12>>2]],format:qt.TextureFormat[N[r+28>>2]],usage:N[r+8>>2]},n=N[r+4>>2];n&&(t.label=z(n));var o=N[r+40>>2];if(o){var a=N[r+44>>2];t.viewFormats=Array.from(I.subarray(a>>2,(a>>2)+o),(function(e){return qt.TextureFormat[e]}))}var i=qt.mgrDevice.get(e);return qt.mgrTexture.create(i.createTexture(t))},wgpuDeviceGetQueue:function(e){var r=qt.mgrDevice.objects[e].queueId;return A(r,"wgpuDeviceGetQueue: queue was missing or null"),qt.mgrQueue.reference(r),r},wgpuDeviceReference:function(e){qt.mgrDevice.reference(e)},wgpuDeviceRelease:function(e){qt.mgrDevice.release(e)},wgpuPipelineLayoutRelease:function(e){qt.mgrPipelineLayout.release(e)},wgpuQuerySetRelease:function(e){qt.mgrQuerySet.release(e)},wgpuQueueRelease:function(e){qt.mgrQueue.release(e)},wgpuQueueSubmit:function(e,r,t){A(t%4==0);var n=qt.mgrQueue.get(e),o=Array.from(I.subarray(t>>2,(t>>2)+r),(function(e){return qt.mgrCommandBuffer.get(e)}));n.submit(o)},wgpuQueueWriteBuffer:function(e,r,t,n,o,a){var i=qt.mgrQueue.get(e),s=qt.mgrBuffer.get(r),u=(A(n<2097152),4294967296*n+t),c=M.subarray(o,o+a);i.writeBuffer(s,u,c,0,a)},wgpuRenderPassEncoderDraw:function(e,r,t,n,o){qt.mgrRenderPassEncoder.get(e).draw(r,t,n,o)},wgpuRenderPassEncoderEnd:function(e){qt.mgrRenderPassEncoder.get(e).end()},wgpuRenderPassEncoderRelease:function(e){qt.mgrRenderPassEncoder.release(e)},wgpuRenderPassEncoderSetBindGroup:function(e,r,t,n,o){var a=qt.mgrRenderPassEncoder.get(e),i=qt.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},wgpuRenderPassEncoderSetPipeline:function(e,r){var t=qt.mgrRenderPassEncoder.get(e),n=qt.mgrRenderPipeline.get(r);t.setPipeline(n)},wgpuRenderPipelineGetBindGroupLayout:function(e,r){var t=qt.mgrRenderPipeline.get(e);return qt.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},wgpuRenderPipelineRelease:function(e){qt.mgrRenderPipeline.release(e)},wgpuSamplerReference:function(e){qt.mgrSampler.reference(e)},wgpuSamplerRelease:function(e){qt.mgrSampler.release(e)},wgpuShaderModuleReference:function(e){qt.mgrShaderModule.reference(e)},wgpuShaderModuleRelease:function(e){qt.mgrShaderModule.release(e)},wgpuTextureCreateView:function(e,r){var t;if(r){A(r),A(0===N[r>>2]);var n=N[r+20>>2],o=N[r+28>>2];t={format:qt.TextureFormat[N[r+8>>2]],dimension:qt.TextureViewDimension[N[r+12>>2]],baseMipLevel:N[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:N[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:qt.TextureAspect[N[r+32>>2]]};var a=N[r+4>>2];a&&(t.label=z(a))}var i=qt.mgrTexture.get(e);return qt.mgrTextureView.create(i.createView(t))},wgpuTextureDestroy:function(e){qt.mgrTexture.get(e).destroy()},wgpuTextureReference:function(e){qt.mgrTexture.reference(e)},wgpuTextureRelease:function(e){qt.mgrTexture.release(e)},wgpuTextureViewReference:function(e){qt.mgrTextureView.reference(e)},wgpuTextureViewRelease:function(e){qt.mgrTextureView.release(e)}},En=(function(){var e={env:_n,wasi_snapshot_preview1:_n};function r(e,r){var t,n=e.exports;o.asm=n,A(P=o.asm.memory,"memory not found in wasm exports"),q(P.buffer),A(X=o.asm.__indirect_function_table,"table not found in wasm exports"),t=o.asm.__wasm_call_ctors,Z.unshift(t),le("wasm-instantiate")}ce("wasm-instantiate");var t=o;function a(e){A(o===t,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),t=null,r(e.instance)}function i(r){return function(){if(!x&&(c||l)){if("function"==typeof fetch&&!ye(fe))return fetch(fe,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+fe+"'";return e.arrayBuffer()})).catch((function(){return we(fe)}));if(p)return new Promise((function(e,r){p(fe,(function(r){e(new Uint8Array(r))}),r)}))}return Promise.resolve().then((function(){return we(fe)}))}().then((function(r){return WebAssembly.instantiate(r,e)})).then((function(e){return e})).then(r,(function(e){E("failed to asynchronously prepare wasm: "+e),ye(fe)&&E("warning: Loading from a file URI ("+fe+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),de(e)}))}if(o.instantiateWasm)try{return o.instantiateWasm(e,r)}catch(e){E("Module.instantiateWasm callback failed with error: "+e),n(e)}(x||"function"!=typeof WebAssembly.instantiateStreaming||he(fe)||ye(fe)||d||"function"!=typeof fetch?i(a):fetch(fe,{credentials:"same-origin"}).then((function(r){return WebAssembly.instantiateStreaming(r,e).then(a,(function(e){return E("wasm streaming compile failed: "+e),E("falling back to ArrayBuffer instantiation"),i(a)}))}))).catch(n)}(),o.___wasm_call_ctors=be("__wasm_call_ctors"),o._malloc=be("malloc")),xn=o._free=be("free"),Cn=o.___errno_location=be("__errno_location"),Tn=o._fflush=be("fflush"),Sn=o.___getTypeName=be("__getTypeName"),Pn=(o.__embind_initialize_bindings=be("_embind_initialize_bindings"),o.___dl_seterr=be("__dl_seterr"),o._emscripten_builtin_memalign=be("emscripten_builtin_memalign")),kn=o._emscripten_stack_init=function(){return(kn=o._emscripten_stack_init=o.asm.emscripten_stack_init).apply(null,arguments)},Fn=(o._emscripten_stack_get_free=function(){return(o._emscripten_stack_get_free=o.asm.emscripten_stack_get_free).apply(null,arguments)},o._emscripten_stack_get_base=function(){return(o._emscripten_stack_get_base=o.asm.emscripten_stack_get_base).apply(null,arguments)},o._emscripten_stack_get_end=function(){return(Fn=o._emscripten_stack_get_end=o.asm.emscripten_stack_get_end).apply(null,arguments)}),Ln=(o.stackSave=be("stackSave"),o.stackRestore=be("stackRestore"),o.stackAlloc=be("stackAlloc"),o._emscripten_stack_get_current=function(){return(Ln=o._emscripten_stack_get_current=o.asm.emscripten_stack_get_current).apply(null,arguments)}),An=o.___cxa_is_pointer_type=be("__cxa_is_pointer_type");o.dynCall_jii=be("dynCall_jii"),o.dynCall_iiiijij=be("dynCall_iiiijij"),o.dynCall_ji=be("dynCall_ji"),o.dynCall_viji=be("dynCall_viji"),o.dynCall_jjj=be("dynCall_jjj"),o.dynCall_jiii=be("dynCall_jiii"),o.dynCall_iiiijj=be("dynCall_iiiijj"),o.dynCall_viijj=be("dynCall_viijj"),o.dynCall_viiijjj=be("dynCall_viiijjj"),o.dynCall_vij=be("dynCall_vij"),o.dynCall_viijii=be("dynCall_viijii"),o.dynCall_vijjj=be("dynCall_vijjj"),o.dynCall_vj=be("dynCall_vj"),o.dynCall_viij=be("dynCall_viij"),o.dynCall_viiiiij=be("dynCall_viiiiij"),o.dynCall_iijjiiii=be("dynCall_iijjiiii"),o.dynCall_jiji=be("dynCall_jiji"),o.dynCall_iiiiij=be("dynCall_iiiiij"),o.dynCall_iiiiijj=be("dynCall_iiiiijj"),o.dynCall_iiiiiijj=be("dynCall_iiiiiijj"),o.___start_em_js=515059,o.___stop_em_js=515579;o.addRunDependency=ce,o.removeRunDependency=le,o.FS_createPath=Oe.createPath,o.FS_createDataFile=Oe.createDataFile,o.FS_createPreloadedFile=Oe.createPreloadedFile,o.FS_createLazyFile=Oe.createLazyFile,o.FS_createDevice=Oe.createDevice,o.FS_unlink=Oe.unlink,o.GL=Ut;["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","out","err","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readEmAsmArgsArray","readEmAsmArgs","runEmAsmFunction","runMainThreadEmAsm","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","doReadv","doWritev","dlopenMissingError","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","emscriptenWebGLGetBufferBinding","emscriptenWebGLValidateMapBufferTarget","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","emscriptenWebGLGetIndexed","WebGPU","JsValStore","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(e){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get:function(){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";S(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),de(r)}})}));var Dn;function Bn(){var e;kn(),A(0==(3&(e=Fn()))),0==e&&(e+=4),N[e>>2]=34821223,N[e+4>>2]=2310721022,N[0]=1668509029}function Mn(e){function r(){Dn||(Dn=!0,o.calledRun=!0,L||(A(!te),te=!0,K(),o.noFSInit||Oe.init.initialized||Oe.init(),Oe.ignorePermissions=!1,Fe.init(),ze(Z),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),A(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(K(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),re.unshift(e);var e;ze(re)}()))}e=e||i,oe>0||(Bn(),function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),J.unshift(e);var e;ze(J)}(),oe>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),r()}),1)):r(),K()))}if(["inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","traverseStack","convertPCtoSourceLocation","runMainThreadEmAsm","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","asmjsMangle","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","stringToAscii","allocateUTF8OnStack","writeStringToMemory","getSocketFromFD","getSocketAddress","registerKeyEventCallback","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","stackTrace","checkWasiClock","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","_setNetworkCallback","emscriptenWebGLGetUniform","emscriptenWebGLGetVertexAttrib","emscriptenWebGLGetBufferBinding","emscriptenWebGLValidateMapBufferTarget","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","emscriptenWebGLGetIndexed","ALLOC_NORMAL","ALLOC_STACK","allocate","enumReadValueFromPointer","craftEmvalAllocator"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get:function(){var r="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",t=e;t.startsWith("_")||(t="$"+e),r+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE="+t+")",S(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Ve(r)}})})),ie=function e(){Dn||Mn(),Dn||(ie=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Mn(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=createMediapipeSolutionsWasm:"function"==typeof define&&define.amd?define([],(function(){return createMediapipeSolutionsWasm})):"object"==typeof exports&&(exports.createMediapipeSolutionsWasm=createMediapipeSolutionsWasm);