aspose.cells.js
Version:
Aspose.Cells for JavaScript via C++ is a high-performance, feature-rich library for manipulating and converting Excel (XLS, XLSX, XLSB), ODS, CSV, and HTML files. It provides a comprehensive set of features for creating, editing, converting, and rendering
3 lines (2 loc) • 2.41 MB
JavaScript
/*! Copyright (c) 2001-2025 Aspose Pty Ltd. All Rights Reserved. Powered by Aspose.Cells. */
var AsposeCells=(()=>{var t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(t=t||__filename),function(e={}){var n,r,i=e;i.ready=new Promise(((t,e)=>{n=t,r=e}));var o,l,s,a=Object.assign({},i),h="./this.program",_=(t,e)=>{throw e},u="object"==typeof window,c="function"==typeof importScripts,w="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(w){var f=require("fs"),g=require("path");p=c?g.dirname(p)+"/":__dirname+"/",o=(t,e)=>(t=Q(t)?new URL(t):g.normalize(t),f.readFileSync(t,e?void 0:"utf8")),s=t=>{var e=o(t,!0);return e.buffer||(e=new Uint8Array(e)),e},l=(t,e,n,r=!0)=>{t=Q(t)?new URL(t):g.normalize(t),f.readFile(t,r?void 0:"utf8",((t,i)=>{t?n(t):e(r?i.buffer:i)}))},!i.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),_=(t,e)=>{throw process.exitCode=t,e},i.inspect=()=>"[Emscripten Module object]"}else(u||c)&&(c?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),t&&(p=t),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},c&&(s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),l=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)},t=>document.title=t);var d,m=i.print||console.log.bind(console),b=i.printErr||console.error.bind(console);Object.assign(i,a),a=null,i.arguments&&i.arguments,i.thisProgram&&(h=i.thisProgram),i.quit&&(_=i.quit),i.wasmBinary&&(d=i.wasmBinary);var S,v,T=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&U("no native wasm support detected");var E,y,C,I,G,P,F,A,O,x=!1;function k(){var t=S.buffer;i.HEAP8=E=new Int8Array(t),i.HEAP16=C=new Int16Array(t),i.HEAP32=G=new Int32Array(t),i.HEAPU8=y=new Uint8Array(t),i.HEAPU16=I=new Uint16Array(t),i.HEAPU32=P=new Uint32Array(t),i.HEAPF32=F=new Float32Array(t),i.HEAPF64=A=new Float64Array(t)}var R=[],D=[],B=[];var L=0,N=null,V=null;function H(t){L++,i.monitorRunDependencies&&i.monitorRunDependencies(L)}function M(t){if(L--,i.monitorRunDependencies&&i.monitorRunDependencies(L),0==L&&(null!==N&&(clearInterval(N),N=null),V)){var e=V;V=null,e()}}function U(t){i.onAbort&&i.onAbort(t),b(t="Aborted("+t+")"),x=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw r(e),e}var W,X,j,z;function q(t){return t.startsWith("data:application/octet-stream;base64,")}function Q(t){return t.startsWith("file://")}function Y(t){if(t==W&&d)return new Uint8Array(d);if(s)return s(t);throw"both async and sync fetching of the wasm failed"}function J(t,e,n){return function(t){if(!d&&(u||c)){if("function"==typeof fetch&&!Q(t))return fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>Y(t)));if(l)return new Promise(((e,n)=>{l(t,(t=>e(new Uint8Array(t))),n)}))}return Promise.resolve().then((()=>Y(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(n,(t=>{b("failed to asynchronously prepare wasm: "+t),U(t)}))}function K(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}q(W="aspose.cells.wasm")||(X=W,W=i.locateFile?i.locateFile(X,p):p+X);var Z=t=>{for(;t.length>0;)t.shift()(i)};var $=[],tt=0;var et=0;function nt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){P[this.ptr+4>>2]=t},this.get_type=function(){return P[this.ptr+4>>2]},this.set_destructor=function(t){P[this.ptr+8>>2]=t},this.get_destructor=function(){return P[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,E[this.ptr+12|0]=t},this.get_caught=function(){return 0!=E[this.ptr+12|0]},this.set_rethrown=function(t){t=t?1:0,E[this.ptr+13|0]=t},this.get_rethrown=function(){return 0!=E[this.ptr+13|0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){P[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return P[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ke(this.get_type()))return P[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var rt=t=>{var e=et;if(!e)return Ue(0),0;var n=new nt(e);n.set_adjusted_ptr(e);var r=n.get_type();if(!r)return Ue(0),e;for(var i in t){var o=t[i];if(0===o||o===r)break;var l=n.ptr+16;if(Je(o,r,l))return Ue(o),e}return Ue(r),e};var it={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n;n--)t.unshift("..");return t},normalize:t=>{var e=it.isAbs(t),n="/"===t.substr(-1);return(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=it.splitPath(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=it.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments);return it.normalize(t.join("/"))},join2:(t,e)=>it.normalize(t+"/"+e)},ot=t=>(ot=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);if(w)try{var t=require("crypto");if(t.randomFillSync)return e=>t.randomFillSync(e);var e=t.randomBytes;return t=>(t.set(e(t.byteLength)),t)}catch(t){}U("initRandomDevice")})())(t),lt={resolve:function(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var r=n>=0?arguments[n]:bt.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,e=it.isAbs(r)}return(e?"/":"")+(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=lt.resolve(t).substr(1),e=lt.resolve(e).substr(1);for(var r=n(t.split("/")),i=n(e.split("/")),o=Math.min(r.length,i.length),l=o,s=0;s<o;s++)if(r[s]!==i[s]){l=s;break}var a=[];for(s=l;s<r.length;s++)a.push("..");return(a=a.concat(i.slice(l))).join("/")}},st="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,at=(t,e,n)=>{for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.buffer&&st)return st.decode(t.subarray(e,i));for(var o="";e<i;){var l=t[e++];if(128&l){var s=63&t[e++];if(192!=(224&l)){var a=63&t[e++];if((l=224==(240&l)?(15&l)<<12|s<<6|a:(7&l)<<18|s<<12|a<<6|63&t[e++])<65536)o+=String.fromCharCode(l);else{var h=l-65536;o+=String.fromCharCode(55296|h>>10,56320|1023&h)}}else o+=String.fromCharCode((31&l)<<6|s)}else o+=String.fromCharCode(l)}return o},ht=[],_t=t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r<=127?e++:r<=2047?e+=2:r>=55296&&r<=57343?(e+=4,++n):e+=3}return e},ut=(t,e,n,r)=>{if(!(r>0))return 0;for(var i=n,o=n+r-1,l=0;l<t.length;++l){var s=t.charCodeAt(l);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++l);if(s<=127){if(n>=o)break;e[n++]=s}else if(s<=2047){if(n+1>=o)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=o)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=o)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}return e[n]=0,n-i};function ct(t,e,n){var r=n>0?n:_t(t)+1,i=new Array(r),o=ut(t,i,0,i.length);return e&&(i.length=o),i}var wt={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){wt.ttys[t]={input:[],output:[],ops:e},bt.registerDevice(t,wt.stream_ops)},stream_ops:{open:function(t){var e=wt.ttys[t.node.rdev];if(!e)throw new bt.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.fsync(t.tty)},fsync:function(t){t.tty.ops.fsync(t.tty)},read:function(t,e,n,r,i){if(!t.tty||!t.tty.ops.get_char)throw new bt.ErrnoError(60);for(var o=0,l=0;l<r;l++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new bt.ErrnoError(29)}if(void 0===s&&0===o)throw new bt.ErrnoError(6);if(null==s)break;o++,e[n+l]=s}return o&&(t.node.timestamp=Date.now()),o},write:function(t,e,n,r,i){if(!t.tty||!t.tty.ops.put_char)throw new bt.ErrnoError(60);try{for(var o=0;o<r;o++)t.tty.ops.put_char(t.tty,e[n+o])}catch(t){throw new bt.ErrnoError(29)}return r&&(t.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(t){return(()=>{if(!ht.length){var t=null;if(w){var e=Buffer.alloc(256),n=0,r=process.stdin.fd;try{n=f.readSync(r,e,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}t=n>0?e.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;ht=ct(t,!0)}return ht.shift()})()},put_char:function(t,e){null===e||10===e?(m(at(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync:function(t){t.output&&t.output.length>0&&(m(at(t.output,0)),t.output=[])},ioctl_tcgets:function(t){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:function(t,e,n){return 0},ioctl_tiocgwinsz:function(t){return[24,80]}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(b(at(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync:function(t){t.output&&t.output.length>0&&(b(at(t.output,0)),t.output=[])}}},pt=t=>{t=((t,e)=>Math.ceil(t/e)*e)(t,65536);var e=Xe(65536,t);return e?((t,e)=>(y.fill(0,t,t+e),t))(e,t):0},ft={ops_table:null,mount:t=>ft.createNode(null,"/",16895,0),createNode(t,e,n,r){if(bt.isBlkdev(n)||bt.isFIFO(n))throw new bt.ErrnoError(63);ft.ops_table||(ft.ops_table={dir:{node:{getattr:ft.node_ops.getattr,setattr:ft.node_ops.setattr,lookup:ft.node_ops.lookup,mknod:ft.node_ops.mknod,rename:ft.node_ops.rename,unlink:ft.node_ops.unlink,rmdir:ft.node_ops.rmdir,readdir:ft.node_ops.readdir,symlink:ft.node_ops.symlink},stream:{llseek:ft.stream_ops.llseek}},file:{node:{getattr:ft.node_ops.getattr,setattr:ft.node_ops.setattr},stream:{llseek:ft.stream_ops.llseek,read:ft.stream_ops.read,write:ft.stream_ops.write,allocate:ft.stream_ops.allocate,mmap:ft.stream_ops.mmap,msync:ft.stream_ops.msync}},link:{node:{getattr:ft.node_ops.getattr,setattr:ft.node_ops.setattr,readlink:ft.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ft.node_ops.getattr,setattr:ft.node_ops.setattr},stream:bt.chrdev_stream_ops}});var i=bt.createNode(t,e,n,r);return bt.isDir(i.mode)?(i.node_ops=ft.ops_table.dir.node,i.stream_ops=ft.ops_table.dir.stream,i.contents={}):bt.isFile(i.mode)?(i.node_ops=ft.ops_table.file.node,i.stream_ops=ft.ops_table.file.stream,i.usedBytes=0,i.contents=null):bt.isLink(i.mode)?(i.node_ops=ft.ops_table.link.node,i.stream_ops=ft.ops_table.link.stream):bt.isChrdev(i.mode)&&(i.node_ops=ft.ops_table.chrdev.node,i.stream_ops=ft.ops_table.chrdev.stream),i.timestamp=Date.now(),t&&(t.contents[e]=i,t.timestamp=i.timestamp),i},getFileDataAsTypedArray:t=>t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0),expandFileStorage(t,e){var n=t.contents?t.contents.length:0;if(!(n>=e)){e=Math.max(e,n*(n<1048576?2:1.125)>>>0),0!=n&&(e=Math.max(e,256));var r=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(r.subarray(0,t.usedBytes),0)}},resizeFileStorage(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var n=t.contents;t.contents=new Uint8Array(e),n&&t.contents.set(n.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr(t){var e={};return e.dev=bt.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,bt.isDir(t.mode)?e.size=4096:bt.isFile(t.mode)?e.size=t.usedBytes:bt.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&ft.resizeFileStorage(t,e.size)},lookup(t,e){throw bt.genericErrors[44]},mknod:(t,e,n,r)=>ft.createNode(t,e,n,r),rename(t,e,n){if(bt.isDir(t.mode)){var r;try{r=bt.lookupNode(e,n)}catch(t){}if(r)for(var i in r.contents)throw new bt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=n,e.contents[n]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir(t,e){var n=bt.lookupNode(t,e);for(var r in n.contents)throw new bt.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir(t){var e=[".",".."];for(var n in t.contents)t.contents.hasOwnProperty(n)&&e.push(n);return e},symlink(t,e,n){var r=ft.createNode(t,e,41471,0);return r.link=n,r},readlink(t){if(!bt.isLink(t.mode))throw new bt.ErrnoError(28);return t.link}},stream_ops:{read(t,e,n,r,i){var o=t.node.contents;if(i>=t.node.usedBytes)return 0;var l=Math.min(t.node.usedBytes-i,r);if(l>8&&o.subarray)e.set(o.subarray(i,i+l),n);else for(var s=0;s<l;s++)e[n+s]=o[i+s];return l},write(t,e,n,r,i,o){if(e.buffer===E.buffer&&(o=!1),!r)return 0;var l=t.node;if(l.timestamp=Date.now(),e.subarray&&(!l.contents||l.contents.subarray)){if(o)return l.contents=e.subarray(n,n+r),l.usedBytes=r,r;if(0===l.usedBytes&&0===i)return l.contents=e.slice(n,n+r),l.usedBytes=r,r;if(i+r<=l.usedBytes)return l.contents.set(e.subarray(n,n+r),i),r}if(ft.expandFileStorage(l,i+r),l.contents.subarray&&e.subarray)l.contents.set(e.subarray(n,n+r),i);else for(var s=0;s<r;s++)l.contents[i+s]=e[n+s];return l.usedBytes=Math.max(l.usedBytes,i+r),r},llseek(t,e,n){var r=e;if(1===n?r+=t.position:2===n&&bt.isFile(t.node.mode)&&(r+=t.node.usedBytes),r<0)throw new bt.ErrnoError(28);return r},allocate(t,e,n){ft.expandFileStorage(t.node,e+n),t.node.usedBytes=Math.max(t.node.usedBytes,e+n)},mmap(t,e,n,r,i){if(!bt.isFile(t.node.mode))throw new bt.ErrnoError(43);var o,l,s=t.node.contents;if(2&i||s.buffer!==E.buffer){if((n>0||n+e<s.length)&&(s=s.subarray?s.subarray(n,n+e):Array.prototype.slice.call(s,n,n+e)),l=!0,!(o=pt(e)))throw new bt.ErrnoError(48);E.set(s,o)}else l=!1,o=s.byteOffset;return{ptr:o,allocated:l}},msync:(t,e,n,r,i)=>(ft.stream_ops.write(t,e,0,r,n,!1),0)}},gt=(t,e,n,r)=>{var i=r?"":`al ${t}`;l(t,(n=>{var r;r=`Loading data file "${t}" failed (no arrayBuffer).`,n||U(r),e(new Uint8Array(n)),i&&M()}),(e=>{if(!n)throw`Loading data file "${t}" failed.`;n()})),i&&H()},dt=i.preloadPlugins||[];function mt(t,e){var n=0;return t&&(n|=365),e&&(n|=146),n}var bt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=lt.resolve(t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new bt.ErrnoError(32);for(var n=t.split("/").filter((t=>!!t)),r=bt.root,i="/",o=0;o<n.length;o++){var l=o===n.length-1;if(l&&e.parent)break;if(r=bt.lookupNode(r,n[o]),i=it.join2(i,n[o]),bt.isMountpoint(r)&&(!l||l&&e.follow_mount)&&(r=r.mounted.root),!l||e.follow)for(var s=0;bt.isLink(r.mode);){var a=bt.readlink(i);if(i=lt.resolve(it.dirname(i),a),r=bt.lookupPath(i,{recurse_count:e.recurse_count+1}).node,s++>40)throw new bt.ErrnoError(32)}}return{path:i,node:r}},getPath:t=>{for(var e;;){if(bt.isRoot(t)){var n=t.mount.mountpoint;return e?"/"!==n[n.length-1]?`${n}/${e}`:n+e:n}e=e?`${t.name}/${e}`:t.name,t=t.parent}},hashName:(t,e)=>{for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return(t+n>>>0)%bt.nameTable.length},hashAddNode:t=>{var e=bt.hashName(t.parent.id,t.name);t.name_next=bt.nameTable[e],bt.nameTable[e]=t},hashRemoveNode:t=>{var e=bt.hashName(t.parent.id,t.name);if(bt.nameTable[e]===t)bt.nameTable[e]=t.name_next;else for(var n=bt.nameTable[e];n;){if(n.name_next===t){n.name_next=t.name_next;break}n=n.name_next}},lookupNode:(t,e)=>{var n=bt.mayLookup(t);if(n)throw new bt.ErrnoError(n,t);for(var r=bt.hashName(t.id,e),i=bt.nameTable[r];i;i=i.name_next){var o=i.name;if(i.parent.id===t.id&&o===e)return i}return bt.lookup(t,e)},createNode:(t,e,n,r)=>{var i=new bt.FSNode(t,e,n,r);return bt.hashAddNode(i),i},destroyNode:t=>{bt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>bt.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=bt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{bt.lookupNode(t,e);return 20}catch(t){}return bt.nodePermissions(t,"wx")},mayDelete:(t,e,n)=>{var r;try{r=bt.lookupNode(t,e)}catch(t){return t.errno}var i=bt.nodePermissions(t,"wx");if(i)return i;if(n){if(!bt.isDir(r.mode))return 54;if(bt.isRoot(r)||bt.getPath(r)===bt.cwd())return 10}else if(bt.isDir(r.mode))return 31;return 0},mayOpen:(t,e)=>t?bt.isLink(t.mode)?32:bt.isDir(t.mode)&&("r"!==bt.flagsToPermissionString(e)||512&e)?31:bt.nodePermissions(t,bt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var t=0;t<=bt.MAX_OPEN_FDS;t++)if(!bt.streams[t])return t;throw new bt.ErrnoError(33)},getStreamChecked:t=>{var e=bt.getStream(t);if(!e)throw new bt.ErrnoError(8);return e},getStream:t=>bt.streams[t],createStream:(t,e=-1)=>(bt.FSStream||(bt.FSStream=function(){this.shared={}},bt.FSStream.prototype={},Object.defineProperties(bt.FSStream.prototype,{object:{get(){return this.node},set(t){this.node=t}},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(t){this.shared.flags=t}},position:{get(){return this.shared.position},set(t){this.shared.position=t}}})),t=Object.assign(new bt.FSStream,t),-1==e&&(e=bt.nextfd()),t.fd=e,bt.streams[e]=t,t),closeStream:t=>{bt.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=bt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new bt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{bt.devices[t]={stream_ops:e}},getDevice:t=>bt.devices[t],getMounts:t=>{for(var e=[],n=[t];n.length;){var r=n.pop();e.push(r),n.push.apply(n,r.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),bt.syncFSRequests++,bt.syncFSRequests>1&&b(`warning: ${bt.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=bt.getMounts(bt.root.mount),r=0;function i(t){return bt.syncFSRequests--,e(t)}function o(t){if(t)return o.errored?void 0:(o.errored=!0,i(t));++r>=n.length&&i(null)}n.forEach((e=>{if(!e.type.syncfs)return o(null);e.type.syncfs(e,t,o)}))},mount:(t,e,n)=>{var r,i="/"===n,o=!n;if(i&&bt.root)throw new bt.ErrnoError(10);if(!i&&!o){var l=bt.lookupPath(n,{follow_mount:!1});if(n=l.path,r=l.node,bt.isMountpoint(r))throw new bt.ErrnoError(10);if(!bt.isDir(r.mode))throw new bt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:n,mounts:[]},a=t.mount(s);return a.mount=s,s.root=a,i?bt.root=a:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),a},unmount:t=>{var e=bt.lookupPath(t,{follow_mount:!1});if(!bt.isMountpoint(e.node))throw new bt.ErrnoError(28);var n=e.node,r=n.mounted,i=bt.getMounts(r);Object.keys(bt.nameTable).forEach((t=>{for(var e=bt.nameTable[t];e;){var n=e.name_next;i.includes(e.mount)&&bt.destroyNode(e),e=n}})),n.mounted=null;var o=n.mount.mounts.indexOf(r);n.mount.mounts.splice(o,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,n)=>{var r=bt.lookupPath(t,{parent:!0}).node,i=it.basename(t);if(!i||"."===i||".."===i)throw new bt.ErrnoError(28);var o=bt.mayCreate(r,i);if(o)throw new bt.ErrnoError(o);if(!r.node_ops.mknod)throw new bt.ErrnoError(63);return r.node_ops.mknod(r,i,e,n)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,bt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,bt.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var n=t.split("/"),r="",i=0;i<n.length;++i)if(n[i]){r+="/"+n[i];try{bt.mkdir(r,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,n)=>(void 0===n&&(n=e,e=438),e|=8192,bt.mknod(t,e,n)),symlink:(t,e)=>{if(!lt.resolve(t))throw new bt.ErrnoError(44);var n=bt.lookupPath(e,{parent:!0}).node;if(!n)throw new bt.ErrnoError(44);var r=it.basename(e),i=bt.mayCreate(n,r);if(i)throw new bt.ErrnoError(i);if(!n.node_ops.symlink)throw new bt.ErrnoError(63);return n.node_ops.symlink(n,r,t)},rename:(t,e)=>{var n,r,i=it.dirname(t),o=it.dirname(e),l=it.basename(t),s=it.basename(e);if(n=bt.lookupPath(t,{parent:!0}).node,r=bt.lookupPath(e,{parent:!0}).node,!n||!r)throw new bt.ErrnoError(44);if(n.mount!==r.mount)throw new bt.ErrnoError(75);var a,h=bt.lookupNode(n,l),_=lt.relative(t,o);if("."!==_.charAt(0))throw new bt.ErrnoError(28);if("."!==(_=lt.relative(e,i)).charAt(0))throw new bt.ErrnoError(55);try{a=bt.lookupNode(r,s)}catch(t){}if(h!==a){var u=bt.isDir(h.mode),c=bt.mayDelete(n,l,u);if(c)throw new bt.ErrnoError(c);if(c=a?bt.mayDelete(r,s,u):bt.mayCreate(r,s))throw new bt.ErrnoError(c);if(!n.node_ops.rename)throw new bt.ErrnoError(63);if(bt.isMountpoint(h)||a&&bt.isMountpoint(a))throw new bt.ErrnoError(10);if(r!==n&&(c=bt.nodePermissions(n,"w")))throw new bt.ErrnoError(c);bt.hashRemoveNode(h);try{n.node_ops.rename(h,r,s)}catch(t){throw t}finally{bt.hashAddNode(h)}}},rmdir:t=>{var e=bt.lookupPath(t,{parent:!0}).node,n=it.basename(t),r=bt.lookupNode(e,n),i=bt.mayDelete(e,n,!0);if(i)throw new bt.ErrnoError(i);if(!e.node_ops.rmdir)throw new bt.ErrnoError(63);if(bt.isMountpoint(r))throw new bt.ErrnoError(10);e.node_ops.rmdir(e,n),bt.destroyNode(r)},readdir:t=>{var e=bt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new bt.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=bt.lookupPath(t,{parent:!0}).node;if(!e)throw new bt.ErrnoError(44);var n=it.basename(t),r=bt.lookupNode(e,n),i=bt.mayDelete(e,n,!1);if(i)throw new bt.ErrnoError(i);if(!e.node_ops.unlink)throw new bt.ErrnoError(63);if(bt.isMountpoint(r))throw new bt.ErrnoError(10);e.node_ops.unlink(e,n),bt.destroyNode(r)},readlink:t=>{var e=bt.lookupPath(t).node;if(!e)throw new bt.ErrnoError(44);if(!e.node_ops.readlink)throw new bt.ErrnoError(28);return lt.resolve(bt.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var n=bt.lookupPath(t,{follow:!e}).node;if(!n)throw new bt.ErrnoError(44);if(!n.node_ops.getattr)throw new bt.ErrnoError(63);return n.node_ops.getattr(n)},lstat:t=>bt.stat(t,!0),chmod:(t,e,n)=>{var r;"string"==typeof t?r=bt.lookupPath(t,{follow:!n}).node:r=t;if(!r.node_ops.setattr)throw new bt.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&e|-4096&r.mode,timestamp:Date.now()})},lchmod:(t,e)=>{bt.chmod(t,e,!0)},fchmod:(t,e)=>{var n=bt.getStreamChecked(t);bt.chmod(n.node,e)},chown:(t,e,n,r)=>{var i;"string"==typeof t?i=bt.lookupPath(t,{follow:!r}).node:i=t;if(!i.node_ops.setattr)throw new bt.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown:(t,e,n)=>{bt.chown(t,e,n,!0)},fchown:(t,e,n)=>{var r=bt.getStreamChecked(t);bt.chown(r.node,e,n)},truncate:(t,e)=>{if(e<0)throw new bt.ErrnoError(28);var n;"string"==typeof t?n=bt.lookupPath(t,{follow:!0}).node:n=t;if(!n.node_ops.setattr)throw new bt.ErrnoError(63);if(bt.isDir(n.mode))throw new bt.ErrnoError(31);if(!bt.isFile(n.mode))throw new bt.ErrnoError(28);var r=bt.nodePermissions(n,"w");if(r)throw new bt.ErrnoError(r);n.node_ops.setattr(n,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var n=bt.getStreamChecked(t);if(!(2097155&n.flags))throw new bt.ErrnoError(28);bt.truncate(n.node,e)},utime:(t,e,n)=>{var r=bt.lookupPath(t,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(e,n)})},open:(t,e,n)=>{if(""===t)throw new bt.ErrnoError(44);var r;if(n=void 0===n?438:n,n=64&(e="string"==typeof e?function(t){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===e)throw new Error(`Unknown file open mode: ${t}`);return e}(e):e)?4095&n|32768:0,"object"==typeof t)r=t;else{t=it.normalize(t);try{r=bt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(r){if(128&e)throw new bt.ErrnoError(20)}else r=bt.mknod(t,n,0),o=!0;if(!r)throw new bt.ErrnoError(44);if(bt.isChrdev(r.mode)&&(e&=-513),65536&e&&!bt.isDir(r.mode))throw new bt.ErrnoError(54);if(!o){var l=bt.mayOpen(r,e);if(l)throw new bt.ErrnoError(l)}512&e&&!o&&bt.truncate(r,0),e&=-131713;var s=bt.createStream({node:r,path:bt.getPath(r),flags:e,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(bt.readFiles||(bt.readFiles={}),t in bt.readFiles||(bt.readFiles[t]=1)),s},close:t=>{if(bt.isClosed(t))throw new bt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{bt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,n)=>{if(bt.isClosed(t))throw new bt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new bt.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new bt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,n),t.ungotten=[],t.position},read:(t,e,n,r,i)=>{if(r<0||i<0)throw new bt.ErrnoError(28);if(bt.isClosed(t))throw new bt.ErrnoError(8);if(1==(2097155&t.flags))throw new bt.ErrnoError(8);if(bt.isDir(t.node.mode))throw new bt.ErrnoError(31);if(!t.stream_ops.read)throw new bt.ErrnoError(28);var o=void 0!==i;if(o){if(!t.seekable)throw new bt.ErrnoError(70)}else i=t.position;var l=t.stream_ops.read(t,e,n,r,i);return o||(t.position+=l),l},write:(t,e,n,r,i,o)=>{if(r<0||i<0)throw new bt.ErrnoError(28);if(bt.isClosed(t))throw new bt.ErrnoError(8);if(!(2097155&t.flags))throw new bt.ErrnoError(8);if(bt.isDir(t.node.mode))throw new bt.ErrnoError(31);if(!t.stream_ops.write)throw new bt.ErrnoError(28);t.seekable&&1024&t.flags&&bt.llseek(t,0,2);var l=void 0!==i;if(l){if(!t.seekable)throw new bt.ErrnoError(70)}else i=t.position;var s=t.stream_ops.write(t,e,n,r,i,o);return l||(t.position+=s),s},allocate:(t,e,n)=>{if(bt.isClosed(t))throw new bt.ErrnoError(8);if(e<0||n<=0)throw new bt.ErrnoError(28);if(!(2097155&t.flags))throw new bt.ErrnoError(8);if(!bt.isFile(t.node.mode)&&!bt.isDir(t.node.mode))throw new bt.ErrnoError(43);if(!t.stream_ops.allocate)throw new bt.ErrnoError(138);t.stream_ops.allocate(t,e,n)},mmap:(t,e,n,r,i)=>{if(2&r&&!(2&i)&&2!=(2097155&t.flags))throw new bt.ErrnoError(2);if(1==(2097155&t.flags))throw new bt.ErrnoError(2);if(!t.stream_ops.mmap)throw new bt.ErrnoError(43);return t.stream_ops.mmap(t,e,n,r,i)},msync:(t,e,n,r,i)=>t.stream_ops.msync?t.stream_ops.msync(t,e,n,r,i):0,munmap:t=>0,ioctl:(t,e,n)=>{if(!t.stream_ops.ioctl)throw new bt.ErrnoError(59);return t.stream_ops.ioctl(t,e,n)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var n,r=bt.open(t,e.flags),i=bt.stat(t).size,o=new Uint8Array(i);return bt.read(r,o,0,i,0),"utf8"===e.encoding?n=at(o,0):"binary"===e.encoding&&(n=o),bt.close(r),n},writeFile:(t,e,n={})=>{n.flags=n.flags||577;var r=bt.open(t,n.flags,n.mode);if("string"==typeof e){var i=new Uint8Array(_t(e)+1),o=ut(e,i,0,i.length);bt.write(r,i,0,o,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");bt.write(r,e,0,e.byteLength,void 0,n.canOwn)}bt.close(r)},cwd:()=>bt.currentPath,chdir:t=>{var e=bt.lookupPath(t,{follow:!0});if(null===e.node)throw new bt.ErrnoError(44);if(!bt.isDir(e.node.mode))throw new bt.ErrnoError(54);var n=bt.nodePermissions(e.node,"x");if(n)throw new bt.ErrnoError(n);bt.currentPath=e.path},createDefaultDirectories:()=>{bt.mkdir("/tmp"),bt.mkdir("/home"),bt.mkdir("/home/web_user")},createDefaultDevices:()=>{bt.mkdir("/dev"),bt.registerDevice(bt.makedev(1,3),{read:()=>0,write:(t,e,n,r,i)=>r}),bt.mkdev("/dev/null",bt.makedev(1,3)),wt.register(bt.makedev(5,0),wt.default_tty_ops),wt.register(bt.makedev(6,0),wt.default_tty1_ops),bt.mkdev("/dev/tty",bt.makedev(5,0)),bt.mkdev("/dev/tty1",bt.makedev(6,0));var t=new Uint8Array(1024),e=0,n=()=>(0===e&&(e=ot(t).byteLength),t[--e]);bt.createDevice("/dev","random",n),bt.createDevice("/dev","urandom",n),bt.mkdir("/dev/shm"),bt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{bt.mkdir("/proc");var t=bt.mkdir("/proc/self");bt.mkdir("/proc/self/fd"),bt.mount({mount:()=>{var e=bt.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var n=+e,r=bt.getStreamChecked(n),i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return i.parent=i,i}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?bt.createDevice("/dev","stdin",i.stdin):bt.symlink("/dev/tty","/dev/stdin"),i.stdout?bt.createDevice("/dev","stdout",null,i.stdout):bt.symlink("/dev/tty","/dev/stdout"),i.stderr?bt.createDevice("/dev","stderr",null,i.stderr):bt.symlink("/dev/tty1","/dev/stderr");bt.open("/dev/stdin",0),bt.open("/dev/stdout",1),bt.open("/dev/stderr",1)},ensureErrnoError:()=>{bt.ErrnoError||(bt.ErrnoError=function(t,e){this.name="ErrnoError",this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},bt.ErrnoError.prototype=new Error,bt.ErrnoError.prototype.constructor=bt.ErrnoError,[44].forEach((t=>{bt.genericErrors[t]=new bt.ErrnoError(t),bt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{bt.ensureErrnoError(),bt.nameTable=new Array(4096),bt.mount(ft,{},"/"),bt.createDefaultDirectories(),bt.createDefaultDevices(),bt.createSpecialDirectories(),bt.filesystems={MEMFS:ft}},init:(t,e,n)=>{bt.init.initialized=!0,bt.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=n||i.stderr,bt.createStandardStreams()},quit:()=>{bt.init.initialized=!1;for(var t=0;t<bt.streams.length;t++){var e=bt.streams[t];e&&bt.close(e)}},findObject:(t,e)=>{var n=bt.analyzePath(t,e);return n.exists?n.object:null},analyzePath:(t,e)=>{try{t=(r=bt.lookupPath(t,{follow:!e})).path}catch(t){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=bt.lookupPath(t,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=it.basename(t),r=bt.lookupPath(t,{follow:!e}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(t){n.error=t.errno}return n},createPath:(t,e,n,r)=>{t="string"==typeof t?t:bt.getPath(t);for(var i=e.split("/").reverse();i.length;){var o=i.pop();if(o){var l=it.join2(t,o);try{bt.mkdir(l)}catch(t){}t=l}}return l},createFile:(t,e,n,r,i)=>{var o=it.join2("string"==typeof t?t:bt.getPath(t),e),l=mt(r,i);return bt.create(o,l)},createDataFile:(t,e,n,r,i,o)=>{var l=e;t&&(t="string"==typeof t?t:bt.getPath(t),l=e?it.join2(t,e):t);var s=mt(r,i),a=bt.create(l,s);if(n){if("string"==typeof n){for(var h=new Array(n.length),_=0,u=n.length;_<u;++_)h[_]=n.charCodeAt(_);n=h}bt.chmod(a,146|s);var c=bt.open(a,577);bt.write(c,n,0,n.length,0,o),bt.close(c),bt.chmod(a,s)}return a},createDevice:(t,e,n,r)=>{var i=it.join2("string"==typeof t?t:bt.getPath(t),e),o=mt(!!n,!!r);bt.createDevice.major||(bt.createDevice.major=64);var l=bt.makedev(bt.createDevice.major++,0);return bt.registerDevice(l,{open:t=>{t.seekable=!1},close:t=>{r&&r.buffer&&r.buffer.length&&r(10)},read:(t,e,r,i,o)=>{for(var l=0,s=0;s<i;s++){var a;try{a=n()}catch(t){throw new bt.ErrnoError(29)}if(void 0===a&&0===l)throw new bt.ErrnoError(6);if(null==a)break;l++,e[r+s]=a}return l&&(t.node.timestamp=Date.now()),l},write:(t,e,n,i,o)=>{for(var l=0;l<i;l++)try{r(e[n+l])}catch(t){throw new bt.ErrnoError(29)}return i&&(t.node.timestamp=Date.now()),l}}),bt.mkdev(i,o,l)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.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(!o)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=ct(o(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new bt.ErrnoError(29)}},createLazyFile:(t,e,n,r,i)=>{function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,n=t/this.chunkSize|0;return this.getter(n)[e]}},o.prototype.setDataGetter=function(t){this.getter=t},o.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",n,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+n+". Status: "+t.status);var e,r=Number(t.getResponseHeader("Content-length")),i=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,o=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,l=1048576;i||(l=r);var s=this;s.setDataGetter((t=>{var e=t*l,i=(t+1)*l-1;if(i=Math.min(i,r-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>r-1)throw new Error("only "+r+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",n,!1),r!==l&&i.setRequestHeader("Range","bytes="+t+"-"+e),i.responseType="arraybuffer",i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+n+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):ct(i.responseText||"",!0)})(e,i)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!o&&r||(l=r=1,r=this.getter(0).length,l=r,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=l,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!c)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var l=new o;Object.defineProperties(l,{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:l}}else s={isDevice:!1,url:n};var a=bt.createFile(t,e,s,r,i);s.contents?a.contents=s.contents:s.url&&(a.contents=null,a.url=s.url),Object.defineProperties(a,{usedBytes:{get:function(){return this.contents.length}}});var h={};function _(t,e,n,r,i){var o=t.node.contents;if(i>=o.length)return 0;var l=Math.min(o.length-i,r);if(o.slice)for(var s=0;s<l;s++)e[n+s]=o[i+s];else for(s=0;s<l;s++)e[n+s]=o.get(i+s);return l}return Object.keys(a.stream_ops).forEach((t=>{var e=a.stream_ops[t];h[t]=function(){return bt.forceLoadFile(a),e.apply(null,arguments)}})),h.read=(t,e,n,r,i)=>(bt.forceLoadFile(a),_(t,e,n,r,i)),h.mmap=(t,e,n,r,i)=>{bt.forceLoadFile(a);var o=pt(e);if(!o)throw new bt.ErrnoError(48);return _(t,E,o,e,n),{ptr:o,allocated:!0}},a.stream_ops=h,a}},St=(t,e)=>t?at(y,t,e):"",vt={DEFAULT_POLLMASK:5,calculateAt:function(t,e,n){if(it.isAbs(e))return e;var r;-100===t?r=bt.cwd():r=vt.getStreamFromFD(t).path;if(0==e.length){if(!n)throw new bt.ErrnoError(44);return r}return it.join2(r,e)},doStat:function(t,e,n){try{var r=t(e)}catch(t){if(t&&t.node&&it.normalize(e)!==it.normalize(bt.getPath(t.node)))return-54;throw t}G[n>>2]=r.dev,G[n+4>>2]=r.mode,P[n+8>>2]=r.nlink,G[n+12>>2]=r.uid,G[n+16>>2]=r.gid,G[n+20>>2]=r.rdev,z=[r.size>>>0,(j=r.size,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],G[n+24>>2]=z[0],G[n+28>>2]=z[1],G[n+32>>2]=4096,G[n+36>>2]=r.blocks;var i=r.atime.getTime(),o=r.mtime.getTime(),l=r.ctime.getTime();return z=[Math.floor(i/1e3)>>>0,(j=Math.floor(i/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],G[n+40>>2]=z[0],G[n+44>>2]=z[1],P[n+48>>2]=i%1e3*1e3,z=[Math.floor(o/1e3)>>>0,(j=Math.floor(o/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],G[n+56>>2]=z[0],G[n+60>>2]=z[1],P[n+64>>2]=o%1e3*1e3,z=[Math.floor(l/1e3)>>>0,(j=Math.floor(l/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],G[n+72>>2]=z[0],G[n+76>>2]=z[1],P[n+80>>2]=l%1e3*1e3,z=[r.ino>>>0,(j=r.ino,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],G[n+88>>2]=z[0],G[n+92>>2]=z[1],0},doMsync:function(t,e,n,r,i){if(!bt.isFile(e.node.mode))throw new bt.ErrnoError(43);if(2&r)return 0;var o=y.slice(t,t+n);bt.msync(e,o,i,n,r)},varargs:void 0,get:()=>(vt.varargs+=4,G[vt.varargs-4>>2]),getStr:t=>St(t),getStreamFromFD:function(t){return bt.getStreamChecked(t)}};var Tt=(t,e,n)=>ut(t,y,e,n);function Et(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${t}`)}}var yt=void 0;function Ct(t){for(var e="",n=t;y[n];)e+=yt[y[n++]];return e}var It={},Gt={},Pt={},Ft=void 0;function At(t){throw new Ft(t)}var Ot=void 0;function xt(t){throw new Ot(t)}function kt(t,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,n={}){var r=e.name;if(t||At(`type "${r}" must have a positive integer typeid pointer`),Gt.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;At(`Cannot register type '${r}' twice`)}if(Gt[t]=e,delete Pt[t],It.hasOwnProperty(t)){var i=It[t];delete It[t],i.forEach((t=>t()))}}(t,e,n)}function Rt(){this.allocated=[void 0],this.freelist=[]}var Dt=new Rt;function Bt(t){t>=Dt.reserved&&0===--Dt.get(t).refcount&&Dt.free(t)}function Lt(){for(var t=0,e=Dt.reserved;e<Dt.allocated.length;++e)void 0!==Dt.allocated[e]&&++t;return t}var Nt=t=>(t||At("Cannot use deleted val. handle = "+t),Dt.get(t).value),Vt=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Dt.allocate({refcount:1,value:t})}};function Ht(t){return this.fromWireType(G[t>>2])}function Mt(t,e){switch(e){case 2:return function(t){return this.fromWireType(F[t>>2])};case 3:return function(t){return this.fromWireType(A[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Ut(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?`_${t}`:t}function Wt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Xt(t,e){return t=Ut(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function jt(t,e){if(!(t instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof t} which is not a function`);var n=Xt(t.name||"unknownFunctionName",(function(){}));n.prototype=t.prototype;var r=new n,i=t.apply(r,e);return i instanceof Object?i:r}function zt(t,e,n){i.hasOwnProperty(t)?((void 0===n||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[n])&&At(`Cannot register public name '${t}' twice`),function(t,e,n){if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||At(`Function '${n}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}}(i,t,t),i.hasOwnProperty(n)&&At(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[t].overloadTable[n]=e):(i[t]=e,void 0!==n&&(i[t].numArguments=n))}var qt=[],Qt=t=>{var e=qt[t];return e||(t>=qt.length&&(qt.length=t+1),qt[t]=e=O.get(t)),e},Yt=(t,e,n)=>t.includes("j")?((t,e,n)=>{var r=i["dynCall_"+t];return n&&n.length?r.apply(null,[e].concat(n)):r.call(null,e)})(t,e,n):Qt(e).apply(null,n);function Jt(t,e){var n,r,i,o=(t=Ct(t)).includes("j")?(n=t,r=e,i=[],function(){return i.length=0,Object.assign(i,arguments),Yt(n,r,i)}):Qt(e);return"function"!=typeof o&&At(`unknown function pointer with signature ${t}: ${e}`),o}var Kt=void 0;function Zt(t){var e=We(t),n=Ct(e);return He(e),n}function $t(t,e,n){switch(e){case 0:return n?function(t){return E[t]}:function(t){return y[t]};case 1:return n?function(t){return C[t>>1]}:function(t){return I[t>>1]};case 2:return n?function(t){return G[t>>2]}:function(t){return P[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var te="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ee=(t,e)=>{for(var n=t,r=n>>1,i=r+e/2;!(r>=i)&&I[r];)++r;if((n=r<<1)-t>32&&te)return te.decode(y.subarray(t,n));for(var o="",l=0;!(l>=e/2);++l){var s=C[t+2*l>>1];if(0==s)break;o+=String.fromCharCode(s)}return o},ne=(t,e,n)=>{if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=e,i=(n-=2)<2*t.length?n/2:t.length,o=0;o<i;++o){var l=t.charCodeAt(o);C[e>>1]=l,e+=2}return C[e>>1]=0,e-r},re=t=>2*t.length,ie=(t,e)=>{for(var n=0,r="";!(n>=e/4);){var i=G[t+4*n>>2];if(0==i)break;if(++n,i>=65536){var o=i-65536;r+=String.fromCharCode(55296|o>>10,56320|1023&o)}else r+=String.fromCharCode(i)}return r},oe=(t,e,n)=>{if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=e,i=r+n-4,o=0;o<t.length;++o){var l=t.charCodeAt(o);if(l>=55296&&l<=57343)l=65536+((1023&l)<<10)|1023&t.charCodeAt(++o);if(G[e>>2]=l,(e+=4)+4>i)break}return G[e>>2]=0,e-r},le=t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&++n,e+=4}return e};function se(t,e){var n=Gt[t];return void 0===n&&At(e+" has unknown type "+Zt(t)),n}function ae(t,e){for(var n=new Array(t),r=0;r<t;++r)n[r]=se(P[e+4*r>>2],"parameter "+r);return n}var he={};function _e(t){var e=he[t];return void 0===e?Ct(t):e}var ue=[];function ce(){return"object"==typeof globalThis?globalThis:Function("return this")()}var we=[];function pe(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}var fe=t=>t%4==0&&(t%100!=0||t%400==0),ge=[0,31,60,91,121,152,182,213,244,274,305,335],de=[0,31,59,90,120,151,181,212,243,273,304,334],me=t=>(fe(t.getFullYear())?ge:de)[t.getMonth()]+t.getDate()-1;var be,Se=t=>{var e=_t(t)+1,n=Ve(e);return n&&Tt(t,n,e),n};be=()=>performance.now();var ve=t=>{var e=t-S.buffer.byteLength+65535>>>16;try{return S.grow(e),k(),1}catch(t){}},Te={},Ee=()=>{if(!Ee.strings){var t={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",_:h||"./this.program"};for(var e in Te)void 0===Te[e]?delete t[e]:t[e]=Te[e];var n=[];for(var e in t)n.push(`${e}=${t[e]}`);Ee.strings=n}return Ee.strings},ye=t=>{T||(i.onExit&&i.onExit(t),x=!0),_(t,new K(t))},Ce=(t,e)=>{ye(t)};var Ie=(t,e,n,r)=>{for(var i=0,o=0;o<n;o++){var l=P[e>>2],s=P[e+4>>2];e+=8;var a=bt.read(t,E,l,s,r);if(a<0)return-1;if(i+=a,a<s)break;void 0!==r&&(r+=a)}return i};var Ge=[31,29,31,30,31,30,31,31,30,31,30,31],Pe=[31,28,31,30,31,30,31,31,30,31,30,31],Fe=(t,e)=>{E.set(t,e)},Ae=(t,e,n,r)=>{var i=G[r+40>>2],o={tm_sec:G[r>>2],tm_min:G[r+4>>2],tm_hour:G[r+8>>2],tm_mday:G[r+12>>2],tm_mon:G[r+16>>2],tm_year:G[r+20>>2],tm_wday:G[r+24>>2],tm_yday:G[r+28>>2],tm_isdst:G[r+32>>2],tm_gmtoff:G[r+36>>2],tm_zone:i?St(i):""},l=St(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var a in s)l=l.replace(new RegExp(a,"g"),s[a]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(t,e,n){for(var r="number"==typeof t?t.toString():t||"";r.length<e;)r=n[0]+r;return r}function c(t,e){return u(t,e,"0")}function w(t,e){function n(t){return t<0?-1:t>0?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function p(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function f(t){var e=((t,e)=>{for(var n=new Date(t.getTime());e>0;){var r=fe(n.getFullYear()),i=n.getMonth(),o=(r?Ge:Pe)[i];if(!(e>o-n.getDate()))return n.setDate(n.getDate()+e),n;e-=o-n.getDate()+1,n.setDate(1),i<11?n.setMonth(i+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n})(new Date(t.tm_year+1900,0,1),t.tm_yday),n=new Date(e.getFullYear(),0,4),r=new Date(e.getFullYear()+1,0,4),i=p(n),o=p(r);return w(i,e)<=0?w(o,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var g={"%a":t=>h[t.tm_wday].substring(0,3),"%A":t=>h[t.tm_wday],"%b":t=>_[t.tm_mon].substring(0,3),"%B":t=>_[t.tm_mon],"%C":t=>c((t.tm_year+1900)/100|0,2),"%d":t=>c(t.tm_mday,2),"%e":t=>u(t.tm_mday,2," "),"%g":t=>f(t).toString().substring(2),"%G":t=>f(t),"%H":t=>c(t.tm_hour,2),"%I":t=>{var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),c(e,2)},"%j":t=>c(t.tm_mday+((t,e)=>{for(var n=0,r=0;r<=e;n+=t[r++]);return n})(fe(t.tm_year+1900)?Ge:Pe,t.tm_mon-1),3),"%m":t=>c(t.tm_mon+1,2),"%M":t=>c(t.tm_min,2),"%n":()=>"\n","%p":t=>t.tm_hour>=0&&t.tm_hour<12?"AM":"PM","%S":t=>c(t.tm_sec,2),"%t":()=>"\t","%u":t=>t.tm_wday||7,"%U":t=>{var e=t.tm_yday+7-t.tm_wday;return c(Math.floor(e/7),2)},"%V":t=>{var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var n=(t.tm_wday+371-t.tm_yday)%7;4==n||3==n&&fe(t.tm_year)||(e=1)}}else{e=52;var r=(t.tm_wday+7-t.tm_yday-1)%7;(4==r||5==r&&fe(t.tm_year%400-1))&&e++}return c(e,2)},"%w":t=>t.tm_wday,"%W":t=>{var e=t.tm_yday+7-(t.tm_wday+6)%7;return c(Math.floor(e/7),2)},"%y":t=>(t.tm_year+1900).toString().substring(2),"%Y":t=>t.tm_year+1900,"%z":t=>{var e=t.tm_gmtoff,n=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(n?"+":"-")+String("0000"+e).slice(-4)},"%Z":t=>t.tm_zone,"%%":()=>"%"};for(var a in l=l.replace(/%%/g,"\0\0"),g)l.includes(a)&&(l=l.replace(new RegExp(a,"g"),g[a](o)));var d=ct(l=l.replace(/\0\0/g,"%"),!1);return d.length>e?0:(Fe(d,t),d.length-1)};var Oe,xe,ke,Re=function(t,e,n,r){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=bt.nextInode++,this.name=e,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r},De=365,Be=146;Object.defineProperties(Re.prototype,{read:{get:function(){return(this.mode&De)===De},set:function(t){t?this.mode|=De:this.mode&=-366}},write:{get:function(){return(this.mode&Be)===Be},set:function(t){t?this.mode|=Be:this.mode&=-147}},isFolder:{get:function(){return bt.isDir(this.mode)}},isDevice:{get:function(){return bt.isChrdev(this.mode)}}}),bt.FSNode=Re,bt.createPreloadedFile=function(t,e,n,r,i,o,l,s,a,h){var _=e?lt.resolve(it.join2(t,e)):t;function u(n){function u(n){h&&h(),s||bt.createDataFile(t,e,n,r,i,a),o&&o(),M()}(function(t,e,n,r){"undefined"!=typeof Browser&&Browser.init();var i=!1;return dt.forEach((function(o){i||o.canHandle(e)&&(o.handle(t,e,n,r),i=!0)})),i})(n,_,u,(()=>{l&&l(),M()}))||u(n)}H(),"string"==typeof n?gt(n,(t=>u(t)),l):u(n)},bt.staticInit(),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);yt=t}(),Ft=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Ot=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(Rt.prototype,{get(t){return this.allocated[t]},has(t){return void 0!==this.allocated[t]},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}}),Dt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Dt.reserved=Dt.allocated.length,i.count_emval_handles=Lt,Kt=i.UnboundTypeError=(Oe=Error,(ke=Xt(xe="UnboundTypeError",(function(t){this.name=xe,this.message=t;var e=new Error(t).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Oe.prototype),ke.prototype.constructor=ke,ke.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},ke);var Le,Ne={J:function(t){var e=new nt(t);return e.get_caught()||(e.set_caught(!0),tt--),e.set_rethrown(!1),$.push(e),Ye(e.excPtr),e.get_exception_ptr()},ca:function(){je(0,0);var t=$.pop();Qe(t.excPtr),et=0},b:()=>rt([]),f:t=>rt([t]),pa:(t,e)=>rt([t,e]),nh:(t,e,n,r,i,o,l)=>rt([t,e,n,r,i,o,l]),sa:function(t){return new nt(t).get_exception_ptr()},uc:function(){var t=$.pop();t||U("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||($.push(t),t.set_rethrown(!0),t.set_caught(!1),tt++),et=e},l:function(t,e,n){throw new nt(t).init(e,n),tt++,et=t},gg:function(){return tt},g:function(t){throw et||(et=t),et},yg:function(t,e,n,r){try{if(e=vt.getStr(e),e=vt.calculateAt(t,e),-8&n)return-28;var i=bt.lookupPath(e,{follow:!0}).node;if(!i)return-44;var o="";return 4&n&&(o+="r"),2&n&&(o+="w"),1&n&&(o+="x"),o&&bt.nodePermissions(i,o)?-2:0}catch(t){if(void 0===bt||"ErrnoError"!==t.name)throw t;return-t.errno}},ee:function(t,e,n){vt.varargs=n;try{var r=vt.getStreamFromFD(t);switch(e){case 0:return(i=vt.get())<0?-28:bt.createStream(r,i).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:var i=vt.get();return r.flags|=i,0;case 5:i=vt.get();return C[i+0>>1]=2,0;case 16:case 8:default:return