@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 70.2 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2372],{62372(e,r,t){t.d(r,{default:()=>o});var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var r,t,o=e;o.ready=new Promise((e,n)=>{r=e,t=n});var a,i,s,u=Object.assign({},o),l="./this.program",d="";d=self.location.href,n&&(d=n),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},s=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)},i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)};var c,h,p=o.print||console.log.bind(console),f=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(l=o.thisProgram),o.quit&&o.quit,o.wasmBinary&&(c=o.wasmBinary),"object"!=typeof WebAssembly&&R("no native wasm support detected");var m,v,y,g,w,E,_,b,k=!1;function $(e,r){e||R(r)}function P(){var e=h.buffer;o.HEAP8=m=new Int8Array(e),o.HEAP16=y=new Int16Array(e),o.HEAPU8=v=new Uint8Array(e),o.HEAPU16=g=new Uint16Array(e),o.HEAP32=w=new Int32Array(e),o.HEAPU32=E=new Uint32Array(e),o.HEAPF32=_=new Float32Array(e),o.HEAPF64=b=new Float64Array(e)}var T=[],C=[],F=[];function D(e){T.unshift(e)}function S(e){F.unshift(e)}var A=0,M=null;function j(e){A++,o.monitorRunDependencies&&o.monitorRunDependencies(A)}function O(e){if(A--,o.monitorRunDependencies&&o.monitorRunDependencies(A),0==A&&M){var r=M;M=null,r()}}function R(e){o.onAbort&&o.onAbort(e),f(e="Aborted("+e+")"),k=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw t(r),r}var x,W,z,N=e=>e.startsWith("data:application/octet-stream;base64,");function H(e){if(e==x&&c)return new Uint8Array(c);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}function B(e,r,t){return function(e){return c||"function"!=typeof fetch?Promise.resolve().then(()=>H(e)):fetch(e,{credentials:"same-origin"}).then(r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(()=>H(e))}(e).then(e=>WebAssembly.instantiate(e,r)).then(e=>e).then(t,e=>{f(`failed to asynchronously prepare wasm: ${e}`),R(e)})}N(x="basis_encoder.wasm")||(x=function(e){return o.locateFile?o.locateFile(e,d):d+e}(x));var L=e=>{for(;e.length>0;)e.shift()(o)};function U(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){E[this.ptr+4>>2]=e},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(e){E[this.ptr+8>>2]=e},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,m[this.ptr+12|0]=e},this.get_caught=function(){return 0!=m[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,m[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=m[this.ptr+13|0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){E[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Gr(this.get_type()))return E[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}o.noExitRuntime;var I={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=I.isAbs(e),t="/"===e.substr(-1);return(e=I.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=I.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=I.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return I.normalize(e.join("/"))},join2:(e,r)=>I.normalize(e+"/"+r)},V=e=>(V=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);R("initRandomDevice")})())(e),q={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:ae.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=I.isAbs(n)}return(r?"/":"")+(e=I.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=q.resolve(e).substr(1),r=q.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},Y="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,X=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Y)return Y.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var u=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var l=i-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},G=[],K=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},J=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function Z(e,r,t){var n=K(e)+1,o=new Array(n),a=J(e,o,0,o.length);return r&&(o.length=a),o}var Q={ttys:[],init(){},shutdown(){},register(e,r){Q.ttys[e]={input:[],output:[],ops:r},ae.registerDevice(e,Q.stream_ops)},stream_ops:{open(e){var r=Q.ttys[e.node.rdev];if(!r)throw new ae.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,o){if(!e.tty||!e.tty.ops.get_char)throw new ae.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ae.ErrnoError(29)}if(void 0===s&&0===a)throw new ae.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ae.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ae.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!G.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;G=Z(e,!0)}return G.shift()})(),put_char(e,r){null===r||10===r?(p(X(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(p(X(e.output,0)),e.output=[])},ioctl_tcgets:e=>({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)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(f(X(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(f(X(e.output,0)),e.output=[])}}},ee=e=>{e=(e=>65536*Math.ceil(e/65536))(e);var r=Vr(65536,e);return r?((e,r)=>(v.fill(0,e,e+r),e))(r,e):0},re={ops_table:null,mount:e=>re.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ae.isBlkdev(t)||ae.isFIFO(t))throw new ae.ErrnoError(63);re.ops_table||(re.ops_table={dir:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,lookup:re.node_ops.lookup,mknod:re.node_ops.mknod,rename:re.node_ops.rename,unlink:re.node_ops.unlink,rmdir:re.node_ops.rmdir,readdir:re.node_ops.readdir,symlink:re.node_ops.symlink},stream:{llseek:re.stream_ops.llseek}},file:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:{llseek:re.stream_ops.llseek,read:re.stream_ops.read,write:re.stream_ops.write,allocate:re.stream_ops.allocate,mmap:re.stream_ops.mmap,msync:re.stream_ops.msync}},link:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,readlink:re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:ae.chrdev_stream_ops}});var o=ae.createNode(e,r,t,n);return ae.isDir(o.mode)?(o.node_ops=re.ops_table.dir.node,o.stream_ops=re.ops_table.dir.stream,o.contents={}):ae.isFile(o.mode)?(o.node_ops=re.ops_table.file.node,o.stream_ops=re.ops_table.file.stream,o.usedBytes=0,o.contents=null):ae.isLink(o.mode)?(o.node_ops=re.ops_table.link.node,o.stream_ops=re.ops_table.link.stream):ae.isChrdev(o.mode)&&(o.node_ops=re.ops_table.chrdev.node,o.stream_ops=re.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>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)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ae.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,ae.isDir(e.mode)?r.size=4096:ae.isFile(e.mode)?r.size=e.usedBytes:ae.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&re.resizeFileStorage(e,r.size)},lookup(e,r){throw ae.genericErrors[44]},mknod:(e,r,t,n)=>re.createNode(e,r,t,n),rename(e,r,t){if(ae.isDir(e.mode)){var n;try{n=ae.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ae.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ae.lookupNode(e,r);for(var n in t.contents)throw new ae.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=re.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ae.isLink(e.mode))throw new ae.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===m.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(re.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ae.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ae.ErrnoError(28);return n},allocate(e,r,t){re.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!ae.isFile(e.node.mode))throw new ae.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||s.buffer!==m.buffer){if((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),i=!0,!(a=ee(r)))throw new ae.ErrnoError(48);m.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(re.stream_ops.write(e,r,0,n,t,!1),0)}},te=(e,r,t,n)=>{var o=`al ${e}`;i(e,t=>{$(t,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(t)),o&&O()},r=>{if(!t)throw`Loading data file "${e}" failed.`;t()}),o&&j()},ne=o.preloadPlugins||[],oe=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ae={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=q.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ae.ErrnoError(32);for(var t=e.split("/").filter(e=>!!e),n=ae.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=ae.lookupNode(n,t[a]),o=I.join2(o,t[a]),ae.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ae.isLink(n.mode);){var u=ae.readlink(o);if(o=q.resolve(I.dirname(o),u),n=ae.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ae.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ae.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)%ae.nameTable.length},hashAddNode(e){var r=ae.hashName(e.parent.id,e.name);e.name_next=ae.nameTable[r],ae.nameTable[r]=e},hashRemoveNode(e){var r=ae.hashName(e.parent.id,e.name);if(ae.nameTable[r]===e)ae.nameTable[r]=e.name_next;else for(var t=ae.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ae.mayLookup(e);if(t)throw new ae.ErrnoError(t,e);for(var n=ae.hashName(e.id,r),o=ae.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ae.lookup(e,r)},createNode(e,r,t,n){var o=new ae.FSNode(e,r,t,n);return ae.hashAddNode(o),o},destroyNode(e){ae.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ae.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ae.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return ae.lookupNode(e,r),20}catch(e){}return ae.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ae.lookupNode(e,r)}catch(e){return e.errno}var o=ae.nodePermissions(e,"wx");if(o)return o;if(t){if(!ae.isDir(n.mode))return 54;if(ae.isRoot(n)||ae.getPath(n)===ae.cwd())return 10}else if(ae.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ae.isLink(e.mode)?32:ae.isDir(e.mode)&&("r"!==ae.flagsToPermissionString(r)||512&r)?31:ae.nodePermissions(e,ae.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ae.MAX_OPEN_FDS;e++)if(!ae.streams[e])return e;throw new ae.ErrnoError(33)},getStreamChecked(e){var r=ae.getStream(e);if(!r)throw new ae.ErrnoError(8);return r},getStream:e=>ae.streams[e],createStream:(e,r=-1)=>(ae.FSStream||(ae.FSStream=function(){this.shared={}},ae.FSStream.prototype={},Object.defineProperties(ae.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new ae.FSStream,e),-1==r&&(r=ae.nextfd()),e.fd=r,ae.streams[r]=e,e),closeStream(e){ae.streams[e]=null},chrdev_stream_ops:{open(e){var r=ae.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new ae.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ae.devices[e]={stream_ops:r}},getDevice:e=>ae.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ae.syncFSRequests++,ae.syncFSRequests>1&&f(`warning: ${ae.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ae.getMounts(ae.root.mount),n=0;function o(e){return ae.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&ae.root)throw new ae.ErrnoError(10);if(!o&&!a){var i=ae.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ae.isMountpoint(n))throw new ae.ErrnoError(10);if(!ae.isDir(n.mode))throw new ae.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?ae.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=ae.lookupPath(e,{follow_mount:!1});if(!ae.isMountpoint(r.node))throw new ae.ErrnoError(28);var t=r.node,n=t.mounted,o=ae.getMounts(n);Object.keys(ae.nameTable).forEach(e=>{for(var r=ae.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ae.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ae.lookupPath(e,{parent:!0}).node,o=I.basename(e);if(!o||"."===o||".."===o)throw new ae.ErrnoError(28);var a=ae.mayCreate(n,o);if(a)throw new ae.ErrnoError(a);if(!n.node_ops.mknod)throw new ae.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ae.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ae.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ae.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ae.mknod(e,r,t)),symlink(e,r){if(!q.resolve(e))throw new ae.ErrnoError(44);var t=ae.lookupPath(r,{parent:!0}).node;if(!t)throw new ae.ErrnoError(44);var n=I.basename(r),o=ae.mayCreate(t,n);if(o)throw new ae.ErrnoError(o);if(!t.node_ops.symlink)throw new ae.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=I.dirname(e),a=I.dirname(r),i=I.basename(e),s=I.basename(r);if(t=ae.lookupPath(e,{parent:!0}).node,n=ae.lookupPath(r,{parent:!0}).node,!t||!n)throw new ae.ErrnoError(44);if(t.mount!==n.mount)throw new ae.ErrnoError(75);var u,l=ae.lookupNode(t,i),d=q.relative(e,a);if("."!==d.charAt(0))throw new ae.ErrnoError(28);if("."!==(d=q.relative(r,o)).charAt(0))throw new ae.ErrnoError(55);try{u=ae.lookupNode(n,s)}catch(e){}if(l!==u){var c=ae.isDir(l.mode),h=ae.mayDelete(t,i,c);if(h)throw new ae.ErrnoError(h);if(h=u?ae.mayDelete(n,s,c):ae.mayCreate(n,s))throw new ae.ErrnoError(h);if(!t.node_ops.rename)throw new ae.ErrnoError(63);if(ae.isMountpoint(l)||u&&ae.isMountpoint(u))throw new ae.ErrnoError(10);if(n!==t&&(h=ae.nodePermissions(t,"w")))throw new ae.ErrnoError(h);ae.hashRemoveNode(l);try{t.node_ops.rename(l,n,s)}catch(e){throw e}finally{ae.hashAddNode(l)}}},rmdir(e){var r=ae.lookupPath(e,{parent:!0}).node,t=I.basename(e),n=ae.lookupNode(r,t),o=ae.mayDelete(r,t,!0);if(o)throw new ae.ErrnoError(o);if(!r.node_ops.rmdir)throw new ae.ErrnoError(63);if(ae.isMountpoint(n))throw new ae.ErrnoError(10);r.node_ops.rmdir(r,t),ae.destroyNode(n)},readdir(e){var r=ae.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ae.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ae.lookupPath(e,{parent:!0}).node;if(!r)throw new ae.ErrnoError(44);var t=I.basename(e),n=ae.lookupNode(r,t),o=ae.mayDelete(r,t,!1);if(o)throw new ae.ErrnoError(o);if(!r.node_ops.unlink)throw new ae.ErrnoError(63);if(ae.isMountpoint(n))throw new ae.ErrnoError(10);r.node_ops.unlink(r,t),ae.destroyNode(n)},readlink(e){var r=ae.lookupPath(e).node;if(!r)throw new ae.ErrnoError(44);if(!r.node_ops.readlink)throw new ae.ErrnoError(28);return q.resolve(ae.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ae.lookupPath(e,{follow:!r}).node;if(!t)throw new ae.ErrnoError(44);if(!t.node_ops.getattr)throw new ae.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ae.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ae.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ae.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ae.chmod(e,r,!0)},fchmod(e,r){var t=ae.getStreamChecked(e);ae.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?ae.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ae.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ae.chown(e,r,t,!0)},fchown(e,r,t){var n=ae.getStreamChecked(e);ae.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ae.ErrnoError(28);var t;if(!(t="string"==typeof e?ae.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ae.ErrnoError(63);if(ae.isDir(t.mode))throw new ae.ErrnoError(31);if(!ae.isFile(t.mode))throw new ae.ErrnoError(28);var n=ae.nodePermissions(t,"w");if(n)throw new ae.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ae.getStreamChecked(e);if(!(2097155&t.flags))throw new ae.ErrnoError(28);ae.truncate(t.node,r)},utime(e,r,t){var n=ae.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ae.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=I.normalize(e);try{n=ae.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new ae.ErrnoError(20)}else n=ae.mknod(e,t,0),a=!0;if(!n)throw new ae.ErrnoError(44);if(ae.isChrdev(n.mode)&&(r&=-513),65536&r&&!ae.isDir(n.mode))throw new ae.ErrnoError(54);if(!a){var i=ae.mayOpen(n,r);if(i)throw new ae.ErrnoError(i)}512&r&&!a&&ae.truncate(n,0),r&=-131713;var s=ae.createStream({node:n,path:ae.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(ae.readFiles||(ae.readFiles={}),e in ae.readFiles||(ae.readFiles[e]=1)),s},close(e){if(ae.isClosed(e))throw new ae.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ae.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ae.isClosed(e))throw new ae.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ae.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ae.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new ae.ErrnoError(28);if(ae.isClosed(e))throw new ae.ErrnoError(8);if(1==(2097155&e.flags))throw new ae.ErrnoError(8);if(ae.isDir(e.node.mode))throw new ae.ErrnoError(31);if(!e.stream_ops.read)throw new ae.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ae.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new ae.ErrnoError(28);if(ae.isClosed(e))throw new ae.ErrnoError(8);if(!(2097155&e.flags))throw new ae.ErrnoError(8);if(ae.isDir(e.node.mode))throw new ae.ErrnoError(31);if(!e.stream_ops.write)throw new ae.ErrnoError(28);e.seekable&&1024&e.flags&&ae.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ae.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ae.isClosed(e))throw new ae.ErrnoError(8);if(r<0||t<=0)throw new ae.ErrnoError(28);if(!(2097155&e.flags))throw new ae.ErrnoError(8);if(!ae.isFile(e.node.mode)&&!ae.isDir(e.node.mode))throw new ae.ErrnoError(43);if(!e.stream_ops.allocate)throw new ae.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new ae.ErrnoError(2);if(1==(2097155&e.flags))throw new ae.ErrnoError(2);if(!e.stream_ops.mmap)throw new ae.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ae.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ae.open(e,r.flags),o=ae.stat(e).size,a=new Uint8Array(o);return ae.read(n,a,0,o,0),"utf8"===r.encoding?t=X(a,0):"binary"===r.encoding&&(t=a),ae.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ae.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(K(r)+1),a=J(r,o,0,o.length);ae.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ae.write(n,r,0,r.byteLength,void 0,t.canOwn)}ae.close(n)},cwd:()=>ae.currentPath,chdir(e){var r=ae.lookupPath(e,{follow:!0});if(null===r.node)throw new ae.ErrnoError(44);if(!ae.isDir(r.node.mode))throw new ae.ErrnoError(54);var t=ae.nodePermissions(r.node,"x");if(t)throw new ae.ErrnoError(t);ae.currentPath=r.path},createDefaultDirectories(){ae.mkdir("/tmp"),ae.mkdir("/home"),ae.mkdir("/home/web_user")},createDefaultDevices(){ae.mkdir("/dev"),ae.registerDevice(ae.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ae.mkdev("/dev/null",ae.makedev(1,3)),Q.register(ae.makedev(5,0),Q.default_tty_ops),Q.register(ae.makedev(6,0),Q.default_tty1_ops),ae.mkdev("/dev/tty",ae.makedev(5,0)),ae.mkdev("/dev/tty1",ae.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=V(e).byteLength),e[--r]);ae.createDevice("/dev","random",t),ae.createDevice("/dev","urandom",t),ae.mkdir("/dev/shm"),ae.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ae.mkdir("/proc");var e=ae.mkdir("/proc/self");ae.mkdir("/proc/self/fd"),ae.mount({mount(){var r=ae.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ae.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){o.stdin?ae.createDevice("/dev","stdin",o.stdin):ae.symlink("/dev/tty","/dev/stdin"),o.stdout?ae.createDevice("/dev","stdout",null,o.stdout):ae.symlink("/dev/tty","/dev/stdout"),o.stderr?ae.createDevice("/dev","stderr",null,o.stderr):ae.symlink("/dev/tty1","/dev/stderr"),ae.open("/dev/stdin",0),ae.open("/dev/stdout",1),ae.open("/dev/stderr",1)},ensureErrnoError(){ae.ErrnoError||(ae.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ae.ErrnoError.prototype=new Error,ae.ErrnoError.prototype.constructor=ae.ErrnoError,[44].forEach(e=>{ae.genericErrors[e]=new ae.ErrnoError(e),ae.genericErrors[e].stack="<generic error, no stack>"}))},staticInit(){ae.ensureErrnoError(),ae.nameTable=new Array(4096),ae.mount(re,{},"/"),ae.createDefaultDirectories(),ae.createDefaultDevices(),ae.createSpecialDirectories(),ae.filesystems={MEMFS:re}},init(e,r,t){ae.init.initialized=!0,ae.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,ae.createStandardStreams()},quit(){ae.init.initialized=!1;for(var e=0;e<ae.streams.length;e++){var r=ae.streams[e];r&&ae.close(r)}},findObject(e,r){var t=ae.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ae.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ae.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=I.basename(e),n=ae.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ae.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=I.join2(e,a);try{ae.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=I.join2("string"==typeof e?e:ae.getPath(e),r),i=oe(n,o);return ae.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ae.getPath(e),i=r?I.join2(e,r):e);var s=oe(n,o),u=ae.create(i,s);if(t){if("string"==typeof t){for(var l=new Array(t.length),d=0,c=t.length;d<c;++d)l[d]=t.charCodeAt(d);t=l}ae.chmod(u,146|s);var h=ae.open(u,577);ae.write(h,t,0,t.length,0,a),ae.close(h),ae.chmod(u,s)}return u},createDevice(e,r,t,n){var o=I.join2("string"==typeof e?e:ae.getPath(e),r),a=oe(!!t,!!n);ae.createDevice.major||(ae.createDevice.major=64);var i=ae.makedev(ae.createDevice.major++,0);return ae.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new ae.ErrnoError(29)}if(void 0===u&&0===i)throw new ae.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new ae.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),ae.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Z(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ae.ErrnoError(29)}},createLazyFile(e,r,t,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Z(o.responseText||"",!0)},u=this;u.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw new Error("doXHR failed!");return u.chunks[e]}),!a&&n||(i=n=1,n=this.getter(0).length,i=n,p("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=ae.createFile(e,r,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(u.stream_ops).forEach(e=>{var r=u.stream_ops[e];l[e]=function(){return ae.forceLoadFile(u),r.apply(null,arguments)}}),l.read=(e,r,t,n,o)=>(ae.forceLoadFile(u),d(e,r,t,n,o)),l.mmap=(e,r,t,n,o)=>{ae.forceLoadFile(u);var a=ee(r);if(!a)throw new ae.ErrnoError(48);return d(e,m,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=l,u}},ie=(e,r)=>e?X(v,e,r):"",se={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(I.isAbs(r))return r;var n;if(n=-100===e?ae.cwd():se.getStreamFromFD(e).path,0==r.length){if(!t)throw new ae.ErrnoError(44);return n}return I.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&I.normalize(r)!==I.normalize(ae.getPath(e.node)))return-54;throw e}w[t>>2]=n.dev,w[t+4>>2]=n.mode,E[t+8>>2]=n.nlink,w[t+12>>2]=n.uid,w[t+16>>2]=n.gid,w[t+20>>2]=n.rdev,z=[n.size>>>0,(W=n.size,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],w[t+24>>2]=z[0],w[t+28>>2]=z[1],w[t+32>>2]=4096,w[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return z=[Math.floor(o/1e3)>>>0,(W=Math.floor(o/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],w[t+40>>2]=z[0],w[t+44>>2]=z[1],E[t+48>>2]=o%1e3*1e3,z=[Math.floor(a/1e3)>>>0,(W=Math.floor(a/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],w[t+56>>2]=z[0],w[t+60>>2]=z[1],E[t+64>>2]=a%1e3*1e3,z=[Math.floor(i/1e3)>>>0,(W=Math.floor(i/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],w[t+72>>2]=z[0],w[t+76>>2]=z[1],E[t+80>>2]=i%1e3*1e3,z=[n.ino>>>0,(W=n.ino,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],w[t+88>>2]=z[0],w[t+92>>2]=z[1],0},doMsync(e,r,t,n,o){if(!ae.isFile(r.node.mode))throw new ae.ErrnoError(43);if(2&n)return 0;var a=v.slice(e,e+t);ae.msync(r,a,o,t,n)},varargs:void 0,get(){var e=w[+se.varargs>>2];return se.varargs+=4,e},getp:()=>se.get(),getStr:e=>ie(e),getStreamFromFD:e=>ae.getStreamChecked(e)},ue={},le=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function de(e){return this.fromWireType(w[e>>2])}var ce,he,pe,fe={},me={},ve={},ye=e=>{throw new ce(e)},ge=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&ye("Mismatched type converter count");for(var o=0;o<e.length;++o)_e(e[o],n[o])}e.forEach(function(e){ve[e]=r});var o=new Array(r.length),a=[],i=0;r.forEach((e,r)=>{me.hasOwnProperty(e)?o[r]=me[e]:(a.push(e),fe.hasOwnProperty(e)||(fe[e]=[]),fe[e].push(()=>{o[r]=me[e],++i===a.length&&n(o)}))}),0===a.length&&n(o)},we=e=>{for(var r="",t=e;v[t];)r+=he[v[t++]];return r},Ee=e=>{throw new pe(e)};function _e(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Ee(`type "${n}" must have a positive integer typeid pointer`),me.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ee(`Cannot register type '${n}' twice`)}if(me[e]=r,delete ve[e],fe.hasOwnProperty(e)){var o=fe[e];delete fe[e],o.forEach(e=>e())}}(e,r,t)}var be,ke=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),$e=e=>{Ee(function(e){return e.$$.ptrType.registeredClass.name}(e)+" instance already deleted")},Pe=!1,Te=e=>{},Ce=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Fe=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Fe(e,r,t.baseClass);return null===n?null:t.downcast(n)},De={},Se=[],Ae=()=>{for(;Se.length;){var e=Se.pop();e.$$.deleteScheduled=!1,e.delete()}},Me={},je=(e,r)=>(r.ptrType&&r.ptr||ye("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ye("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Oe(Object.create(e,{$$:{value:r}})));var Oe=e=>"undefined"==typeof FinalizationRegistry?(Oe=e=>e,e):(Pe=new FinalizationRegistry(e=>{Ce(e.$$)}),Oe=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r};Pe.register(e,t,e)}return e},Te=e=>Pe.unregister(e),Oe(e));function Re(){}var xe=e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e};function We(e,r){return e=xe(e),{[e]:function(){return r.apply(this,arguments)}}[e]}var ze=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||Ee(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},Ne=(e,r,t)=>{o.hasOwnProperty(e)?((void 0===t||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[t])&&Ee(`Cannot register public name '${e}' twice`),ze(o,e,e),o.hasOwnProperty(t)&&Ee(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[e].overloadTable[t]=r):(o[e]=r,void 0!==t&&(o[e].numArguments=t))};function He(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Be=(e,r,t)=>{for(;r!==t;)r.upcast||Ee(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Le(e,r){if(null===r)return this.isReference&&Ee(`null is not a valid ${this.name}`),0;r.$$||Ee(`Cannot pass "${cr(r)}" as a ${this.name}`),r.$$.ptr||Ee(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Be(r.$$.ptr,t,this.registeredClass)}function Ue(e,r){var t;if(null===r)return this.isReference&&Ee(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||Ee(`Cannot pass "${cr(r)}" as a ${this.name}`),r.$$.ptr||Ee(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Ee(`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(void 0===r.$$.smartPtr&&Ee("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Ee(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,ur.toHandle(()=>o.delete())),null!==e&&e.push(this.rawDestructor,t)}break;default:Ee("Unsupporting sharing policy")}return t}function Ie(e,r){if(null===r)return this.isReference&&Ee(`null is not a valid ${this.name}`),0;r.$$||Ee(`Cannot pass "${cr(r)}" as a ${this.name}`),r.$$.ptr||Ee(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Ee(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Be(r.$$.ptr,t,this.registeredClass)}function Ve(e){return this.fromWireType(E[e>>2])}function qe(e,r,t,n,o,a,i,s,u,l,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=d,o||void 0!==r.baseClass?this.toWireType=Ue:n?(this.toWireType=Le,this.destructorFunction=null):(this.toWireType=Ie,this.destructorFunction=null)}var Ye,Xe,Ge=(e,r,t)=>{o.hasOwnProperty(e)||ye("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==t?o[e].overloadTable[t]=r:(o[e]=r,o[e].argCount=t)},Ke=[],Je=e=>{var r=Ke[e];return r||(e>=Ke.length&&(Ke.length=e+1),Ke[e]=r=Ye.get(e)),r},Ze=(e,r)=>{var t=(e=we(e)).includes("j")?((e,r)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{var n=o["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):Je(r).apply(null,t))(e,r,t)}})(e,r):Je(r);return"function"!=typeof t&&Ee(`unknown function pointer with signature ${e}: ${r}`),t},Qe=e=>{var r=Lr(e),t=we(r);return Hr(r),t},er=(e,r)=>{var t=[],n={};throw r.forEach(function e(r){n[r]||me[r]||(ve[r]?ve[r].forEach(e):(t.push(r),n[r]=!0))}),new Xe(`${e}: `+t.map(Qe).join([", "]))},rr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(E[r+4*n>>2]);return t};function tr(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=We(e.name||"unknownFunctionName",function(){});t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}function nr(e,r,t,n,o,a){var i=r.length;i<2&&Ee("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==r[1]&&null!==t,u=!1,l=1;l<r.length;++l)if(null!==r[l]&&void 0===r[l].destructorFunction){u=!0;break}var d="void"!==r[0].name,c="",h="";for(l=0;l<i-2;++l)c+=(0!==l?", ":"")+"arg"+l,h+=(0!==l?", ":"")+"arg"+l+"Wired";var p=`\n return function ${xe(e)}(${c}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;u&&(p+="var destructors = [];\n");var f=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[Ee,n,o,le,r[0],r[1]];for(s&&(p+="var thisWired = classParam.toWireType("+f+", this);\n"),l=0;l<i-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+f+", arg"+l+"); // "+r[l+2].name+"\n",m.push("argType"+l),v.push(r[l+2]);if(s&&(h="thisWired"+(h.length>0?", ":"")+h),p+=(d||a?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",u)p+="runDestructors(destructors);\n";else for(l=s?1:2;l<r.length;++l){var y=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==r[l].destructorFunction&&(p+=y+"_dtor("+y+"); // "+r[l].name+"\n",m.push(y+"_dtor"),v.push(r[l].destructorFunction))}return d&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),tr(Function,m).apply(null,v)}var or=e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?($(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,r)):e};function ar(){this.allocated=[void 0],this.freelist=[]}var ir=new ar,sr=e=>{e>=ir.reserved&&0===--ir.get(e).refcount&&ir.free(e)},ur={toValue:e=>(e||Ee("Cannot use deleted val. handle = "+e),ir.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return ir.allocate({refcount:1,value:e})}}},lr=(e,r,t)=>{switch(r){case 1:return t?function(e){return this.fromWireType(m[0|e])}:function(e){return this.fromWireType(v[0|e])};case 2:return t?function(e){return this.fromWireType(y[e>>1])}:function(e){return this.fromWireType(g[e>>1])};case 4:return t?function(e){return this.fromWireType(w[e>>2])}:function(e){return this.fromWireType(E[e>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},dr=(e,r)=>{var t=me[e];return void 0===t&&Ee(r+" has unknown type "+Qe(e)),t},cr=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},hr=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(_[e>>2])};case 8:return function(e){return this.fromWireType(b[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},pr=(e,r,t)=>{switch(r){case 1:return t?e=>m[0|e]:e=>v[0|e];case 2:return t?e=>y[e>>1]:e=>g[e>>1];case 4:return t?e=>w[e>>2]:e=>E[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},fr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,mr=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&g[n];)++n;if((t=n<<1)-e>32&&fr)return fr.decode(v.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=y[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},vr=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);y[r>>1]=i,r+=2}return y[r>>1]=0,r-n},yr=e=>2*e.length,gr=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=w[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},wr=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),w[r>>2]=i,(r+=4)+4>o)break}return w[r>>2]=0,r-n},Er=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},_r={},br=e=>{var r=_r[e];return void 0===r?we(e):r},kr=[],$r=()=>"object"==typeof globalThis?globalThis:Function("return this")(),Pr=e=>{for(var r="",t=0;t<e;++t)r+=(0!==t?", ":"")+"arg"+t;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(t=0;t<e;++t)n+="var argType"+t+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+t+"');\nvar arg"+t+" = argType"+t+".readValueFromPointer(args);\nargs += argType"+t+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+r+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(dr,o,ur.toHandle,()=>E)},Tr={},Cr=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,Fr=e=>{var r=(e-h.buffer.byteLength+65535)/65536;try{return h.grow(r),P(),1}catch(e){}},Dr={},Sr=()=>{if(!Sr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:l||"./this.program"};for(var r in Dr)void 0===Dr[r]?delete e[r]:e[r]=Dr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Sr.strings=t}return Sr.strings},Ar=e=>e%4==0&&(e%100!=0||e%400==0),Mr=[31,29,31,30,31,30,31,31,30,31,30,31],jr=[31,28,31,30,31,30,31,31,30,31,30,31],Or=(e,r)=>{m.set(e,r)},Rr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ae.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},xr=365,Wr=146;Object.defineProperties(Rr.prototype,{read:{get:function(){return(this.mode&xr)===xr},set:function(e){e?this.mode|=xr:this.mode&=~xr}},write:{get:function(){return(this.mode&Wr)===Wr},set:function(e){e?this.mode|=Wr:this.mode&=~Wr}},isFolder:{get:function(){return ae.isDir(this.mode)}},isDevice:{get:function(){return ae.isChrdev(this.mode)}}}),ae.FSNode=Rr,ae.createPreloadedFile=(e,r,t,n,o,a,i,s,u,l)=>{var d=r?q.resolve(I.join2(e,r)):e;function c(t){function c(t){l&&l(),s||((e,r,t,n,o,a)=>{ae.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,u),a&&a(),O()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return ne.forEach(a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)}),o})(t,d,c,()=>{i&&i(),O()})||c(t)}j(),"string"==typeof t?te(t,e=>c(e),i):c(t)},ae.staticInit(),ce=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);he=e})(),pe=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(Re.prototype,{isAliasOf(e){if(!(this instanceof Re))return!1;if(!(e instanceof Re))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||$e(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Oe(Object.create(Object.getPrototypeOf(this),{$$:{value:ke(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ee("Object already scheduled for deletion"),Te(this),Ce(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ee("Object already scheduled for deletion"),Se.push(this),1===Se.length&&be&&be(Ae),this.$$.deleteScheduled=!0,this}}),o.getInheritedInstanceCount=()=>Object.keys(Me).length,o.getLiveInheritedInstances=()=>{var e=[];for(var r in Me)Me.hasOwnProperty(r)&&e.push(Me[r]);return e},o.flushPendingDeletes=Ae,o.setDelayFunction=e=>{be=e,Se.length&&be&&be(Ae)},Object.assign(qe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor&&this.rawDestructor(e)},argPackAdvance:8,readValueFromPointer:Ve,deleteObject(e){null!==e&&e.delete()},fromWireType:function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Ee("ptr s