@miris-inc/core 0.0.8-9249a0d → 0.0.8-929e9eb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/AquaApi.wasm CHANGED
Binary file
Binary file
package/dist/core.d.ts CHANGED
@@ -115,6 +115,7 @@ declare class Client {
115
115
  getSceneObjectType(...args: ClientMethodParameters["getSceneObjectType"]): SceneObjectType;
116
116
  getStreamStatus(...args: ClientMethodParameters["getStreamStatus"]): StreamStatus;
117
117
  getDrawnOctantMask(...args: ClientMethodParameters["getDrawnOctantMask"]): number;
118
+ getOctantLocalBoundingBoxes(...args: ClientMethodParameters["getOctantLocalBoundingBoxes"]): number[];
118
119
  getLocalTransform(...args: ClientMethodParameters["getLocalTransform"]): AquaStatus;
119
120
  getWorldTransform(...args: ClientMethodParameters["getWorldTransform"]): AquaStatus;
120
121
  hasAttribute(...args: ClientMethodParameters["hasAttribute"]): boolean;
@@ -251,6 +252,7 @@ declare class Engine {
251
252
  deactivatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
252
253
  remaskedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
253
254
  getDrawnOctantMask(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
255
+ getOctantLocalBoundingBoxes(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
254
256
  destroyClient(...args: [handle: AquaClientHandle]): AquaStatus;
255
257
  free(...args: [size: number]): number;
256
258
  getAssetsAsync(...args: [handle: AquaClientHandle, tags: StringVector]): AssetInfo[];
@@ -403,6 +405,8 @@ export declare class Lod {
403
405
  get transform(): Float32Array<ArrayBuffer> | null;
404
406
  get _drawnOctantMask(): number;
405
407
  set _drawnOctantMask(mask: number);
408
+ get _octantLocalBounds(): Float32Array<ArrayBuffer> | null;
409
+ set _octantLocalBounds(bounds: Float32Array<ArrayBuffer> | null);
406
410
  get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
407
411
  get _hasOctantOffsets(): boolean;
408
412
  get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
@@ -471,6 +475,7 @@ declare interface MainModule {
471
475
  remaskedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
472
476
  deletedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
473
477
  GetDrawnOctantMask(handle: number, sceneObjectId: number): number;
478
+ GetOctantLocalBoundingBoxes(handle: number, sceneObjectId: number): number[];
474
479
  GetAssetsAsync(handle: number, tags: StringVector): unknown[];
475
480
  GetSceneChanges(handle: number, sceneChangeIds: SceneChangeIds): void;
476
481
  GetSceneChangesCounts(handle: number, sceneChangeIds: SceneChangeIds): void;
@@ -528,9 +533,9 @@ export declare class Miris {
528
533
  static readonly _XR_TARGET_FRAME_RATE = 43;
529
534
  /* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
530
535
  /* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
531
- static readonly _SHARK_SPLAT_CAPACITY_DESKTOP = 3000000;
536
+ static readonly _SHARK_SPLAT_CAPACITY_DESKTOP: number;
532
537
  /* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
533
- static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2500000;
538
+ static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2400000;
534
539
  /* Excluded from this release type: _isMobileDevice */
535
540
  /* Excluded from this release type: _sharkSplatCapacity */
536
541
  /* Excluded from this release type: _limitSharkSplatCapacity */
package/dist/core.js CHANGED
@@ -60,7 +60,7 @@ var AttributeCache = class {
60
60
  var _factoryPromise;
61
61
  var _wasmPromise;
62
62
  var _wasmUrl = ((u) => u.includes("/.vite/") ? u.replace(/\.vite\/[^?#]*/, () => "@miris-inc/core/dist/AquaApi.wasm") : u)(new URL("AquaApi.wasm", import.meta.url).href);
63
- var _glueSource = "async function vc($t={}){var Ye,l=$t,br=typeof window==\"object\",ge=typeof WorkerGlobalScope<\"u\",Dt=typeof process==\"object\"&&process.versions?.node&&process.type!=\"renderer\",_c=!br&&!Dt&&!ge,Rt=[],kr=\"./this.program\",Er=(e,r)=>{throw r},Mt=import.meta.url,Je=\"\";function It(e){return l.locateFile?l.locateFile(e,Je):Je+e}var Qe,Fe;if(br||ge){try{Je=new URL(\".\",Mt).href}catch{}ge&&(Fe=e=>{var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}),Qe=async e=>{var r=await fetch(e,{credentials:\"same-origin\"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+\" : \"+r.url)}}var we=console.log.bind(console),ee=console.error.bind(console),Se,Pe=!1,Ae;function hc(e,r){e||ce(r)}var mc=e=>e.startsWith(\"file://\"),Cr,Tr,$e,x,N,A,ve,C,m,De,Re,W,Fr,Pr=!1;function Ar(){var e=$e.buffer;l.HEAP8=x=new Int8Array(e),A=new Int16Array(e),l.HEAPU8=N=new Uint8Array(e),ve=new Uint16Array(e),l.HEAP32=C=new Int32Array(e),l.HEAPU32=m=new Uint32Array(e),l.HEAPF32=De=new Float32Array(e),l.HEAPF64=Re=new Float64Array(e),W=new BigInt64Array(e),Fr=new BigUint64Array(e)}function jt(){if(l.preRun)for(typeof l.preRun==\"function\"&&(l.preRun=[l.preRun]);l.preRun.length;)Ht(l.preRun.shift());Dr(Mr)}function Ot(){Pr=!0,!l.noFSInit&&!o.initialized&&o.init(),ae.init(),de.__wasm_call_ctors(),o.ignorePermissions=!1}function Gt(){if(l.postRun)for(typeof l.postRun==\"function\"&&(l.postRun=[l.postRun]);l.postRun.length;)zt(l.postRun.shift());Dr(Rr)}function ce(e){l.onAbort?.(e),e=\"Aborted(\"+e+\")\",ee(e),Pe=!0,e+=\". Build with -sASSERTIONS for more info.\";var r=new WebAssembly.RuntimeError(e);throw Tr?.(r),r}var er;function xt(){return l.locateFile?It(\"AquaApi.wasm\"):new URL(\"AquaApi.wasm\",import.meta.url).href}function Lt(e){if(e==er&&Se)return new Uint8Array(Se);if(Fe)return Fe(e);throw\"both async and sync fetching of the wasm failed\"}async function Nt(e){if(!Se)try{var r=await Qe(e);return new Uint8Array(r)}catch{}return Lt(e)}async function Bt(e,r){try{var t=await Nt(e),n=await WebAssembly.instantiate(t,r);return n}catch(i){ee(`failed to asynchronously prepare wasm: ${i}`),ce(i)}}async function Wt(e,r,t){if(!e)try{var n=fetch(r,{credentials:\"same-origin\"}),i=await WebAssembly.instantiateStreaming(n,t);return i}catch(a){ee(`wasm streaming compile failed: ${a}`),ee(\"falling back to ArrayBuffer instantiation\")}return Bt(r,t)}function Ut(){return{env:At,wasi_snapshot_preview1:At}}async function Vt(){function e(a,s){return de=a.exports,$e=de.memory,Ar(),Yr=de.__indirect_function_table,cs(de),de}function r(a){return e(a.instance)}var t=Ut();if(l.instantiateWasm)return new Promise((a,s)=>{l.instantiateWasm(t,(c,u)=>{a(e(c,u))})});er??=xt();var n=await Wt(Se,er,t),i=r(n);return i}class $r{name=\"ExitStatus\";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var Dr=e=>{for(;e.length>0;)e.shift()(l)},Rr=[],zt=e=>Rr.push(e),Mr=[],Ht=e=>Mr.push(e);function pc(e,r=\"i8\"){switch(r.endsWith(\"*\")&&(r=\"*\"),r){case\"i1\":return x[e];case\"i8\":return x[e];case\"i16\":return A[e>>1];case\"i32\":return C[e>>2];case\"i64\":return W[e>>3];case\"float\":return De[e>>2];case\"double\":return Re[e>>3];case\"*\":return m[e>>2];default:ce(`invalid type for getValue: ${r}`)}}var rr=!0;function yc(e,r,t=\"i8\"){switch(t.endsWith(\"*\")&&(t=\"*\"),t){case\"i1\":x[e]=r;break;case\"i8\":x[e]=r;break;case\"i16\":A[e>>1]=r;break;case\"i32\":C[e>>2]=r;break;case\"i64\":W[e>>3]=BigInt(r);break;case\"float\":De[e>>2]=r;break;case\"double\":Re[e>>3]=r;break;case\"*\":m[e>>2]=r;break;default:ce(`invalid type for setValue: ${t}`)}}var w=e=>bt(e),S=()=>Et(),Me=[],Ie=0,qt=e=>{var r=new tr(e);return r.get_caught()||(r.set_caught(!0),Ie--),r.set_rethrown(!1),Me.push(r),Tt(e),Pt(e)},re=0,Xt=()=>{g(0,0);var e=Me.pop();Ct(e.excPtr),re=0};class tr{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){m[this.ptr+4>>2]=r}get_type(){return m[this.ptr+4>>2]}set_destructor(r){m[this.ptr+8>>2]=r}get_destructor(){return m[this.ptr+8>>2]}set_caught(r){r=r?1:0,x[this.ptr+12]=r}get_caught(){return x[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,x[this.ptr+13]=r}get_rethrown(){return x[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){m[this.ptr+16>>2]=r}get_adjusted_ptr(){return m[this.ptr+16>>2]}}var je=e=>St(e),nr=e=>{var r=re;if(!r)return je(0),0;var t=new tr(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return je(0),r;for(var i of e){if(i===0||i===n)break;var a=t.ptr+16;if(Ft(i,n,a))return je(i),r}return je(n),r},Zt=()=>nr([]),Kt=e=>nr([e]),Yt=(e,r)=>nr([e,r]),Jt=()=>{var e=Me.pop();e||ce(\"no exception to throw\");var r=e.excPtr;throw e.get_rethrown()||(Me.push(e),e.set_rethrown(!0),e.set_caught(!1),Ie++),re=r,re},Qt=(e,r,t)=>{var n=new tr(e);throw n.init(r,t),re=e,Ie++,re},en=()=>Ie,rn=e=>{throw re||(re=e),re},Oe=()=>{var e=C[+R.varargs>>2];return R.varargs+=4,e},_e=Oe,D={isAbs:e=>e.charAt(0)===\"/\",splitPath:e=>{var r=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var i=e[n];i===\".\"?e.splice(n,1):i===\"..\"?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift(\"..\");return e},normalize:e=>{var r=D.isAbs(e),t=e.slice(-1)===\"/\";return e=D.normalizeArray(e.split(\"/\").filter(n=>!!n),!r).join(\"/\"),!e&&!r&&(e=\".\"),e&&t&&(e+=\"/\"),(r?\"/\":\"\")+e},dirname:e=>{var r=D.splitPath(e),t=r[0],n=r[1];return!t&&!n?\".\":(n&&(n=n.slice(0,-1)),t+n)},basename:e=>e&&e.match(/([^\\/]+|\\/)\\/*$/)[1],join:(...e)=>D.normalize(e.join(\"/\")),join2:(e,r)=>D.normalize(e+\"/\"+r)},tn=()=>e=>crypto.getRandomValues(e),ir=e=>{(ir=tn())(e)},he={resolve:(...e)=>{for(var r=\"\",t=!1,n=e.length-1;n>=-1&&!t;n--){var i=n>=0?e[n]:o.cwd();if(typeof i!=\"string\")throw new TypeError(\"Arguments to path.resolve must be strings\");if(!i)return\"\";r=i+\"/\"+r,t=D.isAbs(i)}return r=D.normalizeArray(r.split(\"/\").filter(a=>!!a),!t).join(\"/\"),(t?\"/\":\"\")+r||\".\"},relative:(e,r)=>{e=he.resolve(e).slice(1),r=he.resolve(r).slice(1);function t(f){for(var d=0;d<f.length&&f[d]===\"\";d++);for(var _=f.length-1;_>=0&&f[_]===\"\";_--);return d>_?[]:f.slice(d,_-d+1)}for(var n=t(e.split(\"/\")),i=t(r.split(\"/\")),a=Math.min(n.length,i.length),s=a,c=0;c<a;c++)if(n[c]!==i[c]){s=c;break}for(var u=[],c=s;c<n.length;c++)u.push(\"..\");return u=u.concat(i.slice(s)),u.join(\"/\")}},Ir=typeof TextDecoder<\"u\"?new TextDecoder:void 0,jr=(e,r,t,n)=>{var i=r+t;if(n)return i;for(;e[r]&&!(r>=i);)++r;return r},me=(e,r=0,t,n)=>{var i=jr(e,r,t,n);if(i-r>16&&e.buffer&&Ir)return Ir.decode(e.subarray(r,i));for(var a=\"\";r<i;){var s=e[r++];if(!(s&128)){a+=String.fromCharCode(s);continue}var c=e[r++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|c);continue}var u=e[r++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|u:s=(s&7)<<18|c<<12|u<<6|e[r++]&63,s<65536)a+=String.fromCharCode(s);else{var f=s-65536;a+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return a},ar=[],Y=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Or=(e,r,t,n)=>{if(!(n>0))return 0;for(var i=t,a=t+n-1,s=0;s<e.length;++s){var c=e.codePointAt(s);if(c<=127){if(t>=a)break;r[t++]=c}else if(c<=2047){if(t+1>=a)break;r[t++]=192|c>>6,r[t++]=128|c&63}else if(c<=65535){if(t+2>=a)break;r[t++]=224|c>>12,r[t++]=128|c>>6&63,r[t++]=128|c&63}else{if(t+3>=a)break;r[t++]=240|c>>18,r[t++]=128|c>>12&63,r[t++]=128|c>>6&63,r[t++]=128|c&63,s++}}return r[t]=0,t-i},or=(e,r,t)=>{var n=t>0?t:Y(e)+1,i=new Array(n),a=Or(e,i,0,i.length);return r&&(i.length=a),i},nn=()=>{if(!ar.length){var e=null;if(typeof window<\"u\"&&typeof window.prompt==\"function\"&&(e=window.prompt(\"Input: \"),e!==null&&(e+=`\n`)),!e)return null;ar=or(e,!0)}return ar.shift()},ae={ttys:[],init(){},shutdown(){},register(e,r){ae.ttys[e]={input:[],output:[],ops:r},o.registerDevice(e,ae.stream_ops)},stream_ops:{open(e){var r=ae.ttys[e.node.rdev];if(!r)throw new o.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,i){if(!e.tty||!e.tty.ops.get_char)throw new o.ErrnoError(60);for(var a=0,s=0;s<n;s++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new o.ErrnoError(29)}if(c===void 0&&a===0)throw new o.ErrnoError(6);if(c==null)break;a++,r[t+s]=c}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,i){if(!e.tty||!e.tty.ops.put_char)throw new o.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch{throw new o.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char(e){return nn()},put_char(e,r){r===null||r===10?(we(me(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(we(me(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(ee(me(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(ee(me(e.output)),e.output=[])}}},Gr=e=>{ce()},E={ops_table:null,mount(e){return E.createNode(null,\"/\",16895,0)},createNode(e,r,t,n){if(o.isBlkdev(t)||o.isFIFO(t))throw new o.ErrnoError(63);E.ops_table||={dir:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr,lookup:E.node_ops.lookup,mknod:E.node_ops.mknod,rename:E.node_ops.rename,unlink:E.node_ops.unlink,rmdir:E.node_ops.rmdir,readdir:E.node_ops.readdir,symlink:E.node_ops.symlink},stream:{llseek:E.stream_ops.llseek}},file:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr},stream:{llseek:E.stream_ops.llseek,read:E.stream_ops.read,write:E.stream_ops.write,mmap:E.stream_ops.mmap,msync:E.stream_ops.msync}},link:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr,readlink:E.node_ops.readlink},stream:{}},chrdev:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr},stream:o.chrdev_stream_ops}};var i=o.createNode(e,r,t,n);return o.isDir(i.mode)?(i.node_ops=E.ops_table.dir.node,i.stream_ops=E.ops_table.dir.stream,i.contents={}):o.isFile(i.mode)?(i.node_ops=E.ops_table.file.node,i.stream_ops=E.ops_table.file.stream,i.usedBytes=0,i.contents=null):o.isLink(i.mode)?(i.node_ops=E.ops_table.link.node,i.stream_ops=E.ops_table.link.stream):o.isChrdev(i.mode)&&(i.node_ops=E.ops_table.chrdev.node,i.stream_ops=E.ops_table.chrdev.stream),i.atime=i.mtime=i.ctime=Date.now(),e&&(e.contents[r]=i,e.atime=e.mtime=e.ctime=i.atime),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var i=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=o.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,o.isDir(e.mode)?r.size=4096:o.isFile(e.mode)?r.size=e.usedBytes:o.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of[\"mode\",\"atime\",\"mtime\",\"ctime\"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&E.resizeFileStorage(e,r.size)},lookup(e,r){throw E.doesNotExistError||(E.doesNotExistError=new o.ErrnoError(44),E.doesNotExistError.stack=\"<generic error, no stack>\"),E.doesNotExistError},mknod(e,r,t,n){return E.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=o.lookupNode(r,t)}catch{}if(n){if(o.isDir(e.mode))for(var i in n.contents)throw new o.ErrnoError(55);o.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=o.lookupNode(e,r);for(var n in t.contents)throw new o.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[\".\",\"..\",...Object.keys(e.contents)]},symlink(e,r,t){var n=E.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!o.isLink(e.mode))throw new o.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,n);if(s>8&&a.subarray)r.set(a.subarray(i,i+s),t);else for(var c=0;c<s;c++)r[t+c]=a[i+c];return s},write(e,r,t,n,i,a){if(r.buffer===x.buffer&&(a=!1),!n)return 0;var s=e.node;if(s.mtime=s.ctime=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&i===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(i+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),i),n}if(E.expandFileStorage(s,i+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),i);else for(var c=0;c<n;c++)s.contents[i+c]=r[t+c];return s.usedBytes=Math.max(s.usedBytes,i+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&o.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new o.ErrnoError(28);return n},mmap(e,r,t,n,i){if(!o.isFile(e.node.mode))throw new o.ErrnoError(43);var a,s,c=e.node.contents;if(!(i&2)&&c&&c.buffer===x.buffer)s=!1,a=c.byteOffset;else{if(s=!0,a=Gr(r),!a)throw new o.ErrnoError(48);c&&((t>0||t+r<c.length)&&(c.subarray?c=c.subarray(t,t+r):c=Array.prototype.slice.call(c,t,t+r)),x.set(c,a))}return{ptr:a,allocated:s}},msync(e,r,t,n,i){return E.stream_ops.write(e,r,0,n,t,!1),0}}},an=e=>{var r={r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090},t=r[e];if(typeof t>\"u\")throw new Error(`Unknown file open mode: ${e}`);return t},sr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},on=async e=>{var r=await Qe(e);return new Uint8Array(r)},sn=(...e)=>o.createDataFile(...e),cn=e=>e,ue=0,be=null,xr=e=>{if(ue--,l.monitorRunDependencies?.(ue),ue==0&&be){var r=be;be=null,r()}},Lr=e=>{ue++,l.monitorRunDependencies?.(ue)},Nr=[],un=async(e,r)=>{typeof Browser<\"u\"&&Browser.init();for(var t of Nr)if(t.canHandle(r))return t.handle(e,r);return e},Br=async(e,r,t,n,i,a,s,c)=>{var u=r?he.resolve(D.join2(e,r)):e,f=cn(`cp ${u}`);Lr(f);try{var d=t;typeof t==\"string\"&&(d=await on(t)),d=await un(d,u),c?.(),a||sn(e,r,d,n,i,s)}finally{xr(f)}},ln=(e,r,t,n,i,a,s,c,u,f)=>{Br(e,r,t,n,i,c,u,f).then(a).catch(s)},o={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name=\"ErrnoError\";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=o.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return o.isDir(this.mode)}get isDevice(){return o.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new o.ErrnoError(44);r.follow_mount??=!0,D.isAbs(e)||(e=o.cwd()+\"/\"+e);e:for(var t=0;t<40;t++){for(var n=e.split(\"/\").filter(f=>!!f),i=o.root,a=\"/\",s=0;s<n.length;s++){var c=s===n.length-1;if(c&&r.parent)break;if(n[s]!==\".\"){if(n[s]===\"..\"){if(a=D.dirname(a),o.isRoot(i)){e=a+\"/\"+n.slice(s+1).join(\"/\"),t--;continue e}else i=i.parent;continue}a=D.join2(a,n[s]);try{i=o.lookupNode(i,n[s])}catch(f){if(f?.errno===44&&c&&r.noent_okay)return{path:a};throw f}if(o.isMountpoint(i)&&(!c||r.follow_mount)&&(i=i.mounted.root),o.isLink(i.mode)&&(!c||r.follow)){if(!i.node_ops.readlink)throw new o.ErrnoError(52);var u=i.node_ops.readlink(i);D.isAbs(u)||(u=D.dirname(a)+\"/\"+u),e=u+\"/\"+n.slice(s+1).join(\"/\");continue e}}}return{path:a,node:i}}throw new o.ErrnoError(32)},getPath(e){for(var r;;){if(o.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!==\"/\"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%o.nameTable.length},hashAddNode(e){var r=o.hashName(e.parent.id,e.name);e.name_next=o.nameTable[r],o.nameTable[r]=e},hashRemoveNode(e){var r=o.hashName(e.parent.id,e.name);if(o.nameTable[r]===e)o.nameTable[r]=e.name_next;else for(var t=o.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=o.mayLookup(e);if(t)throw new o.ErrnoError(t);for(var n=o.hashName(e.id,r),i=o.nameTable[n];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===r)return i}return o.lookup(e,r)},createNode(e,r,t,n){var i=new o.FSNode(e,r,t,n);return o.hashAddNode(i),i},destroyNode(e){o.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=[\"r\",\"w\",\"rw\"][e&3];return e&512&&(r+=\"w\"),r},nodePermissions(e,r){return o.ignorePermissions?0:r.includes(\"r\")&&!(e.mode&292)||r.includes(\"w\")&&!(e.mode&146)||r.includes(\"x\")&&!(e.mode&73)?2:0},mayLookup(e){if(!o.isDir(e.mode))return 54;var r=o.nodePermissions(e,\"x\");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!o.isDir(e.mode))return 54;try{var t=o.lookupNode(e,r);return 20}catch{}return o.nodePermissions(e,\"wx\")},mayDelete(e,r,t){var n;try{n=o.lookupNode(e,r)}catch(a){return a.errno}var i=o.nodePermissions(e,\"wx\");if(i)return i;if(t){if(!o.isDir(n.mode))return 54;if(o.isRoot(n)||o.getPath(n)===o.cwd())return 10}else if(o.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?o.isLink(e.mode)?32:o.isDir(e.mode)&&(o.flagsToPermissionString(r)!==\"r\"||r&576)?31:o.nodePermissions(e,o.flagsToPermissionString(r)):44},checkOpExists(e,r){if(!e)throw new o.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=o.MAX_OPEN_FDS;e++)if(!o.streams[e])return e;throw new o.ErrnoError(33)},getStreamChecked(e){var r=o.getStream(e);if(!r)throw new o.ErrnoError(8);return r},getStream:e=>o.streams[e],createStream(e,r=-1){return e=Object.assign(new o.FSStream,e),r==-1&&(r=o.nextfd()),e.fd=r,o.streams[r]=e,e},closeStream(e){o.streams[e]=null},dupStream(e,r=-1){var t=o.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,i=n?e:r;n??=r.node_ops.setattr,o.checkOpExists(n,63),n(i,t)},chrdev_stream_ops:{open(e){var r=o.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new o.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){o.devices[e]={stream_ops:r}},getDevice:e=>o.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e==\"function\"&&(r=e,e=!1),o.syncFSRequests++,o.syncFSRequests>1&&ee(`warning: ${o.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=o.getMounts(o.root.mount),n=0;function i(s){return o.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,i(s));++n>=t.length&&i(null)}t.forEach(s=>{if(!s.type.syncfs)return a(null);s.type.syncfs(s,e,a)})},mount(e,r,t){var n=t===\"/\",i=!t,a;if(n&&o.root)throw new o.ErrnoError(10);if(!n&&!i){var s=o.lookupPath(t,{follow_mount:!1});if(t=s.path,a=s.node,o.isMountpoint(a))throw new o.ErrnoError(10);if(!o.isDir(a.mode))throw new o.ErrnoError(54)}var c={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(c);return u.mount=c,c.root=u,n?o.root=u:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),u},unmount(e){var r=o.lookupPath(e,{follow_mount:!1});if(!o.isMountpoint(r.node))throw new o.ErrnoError(28);var t=r.node,n=t.mounted,i=o.getMounts(n);Object.keys(o.nameTable).forEach(s=>{for(var c=o.nameTable[s];c;){var u=c.name_next;i.includes(c.mount)&&o.destroyNode(c),c=u}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=o.lookupPath(e,{parent:!0}),i=n.node,a=D.basename(e);if(!a)throw new o.ErrnoError(28);if(a===\".\"||a===\"..\")throw new o.ErrnoError(20);var s=o.mayCreate(i,a);if(s)throw new o.ErrnoError(s);if(!i.node_ops.mknod)throw new o.ErrnoError(63);return i.node_ops.mknod(i,a,r,t)},statfs(e){return o.statfsNode(o.lookupPath(e,{follow:!0}).node)},statfsStream(e){return o.statfsNode(e.node)},statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:o.nextInode,ffree:o.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,o.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,o.mknod(e,r,0)},mkdirTree(e,r){var t=e.split(\"/\"),n=\"\";for(var i of t)if(i){(n||D.isAbs(e))&&(n+=\"/\"),n+=i;try{o.mkdir(n,r)}catch(a){if(a.errno!=20)throw a}}},mkdev(e,r,t){return typeof t>\"u\"&&(t=r,r=438),r|=8192,o.mknod(e,r,t)},symlink(e,r){if(!he.resolve(e))throw new o.ErrnoError(44);var t=o.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new o.ErrnoError(44);var i=D.basename(r),a=o.mayCreate(n,i);if(a)throw new o.ErrnoError(a);if(!n.node_ops.symlink)throw new o.ErrnoError(63);return n.node_ops.symlink(n,i,e)},rename(e,r){var t=D.dirname(e),n=D.dirname(r),i=D.basename(e),a=D.basename(r),s,c,u;if(s=o.lookupPath(e,{parent:!0}),c=s.node,s=o.lookupPath(r,{parent:!0}),u=s.node,!c||!u)throw new o.ErrnoError(44);if(c.mount!==u.mount)throw new o.ErrnoError(75);var f=o.lookupNode(c,i),d=he.relative(e,n);if(d.charAt(0)!==\".\")throw new o.ErrnoError(28);if(d=he.relative(r,t),d.charAt(0)!==\".\")throw new o.ErrnoError(55);var _;try{_=o.lookupNode(u,a)}catch{}if(f!==_){var p=o.isDir(f.mode),v=o.mayDelete(c,i,p);if(v)throw new o.ErrnoError(v);if(v=_?o.mayDelete(u,a,p):o.mayCreate(u,a),v)throw new o.ErrnoError(v);if(!c.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(f)||_&&o.isMountpoint(_))throw new o.ErrnoError(10);if(u!==c&&(v=o.nodePermissions(c,\"w\"),v))throw new o.ErrnoError(v);o.hashRemoveNode(f);try{c.node_ops.rename(f,u,a),f.parent=u}catch(h){throw h}finally{o.hashAddNode(f)}}},rmdir(e){var r=o.lookupPath(e,{parent:!0}),t=r.node,n=D.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!0);if(a)throw new o.ErrnoError(a);if(!t.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.rmdir(t,n),o.destroyNode(i)},readdir(e){var r=o.lookupPath(e,{follow:!0}),t=r.node,n=o.checkOpExists(t.node_ops.readdir,54);return n(t)},unlink(e){var r=o.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new o.ErrnoError(44);var n=D.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!1);if(a)throw new o.ErrnoError(a);if(!t.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.unlink(t,n),o.destroyNode(i)},readlink(e){var r=o.lookupPath(e),t=r.node;if(!t)throw new o.ErrnoError(44);if(!t.node_ops.readlink)throw new o.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=o.lookupPath(e,{follow:!r}),n=t.node,i=o.checkOpExists(n.node_ops.getattr,63);return i(n)},fstat(e){var r=o.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,i=n?r:t;return n??=t.node_ops.getattr,o.checkOpExists(n,63),n(i)},lstat(e){return o.stat(e,!0)},doChmod(e,r,t,n){o.doSetAttr(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;if(typeof e==\"string\"){var i=o.lookupPath(e,{follow:!t});n=i.node}else n=e;o.doChmod(null,n,r,t)},lchmod(e,r){o.chmod(e,r,!0)},fchmod(e,r){var t=o.getStreamChecked(e);o.doChmod(t,t.node,r,!1)},doChown(e,r,t){o.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var i;if(typeof e==\"string\"){var a=o.lookupPath(e,{follow:!n});i=a.node}else i=e;o.doChown(null,i,n)},lchown(e,r,t){o.chown(e,r,t,!0)},fchown(e,r,t){var n=o.getStreamChecked(e);o.doChown(n,n.node,!1)},doTruncate(e,r,t){if(o.isDir(r.mode))throw new o.ErrnoError(31);if(!o.isFile(r.mode))throw new o.ErrnoError(28);var n=o.nodePermissions(r,\"w\");if(n)throw new o.ErrnoError(n);o.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new o.ErrnoError(28);var t;if(typeof e==\"string\"){var n=o.lookupPath(e,{follow:!0});t=n.node}else t=e;o.doTruncate(null,t,r)},ftruncate(e,r){var t=o.getStreamChecked(e);if(r<0||(t.flags&2097155)===0)throw new o.ErrnoError(28);o.doTruncate(t,t.node,r)},utime(e,r,t){var n=o.lookupPath(e,{follow:!0}),i=n.node,a=o.checkOpExists(i.node_ops.setattr,63);a(i,{atime:r,mtime:t})},open(e,r,t=438){if(e===\"\")throw new o.ErrnoError(44);r=typeof r==\"string\"?an(r):r,r&64?t=t&4095|32768:t=0;var n,i;if(typeof e==\"object\")n=e;else{i=e.endsWith(\"/\");var a=o.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=a.node,e=a.path}var s=!1;if(r&64)if(n){if(r&128)throw new o.ErrnoError(20)}else{if(i)throw new o.ErrnoError(31);n=o.mknod(e,t|511,0),s=!0}if(!n)throw new o.ErrnoError(44);if(o.isChrdev(n.mode)&&(r&=-513),r&65536&&!o.isDir(n.mode))throw new o.ErrnoError(54);if(!s){var c=o.mayOpen(n,r);if(c)throw new o.ErrnoError(c)}r&512&&!s&&o.truncate(n,0),r&=-131713;var u=o.createStream({node:n,path:o.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),s&&o.chmod(n,t&511),l.logReadFiles&&!(r&1)&&(e in o.readFiles||(o.readFiles[e]=1)),u},close(e){if(o.isClosed(e))throw new o.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{o.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(o.isClosed(e))throw new o.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new o.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new o.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,i){if(n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===1)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.read)throw new o.ErrnoError(28);var a=typeof i<\"u\";if(!a)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,i);return a||(e.position+=s),s},write(e,r,t,n,i,a){if(n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===0)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.write)throw new o.ErrnoError(28);e.seekable&&e.flags&1024&&o.llseek(e,0,2);var s=typeof i<\"u\";if(!s)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var c=e.stream_ops.write(e,r,t,n,i,a);return s||(e.position+=c),c},mmap(e,r,t,n,i){if((n&2)!==0&&(i&2)===0&&(e.flags&2097155)!==2)throw new o.ErrnoError(2);if((e.flags&2097155)===1)throw new o.ErrnoError(2);if(!e.stream_ops.mmap)throw new o.ErrnoError(43);if(!r)throw new o.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,i)},msync(e,r,t,n,i){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,i):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new o.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||\"binary\",r.encoding!==\"utf8\"&&r.encoding!==\"binary\")throw new Error(`Invalid encoding type \"${r.encoding}\"`);var t=o.open(e,r.flags),n=o.stat(e),i=n.size,a=new Uint8Array(i);return o.read(t,a,0,i,0),r.encoding===\"utf8\"&&(a=me(a)),o.close(t),a},writeFile(e,r,t={}){t.flags=t.flags||577;var n=o.open(e,t.flags,t.mode);if(typeof r==\"string\"&&(r=new Uint8Array(or(r,!0))),ArrayBuffer.isView(r))o.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error(\"Unsupported data type\");o.close(n)},cwd:()=>o.currentPath,chdir(e){var r=o.lookupPath(e,{follow:!0});if(r.node===null)throw new o.ErrnoError(44);if(!o.isDir(r.node.mode))throw new o.ErrnoError(54);var t=o.nodePermissions(r.node,\"x\");if(t)throw new o.ErrnoError(t);o.currentPath=r.path},createDefaultDirectories(){o.mkdir(\"/tmp\"),o.mkdir(\"/home\"),o.mkdir(\"/home/web_user\")},createDefaultDevices(){o.mkdir(\"/dev\"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(n,i,a,s,c)=>s,llseek:()=>0}),o.mkdev(\"/dev/null\",o.makedev(1,3)),ae.register(o.makedev(5,0),ae.default_tty_ops),ae.register(o.makedev(6,0),ae.default_tty1_ops),o.mkdev(\"/dev/tty\",o.makedev(5,0)),o.mkdev(\"/dev/tty1\",o.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(ir(e),r=e.byteLength),e[--r]);o.createDevice(\"/dev\",\"random\",t),o.createDevice(\"/dev\",\"urandom\",t),o.mkdir(\"/dev/shm\"),o.mkdir(\"/dev/shm/tmp\")},createSpecialDirectories(){o.mkdir(\"/proc\");var e=o.mkdir(\"/proc/self\");o.mkdir(\"/proc/self/fd\"),o.mount({mount(){var r=o.createNode(e,\"fd\",16895,73);return r.stream_ops={llseek:E.stream_ops.llseek},r.node_ops={lookup(t,n){var i=+n,a=o.getStreamChecked(i),s={parent:null,mount:{mountpoint:\"fake\"},node_ops:{readlink:()=>a.path},id:i+1};return s.parent=s,s},readdir(){return Array.from(o.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},\"/proc/self/fd\")},createStandardStreams(e,r,t){e?o.createDevice(\"/dev\",\"stdin\",e):o.symlink(\"/dev/tty\",\"/dev/stdin\"),r?o.createDevice(\"/dev\",\"stdout\",null,r):o.symlink(\"/dev/tty\",\"/dev/stdout\"),t?o.createDevice(\"/dev\",\"stderr\",null,t):o.symlink(\"/dev/tty1\",\"/dev/stderr\");var n=o.open(\"/dev/stdin\",0),i=o.open(\"/dev/stdout\",1),a=o.open(\"/dev/stderr\",1)},staticInit(){o.nameTable=new Array(4096),o.mount(E,{},\"/\"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:E}},init(e,r,t){o.initialized=!0,e??=l.stdin,r??=l.stdout,t??=l.stderr,o.createStandardStreams(e,r,t)},quit(){o.initialized=!1;for(var e of o.streams)e&&o.close(e)},findObject(e,r){var t=o.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=o.lookupPath(e,{follow:!r});e=t.path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=o.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=D.basename(e),t=o.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path===\"/\"}catch(i){n.error=i.errno}return n},createPath(e,r,t,n){e=typeof e==\"string\"?e:o.getPath(e);for(var i=r.split(\"/\").reverse();i.length;){var a=i.pop();if(a){var s=D.join2(e,a);try{o.mkdir(s)}catch(c){if(c.errno!=20)throw c}e=s}}return s},createFile(e,r,t,n,i){var a=D.join2(typeof e==\"string\"?e:o.getPath(e),r),s=sr(n,i);return o.create(a,s)},createDataFile(e,r,t,n,i,a){var s=r;e&&(e=typeof e==\"string\"?e:o.getPath(e),s=r?D.join2(e,r):e);var c=sr(n,i),u=o.create(s,c);if(t){if(typeof t==\"string\"){for(var f=new Array(t.length),d=0,_=t.length;d<_;++d)f[d]=t.charCodeAt(d);t=f}o.chmod(u,c|146);var p=o.open(u,577);o.write(p,t,0,t.length,0,a),o.close(p),o.chmod(u,c)}},createDevice(e,r,t,n){var i=D.join2(typeof e==\"string\"?e:o.getPath(e),r),a=sr(!!t,!!n);o.createDevice.major??=64;var s=o.makedev(o.createDevice.major++,0);return o.registerDevice(s,{open(c){c.seekable=!1},close(c){n?.buffer?.length&&n(10)},read(c,u,f,d,_){for(var p=0,v=0;v<d;v++){var h;try{h=t()}catch{throw new o.ErrnoError(29)}if(h===void 0&&p===0)throw new o.ErrnoError(6);if(h==null)break;p++,u[f+v]=h}return p&&(c.node.atime=Date.now()),p},write(c,u,f,d,_){for(var p=0;p<d;p++)try{n(u[f+p])}catch{throw new o.ErrnoError(29)}return d&&(c.node.mtime=c.node.ctime=Date.now()),p}}),o.mkdev(i,a,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<\"u\")throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");try{e.contents=Fe(e.url)}catch{throw new o.ErrnoError(29)}},createLazyFile(e,r,t,n,i){class a{lengthKnown=!1;chunks=[];get(v){if(!(v>this.length-1||v<0)){var h=v%this.chunkSize,k=v/this.chunkSize|0;return this.getter(k)[h]}}setDataGetter(v){this.getter=v}cacheLength(){var v=new XMLHttpRequest;if(v.open(\"HEAD\",t,!1),v.send(null),!(v.status>=200&&v.status<300||v.status===304))throw new Error(\"Couldn't load \"+t+\". Status: \"+v.status);var h=Number(v.getResponseHeader(\"Content-length\")),k,$=(k=v.getResponseHeader(\"Accept-Ranges\"))&&k===\"bytes\",T=(k=v.getResponseHeader(\"Content-Encoding\"))&&k===\"gzip\",G=1024*1024;$||(G=h);var P=(z,b)=>{if(z>b)throw new Error(\"invalid range (\"+z+\", \"+b+\") or no bytes requested!\");if(b>h-1)throw new Error(\"only \"+h+\" bytes available! programmer error!\");var M=new XMLHttpRequest;if(M.open(\"GET\",t,!1),h!==G&&M.setRequestHeader(\"Range\",\"bytes=\"+z+\"-\"+b),M.responseType=\"arraybuffer\",M.overrideMimeType&&M.overrideMimeType(\"text/plain; charset=x-user-defined\"),M.send(null),!(M.status>=200&&M.status<300||M.status===304))throw new Error(\"Couldn't load \"+t+\". Status: \"+M.status);return M.response!==void 0?new Uint8Array(M.response||[]):or(M.responseText||\"\",!0)},K=this;K.setDataGetter(z=>{var b=z*G,M=(z+1)*G-1;if(M=Math.min(M,h-1),typeof K.chunks[z]>\"u\"&&(K.chunks[z]=P(b,M)),typeof K.chunks[z]>\"u\")throw new Error(\"doXHR failed!\");return K.chunks[z]}),(T||!h)&&(G=h=1,h=this.getter(0).length,G=h,we(\"LazyFiles on gzip forces download of the whole file when length is accessed\")),this._length=h,this._chunkSize=G,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<\"u\"){if(!ge)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var s=new a,c={isDevice:!1,contents:s}}else var c={isDevice:!1,url:t};var u=o.createFile(e,r,c,n,i);c.contents?u.contents=c.contents:c.url&&(u.contents=null,u.url=c.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var f={},d=Object.keys(u.stream_ops);d.forEach(p=>{var v=u.stream_ops[p];f[p]=(...h)=>(o.forceLoadFile(u),v(...h))});function _(p,v,h,k,$){var T=p.node.contents;if($>=T.length)return 0;var G=Math.min(T.length-$,k);if(T.slice)for(var P=0;P<G;P++)v[h+P]=T[$+P];else for(var P=0;P<G;P++)v[h+P]=T.get($+P);return G}return f.read=(p,v,h,k,$)=>(o.forceLoadFile(u),_(p,v,h,k,$)),f.mmap=(p,v,h,k,$)=>{o.forceLoadFile(u);var T=Gr(v);if(!T)throw new o.ErrnoError(48);return _(p,x,T,v,h),{ptr:T,allocated:!0}},u.stream_ops=f,u}},I=(e,r,t)=>e?me(N,e,r,t):\"\",R={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(D.isAbs(r))return r;var n;if(e===-100)n=o.cwd();else{var i=R.getStreamFromFD(e);n=i.path}if(r.length==0){if(!t)throw new o.ErrnoError(44);return n}return n+\"/\"+r},writeStat(e,r){m[e>>2]=r.dev,m[e+4>>2]=r.mode,m[e+8>>2]=r.nlink,m[e+12>>2]=r.uid,m[e+16>>2]=r.gid,m[e+20>>2]=r.rdev,W[e+24>>3]=BigInt(r.size),C[e+32>>2]=4096,C[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return W[e+40>>3]=BigInt(Math.floor(t/1e3)),m[e+48>>2]=t%1e3*1e3*1e3,W[e+56>>3]=BigInt(Math.floor(n/1e3)),m[e+64>>2]=n%1e3*1e3*1e3,W[e+72>>3]=BigInt(Math.floor(i/1e3)),m[e+80>>2]=i%1e3*1e3*1e3,W[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){m[e+4>>2]=r.bsize,m[e+60>>2]=r.bsize,W[e+8>>3]=BigInt(r.blocks),W[e+16>>3]=BigInt(r.bfree),W[e+24>>3]=BigInt(r.bavail),W[e+32>>3]=BigInt(r.files),W[e+40>>3]=BigInt(r.ffree),m[e+48>>2]=r.fsid,m[e+64>>2]=r.flags,m[e+56>>2]=r.namelen},doMsync(e,r,t,n,i){if(!o.isFile(r.node.mode))throw new o.ErrnoError(43);if(n&2)return 0;var a=N.slice(e,e+t);o.msync(r,a,i,t,n)},getStreamFromFD(e){var r=o.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=I(e);return r}};function fn(e,r,t){R.varargs=t;try{var n=R.getStreamFromFD(e);switch(r){case 0:{var i=Oe();if(i<0)return-28;for(;o.streams[i];)i++;var a;return a=o.dupStream(n,i),a.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var i=Oe();return n.flags|=i,0}case 12:{var i=_e(),s=0;return A[i+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof o>\"u\"||c.name!==\"ErrnoError\")throw c;return-c.errno}}function dn(e,r){try{return R.writeStat(r,o.fstat(e))}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return-t.errno}}function vn(e,r,t){R.varargs=t;try{var n=R.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var i=n.tty.ops.ioctl_tcgets(n),a=_e();C[a>>2]=i.c_iflag||0,C[a+4>>2]=i.c_oflag||0,C[a+8>>2]=i.c_cflag||0,C[a+12>>2]=i.c_lflag||0;for(var s=0;s<32;s++)x[a+s+17]=i.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var a=_e(),c=C[a>>2],u=C[a+4>>2],f=C[a+8>>2],d=C[a+12>>2],_=[],s=0;s<32;s++)_.push(x[a+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:c,c_oflag:u,c_cflag:f,c_lflag:d,c_cc:_})}return 0}case 21519:{if(!n.tty)return-59;var a=_e();return C[a>>2]=0,0}case 21520:return n.tty?-28:-59;case 21537:case 21531:{var a=_e();return o.ioctl(n,r,a)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var p=n.tty.ops.ioctl_tiocgwinsz(n.tty),a=_e();A[a>>1]=p[0],A[a+2>>1]=p[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(v){if(typeof o>\"u\"||v.name!==\"ErrnoError\")throw v;return-v.errno}}function _n(e,r){try{return e=R.getStr(e),R.writeStat(r,o.lstat(e))}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return-t.errno}}function hn(e,r,t,n){try{r=R.getStr(r);var i=n&256,a=n&4096;return n=n&-6401,r=R.calculateAt(e,r,a),R.writeStat(t,i?o.lstat(r):o.stat(r))}catch(s){if(typeof o>\"u\"||s.name!==\"ErrnoError\")throw s;return-s.errno}}function mn(e,r,t,n){R.varargs=n;try{r=R.getStr(r),r=R.calculateAt(e,r);var i=n?Oe():0;return o.open(r,t,i).fd}catch(a){if(typeof o>\"u\"||a.name!==\"ErrnoError\")throw a;return-a.errno}}function pn(e){try{return e=R.getStr(e),o.rmdir(e),0}catch(r){if(typeof o>\"u\"||r.name!==\"ErrnoError\")throw r;return-r.errno}}function yn(e,r){try{return e=R.getStr(e),R.writeStat(r,o.stat(e))}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return-t.errno}}function gn(e,r,t){try{if(r=R.getStr(r),r=R.calculateAt(e,r),!t)o.unlink(r);else if(t===512)o.rmdir(r);else return-28;return 0}catch(n){if(typeof o>\"u\"||n.name!==\"ErrnoError\")throw n;return-n.errno}}var wn=()=>ce(\"\"),V=e=>{for(var r=\"\";;){var t=N[e++];if(!t)return r;r+=String.fromCharCode(t)}},pe={},le={},Ge={},ke=class extends Error{constructor(r){super(r),this.name=\"BindingError\"}},F=e=>{throw new ke(e)};function Sn(e,r,t={}){var n=r.name;if(e||F(`type \"${n}\" must have a positive integer typeid pointer`),le.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;F(`Cannot register type '${n}' twice`)}if(le[e]=r,delete Ge[e],pe.hasOwnProperty(e)){var i=pe[e];delete pe[e],i.forEach(a=>a())}}function q(e,r,t={}){return Sn(e,r,t)}var Wr=(e,r,t)=>{switch(r){case 1:return t?n=>x[n]:n=>N[n];case 2:return t?n=>A[n>>1]:n=>ve[n>>1];case 4:return t?n=>C[n>>2]:n=>m[n>>2];case 8:return t?n=>W[n>>3]:n=>Fr[n>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},bn=(e,r,t,n,i)=>{r=V(r);const a=n===0n;let s=c=>c;if(a){const c=t*8;s=u=>BigInt.asUintN(c,u),i=s(i)}q(e,{name:r,fromWireType:s,toWireType:(c,u)=>(typeof u==\"number\"&&(u=BigInt(u)),u),readValueFromPointer:Wr(r,t,!a),destructorFunction:null})},kn=(e,r,t,n)=>{r=V(r),q(e,{name:r,fromWireType:function(i){return!!i},toWireType:function(i,a){return a?t:n},readValueFromPointer:function(i){return this.fromWireType(N[i])},destructorFunction:null})},En=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),cr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}F(r(e)+\" instance already deleted\")},ur=!1,Ur=e=>{},Cn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Vr=e=>{e.count.value-=1;var r=e.count.value===0;r&&Cn(e)},Ee=e=>typeof FinalizationRegistry>\"u\"?(Ee=r=>r,e):(ur=new FinalizationRegistry(r=>{Vr(r.$$)}),Ee=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t};ur.register(r,i,r)}return r},Ur=r=>ur.unregister(r),Ee(e)),xe=[],Tn=()=>{for(;xe.length;){var e=xe.pop();e.$$.deleteScheduled=!1,e.delete()}},zr,Fn=()=>{let e=Le.prototype;Object.assign(e,{isAliasOf(t){if(!(this instanceof Le)||!(t instanceof Le))return!1;var n=this.$$.ptrType.registeredClass,i=this.$$.ptr;t.$$=t.$$;for(var a=t.$$.ptrType.registeredClass,s=t.$$.ptr;n.baseClass;)i=n.upcast(i),n=n.baseClass;for(;a.baseClass;)s=a.upcast(s),a=a.baseClass;return n===a&&i===s},clone(){if(this.$$.ptr||cr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ee(Object.create(Object.getPrototypeOf(this),{$$:{value:En(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||cr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&F(\"Object already scheduled for deletion\"),Ur(this),Vr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||cr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&F(\"Object already scheduled for deletion\"),xe.push(this),xe.length===1&&zr&&zr(Tn),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)};function Le(){}var Ne=(e,r)=>Object.defineProperty(r,\"name\",{value:e}),Hr={},qr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...i){return e[r].overloadTable.hasOwnProperty(i.length)||F(`Function '${t}' called with an invalid number of arguments (${i.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[i.length].apply(this,i)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},lr=(e,r,t)=>{l.hasOwnProperty(e)?((t===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[t]!==void 0)&&F(`Cannot register public name '${e}' twice`),qr(l,e,e),l[e].overloadTable.hasOwnProperty(t)&&F(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),l[e].overloadTable[t]=r):(l[e]=r,l[e].argCount=t)},Pn=48,An=57,$n=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,\"$\");var r=e.charCodeAt(0);return r>=Pn&&r<=An?`_${e}`:e};function Dn(e,r,t,n,i,a,s,c){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=i,this.getActualType=a,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Be=(e,r,t)=>{for(;r!==t;)r.upcast||F(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e},fr=e=>{if(e===null)return\"null\";var r=typeof e;return r===\"object\"||r===\"array\"||r===\"function\"?e.toString():\"\"+e};function Rn(e,r){if(r===null)return this.isReference&&F(`null is not a valid ${this.name}`),0;r.$$||F(`Cannot pass \"${fr(r)}\" as a ${this.name}`),r.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Be(r.$$.ptr,t,this.registeredClass);return n}function Mn(e,r){var t;if(r===null)return this.isReference&&F(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&F(`Cannot pass \"${fr(r)}\" as a ${this.name}`),r.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&F(`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=Be(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&F(\"Passing raw pointer to smart pointer is illegal\"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:F(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var i=r.clone();t=this.rawShare(t,B.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:F(\"Unsupporting sharing policy\")}return t}function In(e,r){if(r===null)return this.isReference&&F(`null is not a valid ${this.name}`),0;r.$$||F(`Cannot pass \"${fr(r)}\" as a ${this.name}`),r.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&F(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Be(r.$$.ptr,t,this.registeredClass);return n}function We(e){return this.fromWireType(m[e>>2])}var Xr=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=Xr(e,r,t.baseClass);return n===null?null:t.downcast(n)},jn={},On=(e,r)=>{for(r===void 0&&F(\"ptr should not be undefined\");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},Gn=(e,r)=>(r=On(e,r),jn[r]),xn=class extends Error{constructor(r){super(r),this.name=\"InternalError\"}},Ue=e=>{throw new xn(e)},Ve=(e,r)=>{(!r.ptrType||!r.ptr)&&Ue(\"makeClassHandle requires ptr and ptrType\");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Ue(\"Both smartPtrType and smartPtr must be specified\"),r.count={value:1},Ee(Object.create(e,{$$:{value:r,writable:!0}}))};function Ln(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Gn(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Ve(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ve(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(r),s=Hr[a];if(!s)return i.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var u=Xr(r,this.registeredClass,c.registeredClass);return u===null?i.call(this):this.isSmartPointer?Ve(c.registeredClass.instancePrototype,{ptrType:c,ptr:u,smartPtrType:this,smartPtr:e}):Ve(c.registeredClass.instancePrototype,{ptrType:c,ptr:u})}var Nn=()=>{Object.assign(ze.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},readValueFromPointer:We,fromWireType:Ln})};function ze(e,r,t,n,i,a,s,c,u,f,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=u,this.rawShare=f,this.rawDestructor=d,!i&&r.baseClass===void 0?n?(this.toWireType=Rn,this.destructorFunction=null):(this.toWireType=In,this.destructorFunction=null):this.toWireType=Mn}var Zr=(e,r,t)=>{l.hasOwnProperty(e)||Ue(\"Replacing nonexistent public symbol\"),l[e].overloadTable!==void 0&&t!==void 0?l[e].overloadTable[t]=r:(l[e]=r,l[e].argCount=t)},Kr=[],Yr,y=e=>{var r=Kr[e];return r||(Kr[e]=r=Yr.get(e)),r},te=(e,r,t=!1)=>{e=V(e);function n(){var a=y(r);return a}var i=n();return typeof i!=\"function\"&&F(`unknown function pointer with signature ${e}: ${r}`),i};class Bn extends Error{}var Jr=e=>{var r=gt(e),t=V(r);return J(r),t},ye=(e,r)=>{var t=[],n={};function i(a){if(!n[a]&&!le[a]){if(Ge[a]){Ge[a].forEach(i);return}t.push(a),n[a]=!0}}throw r.forEach(i),new Bn(`${e}: `+t.map(Jr).join([\", \"]))},oe=(e,r,t)=>{e.forEach(c=>Ge[c]=r);function n(c){var u=t(c);u.length!==e.length&&Ue(\"Mismatched type converter count\");for(var f=0;f<e.length;++f)q(e[f],u[f])}var i=new Array(r.length),a=[],s=0;r.forEach((c,u)=>{le.hasOwnProperty(c)?i[u]=le[c]:(a.push(c),pe.hasOwnProperty(c)||(pe[c]=[]),pe[c].push(()=>{i[u]=le[c],++s,s===a.length&&n(i)}))}),a.length===0&&n(i)},Wn=(e,r,t,n,i,a,s,c,u,f,d,_,p)=>{d=V(d),a=te(i,a),c&&=te(s,c),f&&=te(u,f),p=te(_,p);var v=$n(d);lr(v,function(){ye(`Cannot construct ${d} due to unbound types`,[n])}),oe([e,r,t],n?[n]:[],h=>{h=h[0];var k,$;n?(k=h.registeredClass,$=k.instancePrototype):$=Le.prototype;var T=Ne(d,function(...M){if(Object.getPrototypeOf(this)!==G)throw new ke(`Use 'new' to construct ${d}`);if(P.constructor_body===void 0)throw new ke(`${d} has no accessible constructor`);var se=P.constructor_body[M.length];if(se===void 0)throw new ke(`Tried to invoke ctor of ${d} with invalid number of parameters (${M.length}) - expected (${Object.keys(P.constructor_body).toString()}) parameters instead!`);return se.apply(this,M)}),G=Object.create($,{constructor:{value:T}});T.prototype=G;var P=new Dn(d,T,G,p,k,a,c,f);P.baseClass&&(P.baseClass.__derivedClasses??=[],P.baseClass.__derivedClasses.push(P));var K=new ze(d,P,!0,!1,!1),z=new ze(d+\"*\",P,!1,!1,!1),b=new ze(d+\" const*\",P,!1,!0,!1);return Hr[e]={pointerType:z,constPointerType:b},Zr(v,T),[K,z,b]})},dr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(m[r+n*4>>2]);return t},vr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Qr(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function Un(e,r,t,n){var i=Qr(e),a=e.length-2,s=[],c=[\"fn\"];r&&c.push(\"thisWired\");for(var u=0;u<a;++u)s.push(`arg${u}`),c.push(`arg${u}Wired`);s=s.join(\",\"),c=c.join(\",\");var f=`return function (${s}) {\n`;i&&(f+=`var destructors = [];\n`);var d=i?\"destructors\":\"null\",_=[\"humanName\",\"throwBindingError\",\"invoker\",\"fn\",\"runDestructors\",\"fromRetWire\",\"toClassParamWire\"];r&&(f+=`var thisWired = toClassParamWire(${d}, this);\n`);for(var u=0;u<a;++u){var p=`toArg${u}Wire`;f+=`var arg${u}Wired = ${p}(${d}, arg${u});\n`,_.push(p)}f+=(t||n?\"var rv = \":\"\")+`invoker(${c});\n`;var v=t?\"rv\":\"\";if(i)f+=`runDestructors(destructors);\n`;else for(var u=r?1:2;u<e.length;++u){var h=u===1?\"thisWired\":\"arg\"+(u-2)+\"Wired\";e[u].destructorFunction!==null&&(f+=`${h}_dtor(${h});\n`,_.push(`${h}_dtor`))}return t&&(f+=`var ret = fromRetWire(rv);\nreturn ret;\n`),f+=`}\n`,new Function(_,f)}function _r(e,r,t,n,i,a){var s=r.length;s<2&&F(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");for(var c=r[1]!==null&&t!==null,u=Qr(r),f=!r[0].isVoid,d=s-2,_=r[0],p=r[1],v=[e,F,n,i,vr,_.fromWireType.bind(_),p?.toWireType.bind(p)],h=2;h<s;++h){var k=r[h];v.push(k.toWireType.bind(k))}if(!u)for(var h=c?1:2;h<r.length;++h)r[h].destructorFunction!==null&&v.push(r[h].destructorFunction);var T=Un(r,c,f,a)(...v);return Ne(e,T)}var Vn=(e,r,t,n,i,a)=>{var s=dr(r,t);i=te(n,i);var c=[a],u=[];oe([],[e],f=>{f=f[0];var d=`constructor ${f.name}`;if(f.registeredClass.constructor_body===void 0&&(f.registeredClass.constructor_body=[]),f.registeredClass.constructor_body[r-1]!==void 0)throw new ke(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${f.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return f.registeredClass.constructor_body[r-1]=()=>{ye(`Cannot construct ${f.name} due to unbound types`,s)},oe([],s,_=>(_.splice(1,0,null),f.registeredClass.constructor_body[r-1]=_r(d,_,null,i,a),[])),[]})},et=e=>{e=e.trim();const r=e.indexOf(\"(\");return r===-1?e:e.slice(0,r)},zn=(e,r,t,n,i,a,s,c,u,f)=>{var d=dr(t,n);r=V(r),r=et(r),a=te(i,a,u),oe([],[e],_=>{_=_[0];var p=`${_.name}.${r}`;r.startsWith(\"@@\")&&(r=Symbol[r.substring(2)]),c&&_.registeredClass.pureVirtualFunctions.push(r);function v(){ye(`Cannot call ${p} due to unbound types`,d)}var h=_.registeredClass.instancePrototype,k=h[r];return k===void 0||k.overloadTable===void 0&&k.className!==_.name&&k.argCount===t-2?(v.argCount=t-2,v.className=_.name,h[r]=v):(qr(h,r,p),h[r].overloadTable[t-2]=v),oe([],d,$=>{var T=_r(p,$,_,a,s,u);return h[r].overloadTable===void 0?(T.argCount=t-2,h[r]=T):h[r].overloadTable[t-2]=T,[]}),[]})},rt=(e,r,t)=>(e instanceof Object||F(`${t} with invalid \"this\": ${e}`),e instanceof r.registeredClass.constructor||F(`${t} incompatible with \"this\" of type ${e.constructor.name}`),e.$$.ptr||F(`cannot call emscripten binding method ${t} on deleted object`),Be(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Hn=(e,r,t,n,i,a,s,c,u,f)=>{r=V(r),i=te(n,i),oe([],[e],d=>{d=d[0];var _=`${d.name}.${r}`,p={get(){ye(`Cannot access ${_} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return u?p.set=()=>ye(`Cannot access ${_} due to unbound types`,[t,s]):p.set=v=>F(_+\" is a read-only property\"),Object.defineProperty(d.registeredClass.instancePrototype,r,p),oe([],u?[t,s]:[t],v=>{var h=v[0],k={get(){var T=rt(this,d,_+\" getter\");return h.fromWireType(i(a,T))},enumerable:!0};if(u){u=te(c,u);var $=v[1];k.set=function(T){var G=rt(this,d,_+\" setter\"),P=[];u(f,G,$.toWireType(P,T)),vr(P)}}return Object.defineProperty(d.registeredClass.instancePrototype,r,k),[]}),[]})},tt=[],fe=[0,1,,1,null,1,!0,1,!1,1],hr=e=>{e>9&&--fe[e+1]===0&&(fe[e]=void 0,tt.push(e))},B={toValue:e=>(e||F(`Cannot use deleted val. handle = ${e}`),fe[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=tt.pop()||fe.length;return fe[r]=e,fe[r+1]=1,r}}}},nt={name:\"emscripten::val\",fromWireType:e=>{var r=B.toValue(e);return hr(e),r},toWireType:(e,r)=>B.toHandle(r),readValueFromPointer:We,destructorFunction:null},qn=e=>q(e,nt),Xn=(e,r,t)=>{switch(r){case 1:return t?function(n){return this.fromWireType(x[n])}:function(n){return this.fromWireType(N[n])};case 2:return t?function(n){return this.fromWireType(A[n>>1])}:function(n){return this.fromWireType(ve[n>>1])};case 4:return t?function(n){return this.fromWireType(C[n>>2])}:function(n){return this.fromWireType(m[n>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Zn=(e,r,t,n)=>{r=V(r);function i(){}i.values={},q(e,{name:r,constructor:i,fromWireType:function(a){return this.constructor.values[a]},toWireType:(a,s)=>s.value,readValueFromPointer:Xn(r,t,n),destructorFunction:null}),lr(r,i)},it=(e,r)=>{var t=le[e];return t===void 0&&F(`${r} has unknown type ${Jr(e)}`),t},Kn=(e,r,t)=>{var n=it(e,\"enum\");r=V(r);var i=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:Ne(`${n.name}_${r}`,function(){})}});i.values[t]=a,i[r]=a},Yn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(De[t>>2])};case 8:return function(t){return this.fromWireType(Re[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Jn=(e,r,t)=>{r=V(r),q(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>i,readValueFromPointer:Yn(r,t),destructorFunction:null})},Qn=(e,r,t,n,i,a,s,c)=>{var u=dr(r,t);e=V(e),e=et(e),i=te(n,i,s),lr(e,function(){ye(`Cannot call ${e} due to unbound types`,u)},r-1),oe([],u,f=>{var d=[f[0],null].concat(f.slice(1));return Zr(e,_r(e,d,null,i,a,s),r-1),[]})},ei=(e,r,t,n,i)=>{r=V(r);const a=n===0;let s=u=>u;if(a){var c=32-8*t;s=u=>u<<c>>>c,i=s(i)}q(e,{name:r,fromWireType:s,toWireType:(u,f)=>f,readValueFromPointer:Wr(r,t,n!==0),destructorFunction:null})},ri=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],i=n[r];function a(s){var c=m[s>>2],u=m[s+4>>2];return new i(x.buffer,u,c)}t=V(t),q(e,{name:t,fromWireType:a,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},ti=Object.assign({optional:!0},nt),ni=(e,r)=>{q(e,ti)},O=(e,r,t)=>Or(e,N,r,t),ii=(e,r)=>{r=V(r);var t=!0;q(e,{name:r,fromWireType(n){var i=m[n>>2],a=n+4,s;if(t)s=I(a,i,!0);else{s=\"\";for(var c=0;c<i;++c)s+=String.fromCharCode(N[a+c])}return J(n),s},toWireType(n,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var a,s=typeof i==\"string\";s||ArrayBuffer.isView(i)&&i.BYTES_PER_ELEMENT==1||F(\"Cannot pass non-string to std::string\"),t&&s?a=Y(i):a=i.length;var c=Z(4+a+1),u=c+4;if(m[c>>2]=a,s)if(t)O(i,u,a+1);else for(var f=0;f<a;++f){var d=i.charCodeAt(f);d>255&&(J(c),F(\"String has UTF-16 code units that do not fit in 8 bits\")),N[u+f]=d}else N.set(i,u);return n!==null&&n.push(J,c),c},readValueFromPointer:We,destructorFunction(n){J(n)}})},at=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0,ai=(e,r,t)=>{var n=e>>1,i=jr(ve,n,r/2,t);if(i-n>16&&at)return at.decode(ve.subarray(n,i));for(var a=\"\",s=n;s<i;++s){var c=ve[s];a+=String.fromCharCode(c)}return a},oi=(e,r,t)=>{if(t??=2147483647,t<2)return 0;t-=2;for(var n=r,i=t<e.length*2?t/2:e.length,a=0;a<i;++a){var s=e.charCodeAt(a);A[r>>1]=s,r+=2}return A[r>>1]=0,r-n},si=e=>e.length*2,ci=(e,r,t)=>{for(var n=\"\",i=e>>2,a=0;!(a>=r/4);a++){var s=m[i+a];if(!s&&!t)break;n+=String.fromCodePoint(s)}return n},ui=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,i=n+t-4,a=0;a<e.length;++a){var s=e.codePointAt(a);if(s>65535&&a++,C[r>>2]=s,r+=4,r+4>i)break}return C[r>>2]=0,r-n},li=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.codePointAt(t);n>65535&&t++,r+=4}return r},fi=(e,r,t)=>{t=V(t);var n,i,a;r===2?(n=ai,i=oi,a=si):(n=ci,i=ui,a=li),q(e,{name:t,fromWireType:s=>{var c=m[s>>2],u=n(s+4,c*r,!0);return J(s),u},toWireType:(s,c)=>{typeof c!=\"string\"&&F(`Cannot pass non-string to C++ string type ${t}`);var u=a(c),f=Z(4+u+r);return m[f>>2]=u/r,i(c,f+4,u+r),s!==null&&s.push(J,f),f},readValueFromPointer:We,destructorFunction(s){J(s)}})},di=(e,r)=>{r=V(r),q(e,{isVoid:!0,name:r,fromWireType:()=>{},toWireType:(t,n)=>{}})},ot=0,vi=()=>{rr=!1,ot=0},mr=[],_i=e=>{var r=mr.length;return mr.push(e),r},hi=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=it(m[r+n*4>>2],`parameter ${n}`);return t},mi=(e,r,t)=>{var n=[],i=e(n,t);return n.length&&(m[r>>2]=B.toHandle(n)),i},pi={},pr=e=>{var r=pi[e];return r===void 0?V(e):r},yi=(e,r,t)=>{var n=8,[i,...a]=hi(e,r),s=i.toWireType.bind(i),c=a.map(v=>v.readValueFromPointer.bind(v));e--;var u={toValue:B.toValue},f=c.map((v,h)=>{var k=`argFromPtr${h}`;return u[k]=v,`${k}(args${h?\"+\"+h*n:\"\"})`}),d;switch(t){case 0:d=\"toValue(handle)\";break;case 2:d=\"new (toValue(handle))\";break;case 3:d=\"\";break;case 1:u.getStringOrSymbol=pr,d=\"toValue(handle)[getStringOrSymbol(methodName)]\";break}d+=`(${f})`,i.isVoid||(u.toReturnWire=s,u.emval_returnValue=mi,d=`return emval_returnValue(toReturnWire, destructorsRef, ${d})`),d=`return function (handle, methodName, destructorsRef, args) {\n ${d}\n }`;var _=new Function(Object.keys(u),d)(...Object.values(u)),p=`methodCaller<(${a.map(v=>v.name)}) => ${i.name}>`;return _i(Ne(p,_))},st=()=>globalThis,gi=e=>e===0?B.toHandle(st()):(e=pr(e),B.toHandle(st()[e])),wi=(e,r)=>(e=B.toValue(e),r=B.toValue(r),B.toHandle(e[r])),Si=e=>{e>9&&(fe[e+1]+=1)},bi=(e,r,t,n,i)=>mr[e](r,t,n,i),ki=()=>B.toHandle([]),Ei=e=>B.toHandle(pr(e)),Ci=e=>{var r=B.toValue(e);vr(r),hr(e)},Ti=(e,r,t)=>{e=B.toValue(e),r=B.toValue(r),t=B.toValue(t),e[r]=t},Fi=9007199254740992,Pi=-9007199254740992,He=e=>e<Pi||e>Fi?NaN:Number(e);function Ai(e,r){e=He(e);var t=new Date(e*1e3);C[r>>2]=t.getUTCSeconds(),C[r+4>>2]=t.getUTCMinutes(),C[r+8>>2]=t.getUTCHours(),C[r+12>>2]=t.getUTCDate(),C[r+16>>2]=t.getUTCMonth(),C[r+20>>2]=t.getUTCFullYear()-1900,C[r+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),i=(t.getTime()-n)/(1e3*60*60*24)|0;C[r+28>>2]=i}var $i=e=>e%4===0&&(e%100!==0||e%400===0),Di=[0,31,60,91,121,152,182,213,244,274,305,335],Ri=[0,31,59,90,120,151,181,212,243,273,304,334],Mi=e=>{var r=$i(e.getFullYear()),t=r?Di:Ri,n=t[e.getMonth()]+e.getDate()-1;return n};function Ii(e,r){e=He(e);var t=new Date(e*1e3);C[r>>2]=t.getSeconds(),C[r+4>>2]=t.getMinutes(),C[r+8>>2]=t.getHours(),C[r+12>>2]=t.getDate(),C[r+16>>2]=t.getMonth(),C[r+20>>2]=t.getFullYear()-1900,C[r+24>>2]=t.getDay();var n=Mi(t)|0;C[r+28>>2]=n,C[r+36>>2]=-(t.getTimezoneOffset()*60);var i=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),c=(a!=s&&t.getTimezoneOffset()==Math.min(s,a))|0;C[r+32>>2]=c}var Ce={},ct=e=>{if(e instanceof $r||e==\"unwind\")return Ae;Er(1,e)},ut=()=>rr||ot>0,lt=e=>{Ae=e,ut()||(l.onExit?.(e),Pe=!0),Er(e,new $r(e))},ji=(e,r)=>{Ae=e,lt(e)},Oi=ji,Gi=()=>{if(!ut())try{Oi(Ae)}catch(e){ct(e)}},ft=e=>{if(!Pe)try{e(),Gi()}catch(r){ct(r)}},yr=()=>performance.now(),xi=(e,r)=>{if(Ce[e]&&(clearTimeout(Ce[e].id),delete Ce[e]),!r)return 0;var t=setTimeout(()=>{delete Ce[e],ft(()=>wt(e,yr()))},r);return Ce[e]={id:t,timeout_ms:r},0},Li=(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),s=new Date(i,6,1),c=a.getTimezoneOffset(),u=s.getTimezoneOffset(),f=Math.max(c,u);m[e>>2]=f*60,C[r>>2]=+(c!=u);var d=v=>{var h=v>=0?\"-\":\"+\",k=Math.abs(v),$=String(Math.floor(k/60)).padStart(2,\"0\"),T=String(k%60).padStart(2,\"0\");return`UTC${h}${$}${T}`},_=d(c),p=d(u);u<c?(O(_,t,17),O(p,n,17)):(O(_,n,17),O(p,t,17))},dt=()=>Date.now(),Ni=1,Bi=e=>e>=0&&e<=3;function Wi(e,r,t){if(r=He(r),!Bi(e))return 28;var n;if(e===0)n=dt();else if(Ni)n=yr();else return 52;var i=Math.round(n*1e3*1e3);return W[t>>3]=BigInt(i),0}var Ui=e=>{console.warn(I(e))},Vi=(e,r)=>ee(I(e,r));function zi(e){if(U.xhrs.has(e)){var r=U.xhrs.get(e);U.xhrs.free(e),r.readyState>0&&r.readyState<4&&r.abort()}}var vt=()=>2147483648,Hi=()=>vt(),qi=()=>!ge,Xi=(e,r)=>we(I(e,r)),Zi=(e,r)=>Math.ceil(e/r)*r,Ki=e=>{var r=$e.buffer.byteLength,t=(e-r+65535)/65536|0;try{return $e.grow(t),Ar(),1}catch{}},Yi=e=>{var r=N.length;e>>>=0;var t=vt();if(e>t)return!1;for(var n=1;n<=4;n*=2){var i=r*(1+.2/n);i=Math.min(i,e+100663296);var a=Math.min(t,Zi(Math.max(e,i),65536)),s=Ki(a);if(s)return!0}return!1};class Ji{allocated=[void 0];freelist=[];get(r){return this.allocated[r]}has(r){return this.allocated[r]!==void 0}allocate(r){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=r,t}free(r){this.allocated[r]=void 0,this.freelist.push(r)}}var U={async openDatabase(e,r){return new Promise((t,n)=>{try{var i=indexedDB.open(e,r)}catch(a){return n(a)}i.onupgradeneeded=a=>{var s=a.target.result;s.objectStoreNames.contains(\"FILES\")&&s.deleteObjectStore(\"FILES\"),s.createObjectStore(\"FILES\")},i.onsuccess=a=>t(a.target.result),i.onerror=n})},async init(){U.xhrs=new Ji,Lr(\"library_fetch_init\");try{var e=await U.openDatabase(\"emscripten_filesystem\",1);U.dbInstance=e}catch{U.dbInstance=!1}finally{xr(\"library_fetch_init\")}}};function gr(e,r,t,n,i){var a=m[e+8>>2];if(!a){t(e,\"no url specified!\");return}var s=I(a),c=e+108,u=I(c+0);u||=\"GET\";var f=m[c+56>>2],d=m[c+68>>2],_=m[c+72>>2],p=m[c+76>>2],v=m[c+80>>2],h=m[c+84>>2],k=m[c+88>>2],$=m[c+52>>2],T=!!($&1),G=!!($&2),P=!!($&64),K=d?I(d):void 0,z=_?I(_):void 0,b=new XMLHttpRequest;if(b.withCredentials=!!N[c+60],b.open(u,s,!P,K,z),P||(b.timeout=f),b.url_=s,b.responseType=\"arraybuffer\",v){var M=I(v);b.overrideMimeType(M)}if(p)for(;;){var se=m[p>>2];if(!se)break;var Xe=m[p+4>>2];if(!Xe)break;p+=8;var L=I(se),ne=I(Xe);b.setRequestHeader(L,ne)}var Q=U.xhrs.allocate(b);m[e>>2]=Q;var Sr=h&&k?N.slice(h,h+k):null;function Ze(){var j=0,H=0;b.response&&T&&m[e+12>>2]===0&&(H=b.response.byteLength),H>0&&(j=Z(H),N.set(new Uint8Array(b.response),j)),m[e+12>>2]=j,X(e+16,H),X(e+24,0);var ie=b.response?b.response.byteLength:0;if(ie&&X(e+32,ie),A[e+40>>1]=b.readyState,A[e+42>>1]=b.status,b.statusText&&O(b.statusText,e+44,64),P){var Ke=_t(b.responseURL);m[e+200>>2]=Ke}}b.onload=j=>{U.xhrs.has(Q)&&(Ze(),b.status>=200&&b.status<300?r(e,b,j):t(e,j))},b.onerror=j=>{U.xhrs.has(Q)&&(Ze(),t(e,j))},b.ontimeout=j=>{U.xhrs.has(Q)&&t(e,j)},b.onprogress=j=>{if(U.xhrs.has(Q)){var H=T&&G&&b.response?b.response.byteLength:0,ie=0;H>0&&T&&G&&(ie=Z(H),N.set(new Uint8Array(b.response),ie)),m[e+12>>2]=ie,X(e+16,H),X(e+24,j.loaded-H),X(e+32,j.total),A[e+40>>1]=b.readyState;var Ke=b.status;b.readyState>=3&&b.status===0&&j.loaded>0&&(Ke=200),A[e+42>>1]=Ke,b.statusText&&O(b.statusText,e+44,64),n(e,j),J(ie)}},b.onreadystatechange=j=>{if(U.xhrs.has(Q)){if(A[e+40>>1]=b.readyState,b.readyState>=2&&(A[e+42>>1]=b.status),!P&&b.readyState===2&&b.responseURL.length>0){var H=_t(b.responseURL);m[e+200>>2]=H}i(e,j)}};try{b.send(Sr)}catch(j){t(e,j)}}var X=(e,r)=>{m[e>>2]=r;var t=m[e>>2];m[e+4>>2]=(r-t)/4294967296},_t=e=>{var r=Y(e)+1,t=Z(r);return t&&O(e,t,r),t};function ht(e,r,t,n,i){if(!e){i(r,0,\"IndexedDB not available!\");return}var a=r+108,s=m[a+64>>2];s||=m[r+8>>2];var c=I(s);try{var u=e.transaction([\"FILES\"],\"readwrite\"),f=u.objectStore(\"FILES\"),d=f.put(t,c);d.onsuccess=_=>{A[r+40>>1]=4,A[r+42>>1]=200,O(\"OK\",r+44,64),n(r,0,c)},d.onerror=_=>{A[r+40>>1]=4,A[r+42>>1]=413,O(\"Payload Too Large\",r+44,64),i(r,0,_)}}catch(_){i(r,0,_)}}function Qi(e,r,t,n){if(!e){n(r,0,\"IndexedDB not available!\");return}var i=r+108,a=m[i+64>>2];a||=m[r+8>>2];var s=I(a);try{var c=e.transaction([\"FILES\"],\"readonly\"),u=c.objectStore(\"FILES\"),f=u.get(s);f.onsuccess=d=>{if(d.target.result){var _=d.target.result,p=_.byteLength||_.length,v=Z(p);N.set(new Uint8Array(_),v),m[r+12>>2]=v,X(r+16,p),X(r+24,0),X(r+32,p),A[r+40>>1]=4,A[r+42>>1]=200,O(\"OK\",r+44,64),t(r,0,_)}else A[r+40>>1]=4,A[r+42>>1]=404,O(\"Not Found\",r+44,64),n(r,0,\"no data\")},f.onerror=d=>{A[r+40>>1]=4,A[r+42>>1]=404,O(\"Not Found\",r+44,64),n(r,0,d)}}catch(d){n(r,0,d)}}function ea(e,r,t,n){if(!e){n(r,0,\"IndexedDB not available!\");return}var i=r+108,a=m[i+64>>2];a||=m[r+8>>2];var s=I(a);try{var c=e.transaction([\"FILES\"],\"readwrite\"),u=c.objectStore(\"FILES\"),f=u.delete(s);f.onsuccess=d=>{var _=d.target.result;m[r+12>>2]=0,X(r+16,0),X(r+24,0),X(r+32,0),A[r+40>>1]=4,A[r+42>>1]=200,O(\"OK\",r+44,64),t(r,0,_)},f.onerror=d=>{A[r+40>>1]=4,A[r+42>>1]=404,O(\"Not Found\",r+44,64),n(r,0,d)}}catch(d){n(r,0,d)}}function ra(e,r,t,n,i){var a=e+108,s=m[a+36>>2],c=m[a+40>>2],u=m[a+44>>2],f=m[a+48>>2],d=m[a+52>>2],_=!!(d&64);function p(L){_?L():ft(L)}var v=(L,ne,Q)=>{p(()=>{s?y(s)(L):r?.(L)})},h=(L,ne)=>{p(()=>{u?y(u)(L):n?.(L)})},k=(L,ne)=>{p(()=>{c?y(c)(L):t?.(L)})},$=(L,ne)=>{p(()=>{f?y(f)(L):i?.(L)})},T=(L,ne,Q)=>{gr(L,v,k,h,$)},G=(L,ne,Q)=>{var Sr=(j,H,ie)=>{p(()=>{s?y(s)(j):r?.(j)})},Ze=(j,H,ie)=>{p(()=>{s?y(s)(j):r?.(j)})};ht(U.dbInstance,L,ne.response,Sr,Ze)},P=(L,ne,Q)=>{gr(L,G,k,h,$)},K=I(a+0),z=!!(d&16),b=!!(d&4),M=!!(d&32);if(K===\"EM_IDB_STORE\"){var se=m[a+84>>2],Xe=m[a+88>>2];ht(U.dbInstance,e,N.slice(se,se+Xe),v,k)}else if(K===\"EM_IDB_DELETE\")ea(U.dbInstance,e,v,k);else if(!z)Qi(U.dbInstance,e,v,M?k:b?P:T);else if(!M)gr(e,b?G:v,k,h,$);else return 0;return e}var qe={},ta=()=>kr||\"./this.program\",Te=()=>{if(!Te.strings){var e=(typeof navigator==\"object\"&&navigator.language||\"C\").replace(\"-\",\"_\")+\".UTF-8\",r={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:e,_:ta()};for(var t in qe)qe[t]===void 0?delete r[t]:r[t]=qe[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Te.strings=n}return Te.strings},na=(e,r)=>{var t=0,n=0;for(var i of Te()){var a=r+t;m[e+n>>2]=a,t+=O(i,a,1/0)+1,n+=4}return 0},ia=(e,r)=>{var t=Te();m[e>>2]=t.length;var n=0;for(var i of t)n+=Y(i)+1;return m[r>>2]=n,0};function aa(e){try{var r=R.getStreamFromFD(e);return o.close(r),0}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return t.errno}}function oa(e,r){try{var t=0,n=0,i=0,a=R.getStreamFromFD(e),s=a.tty?2:o.isDir(a.mode)?3:o.isLink(a.mode)?7:4;return x[r]=s,A[r+2>>1]=i,W[r+8>>3]=BigInt(t),W[r+16>>3]=BigInt(n),0}catch(c){if(typeof o>\"u\"||c.name!==\"ErrnoError\")throw c;return c.errno}}var sa=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=m[r>>2],c=m[r+4>>2];r+=8;var u=o.read(e,x,s,c,n);if(u<0)return-1;if(i+=u,u<c)break;typeof n<\"u\"&&(n+=u)}return i};function ca(e,r,t,n){try{var i=R.getStreamFromFD(e),a=sa(i,r,t);return m[n>>2]=a,0}catch(s){if(typeof o>\"u\"||s.name!==\"ErrnoError\")throw s;return s.errno}}function ua(e,r,t,n){r=He(r);try{if(isNaN(r))return 61;var i=R.getStreamFromFD(e);return o.llseek(i,r,t),W[n>>3]=BigInt(i.position),i.getdents&&r===0&&t===0&&(i.getdents=null),0}catch(a){if(typeof o>\"u\"||a.name!==\"ErrnoError\")throw a;return a.errno}}var la=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=m[r>>2],c=m[r+4>>2];r+=8;var u=o.write(e,x,s,c,n);if(u<0)return-1;if(i+=u,u<c)break;typeof n<\"u\"&&(n+=u)}return i};function fa(e,r,t,n){try{var i=R.getStreamFromFD(e),a=la(i,r,t);return m[n>>2]=a,0}catch(s){if(typeof o>\"u\"||s.name!==\"ErrnoError\")throw s;return s.errno}}var da=e=>e;function va(e,r){try{return ir(N.subarray(e,e+r)),0}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return t.errno}}var gc=e=>(e>>>=0,\"0x\"+e.toString(16).padStart(8,\"0\")),mt=e=>{var r=l[\"_\"+e];return r},_a=(e,r)=>{x.set(e,r)},pt=e=>kt(e),ha=e=>{var r=Y(e)+1,t=pt(r);return O(e,t,r),t},yt=(e,r,t,n,i)=>{var a={string:h=>{var k=0;return h!=null&&h!==0&&(k=ha(h)),k},array:h=>{var k=pt(h.length);return _a(h,k),k}};function s(h){return r===\"string\"?I(h):r===\"boolean\"?!!h:h}var c=mt(e),u=[],f=0;if(n)for(var d=0;d<n.length;d++){var _=a[t[d]];_?(f===0&&(f=S()),u[d]=_(n[d])):u[d]=n[d]}var p=c(...u);function v(h){return f!==0&&w(f),s(h)}return p=v(p),p},ma=(e,r,t,n)=>{var i=!t||t.every(s=>s===\"number\"||s===\"boolean\"),a=r!==\"string\";return a&&i&&!n?mt(e):(...s)=>yt(e,r,t,s,n)};if(o.createPreloadedFile=ln,o.preloadFile=Br,o.staticInit(),Fn(),Nn(),U.init(),l.noExitRuntime&&(rr=l.noExitRuntime),l.preloadPlugins&&(Nr=l.preloadPlugins),l.print&&(we=l.print),l.printErr&&(ee=l.printErr),l.wasmBinary&&(Se=l.wasmBinary),l.arguments&&(Rt=l.arguments),l.thisProgram&&(kr=l.thisProgram),l.preInit)for(typeof l.preInit==\"function\"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();l.ENV=qe,l.ccall=yt,l.cwrap=ma,l.lengthBytesUTF8=Y,l.stringToUTF8=O;function pa(e){if(typeof l.locateFile==\"function\")try{const r=l.locateFile(I(e));if(r){const t=Y(r)+1,n=Z(t);if(n)return O(r,n,t),n}}catch(r){console.warn(\"Module.locateFile failed:\",r)}return 0}function ya(e){try{if(typeof l<\"u\"&&l.workerUrl){var r=l.workerUrl,t=Y(r)+1,n=Z(t);return O(r,n,t),n}}catch(i){console.warn(\"Failed to read Module.workerUrl:\",i)}if(e){var t=Y(I(e))+1,n=Z(t);return O(I(e),n,t),n}return 0}function ga(){return navigator.hardwareConcurrency||1}function wa(e){l._aquaLiveTransports||(l._aquaLiveTransports=new Set),l._aquaLiveTransports.add(e),queueMicrotask(function(){l._aquaLiveTransports&&l._aquaLiveTransports.has(e)&&l._aquaDrainDeferredCompletions(e)})}function Sa(e){l._aquaLiveTransports&&l._aquaLiveTransports.delete(e)}function ba(e,r){if(!l.createDeserializeWorker)return console.error(\"createDeserializeWorker not available - worker-bridge.ts not loaded\"),0;const t=I(e);return l.createDeserializeWorker(t,l,r)?1:0}function ka(e,r,t,n,i){if(!l.submitToWorker)return console.error(\"submitToWorker not available - worker-bridge.ts not loaded\"),0;try{const a=t,s=n,c=new ArrayBuffer(s);return new Uint8Array(c).set(l.HEAPU8.subarray(a,a+s)),l.submitToWorker(e,r,c,i)?1:0}catch(a){return console.error(\"submitToWorker failed:\",a),0}}function Ea(e,r){l.cancelRequest&&l.cancelRequest(e,r)}function wc(){return l.isWorkerReady&&l.isWorkerReady()?1:0}function Ca(){l.terminateWorker&&l.terminateWorker()}function Ta(e,r){typeof globalThis.Sentry<\"u\"&&typeof globalThis.Sentry.captureException==\"function\"&&globalThis.Sentry.captureException(new Error(I(e,r)))}function Fa(e){const r=I(e);try{const t=new URL(r)}catch{return 0}return 1}function Pa(e,r){const t=I(e);let n;try{n=new URL(t)}catch(c){return console.error(`Failed to parse URL ${t} due to error : ${c}`),0}function i(c){return c>>>0}function a(c){const u=Y(c)+1,f=Z(u);return O(c,f,u),i(f)}let s=i(r)>>2;return m[s]=a(n.origin),m[s+1]=a(n.pathname.substring(1)),m[s+2]=a(n.search.substring(1)),m[s+3]=a(n.hash.substring(1)),1}function Aa(e){const r=I(e),t=encodeURIComponent(r),n=Y(t)+1,i=Z(n);return O(t,i,n),i>>>0}function $a(e){l.__mirisPrivatePromiseTracker||(l.__mirisPrivatePromiseTracker=new Map);let r,t;const n=new Promise(function(i,a){r=i,t=a});return l.__mirisPrivatePromiseTracker.set(e,{resolve:r,reject:t}),B.toHandle(n)}function Da(e,r){const t=l.__mirisPrivatePromiseTracker;if(!t||!t.has(e)){console.error(\"[miris] No resolver for tracked promise ID:\",e);return}const{resolve:n}=t.get(e);if(!n){console.error(\"[miris] No resolver for tracked promise ID:\",e);return}t.delete(e),n(B.toValue(r))}function Sc(e,r){const t=l.__mirisPrivatePromiseTracker;if(!t||!t.has(e)){console.error(\"[miris] No rejector for tracked promise ID:\",e);return}const{reject:n}=t.get(e);if(!n){console.error(\"[miris] No rejector for tracked promise ID:\",e);return}t.delete(e),n(B.toValue(r))}var gt,Ra,Ma,Ia,ja,Oa,Ga,xa,La,Na,Ba,Wa,Ua,Va,za,Ha,qa,Xa,Za,Ka,Ya,Ja,Qa,eo,ro,to,no,io,ao,oo,so,co,uo,lo,fo,vo,_o,ho,mo,po,yo,go,wo,So,bo,ko,Eo,Co,To,Fo,Po,Ao,$o,Do,Ro,Mo,Io,jo,Oo,Go,xo,Lo,No,Bo,Wo,Uo,Vo,zo,Ho,qo,Xo,Zo,Ko,Yo,Jo,Qo,es,rs,ts,ns,is,as,Z,J,os,ss,wt,g,St,bt,kt,Et,Ct,Tt,Ft,Pt;function cs(e){gt=e.__getTypeName,l._CreateAquaContext=Ra=e.CreateAquaContext,l._BeginFrame=Ma=e.BeginFrame,l._DestroyAquaContext=Ia=e.DestroyAquaContext,l._SetMaxRequestCacheSize=ja=e.SetMaxRequestCacheSize,l._TriggerTestError=Oa=e.TriggerTestError,l._CreateClientForContext=Ga=e.CreateClientForContext,l._CreateClient=xa=e.CreateClient,l._DestroyClient=La=e.DestroyClient,l._ClearScene=Na=e.ClearScene,l._WaitForSceneExecution=Ba=e.WaitForSceneExecution,l._SetPersistentDataDirectory=Wa=e.SetPersistentDataDirectory,l._SetClientSpatialFormat=Ua=e.SetClientSpatialFormat,l._SetAssetViewerKey=Va=e.SetAssetViewerKey,l._PrefetchContent=za=e.PrefetchContent,l._PrintSceneObjectHierarchy=Ha=e.PrintSceneObjectHierarchy,l._CancelAllSceneExecution=qa=e.CancelAllSceneExecution,l._AddStream=Xa=e.AddStream,l._AddStreamById=Za=e.AddStreamById,l._RemoveStream=Ka=e.RemoveStream,l._SetStreamFetchMode=Ya=e.SetStreamFetchMode,l._GetStreamFetchMode=Ja=e.GetStreamFetchMode,l._GetStreamStatus=Qa=e.GetStreamStatus,l._UpdateSceneExecution=eo=e.UpdateSceneExecution,l._RecordFrameTime=ro=e.RecordFrameTime,l._TakeRenderRequired=to=e.TakeRenderRequired,l._LockScene=no=e.LockScene,l._UnlockScene=io=e.UnlockScene,l._SetMainCameraTransform=ao=e.SetMainCameraTransform,l._SetMainCameraViewFrustum=oo=e.SetMainCameraViewFrustum,l._SetSceneObjectTransform=so=e.SetSceneObjectTransform,l._SetRuntimeSettings=co=e.SetRuntimeSettings,l._SetOctreeSolverMode=uo=e.SetOctreeSolverMode,l._SetBudgetControllerType=lo=e.SetBudgetControllerType,l._SetMaxCacheSize=fo=e.SetMaxCacheSize,l._SetPreferSharkEncodingProfiles=vo=e.SetPreferSharkEncodingProfiles,l._HasFeature=_o=e.HasFeature,l._GetFeatureVersion=ho=e.GetFeatureVersion,l._GetFeatureState=mo=e.GetFeatureState,l._GetAssetFormatVersion=po=e.GetAssetFormatVersion,l._GetSceneChangesCounts=yo=e.GetSceneChangesCounts,l._GetSceneChanges=go=e.GetSceneChanges,l._GetSceneRootObjectId=wo=e.GetSceneRootObjectId,l._GetSceneObjectChildrenCount=So=e.GetSceneObjectChildrenCount,l._GetSceneObjectChildren=bo=e.GetSceneObjectChildren,l._GetSceneObjectType=ko=e.GetSceneObjectType,l._GetDrawnOctantMask=Eo=e.GetDrawnOctantMask,l._GetDrMapLadderRoughnessLevels=Co=e.GetDrMapLadderRoughnessLevels,l._LogOctreeStats=To=e.LogOctreeStats,l._GetSceneObjectParent=Fo=e.GetSceneObjectParent,l._IsSceneObjectAncestorOf=Po=e.IsSceneObjectAncestorOf,l._GetSceneObjectName=Ao=e.GetSceneObjectName,l._GetAttributeCount=$o=e.GetAttributeCount,l._HasAttribute=Do=e.HasAttribute,l._GetMosaicDescriptors=Ro=e.GetMosaicDescriptors,l._GetEccLutData=Mo=e.GetEccLutData,l._GetAttribute=Io=e.GetAttribute,l._TakeAttribute=jo=e.TakeAttribute,l._GetBufferHash=Oo=e.GetBufferHash,l._GetWorldBoundingBox=Go=e.GetWorldBoundingBox,l._GetLocalBoundingBox=xo=e.GetLocalBoundingBox,l._MirisGetLocalTransform=Lo=e.MirisGetLocalTransform,l._MirisGetWorldTransform=No=e.MirisGetWorldTransform,l._MirisGetTransformRelativeToAncestor=Bo=e.MirisGetTransformRelativeToAncestor,l._GetBoundingBoxRelativeToAncestor=Wo=e.GetBoundingBoxRelativeToAncestor,l._GetMetadata=Uo=e.GetMetadata,l._GetLodIndex=Vo=e.GetLodIndex,l._GetLibAquaVersion=zo=e.GetLibAquaVersion,l._GetLodMinMaxIndices=Ho=e.GetLodMinMaxIndices,l._GetCameraCount=qo=e.GetCameraCount,l._GetCameraIds=Xo=e.GetCameraIds,l._GetDefaultCameraId=Zo=e.GetDefaultCameraId,l._GetViewingVolumeId=Ko=e.GetViewingVolumeId,l._GetSceneMetadata=Yo=e.GetSceneMetadata,l._GetSceneOperatorCount=Jo=e.GetSceneOperatorCount,l._SetVariantSelection=Qo=e.SetVariantSelection,l.__Z26GetSceneObjectNameAsStringP10AquaClienti=es=e._Z26GetSceneObjectNameAsStringP10AquaClienti,l.__Z14GetAssetsAsyncP10AquaClientRKNSt3__26vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEEiPN4aqua6v0_0_013ArrayCallbackINSE_9AssetInfoEEE=rs=e._Z14GetAssetsAsyncP10AquaClientRKNSt3__26vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEEiPN4aqua6v0_0_013ArrayCallbackINSE_9AssetInfoEEE,l.__Z21GetAvailableTagsAsyncP10AquaClientPN4aqua6v0_0_013ArrayCallbackINSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE=ts=e._Z21GetAvailableTagsAsyncP10AquaClientPN4aqua6v0_0_013ArrayCallbackINSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE,l.__Z33TakeEvictedClientSideAttributeIdsP10AquaClient=ns=e._Z33TakeEvictedClientSideAttributeIdsP10AquaClient,l.__Z30GetActiveClientSideIdsCheckSumv=is=e._Z30GetActiveClientSideIdsCheckSumv,as=e.__cxa_free_exception,l._malloc=Z=e.malloc,l._free=J=e.free,l._aquaDrainDeferredCompletions=os=e.aquaDrainDeferredCompletions,l._onWorkerResult=ss=e.onWorkerResult,wt=e._emscripten_timeout,g=e.setThrew,St=e._emscripten_tempret_set,bt=e._emscripten_stack_restore,kt=e._emscripten_stack_alloc,Et=e.emscripten_stack_get_current,Ct=e.__cxa_decrement_exception_refcount,Tt=e.__cxa_increment_exception_refcount,Ft=e.__cxa_can_catch,Pt=e.__cxa_get_exception_ptr}var At={__cxa_begin_catch:qt,__cxa_end_catch:Xt,__cxa_find_matching_catch_2:Zt,__cxa_find_matching_catch_3:Kt,__cxa_find_matching_catch_4:Yt,__cxa_rethrow:Jt,__cxa_throw:Qt,__cxa_uncaught_exceptions:en,__resumeException:rn,__syscall_fcntl64:fn,__syscall_fstat64:dn,__syscall_ioctl:vn,__syscall_lstat64:_n,__syscall_newfstatat:hn,__syscall_openat:mn,__syscall_rmdir:pn,__syscall_stat64:yn,__syscall_unlinkat:gn,_abort_js:wn,_embind_register_bigint:bn,_embind_register_bool:kn,_embind_register_class:Wn,_embind_register_class_constructor:Vn,_embind_register_class_function:zn,_embind_register_class_property:Hn,_embind_register_emval:qn,_embind_register_enum:Zn,_embind_register_enum_value:Kn,_embind_register_float:Jn,_embind_register_function:Qn,_embind_register_integer:ei,_embind_register_memory_view:ri,_embind_register_optional:ni,_embind_register_std_string:ii,_embind_register_std_wstring:fi,_embind_register_void:di,_emscripten_runtime_keepalive_clear:vi,_emval_create_invoker:yi,_emval_decref:hr,_emval_get_global:gi,_emval_get_property:wi,_emval_incref:Si,_emval_invoke:bi,_emval_new_array:ki,_emval_new_cstring:Ei,_emval_run_destructors:Ci,_emval_set_property:Ti,_gmtime_js:Ai,_localtime_js:Ii,_setitimer_js:xi,_tzset_js:Li,clock_time_get:Wi,emjsCreateTrackedPromise:$a,emjsEncodeUriComponent:Aa,emjsGetPartsFromUrl:Pa,emjsIsValidUrl:Fa,emjsResolveTrackedPromise:Da,emjsSentryCaptureException:Ta,emscripten_console_warn:Ui,emscripten_date_now:dt,emscripten_errn:Vi,emscripten_fetch_free:zi,emscripten_get_heap_max:Hi,emscripten_get_now:yr,emscripten_is_main_browser_thread:qi,emscripten_outn:Xi,emscripten_resize_heap:Yi,emscripten_start_fetch:ra,environ_get:na,environ_sizes_get:ia,fd_close:aa,fd_fdstat_get:oa,fd_read:ca,fd_seek:ua,fd_write:fa,getHardwareConcurrency:ga,getWorkerUrlFromModule:ya,impl_cancelRequest:Ea,impl_createDeserializeWorker:ba,impl_submitToWorker:ka,impl_terminateWorker:Ca,invoke_diii:nc,invoke_diiiii:Es,invoke_djj:zs,invoke_fi:Is,invoke_fiii:Zs,invoke_i:gs,invoke_ii:ls,invoke_iii:ms,invoke_iiii:ks,invoke_iiiid:ic,invoke_iiiii:ys,invoke_iiiiid:ec,invoke_iiiiii:Ss,invoke_iiiiiii:js,invoke_iiiiiiii:rc,invoke_iiiiiiiii:Ls,invoke_iiiiiiiiii:Rs,invoke_iiiiiiiiiii:$s,invoke_iiiiiiiiiiii:Ds,invoke_iiiiij:fc,invoke_iiiiijj:ac,invoke_iiiij:lc,invoke_iiiiji:Bs,invoke_iiiijj:oc,invoke_iiij:uc,invoke_iij:ws,invoke_iiji:Ys,invoke_iijiiii:bs,invoke_j:Gs,invoke_ji:Ns,invoke_jii:Cs,invoke_jiiii:tc,invoke_v:ps,invoke_vi:fs,invoke_viddi:Us,invoke_vif:Xs,invoke_vii:vs,invoke_viif:dc,invoke_viii:ds,invoke_viiifi:qs,invoke_viiii:us,invoke_viiiiddiii:Hs,invoke_viiiii:hs,invoke_viiiiii:_s,invoke_viiiiiii:Ps,invoke_viiiiiiii:Os,invoke_viiiiiiiiii:sc,invoke_viiiiiiiiiii:As,invoke_viiiiiiiiiiiiiii:cc,invoke_viiij:Ws,invoke_viij:Vs,invoke_viiji:Fs,invoke_viijii:Ms,invoke_viijiiii:Ks,invoke_vij:Qs,invoke_viji:Js,invoke_vijii:xs,invoke_vijiiii:Ts,llvm_eh_typeid_for:da,proc_exit:lt,random_get:va,scheduleMicrotaskDrain:wa,tryLocateWorkerFile:pa,unregisterTransportInstance:Sa};function us(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function ls(e,r){var t=S();try{return y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;g(1,0)}}function fs(e,r){var t=S();try{y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;g(1,0)}}function ds(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function vs(e,r,t){var n=S();try{y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function _s(e,r,t,n,i,a,s){var c=S();try{y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function hs(e,r,t,n,i,a){var s=S();try{y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function ms(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function ps(e){var r=S();try{y(e)()}catch(t){if(w(r),t!==t+0)throw t;g(1,0)}}function ys(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function gs(e){var r=S();try{return y(e)()}catch(t){if(w(r),t!==t+0)throw t;g(1,0)}}function ws(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function Ss(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function bs(e,r,t,n,i,a,s){var c=S();try{return y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function ks(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Es(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Cs(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;return g(1,0),0n}}function Ts(e,r,t,n,i,a,s){var c=S();try{y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function Fs(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Ps(e,r,t,n,i,a,s,c){var u=S();try{y(e)(r,t,n,i,a,s,c)}catch(f){if(w(u),f!==f+0)throw f;g(1,0)}}function As(e,r,t,n,i,a,s,c,u,f,d,_){var p=S();try{y(e)(r,t,n,i,a,s,c,u,f,d,_)}catch(v){if(w(p),v!==v+0)throw v;g(1,0)}}function $s(e,r,t,n,i,a,s,c,u,f,d){var _=S();try{return y(e)(r,t,n,i,a,s,c,u,f,d)}catch(p){if(w(_),p!==p+0)throw p;g(1,0)}}function Ds(e,r,t,n,i,a,s,c,u,f,d,_){var p=S();try{return y(e)(r,t,n,i,a,s,c,u,f,d,_)}catch(v){if(w(p),v!==v+0)throw v;g(1,0)}}function Rs(e,r,t,n,i,a,s,c,u,f){var d=S();try{return y(e)(r,t,n,i,a,s,c,u,f)}catch(_){if(w(d),_!==_+0)throw _;g(1,0)}}function Ms(e,r,t,n,i,a){var s=S();try{y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Is(e,r){var t=S();try{return y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;g(1,0)}}function js(e,r,t,n,i,a,s){var c=S();try{return y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function Os(e,r,t,n,i,a,s,c,u){var f=S();try{y(e)(r,t,n,i,a,s,c,u)}catch(d){if(w(f),d!==d+0)throw d;g(1,0)}}function Gs(e){var r=S();try{return y(e)()}catch(t){if(w(r),t!==t+0)throw t;return g(1,0),0n}}function xs(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Ls(e,r,t,n,i,a,s,c,u){var f=S();try{return y(e)(r,t,n,i,a,s,c,u)}catch(d){if(w(f),d!==d+0)throw d;g(1,0)}}function Ns(e,r){var t=S();try{return y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;return g(1,0),0n}}function Bs(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Ws(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Us(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Vs(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function zs(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function Hs(e,r,t,n,i,a,s,c,u,f){var d=S();try{y(e)(r,t,n,i,a,s,c,u,f)}catch(_){if(w(d),_!==_+0)throw _;g(1,0)}}function qs(e,r,t,n,i,a){var s=S();try{y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Xs(e,r,t){var n=S();try{y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function Zs(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Ks(e,r,t,n,i,a,s,c){var u=S();try{y(e)(r,t,n,i,a,s,c)}catch(f){if(w(u),f!==f+0)throw f;g(1,0)}}function Ys(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Js(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Qs(e,r,t){var n=S();try{y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function ec(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function rc(e,r,t,n,i,a,s,c){var u=S();try{return y(e)(r,t,n,i,a,s,c)}catch(f){if(w(u),f!==f+0)throw f;g(1,0)}}function tc(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;return g(1,0),0n}}function nc(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function ic(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function ac(e,r,t,n,i,a,s){var c=S();try{return y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function oc(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function sc(e,r,t,n,i,a,s,c,u,f,d){var _=S();try{y(e)(r,t,n,i,a,s,c,u,f,d)}catch(p){if(w(_),p!==p+0)throw p;g(1,0)}}function cc(e,r,t,n,i,a,s,c,u,f,d,_,p,v,h,k){var $=S();try{y(e)(r,t,n,i,a,s,c,u,f,d,_,p,v,h,k)}catch(T){if(w($),T!==T+0)throw T;g(1,0)}}function uc(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function lc(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function fc(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function dc(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function wr(){if(ue>0){be=wr;return}if(jt(),ue>0){be=wr;return}function e(){l.calledRun=!0,!Pe&&(Ot(),Cr?.(l),l.onRuntimeInitialized?.(),Gt())}l.setStatus?(l.setStatus(\"Running...\"),setTimeout(()=>{setTimeout(()=>l.setStatus(\"\"),1),e()},1)):e()}var de;return de=await Vt(),wr(),Pr?Ye=l:Ye=new Promise((e,r)=>{Cr=e,Tr=r}),Ye}export default vc;\n\n";
63
+ var _glueSource = "async function dc($t={}){var Ye,l=$t,br=typeof window==\"object\",ge=typeof WorkerGlobalScope<\"u\",Dt=typeof process==\"object\"&&process.versions?.node&&process.type!=\"renderer\",vc=!br&&!Dt&&!ge,Rt=[],kr=\"./this.program\",Er=(e,r)=>{throw r},It=import.meta.url,Je=\"\";function Mt(e){return l.locateFile?l.locateFile(e,Je):Je+e}var Qe,Fe;if(br||ge){try{Je=new URL(\".\",It).href}catch{}ge&&(Fe=e=>{var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}),Qe=async e=>{var r=await fetch(e,{credentials:\"same-origin\"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+\" : \"+r.url)}}var we=console.log.bind(console),ee=console.error.bind(console),Se,Pe=!1,Ae;function _c(e,r){e||ce(r)}var hc=e=>e.startsWith(\"file://\"),Cr,Tr,$e,G,L,A,ve,C,m,De,Re,W,Fr,Pr=!1;function Ar(){var e=$e.buffer;l.HEAP8=G=new Int8Array(e),A=new Int16Array(e),l.HEAPU8=L=new Uint8Array(e),ve=new Uint16Array(e),l.HEAP32=C=new Int32Array(e),l.HEAPU32=m=new Uint32Array(e),l.HEAPF32=De=new Float32Array(e),l.HEAPF64=Re=new Float64Array(e),W=new BigInt64Array(e),Fr=new BigUint64Array(e)}function jt(){if(l.preRun)for(typeof l.preRun==\"function\"&&(l.preRun=[l.preRun]);l.preRun.length;)Ht(l.preRun.shift());Dr(Ir)}function Ot(){Pr=!0,!l.noFSInit&&!o.initialized&&o.init(),ae.init(),de.__wasm_call_ctors(),o.ignorePermissions=!1}function xt(){if(l.postRun)for(typeof l.postRun==\"function\"&&(l.postRun=[l.postRun]);l.postRun.length;)zt(l.postRun.shift());Dr(Rr)}function ce(e){l.onAbort?.(e),e=\"Aborted(\"+e+\")\",ee(e),Pe=!0,e+=\". Build with -sASSERTIONS for more info.\";var r=new WebAssembly.RuntimeError(e);throw Tr?.(r),r}var er;function Gt(){return l.locateFile?Mt(\"AquaApi.wasm\"):new URL(\"AquaApi.wasm\",import.meta.url).href}function Bt(e){if(e==er&&Se)return new Uint8Array(Se);if(Fe)return Fe(e);throw\"both async and sync fetching of the wasm failed\"}async function Lt(e){if(!Se)try{var r=await Qe(e);return new Uint8Array(r)}catch{}return Bt(e)}async function Nt(e,r){try{var t=await Lt(e),n=await WebAssembly.instantiate(t,r);return n}catch(i){ee(`failed to asynchronously prepare wasm: ${i}`),ce(i)}}async function Wt(e,r,t){if(!e)try{var n=fetch(r,{credentials:\"same-origin\"}),i=await WebAssembly.instantiateStreaming(n,t);return i}catch(a){ee(`wasm streaming compile failed: ${a}`),ee(\"falling back to ArrayBuffer instantiation\")}return Nt(r,t)}function Ut(){return{env:At,wasi_snapshot_preview1:At}}async function Vt(){function e(a,s){return de=a.exports,$e=de.memory,Ar(),Yr=de.__indirect_function_table,ss(de),de}function r(a){return e(a.instance)}var t=Ut();if(l.instantiateWasm)return new Promise((a,s)=>{l.instantiateWasm(t,(c,u)=>{a(e(c,u))})});er??=Gt();var n=await Wt(Se,er,t),i=r(n);return i}class $r{name=\"ExitStatus\";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var Dr=e=>{for(;e.length>0;)e.shift()(l)},Rr=[],zt=e=>Rr.push(e),Ir=[],Ht=e=>Ir.push(e);function mc(e,r=\"i8\"){switch(r.endsWith(\"*\")&&(r=\"*\"),r){case\"i1\":return G[e];case\"i8\":return G[e];case\"i16\":return A[e>>1];case\"i32\":return C[e>>2];case\"i64\":return W[e>>3];case\"float\":return De[e>>2];case\"double\":return Re[e>>3];case\"*\":return m[e>>2];default:ce(`invalid type for getValue: ${r}`)}}var rr=!0;function pc(e,r,t=\"i8\"){switch(t.endsWith(\"*\")&&(t=\"*\"),t){case\"i1\":G[e]=r;break;case\"i8\":G[e]=r;break;case\"i16\":A[e>>1]=r;break;case\"i32\":C[e>>2]=r;break;case\"i64\":W[e>>3]=BigInt(r);break;case\"float\":De[e>>2]=r;break;case\"double\":Re[e>>3]=r;break;case\"*\":m[e>>2]=r;break;default:ce(`invalid type for setValue: ${t}`)}}var w=e=>bt(e),S=()=>Et(),Ie=[],Me=0,qt=e=>{var r=new tr(e);return r.get_caught()||(r.set_caught(!0),Me--),r.set_rethrown(!1),Ie.push(r),Tt(e),Pt(e)},re=0,Xt=()=>{g(0,0);var e=Ie.pop();Ct(e.excPtr),re=0};class tr{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){m[this.ptr+4>>2]=r}get_type(){return m[this.ptr+4>>2]}set_destructor(r){m[this.ptr+8>>2]=r}get_destructor(){return m[this.ptr+8>>2]}set_caught(r){r=r?1:0,G[this.ptr+12]=r}get_caught(){return G[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,G[this.ptr+13]=r}get_rethrown(){return G[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){m[this.ptr+16>>2]=r}get_adjusted_ptr(){return m[this.ptr+16>>2]}}var je=e=>St(e),nr=e=>{var r=re;if(!r)return je(0),0;var t=new tr(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return je(0),r;for(var i of e){if(i===0||i===n)break;var a=t.ptr+16;if(Ft(i,n,a))return je(i),r}return je(n),r},Zt=()=>nr([]),Kt=e=>nr([e]),Yt=(e,r)=>nr([e,r]),Jt=()=>{var e=Ie.pop();e||ce(\"no exception to throw\");var r=e.excPtr;throw e.get_rethrown()||(Ie.push(e),e.set_rethrown(!0),e.set_caught(!1),Me++),re=r,re},Qt=(e,r,t)=>{var n=new tr(e);throw n.init(r,t),re=e,Me++,re},en=()=>Me,rn=e=>{throw re||(re=e),re},Oe=()=>{var e=C[+R.varargs>>2];return R.varargs+=4,e},_e=Oe,D={isAbs:e=>e.charAt(0)===\"/\",splitPath:e=>{var r=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var i=e[n];i===\".\"?e.splice(n,1):i===\"..\"?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift(\"..\");return e},normalize:e=>{var r=D.isAbs(e),t=e.slice(-1)===\"/\";return e=D.normalizeArray(e.split(\"/\").filter(n=>!!n),!r).join(\"/\"),!e&&!r&&(e=\".\"),e&&t&&(e+=\"/\"),(r?\"/\":\"\")+e},dirname:e=>{var r=D.splitPath(e),t=r[0],n=r[1];return!t&&!n?\".\":(n&&(n=n.slice(0,-1)),t+n)},basename:e=>e&&e.match(/([^\\/]+|\\/)\\/*$/)[1],join:(...e)=>D.normalize(e.join(\"/\")),join2:(e,r)=>D.normalize(e+\"/\"+r)},tn=()=>e=>crypto.getRandomValues(e),ir=e=>{(ir=tn())(e)},he={resolve:(...e)=>{for(var r=\"\",t=!1,n=e.length-1;n>=-1&&!t;n--){var i=n>=0?e[n]:o.cwd();if(typeof i!=\"string\")throw new TypeError(\"Arguments to path.resolve must be strings\");if(!i)return\"\";r=i+\"/\"+r,t=D.isAbs(i)}return r=D.normalizeArray(r.split(\"/\").filter(a=>!!a),!t).join(\"/\"),(t?\"/\":\"\")+r||\".\"},relative:(e,r)=>{e=he.resolve(e).slice(1),r=he.resolve(r).slice(1);function t(f){for(var d=0;d<f.length&&f[d]===\"\";d++);for(var _=f.length-1;_>=0&&f[_]===\"\";_--);return d>_?[]:f.slice(d,_-d+1)}for(var n=t(e.split(\"/\")),i=t(r.split(\"/\")),a=Math.min(n.length,i.length),s=a,c=0;c<a;c++)if(n[c]!==i[c]){s=c;break}for(var u=[],c=s;c<n.length;c++)u.push(\"..\");return u=u.concat(i.slice(s)),u.join(\"/\")}},Mr=typeof TextDecoder<\"u\"?new TextDecoder:void 0,jr=(e,r,t,n)=>{var i=r+t;if(n)return i;for(;e[r]&&!(r>=i);)++r;return r},me=(e,r=0,t,n)=>{var i=jr(e,r,t,n);if(i-r>16&&e.buffer&&Mr)return Mr.decode(e.subarray(r,i));for(var a=\"\";r<i;){var s=e[r++];if(!(s&128)){a+=String.fromCharCode(s);continue}var c=e[r++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|c);continue}var u=e[r++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|u:s=(s&7)<<18|c<<12|u<<6|e[r++]&63,s<65536)a+=String.fromCharCode(s);else{var f=s-65536;a+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return a},ar=[],Y=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Or=(e,r,t,n)=>{if(!(n>0))return 0;for(var i=t,a=t+n-1,s=0;s<e.length;++s){var c=e.codePointAt(s);if(c<=127){if(t>=a)break;r[t++]=c}else if(c<=2047){if(t+1>=a)break;r[t++]=192|c>>6,r[t++]=128|c&63}else if(c<=65535){if(t+2>=a)break;r[t++]=224|c>>12,r[t++]=128|c>>6&63,r[t++]=128|c&63}else{if(t+3>=a)break;r[t++]=240|c>>18,r[t++]=128|c>>12&63,r[t++]=128|c>>6&63,r[t++]=128|c&63,s++}}return r[t]=0,t-i},or=(e,r,t)=>{var n=t>0?t:Y(e)+1,i=new Array(n),a=Or(e,i,0,i.length);return r&&(i.length=a),i},nn=()=>{if(!ar.length){var e=null;if(typeof window<\"u\"&&typeof window.prompt==\"function\"&&(e=window.prompt(\"Input: \"),e!==null&&(e+=`\n`)),!e)return null;ar=or(e,!0)}return ar.shift()},ae={ttys:[],init(){},shutdown(){},register(e,r){ae.ttys[e]={input:[],output:[],ops:r},o.registerDevice(e,ae.stream_ops)},stream_ops:{open(e){var r=ae.ttys[e.node.rdev];if(!r)throw new o.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,i){if(!e.tty||!e.tty.ops.get_char)throw new o.ErrnoError(60);for(var a=0,s=0;s<n;s++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new o.ErrnoError(29)}if(c===void 0&&a===0)throw new o.ErrnoError(6);if(c==null)break;a++,r[t+s]=c}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,i){if(!e.tty||!e.tty.ops.put_char)throw new o.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch{throw new o.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char(e){return nn()},put_char(e,r){r===null||r===10?(we(me(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(we(me(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(ee(me(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(ee(me(e.output)),e.output=[])}}},xr=e=>{ce()},E={ops_table:null,mount(e){return E.createNode(null,\"/\",16895,0)},createNode(e,r,t,n){if(o.isBlkdev(t)||o.isFIFO(t))throw new o.ErrnoError(63);E.ops_table||={dir:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr,lookup:E.node_ops.lookup,mknod:E.node_ops.mknod,rename:E.node_ops.rename,unlink:E.node_ops.unlink,rmdir:E.node_ops.rmdir,readdir:E.node_ops.readdir,symlink:E.node_ops.symlink},stream:{llseek:E.stream_ops.llseek}},file:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr},stream:{llseek:E.stream_ops.llseek,read:E.stream_ops.read,write:E.stream_ops.write,mmap:E.stream_ops.mmap,msync:E.stream_ops.msync}},link:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr,readlink:E.node_ops.readlink},stream:{}},chrdev:{node:{getattr:E.node_ops.getattr,setattr:E.node_ops.setattr},stream:o.chrdev_stream_ops}};var i=o.createNode(e,r,t,n);return o.isDir(i.mode)?(i.node_ops=E.ops_table.dir.node,i.stream_ops=E.ops_table.dir.stream,i.contents={}):o.isFile(i.mode)?(i.node_ops=E.ops_table.file.node,i.stream_ops=E.ops_table.file.stream,i.usedBytes=0,i.contents=null):o.isLink(i.mode)?(i.node_ops=E.ops_table.link.node,i.stream_ops=E.ops_table.link.stream):o.isChrdev(i.mode)&&(i.node_ops=E.ops_table.chrdev.node,i.stream_ops=E.ops_table.chrdev.stream),i.atime=i.mtime=i.ctime=Date.now(),e&&(e.contents[r]=i,e.atime=e.mtime=e.ctime=i.atime),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var i=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=o.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,o.isDir(e.mode)?r.size=4096:o.isFile(e.mode)?r.size=e.usedBytes:o.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of[\"mode\",\"atime\",\"mtime\",\"ctime\"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&E.resizeFileStorage(e,r.size)},lookup(e,r){throw E.doesNotExistError||(E.doesNotExistError=new o.ErrnoError(44),E.doesNotExistError.stack=\"<generic error, no stack>\"),E.doesNotExistError},mknod(e,r,t,n){return E.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=o.lookupNode(r,t)}catch{}if(n){if(o.isDir(e.mode))for(var i in n.contents)throw new o.ErrnoError(55);o.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=o.lookupNode(e,r);for(var n in t.contents)throw new o.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[\".\",\"..\",...Object.keys(e.contents)]},symlink(e,r,t){var n=E.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!o.isLink(e.mode))throw new o.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,n);if(s>8&&a.subarray)r.set(a.subarray(i,i+s),t);else for(var c=0;c<s;c++)r[t+c]=a[i+c];return s},write(e,r,t,n,i,a){if(r.buffer===G.buffer&&(a=!1),!n)return 0;var s=e.node;if(s.mtime=s.ctime=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&i===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(i+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),i),n}if(E.expandFileStorage(s,i+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),i);else for(var c=0;c<n;c++)s.contents[i+c]=r[t+c];return s.usedBytes=Math.max(s.usedBytes,i+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&o.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new o.ErrnoError(28);return n},mmap(e,r,t,n,i){if(!o.isFile(e.node.mode))throw new o.ErrnoError(43);var a,s,c=e.node.contents;if(!(i&2)&&c&&c.buffer===G.buffer)s=!1,a=c.byteOffset;else{if(s=!0,a=xr(r),!a)throw new o.ErrnoError(48);c&&((t>0||t+r<c.length)&&(c.subarray?c=c.subarray(t,t+r):c=Array.prototype.slice.call(c,t,t+r)),G.set(c,a))}return{ptr:a,allocated:s}},msync(e,r,t,n,i){return E.stream_ops.write(e,r,0,n,t,!1),0}}},an=e=>{var r={r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090},t=r[e];if(typeof t>\"u\")throw new Error(`Unknown file open mode: ${e}`);return t},sr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},on=async e=>{var r=await Qe(e);return new Uint8Array(r)},sn=(...e)=>o.createDataFile(...e),cn=e=>e,ue=0,be=null,Gr=e=>{if(ue--,l.monitorRunDependencies?.(ue),ue==0&&be){var r=be;be=null,r()}},Br=e=>{ue++,l.monitorRunDependencies?.(ue)},Lr=[],un=async(e,r)=>{typeof Browser<\"u\"&&Browser.init();for(var t of Lr)if(t.canHandle(r))return t.handle(e,r);return e},Nr=async(e,r,t,n,i,a,s,c)=>{var u=r?he.resolve(D.join2(e,r)):e,f=cn(`cp ${u}`);Br(f);try{var d=t;typeof t==\"string\"&&(d=await on(t)),d=await un(d,u),c?.(),a||sn(e,r,d,n,i,s)}finally{Gr(f)}},ln=(e,r,t,n,i,a,s,c,u,f)=>{Nr(e,r,t,n,i,c,u,f).then(a).catch(s)},o={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name=\"ErrnoError\";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=o.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return o.isDir(this.mode)}get isDevice(){return o.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new o.ErrnoError(44);r.follow_mount??=!0,D.isAbs(e)||(e=o.cwd()+\"/\"+e);e:for(var t=0;t<40;t++){for(var n=e.split(\"/\").filter(f=>!!f),i=o.root,a=\"/\",s=0;s<n.length;s++){var c=s===n.length-1;if(c&&r.parent)break;if(n[s]!==\".\"){if(n[s]===\"..\"){if(a=D.dirname(a),o.isRoot(i)){e=a+\"/\"+n.slice(s+1).join(\"/\"),t--;continue e}else i=i.parent;continue}a=D.join2(a,n[s]);try{i=o.lookupNode(i,n[s])}catch(f){if(f?.errno===44&&c&&r.noent_okay)return{path:a};throw f}if(o.isMountpoint(i)&&(!c||r.follow_mount)&&(i=i.mounted.root),o.isLink(i.mode)&&(!c||r.follow)){if(!i.node_ops.readlink)throw new o.ErrnoError(52);var u=i.node_ops.readlink(i);D.isAbs(u)||(u=D.dirname(a)+\"/\"+u),e=u+\"/\"+n.slice(s+1).join(\"/\");continue e}}}return{path:a,node:i}}throw new o.ErrnoError(32)},getPath(e){for(var r;;){if(o.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!==\"/\"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%o.nameTable.length},hashAddNode(e){var r=o.hashName(e.parent.id,e.name);e.name_next=o.nameTable[r],o.nameTable[r]=e},hashRemoveNode(e){var r=o.hashName(e.parent.id,e.name);if(o.nameTable[r]===e)o.nameTable[r]=e.name_next;else for(var t=o.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=o.mayLookup(e);if(t)throw new o.ErrnoError(t);for(var n=o.hashName(e.id,r),i=o.nameTable[n];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===r)return i}return o.lookup(e,r)},createNode(e,r,t,n){var i=new o.FSNode(e,r,t,n);return o.hashAddNode(i),i},destroyNode(e){o.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=[\"r\",\"w\",\"rw\"][e&3];return e&512&&(r+=\"w\"),r},nodePermissions(e,r){return o.ignorePermissions?0:r.includes(\"r\")&&!(e.mode&292)||r.includes(\"w\")&&!(e.mode&146)||r.includes(\"x\")&&!(e.mode&73)?2:0},mayLookup(e){if(!o.isDir(e.mode))return 54;var r=o.nodePermissions(e,\"x\");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!o.isDir(e.mode))return 54;try{var t=o.lookupNode(e,r);return 20}catch{}return o.nodePermissions(e,\"wx\")},mayDelete(e,r,t){var n;try{n=o.lookupNode(e,r)}catch(a){return a.errno}var i=o.nodePermissions(e,\"wx\");if(i)return i;if(t){if(!o.isDir(n.mode))return 54;if(o.isRoot(n)||o.getPath(n)===o.cwd())return 10}else if(o.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?o.isLink(e.mode)?32:o.isDir(e.mode)&&(o.flagsToPermissionString(r)!==\"r\"||r&576)?31:o.nodePermissions(e,o.flagsToPermissionString(r)):44},checkOpExists(e,r){if(!e)throw new o.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=o.MAX_OPEN_FDS;e++)if(!o.streams[e])return e;throw new o.ErrnoError(33)},getStreamChecked(e){var r=o.getStream(e);if(!r)throw new o.ErrnoError(8);return r},getStream:e=>o.streams[e],createStream(e,r=-1){return e=Object.assign(new o.FSStream,e),r==-1&&(r=o.nextfd()),e.fd=r,o.streams[r]=e,e},closeStream(e){o.streams[e]=null},dupStream(e,r=-1){var t=o.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,i=n?e:r;n??=r.node_ops.setattr,o.checkOpExists(n,63),n(i,t)},chrdev_stream_ops:{open(e){var r=o.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new o.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){o.devices[e]={stream_ops:r}},getDevice:e=>o.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e==\"function\"&&(r=e,e=!1),o.syncFSRequests++,o.syncFSRequests>1&&ee(`warning: ${o.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=o.getMounts(o.root.mount),n=0;function i(s){return o.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,i(s));++n>=t.length&&i(null)}t.forEach(s=>{if(!s.type.syncfs)return a(null);s.type.syncfs(s,e,a)})},mount(e,r,t){var n=t===\"/\",i=!t,a;if(n&&o.root)throw new o.ErrnoError(10);if(!n&&!i){var s=o.lookupPath(t,{follow_mount:!1});if(t=s.path,a=s.node,o.isMountpoint(a))throw new o.ErrnoError(10);if(!o.isDir(a.mode))throw new o.ErrnoError(54)}var c={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(c);return u.mount=c,c.root=u,n?o.root=u:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),u},unmount(e){var r=o.lookupPath(e,{follow_mount:!1});if(!o.isMountpoint(r.node))throw new o.ErrnoError(28);var t=r.node,n=t.mounted,i=o.getMounts(n);Object.keys(o.nameTable).forEach(s=>{for(var c=o.nameTable[s];c;){var u=c.name_next;i.includes(c.mount)&&o.destroyNode(c),c=u}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=o.lookupPath(e,{parent:!0}),i=n.node,a=D.basename(e);if(!a)throw new o.ErrnoError(28);if(a===\".\"||a===\"..\")throw new o.ErrnoError(20);var s=o.mayCreate(i,a);if(s)throw new o.ErrnoError(s);if(!i.node_ops.mknod)throw new o.ErrnoError(63);return i.node_ops.mknod(i,a,r,t)},statfs(e){return o.statfsNode(o.lookupPath(e,{follow:!0}).node)},statfsStream(e){return o.statfsNode(e.node)},statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:o.nextInode,ffree:o.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,o.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,o.mknod(e,r,0)},mkdirTree(e,r){var t=e.split(\"/\"),n=\"\";for(var i of t)if(i){(n||D.isAbs(e))&&(n+=\"/\"),n+=i;try{o.mkdir(n,r)}catch(a){if(a.errno!=20)throw a}}},mkdev(e,r,t){return typeof t>\"u\"&&(t=r,r=438),r|=8192,o.mknod(e,r,t)},symlink(e,r){if(!he.resolve(e))throw new o.ErrnoError(44);var t=o.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new o.ErrnoError(44);var i=D.basename(r),a=o.mayCreate(n,i);if(a)throw new o.ErrnoError(a);if(!n.node_ops.symlink)throw new o.ErrnoError(63);return n.node_ops.symlink(n,i,e)},rename(e,r){var t=D.dirname(e),n=D.dirname(r),i=D.basename(e),a=D.basename(r),s,c,u;if(s=o.lookupPath(e,{parent:!0}),c=s.node,s=o.lookupPath(r,{parent:!0}),u=s.node,!c||!u)throw new o.ErrnoError(44);if(c.mount!==u.mount)throw new o.ErrnoError(75);var f=o.lookupNode(c,i),d=he.relative(e,n);if(d.charAt(0)!==\".\")throw new o.ErrnoError(28);if(d=he.relative(r,t),d.charAt(0)!==\".\")throw new o.ErrnoError(55);var _;try{_=o.lookupNode(u,a)}catch{}if(f!==_){var p=o.isDir(f.mode),v=o.mayDelete(c,i,p);if(v)throw new o.ErrnoError(v);if(v=_?o.mayDelete(u,a,p):o.mayCreate(u,a),v)throw new o.ErrnoError(v);if(!c.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(f)||_&&o.isMountpoint(_))throw new o.ErrnoError(10);if(u!==c&&(v=o.nodePermissions(c,\"w\"),v))throw new o.ErrnoError(v);o.hashRemoveNode(f);try{c.node_ops.rename(f,u,a),f.parent=u}catch(h){throw h}finally{o.hashAddNode(f)}}},rmdir(e){var r=o.lookupPath(e,{parent:!0}),t=r.node,n=D.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!0);if(a)throw new o.ErrnoError(a);if(!t.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.rmdir(t,n),o.destroyNode(i)},readdir(e){var r=o.lookupPath(e,{follow:!0}),t=r.node,n=o.checkOpExists(t.node_ops.readdir,54);return n(t)},unlink(e){var r=o.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new o.ErrnoError(44);var n=D.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!1);if(a)throw new o.ErrnoError(a);if(!t.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.unlink(t,n),o.destroyNode(i)},readlink(e){var r=o.lookupPath(e),t=r.node;if(!t)throw new o.ErrnoError(44);if(!t.node_ops.readlink)throw new o.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=o.lookupPath(e,{follow:!r}),n=t.node,i=o.checkOpExists(n.node_ops.getattr,63);return i(n)},fstat(e){var r=o.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,i=n?r:t;return n??=t.node_ops.getattr,o.checkOpExists(n,63),n(i)},lstat(e){return o.stat(e,!0)},doChmod(e,r,t,n){o.doSetAttr(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;if(typeof e==\"string\"){var i=o.lookupPath(e,{follow:!t});n=i.node}else n=e;o.doChmod(null,n,r,t)},lchmod(e,r){o.chmod(e,r,!0)},fchmod(e,r){var t=o.getStreamChecked(e);o.doChmod(t,t.node,r,!1)},doChown(e,r,t){o.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var i;if(typeof e==\"string\"){var a=o.lookupPath(e,{follow:!n});i=a.node}else i=e;o.doChown(null,i,n)},lchown(e,r,t){o.chown(e,r,t,!0)},fchown(e,r,t){var n=o.getStreamChecked(e);o.doChown(n,n.node,!1)},doTruncate(e,r,t){if(o.isDir(r.mode))throw new o.ErrnoError(31);if(!o.isFile(r.mode))throw new o.ErrnoError(28);var n=o.nodePermissions(r,\"w\");if(n)throw new o.ErrnoError(n);o.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new o.ErrnoError(28);var t;if(typeof e==\"string\"){var n=o.lookupPath(e,{follow:!0});t=n.node}else t=e;o.doTruncate(null,t,r)},ftruncate(e,r){var t=o.getStreamChecked(e);if(r<0||(t.flags&2097155)===0)throw new o.ErrnoError(28);o.doTruncate(t,t.node,r)},utime(e,r,t){var n=o.lookupPath(e,{follow:!0}),i=n.node,a=o.checkOpExists(i.node_ops.setattr,63);a(i,{atime:r,mtime:t})},open(e,r,t=438){if(e===\"\")throw new o.ErrnoError(44);r=typeof r==\"string\"?an(r):r,r&64?t=t&4095|32768:t=0;var n,i;if(typeof e==\"object\")n=e;else{i=e.endsWith(\"/\");var a=o.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=a.node,e=a.path}var s=!1;if(r&64)if(n){if(r&128)throw new o.ErrnoError(20)}else{if(i)throw new o.ErrnoError(31);n=o.mknod(e,t|511,0),s=!0}if(!n)throw new o.ErrnoError(44);if(o.isChrdev(n.mode)&&(r&=-513),r&65536&&!o.isDir(n.mode))throw new o.ErrnoError(54);if(!s){var c=o.mayOpen(n,r);if(c)throw new o.ErrnoError(c)}r&512&&!s&&o.truncate(n,0),r&=-131713;var u=o.createStream({node:n,path:o.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),s&&o.chmod(n,t&511),l.logReadFiles&&!(r&1)&&(e in o.readFiles||(o.readFiles[e]=1)),u},close(e){if(o.isClosed(e))throw new o.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{o.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(o.isClosed(e))throw new o.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new o.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new o.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,i){if(n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===1)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.read)throw new o.ErrnoError(28);var a=typeof i<\"u\";if(!a)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,i);return a||(e.position+=s),s},write(e,r,t,n,i,a){if(n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===0)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.write)throw new o.ErrnoError(28);e.seekable&&e.flags&1024&&o.llseek(e,0,2);var s=typeof i<\"u\";if(!s)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var c=e.stream_ops.write(e,r,t,n,i,a);return s||(e.position+=c),c},mmap(e,r,t,n,i){if((n&2)!==0&&(i&2)===0&&(e.flags&2097155)!==2)throw new o.ErrnoError(2);if((e.flags&2097155)===1)throw new o.ErrnoError(2);if(!e.stream_ops.mmap)throw new o.ErrnoError(43);if(!r)throw new o.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,i)},msync(e,r,t,n,i){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,i):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new o.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||\"binary\",r.encoding!==\"utf8\"&&r.encoding!==\"binary\")throw new Error(`Invalid encoding type \"${r.encoding}\"`);var t=o.open(e,r.flags),n=o.stat(e),i=n.size,a=new Uint8Array(i);return o.read(t,a,0,i,0),r.encoding===\"utf8\"&&(a=me(a)),o.close(t),a},writeFile(e,r,t={}){t.flags=t.flags||577;var n=o.open(e,t.flags,t.mode);if(typeof r==\"string\"&&(r=new Uint8Array(or(r,!0))),ArrayBuffer.isView(r))o.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error(\"Unsupported data type\");o.close(n)},cwd:()=>o.currentPath,chdir(e){var r=o.lookupPath(e,{follow:!0});if(r.node===null)throw new o.ErrnoError(44);if(!o.isDir(r.node.mode))throw new o.ErrnoError(54);var t=o.nodePermissions(r.node,\"x\");if(t)throw new o.ErrnoError(t);o.currentPath=r.path},createDefaultDirectories(){o.mkdir(\"/tmp\"),o.mkdir(\"/home\"),o.mkdir(\"/home/web_user\")},createDefaultDevices(){o.mkdir(\"/dev\"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(n,i,a,s,c)=>s,llseek:()=>0}),o.mkdev(\"/dev/null\",o.makedev(1,3)),ae.register(o.makedev(5,0),ae.default_tty_ops),ae.register(o.makedev(6,0),ae.default_tty1_ops),o.mkdev(\"/dev/tty\",o.makedev(5,0)),o.mkdev(\"/dev/tty1\",o.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(ir(e),r=e.byteLength),e[--r]);o.createDevice(\"/dev\",\"random\",t),o.createDevice(\"/dev\",\"urandom\",t),o.mkdir(\"/dev/shm\"),o.mkdir(\"/dev/shm/tmp\")},createSpecialDirectories(){o.mkdir(\"/proc\");var e=o.mkdir(\"/proc/self\");o.mkdir(\"/proc/self/fd\"),o.mount({mount(){var r=o.createNode(e,\"fd\",16895,73);return r.stream_ops={llseek:E.stream_ops.llseek},r.node_ops={lookup(t,n){var i=+n,a=o.getStreamChecked(i),s={parent:null,mount:{mountpoint:\"fake\"},node_ops:{readlink:()=>a.path},id:i+1};return s.parent=s,s},readdir(){return Array.from(o.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},\"/proc/self/fd\")},createStandardStreams(e,r,t){e?o.createDevice(\"/dev\",\"stdin\",e):o.symlink(\"/dev/tty\",\"/dev/stdin\"),r?o.createDevice(\"/dev\",\"stdout\",null,r):o.symlink(\"/dev/tty\",\"/dev/stdout\"),t?o.createDevice(\"/dev\",\"stderr\",null,t):o.symlink(\"/dev/tty1\",\"/dev/stderr\");var n=o.open(\"/dev/stdin\",0),i=o.open(\"/dev/stdout\",1),a=o.open(\"/dev/stderr\",1)},staticInit(){o.nameTable=new Array(4096),o.mount(E,{},\"/\"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:E}},init(e,r,t){o.initialized=!0,e??=l.stdin,r??=l.stdout,t??=l.stderr,o.createStandardStreams(e,r,t)},quit(){o.initialized=!1;for(var e of o.streams)e&&o.close(e)},findObject(e,r){var t=o.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=o.lookupPath(e,{follow:!r});e=t.path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=o.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=D.basename(e),t=o.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path===\"/\"}catch(i){n.error=i.errno}return n},createPath(e,r,t,n){e=typeof e==\"string\"?e:o.getPath(e);for(var i=r.split(\"/\").reverse();i.length;){var a=i.pop();if(a){var s=D.join2(e,a);try{o.mkdir(s)}catch(c){if(c.errno!=20)throw c}e=s}}return s},createFile(e,r,t,n,i){var a=D.join2(typeof e==\"string\"?e:o.getPath(e),r),s=sr(n,i);return o.create(a,s)},createDataFile(e,r,t,n,i,a){var s=r;e&&(e=typeof e==\"string\"?e:o.getPath(e),s=r?D.join2(e,r):e);var c=sr(n,i),u=o.create(s,c);if(t){if(typeof t==\"string\"){for(var f=new Array(t.length),d=0,_=t.length;d<_;++d)f[d]=t.charCodeAt(d);t=f}o.chmod(u,c|146);var p=o.open(u,577);o.write(p,t,0,t.length,0,a),o.close(p),o.chmod(u,c)}},createDevice(e,r,t,n){var i=D.join2(typeof e==\"string\"?e:o.getPath(e),r),a=sr(!!t,!!n);o.createDevice.major??=64;var s=o.makedev(o.createDevice.major++,0);return o.registerDevice(s,{open(c){c.seekable=!1},close(c){n?.buffer?.length&&n(10)},read(c,u,f,d,_){for(var p=0,v=0;v<d;v++){var h;try{h=t()}catch{throw new o.ErrnoError(29)}if(h===void 0&&p===0)throw new o.ErrnoError(6);if(h==null)break;p++,u[f+v]=h}return p&&(c.node.atime=Date.now()),p},write(c,u,f,d,_){for(var p=0;p<d;p++)try{n(u[f+p])}catch{throw new o.ErrnoError(29)}return d&&(c.node.mtime=c.node.ctime=Date.now()),p}}),o.mkdev(i,a,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<\"u\")throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");try{e.contents=Fe(e.url)}catch{throw new o.ErrnoError(29)}},createLazyFile(e,r,t,n,i){class a{lengthKnown=!1;chunks=[];get(v){if(!(v>this.length-1||v<0)){var h=v%this.chunkSize,k=v/this.chunkSize|0;return this.getter(k)[h]}}setDataGetter(v){this.getter=v}cacheLength(){var v=new XMLHttpRequest;if(v.open(\"HEAD\",t,!1),v.send(null),!(v.status>=200&&v.status<300||v.status===304))throw new Error(\"Couldn't load \"+t+\". Status: \"+v.status);var h=Number(v.getResponseHeader(\"Content-length\")),k,$=(k=v.getResponseHeader(\"Accept-Ranges\"))&&k===\"bytes\",T=(k=v.getResponseHeader(\"Content-Encoding\"))&&k===\"gzip\",x=1024*1024;$||(x=h);var P=(z,b)=>{if(z>b)throw new Error(\"invalid range (\"+z+\", \"+b+\") or no bytes requested!\");if(b>h-1)throw new Error(\"only \"+h+\" bytes available! programmer error!\");var I=new XMLHttpRequest;if(I.open(\"GET\",t,!1),h!==x&&I.setRequestHeader(\"Range\",\"bytes=\"+z+\"-\"+b),I.responseType=\"arraybuffer\",I.overrideMimeType&&I.overrideMimeType(\"text/plain; charset=x-user-defined\"),I.send(null),!(I.status>=200&&I.status<300||I.status===304))throw new Error(\"Couldn't load \"+t+\". Status: \"+I.status);return I.response!==void 0?new Uint8Array(I.response||[]):or(I.responseText||\"\",!0)},K=this;K.setDataGetter(z=>{var b=z*x,I=(z+1)*x-1;if(I=Math.min(I,h-1),typeof K.chunks[z]>\"u\"&&(K.chunks[z]=P(b,I)),typeof K.chunks[z]>\"u\")throw new Error(\"doXHR failed!\");return K.chunks[z]}),(T||!h)&&(x=h=1,h=this.getter(0).length,x=h,we(\"LazyFiles on gzip forces download of the whole file when length is accessed\")),this._length=h,this._chunkSize=x,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<\"u\"){if(!ge)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var s=new a,c={isDevice:!1,contents:s}}else var c={isDevice:!1,url:t};var u=o.createFile(e,r,c,n,i);c.contents?u.contents=c.contents:c.url&&(u.contents=null,u.url=c.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var f={},d=Object.keys(u.stream_ops);d.forEach(p=>{var v=u.stream_ops[p];f[p]=(...h)=>(o.forceLoadFile(u),v(...h))});function _(p,v,h,k,$){var T=p.node.contents;if($>=T.length)return 0;var x=Math.min(T.length-$,k);if(T.slice)for(var P=0;P<x;P++)v[h+P]=T[$+P];else for(var P=0;P<x;P++)v[h+P]=T.get($+P);return x}return f.read=(p,v,h,k,$)=>(o.forceLoadFile(u),_(p,v,h,k,$)),f.mmap=(p,v,h,k,$)=>{o.forceLoadFile(u);var T=xr(v);if(!T)throw new o.ErrnoError(48);return _(p,G,T,v,h),{ptr:T,allocated:!0}},u.stream_ops=f,u}},M=(e,r,t)=>e?me(L,e,r,t):\"\",R={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(D.isAbs(r))return r;var n;if(e===-100)n=o.cwd();else{var i=R.getStreamFromFD(e);n=i.path}if(r.length==0){if(!t)throw new o.ErrnoError(44);return n}return n+\"/\"+r},writeStat(e,r){m[e>>2]=r.dev,m[e+4>>2]=r.mode,m[e+8>>2]=r.nlink,m[e+12>>2]=r.uid,m[e+16>>2]=r.gid,m[e+20>>2]=r.rdev,W[e+24>>3]=BigInt(r.size),C[e+32>>2]=4096,C[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return W[e+40>>3]=BigInt(Math.floor(t/1e3)),m[e+48>>2]=t%1e3*1e3*1e3,W[e+56>>3]=BigInt(Math.floor(n/1e3)),m[e+64>>2]=n%1e3*1e3*1e3,W[e+72>>3]=BigInt(Math.floor(i/1e3)),m[e+80>>2]=i%1e3*1e3*1e3,W[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){m[e+4>>2]=r.bsize,m[e+60>>2]=r.bsize,W[e+8>>3]=BigInt(r.blocks),W[e+16>>3]=BigInt(r.bfree),W[e+24>>3]=BigInt(r.bavail),W[e+32>>3]=BigInt(r.files),W[e+40>>3]=BigInt(r.ffree),m[e+48>>2]=r.fsid,m[e+64>>2]=r.flags,m[e+56>>2]=r.namelen},doMsync(e,r,t,n,i){if(!o.isFile(r.node.mode))throw new o.ErrnoError(43);if(n&2)return 0;var a=L.slice(e,e+t);o.msync(r,a,i,t,n)},getStreamFromFD(e){var r=o.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=M(e);return r}};function fn(e,r,t){R.varargs=t;try{var n=R.getStreamFromFD(e);switch(r){case 0:{var i=Oe();if(i<0)return-28;for(;o.streams[i];)i++;var a;return a=o.dupStream(n,i),a.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var i=Oe();return n.flags|=i,0}case 12:{var i=_e(),s=0;return A[i+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof o>\"u\"||c.name!==\"ErrnoError\")throw c;return-c.errno}}function dn(e,r){try{return R.writeStat(r,o.fstat(e))}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return-t.errno}}function vn(e,r,t){R.varargs=t;try{var n=R.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var i=n.tty.ops.ioctl_tcgets(n),a=_e();C[a>>2]=i.c_iflag||0,C[a+4>>2]=i.c_oflag||0,C[a+8>>2]=i.c_cflag||0,C[a+12>>2]=i.c_lflag||0;for(var s=0;s<32;s++)G[a+s+17]=i.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var a=_e(),c=C[a>>2],u=C[a+4>>2],f=C[a+8>>2],d=C[a+12>>2],_=[],s=0;s<32;s++)_.push(G[a+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:c,c_oflag:u,c_cflag:f,c_lflag:d,c_cc:_})}return 0}case 21519:{if(!n.tty)return-59;var a=_e();return C[a>>2]=0,0}case 21520:return n.tty?-28:-59;case 21537:case 21531:{var a=_e();return o.ioctl(n,r,a)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var p=n.tty.ops.ioctl_tiocgwinsz(n.tty),a=_e();A[a>>1]=p[0],A[a+2>>1]=p[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(v){if(typeof o>\"u\"||v.name!==\"ErrnoError\")throw v;return-v.errno}}function _n(e,r){try{return e=R.getStr(e),R.writeStat(r,o.lstat(e))}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return-t.errno}}function hn(e,r,t,n){try{r=R.getStr(r);var i=n&256,a=n&4096;return n=n&-6401,r=R.calculateAt(e,r,a),R.writeStat(t,i?o.lstat(r):o.stat(r))}catch(s){if(typeof o>\"u\"||s.name!==\"ErrnoError\")throw s;return-s.errno}}function mn(e,r,t,n){R.varargs=n;try{r=R.getStr(r),r=R.calculateAt(e,r);var i=n?Oe():0;return o.open(r,t,i).fd}catch(a){if(typeof o>\"u\"||a.name!==\"ErrnoError\")throw a;return-a.errno}}function pn(e){try{return e=R.getStr(e),o.rmdir(e),0}catch(r){if(typeof o>\"u\"||r.name!==\"ErrnoError\")throw r;return-r.errno}}function yn(e,r){try{return e=R.getStr(e),R.writeStat(r,o.stat(e))}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return-t.errno}}function gn(e,r,t){try{if(r=R.getStr(r),r=R.calculateAt(e,r),!t)o.unlink(r);else if(t===512)o.rmdir(r);else return-28;return 0}catch(n){if(typeof o>\"u\"||n.name!==\"ErrnoError\")throw n;return-n.errno}}var wn=()=>ce(\"\"),V=e=>{for(var r=\"\";;){var t=L[e++];if(!t)return r;r+=String.fromCharCode(t)}},pe={},le={},xe={},ke=class extends Error{constructor(r){super(r),this.name=\"BindingError\"}},F=e=>{throw new ke(e)};function Sn(e,r,t={}){var n=r.name;if(e||F(`type \"${n}\" must have a positive integer typeid pointer`),le.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;F(`Cannot register type '${n}' twice`)}if(le[e]=r,delete xe[e],pe.hasOwnProperty(e)){var i=pe[e];delete pe[e],i.forEach(a=>a())}}function q(e,r,t={}){return Sn(e,r,t)}var Wr=(e,r,t)=>{switch(r){case 1:return t?n=>G[n]:n=>L[n];case 2:return t?n=>A[n>>1]:n=>ve[n>>1];case 4:return t?n=>C[n>>2]:n=>m[n>>2];case 8:return t?n=>W[n>>3]:n=>Fr[n>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},bn=(e,r,t,n,i)=>{r=V(r);const a=n===0n;let s=c=>c;if(a){const c=t*8;s=u=>BigInt.asUintN(c,u),i=s(i)}q(e,{name:r,fromWireType:s,toWireType:(c,u)=>(typeof u==\"number\"&&(u=BigInt(u)),u),readValueFromPointer:Wr(r,t,!a),destructorFunction:null})},kn=(e,r,t,n)=>{r=V(r),q(e,{name:r,fromWireType:function(i){return!!i},toWireType:function(i,a){return a?t:n},readValueFromPointer:function(i){return this.fromWireType(L[i])},destructorFunction:null})},En=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),cr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}F(r(e)+\" instance already deleted\")},ur=!1,Ur=e=>{},Cn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Vr=e=>{e.count.value-=1;var r=e.count.value===0;r&&Cn(e)},Ee=e=>typeof FinalizationRegistry>\"u\"?(Ee=r=>r,e):(ur=new FinalizationRegistry(r=>{Vr(r.$$)}),Ee=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t};ur.register(r,i,r)}return r},Ur=r=>ur.unregister(r),Ee(e)),Ge=[],Tn=()=>{for(;Ge.length;){var e=Ge.pop();e.$$.deleteScheduled=!1,e.delete()}},zr,Fn=()=>{let e=Be.prototype;Object.assign(e,{isAliasOf(t){if(!(this instanceof Be)||!(t instanceof Be))return!1;var n=this.$$.ptrType.registeredClass,i=this.$$.ptr;t.$$=t.$$;for(var a=t.$$.ptrType.registeredClass,s=t.$$.ptr;n.baseClass;)i=n.upcast(i),n=n.baseClass;for(;a.baseClass;)s=a.upcast(s),a=a.baseClass;return n===a&&i===s},clone(){if(this.$$.ptr||cr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ee(Object.create(Object.getPrototypeOf(this),{$$:{value:En(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||cr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&F(\"Object already scheduled for deletion\"),Ur(this),Vr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||cr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&F(\"Object already scheduled for deletion\"),Ge.push(this),Ge.length===1&&zr&&zr(Tn),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)};function Be(){}var Le=(e,r)=>Object.defineProperty(r,\"name\",{value:e}),Hr={},qr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...i){return e[r].overloadTable.hasOwnProperty(i.length)||F(`Function '${t}' called with an invalid number of arguments (${i.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[i.length].apply(this,i)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},lr=(e,r,t)=>{l.hasOwnProperty(e)?((t===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[t]!==void 0)&&F(`Cannot register public name '${e}' twice`),qr(l,e,e),l[e].overloadTable.hasOwnProperty(t)&&F(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),l[e].overloadTable[t]=r):(l[e]=r,l[e].argCount=t)},Pn=48,An=57,$n=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,\"$\");var r=e.charCodeAt(0);return r>=Pn&&r<=An?`_${e}`:e};function Dn(e,r,t,n,i,a,s,c){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=i,this.getActualType=a,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Ne=(e,r,t)=>{for(;r!==t;)r.upcast||F(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e},fr=e=>{if(e===null)return\"null\";var r=typeof e;return r===\"object\"||r===\"array\"||r===\"function\"?e.toString():\"\"+e};function Rn(e,r){if(r===null)return this.isReference&&F(`null is not a valid ${this.name}`),0;r.$$||F(`Cannot pass \"${fr(r)}\" as a ${this.name}`),r.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Ne(r.$$.ptr,t,this.registeredClass);return n}function In(e,r){var t;if(r===null)return this.isReference&&F(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&F(`Cannot pass \"${fr(r)}\" as a ${this.name}`),r.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&F(`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=Ne(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&F(\"Passing raw pointer to smart pointer is illegal\"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:F(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var i=r.clone();t=this.rawShare(t,N.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:F(\"Unsupporting sharing policy\")}return t}function Mn(e,r){if(r===null)return this.isReference&&F(`null is not a valid ${this.name}`),0;r.$$||F(`Cannot pass \"${fr(r)}\" as a ${this.name}`),r.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&F(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Ne(r.$$.ptr,t,this.registeredClass);return n}function We(e){return this.fromWireType(m[e>>2])}var Xr=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=Xr(e,r,t.baseClass);return n===null?null:t.downcast(n)},jn={},On=(e,r)=>{for(r===void 0&&F(\"ptr should not be undefined\");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},xn=(e,r)=>(r=On(e,r),jn[r]),Gn=class extends Error{constructor(r){super(r),this.name=\"InternalError\"}},Ue=e=>{throw new Gn(e)},Ve=(e,r)=>{(!r.ptrType||!r.ptr)&&Ue(\"makeClassHandle requires ptr and ptrType\");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Ue(\"Both smartPtrType and smartPtr must be specified\"),r.count={value:1},Ee(Object.create(e,{$$:{value:r,writable:!0}}))};function Bn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=xn(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Ve(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ve(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(r),s=Hr[a];if(!s)return i.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var u=Xr(r,this.registeredClass,c.registeredClass);return u===null?i.call(this):this.isSmartPointer?Ve(c.registeredClass.instancePrototype,{ptrType:c,ptr:u,smartPtrType:this,smartPtr:e}):Ve(c.registeredClass.instancePrototype,{ptrType:c,ptr:u})}var Ln=()=>{Object.assign(ze.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},readValueFromPointer:We,fromWireType:Bn})};function ze(e,r,t,n,i,a,s,c,u,f,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=u,this.rawShare=f,this.rawDestructor=d,!i&&r.baseClass===void 0?n?(this.toWireType=Rn,this.destructorFunction=null):(this.toWireType=Mn,this.destructorFunction=null):this.toWireType=In}var Zr=(e,r,t)=>{l.hasOwnProperty(e)||Ue(\"Replacing nonexistent public symbol\"),l[e].overloadTable!==void 0&&t!==void 0?l[e].overloadTable[t]=r:(l[e]=r,l[e].argCount=t)},Kr=[],Yr,y=e=>{var r=Kr[e];return r||(Kr[e]=r=Yr.get(e)),r},te=(e,r,t=!1)=>{e=V(e);function n(){var a=y(r);return a}var i=n();return typeof i!=\"function\"&&F(`unknown function pointer with signature ${e}: ${r}`),i};class Nn extends Error{}var Jr=e=>{var r=gt(e),t=V(r);return J(r),t},ye=(e,r)=>{var t=[],n={};function i(a){if(!n[a]&&!le[a]){if(xe[a]){xe[a].forEach(i);return}t.push(a),n[a]=!0}}throw r.forEach(i),new Nn(`${e}: `+t.map(Jr).join([\", \"]))},oe=(e,r,t)=>{e.forEach(c=>xe[c]=r);function n(c){var u=t(c);u.length!==e.length&&Ue(\"Mismatched type converter count\");for(var f=0;f<e.length;++f)q(e[f],u[f])}var i=new Array(r.length),a=[],s=0;r.forEach((c,u)=>{le.hasOwnProperty(c)?i[u]=le[c]:(a.push(c),pe.hasOwnProperty(c)||(pe[c]=[]),pe[c].push(()=>{i[u]=le[c],++s,s===a.length&&n(i)}))}),a.length===0&&n(i)},Wn=(e,r,t,n,i,a,s,c,u,f,d,_,p)=>{d=V(d),a=te(i,a),c&&=te(s,c),f&&=te(u,f),p=te(_,p);var v=$n(d);lr(v,function(){ye(`Cannot construct ${d} due to unbound types`,[n])}),oe([e,r,t],n?[n]:[],h=>{h=h[0];var k,$;n?(k=h.registeredClass,$=k.instancePrototype):$=Be.prototype;var T=Le(d,function(...I){if(Object.getPrototypeOf(this)!==x)throw new ke(`Use 'new' to construct ${d}`);if(P.constructor_body===void 0)throw new ke(`${d} has no accessible constructor`);var se=P.constructor_body[I.length];if(se===void 0)throw new ke(`Tried to invoke ctor of ${d} with invalid number of parameters (${I.length}) - expected (${Object.keys(P.constructor_body).toString()}) parameters instead!`);return se.apply(this,I)}),x=Object.create($,{constructor:{value:T}});T.prototype=x;var P=new Dn(d,T,x,p,k,a,c,f);P.baseClass&&(P.baseClass.__derivedClasses??=[],P.baseClass.__derivedClasses.push(P));var K=new ze(d,P,!0,!1,!1),z=new ze(d+\"*\",P,!1,!1,!1),b=new ze(d+\" const*\",P,!1,!0,!1);return Hr[e]={pointerType:z,constPointerType:b},Zr(v,T),[K,z,b]})},dr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(m[r+n*4>>2]);return t},vr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Qr(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function Un(e,r,t,n){var i=Qr(e),a=e.length-2,s=[],c=[\"fn\"];r&&c.push(\"thisWired\");for(var u=0;u<a;++u)s.push(`arg${u}`),c.push(`arg${u}Wired`);s=s.join(\",\"),c=c.join(\",\");var f=`return function (${s}) {\n`;i&&(f+=`var destructors = [];\n`);var d=i?\"destructors\":\"null\",_=[\"humanName\",\"throwBindingError\",\"invoker\",\"fn\",\"runDestructors\",\"fromRetWire\",\"toClassParamWire\"];r&&(f+=`var thisWired = toClassParamWire(${d}, this);\n`);for(var u=0;u<a;++u){var p=`toArg${u}Wire`;f+=`var arg${u}Wired = ${p}(${d}, arg${u});\n`,_.push(p)}f+=(t||n?\"var rv = \":\"\")+`invoker(${c});\n`;var v=t?\"rv\":\"\";if(i)f+=`runDestructors(destructors);\n`;else for(var u=r?1:2;u<e.length;++u){var h=u===1?\"thisWired\":\"arg\"+(u-2)+\"Wired\";e[u].destructorFunction!==null&&(f+=`${h}_dtor(${h});\n`,_.push(`${h}_dtor`))}return t&&(f+=`var ret = fromRetWire(rv);\nreturn ret;\n`),f+=`}\n`,new Function(_,f)}function _r(e,r,t,n,i,a){var s=r.length;s<2&&F(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");for(var c=r[1]!==null&&t!==null,u=Qr(r),f=!r[0].isVoid,d=s-2,_=r[0],p=r[1],v=[e,F,n,i,vr,_.fromWireType.bind(_),p?.toWireType.bind(p)],h=2;h<s;++h){var k=r[h];v.push(k.toWireType.bind(k))}if(!u)for(var h=c?1:2;h<r.length;++h)r[h].destructorFunction!==null&&v.push(r[h].destructorFunction);var T=Un(r,c,f,a)(...v);return Le(e,T)}var Vn=(e,r,t,n,i,a)=>{var s=dr(r,t);i=te(n,i);var c=[a],u=[];oe([],[e],f=>{f=f[0];var d=`constructor ${f.name}`;if(f.registeredClass.constructor_body===void 0&&(f.registeredClass.constructor_body=[]),f.registeredClass.constructor_body[r-1]!==void 0)throw new ke(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${f.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return f.registeredClass.constructor_body[r-1]=()=>{ye(`Cannot construct ${f.name} due to unbound types`,s)},oe([],s,_=>(_.splice(1,0,null),f.registeredClass.constructor_body[r-1]=_r(d,_,null,i,a),[])),[]})},et=e=>{e=e.trim();const r=e.indexOf(\"(\");return r===-1?e:e.slice(0,r)},zn=(e,r,t,n,i,a,s,c,u,f)=>{var d=dr(t,n);r=V(r),r=et(r),a=te(i,a,u),oe([],[e],_=>{_=_[0];var p=`${_.name}.${r}`;r.startsWith(\"@@\")&&(r=Symbol[r.substring(2)]),c&&_.registeredClass.pureVirtualFunctions.push(r);function v(){ye(`Cannot call ${p} due to unbound types`,d)}var h=_.registeredClass.instancePrototype,k=h[r];return k===void 0||k.overloadTable===void 0&&k.className!==_.name&&k.argCount===t-2?(v.argCount=t-2,v.className=_.name,h[r]=v):(qr(h,r,p),h[r].overloadTable[t-2]=v),oe([],d,$=>{var T=_r(p,$,_,a,s,u);return h[r].overloadTable===void 0?(T.argCount=t-2,h[r]=T):h[r].overloadTable[t-2]=T,[]}),[]})},rt=(e,r,t)=>(e instanceof Object||F(`${t} with invalid \"this\": ${e}`),e instanceof r.registeredClass.constructor||F(`${t} incompatible with \"this\" of type ${e.constructor.name}`),e.$$.ptr||F(`cannot call emscripten binding method ${t} on deleted object`),Ne(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Hn=(e,r,t,n,i,a,s,c,u,f)=>{r=V(r),i=te(n,i),oe([],[e],d=>{d=d[0];var _=`${d.name}.${r}`,p={get(){ye(`Cannot access ${_} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return u?p.set=()=>ye(`Cannot access ${_} due to unbound types`,[t,s]):p.set=v=>F(_+\" is a read-only property\"),Object.defineProperty(d.registeredClass.instancePrototype,r,p),oe([],u?[t,s]:[t],v=>{var h=v[0],k={get(){var T=rt(this,d,_+\" getter\");return h.fromWireType(i(a,T))},enumerable:!0};if(u){u=te(c,u);var $=v[1];k.set=function(T){var x=rt(this,d,_+\" setter\"),P=[];u(f,x,$.toWireType(P,T)),vr(P)}}return Object.defineProperty(d.registeredClass.instancePrototype,r,k),[]}),[]})},tt=[],fe=[0,1,,1,null,1,!0,1,!1,1],hr=e=>{e>9&&--fe[e+1]===0&&(fe[e]=void 0,tt.push(e))},N={toValue:e=>(e||F(`Cannot use deleted val. handle = ${e}`),fe[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=tt.pop()||fe.length;return fe[r]=e,fe[r+1]=1,r}}}},nt={name:\"emscripten::val\",fromWireType:e=>{var r=N.toValue(e);return hr(e),r},toWireType:(e,r)=>N.toHandle(r),readValueFromPointer:We,destructorFunction:null},qn=e=>q(e,nt),Xn=(e,r,t)=>{switch(r){case 1:return t?function(n){return this.fromWireType(G[n])}:function(n){return this.fromWireType(L[n])};case 2:return t?function(n){return this.fromWireType(A[n>>1])}:function(n){return this.fromWireType(ve[n>>1])};case 4:return t?function(n){return this.fromWireType(C[n>>2])}:function(n){return this.fromWireType(m[n>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Zn=(e,r,t,n)=>{r=V(r);function i(){}i.values={},q(e,{name:r,constructor:i,fromWireType:function(a){return this.constructor.values[a]},toWireType:(a,s)=>s.value,readValueFromPointer:Xn(r,t,n),destructorFunction:null}),lr(r,i)},it=(e,r)=>{var t=le[e];return t===void 0&&F(`${r} has unknown type ${Jr(e)}`),t},Kn=(e,r,t)=>{var n=it(e,\"enum\");r=V(r);var i=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:Le(`${n.name}_${r}`,function(){})}});i.values[t]=a,i[r]=a},Yn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(De[t>>2])};case 8:return function(t){return this.fromWireType(Re[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Jn=(e,r,t)=>{r=V(r),q(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>i,readValueFromPointer:Yn(r,t),destructorFunction:null})},Qn=(e,r,t,n,i,a,s,c)=>{var u=dr(r,t);e=V(e),e=et(e),i=te(n,i,s),lr(e,function(){ye(`Cannot call ${e} due to unbound types`,u)},r-1),oe([],u,f=>{var d=[f[0],null].concat(f.slice(1));return Zr(e,_r(e,d,null,i,a,s),r-1),[]})},ei=(e,r,t,n,i)=>{r=V(r);const a=n===0;let s=u=>u;if(a){var c=32-8*t;s=u=>u<<c>>>c,i=s(i)}q(e,{name:r,fromWireType:s,toWireType:(u,f)=>f,readValueFromPointer:Wr(r,t,n!==0),destructorFunction:null})},ri=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],i=n[r];function a(s){var c=m[s>>2],u=m[s+4>>2];return new i(G.buffer,u,c)}t=V(t),q(e,{name:t,fromWireType:a,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},ti=Object.assign({optional:!0},nt),ni=(e,r)=>{q(e,ti)},O=(e,r,t)=>Or(e,L,r,t),ii=(e,r)=>{r=V(r);var t=!0;q(e,{name:r,fromWireType(n){var i=m[n>>2],a=n+4,s;if(t)s=M(a,i,!0);else{s=\"\";for(var c=0;c<i;++c)s+=String.fromCharCode(L[a+c])}return J(n),s},toWireType(n,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var a,s=typeof i==\"string\";s||ArrayBuffer.isView(i)&&i.BYTES_PER_ELEMENT==1||F(\"Cannot pass non-string to std::string\"),t&&s?a=Y(i):a=i.length;var c=Z(4+a+1),u=c+4;if(m[c>>2]=a,s)if(t)O(i,u,a+1);else for(var f=0;f<a;++f){var d=i.charCodeAt(f);d>255&&(J(c),F(\"String has UTF-16 code units that do not fit in 8 bits\")),L[u+f]=d}else L.set(i,u);return n!==null&&n.push(J,c),c},readValueFromPointer:We,destructorFunction(n){J(n)}})},at=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0,ai=(e,r,t)=>{var n=e>>1,i=jr(ve,n,r/2,t);if(i-n>16&&at)return at.decode(ve.subarray(n,i));for(var a=\"\",s=n;s<i;++s){var c=ve[s];a+=String.fromCharCode(c)}return a},oi=(e,r,t)=>{if(t??=2147483647,t<2)return 0;t-=2;for(var n=r,i=t<e.length*2?t/2:e.length,a=0;a<i;++a){var s=e.charCodeAt(a);A[r>>1]=s,r+=2}return A[r>>1]=0,r-n},si=e=>e.length*2,ci=(e,r,t)=>{for(var n=\"\",i=e>>2,a=0;!(a>=r/4);a++){var s=m[i+a];if(!s&&!t)break;n+=String.fromCodePoint(s)}return n},ui=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,i=n+t-4,a=0;a<e.length;++a){var s=e.codePointAt(a);if(s>65535&&a++,C[r>>2]=s,r+=4,r+4>i)break}return C[r>>2]=0,r-n},li=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.codePointAt(t);n>65535&&t++,r+=4}return r},fi=(e,r,t)=>{t=V(t);var n,i,a;r===2?(n=ai,i=oi,a=si):(n=ci,i=ui,a=li),q(e,{name:t,fromWireType:s=>{var c=m[s>>2],u=n(s+4,c*r,!0);return J(s),u},toWireType:(s,c)=>{typeof c!=\"string\"&&F(`Cannot pass non-string to C++ string type ${t}`);var u=a(c),f=Z(4+u+r);return m[f>>2]=u/r,i(c,f+4,u+r),s!==null&&s.push(J,f),f},readValueFromPointer:We,destructorFunction(s){J(s)}})},di=(e,r)=>{r=V(r),q(e,{isVoid:!0,name:r,fromWireType:()=>{},toWireType:(t,n)=>{}})},ot=0,vi=()=>{rr=!1,ot=0},mr=[],_i=e=>{var r=mr.length;return mr.push(e),r},hi=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=it(m[r+n*4>>2],`parameter ${n}`);return t},mi=(e,r,t)=>{var n=[],i=e(n,t);return n.length&&(m[r>>2]=N.toHandle(n)),i},pi={},pr=e=>{var r=pi[e];return r===void 0?V(e):r},yi=(e,r,t)=>{var n=8,[i,...a]=hi(e,r),s=i.toWireType.bind(i),c=a.map(v=>v.readValueFromPointer.bind(v));e--;var u={toValue:N.toValue},f=c.map((v,h)=>{var k=`argFromPtr${h}`;return u[k]=v,`${k}(args${h?\"+\"+h*n:\"\"})`}),d;switch(t){case 0:d=\"toValue(handle)\";break;case 2:d=\"new (toValue(handle))\";break;case 3:d=\"\";break;case 1:u.getStringOrSymbol=pr,d=\"toValue(handle)[getStringOrSymbol(methodName)]\";break}d+=`(${f})`,i.isVoid||(u.toReturnWire=s,u.emval_returnValue=mi,d=`return emval_returnValue(toReturnWire, destructorsRef, ${d})`),d=`return function (handle, methodName, destructorsRef, args) {\n ${d}\n }`;var _=new Function(Object.keys(u),d)(...Object.values(u)),p=`methodCaller<(${a.map(v=>v.name)}) => ${i.name}>`;return _i(Le(p,_))},st=()=>globalThis,gi=e=>e===0?N.toHandle(st()):(e=pr(e),N.toHandle(st()[e])),wi=(e,r)=>(e=N.toValue(e),r=N.toValue(r),N.toHandle(e[r])),Si=e=>{e>9&&(fe[e+1]+=1)},bi=(e,r,t,n,i)=>mr[e](r,t,n,i),ki=()=>N.toHandle([]),Ei=e=>N.toHandle(pr(e)),Ci=e=>{var r=N.toValue(e);vr(r),hr(e)},Ti=(e,r,t)=>{e=N.toValue(e),r=N.toValue(r),t=N.toValue(t),e[r]=t},Fi=9007199254740992,Pi=-9007199254740992,He=e=>e<Pi||e>Fi?NaN:Number(e);function Ai(e,r){e=He(e);var t=new Date(e*1e3);C[r>>2]=t.getUTCSeconds(),C[r+4>>2]=t.getUTCMinutes(),C[r+8>>2]=t.getUTCHours(),C[r+12>>2]=t.getUTCDate(),C[r+16>>2]=t.getUTCMonth(),C[r+20>>2]=t.getUTCFullYear()-1900,C[r+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),i=(t.getTime()-n)/(1e3*60*60*24)|0;C[r+28>>2]=i}var $i=e=>e%4===0&&(e%100!==0||e%400===0),Di=[0,31,60,91,121,152,182,213,244,274,305,335],Ri=[0,31,59,90,120,151,181,212,243,273,304,334],Ii=e=>{var r=$i(e.getFullYear()),t=r?Di:Ri,n=t[e.getMonth()]+e.getDate()-1;return n};function Mi(e,r){e=He(e);var t=new Date(e*1e3);C[r>>2]=t.getSeconds(),C[r+4>>2]=t.getMinutes(),C[r+8>>2]=t.getHours(),C[r+12>>2]=t.getDate(),C[r+16>>2]=t.getMonth(),C[r+20>>2]=t.getFullYear()-1900,C[r+24>>2]=t.getDay();var n=Ii(t)|0;C[r+28>>2]=n,C[r+36>>2]=-(t.getTimezoneOffset()*60);var i=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),c=(a!=s&&t.getTimezoneOffset()==Math.min(s,a))|0;C[r+32>>2]=c}var Ce={},ct=e=>{if(e instanceof $r||e==\"unwind\")return Ae;Er(1,e)},ut=()=>rr||ot>0,lt=e=>{Ae=e,ut()||(l.onExit?.(e),Pe=!0),Er(e,new $r(e))},ji=(e,r)=>{Ae=e,lt(e)},Oi=ji,xi=()=>{if(!ut())try{Oi(Ae)}catch(e){ct(e)}},ft=e=>{if(!Pe)try{e(),xi()}catch(r){ct(r)}},yr=()=>performance.now(),Gi=(e,r)=>{if(Ce[e]&&(clearTimeout(Ce[e].id),delete Ce[e]),!r)return 0;var t=setTimeout(()=>{delete Ce[e],ft(()=>wt(e,yr()))},r);return Ce[e]={id:t,timeout_ms:r},0},Bi=(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),s=new Date(i,6,1),c=a.getTimezoneOffset(),u=s.getTimezoneOffset(),f=Math.max(c,u);m[e>>2]=f*60,C[r>>2]=+(c!=u);var d=v=>{var h=v>=0?\"-\":\"+\",k=Math.abs(v),$=String(Math.floor(k/60)).padStart(2,\"0\"),T=String(k%60).padStart(2,\"0\");return`UTC${h}${$}${T}`},_=d(c),p=d(u);u<c?(O(_,t,17),O(p,n,17)):(O(_,n,17),O(p,t,17))},dt=()=>Date.now(),Li=1,Ni=e=>e>=0&&e<=3;function Wi(e,r,t){if(r=He(r),!Ni(e))return 28;var n;if(e===0)n=dt();else if(Li)n=yr();else return 52;var i=Math.round(n*1e3*1e3);return W[t>>3]=BigInt(i),0}var Ui=e=>{console.warn(M(e))},Vi=(e,r)=>ee(M(e,r));function zi(e){if(U.xhrs.has(e)){var r=U.xhrs.get(e);U.xhrs.free(e),r.readyState>0&&r.readyState<4&&r.abort()}}var vt=()=>2147483648,Hi=()=>vt(),qi=()=>!ge,Xi=(e,r)=>we(M(e,r)),Zi=(e,r)=>Math.ceil(e/r)*r,Ki=e=>{var r=$e.buffer.byteLength,t=(e-r+65535)/65536|0;try{return $e.grow(t),Ar(),1}catch{}},Yi=e=>{var r=L.length;e>>>=0;var t=vt();if(e>t)return!1;for(var n=1;n<=4;n*=2){var i=r*(1+.2/n);i=Math.min(i,e+100663296);var a=Math.min(t,Zi(Math.max(e,i),65536)),s=Ki(a);if(s)return!0}return!1};class Ji{allocated=[void 0];freelist=[];get(r){return this.allocated[r]}has(r){return this.allocated[r]!==void 0}allocate(r){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=r,t}free(r){this.allocated[r]=void 0,this.freelist.push(r)}}var U={async openDatabase(e,r){return new Promise((t,n)=>{try{var i=indexedDB.open(e,r)}catch(a){return n(a)}i.onupgradeneeded=a=>{var s=a.target.result;s.objectStoreNames.contains(\"FILES\")&&s.deleteObjectStore(\"FILES\"),s.createObjectStore(\"FILES\")},i.onsuccess=a=>t(a.target.result),i.onerror=n})},async init(){U.xhrs=new Ji,Br(\"library_fetch_init\");try{var e=await U.openDatabase(\"emscripten_filesystem\",1);U.dbInstance=e}catch{U.dbInstance=!1}finally{Gr(\"library_fetch_init\")}}};function gr(e,r,t,n,i){var a=m[e+8>>2];if(!a){t(e,\"no url specified!\");return}var s=M(a),c=e+108,u=M(c+0);u||=\"GET\";var f=m[c+56>>2],d=m[c+68>>2],_=m[c+72>>2],p=m[c+76>>2],v=m[c+80>>2],h=m[c+84>>2],k=m[c+88>>2],$=m[c+52>>2],T=!!($&1),x=!!($&2),P=!!($&64),K=d?M(d):void 0,z=_?M(_):void 0,b=new XMLHttpRequest;if(b.withCredentials=!!L[c+60],b.open(u,s,!P,K,z),P||(b.timeout=f),b.url_=s,b.responseType=\"arraybuffer\",v){var I=M(v);b.overrideMimeType(I)}if(p)for(;;){var se=m[p>>2];if(!se)break;var Xe=m[p+4>>2];if(!Xe)break;p+=8;var B=M(se),ne=M(Xe);b.setRequestHeader(B,ne)}var Q=U.xhrs.allocate(b);m[e>>2]=Q;var Sr=h&&k?L.slice(h,h+k):null;function Ze(){var j=0,H=0;b.response&&T&&m[e+12>>2]===0&&(H=b.response.byteLength),H>0&&(j=Z(H),L.set(new Uint8Array(b.response),j)),m[e+12>>2]=j,X(e+16,H),X(e+24,0);var ie=b.response?b.response.byteLength:0;if(ie&&X(e+32,ie),A[e+40>>1]=b.readyState,A[e+42>>1]=b.status,b.statusText&&O(b.statusText,e+44,64),P){var Ke=_t(b.responseURL);m[e+200>>2]=Ke}}b.onload=j=>{U.xhrs.has(Q)&&(Ze(),b.status>=200&&b.status<300?r(e,b,j):t(e,j))},b.onerror=j=>{U.xhrs.has(Q)&&(Ze(),t(e,j))},b.ontimeout=j=>{U.xhrs.has(Q)&&t(e,j)},b.onprogress=j=>{if(U.xhrs.has(Q)){var H=T&&x&&b.response?b.response.byteLength:0,ie=0;H>0&&T&&x&&(ie=Z(H),L.set(new Uint8Array(b.response),ie)),m[e+12>>2]=ie,X(e+16,H),X(e+24,j.loaded-H),X(e+32,j.total),A[e+40>>1]=b.readyState;var Ke=b.status;b.readyState>=3&&b.status===0&&j.loaded>0&&(Ke=200),A[e+42>>1]=Ke,b.statusText&&O(b.statusText,e+44,64),n(e,j),J(ie)}},b.onreadystatechange=j=>{if(U.xhrs.has(Q)){if(A[e+40>>1]=b.readyState,b.readyState>=2&&(A[e+42>>1]=b.status),!P&&b.readyState===2&&b.responseURL.length>0){var H=_t(b.responseURL);m[e+200>>2]=H}i(e,j)}};try{b.send(Sr)}catch(j){t(e,j)}}var X=(e,r)=>{m[e>>2]=r;var t=m[e>>2];m[e+4>>2]=(r-t)/4294967296},_t=e=>{var r=Y(e)+1,t=Z(r);return t&&O(e,t,r),t};function ht(e,r,t,n,i){if(!e){i(r,0,\"IndexedDB not available!\");return}var a=r+108,s=m[a+64>>2];s||=m[r+8>>2];var c=M(s);try{var u=e.transaction([\"FILES\"],\"readwrite\"),f=u.objectStore(\"FILES\"),d=f.put(t,c);d.onsuccess=_=>{A[r+40>>1]=4,A[r+42>>1]=200,O(\"OK\",r+44,64),n(r,0,c)},d.onerror=_=>{A[r+40>>1]=4,A[r+42>>1]=413,O(\"Payload Too Large\",r+44,64),i(r,0,_)}}catch(_){i(r,0,_)}}function Qi(e,r,t,n){if(!e){n(r,0,\"IndexedDB not available!\");return}var i=r+108,a=m[i+64>>2];a||=m[r+8>>2];var s=M(a);try{var c=e.transaction([\"FILES\"],\"readonly\"),u=c.objectStore(\"FILES\"),f=u.get(s);f.onsuccess=d=>{if(d.target.result){var _=d.target.result,p=_.byteLength||_.length,v=Z(p);L.set(new Uint8Array(_),v),m[r+12>>2]=v,X(r+16,p),X(r+24,0),X(r+32,p),A[r+40>>1]=4,A[r+42>>1]=200,O(\"OK\",r+44,64),t(r,0,_)}else A[r+40>>1]=4,A[r+42>>1]=404,O(\"Not Found\",r+44,64),n(r,0,\"no data\")},f.onerror=d=>{A[r+40>>1]=4,A[r+42>>1]=404,O(\"Not Found\",r+44,64),n(r,0,d)}}catch(d){n(r,0,d)}}function ea(e,r,t,n){if(!e){n(r,0,\"IndexedDB not available!\");return}var i=r+108,a=m[i+64>>2];a||=m[r+8>>2];var s=M(a);try{var c=e.transaction([\"FILES\"],\"readwrite\"),u=c.objectStore(\"FILES\"),f=u.delete(s);f.onsuccess=d=>{var _=d.target.result;m[r+12>>2]=0,X(r+16,0),X(r+24,0),X(r+32,0),A[r+40>>1]=4,A[r+42>>1]=200,O(\"OK\",r+44,64),t(r,0,_)},f.onerror=d=>{A[r+40>>1]=4,A[r+42>>1]=404,O(\"Not Found\",r+44,64),n(r,0,d)}}catch(d){n(r,0,d)}}function ra(e,r,t,n,i){var a=e+108,s=m[a+36>>2],c=m[a+40>>2],u=m[a+44>>2],f=m[a+48>>2],d=m[a+52>>2],_=!!(d&64);function p(B){_?B():ft(B)}var v=(B,ne,Q)=>{p(()=>{s?y(s)(B):r?.(B)})},h=(B,ne)=>{p(()=>{u?y(u)(B):n?.(B)})},k=(B,ne)=>{p(()=>{c?y(c)(B):t?.(B)})},$=(B,ne)=>{p(()=>{f?y(f)(B):i?.(B)})},T=(B,ne,Q)=>{gr(B,v,k,h,$)},x=(B,ne,Q)=>{var Sr=(j,H,ie)=>{p(()=>{s?y(s)(j):r?.(j)})},Ze=(j,H,ie)=>{p(()=>{s?y(s)(j):r?.(j)})};ht(U.dbInstance,B,ne.response,Sr,Ze)},P=(B,ne,Q)=>{gr(B,x,k,h,$)},K=M(a+0),z=!!(d&16),b=!!(d&4),I=!!(d&32);if(K===\"EM_IDB_STORE\"){var se=m[a+84>>2],Xe=m[a+88>>2];ht(U.dbInstance,e,L.slice(se,se+Xe),v,k)}else if(K===\"EM_IDB_DELETE\")ea(U.dbInstance,e,v,k);else if(!z)Qi(U.dbInstance,e,v,I?k:b?P:T);else if(!I)gr(e,b?x:v,k,h,$);else return 0;return e}var qe={},ta=()=>kr||\"./this.program\",Te=()=>{if(!Te.strings){var e=(typeof navigator==\"object\"&&navigator.language||\"C\").replace(\"-\",\"_\")+\".UTF-8\",r={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:e,_:ta()};for(var t in qe)qe[t]===void 0?delete r[t]:r[t]=qe[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Te.strings=n}return Te.strings},na=(e,r)=>{var t=0,n=0;for(var i of Te()){var a=r+t;m[e+n>>2]=a,t+=O(i,a,1/0)+1,n+=4}return 0},ia=(e,r)=>{var t=Te();m[e>>2]=t.length;var n=0;for(var i of t)n+=Y(i)+1;return m[r>>2]=n,0};function aa(e){try{var r=R.getStreamFromFD(e);return o.close(r),0}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return t.errno}}function oa(e,r){try{var t=0,n=0,i=0,a=R.getStreamFromFD(e),s=a.tty?2:o.isDir(a.mode)?3:o.isLink(a.mode)?7:4;return G[r]=s,A[r+2>>1]=i,W[r+8>>3]=BigInt(t),W[r+16>>3]=BigInt(n),0}catch(c){if(typeof o>\"u\"||c.name!==\"ErrnoError\")throw c;return c.errno}}var sa=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=m[r>>2],c=m[r+4>>2];r+=8;var u=o.read(e,G,s,c,n);if(u<0)return-1;if(i+=u,u<c)break;typeof n<\"u\"&&(n+=u)}return i};function ca(e,r,t,n){try{var i=R.getStreamFromFD(e),a=sa(i,r,t);return m[n>>2]=a,0}catch(s){if(typeof o>\"u\"||s.name!==\"ErrnoError\")throw s;return s.errno}}function ua(e,r,t,n){r=He(r);try{if(isNaN(r))return 61;var i=R.getStreamFromFD(e);return o.llseek(i,r,t),W[n>>3]=BigInt(i.position),i.getdents&&r===0&&t===0&&(i.getdents=null),0}catch(a){if(typeof o>\"u\"||a.name!==\"ErrnoError\")throw a;return a.errno}}var la=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=m[r>>2],c=m[r+4>>2];r+=8;var u=o.write(e,G,s,c,n);if(u<0)return-1;if(i+=u,u<c)break;typeof n<\"u\"&&(n+=u)}return i};function fa(e,r,t,n){try{var i=R.getStreamFromFD(e),a=la(i,r,t);return m[n>>2]=a,0}catch(s){if(typeof o>\"u\"||s.name!==\"ErrnoError\")throw s;return s.errno}}var da=e=>e;function va(e,r){try{return ir(L.subarray(e,e+r)),0}catch(t){if(typeof o>\"u\"||t.name!==\"ErrnoError\")throw t;return t.errno}}var yc=e=>(e>>>=0,\"0x\"+e.toString(16).padStart(8,\"0\")),mt=e=>{var r=l[\"_\"+e];return r},_a=(e,r)=>{G.set(e,r)},pt=e=>kt(e),ha=e=>{var r=Y(e)+1,t=pt(r);return O(e,t,r),t},yt=(e,r,t,n,i)=>{var a={string:h=>{var k=0;return h!=null&&h!==0&&(k=ha(h)),k},array:h=>{var k=pt(h.length);return _a(h,k),k}};function s(h){return r===\"string\"?M(h):r===\"boolean\"?!!h:h}var c=mt(e),u=[],f=0;if(n)for(var d=0;d<n.length;d++){var _=a[t[d]];_?(f===0&&(f=S()),u[d]=_(n[d])):u[d]=n[d]}var p=c(...u);function v(h){return f!==0&&w(f),s(h)}return p=v(p),p},ma=(e,r,t,n)=>{var i=!t||t.every(s=>s===\"number\"||s===\"boolean\"),a=r!==\"string\";return a&&i&&!n?mt(e):(...s)=>yt(e,r,t,s,n)};if(o.createPreloadedFile=ln,o.preloadFile=Nr,o.staticInit(),Fn(),Ln(),U.init(),l.noExitRuntime&&(rr=l.noExitRuntime),l.preloadPlugins&&(Lr=l.preloadPlugins),l.print&&(we=l.print),l.printErr&&(ee=l.printErr),l.wasmBinary&&(Se=l.wasmBinary),l.arguments&&(Rt=l.arguments),l.thisProgram&&(kr=l.thisProgram),l.preInit)for(typeof l.preInit==\"function\"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();l.ENV=qe,l.ccall=yt,l.cwrap=ma,l.lengthBytesUTF8=Y,l.stringToUTF8=O;function pa(e){if(typeof l.locateFile==\"function\")try{const r=l.locateFile(M(e));if(r){const t=Y(r)+1,n=Z(t);if(n)return O(r,n,t),n}}catch(r){console.warn(\"Module.locateFile failed:\",r)}return 0}function ya(e){try{if(typeof l<\"u\"&&l.workerUrl){var r=l.workerUrl,t=Y(r)+1,n=Z(t);return O(r,n,t),n}}catch(i){console.warn(\"Failed to read Module.workerUrl:\",i)}if(e){var t=Y(M(e))+1,n=Z(t);return O(M(e),n,t),n}return 0}function ga(){return navigator.hardwareConcurrency||1}function wa(e){l._aquaLiveTransports||(l._aquaLiveTransports=new Set),l._aquaLiveTransports.add(e),queueMicrotask(function(){l._aquaLiveTransports&&l._aquaLiveTransports.has(e)&&l._aquaDrainDeferredCompletions(e)})}function Sa(e){l._aquaLiveTransports&&l._aquaLiveTransports.delete(e)}function ba(e,r){if(!l.createDeserializeWorker)return console.error(\"createDeserializeWorker not available - worker-bridge.ts not loaded\"),0;const t=M(e);return l.createDeserializeWorker(t,l,r)?1:0}function ka(e,r,t,n,i){if(!l.submitToWorker)return console.error(\"submitToWorker not available - worker-bridge.ts not loaded\"),0;try{const a=t,s=n,c=new ArrayBuffer(s);return new Uint8Array(c).set(l.HEAPU8.subarray(a,a+s)),l.submitToWorker(e,r,c,i)?1:0}catch(a){return console.error(\"submitToWorker failed:\",a),0}}function Ea(e,r){l.cancelRequest&&l.cancelRequest(e,r)}function gc(){return l.isWorkerReady&&l.isWorkerReady()?1:0}function Ca(){l.terminateWorker&&l.terminateWorker()}function Ta(e,r){typeof globalThis.Sentry<\"u\"&&typeof globalThis.Sentry.captureException==\"function\"&&globalThis.Sentry.captureException(new Error(M(e,r)))}function Fa(e){const r=M(e);try{const t=new URL(r)}catch{return 0}return 1}function Pa(e,r){const t=M(e);let n;try{n=new URL(t)}catch(c){return console.error(`Failed to parse URL ${t} due to error : ${c}`),0}function i(c){return c>>>0}function a(c){const u=Y(c)+1,f=Z(u);return O(c,f,u),i(f)}let s=i(r)>>2;return m[s]=a(n.origin),m[s+1]=a(n.pathname.substring(1)),m[s+2]=a(n.search.substring(1)),m[s+3]=a(n.hash.substring(1)),1}function Aa(e){const r=M(e),t=encodeURIComponent(r),n=Y(t)+1,i=Z(n);return O(t,i,n),i>>>0}function $a(e){l.__mirisPrivatePromiseTracker||(l.__mirisPrivatePromiseTracker=new Map);let r,t;const n=new Promise(function(i,a){r=i,t=a});return l.__mirisPrivatePromiseTracker.set(e,{resolve:r,reject:t}),N.toHandle(n)}function Da(e,r){const t=l.__mirisPrivatePromiseTracker;if(!t||!t.has(e)){console.error(\"[miris] No resolver for tracked promise ID:\",e);return}const{resolve:n}=t.get(e);if(!n){console.error(\"[miris] No resolver for tracked promise ID:\",e);return}t.delete(e),n(N.toValue(r))}function wc(e,r){const t=l.__mirisPrivatePromiseTracker;if(!t||!t.has(e)){console.error(\"[miris] No rejector for tracked promise ID:\",e);return}const{reject:n}=t.get(e);if(!n){console.error(\"[miris] No rejector for tracked promise ID:\",e);return}t.delete(e),n(N.toValue(r))}var gt,Ra,Ia,Ma,ja,Oa,xa,Ga,Ba,La,Na,Wa,Ua,Va,za,Ha,qa,Xa,Za,Ka,Ya,Ja,Qa,eo,ro,to,no,io,ao,oo,so,co,uo,lo,fo,vo,_o,ho,mo,po,yo,go,wo,So,bo,ko,Eo,Co,To,Fo,Po,Ao,$o,Do,Ro,Io,Mo,jo,Oo,xo,Go,Bo,Lo,No,Wo,Uo,Vo,zo,Ho,qo,Xo,Zo,Ko,Yo,Jo,Qo,es,rs,ts,ns,is,Z,J,as,os,wt,g,St,bt,kt,Et,Ct,Tt,Ft,Pt;function ss(e){gt=e.__getTypeName,l._CreateAquaContext=Ra=e.CreateAquaContext,l._BeginFrame=Ia=e.BeginFrame,l._DestroyAquaContext=Ma=e.DestroyAquaContext,l._SetMaxRequestCacheSize=ja=e.SetMaxRequestCacheSize,l._TriggerTestError=Oa=e.TriggerTestError,l._CreateClientForContext=xa=e.CreateClientForContext,l._CreateClient=Ga=e.CreateClient,l._DestroyClient=Ba=e.DestroyClient,l._ClearScene=La=e.ClearScene,l._WaitForSceneExecution=Na=e.WaitForSceneExecution,l._SetPersistentDataDirectory=Wa=e.SetPersistentDataDirectory,l._SetClientSpatialFormat=Ua=e.SetClientSpatialFormat,l._SetAssetViewerKey=Va=e.SetAssetViewerKey,l._PrefetchContent=za=e.PrefetchContent,l._PrintSceneObjectHierarchy=Ha=e.PrintSceneObjectHierarchy,l._CancelAllSceneExecution=qa=e.CancelAllSceneExecution,l._AddStream=Xa=e.AddStream,l._AddStreamById=Za=e.AddStreamById,l._RemoveStream=Ka=e.RemoveStream,l._SetStreamFetchMode=Ya=e.SetStreamFetchMode,l._GetStreamFetchMode=Ja=e.GetStreamFetchMode,l._GetStreamStatus=Qa=e.GetStreamStatus,l._UpdateSceneExecution=eo=e.UpdateSceneExecution,l._RecordFrameTime=ro=e.RecordFrameTime,l._TakeRenderRequired=to=e.TakeRenderRequired,l._LockScene=no=e.LockScene,l._UnlockScene=io=e.UnlockScene,l._SetMainCameraTransform=ao=e.SetMainCameraTransform,l._SetMainCameraViewFrustum=oo=e.SetMainCameraViewFrustum,l._SetSceneObjectTransform=so=e.SetSceneObjectTransform,l._SetRuntimeSettings=co=e.SetRuntimeSettings,l._SetOctreeSolverMode=uo=e.SetOctreeSolverMode,l._SetBudgetControllerType=lo=e.SetBudgetControllerType,l._SetMaxCacheSize=fo=e.SetMaxCacheSize,l._SetPreferSharkEncodingProfiles=vo=e.SetPreferSharkEncodingProfiles,l._HasFeature=_o=e.HasFeature,l._GetFeatureVersion=ho=e.GetFeatureVersion,l._GetFeatureState=mo=e.GetFeatureState,l._GetAssetFormatVersion=po=e.GetAssetFormatVersion,l._GetSceneChangesCounts=yo=e.GetSceneChangesCounts,l._GetSceneChanges=go=e.GetSceneChanges,l._GetSceneRootObjectId=wo=e.GetSceneRootObjectId,l._GetSceneObjectChildrenCount=So=e.GetSceneObjectChildrenCount,l._GetSceneObjectChildren=bo=e.GetSceneObjectChildren,l._GetSceneObjectType=ko=e.GetSceneObjectType,l._GetDrawnOctantMask=Eo=e.GetDrawnOctantMask,l._GetOctantLocalBoundingBoxes=Co=e.GetOctantLocalBoundingBoxes,l._GetDrMapLadderRoughnessLevels=To=e.GetDrMapLadderRoughnessLevels,l._LogOctreeStats=Fo=e.LogOctreeStats,l._GetSceneObjectParent=Po=e.GetSceneObjectParent,l._IsSceneObjectAncestorOf=Ao=e.IsSceneObjectAncestorOf,l._GetSceneObjectName=$o=e.GetSceneObjectName,l._GetAttributeCount=Do=e.GetAttributeCount,l._HasAttribute=Ro=e.HasAttribute,l._GetAttribute=Io=e.GetAttribute,l._TakeAttribute=Mo=e.TakeAttribute,l._GetBufferHash=jo=e.GetBufferHash,l._GetWorldBoundingBox=Oo=e.GetWorldBoundingBox,l._GetLocalBoundingBox=xo=e.GetLocalBoundingBox,l._MirisGetLocalTransform=Go=e.MirisGetLocalTransform,l._MirisGetWorldTransform=Bo=e.MirisGetWorldTransform,l._MirisGetTransformRelativeToAncestor=Lo=e.MirisGetTransformRelativeToAncestor,l._GetBoundingBoxRelativeToAncestor=No=e.GetBoundingBoxRelativeToAncestor,l._GetMetadata=Wo=e.GetMetadata,l._GetLodIndex=Uo=e.GetLodIndex,l._GetLibAquaVersion=Vo=e.GetLibAquaVersion,l._GetLodMinMaxIndices=zo=e.GetLodMinMaxIndices,l._GetCameraCount=Ho=e.GetCameraCount,l._GetCameraIds=qo=e.GetCameraIds,l._GetDefaultCameraId=Xo=e.GetDefaultCameraId,l._GetViewingVolumeId=Zo=e.GetViewingVolumeId,l._GetSceneMetadata=Ko=e.GetSceneMetadata,l._GetSceneOperatorCount=Yo=e.GetSceneOperatorCount,l._SetVariantSelection=Jo=e.SetVariantSelection,l.__Z26GetSceneObjectNameAsStringP10AquaClienti=Qo=e._Z26GetSceneObjectNameAsStringP10AquaClienti,l.__Z14GetAssetsAsyncP10AquaClientRKNSt3__26vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEEiPN4aqua6v0_0_013ArrayCallbackINSE_9AssetInfoEEE=es=e._Z14GetAssetsAsyncP10AquaClientRKNSt3__26vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEEiPN4aqua6v0_0_013ArrayCallbackINSE_9AssetInfoEEE,l.__Z21GetAvailableTagsAsyncP10AquaClientPN4aqua6v0_0_013ArrayCallbackINSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE=rs=e._Z21GetAvailableTagsAsyncP10AquaClientPN4aqua6v0_0_013ArrayCallbackINSt3__212basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEE,l.__Z33TakeEvictedClientSideAttributeIdsP10AquaClient=ts=e._Z33TakeEvictedClientSideAttributeIdsP10AquaClient,l.__Z30GetActiveClientSideIdsCheckSumv=ns=e._Z30GetActiveClientSideIdsCheckSumv,is=e.__cxa_free_exception,l._malloc=Z=e.malloc,l._free=J=e.free,l._aquaDrainDeferredCompletions=as=e.aquaDrainDeferredCompletions,l._onWorkerResult=os=e.onWorkerResult,wt=e._emscripten_timeout,g=e.setThrew,St=e._emscripten_tempret_set,bt=e._emscripten_stack_restore,kt=e._emscripten_stack_alloc,Et=e.emscripten_stack_get_current,Ct=e.__cxa_decrement_exception_refcount,Tt=e.__cxa_increment_exception_refcount,Ft=e.__cxa_can_catch,Pt=e.__cxa_get_exception_ptr}var At={__cxa_begin_catch:qt,__cxa_end_catch:Xt,__cxa_find_matching_catch_2:Zt,__cxa_find_matching_catch_3:Kt,__cxa_find_matching_catch_4:Yt,__cxa_rethrow:Jt,__cxa_throw:Qt,__cxa_uncaught_exceptions:en,__resumeException:rn,__syscall_fcntl64:fn,__syscall_fstat64:dn,__syscall_ioctl:vn,__syscall_lstat64:_n,__syscall_newfstatat:hn,__syscall_openat:mn,__syscall_rmdir:pn,__syscall_stat64:yn,__syscall_unlinkat:gn,_abort_js:wn,_embind_register_bigint:bn,_embind_register_bool:kn,_embind_register_class:Wn,_embind_register_class_constructor:Vn,_embind_register_class_function:zn,_embind_register_class_property:Hn,_embind_register_emval:qn,_embind_register_enum:Zn,_embind_register_enum_value:Kn,_embind_register_float:Jn,_embind_register_function:Qn,_embind_register_integer:ei,_embind_register_memory_view:ri,_embind_register_optional:ni,_embind_register_std_string:ii,_embind_register_std_wstring:fi,_embind_register_void:di,_emscripten_runtime_keepalive_clear:vi,_emval_create_invoker:yi,_emval_decref:hr,_emval_get_global:gi,_emval_get_property:wi,_emval_incref:Si,_emval_invoke:bi,_emval_new_array:ki,_emval_new_cstring:Ei,_emval_run_destructors:Ci,_emval_set_property:Ti,_gmtime_js:Ai,_localtime_js:Mi,_setitimer_js:Gi,_tzset_js:Bi,clock_time_get:Wi,emjsCreateTrackedPromise:$a,emjsEncodeUriComponent:Aa,emjsGetPartsFromUrl:Pa,emjsIsValidUrl:Fa,emjsResolveTrackedPromise:Da,emjsSentryCaptureException:Ta,emscripten_console_warn:Ui,emscripten_date_now:dt,emscripten_errn:Vi,emscripten_fetch_free:zi,emscripten_get_heap_max:Hi,emscripten_get_now:yr,emscripten_is_main_browser_thread:qi,emscripten_outn:Xi,emscripten_resize_heap:Yi,emscripten_start_fetch:ra,environ_get:na,environ_sizes_get:ia,fd_close:aa,fd_fdstat_get:oa,fd_read:ca,fd_seek:ua,fd_write:fa,getHardwareConcurrency:ga,getWorkerUrlFromModule:ya,impl_cancelRequest:Ea,impl_createDeserializeWorker:ba,impl_submitToWorker:ka,impl_terminateWorker:Ca,invoke_diii:tc,invoke_diiiii:ks,invoke_djj:Vs,invoke_fi:Is,invoke_fiii:Xs,invoke_i:ys,invoke_ii:us,invoke_iii:hs,invoke_iiii:bs,invoke_iiiid:nc,invoke_iiiii:ps,invoke_iiiiid:Qs,invoke_iiiiii:ws,invoke_iiiiiii:Ms,invoke_iiiiiiii:ec,invoke_iiiiiiiii:Gs,invoke_iiiiiiiiii:Ds,invoke_iiiiiiiiiii:As,invoke_iiiiiiiiiiii:$s,invoke_iiiiij:lc,invoke_iiiiijj:ic,invoke_iiiij:uc,invoke_iiiiji:Ls,invoke_iiiijj:ac,invoke_iiij:cc,invoke_iij:gs,invoke_iiji:Ks,invoke_iijiiii:Ss,invoke_j:Os,invoke_ji:Bs,invoke_jii:Es,invoke_jiiii:rc,invoke_v:ms,invoke_vi:ls,invoke_viddi:Ws,invoke_vif:qs,invoke_vii:ds,invoke_viif:fc,invoke_viii:fs,invoke_viiifi:Hs,invoke_viiii:cs,invoke_viiiiddiii:zs,invoke_viiiii:_s,invoke_viiiiii:vs,invoke_viiiiiii:Fs,invoke_viiiiiiii:js,invoke_viiiiiiiiii:oc,invoke_viiiiiiiiiii:Ps,invoke_viiiiiiiiiiiiiii:sc,invoke_viiij:Ns,invoke_viij:Us,invoke_viiji:Ts,invoke_viijii:Rs,invoke_viijiiii:Zs,invoke_vij:Js,invoke_viji:Ys,invoke_vijii:xs,invoke_vijiiii:Cs,llvm_eh_typeid_for:da,proc_exit:lt,random_get:va,scheduleMicrotaskDrain:wa,tryLocateWorkerFile:pa,unregisterTransportInstance:Sa};function cs(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function us(e,r){var t=S();try{return y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;g(1,0)}}function ls(e,r){var t=S();try{y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;g(1,0)}}function fs(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function ds(e,r,t){var n=S();try{y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function vs(e,r,t,n,i,a,s){var c=S();try{y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function _s(e,r,t,n,i,a){var s=S();try{y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function hs(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function ms(e){var r=S();try{y(e)()}catch(t){if(w(r),t!==t+0)throw t;g(1,0)}}function ps(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function ys(e){var r=S();try{return y(e)()}catch(t){if(w(r),t!==t+0)throw t;g(1,0)}}function gs(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function ws(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Ss(e,r,t,n,i,a,s){var c=S();try{return y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function bs(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function ks(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Es(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;return g(1,0),0n}}function Cs(e,r,t,n,i,a,s){var c=S();try{y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function Ts(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Fs(e,r,t,n,i,a,s,c){var u=S();try{y(e)(r,t,n,i,a,s,c)}catch(f){if(w(u),f!==f+0)throw f;g(1,0)}}function Ps(e,r,t,n,i,a,s,c,u,f,d,_){var p=S();try{y(e)(r,t,n,i,a,s,c,u,f,d,_)}catch(v){if(w(p),v!==v+0)throw v;g(1,0)}}function As(e,r,t,n,i,a,s,c,u,f,d){var _=S();try{return y(e)(r,t,n,i,a,s,c,u,f,d)}catch(p){if(w(_),p!==p+0)throw p;g(1,0)}}function $s(e,r,t,n,i,a,s,c,u,f,d,_){var p=S();try{return y(e)(r,t,n,i,a,s,c,u,f,d,_)}catch(v){if(w(p),v!==v+0)throw v;g(1,0)}}function Ds(e,r,t,n,i,a,s,c,u,f){var d=S();try{return y(e)(r,t,n,i,a,s,c,u,f)}catch(_){if(w(d),_!==_+0)throw _;g(1,0)}}function Rs(e,r,t,n,i,a){var s=S();try{y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Is(e,r){var t=S();try{return y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;g(1,0)}}function Ms(e,r,t,n,i,a,s){var c=S();try{return y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function js(e,r,t,n,i,a,s,c,u){var f=S();try{y(e)(r,t,n,i,a,s,c,u)}catch(d){if(w(f),d!==d+0)throw d;g(1,0)}}function Os(e){var r=S();try{return y(e)()}catch(t){if(w(r),t!==t+0)throw t;return g(1,0),0n}}function xs(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Gs(e,r,t,n,i,a,s,c,u){var f=S();try{return y(e)(r,t,n,i,a,s,c,u)}catch(d){if(w(f),d!==d+0)throw d;g(1,0)}}function Bs(e,r){var t=S();try{return y(e)(r)}catch(n){if(w(t),n!==n+0)throw n;return g(1,0),0n}}function Ls(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function Ns(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Ws(e,r,t,n,i){var a=S();try{y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function Us(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Vs(e,r,t){var n=S();try{return y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function zs(e,r,t,n,i,a,s,c,u,f){var d=S();try{y(e)(r,t,n,i,a,s,c,u,f)}catch(_){if(w(d),_!==_+0)throw _;g(1,0)}}function Hs(e,r,t,n,i,a){var s=S();try{y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function qs(e,r,t){var n=S();try{y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function Xs(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Zs(e,r,t,n,i,a,s,c){var u=S();try{y(e)(r,t,n,i,a,s,c)}catch(f){if(w(u),f!==f+0)throw f;g(1,0)}}function Ks(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Ys(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function Js(e,r,t){var n=S();try{y(e)(r,t)}catch(i){if(w(n),i!==i+0)throw i;g(1,0)}}function Qs(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function ec(e,r,t,n,i,a,s,c){var u=S();try{return y(e)(r,t,n,i,a,s,c)}catch(f){if(w(u),f!==f+0)throw f;g(1,0)}}function rc(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;return g(1,0),0n}}function tc(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function nc(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function ic(e,r,t,n,i,a,s){var c=S();try{return y(e)(r,t,n,i,a,s)}catch(u){if(w(c),u!==u+0)throw u;g(1,0)}}function ac(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function oc(e,r,t,n,i,a,s,c,u,f,d){var _=S();try{y(e)(r,t,n,i,a,s,c,u,f,d)}catch(p){if(w(_),p!==p+0)throw p;g(1,0)}}function sc(e,r,t,n,i,a,s,c,u,f,d,_,p,v,h,k){var $=S();try{y(e)(r,t,n,i,a,s,c,u,f,d,_,p,v,h,k)}catch(T){if(w($),T!==T+0)throw T;g(1,0)}}function cc(e,r,t,n){var i=S();try{return y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function uc(e,r,t,n,i){var a=S();try{return y(e)(r,t,n,i)}catch(s){if(w(a),s!==s+0)throw s;g(1,0)}}function lc(e,r,t,n,i,a){var s=S();try{return y(e)(r,t,n,i,a)}catch(c){if(w(s),c!==c+0)throw c;g(1,0)}}function fc(e,r,t,n){var i=S();try{y(e)(r,t,n)}catch(a){if(w(i),a!==a+0)throw a;g(1,0)}}function wr(){if(ue>0){be=wr;return}if(jt(),ue>0){be=wr;return}function e(){l.calledRun=!0,!Pe&&(Ot(),Cr?.(l),l.onRuntimeInitialized?.(),xt())}l.setStatus?(l.setStatus(\"Running...\"),setTimeout(()=>{setTimeout(()=>l.setStatus(\"\"),1),e()},1)):e()}var de;return de=await Vt(),wr(),Pr?Ye=l:Ye=new Promise((e,r)=>{Cr=e,Tr=r}),Ye}export default dc;\n\n";
64
64
  function _getExport(m) {
65
65
  return m.default || m;
66
66
  }
@@ -425,6 +425,9 @@ var Engine = class Engine {
425
425
  getDrawnOctantMask(...args) {
426
426
  return this.module.GetDrawnOctantMask(...args);
427
427
  }
428
+ getOctantLocalBoundingBoxes(...args) {
429
+ return this.module.GetOctantLocalBoundingBoxes(...args);
430
+ }
428
431
  destroyClient(...args) {
429
432
  return this.module.ccall("DestroyClient", "number", ["number"], args);
430
433
  }
@@ -925,6 +928,7 @@ var Lod = class {
925
928
  #lodIndex = null;
926
929
  #paddingSplatsCount = 0;
927
930
  #drawnOctantMask = 255;
931
+ #octantLocalBounds = null;
928
932
  #octantOffsets = null;
929
933
  #surfelOctantOffsets = null;
930
934
  #surfelCount = 0;
@@ -987,6 +991,12 @@ var Lod = class {
987
991
  set _drawnOctantMask(mask) {
988
992
  this.#drawnOctantMask = mask;
989
993
  }
994
+ get _octantLocalBounds() {
995
+ return this.#octantLocalBounds;
996
+ }
997
+ set _octantLocalBounds(bounds) {
998
+ this.#octantLocalBounds = bounds;
999
+ }
990
1000
  get _octantOffsets() {
991
1001
  return this.#octantOffsets;
992
1002
  }
@@ -1038,6 +1048,7 @@ var Lod = class {
1038
1048
  key?.dispose?.();
1039
1049
  this.#cachedWorldBounds = null;
1040
1050
  this.#localBounds = null;
1051
+ this.#octantLocalBounds = null;
1041
1052
  this.#transform = null;
1042
1053
  this.modelRoot?.lods?.delete(this);
1043
1054
  }
@@ -1575,14 +1586,14 @@ var Miris = class Miris {
1575
1586
  * case we occasionally budget over a million prims (most phones can't do this).
1576
1587
  */
1577
1588
  static _SHARK_SPLAT_CAPACITY_MOBILE = 1048576;
1578
- static _SHARK_SPLAT_CAPACITY_DESKTOP = 3e6;
1589
+ static _SHARK_SPLAT_CAPACITY_DESKTOP = 3145728;
1579
1590
  /**
1580
1591
  * @internal
1581
1592
  * The cap on what the solver may budget, held ~20% under the GPU capacity above (the same
1582
1593
  * margin Unity's SharkSplatRenderSystem uses). Leaves headroom for un-garbage collected splats.
1583
1594
  */
1584
- static _SHARK_SPLAT_BUDGET_CAP_MOBILE = 85e4;
1585
- static _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 25e5;
1595
+ static _SHARK_SPLAT_BUDGET_CAP_MOBILE = 65e4;
1596
+ static _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 24e5;
1586
1597
  /**
1587
1598
  * @internal
1588
1599
  * Copied from spork so the dependency is not introduced to core.
@@ -1821,6 +1832,10 @@ var Miris = class Miris {
1821
1832
  const localBounds = retrieveFloatArray(this.engine, lod.id, 6, client.getLocalBoundingBox.bind(client));
1822
1833
  lod.bounds = worldBounds;
1823
1834
  lod.localBounds = localBounds;
1835
+ if (!lod._octantLocalBounds) {
1836
+ const octantBounds = client.getOctantLocalBoundingBoxes(sceneObjectId);
1837
+ lod._octantLocalBounds = octantBounds.length === 48 ? new Float32Array(octantBounds) : null;
1838
+ }
1824
1839
  lod.lodIndex = lodIndex;
1825
1840
  const entry = new Change({
1826
1841
  type: "modified",
@@ -2096,6 +2111,9 @@ var Client = class {
2096
2111
  getDrawnOctantMask(...args) {
2097
2112
  return this.engine.getDrawnOctantMask(this.handle, ...args);
2098
2113
  }
2114
+ getOctantLocalBoundingBoxes(...args) {
2115
+ return this.engine.getOctantLocalBoundingBoxes(this.handle, ...args);
2116
+ }
2099
2117
  getLocalTransform(...args) {
2100
2118
  return this.engine.getLocalTransform(this.handle, ...args);
2101
2119
  }