@areb0s/scip.js 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -44
- package/dist/scip-core.js +1 -1
- package/dist/scip-wrapper.js +33 -17
- package/dist/scip.js +184 -25
- package/dist/scip.js.map +2 -2
- package/dist/scip.min.js +11 -11
- package/dist/scip.min.js.map +3 -3
- package/dist/scip.wasm +0 -0
- package/dist/types.d.ts +8 -2
- package/package.json +1 -1
package/dist/scip.min.js
CHANGED
|
@@ -13,17 +13,17 @@ var __importMetaUrl = (function() {
|
|
|
13
13
|
return CDN_BASE;
|
|
14
14
|
})();
|
|
15
15
|
|
|
16
|
-
var SCIPModule=(()=>{var
|
|
16
|
+
var SCIPModule=(()=>{var qe=Object.defineProperty;var en=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var tn=Object.prototype.hasOwnProperty;var nn=(d,y)=>()=>(d&&(y=d(d=0)),y);var br=(d,y)=>{for(var u in y)qe(d,u,{get:y[u],enumerable:!0})},on=(d,y,u,I)=>{if(y&&typeof y=="object"||typeof y=="function")for(let F of rn(y))!tn.call(d,F)&&F!==u&&qe(d,F,{get:()=>y[F],enumerable:!(I=en(y,F))||I.enumerable});return d};var an=d=>on(qe({},"__esModule",{value:!0}),d);var Fr={};br(Fr,{default:()=>ln});var sn,ln,Dr=nn(()=>{sn=(()=>{var d=__importMetaUrl;return function(y={}){var u=y,I,F;u.ready=new Promise((e,r)=>{I=e,F=r});var U=Object.assign({},u),le=[],L="./this.program",Q=(e,r)=>{throw r},O=typeof window=="object",ee=typeof importScripts=="function",ge=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",B="";function H(e){return u.locateFile?u.locateFile(e,B):B+e}var me,Ee,he;(O||ee)&&(ee?B=self.location.href:typeof document<"u"&&document.currentScript&&(B=document.currentScript.src),d&&(B=d),B.startsWith("blob:")?B="":B=B.substr(0,B.replace(/[?#].*/,"").lastIndexOf("/")+1),me=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},ee&&(he=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Ee=(e,r,t)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{if(o.status==200||o.status==0&&o.response){r(o.response);return}t()},o.onerror=t,o.send(null)});var pe=u.print||console.log.bind(console),q=u.printErr||console.error.bind(console);Object.assign(u,U),U=null,u.arguments&&(le=u.arguments),u.thisProgram&&(L=u.thisProgram),u.quit&&(Q=u.quit);var ne;u.wasmBinary&&(ne=u.wasmBinary);var oe,ue=!1,fe,x,ae,ke,Pr,_,P,Mr,Ar;function Ke(){var e=oe.buffer;u.HEAP8=x=new Int8Array(e),u.HEAP16=ke=new Int16Array(e),u.HEAPU8=ae=new Uint8Array(e),u.HEAPU16=Pr=new Uint16Array(e),u.HEAP32=_=new Int32Array(e),u.HEAPU32=P=new Uint32Array(e),u.HEAPF32=Mr=new Float32Array(e),u.HEAPF64=Ar=new Float64Array(e)}var Je=[],Qe=[],Rr=[],Ze=[],Tr=!1;function Nr(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)zr(u.preRun.shift());be(Je)}function Cr(){Tr=!0,!u.noFSInit&&!n.init.initialized&&n.init(),n.ignorePermissions=!1,re.init(),be(Qe)}function xr(){be(Rr)}function Ir(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Lr(u.postRun.shift());be(Ze)}function zr(e){Je.unshift(e)}function Ur(e){Qe.unshift(e)}function Lr(e){Ze.unshift(e)}var ie=0,Ue=null,we=null;function wn(e){return e}function Se(e){ie++,u.monitorRunDependencies?.(ie)}function ye(e){if(ie--,u.monitorRunDependencies?.(ie),ie==0&&(Ue!==null&&(clearInterval(Ue),Ue=null),we)){var r=we;we=null,r()}}function Le(e){u.onAbort?.(e),e="Aborted("+e+")",q(e),ue=!0,fe=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw F(r),r}var Or="data:application/octet-stream;base64,",er=e=>e.startsWith(Or),se;u.locateFile?(se="scip.wasm",er(se)||(se=H(se))):se=new URL("scip.wasm",__importMetaUrl).href;function rr(e){if(e==se&&ne)return new Uint8Array(ne);if(he)return he(e);throw"both async and sync fetching of the wasm failed"}function Br(e){return!ne&&(O||ee)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(r=>{if(!r.ok)throw`failed to load wasm binary file at '${e}'`;return r.arrayBuffer()}).catch(()=>rr(e)):Promise.resolve().then(()=>rr(e))}function tr(e,r,t){return Br(e).then(o=>WebAssembly.instantiate(o,r)).then(t,o=>{q(`failed to asynchronously prepare wasm: ${o}`),Le(o)})}function jr(e,r,t,o){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!er(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(a=>{var i=WebAssembly.instantiateStreaming(a,t);return i.then(o,function(s){return q(`wasm streaming compile failed: ${s}`),q("falling back to ArrayBuffer instantiation"),tr(r,t,o)})}):tr(r,t,o)}function Hr(){var e={a:Wt};function r(o,a){return j=o.exports,oe=j.O,Ke(),ar=j.R,Ur(j.P),ye("wasm-instantiate"),j}Se("wasm-instantiate");function t(o){r(o.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(o){q(`Module.instantiateWasm callback failed with error: ${o}`),F(o)}return jr(ne,se,e,t).catch(F),{}}var E,T;function nr(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var be=e=>{for(;e.length>0;)e.shift()(u)},or=u.noExitRuntime||!0,Fe=[],ar,X=e=>{var r=Fe[e];return r||(e>=Fe.length&&(Fe.length=e+1),Fe[e]=r=ar.get(e)),r},Wr=(e,r)=>X(e)(r);class Yr{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){P[this.ptr+4>>2]=r}get_type(){return P[this.ptr+4>>2]}set_destructor(r){P[this.ptr+8>>2]=r}get_destructor(){return P[this.ptr+8>>2]}set_caught(r){r=r?1:0,x[this.ptr+12]=r}get_caught(){return x[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,x[this.ptr+13]=r}get_rethrown(){return x[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){P[this.ptr+16>>2]=r}get_adjusted_ptr(){return P[this.ptr+16>>2]}get_exception_ptr(){var r=gr(this.get_type());if(r)return P[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var ir=0,$r=0,qr=(e,r,t)=>{var o=new Yr(e);throw o.init(r,t),ir=e,$r++,ir},D={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,o=e.length-1;o>=0;o--){var a=e[o];a==="."?e.splice(o,1):a===".."?(e.splice(o,1),t++):t&&(e.splice(o,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=D.isAbs(e),t=e.substr(-1)==="/";return e=D.normalizeArray(e.split("/").filter(o=>!!o),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=D.splitPath(e),t=r[0],o=r[1];return!t&&!o?".":(o&&(o=o.substr(0,o.length-1)),t+o)},basename:e=>{if(e==="/")return"/";e=D.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>D.normalize(e.join("/")),join2:(e,r)=>D.normalize(e+"/"+r)},Xr=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);Le("initRandomDevice")},sr=e=>(sr=Xr())(e),Z={resolve:(...e)=>{for(var r="",t=!1,o=e.length-1;o>=-1&&!t;o--){var a=o>=0?e[o]:n.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";r=a+"/"+r,t=D.isAbs(a)}return r=D.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=Z.resolve(e).substr(1),r=Z.resolve(r).substr(1);function t(p){for(var S=0;S<p.length&&p[S]==="";S++);for(var b=p.length-1;b>=0&&p[b]==="";b--);return S>b?[]:p.slice(S,b-S+1)}for(var o=t(e.split("/")),a=t(r.split("/")),i=Math.min(o.length,a.length),s=i,l=0;l<i;l++)if(o[l]!==a[l]){s=l;break}for(var c=[],l=s;l<o.length;l++)c.push("..");return c=c.concat(a.slice(s)),c.join("/")}},lr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,ce=(e,r,t)=>{for(var o=r+t,a=r;e[a]&&!(a>=o);)++a;if(a-r>16&&e.buffer&&lr)return lr.decode(e.subarray(r,a));for(var i="";r<a;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var c=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var p=s-65536;i+=String.fromCharCode(55296|p>>10,56320|p&1023)}}return i},Oe=[],De=e=>{for(var r=0,t=0;t<e.length;++t){var o=e.charCodeAt(t);o<=127?r++:o<=2047?r+=2:o>=55296&&o<=57343?(r+=4,++t):r+=3}return r},Be=(e,r,t,o)=>{if(!(o>0))return 0;for(var a=t,i=t+o-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-a};function Pe(e,r,t){var o=t>0?t:De(e)+1,a=new Array(o),i=Be(e,a,0,a.length);return r&&(a.length=i),a}var Gr=()=>{if(!Oe.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"?(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
17
17
|
`)):typeof readline=="function"&&(e=readline(),e!==null&&(e+=`
|
|
18
|
-
`)),!e)return null;Ce=_e(e,!0)}return Ce.shift()},J={ttys:[],init(){},shutdown(){},register(e,r){J.ttys[e]={input:[],output:[],ops:r},n.registerDevice(e,J.stream_ops)},stream_ops:{open(e){var r=J.ttys[e.node.rdev];if(!r)throw new n.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,o,a){if(!e.tty||!e.tty.ops.get_char)throw new n.ErrnoError(60);for(var i=0,s=0;s<o;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch{throw new n.ErrnoError(29)}if(l===void 0&&i===0)throw new n.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){if(!e.tty||!e.tty.ops.put_char)throw new n.ErrnoError(60);try{for(var i=0;i<o;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch{throw new n.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Ur()},put_char(e,r){r===null||r===10?(ue(oe(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ue(oe(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(W(oe(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(W(oe(e.output,0)),e.output=[])}}},Or=(e,r)=>(ee.fill(0,e,e+r),e),Br=(e,r)=>Math.ceil(e/r)*r,tr=e=>{e=Br(e,65536);var r=ur(65536,e);return r?Or(r,e):0},w={ops_table:null,mount(e){return w.createNode(null,"/",16895,0)},createNode(e,r,t,o){if(n.isBlkdev(t)||n.isFIFO(t))throw new n.ErrnoError(63);w.ops_table||(w.ops_table={dir:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr,lookup:w.node_ops.lookup,mknod:w.node_ops.mknod,rename:w.node_ops.rename,unlink:w.node_ops.unlink,rmdir:w.node_ops.rmdir,readdir:w.node_ops.readdir,symlink:w.node_ops.symlink},stream:{llseek:w.stream_ops.llseek}},file:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr},stream:{llseek:w.stream_ops.llseek,read:w.stream_ops.read,write:w.stream_ops.write,allocate:w.stream_ops.allocate,mmap:w.stream_ops.mmap,msync:w.stream_ops.msync}},link:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr,readlink:w.node_ops.readlink},stream:{}},chrdev:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr},stream:n.chrdev_stream_ops}});var a=n.createNode(e,r,t,o);return n.isDir(a.mode)?(a.node_ops=w.ops_table.dir.node,a.stream_ops=w.ops_table.dir.stream,a.contents={}):n.isFile(a.mode)?(a.node_ops=w.ops_table.file.node,a.stream_ops=w.ops_table.file.stream,a.usedBytes=0,a.contents=null):n.isLink(a.mode)?(a.node_ops=w.ops_table.link.node,a.stream_ops=w.ops_table.link.stream):n.isChrdev(a.mode)&&(a.node_ops=w.ops_table.chrdev.node,a.stream_ops=w.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[r]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var o=1024*1024;r=Math.max(r,t*(t<o?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var a=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=n.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,n.isDir(e.mode)?r.size=4096:n.isFile(e.mode)?r.size=e.usedBytes:n.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){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&w.resizeFileStorage(e,r.size)},lookup(e,r){throw n.genericErrors[44]},mknod(e,r,t,o){return w.createNode(e,r,t,o)},rename(e,r,t){if(n.isDir(e.mode)){var o;try{o=n.lookupNode(r,t)}catch{}if(o)for(var a in o.contents)throw new n.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=n.lookupNode(e,r);for(var o in t.contents)throw new n.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var o=w.createNode(e,r,41471,0);return o.link=t,o},readlink(e){if(!n.isLink(e.mode))throw new n.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,o,a){var i=e.node.contents;if(a>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-a,o);if(s>8&&i.subarray)r.set(i.subarray(a,a+s),t);else for(var l=0;l<s;l++)r[t+l]=i[a+l];return s},write(e,r,t,o,a,i){if(r.buffer===I.buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+o),s.usedBytes=o,o;if(s.usedBytes===0&&a===0)return s.contents=r.slice(t,t+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(t,t+o),a),o}if(w.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+o),a);else for(var l=0;l<o;l++)s.contents[a+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,r,t){var o=r;if(t===1?o+=e.position:t===2&&n.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new n.ErrnoError(28);return o},allocate(e,r,t){w.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,o,a){if(!n.isFile(e.node.mode))throw new n.ErrnoError(43);var i,s,l=e.node.contents;if(!(a&2)&&l.buffer===I.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=tr(r),!i)throw new n.ErrnoError(48);I.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,o,a){return w.stream_ops.write(e,r,0,o,t,!1),0}}},jr=(e,r,t,o)=>{var a=o?"":`al ${e}`;ve(e,i=>{r(new Uint8Array(i)),a&&de(a)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),a&&we(a)},Hr=(e,r,t,o,a,i)=>{n.createDataFile(e,r,t,o,a,i)},Yr=u.preloadPlugins||[],Wr=(e,r,t,o)=>{typeof Browser<"u"&&Browser.init();var a=!1;return Yr.forEach(i=>{a||i.canHandle(r)&&(i.handle(e,r,t,o),a=!0)}),a},$r=(e,r,t,o,a,i,s,l,c,p)=>{var k=r?X.resolve(D.join2(e,r)):e,b=`cp ${k}`;function h(v){function E(x){p?.(),l||Hr(e,r,x,o,a,c),i?.(),de(b)}Wr(v,k,E,()=>{s?.(),de(b)})||E(v)}we(b),typeof t=="string"?jr(t,h,s):h(t)},qr=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},ze=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},n={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=n.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=o,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return n.isDir(this.mode)}get isDevice(){return n.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=X.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new n.ErrnoError(32);for(var o=e.split("/").filter(b=>!!b),a=n.root,i="/",s=0;s<o.length;s++){var l=s===o.length-1;if(l&&r.parent)break;if(a=n.lookupNode(a,o[s]),i=D.join2(i,o[s]),n.isMountpoint(a)&&(!l||l&&r.follow_mount)&&(a=a.mounted.root),!l||r.follow)for(var c=0;n.isLink(a.mode);){var p=n.readlink(i);i=X.resolve(D.dirname(i),p);var k=n.lookupPath(i,{recurse_count:r.recurse_count+1});if(a=k.node,c++>40)throw new n.ErrnoError(32)}}return{path:i,node:a}},getPath(e){for(var r;;){if(n.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,o=0;o<r.length;o++)t=(t<<5)-t+r.charCodeAt(o)|0;return(e+t>>>0)%n.nameTable.length},hashAddNode(e){var r=n.hashName(e.parent.id,e.name);e.name_next=n.nameTable[r],n.nameTable[r]=e},hashRemoveNode(e){var r=n.hashName(e.parent.id,e.name);if(n.nameTable[r]===e)n.nameTable[r]=e.name_next;else for(var t=n.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=n.mayLookup(e);if(t)throw new n.ErrnoError(t);for(var o=n.hashName(e.id,r),a=n.nameTable[o];a;a=a.name_next){var i=a.name;if(a.parent.id===e.id&&i===r)return a}return n.lookup(e,r)},createNode(e,r,t,o){var a=new n.FSNode(e,r,t,o);return n.hashAddNode(a),a},destroyNode(e){n.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return n.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!n.isDir(e.mode))return 54;var r=n.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=n.lookupNode(e,r);return 20}catch{}return n.nodePermissions(e,"wx")},mayDelete(e,r,t){var o;try{o=n.lookupNode(e,r)}catch(i){return i.errno}var a=n.nodePermissions(e,"wx");if(a)return a;if(t){if(!n.isDir(o.mode))return 54;if(n.isRoot(o)||n.getPath(o)===n.cwd())return 10}else if(n.isDir(o.mode))return 31;return 0},mayOpen(e,r){return e?n.isLink(e.mode)?32:n.isDir(e.mode)&&(n.flagsToPermissionString(r)!=="r"||r&512)?31:n.nodePermissions(e,n.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=n.MAX_OPEN_FDS;e++)if(!n.streams[e])return e;throw new n.ErrnoError(33)},getStreamChecked(e){var r=n.getStream(e);if(!r)throw new n.ErrnoError(8);return r},getStream:e=>n.streams[e],createStream(e,r=-1){return e=Object.assign(new n.FSStream,e),r==-1&&(r=n.nextfd()),e.fd=r,n.streams[r]=e,e},closeStream(e){n.streams[e]=null},dupStream(e,r=-1){var t=n.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=n.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new n.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){n.devices[e]={stream_ops:r}},getDevice:e=>n.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var o=t.pop();r.push(o),t.push(...o.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),n.syncFSRequests++,n.syncFSRequests>1&&W(`warning: ${n.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=n.getMounts(n.root.mount),o=0;function a(s){return n.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,a(s));++o>=t.length&&a(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var o=t==="/",a=!t,i;if(o&&n.root)throw new n.ErrnoError(10);if(!o&&!a){var s=n.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,n.isMountpoint(i))throw new n.ErrnoError(10);if(!n.isDir(i.mode))throw new n.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(l);return c.mount=l,l.root=c,o?n.root=c:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),c},unmount(e){var r=n.lookupPath(e,{follow_mount:!1});if(!n.isMountpoint(r.node))throw new n.ErrnoError(28);var t=r.node,o=t.mounted,a=n.getMounts(o);Object.keys(n.nameTable).forEach(s=>{for(var l=n.nameTable[s];l;){var c=l.name_next;a.includes(l.mount)&&n.destroyNode(l),l=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(o);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var o=n.lookupPath(e,{parent:!0}),a=o.node,i=D.basename(e);if(!i||i==="."||i==="..")throw new n.ErrnoError(28);var s=n.mayCreate(a,i);if(s)throw new n.ErrnoError(s);if(!a.node_ops.mknod)throw new n.ErrnoError(63);return a.node_ops.mknod(a,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,n.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,n.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),o="",a=0;a<t.length;++a)if(t[a]){o+="/"+t[a];try{n.mkdir(o,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,n.mknod(e,r,t)},symlink(e,r){if(!X.resolve(e))throw new n.ErrnoError(44);var t=n.lookupPath(r,{parent:!0}),o=t.node;if(!o)throw new n.ErrnoError(44);var a=D.basename(r),i=n.mayCreate(o,a);if(i)throw new n.ErrnoError(i);if(!o.node_ops.symlink)throw new n.ErrnoError(63);return o.node_ops.symlink(o,a,e)},rename(e,r){var t=D.dirname(e),o=D.dirname(r),a=D.basename(e),i=D.basename(r),s,l,c;if(s=n.lookupPath(e,{parent:!0}),l=s.node,s=n.lookupPath(r,{parent:!0}),c=s.node,!l||!c)throw new n.ErrnoError(44);if(l.mount!==c.mount)throw new n.ErrnoError(75);var p=n.lookupNode(l,a),k=X.relative(e,o);if(k.charAt(0)!==".")throw new n.ErrnoError(28);if(k=X.relative(r,t),k.charAt(0)!==".")throw new n.ErrnoError(55);var b;try{b=n.lookupNode(c,i)}catch{}if(p!==b){var h=n.isDir(p.mode),v=n.mayDelete(l,a,h);if(v)throw new n.ErrnoError(v);if(v=b?n.mayDelete(c,i,h):n.mayCreate(c,i),v)throw new n.ErrnoError(v);if(!l.node_ops.rename)throw new n.ErrnoError(63);if(n.isMountpoint(p)||b&&n.isMountpoint(b))throw new n.ErrnoError(10);if(c!==l&&(v=n.nodePermissions(l,"w"),v))throw new n.ErrnoError(v);n.hashRemoveNode(p);try{l.node_ops.rename(p,c,i)}catch(E){throw E}finally{n.hashAddNode(p)}}},rmdir(e){var r=n.lookupPath(e,{parent:!0}),t=r.node,o=D.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!0);if(i)throw new n.ErrnoError(i);if(!t.node_ops.rmdir)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.rmdir(t,o),n.destroyNode(a)},readdir(e){var r=n.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new n.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=n.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new n.ErrnoError(44);var o=D.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!1);if(i)throw new n.ErrnoError(i);if(!t.node_ops.unlink)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.unlink(t,o),n.destroyNode(a)},readlink(e){var r=n.lookupPath(e),t=r.node;if(!t)throw new n.ErrnoError(44);if(!t.node_ops.readlink)throw new n.ErrnoError(28);return X.resolve(n.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=n.lookupPath(e,{follow:!r}),o=t.node;if(!o)throw new n.ErrnoError(44);if(!o.node_ops.getattr)throw new n.ErrnoError(63);return o.node_ops.getattr(o)},lstat(e){return n.stat(e,!0)},chmod(e,r,t){var o;if(typeof e=="string"){var a=n.lookupPath(e,{follow:!t});o=a.node}else o=e;if(!o.node_ops.setattr)throw new n.ErrnoError(63);o.node_ops.setattr(o,{mode:r&4095|o.mode&-4096,timestamp:Date.now()})},lchmod(e,r){n.chmod(e,r,!0)},fchmod(e,r){var t=n.getStreamChecked(e);n.chmod(t.node,r)},chown(e,r,t,o){var a;if(typeof e=="string"){var i=n.lookupPath(e,{follow:!o});a=i.node}else a=e;if(!a.node_ops.setattr)throw new n.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,r,t){n.chown(e,r,t,!0)},fchown(e,r,t){var o=n.getStreamChecked(e);n.chown(o.node,r,t)},truncate(e,r){if(r<0)throw new n.ErrnoError(28);var t;if(typeof e=="string"){var o=n.lookupPath(e,{follow:!0});t=o.node}else t=e;if(!t.node_ops.setattr)throw new n.ErrnoError(63);if(n.isDir(t.mode))throw new n.ErrnoError(31);if(!n.isFile(t.mode))throw new n.ErrnoError(28);var a=n.nodePermissions(t,"w");if(a)throw new n.ErrnoError(a);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=n.getStreamChecked(e);if(!(t.flags&2097155))throw new n.ErrnoError(28);n.truncate(t.node,r)},utime(e,r,t){var o=n.lookupPath(e,{follow:!0}),a=o.node;a.node_ops.setattr(a,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new n.ErrnoError(44);r=typeof r=="string"?qr(r):r,t=typeof t>"u"?438:t,r&64?t=t&4095|32768:t=0;var o;if(typeof e=="object")o=e;else{e=D.normalize(e);try{var a=n.lookupPath(e,{follow:!(r&131072)});o=a.node}catch{}}var i=!1;if(r&64)if(o){if(r&128)throw new n.ErrnoError(20)}else o=n.mknod(e,t,0),i=!0;if(!o)throw new n.ErrnoError(44);if(n.isChrdev(o.mode)&&(r&=-513),r&65536&&!n.isDir(o.mode))throw new n.ErrnoError(54);if(!i){var s=n.mayOpen(o,r);if(s)throw new n.ErrnoError(s)}r&512&&!i&&n.truncate(o,0),r&=-131713;var l=n.createStream({node:o,path:n.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(n.readFiles||(n.readFiles={}),e in n.readFiles||(n.readFiles[e]=1)),l},close(e){if(n.isClosed(e))throw new n.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{n.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new n.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new n.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,o,a){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===1)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.read)throw new n.ErrnoError(28);var i=typeof a<"u";if(!i)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var s=e.stream_ops.read(e,r,t,o,a);return i||(e.position+=s),s},write(e,r,t,o,a,i){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if(!(e.flags&2097155))throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.write)throw new n.ErrnoError(28);e.seekable&&e.flags&1024&&n.llseek(e,0,2);var s=typeof a<"u";if(!s)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var l=e.stream_ops.write(e,r,t,o,a,i);return s||(e.position+=l),l},allocate(e,r,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(r<0||t<=0)throw new n.ErrnoError(28);if(!(e.flags&2097155))throw new n.ErrnoError(8);if(!n.isFile(e.node.mode)&&!n.isDir(e.node.mode))throw new n.ErrnoError(43);if(!e.stream_ops.allocate)throw new n.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,o,a){if(o&2&&!(a&2)&&(e.flags&2097155)!==2)throw new n.ErrnoError(2);if((e.flags&2097155)===1)throw new n.ErrnoError(2);if(!e.stream_ops.mmap)throw new n.ErrnoError(43);return e.stream_ops.mmap(e,r,t,o,a)},msync(e,r,t,o,a){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,o,a):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new n.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,o=n.open(e,r.flags),a=n.stat(e),i=a.size,s=new Uint8Array(i);return n.read(o,s,0,i,0),r.encoding==="utf8"?t=oe(s,0):r.encoding==="binary"&&(t=s),n.close(o),t},writeFile(e,r,t={}){t.flags=t.flags||577;var o=n.open(e,t.flags,t.mode);if(typeof r=="string"){var a=new Uint8Array(xe(r)+1),i=Ie(r,a,0,a.length);n.write(o,a,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))n.write(o,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");n.close(o)},cwd:()=>n.currentPath,chdir(e){var r=n.lookupPath(e,{follow:!0});if(r.node===null)throw new n.ErrnoError(44);if(!n.isDir(r.node.mode))throw new n.ErrnoError(54);var t=n.nodePermissions(r.node,"x");if(t)throw new n.ErrnoError(t);n.currentPath=r.path},createDefaultDirectories(){n.mkdir("/tmp"),n.mkdir("/home"),n.mkdir("/home/web_user")},createDefaultDevices(){n.mkdir("/dev"),n.registerDevice(n.makedev(1,3),{read:()=>0,write:(o,a,i,s,l)=>s}),n.mkdev("/dev/null",n.makedev(1,3)),J.register(n.makedev(5,0),J.default_tty_ops),J.register(n.makedev(6,0),J.default_tty1_ops),n.mkdev("/dev/tty",n.makedev(5,0)),n.mkdev("/dev/tty1",n.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=er(e).byteLength),e[--r]);n.createDevice("/dev","random",t),n.createDevice("/dev","urandom",t),n.mkdir("/dev/shm"),n.mkdir("/dev/shm/tmp")},createSpecialDirectories(){n.mkdir("/proc");var e=n.mkdir("/proc/self");n.mkdir("/proc/self/fd"),n.mount({mount(){var r=n.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,o){var a=+o,i=n.getStreamChecked(a),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?n.createDevice("/dev","stdin",u.stdin):n.symlink("/dev/tty","/dev/stdin"),u.stdout?n.createDevice("/dev","stdout",null,u.stdout):n.symlink("/dev/tty","/dev/stdout"),u.stderr?n.createDevice("/dev","stderr",null,u.stderr):n.symlink("/dev/tty1","/dev/stderr");var e=n.open("/dev/stdin",0),r=n.open("/dev/stdout",1),t=n.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{n.genericErrors[e]=new n.ErrnoError(e),n.genericErrors[e].stack="<generic error, no stack>"}),n.nameTable=new Array(4096),n.mount(w,{},"/"),n.createDefaultDirectories(),n.createDefaultDevices(),n.createSpecialDirectories(),n.filesystems={MEMFS:w}},init(e,r,t){n.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,n.createStandardStreams()},quit(){n.init.initialized=!1;for(var e=0;e<n.streams.length;e++){var r=n.streams[e];r&&n.close(r)}},findObject(e,r){var t=n.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=n.lookupPath(e,{follow:!r});e=t.path}catch{}var o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=n.lookupPath(e,{parent:!0});o.parentExists=!0,o.parentPath=t.path,o.parentObject=t.node,o.name=D.basename(e),t=n.lookupPath(e,{follow:!r}),o.exists=!0,o.path=t.path,o.object=t.node,o.name=t.node.name,o.isRoot=t.path==="/"}catch(a){o.error=a.errno}return o},createPath(e,r,t,o){e=typeof e=="string"?e:n.getPath(e);for(var a=r.split("/").reverse();a.length;){var i=a.pop();if(i){var s=D.join2(e,i);try{n.mkdir(s)}catch{}e=s}}return s},createFile(e,r,t,o,a){var i=D.join2(typeof e=="string"?e:n.getPath(e),r),s=ze(o,a);return n.create(i,s)},createDataFile(e,r,t,o,a,i){var s=r;e&&(e=typeof e=="string"?e:n.getPath(e),s=r?D.join2(e,r):e);var l=ze(o,a),c=n.create(s,l);if(t){if(typeof t=="string"){for(var p=new Array(t.length),k=0,b=t.length;k<b;++k)p[k]=t.charCodeAt(k);t=p}n.chmod(c,l|146);var h=n.open(c,577);n.write(h,t,0,t.length,0,i),n.close(h),n.chmod(c,l)}},createDevice(e,r,t,o){var a=D.join2(typeof e=="string"?e:n.getPath(e),r),i=ze(!!t,!!o);n.createDevice.major||(n.createDevice.major=64);var s=n.makedev(n.createDevice.major++,0);return n.registerDevice(s,{open(l){l.seekable=!1},close(l){o?.buffer?.length&&o(10)},read(l,c,p,k,b){for(var h=0,v=0;v<k;v++){var E;try{E=t()}catch{throw new n.ErrnoError(29)}if(E===void 0&&h===0)throw new n.ErrnoError(6);if(E==null)break;h++,c[p+v]=E}return h&&(l.node.timestamp=Date.now()),h},write(l,c,p,k,b){for(var h=0;h<k;h++)try{o(c[p+h])}catch{throw new n.ErrnoError(29)}return k&&(l.node.timestamp=Date.now()),h}}),n.mkdev(a,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(se)try{e.contents=_e(se(e.url),!0),e.usedBytes=e.contents.length}catch{throw new n.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(e,r,t,o,a){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(v){if(!(v>this.length-1||v<0)){var E=v%this.chunkSize,x=v/this.chunkSize|0;return this.getter(x)[E]}}setDataGetter(v){this.getter=v}cacheLength(){var v=new XMLHttpRequest;if(v.open("HEAD",t,!1),v.send(null),!(v.status>=200&&v.status<300||v.status===304))throw new Error("Couldn't load "+t+". Status: "+v.status);var E=Number(v.getResponseHeader("Content-length")),x,j=(x=v.getResponseHeader("Accept-Ranges"))&&x==="bytes",U=(x=v.getResponseHeader("Content-Encoding"))&&x==="gzip",f=1024*1024;j||(f=E);var m=(A,H)=>{if(A>H)throw new Error("invalid range ("+A+", "+H+") or no bytes requested!");if(H>E-1)throw new Error("only "+E+" bytes available! programmer error!");var T=new XMLHttpRequest;if(T.open("GET",t,!1),E!==f&&T.setRequestHeader("Range","bytes="+A+"-"+H),T.responseType="arraybuffer",T.overrideMimeType&&T.overrideMimeType("text/plain; charset=x-user-defined"),T.send(null),!(T.status>=200&&T.status<300||T.status===304))throw new Error("Couldn't load "+t+". Status: "+T.status);return T.response!==void 0?new Uint8Array(T.response||[]):_e(T.responseText||"",!0)},C=this;C.setDataGetter(A=>{var H=A*f,T=(A+1)*f-1;if(T=Math.min(T,E-1),typeof C.chunks[A]>"u"&&(C.chunks[A]=m(H,T)),typeof C.chunks[A]>"u")throw new Error("doXHR failed!");return C.chunks[A]}),(U||!E)&&(f=E=1,E=this.getter(0).length,f=E,ue("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=E,this._chunkSize=f,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!V)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var c=n.createFile(e,r,l,o,a);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var p={},k=Object.keys(c.stream_ops);k.forEach(h=>{var v=c.stream_ops[h];p[h]=(...E)=>(n.forceLoadFile(c),v(...E))});function b(h,v,E,x,j){var U=h.node.contents;if(j>=U.length)return 0;var f=Math.min(U.length-j,x);if(U.slice)for(var m=0;m<f;m++)v[E+m]=U[j+m];else for(var m=0;m<f;m++)v[E+m]=U.get(j+m);return f}return p.read=(h,v,E,x,j)=>(n.forceLoadFile(c),b(h,v,E,x,j)),p.mmap=(h,v,E,x,j)=>{n.forceLoadFile(c);var U=tr(v);if(!U)throw new n.ErrnoError(48);return b(h,I,U,v,E),{ptr:U,allocated:!0}},c.stream_ops=p,c}},Le=(e,r)=>e?oe(ee,e,r):"",S={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(D.isAbs(r))return r;var o;if(e===-100)o=n.cwd();else{var a=S.getStreamFromFD(e);o=a.path}if(r.length==0){if(!t)throw new n.ErrnoError(44);return o}return D.join2(o,r)},doStat(e,r,t){var o=e(r);_[t>>2]=o.dev,_[t+4>>2]=o.mode,M[t+8>>2]=o.nlink,_[t+12>>2]=o.uid,_[t+16>>2]=o.gid,_[t+20>>2]=o.rdev,N=[o.size>>>0,(g=o.size,+Math.abs(g)>=1?g>0?+Math.floor(g/4294967296)>>>0:~~+Math.ceil((g-+(~~g>>>0))/4294967296)>>>0:0)],_[t+24>>2]=N[0],_[t+28>>2]=N[1],_[t+32>>2]=4096,_[t+36>>2]=o.blocks;var a=o.atime.getTime(),i=o.mtime.getTime(),s=o.ctime.getTime();return N=[Math.floor(a/1e3)>>>0,(g=Math.floor(a/1e3),+Math.abs(g)>=1?g>0?+Math.floor(g/4294967296)>>>0:~~+Math.ceil((g-+(~~g>>>0))/4294967296)>>>0:0)],_[t+40>>2]=N[0],_[t+44>>2]=N[1],M[t+48>>2]=a%1e3*1e3,N=[Math.floor(i/1e3)>>>0,(g=Math.floor(i/1e3),+Math.abs(g)>=1?g>0?+Math.floor(g/4294967296)>>>0:~~+Math.ceil((g-+(~~g>>>0))/4294967296)>>>0:0)],_[t+56>>2]=N[0],_[t+60>>2]=N[1],M[t+64>>2]=i%1e3*1e3,N=[Math.floor(s/1e3)>>>0,(g=Math.floor(s/1e3),+Math.abs(g)>=1?g>0?+Math.floor(g/4294967296)>>>0:~~+Math.ceil((g-+(~~g>>>0))/4294967296)>>>0:0)],_[t+72>>2]=N[0],_[t+76>>2]=N[1],M[t+80>>2]=s%1e3*1e3,N=[o.ino>>>0,(g=o.ino,+Math.abs(g)>=1?g>0?+Math.floor(g/4294967296)>>>0:~~+Math.ceil((g-+(~~g>>>0))/4294967296)>>>0:0)],_[t+88>>2]=N[0],_[t+92>>2]=N[1],0},doMsync(e,r,t,o,a){if(!n.isFile(r.node.mode))throw new n.ErrnoError(43);if(o&2)return 0;var i=ee.slice(e,e+t);n.msync(r,i,a,t,o)},varargs:void 0,get(){var e=_[+S.varargs>>2];return S.varargs+=4,e},getp(){return S.get()},getStr(e){var r=Le(e);return r},getStreamFromFD(e){var r=n.getStreamChecked(e);return r}};function Xr(e,r,t){S.varargs=t;try{var o=S.getStreamFromFD(e);switch(r){case 0:{var a=S.get();if(a<0)return-28;for(;n.streams[a];)a++;var i;return i=n.dupStream(o,a),i.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var a=S.get();return o.flags|=a,0}case 12:{var a=S.getp(),s=0;return pe[a+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function Gr(e,r){try{var t=S.getStreamFromFD(e);return S.doStat(n.stat,t.path,r)}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function Vr(e,r,t){S.varargs=t;try{var o=S.getStreamFromFD(e);switch(r){case 21509:return o.tty?0:-59;case 21505:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var a=o.tty.ops.ioctl_tcgets(o),i=S.getp();_[i>>2]=a.c_iflag||0,_[i+4>>2]=a.c_oflag||0,_[i+8>>2]=a.c_cflag||0,_[i+12>>2]=a.c_lflag||0;for(var s=0;s<32;s++)I[i+s+17]=a.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return o.tty?0:-59;case 21506:case 21507:case 21508:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){for(var i=S.getp(),l=_[i>>2],c=_[i+4>>2],p=_[i+8>>2],k=_[i+12>>2],b=[],s=0;s<32;s++)b.push(I[i+s+17]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:l,c_oflag:c,c_cflag:p,c_lflag:k,c_cc:b})}return 0}case 21519:{if(!o.tty)return-59;var i=S.getp();return _[i>>2]=0,0}case 21520:return o.tty?-28:-59;case 21531:{var i=S.getp();return n.ioctl(o,r,i)}case 21523:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var h=o.tty.ops.ioctl_tiocgwinsz(o.tty),i=S.getp();pe[i>>1]=h[0],pe[i+2>>1]=h[1]}return 0}case 21524:return o.tty?0:-59;case 21515:return o.tty?0:-59;default:return-28}}catch(v){if(typeof n>"u"||v.name!=="ErrnoError")throw v;return-v.errno}}function Kr(e,r,t,o){try{r=S.getStr(r);var a=o&256,i=o&4096;return o=o&-6401,r=S.calculateAt(e,r,i),S.doStat(a?n.lstat:n.stat,r,t)}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function Jr(e,r,t,o){S.varargs=o;try{r=S.getStr(r),r=S.calculateAt(e,r);var a=o?S.get():0;return n.open(r,t,a).fd}catch(i){if(typeof n>"u"||i.name!=="ErrnoError")throw i;return-i.errno}}function Zr(e,r){try{return e=S.getStr(e),S.doStat(n.stat,e,r)}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}var Qr=1,et=()=>Qr,Ue=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function rt(e,r,t,o,a,i,s,l){var c=Ue(a,i);try{if(isNaN(c))return 61;var p=S.getStreamFromFD(o),k=n.mmap(p,e,c,r,t),b=k.ptr;return _[s>>2]=k.allocated,M[l>>2]=b,0}catch(h){if(typeof n>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}function tt(e,r,t,o,a,i,s){var l=Ue(i,s);try{var c=S.getStreamFromFD(a);t&2&&S.doMsync(e,c,r,o,l)}catch(p){if(typeof n>"u"||p.name!=="ErrnoError")throw p;return-p.errno}}var nt=()=>{Ne("")},ot=()=>Date.now(),nr=()=>2147483648,at=()=>nr(),or;or=()=>performance.now();var it=(e,r,t)=>ee.copyWithin(e,r,r+t),st=e=>{var r=Q.buffer,t=(e-r.byteLength+65535)/65536;try{return Q.grow(t),$e(),1}catch{}},lt=e=>{var r=ee.length;e>>>=0;var t=nr();if(e>t)return!1;for(var o=(c,p)=>c+(p-c%p)%p,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,o(Math.max(e,i),65536)),l=st(s);if(l)return!0}return!1},Oe={},ut=()=>B||"./this.program",me=()=>{if(!me.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:ut()};for(var t in Oe)Oe[t]===void 0?delete r[t]:r[t]=Oe[t];var o=[];for(var t in r)o.push(`${t}=${r[t]}`);me.strings=o}return me.strings},ft=(e,r)=>{for(var t=0;t<e.length;++t)I[r++]=e.charCodeAt(t);I[r]=0},ct=(e,r)=>{var t=0;return me().forEach((o,a)=>{var i=r+t;M[e+a*4>>2]=i,ft(o,i),t+=o.length+1}),0},dt=(e,r)=>{var t=me();M[e>>2]=t.length;var o=0;return t.forEach(a=>o+=a.length+1),M[r>>2]=o,0},mt=0,vt=()=>Cr||mt>0,ht=e=>{he=e,vt()||(u.onExit?.(e),fe=!0),q(e,new Ze(e))},ar=(e,r)=>{he=e,ht(e)},pt=ar;function wt(e){try{var r=S.getStreamFromFD(e);return n.close(r),0}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var yt=(e,r,t,o)=>{for(var a=0,i=0;i<t;i++){var s=M[r>>2],l=M[r+4>>2];r+=8;var c=n.read(e,I,s,l,o);if(c<0)return-1;if(a+=c,c<l)break;typeof o<"u"&&(o+=c)}return a};function _t(e,r,t,o){try{var a=S.getStreamFromFD(e),i=yt(a,r,t);return M[o>>2]=i,0}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return s.errno}}function gt(e,r,t,o,a){var i=Ue(r,t);try{if(isNaN(i))return 61;var s=S.getStreamFromFD(e);return n.llseek(s,i,o),N=[s.position>>>0,(g=s.position,+Math.abs(g)>=1?g>0?+Math.floor(g/4294967296)>>>0:~~+Math.ceil((g-+(~~g>>>0))/4294967296)>>>0:0)],_[a>>2]=N[0],_[a+4>>2]=N[1],s.getdents&&i===0&&o===0&&(s.getdents=null),0}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var Et=(e,r,t,o)=>{for(var a=0,i=0;i<t;i++){var s=M[r>>2],l=M[r+4>>2];r+=8;var c=n.write(e,I,s,l,o);if(c<0)return-1;a+=c,typeof o<"u"&&(o+=c)}return a};function kt(e,r,t,o){try{var a=S.getStreamFromFD(e),i=Et(a,r,t);return M[o>>2]=i,0}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var ge=e=>e%4===0&&(e%100!==0||e%400===0),St=(e,r)=>{for(var t=0,o=0;o<=r;t+=e[o++]);return t},ir=[31,29,31,30,31,30,31,31,30,31,30,31],sr=[31,28,31,30,31,30,31,31,30,31,30,31],bt=(e,r)=>{for(var t=new Date(e.getTime());r>0;){var o=ge(t.getFullYear()),a=t.getMonth(),i=(o?ir:sr)[a];if(r>i-t.getDate())r-=i-t.getDate()+1,t.setDate(1),a<11?t.setMonth(a+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else return t.setDate(t.getDate()+r),t}return t},Ft=(e,r)=>{I.set(e,r)},Dt=(e,r,t,o)=>{var a=M[o+40>>2],i={tm_sec:_[o>>2],tm_min:_[o+4>>2],tm_hour:_[o+8>>2],tm_mday:_[o+12>>2],tm_mon:_[o+16>>2],tm_year:_[o+20>>2],tm_wday:_[o+24>>2],tm_yday:_[o+28>>2],tm_isdst:_[o+32>>2],tm_gmtoff:_[o+36>>2],tm_zone:a?Le(a):""},s=Le(t),l={"%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 c in l)s=s.replace(new RegExp(c,"g"),l[c]);var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],k=["January","February","March","April","May","June","July","August","September","October","November","December"];function b(f,m,C){for(var A=typeof f=="number"?f.toString():f||"";A.length<m;)A=C[0]+A;return A}function h(f,m){return b(f,m,"0")}function v(f,m){function C(H){return H<0?-1:H>0?1:0}var A;return(A=C(f.getFullYear()-m.getFullYear()))===0&&(A=C(f.getMonth()-m.getMonth()))===0&&(A=C(f.getDate()-m.getDate())),A}function E(f){switch(f.getDay()){case 0:return new Date(f.getFullYear()-1,11,29);case 1:return f;case 2:return new Date(f.getFullYear(),0,3);case 3:return new Date(f.getFullYear(),0,2);case 4:return new Date(f.getFullYear(),0,1);case 5:return new Date(f.getFullYear()-1,11,31);case 6:return new Date(f.getFullYear()-1,11,30)}}function x(f){var m=bt(new Date(f.tm_year+1900,0,1),f.tm_yday),C=new Date(m.getFullYear(),0,4),A=new Date(m.getFullYear()+1,0,4),H=E(C),T=E(A);return v(H,m)<=0?v(T,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var j={"%a":f=>p[f.tm_wday].substring(0,3),"%A":f=>p[f.tm_wday],"%b":f=>k[f.tm_mon].substring(0,3),"%B":f=>k[f.tm_mon],"%C":f=>{var m=f.tm_year+1900;return h(m/100|0,2)},"%d":f=>h(f.tm_mday,2),"%e":f=>b(f.tm_mday,2," "),"%g":f=>x(f).toString().substring(2),"%G":x,"%H":f=>h(f.tm_hour,2),"%I":f=>{var m=f.tm_hour;return m==0?m=12:m>12&&(m-=12),h(m,2)},"%j":f=>h(f.tm_mday+St(ge(f.tm_year+1900)?ir:sr,f.tm_mon-1),3),"%m":f=>h(f.tm_mon+1,2),"%M":f=>h(f.tm_min,2),"%n":()=>`
|
|
19
|
-
`,"%p":f=>f.tm_hour>=0&&f.tm_hour<12?"AM":"PM","%S":f=>h(f.tm_sec,2),"%t":()=>" ","%u":f=>f.tm_wday||7,"%U":f=>{var
|
|
20
|
-
`,
|
|
21
|
-
`,
|
|
22
|
-
`);
|
|
23
|
-
`+d),
|
|
24
|
-
`+d),
|
|
25
|
-
`},
|
|
26
|
-
`},
|
|
18
|
+
`)),!e)return null;Oe=Pe(e,!0)}return Oe.shift()},re={ttys:[],init(){},shutdown(){},register(e,r){re.ttys[e]={input:[],output:[],ops:r},n.registerDevice(e,re.stream_ops)},stream_ops:{open(e){var r=re.ttys[e.node.rdev];if(!r)throw new n.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,o,a){if(!e.tty||!e.tty.ops.get_char)throw new n.ErrnoError(60);for(var i=0,s=0;s<o;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch{throw new n.ErrnoError(29)}if(l===void 0&&i===0)throw new n.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){if(!e.tty||!e.tty.ops.put_char)throw new n.ErrnoError(60);try{for(var i=0;i<o;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch{throw new n.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Gr()},put_char(e,r){r===null||r===10?(pe(ce(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(pe(ce(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(q(ce(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(q(ce(e.output,0)),e.output=[])}}},Vr=(e,r)=>(ae.fill(0,e,e+r),e),Kr=(e,r)=>Math.ceil(e/r)*r,ur=e=>{e=Kr(e,65536);var r=_r(65536,e);return r?Vr(r,e):0},w={ops_table:null,mount(e){return w.createNode(null,"/",16895,0)},createNode(e,r,t,o){if(n.isBlkdev(t)||n.isFIFO(t))throw new n.ErrnoError(63);w.ops_table||(w.ops_table={dir:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr,lookup:w.node_ops.lookup,mknod:w.node_ops.mknod,rename:w.node_ops.rename,unlink:w.node_ops.unlink,rmdir:w.node_ops.rmdir,readdir:w.node_ops.readdir,symlink:w.node_ops.symlink},stream:{llseek:w.stream_ops.llseek}},file:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr},stream:{llseek:w.stream_ops.llseek,read:w.stream_ops.read,write:w.stream_ops.write,allocate:w.stream_ops.allocate,mmap:w.stream_ops.mmap,msync:w.stream_ops.msync}},link:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr,readlink:w.node_ops.readlink},stream:{}},chrdev:{node:{getattr:w.node_ops.getattr,setattr:w.node_ops.setattr},stream:n.chrdev_stream_ops}});var a=n.createNode(e,r,t,o);return n.isDir(a.mode)?(a.node_ops=w.ops_table.dir.node,a.stream_ops=w.ops_table.dir.stream,a.contents={}):n.isFile(a.mode)?(a.node_ops=w.ops_table.file.node,a.stream_ops=w.ops_table.file.stream,a.usedBytes=0,a.contents=null):n.isLink(a.mode)?(a.node_ops=w.ops_table.link.node,a.stream_ops=w.ops_table.link.stream):n.isChrdev(a.mode)&&(a.node_ops=w.ops_table.chrdev.node,a.stream_ops=w.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[r]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var o=1024*1024;r=Math.max(r,t*(t<o?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var a=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=n.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,n.isDir(e.mode)?r.size=4096:n.isFile(e.mode)?r.size=e.usedBytes:n.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){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&w.resizeFileStorage(e,r.size)},lookup(e,r){throw n.genericErrors[44]},mknod(e,r,t,o){return w.createNode(e,r,t,o)},rename(e,r,t){if(n.isDir(e.mode)){var o;try{o=n.lookupNode(r,t)}catch{}if(o)for(var a in o.contents)throw new n.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=n.lookupNode(e,r);for(var o in t.contents)throw new n.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var o=w.createNode(e,r,41471,0);return o.link=t,o},readlink(e){if(!n.isLink(e.mode))throw new n.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,o,a){var i=e.node.contents;if(a>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-a,o);if(s>8&&i.subarray)r.set(i.subarray(a,a+s),t);else for(var l=0;l<s;l++)r[t+l]=i[a+l];return s},write(e,r,t,o,a,i){if(r.buffer===x.buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+o),s.usedBytes=o,o;if(s.usedBytes===0&&a===0)return s.contents=r.slice(t,t+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(t,t+o),a),o}if(w.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+o),a);else for(var l=0;l<o;l++)s.contents[a+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,r,t){var o=r;if(t===1?o+=e.position:t===2&&n.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new n.ErrnoError(28);return o},allocate(e,r,t){w.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,o,a){if(!n.isFile(e.node.mode))throw new n.ErrnoError(43);var i,s,l=e.node.contents;if(!(a&2)&&l.buffer===x.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=ur(r),!i)throw new n.ErrnoError(48);x.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,o,a){return w.stream_ops.write(e,r,0,o,t,!1),0}}},Jr=(e,r,t,o)=>{var a=o?"":`al ${e}`;Ee(e,i=>{r(new Uint8Array(i)),a&&ye(a)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),a&&Se(a)},Qr=(e,r,t,o,a,i)=>{n.createDataFile(e,r,t,o,a,i)},Zr=u.preloadPlugins||[],et=(e,r,t,o)=>{typeof Browser<"u"&&Browser.init();var a=!1;return Zr.forEach(i=>{a||i.canHandle(r)&&(i.handle(e,r,t,o),a=!0)}),a},rt=(e,r,t,o,a,i,s,l,c,p)=>{var S=r?Z.resolve(D.join2(e,r)):e,b=`cp ${S}`;function h(m){function k(C){p?.(),l||Qr(e,r,C,o,a,c),i?.(),ye(b)}et(m,S,k,()=>{s?.(),ye(b)})||k(m)}Se(b),typeof t=="string"?Jr(t,h,s):h(t)},tt=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},je=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},n={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=n.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=o,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return n.isDir(this.mode)}get isDevice(){return n.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=Z.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new n.ErrnoError(32);for(var o=e.split("/").filter(b=>!!b),a=n.root,i="/",s=0;s<o.length;s++){var l=s===o.length-1;if(l&&r.parent)break;if(a=n.lookupNode(a,o[s]),i=D.join2(i,o[s]),n.isMountpoint(a)&&(!l||l&&r.follow_mount)&&(a=a.mounted.root),!l||r.follow)for(var c=0;n.isLink(a.mode);){var p=n.readlink(i);i=Z.resolve(D.dirname(i),p);var S=n.lookupPath(i,{recurse_count:r.recurse_count+1});if(a=S.node,c++>40)throw new n.ErrnoError(32)}}return{path:i,node:a}},getPath(e){for(var r;;){if(n.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,o=0;o<r.length;o++)t=(t<<5)-t+r.charCodeAt(o)|0;return(e+t>>>0)%n.nameTable.length},hashAddNode(e){var r=n.hashName(e.parent.id,e.name);e.name_next=n.nameTable[r],n.nameTable[r]=e},hashRemoveNode(e){var r=n.hashName(e.parent.id,e.name);if(n.nameTable[r]===e)n.nameTable[r]=e.name_next;else for(var t=n.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=n.mayLookup(e);if(t)throw new n.ErrnoError(t);for(var o=n.hashName(e.id,r),a=n.nameTable[o];a;a=a.name_next){var i=a.name;if(a.parent.id===e.id&&i===r)return a}return n.lookup(e,r)},createNode(e,r,t,o){var a=new n.FSNode(e,r,t,o);return n.hashAddNode(a),a},destroyNode(e){n.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return n.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!n.isDir(e.mode))return 54;var r=n.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=n.lookupNode(e,r);return 20}catch{}return n.nodePermissions(e,"wx")},mayDelete(e,r,t){var o;try{o=n.lookupNode(e,r)}catch(i){return i.errno}var a=n.nodePermissions(e,"wx");if(a)return a;if(t){if(!n.isDir(o.mode))return 54;if(n.isRoot(o)||n.getPath(o)===n.cwd())return 10}else if(n.isDir(o.mode))return 31;return 0},mayOpen(e,r){return e?n.isLink(e.mode)?32:n.isDir(e.mode)&&(n.flagsToPermissionString(r)!=="r"||r&512)?31:n.nodePermissions(e,n.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=n.MAX_OPEN_FDS;e++)if(!n.streams[e])return e;throw new n.ErrnoError(33)},getStreamChecked(e){var r=n.getStream(e);if(!r)throw new n.ErrnoError(8);return r},getStream:e=>n.streams[e],createStream(e,r=-1){return e=Object.assign(new n.FSStream,e),r==-1&&(r=n.nextfd()),e.fd=r,n.streams[r]=e,e},closeStream(e){n.streams[e]=null},dupStream(e,r=-1){var t=n.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=n.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new n.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){n.devices[e]={stream_ops:r}},getDevice:e=>n.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var o=t.pop();r.push(o),t.push(...o.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),n.syncFSRequests++,n.syncFSRequests>1&&q(`warning: ${n.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=n.getMounts(n.root.mount),o=0;function a(s){return n.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,a(s));++o>=t.length&&a(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var o=t==="/",a=!t,i;if(o&&n.root)throw new n.ErrnoError(10);if(!o&&!a){var s=n.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,n.isMountpoint(i))throw new n.ErrnoError(10);if(!n.isDir(i.mode))throw new n.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(l);return c.mount=l,l.root=c,o?n.root=c:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),c},unmount(e){var r=n.lookupPath(e,{follow_mount:!1});if(!n.isMountpoint(r.node))throw new n.ErrnoError(28);var t=r.node,o=t.mounted,a=n.getMounts(o);Object.keys(n.nameTable).forEach(s=>{for(var l=n.nameTable[s];l;){var c=l.name_next;a.includes(l.mount)&&n.destroyNode(l),l=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(o);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var o=n.lookupPath(e,{parent:!0}),a=o.node,i=D.basename(e);if(!i||i==="."||i==="..")throw new n.ErrnoError(28);var s=n.mayCreate(a,i);if(s)throw new n.ErrnoError(s);if(!a.node_ops.mknod)throw new n.ErrnoError(63);return a.node_ops.mknod(a,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,n.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,n.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),o="",a=0;a<t.length;++a)if(t[a]){o+="/"+t[a];try{n.mkdir(o,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,n.mknod(e,r,t)},symlink(e,r){if(!Z.resolve(e))throw new n.ErrnoError(44);var t=n.lookupPath(r,{parent:!0}),o=t.node;if(!o)throw new n.ErrnoError(44);var a=D.basename(r),i=n.mayCreate(o,a);if(i)throw new n.ErrnoError(i);if(!o.node_ops.symlink)throw new n.ErrnoError(63);return o.node_ops.symlink(o,a,e)},rename(e,r){var t=D.dirname(e),o=D.dirname(r),a=D.basename(e),i=D.basename(r),s,l,c;if(s=n.lookupPath(e,{parent:!0}),l=s.node,s=n.lookupPath(r,{parent:!0}),c=s.node,!l||!c)throw new n.ErrnoError(44);if(l.mount!==c.mount)throw new n.ErrnoError(75);var p=n.lookupNode(l,a),S=Z.relative(e,o);if(S.charAt(0)!==".")throw new n.ErrnoError(28);if(S=Z.relative(r,t),S.charAt(0)!==".")throw new n.ErrnoError(55);var b;try{b=n.lookupNode(c,i)}catch{}if(p!==b){var h=n.isDir(p.mode),m=n.mayDelete(l,a,h);if(m)throw new n.ErrnoError(m);if(m=b?n.mayDelete(c,i,h):n.mayCreate(c,i),m)throw new n.ErrnoError(m);if(!l.node_ops.rename)throw new n.ErrnoError(63);if(n.isMountpoint(p)||b&&n.isMountpoint(b))throw new n.ErrnoError(10);if(c!==l&&(m=n.nodePermissions(l,"w"),m))throw new n.ErrnoError(m);n.hashRemoveNode(p);try{l.node_ops.rename(p,c,i)}catch(k){throw k}finally{n.hashAddNode(p)}}},rmdir(e){var r=n.lookupPath(e,{parent:!0}),t=r.node,o=D.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!0);if(i)throw new n.ErrnoError(i);if(!t.node_ops.rmdir)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.rmdir(t,o),n.destroyNode(a)},readdir(e){var r=n.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new n.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=n.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new n.ErrnoError(44);var o=D.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!1);if(i)throw new n.ErrnoError(i);if(!t.node_ops.unlink)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.unlink(t,o),n.destroyNode(a)},readlink(e){var r=n.lookupPath(e),t=r.node;if(!t)throw new n.ErrnoError(44);if(!t.node_ops.readlink)throw new n.ErrnoError(28);return Z.resolve(n.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=n.lookupPath(e,{follow:!r}),o=t.node;if(!o)throw new n.ErrnoError(44);if(!o.node_ops.getattr)throw new n.ErrnoError(63);return o.node_ops.getattr(o)},lstat(e){return n.stat(e,!0)},chmod(e,r,t){var o;if(typeof e=="string"){var a=n.lookupPath(e,{follow:!t});o=a.node}else o=e;if(!o.node_ops.setattr)throw new n.ErrnoError(63);o.node_ops.setattr(o,{mode:r&4095|o.mode&-4096,timestamp:Date.now()})},lchmod(e,r){n.chmod(e,r,!0)},fchmod(e,r){var t=n.getStreamChecked(e);n.chmod(t.node,r)},chown(e,r,t,o){var a;if(typeof e=="string"){var i=n.lookupPath(e,{follow:!o});a=i.node}else a=e;if(!a.node_ops.setattr)throw new n.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,r,t){n.chown(e,r,t,!0)},fchown(e,r,t){var o=n.getStreamChecked(e);n.chown(o.node,r,t)},truncate(e,r){if(r<0)throw new n.ErrnoError(28);var t;if(typeof e=="string"){var o=n.lookupPath(e,{follow:!0});t=o.node}else t=e;if(!t.node_ops.setattr)throw new n.ErrnoError(63);if(n.isDir(t.mode))throw new n.ErrnoError(31);if(!n.isFile(t.mode))throw new n.ErrnoError(28);var a=n.nodePermissions(t,"w");if(a)throw new n.ErrnoError(a);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=n.getStreamChecked(e);if(!(t.flags&2097155))throw new n.ErrnoError(28);n.truncate(t.node,r)},utime(e,r,t){var o=n.lookupPath(e,{follow:!0}),a=o.node;a.node_ops.setattr(a,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new n.ErrnoError(44);r=typeof r=="string"?tt(r):r,t=typeof t>"u"?438:t,r&64?t=t&4095|32768:t=0;var o;if(typeof e=="object")o=e;else{e=D.normalize(e);try{var a=n.lookupPath(e,{follow:!(r&131072)});o=a.node}catch{}}var i=!1;if(r&64)if(o){if(r&128)throw new n.ErrnoError(20)}else o=n.mknod(e,t,0),i=!0;if(!o)throw new n.ErrnoError(44);if(n.isChrdev(o.mode)&&(r&=-513),r&65536&&!n.isDir(o.mode))throw new n.ErrnoError(54);if(!i){var s=n.mayOpen(o,r);if(s)throw new n.ErrnoError(s)}r&512&&!i&&n.truncate(o,0),r&=-131713;var l=n.createStream({node:o,path:n.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(n.readFiles||(n.readFiles={}),e in n.readFiles||(n.readFiles[e]=1)),l},close(e){if(n.isClosed(e))throw new n.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{n.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new n.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new n.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,o,a){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===1)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.read)throw new n.ErrnoError(28);var i=typeof a<"u";if(!i)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var s=e.stream_ops.read(e,r,t,o,a);return i||(e.position+=s),s},write(e,r,t,o,a,i){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if(!(e.flags&2097155))throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.write)throw new n.ErrnoError(28);e.seekable&&e.flags&1024&&n.llseek(e,0,2);var s=typeof a<"u";if(!s)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var l=e.stream_ops.write(e,r,t,o,a,i);return s||(e.position+=l),l},allocate(e,r,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(r<0||t<=0)throw new n.ErrnoError(28);if(!(e.flags&2097155))throw new n.ErrnoError(8);if(!n.isFile(e.node.mode)&&!n.isDir(e.node.mode))throw new n.ErrnoError(43);if(!e.stream_ops.allocate)throw new n.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,o,a){if(o&2&&!(a&2)&&(e.flags&2097155)!==2)throw new n.ErrnoError(2);if((e.flags&2097155)===1)throw new n.ErrnoError(2);if(!e.stream_ops.mmap)throw new n.ErrnoError(43);return e.stream_ops.mmap(e,r,t,o,a)},msync(e,r,t,o,a){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,o,a):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new n.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,o=n.open(e,r.flags),a=n.stat(e),i=a.size,s=new Uint8Array(i);return n.read(o,s,0,i,0),r.encoding==="utf8"?t=ce(s,0):r.encoding==="binary"&&(t=s),n.close(o),t},writeFile(e,r,t={}){t.flags=t.flags||577;var o=n.open(e,t.flags,t.mode);if(typeof r=="string"){var a=new Uint8Array(De(r)+1),i=Be(r,a,0,a.length);n.write(o,a,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))n.write(o,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");n.close(o)},cwd:()=>n.currentPath,chdir(e){var r=n.lookupPath(e,{follow:!0});if(r.node===null)throw new n.ErrnoError(44);if(!n.isDir(r.node.mode))throw new n.ErrnoError(54);var t=n.nodePermissions(r.node,"x");if(t)throw new n.ErrnoError(t);n.currentPath=r.path},createDefaultDirectories(){n.mkdir("/tmp"),n.mkdir("/home"),n.mkdir("/home/web_user")},createDefaultDevices(){n.mkdir("/dev"),n.registerDevice(n.makedev(1,3),{read:()=>0,write:(o,a,i,s,l)=>s}),n.mkdev("/dev/null",n.makedev(1,3)),re.register(n.makedev(5,0),re.default_tty_ops),re.register(n.makedev(6,0),re.default_tty1_ops),n.mkdev("/dev/tty",n.makedev(5,0)),n.mkdev("/dev/tty1",n.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=sr(e).byteLength),e[--r]);n.createDevice("/dev","random",t),n.createDevice("/dev","urandom",t),n.mkdir("/dev/shm"),n.mkdir("/dev/shm/tmp")},createSpecialDirectories(){n.mkdir("/proc");var e=n.mkdir("/proc/self");n.mkdir("/proc/self/fd"),n.mount({mount(){var r=n.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,o){var a=+o,i=n.getStreamChecked(a),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?n.createDevice("/dev","stdin",u.stdin):n.symlink("/dev/tty","/dev/stdin"),u.stdout?n.createDevice("/dev","stdout",null,u.stdout):n.symlink("/dev/tty","/dev/stdout"),u.stderr?n.createDevice("/dev","stderr",null,u.stderr):n.symlink("/dev/tty1","/dev/stderr");var e=n.open("/dev/stdin",0),r=n.open("/dev/stdout",1),t=n.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{n.genericErrors[e]=new n.ErrnoError(e),n.genericErrors[e].stack="<generic error, no stack>"}),n.nameTable=new Array(4096),n.mount(w,{},"/"),n.createDefaultDirectories(),n.createDefaultDevices(),n.createSpecialDirectories(),n.filesystems={MEMFS:w}},init(e,r,t){n.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,n.createStandardStreams()},quit(){n.init.initialized=!1;for(var e=0;e<n.streams.length;e++){var r=n.streams[e];r&&n.close(r)}},findObject(e,r){var t=n.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=n.lookupPath(e,{follow:!r});e=t.path}catch{}var o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=n.lookupPath(e,{parent:!0});o.parentExists=!0,o.parentPath=t.path,o.parentObject=t.node,o.name=D.basename(e),t=n.lookupPath(e,{follow:!r}),o.exists=!0,o.path=t.path,o.object=t.node,o.name=t.node.name,o.isRoot=t.path==="/"}catch(a){o.error=a.errno}return o},createPath(e,r,t,o){e=typeof e=="string"?e:n.getPath(e);for(var a=r.split("/").reverse();a.length;){var i=a.pop();if(i){var s=D.join2(e,i);try{n.mkdir(s)}catch{}e=s}}return s},createFile(e,r,t,o,a){var i=D.join2(typeof e=="string"?e:n.getPath(e),r),s=je(o,a);return n.create(i,s)},createDataFile(e,r,t,o,a,i){var s=r;e&&(e=typeof e=="string"?e:n.getPath(e),s=r?D.join2(e,r):e);var l=je(o,a),c=n.create(s,l);if(t){if(typeof t=="string"){for(var p=new Array(t.length),S=0,b=t.length;S<b;++S)p[S]=t.charCodeAt(S);t=p}n.chmod(c,l|146);var h=n.open(c,577);n.write(h,t,0,t.length,0,i),n.close(h),n.chmod(c,l)}},createDevice(e,r,t,o){var a=D.join2(typeof e=="string"?e:n.getPath(e),r),i=je(!!t,!!o);n.createDevice.major||(n.createDevice.major=64);var s=n.makedev(n.createDevice.major++,0);return n.registerDevice(s,{open(l){l.seekable=!1},close(l){o?.buffer?.length&&o(10)},read(l,c,p,S,b){for(var h=0,m=0;m<S;m++){var k;try{k=t()}catch{throw new n.ErrnoError(29)}if(k===void 0&&h===0)throw new n.ErrnoError(6);if(k==null)break;h++,c[p+m]=k}return h&&(l.node.timestamp=Date.now()),h},write(l,c,p,S,b){for(var h=0;h<S;h++)try{o(c[p+h])}catch{throw new n.ErrnoError(29)}return S&&(l.node.timestamp=Date.now()),h}}),n.mkdev(a,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(me)try{e.contents=Pe(me(e.url),!0),e.usedBytes=e.contents.length}catch{throw new n.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(e,r,t,o,a){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(m){if(!(m>this.length-1||m<0)){var k=m%this.chunkSize,C=m/this.chunkSize|0;return this.getter(C)[k]}}setDataGetter(m){this.getter=m}cacheLength(){var m=new XMLHttpRequest;if(m.open("HEAD",t,!1),m.send(null),!(m.status>=200&&m.status<300||m.status===304))throw new Error("Couldn't load "+t+". Status: "+m.status);var k=Number(m.getResponseHeader("Content-length")),C,W=(C=m.getResponseHeader("Accept-Ranges"))&&C==="bytes",z=(C=m.getResponseHeader("Content-Encoding"))&&C==="gzip",f=1024*1024;W||(f=k);var v=(M,Y)=>{if(M>Y)throw new Error("invalid range ("+M+", "+Y+") or no bytes requested!");if(Y>k-1)throw new Error("only "+k+" bytes available! programmer error!");var R=new XMLHttpRequest;if(R.open("GET",t,!1),k!==f&&R.setRequestHeader("Range","bytes="+M+"-"+Y),R.responseType="arraybuffer",R.overrideMimeType&&R.overrideMimeType("text/plain; charset=x-user-defined"),R.send(null),!(R.status>=200&&R.status<300||R.status===304))throw new Error("Couldn't load "+t+". Status: "+R.status);return R.response!==void 0?new Uint8Array(R.response||[]):Pe(R.responseText||"",!0)},N=this;N.setDataGetter(M=>{var Y=M*f,R=(M+1)*f-1;if(R=Math.min(R,k-1),typeof N.chunks[M]>"u"&&(N.chunks[M]=v(Y,R)),typeof N.chunks[M]>"u")throw new Error("doXHR failed!");return N.chunks[M]}),(z||!k)&&(f=k=1,k=this.getter(0).length,f=k,pe("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=k,this._chunkSize=f,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ee)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var c=n.createFile(e,r,l,o,a);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var p={},S=Object.keys(c.stream_ops);S.forEach(h=>{var m=c.stream_ops[h];p[h]=(...k)=>(n.forceLoadFile(c),m(...k))});function b(h,m,k,C,W){var z=h.node.contents;if(W>=z.length)return 0;var f=Math.min(z.length-W,C);if(z.slice)for(var v=0;v<f;v++)m[k+v]=z[W+v];else for(var v=0;v<f;v++)m[k+v]=z.get(W+v);return f}return p.read=(h,m,k,C,W)=>(n.forceLoadFile(c),b(h,m,k,C,W)),p.mmap=(h,m,k,C,W)=>{n.forceLoadFile(c);var z=ur(m);if(!z)throw new n.ErrnoError(48);return b(h,x,z,m,k),{ptr:z,allocated:!0}},c.stream_ops=p,c}},He=(e,r)=>e?ce(ae,e,r):"",g={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(D.isAbs(r))return r;var o;if(e===-100)o=n.cwd();else{var a=g.getStreamFromFD(e);o=a.path}if(r.length==0){if(!t)throw new n.ErrnoError(44);return o}return D.join2(o,r)},doStat(e,r,t){var o=e(r);_[t>>2]=o.dev,_[t+4>>2]=o.mode,P[t+8>>2]=o.nlink,_[t+12>>2]=o.uid,_[t+16>>2]=o.gid,_[t+20>>2]=o.rdev,T=[o.size>>>0,(E=o.size,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+24>>2]=T[0],_[t+28>>2]=T[1],_[t+32>>2]=4096,_[t+36>>2]=o.blocks;var a=o.atime.getTime(),i=o.mtime.getTime(),s=o.ctime.getTime();return T=[Math.floor(a/1e3)>>>0,(E=Math.floor(a/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+40>>2]=T[0],_[t+44>>2]=T[1],P[t+48>>2]=a%1e3*1e3,T=[Math.floor(i/1e3)>>>0,(E=Math.floor(i/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+56>>2]=T[0],_[t+60>>2]=T[1],P[t+64>>2]=i%1e3*1e3,T=[Math.floor(s/1e3)>>>0,(E=Math.floor(s/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+72>>2]=T[0],_[t+76>>2]=T[1],P[t+80>>2]=s%1e3*1e3,T=[o.ino>>>0,(E=o.ino,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+88>>2]=T[0],_[t+92>>2]=T[1],0},doMsync(e,r,t,o,a){if(!n.isFile(r.node.mode))throw new n.ErrnoError(43);if(o&2)return 0;var i=ae.slice(e,e+t);n.msync(r,i,a,t,o)},varargs:void 0,get(){var e=_[+g.varargs>>2];return g.varargs+=4,e},getp(){return g.get()},getStr(e){var r=He(e);return r},getStreamFromFD(e){var r=n.getStreamChecked(e);return r}};function nt(e){try{return e=g.getStr(e),n.chdir(e),0}catch(r){if(typeof n>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function ot(e,r,t,o){try{if(r=g.getStr(r),r=g.calculateAt(e,r),t&-8)return-28;var a=n.lookupPath(r,{follow:!0}),i=a.node;if(!i)return-44;var s="";return t&4&&(s+="r"),t&2&&(s+="w"),t&1&&(s+="x"),s&&n.nodePermissions(i,s)?-2:0}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function at(e,r,t){g.varargs=t;try{var o=g.getStreamFromFD(e);switch(r){case 0:{var a=g.get();if(a<0)return-28;for(;n.streams[a];)a++;var i;return i=n.dupStream(o,a),i.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var a=g.get();return o.flags|=a,0}case 12:{var a=g.getp(),s=0;return ke[a+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function it(e,r){try{var t=g.getStreamFromFD(e);return g.doStat(n.stat,t.path,r)}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var fr=(e,r,t)=>Be(e,ae,r,t);function st(e,r){try{if(r===0)return-28;var t=n.cwd(),o=De(t)+1;return r<o?-68:(fr(t,e,r),o)}catch(a){if(typeof n>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}function lt(e,r,t){g.varargs=t;try{var o=g.getStreamFromFD(e);switch(r){case 21509:return o.tty?0:-59;case 21505:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var a=o.tty.ops.ioctl_tcgets(o),i=g.getp();_[i>>2]=a.c_iflag||0,_[i+4>>2]=a.c_oflag||0,_[i+8>>2]=a.c_cflag||0,_[i+12>>2]=a.c_lflag||0;for(var s=0;s<32;s++)x[i+s+17]=a.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return o.tty?0:-59;case 21506:case 21507:case 21508:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){for(var i=g.getp(),l=_[i>>2],c=_[i+4>>2],p=_[i+8>>2],S=_[i+12>>2],b=[],s=0;s<32;s++)b.push(x[i+s+17]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:l,c_oflag:c,c_cflag:p,c_lflag:S,c_cc:b})}return 0}case 21519:{if(!o.tty)return-59;var i=g.getp();return _[i>>2]=0,0}case 21520:return o.tty?-28:-59;case 21531:{var i=g.getp();return n.ioctl(o,r,i)}case 21523:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var h=o.tty.ops.ioctl_tiocgwinsz(o.tty),i=g.getp();ke[i>>1]=h[0],ke[i+2>>1]=h[1]}return 0}case 21524:return o.tty?0:-59;case 21515:return o.tty?0:-59;default:return-28}}catch(m){if(typeof n>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}function ut(e,r,t,o){try{r=g.getStr(r);var a=o&256,i=o&4096;return o=o&-6401,r=g.calculateAt(e,r,i),g.doStat(a?n.lstat:n.stat,r,t)}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function ft(e,r,t,o){g.varargs=o;try{r=g.getStr(r),r=g.calculateAt(e,r);var a=o?g.get():0;return n.open(r,t,a).fd}catch(i){if(typeof n>"u"||i.name!=="ErrnoError")throw i;return-i.errno}}function ct(e,r){try{return e=g.getStr(e),g.doStat(n.stat,e,r)}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}var dt=1,vt=()=>dt,mt=()=>{or=!1,vr=0},ht=()=>{throw 1/0},We=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function pt(e,r,t,o,a,i,s,l){var c=We(a,i);try{if(isNaN(c))return 61;var p=g.getStreamFromFD(o),S=n.mmap(p,e,c,r,t),b=S.ptr;return _[s>>2]=S.allocated,P[l>>2]=b,0}catch(h){if(typeof n>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}function wt(e,r,t,o,a,i,s){var l=We(i,s);try{var c=g.getStreamFromFD(a);t&2&&g.doMsync(e,c,r,o,l)}catch(p){if(typeof n>"u"||p.name!=="ErrnoError")throw p;return-p.errno}}var yt=()=>{Le("")},_t=()=>Date.now(),cr=()=>2147483648,gt=()=>cr(),dr;dr=()=>performance.now();var Et=(e,r,t)=>ae.copyWithin(e,r,r+t),kt=e=>{var r=oe.buffer,t=(e-r.byteLength+65535)/65536;try{return oe.grow(t),Ke(),1}catch{}},St=e=>{var r=ae.length;e>>>=0;var t=cr();if(e>t)return!1;for(var o=(c,p)=>c+(p-c%p)%p,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,o(Math.max(e,i),65536)),l=kt(s);if(l)return!0}return!1},Ye={},bt=()=>L||"./this.program",_e=()=>{if(!_e.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:bt()};for(var t in Ye)Ye[t]===void 0?delete r[t]:r[t]=Ye[t];var o=[];for(var t in r)o.push(`${t}=${r[t]}`);_e.strings=o}return _e.strings},Ft=(e,r)=>{for(var t=0;t<e.length;++t)x[r++]=e.charCodeAt(t);x[r]=0},Dt=(e,r)=>{var t=0;return _e().forEach((o,a)=>{var i=r+t;P[e+a*4>>2]=i,Ft(o,i),t+=o.length+1}),0},Pt=(e,r)=>{var t=_e();P[e>>2]=t.length;var o=0;return t.forEach(a=>o+=a.length+1),P[r>>2]=o,0},vr=0,Mt=()=>or||vr>0,mr=e=>{fe=e,Mt()||(u.onExit?.(e),ue=!0),Q(e,new nr(e))},hr=(e,r)=>{fe=e,mr(e)},At=hr;function Rt(e){try{var r=g.getStreamFromFD(e);return n.close(r),0}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var Tt=(e,r,t,o)=>{for(var a=0,i=0;i<t;i++){var s=P[r>>2],l=P[r+4>>2];r+=8;var c=n.read(e,x,s,l,o);if(c<0)return-1;if(a+=c,c<l)break;typeof o<"u"&&(o+=c)}return a};function Nt(e,r,t,o){try{var a=g.getStreamFromFD(e),i=Tt(a,r,t);return P[o>>2]=i,0}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return s.errno}}function Ct(e,r,t,o,a){var i=We(r,t);try{if(isNaN(i))return 61;var s=g.getStreamFromFD(e);return n.llseek(s,i,o),T=[s.position>>>0,(E=s.position,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[a>>2]=T[0],_[a+4>>2]=T[1],s.getdents&&i===0&&o===0&&(s.getdents=null),0}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var xt=(e,r,t,o)=>{for(var a=0,i=0;i<t;i++){var s=P[r>>2],l=P[r+4>>2];r+=8;var c=n.write(e,x,s,l,o);if(c<0)return-1;a+=c,typeof o<"u"&&(o+=c)}return a};function It(e,r,t,o){try{var a=g.getStreamFromFD(e),i=xt(a,r,t);return P[o>>2]=i,0}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var Me=e=>e%4===0&&(e%100!==0||e%400===0),zt=(e,r)=>{for(var t=0,o=0;o<=r;t+=e[o++]);return t},pr=[31,29,31,30,31,30,31,31,30,31,30,31],wr=[31,28,31,30,31,30,31,31,30,31,30,31],Ut=(e,r)=>{for(var t=new Date(e.getTime());r>0;){var o=Me(t.getFullYear()),a=t.getMonth(),i=(o?pr:wr)[a];if(r>i-t.getDate())r-=i-t.getDate()+1,t.setDate(1),a<11?t.setMonth(a+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else return t.setDate(t.getDate()+r),t}return t},Lt=(e,r)=>{x.set(e,r)},Ot=(e,r,t,o)=>{var a=P[o+40>>2],i={tm_sec:_[o>>2],tm_min:_[o+4>>2],tm_hour:_[o+8>>2],tm_mday:_[o+12>>2],tm_mon:_[o+16>>2],tm_year:_[o+20>>2],tm_wday:_[o+24>>2],tm_yday:_[o+28>>2],tm_isdst:_[o+32>>2],tm_gmtoff:_[o+36>>2],tm_zone:a?He(a):""},s=He(t),l={"%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 c in l)s=s.replace(new RegExp(c,"g"),l[c]);var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"];function b(f,v,N){for(var M=typeof f=="number"?f.toString():f||"";M.length<v;)M=N[0]+M;return M}function h(f,v){return b(f,v,"0")}function m(f,v){function N(Y){return Y<0?-1:Y>0?1:0}var M;return(M=N(f.getFullYear()-v.getFullYear()))===0&&(M=N(f.getMonth()-v.getMonth()))===0&&(M=N(f.getDate()-v.getDate())),M}function k(f){switch(f.getDay()){case 0:return new Date(f.getFullYear()-1,11,29);case 1:return f;case 2:return new Date(f.getFullYear(),0,3);case 3:return new Date(f.getFullYear(),0,2);case 4:return new Date(f.getFullYear(),0,1);case 5:return new Date(f.getFullYear()-1,11,31);case 6:return new Date(f.getFullYear()-1,11,30)}}function C(f){var v=Ut(new Date(f.tm_year+1900,0,1),f.tm_yday),N=new Date(v.getFullYear(),0,4),M=new Date(v.getFullYear()+1,0,4),Y=k(N),R=k(M);return m(Y,v)<=0?m(R,v)<=0?v.getFullYear()+1:v.getFullYear():v.getFullYear()-1}var W={"%a":f=>p[f.tm_wday].substring(0,3),"%A":f=>p[f.tm_wday],"%b":f=>S[f.tm_mon].substring(0,3),"%B":f=>S[f.tm_mon],"%C":f=>{var v=f.tm_year+1900;return h(v/100|0,2)},"%d":f=>h(f.tm_mday,2),"%e":f=>b(f.tm_mday,2," "),"%g":f=>C(f).toString().substring(2),"%G":C,"%H":f=>h(f.tm_hour,2),"%I":f=>{var v=f.tm_hour;return v==0?v=12:v>12&&(v-=12),h(v,2)},"%j":f=>h(f.tm_mday+zt(Me(f.tm_year+1900)?pr:wr,f.tm_mon-1),3),"%m":f=>h(f.tm_mon+1,2),"%M":f=>h(f.tm_min,2),"%n":()=>`
|
|
19
|
+
`,"%p":f=>f.tm_hour>=0&&f.tm_hour<12?"AM":"PM","%S":f=>h(f.tm_sec,2),"%t":()=>" ","%u":f=>f.tm_wday||7,"%U":f=>{var v=f.tm_yday+7-f.tm_wday;return h(Math.floor(v/7),2)},"%V":f=>{var v=Math.floor((f.tm_yday+7-(f.tm_wday+6)%7)/7);if((f.tm_wday+371-f.tm_yday-2)%7<=2&&v++,v){if(v==53){var M=(f.tm_wday+371-f.tm_yday)%7;M!=4&&(M!=3||!Me(f.tm_year))&&(v=1)}}else{v=52;var N=(f.tm_wday+7-f.tm_yday-1)%7;(N==4||N==5&&Me(f.tm_year%400-1))&&v++}return h(v,2)},"%w":f=>f.tm_wday,"%W":f=>{var v=f.tm_yday+7-(f.tm_wday+6)%7;return h(Math.floor(v/7),2)},"%y":f=>(f.tm_year+1900).toString().substring(2),"%Y":f=>f.tm_year+1900,"%z":f=>{var v=f.tm_gmtoff,N=v>=0;return v=Math.abs(v)/60,v=v/60*100+v%60,(N?"+":"-")+("0000"+v).slice(-4)},"%Z":f=>f.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var c in W)s.includes(c)&&(s=s.replace(new RegExp(c,"g"),W[c](i)));s=s.replace(/\0\0/g,"%");var z=Pe(s,!1);return z.length>r?0:(Lt(z,e),z.length-1)},Bt=(e,r,t,o,a)=>Ot(e,r,t,o),jt=e=>{if(e instanceof nr||e=="unwind")return fe;Q(1,e)},Ht=e=>{var r=De(e)+1,t=$e(r);return fr(e,t,r),t};n.createPreloadedFile=rt,n.staticInit(),u.FS_createPath=n.createPath,u.FS_createDataFile=n.createDataFile,u.FS_createPreloadedFile=n.createPreloadedFile,u.FS_unlink=n.unlink,u.FS_createLazyFile=n.createLazyFile,u.FS_createDevice=n.createDevice;var Wt={y:Wr,a:qr,L:nt,M:ot,q:at,G:it,D:st,N:lt,E:ut,n:ft,F:ct,I:vt,A:mt,v:ht,r:pt,s:wt,b:yt,J:_t,x:gt,H:dr,K:Et,w:St,B:Dt,C:Pt,j:At,l:Rt,p:Nt,t:Ct,o:It,h:Kt,k:Xt,d:$t,e:qt,m:Jt,c:Gt,f:Vt,i:Zt,g:Qt,z:mr,u:Bt},j=Hr(),Yt=()=>(Yt=j.P)(),yr=u._main=(e,r)=>(yr=u._main=j.Q)(e,r),_r=(e,r)=>(_r=j.S)(e,r),G=(e,r)=>(G=j.T)(e,r),V=()=>(V=j.U)(),K=e=>(K=j.V)(e),$e=e=>($e=j.W)(e),gr=e=>(gr=j.X)(e);function $t(e,r,t,o){var a=V();try{return X(e)(r,t,o)}catch(i){if(K(a),i!==i+0)throw i;G(1,0)}}function qt(e,r,t,o,a){var i=V();try{return X(e)(r,t,o,a)}catch(s){if(K(i),s!==s+0)throw s;G(1,0)}}function Xt(e,r,t){var o=V();try{return X(e)(r,t)}catch(a){if(K(o),a!==a+0)throw a;G(1,0)}}function Gt(e){var r=V();try{X(e)()}catch(t){if(K(r),t!==t+0)throw t;G(1,0)}}function Vt(e,r){var t=V();try{X(e)(r)}catch(o){if(K(t),o!==o+0)throw o;G(1,0)}}function Kt(e){var r=V();try{return X(e)()}catch(t){if(K(r),t!==t+0)throw t;G(1,0)}}function Jt(e,r,t,o,a,i){var s=V();try{return X(e)(r,t,o,a,i)}catch(l){if(K(s),l!==l+0)throw l;G(1,0)}}function Qt(e,r,t,o){var a=V();try{X(e)(r,t,o)}catch(i){if(K(a),i!==i+0)throw i;G(1,0)}}function Zt(e,r,t){var o=V();try{X(e)(r,t)}catch(a){if(K(o),a!==a+0)throw a;G(1,0)}}u.addRunDependency=Se,u.removeRunDependency=ye,u.FS_createPath=n.createPath,u.FS_createLazyFile=n.createLazyFile,u.FS_createDevice=n.createDevice,u.callMain=Er,u.FS_createPreloadedFile=n.createPreloadedFile,u.FS=n,u.FS_createDataFile=n.createDataFile,u.FS_unlink=n.unlink;var Ae;we=function e(){Ae||kr(),Ae||(we=e)};function Er(e=[]){var r=yr;e.unshift(L);var t=e.length,o=$e((t+1)*4),a=o;e.forEach(s=>{P[a>>2]=Ht(s),a+=4}),P[a>>2]=0;try{var i=r(t,o);return hr(i,!0),i}catch(s){return jt(s)}}function kr(e=le){if(ie>0||(Nr(),ie>0))return;function r(){Ae||(Ae=!0,u.calledRun=!0,!ue&&(Cr(),xr(),I(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Sr&&Er(e),Ir()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),r()},1)):r()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var Sr=!1;return u.noInitialRun&&(Sr=!1),kr(),y.ready}})(),ln=sn});var pn={};br(pn,{Status:()=>J,default:()=>hn,getParameters:()=>ze,init:()=>te,isReady:()=>Ne,maximize:()=>xe,minimize:()=>Ce,ready:()=>Te,solve:()=>ve,version:()=>Ie});var A=null,de=!1,Re=null,Xe=null,Ge=null,Te=new Promise((d,y)=>{Xe=d,Ge=y}),un="https://cdn.jsdelivr.net/gh/areb0s/scip.js/dist/";function fn(){let d=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof window<"u"&&window||{};return d.SCIP_BASE_URL?d.SCIP_BASE_URL:typeof __importMetaUrl<"u"&&__importMetaUrl&&!__importMetaUrl.startsWith("blob:")?__importMetaUrl.substring(0,__importMetaUrl.lastIndexOf("/")+1):un}var J={OPTIMAL:"optimal",INFEASIBLE:"infeasible",UNBOUNDED:"unbounded",TIME_LIMIT:"timelimit",UNKNOWN:"unknown",ERROR:"error"};function cn(d){return d.includes("optimal solution found")?J.OPTIMAL:d.includes("problem is infeasible")?J.INFEASIBLE:d.includes("problem is unbounded")?J.UNBOUNDED:d.includes("time limit reached")?J.TIME_LIMIT:J.UNKNOWN}function dn(d){let y={},u={value:null,sense:null},I=d.match(/objective value:\s*([\d.e+-]+)/i);I&&(u.value=parseFloat(I[1]));let F=/^(\w+)\s+([\d.e+-]+)/gm,U,le=d.split("solution:")[1]||d;for(;(U=F.exec(le))!==null;){let L=U[1],Q=parseFloat(U[2]);!isNaN(Q)&&L!=="objective"&&(y[L]=Q)}return{variables:y,objective:u}}function vn(d){let y={solvingTime:null,nodes:null,iterations:null,gap:null},u=d.match(/Solving Time \(sec\)\s*:\s*([\d.]+)/);u&&(y.solvingTime=parseFloat(u[1]));let I=d.match(/Nodes\s*:\s*(\d+)/);I&&(y.nodes=parseInt(I[1]));let F=d.match(/LP Iterations\s*:\s*(\d+)/);F&&(y.iterations=parseInt(F[1]));let U=d.match(/Gap\s*:\s*([\d.]+)\s*%/);return U&&(y.gap=parseFloat(U[1])),y}async function te(d={}){if(!de)return Re||(Re=(async()=>{try{let y=fn(),u=d.wasmPath||y+"scip.wasm",I=(await Promise.resolve().then(()=>(Dr(),Fr))).default;if(A=await I({locateFile:F=>F.endsWith(".wasm")?u:F,print:F=>{A&&A.onStdout&&A.onStdout(F)},printErr:F=>{A&&A.onStderr&&A.onStderr(F)}}),A.FS){try{A.FS.mkdir("/problems")}catch{}try{A.FS.mkdir("/solutions")}catch{}try{A.FS.mkdir("/settings")}catch{}}de=!0,Xe&&Xe()}catch(y){throw Ge&&Ge(y),y}})(),Re)}function Ne(){return de}async function ve(d,y={}){de||await te(y);let{format:u="lp",timeLimit:I=3600,gap:F=null,verbose:U=!1,parameters:le={}}=y,L="",Q="";A.onStdout=O=>{L+=O+`
|
|
20
|
+
`,U&&console.log("[SCIP]",O)},A.onStderr=O=>{Q+=O+`
|
|
21
|
+
`,U&&console.error("[SCIP Error]",O)};try{let ge=`/problems/problem.${{mps:"mps",zpl:"zpl",cip:"cip",lp:"lp"}[u]||"lp"}`,B="/solutions/solution.sol";A.FS.writeFile(ge,d);let H=[];H.push(`set limits time ${I}`),F!==null&&H.push(`set limits gap ${F}`);for(let[ue,fe]of Object.entries(le))H.push(`set ${ue} ${fe}`);H.push(`read ${ge}`),H.push("optimize"),H.push("display solution"),H.push(`write solution ${B}`),H.push("display statistics"),H.push("quit");let me=H.join(`
|
|
22
|
+
`);A.FS.writeFile("/settings/commands.txt",me);let Ee=A.callMain(["-b","/settings/commands.txt"]),he=cn(L),{variables:pe,objective:q}=dn(L),ne=vn(L),oe=null;try{oe=A.FS.readFile(B,{encoding:"utf8"})}catch{}return{status:he,objective:q.value,variables:pe,statistics:ne,exitCode:Ee,output:U?L:void 0,rawSolution:oe}}catch(O){return{status:J.ERROR,error:O.message,output:L+Q}}finally{let O=["/problems/problem.lp","/problems/problem.mps","/problems/problem.zpl","/problems/problem.cip","/solutions/solution.sol","/settings/commands.txt"];for(let ee of O)try{A.FS.unlink(ee)}catch{}}}async function Ce(d,y={}){return d.toLowerCase().includes("minimize")||(d=`Minimize
|
|
23
|
+
`+d),ve(d,y)}async function xe(d,y={}){return d.toLowerCase().includes("maximize")||(d=`Maximize
|
|
24
|
+
`+d),ve(d,y)}async function Ie(){de||await te();let d="";return A.onStdout=y=>{d+=y+`
|
|
25
|
+
`},A.callMain(["--version"]),d.trim()}async function ze(){de||await te();let d="";return A.onStdout=y=>{d+=y+`
|
|
26
|
+
`},A.FS.writeFile("/settings/params.txt",`set
|
|
27
27
|
quit
|
|
28
|
-
`),
|
|
28
|
+
`),A.callMain(["-b","/settings/params.txt"]),d}var Ve={init:te,ready:Te,isReady:Ne,solve:ve,minimize:Ce,maximize:xe,version:Ie,getParameters:ze,Status:J};var $=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof window<"u"&&window||{},mn=typeof window<"u"||typeof self<"u";mn&&$&&($.SCIP=Ve,$.SCIP.init=te,$.SCIP.ready=Te,$.SCIP.isReady=Ne,$.SCIP.solve=ve,$.SCIP.minimize=Ce,$.SCIP.maximize=xe,$.SCIP.version=Ie,$.SCIP.getParameters=ze,$.SCIP.Status=J,te().catch(d=>{console.error("[SCIP.js] Auto-initialization failed:",d.message)}));var hn=Ve;return an(pn);})();
|
|
29
29
|
(function(g){g.SCIP=SCIPModule.default||SCIPModule;if(SCIPModule.ready)g.SCIP.ready=SCIPModule.ready;})(typeof self!=='undefined'?self:typeof window!=='undefined'?window:globalThis);
|