@hpcc-js/wasm 1.15.7 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self)["@hpcc-js/wasm"]={})}(this,(function(r){"use strict";var t,e=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise((function(r,t){e=r,n=t}));var a=Object.assign({},o),i="./this.program",s="";"undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),t&&(s=t),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u,c,p=o.print||console.log.bind(console),l=o.printErr||console.warn.bind(console);Object.assign(o,a),a=null,o.arguments&&o.arguments,o.thisProgram&&(i=o.thisProgram),o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&M("no native wasm support detected");var f=!1;function d(r,t){r||M(t)}var m,h,_,v,y,w,E="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.buffer&&E)return E.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function b(r,t){return r?g(_,r,t):""}function k(r){m=r,o.HEAP8=h=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=v=new Int32Array(r),o.HEAPU8=_=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=y=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=w=new Float64Array(r)}o.INITIAL_MEMORY;var S,D,A=[],x=[],P=[],C=0,F=null;function M(r){o.onAbort&&o.onAbort(r),l(r="Aborted("+r+")"),f=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}function R(r){return r.startsWith("data:application/octet-stream;base64,")}function z(r){try{if(r==S&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}catch(r){M(r)}}R(S="expatlib.wasm")||(D=S,S=o.locateFile?o.locateFile(D,s):s+D);var j={11534:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";t.startElement()},11752:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";t.endElement()},11964:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";t.characterData()}};function T(r){for(;r.length>0;)r.shift()(o)}var O=[];function B(r){try{return c.grow(r-m.byteLength+65535>>>16),k(c.buffer),1}catch(r){}}var N={};function I(){if(!I.strings){var r={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",_:i||"./this.program"};for(var t in N)void 0===N[t]?delete r[t]:r[t]=N[t];var e=[];for(var t in r)e.push(t+"="+r[t]);I.strings=e}return I.strings}var L=[null,[],[]];function H(r,t){var e=L[r];0===t||10===t?((1===r?p:l)(g(e,0)),e.length=0):e.push(t)}var U={g:function(r,t,e,n){},j:function(){return Date.now()},c:function(){M("")},a:function(r,t,e){var n=function(r,t){var e;for(O.length=0,t>>=2;e=_[r++];)t+=105!=e&t,O.push(105==e?v[t]:w[t++>>1]),++t;return O}(t,e);return j[r].apply(null,n)},k:function(r,t,e){_.copyWithin(r,t,t+e)},e:function(r){var t,e,n=_.length,o=2147483648;if((r>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,r+100663296),B(Math.min(o,(t=Math.max(r,i))+((e=65536)-t%e)%e)))return!0}return!1},h:function(r,t){var e=0;return I().forEach((function(n,o){var a=t+e;y[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)h[t++>>0]=r.charCodeAt(n);e||(h[t>>0]=0)}(n,a),e+=n.length+1})),0},i:function(r,t){var e=I();y[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),y[t>>2]=n,0},d:function(r){return 52},f:function(r,t,e,n){return 52},l:function(r,t,e,n,o){return 70},b:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=y[t>>2],s=y[t+4>>2];t+=8;for(var u=0;u<s;u++)H(r,_[i+u]);o+=s}return y[n>>2]=o,0}};!function(){var r={a:U};function t(r,t){var e,n=r.exports;o.asm=n,k((c=o.asm.m).buffer),o.asm.G,e=o.asm.n,x.unshift(e),function(r){if(C--,o.monitorRunDependencies&&o.monitorRunDependencies(C),0==C&&F){var t=F;F=null,t()}}()}function e(r){t(r.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return z(S)})):fetch(S,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+S+"'";return r.arrayBuffer()})).catch((function(){return z(S)}))).then((function(t){return WebAssembly.instantiate(t,r)})).then((function(r){return r})).then(t,(function(r){l("failed to asynchronously prepare wasm: "+r),M(r)}))}if(C++,o.monitorRunDependencies&&o.monitorRunDependencies(C),o.instantiateWasm)try{return o.instantiateWasm(r,t)}catch(r){return l("Module.instantiateWasm callback failed with error: "+r),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||R(S)||"function"!=typeof fetch?a(e):fetch(S,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){return l("wasm streaming compile failed: "+r),l("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.n).apply(null,arguments)};var G,W=o._emscripten_bind_CExpat_CExpat_0=function(){return(W=o._emscripten_bind_CExpat_CExpat_0=o.asm.o).apply(null,arguments)},J=o._emscripten_bind_CExpat_version_0=function(){return(J=o._emscripten_bind_CExpat_version_0=o.asm.p).apply(null,arguments)},q=o._emscripten_bind_CExpat_create_0=function(){return(q=o._emscripten_bind_CExpat_create_0=o.asm.q).apply(null,arguments)},V=o._emscripten_bind_CExpat_destroy_0=function(){return(V=o._emscripten_bind_CExpat_destroy_0=o.asm.r).apply(null,arguments)},X=o._emscripten_bind_CExpat_parse_1=function(){return(X=o._emscripten_bind_CExpat_parse_1=o.asm.s).apply(null,arguments)},$=o._emscripten_bind_CExpat_tag_0=function(){return($=o._emscripten_bind_CExpat_tag_0=o.asm.t).apply(null,arguments)},Y=o._emscripten_bind_CExpat_attrs_0=function(){return(Y=o._emscripten_bind_CExpat_attrs_0=o.asm.u).apply(null,arguments)},K=o._emscripten_bind_CExpat_content_0=function(){return(K=o._emscripten_bind_CExpat_content_0=o.asm.v).apply(null,arguments)},Q=o._emscripten_bind_CExpat_startElement_0=function(){return(Q=o._emscripten_bind_CExpat_startElement_0=o.asm.w).apply(null,arguments)},Z=o._emscripten_bind_CExpat_endElement_0=function(){return(Z=o._emscripten_bind_CExpat_endElement_0=o.asm.x).apply(null,arguments)},rr=o._emscripten_bind_CExpat_characterData_0=function(){return(rr=o._emscripten_bind_CExpat_characterData_0=o.asm.y).apply(null,arguments)},tr=o._emscripten_bind_CExpat___destroy___0=function(){return(tr=o._emscripten_bind_CExpat___destroy___0=o.asm.z).apply(null,arguments)},er=o._emscripten_bind_VoidPtr___destroy___0=function(){return(er=o._emscripten_bind_VoidPtr___destroy___0=o.asm.A).apply(null,arguments)},nr=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(nr=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.B).apply(null,arguments)},or=o._emscripten_bind_CExpatJS_startElement_0=function(){return(or=o._emscripten_bind_CExpatJS_startElement_0=o.asm.C).apply(null,arguments)},ar=o._emscripten_bind_CExpatJS_endElement_0=function(){return(ar=o._emscripten_bind_CExpatJS_endElement_0=o.asm.D).apply(null,arguments)},ir=o._emscripten_bind_CExpatJS_characterData_0=function(){return(ir=o._emscripten_bind_CExpatJS_characterData_0=o.asm.E).apply(null,arguments)},sr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(sr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.F).apply(null,arguments)};function ur(r){function t(){G||(G=!0,o.calledRun=!0,f||(T(x),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),P.unshift(r);var r;T(P)}()))}C>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),A.unshift(r);var r;T(A)}(),C>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.H).apply(null,arguments)},o.___start_em_js=11436,o.___stop_em_js=11534,F=function r(){G||ur(),G||(F=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function cr(){}function pr(r){return(r||cr).__cache__}function lr(r,t){var e=pr(t),n=e[r];return n||((n=Object.create((t||cr).prototype)).ptr=r,e[r]=n)}ur(),cr.prototype=Object.create(cr.prototype),cr.prototype.constructor=cr,cr.prototype.__class__=cr,cr.__cache__={},o.WrapperObject=cr,o.getCache=pr,o.wrapPointer=lr,o.castObject=function(r,t){return lr(r.ptr,t)},o.NULL=lr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete pr(r.__class__)[r.ptr]},o.compare=function(r,t){return r.ptr===t.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var fr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(fr.needed){for(var r=0;r<fr.temps.length;r++)o._free(fr.temps[r]);fr.temps.length=0,o._free(fr.buffer),fr.buffer=0,fr.size+=fr.needed,fr.needed=0}fr.buffer||(fr.size+=128,fr.buffer=o._malloc(fr.size),d(fr.buffer)),fr.pos=0},alloc:function(r,t){d(fr.buffer);var e,n=t.BYTES_PER_ELEMENT,a=r.length*n;return a=a+7&-8,fr.pos+a>=fr.size?(d(a>0),fr.needed+=a,e=o._malloc(a),fr.temps.push(e)):(e=fr.buffer+fr.pos,fr.pos+=a),e},copy:function(r,t,e){switch(e>>>=0,t.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<r.length;n++)t[e+n]=r[n]}};function dr(r){if("string"==typeof r){var t=(n=r,i=a>0?a:function(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++e):t+=3}return t}(n)+1,s=new Array(i),u=function(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}(n,s,0,s.length),o&&(s.length=u),s),e=fr.alloc(t,h);return fr.copy(t,h,e),e}var n,o,a,i,s,u;return r}function mr(){this.ptr=W(),pr(mr)[this.ptr]=this}function hr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function _r(){this.ptr=nr(),pr(_r)[this.ptr]=this}return mr.prototype=Object.create(cr.prototype),mr.prototype.constructor=mr,mr.prototype.__class__=mr,mr.__cache__={},o.CExpat=mr,mr.prototype.version=mr.prototype.version=function(){var r=this.ptr;return b(J(r))},mr.prototype.create=mr.prototype.create=function(){var r=this.ptr;return!!q(r)},mr.prototype.destroy=mr.prototype.destroy=function(){var r=this.ptr;V(r)},mr.prototype.parse=mr.prototype.parse=function(r){var t=this.ptr;return fr.prepare(),r=r&&"object"==typeof r?r.ptr:dr(r),!!X(t,r)},mr.prototype.tag=mr.prototype.tag=function(){var r=this.ptr;return b($(r))},mr.prototype.attrs=mr.prototype.attrs=function(){var r=this.ptr;return b(Y(r))},mr.prototype.content=mr.prototype.content=function(){var r=this.ptr;return b(K(r))},mr.prototype.startElement=mr.prototype.startElement=function(){var r=this.ptr;Q(r)},mr.prototype.endElement=mr.prototype.endElement=function(){var r=this.ptr;Z(r)},mr.prototype.characterData=mr.prototype.characterData=function(){var r=this.ptr;rr(r)},mr.prototype.__destroy__=mr.prototype.__destroy__=function(){var r=this.ptr;tr(r)},hr.prototype=Object.create(cr.prototype),hr.prototype.constructor=hr,hr.prototype.__class__=hr,hr.__cache__={},o.VoidPtr=hr,hr.prototype.__destroy__=hr.prototype.__destroy__=function(){var r=this.ptr;er(r)},_r.prototype=Object.create(mr.prototype),_r.prototype.constructor=_r,_r.prototype.__class__=_r,_r.__cache__={},o.CExpatJS=_r,_r.prototype.startElement=_r.prototype.startElement=function(){var r=this.ptr;or(r)},_r.prototype.endElement=_r.prototype.endElement=function(){var r=this.ptr;ar(r)},_r.prototype.characterData=_r.prototype.characterData=function(){var r=this.ptr;ir(r)},_r.prototype.__destroy__=_r.prototype.__destroy__=function(){var r=this.ptr;sr(r)},r.ready}),n=Object.freeze({__proto__:null,default:e});let o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().__hpcc_wasmFolder||void 0;function a(r){if(!arguments.length)return o;const t=o;return o=r,t}let i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:"undefined"!=typeof __filename?__filename:"undefined"!=typeof document&&document.currentScript?document.currentScript.src:"";i=i.substr(0,i.replace(/[?#].*/,"").lastIndexOf("/")+1);const s={};async function u(r,t,e){const n=r.default||r;return e||(e=await async function(r){return fetch(r,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+r+"'";return t.arrayBuffer()})).catch((r=>{throw r}))}(t)),await n({wasmBinary:e})}async function c(r,t,e,n){const o=`${function(r,t){for(;r.charAt(r.length-1)===t;)r=r.substring(0,r.length-1);return r}(e||a()||i||".","/")}/${function(r,t){for(;r.charAt(0)===t;)r=r.substring(1);return r}(`${t}.wasm`,"/")}`;return s[o]||(s[o]=u(r,o,n)),s[o]}class p{constructor(r,t){this.tag=r,this.attrs=t,this._content=""}get content(){return this._content}appendContent(r){this._content+=r}}function l(r,t,e,o){return c(n,"expatlib",e,o).then((e=>{const n=new e.CExpatJS;n.startElement=function(){t.startElement(this.tag(),function(r){const t={},e=r,n=`${String.fromCharCode(1)}`,o=`${n}${n}`;return e.split(o).filter((r=>!!r)).forEach((r=>{const e=r.split(n);t[e[0]]=e[1]})),t}(this.attrs()))},n.endElement=function(){t.endElement(this.tag())},n.characterData=function(){t.characterData(this.content())},n.create();const o=n.parse(r);return n.destroy(),e.destroy(n),o}))}var f=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(t){var e,n,o=void 0!==(t=t||{})?t:{};o.ready=new Promise((function(r,t){e=r,n=t}));var a,i,s=Object.assign({},o),u="./this.program",c=(r,t)=>{throw t},p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText},i=(r,t,e)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):e()},n.onerror=e,n.send(null)};var l,f=o.print||console.log.bind(console),d=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit),o.wasmBinary&&(l=o.wasmBinary);var m,h=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&N("no native wasm support detected");var _=!1;function v(r,t){r||N(t)}var y,w,E,g,b,k,S,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.buffer&&D)return D.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function x(r,t){return r?A(E,r,t):""}function P(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i);if(s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}function C(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++e):t+=3}return t}function F(r){y=r,o.HEAP8=w=new Int8Array(r),o.HEAP16=g=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=E=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=S=new Float64Array(r)}o.INITIAL_MEMORY;var M=[],R=[],z=[];var j=0,T=null;function O(r){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function B(r){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&T){var t=T;T=null,t()}}function N(r){o.onAbort&&o.onAbort(r),d(r="Aborted("+r+")"),_=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}var I,L,H,U;function G(r){return r.startsWith("data:application/octet-stream;base64,")}function W(r){try{if(r==I&&l)return new Uint8Array(l);throw"both async and sync fetching of the wasm failed"}catch(r){N(r)}}G(I="graphvizlib.wasm")||(L=I,I=o.locateFile?o.locateFile(L,p):p+L);var J={163520:(r,t)=>{var e=x(r),n=x(t);rr.createPath("/",X.dirname(e)),rr.writeFile(X.join("/",e),n)}};function q(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function V(r){for(;r.length>0;)r.shift()(o)}var X={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,t)=>{for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e;e--)r.unshift("..");return r},normalize:r=>{var t=X.isAbs(r),e="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:r=>{var t=X.splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:r=>{if("/"===r)return"/";var t=(r=(r=X.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?r:r.substr(t+1)},join:function(){var r=Array.prototype.slice.call(arguments);return X.normalize(r.join("/"))},join2:(r,t)=>X.normalize(r+"/"+t)};var $={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:rr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,t=X.isAbs(n)}return(t?"/":"")+(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!t).join("/"))||"."},relative:(r,t)=>{function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=$.resolve(r).substr(1),t=$.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}};function Y(r,t,e){var n=e>0?e:C(r)+1,o=new Array(n),a=P(r,o,0,o.length);return t&&(o.length=a),o}var K={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){K.ttys[r]={input:[],output:[],ops:t},rr.registerDevice(r,K.stream_ops)},stream_ops:{open:function(r){var t=K.ttys[r.node.rdev];if(!t)throw new rr.ErrnoError(43);r.tty=t,r.seekable=!1},close:function(r){r.tty.ops.fsync(r.tty)},fsync:function(r){r.tty.ops.fsync(r.tty)},read:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.get_char)throw new rr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new rr.ErrnoError(29)}if(void 0===s&&0===a)throw new rr.ErrnoError(6);if(null==s)break;a++,t[e+i]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.put_char)throw new rr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,t[e+a])}catch(r){throw new rr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;r.input=Y(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(f(A(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},fsync:function(r){r.output&&r.output.length>0&&(f(A(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(d(A(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},fsync:function(r){r.output&&r.output.length>0&&(d(A(r.output,0)),r.output=[])}}};function Q(r){r=function(r,t){return Math.ceil(r/t)*t}(r,65536);var t=gr(65536,r);return t?function(r,t){return E.fill(0,r,r+t),r}(t,r):0}var Z={ops_table:null,mount:function(r){return Z.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(rr.isBlkdev(e)||rr.isFIFO(e))throw new rr.ErrnoError(63);Z.ops_table||(Z.ops_table={dir:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,lookup:Z.node_ops.lookup,mknod:Z.node_ops.mknod,rename:Z.node_ops.rename,unlink:Z.node_ops.unlink,rmdir:Z.node_ops.rmdir,readdir:Z.node_ops.readdir,symlink:Z.node_ops.symlink},stream:{llseek:Z.stream_ops.llseek}},file:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:{llseek:Z.stream_ops.llseek,read:Z.stream_ops.read,write:Z.stream_ops.write,allocate:Z.stream_ops.allocate,mmap:Z.stream_ops.mmap,msync:Z.stream_ops.msync}},link:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,readlink:Z.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:rr.chrdev_stream_ops}});var o=rr.createNode(r,t,e,n);return rr.isDir(o.mode)?(o.node_ops=Z.ops_table.dir.node,o.stream_ops=Z.ops_table.dir.stream,o.contents={}):rr.isFile(o.mode)?(o.node_ops=Z.ops_table.file.node,o.stream_ops=Z.ops_table.file.stream,o.usedBytes=0,o.contents=null):rr.isLink(o.mode)?(o.node_ops=Z.ops_table.link.node,o.stream_ops=Z.ops_table.link.stream):rr.isChrdev(o.mode)&&(o.node_ops=Z.ops_table.chrdev.node,o.stream_ops=Z.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,t){var e=r.contents?r.contents.length:0;if(!(e>=t)){t=Math.max(t,e*(e<1048576?2:1.125)>>>0),0!=e&&(t=Math.max(t,256));var n=r.contents;r.contents=new Uint8Array(t),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,t){if(r.usedBytes!=t)if(0==t)r.contents=null,r.usedBytes=0;else{var e=r.contents;r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=rr.isChrdev(r.mode)?r.id:1,t.ino=r.id,t.mode=r.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=r.rdev,rr.isDir(r.mode)?t.size=4096:rr.isFile(r.mode)?t.size=r.usedBytes:rr.isLink(r.mode)?t.size=r.link.length:t.size=0,t.atime=new Date(r.timestamp),t.mtime=new Date(r.timestamp),t.ctime=new Date(r.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(r,t){void 0!==t.mode&&(r.mode=t.mode),void 0!==t.timestamp&&(r.timestamp=t.timestamp),void 0!==t.size&&Z.resizeFileStorage(r,t.size)},lookup:function(r,t){throw rr.genericErrors[44]},mknod:function(r,t,e,n){return Z.createNode(r,t,e,n)},rename:function(r,t,e){if(rr.isDir(r.mode)){var n;try{n=rr.lookupNode(t,e)}catch(r){}if(n)for(var o in n.contents)throw new rr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=e,t.contents[e]=r,t.timestamp=r.parent.timestamp,r.parent=t},unlink:function(r,t){delete r.contents[t],r.timestamp=Date.now()},rmdir:function(r,t){var e=rr.lookupNode(r,t);for(var n in e.contents)throw new rr.ErrnoError(55);delete r.contents[t],r.timestamp=Date.now()},readdir:function(r){var t=[".",".."];for(var e in r.contents)r.contents.hasOwnProperty(e)&&t.push(e);return t},symlink:function(r,t,e){var n=Z.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!rr.isLink(r.mode))throw new rr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,t,e,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),e);else for(var s=0;s<i;s++)t[e+s]=a[o+s];return i},write:function(r,t,e,n,o,a){if(t.buffer===w.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(e,e+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(e,e+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(e,e+n),o),n}if(Z.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(e,e+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[e+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,t,e){var n=t;if(1===e?n+=r.position:2===e&&rr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new rr.ErrnoError(28);return n},allocate:function(r,t,e){Z.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||s.buffer!==y){if((e>0||e+t<s.length)&&(s=s.subarray?s.subarray(e,e+t):Array.prototype.slice.call(s,e,e+t)),i=!0,!(a=Q(t)))throw new rr.ErrnoError(48);w.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:function(r,t,e,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);return 2&o||Z.stream_ops.write(r,t,0,n,e,!1),0}}};var rr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,t={})=>{if(!(r=$.resolve(rr.cwd(),r)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new rr.ErrnoError(32);for(var e=X.normalizeArray(r.split("/").filter((r=>!!r)),!1),n=rr.root,o="/",a=0;a<e.length;a++){var i=a===e.length-1;if(i&&t.parent)break;if(n=rr.lookupNode(n,e[a]),o=X.join2(o,e[a]),rr.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;rr.isLink(n.mode);){var u=rr.readlink(o);if(o=$.resolve(X.dirname(o),u),n=rr.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new rr.ErrnoError(32)}}return{path:o,node:n}},getPath:r=>{for(var t;;){if(rr.isRoot(r)){var e=r.mount.mountpoint;return t?"/"!==e[e.length-1]?e+"/"+t:e+t:e}t=t?r.name+"/"+t:r.name,r=r.parent}},hashName:(r,t)=>{for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(r+e>>>0)%rr.nameTable.length},hashAddNode:r=>{var t=rr.hashName(r.parent.id,r.name);r.name_next=rr.nameTable[t],rr.nameTable[t]=r},hashRemoveNode:r=>{var t=rr.hashName(r.parent.id,r.name);if(rr.nameTable[t]===r)rr.nameTable[t]=r.name_next;else for(var e=rr.nameTable[t];e;){if(e.name_next===r){e.name_next=r.name_next;break}e=e.name_next}},lookupNode:(r,t)=>{var e=rr.mayLookup(r);if(e)throw new rr.ErrnoError(e,r);for(var n=rr.hashName(r.id,t),o=rr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===t)return o}return rr.lookup(r,t)},createNode:(r,t,e,n)=>{var o=new rr.FSNode(r,t,e,n);return rr.hashAddNode(o),o},destroyNode:r=>{rr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var t=rr.flagModes[r];if(void 0===t)throw new Error("Unknown file open mode: "+r);return t},flagsToPermissionString:r=>{var t=["r","w","rw"][3&r];return 512&r&&(t+="w"),t},nodePermissions:(r,t)=>rr.ignorePermissions||(!t.includes("r")||292&r.mode)&&(!t.includes("w")||146&r.mode)&&(!t.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var t=rr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:(r,t)=>{try{rr.lookupNode(r,t);return 20}catch(r){}return rr.nodePermissions(r,"wx")},mayDelete:(r,t,e)=>{var n;try{n=rr.lookupNode(r,t)}catch(r){return r.errno}var o=rr.nodePermissions(r,"wx");if(o)return o;if(e){if(!rr.isDir(n.mode))return 54;if(rr.isRoot(n)||rr.getPath(n)===rr.cwd())return 10}else if(rr.isDir(n.mode))return 31;return 0},mayOpen:(r,t)=>r?rr.isLink(r.mode)?32:rr.isDir(r.mode)&&("r"!==rr.flagsToPermissionString(t)||512&t)?31:rr.nodePermissions(r,rr.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,t=rr.MAX_OPEN_FDS)=>{for(var e=r;e<=t;e++)if(!rr.streams[e])return e;throw new rr.ErrnoError(33)},getStream:r=>rr.streams[r],createStream:(r,t,e)=>{rr.FSStream||(rr.FSStream=function(){this.shared={}},rr.FSStream.prototype={},Object.defineProperties(rr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get:function(){return this.shared.position},set:function(r){this.shared.position=r}}})),r=Object.assign(new rr.FSStream,r);var n=rr.nextfd(t,e);return r.fd=n,rr.streams[n]=r,r},closeStream:r=>{rr.streams[r]=null},chrdev_stream_ops:{open:r=>{var t=rr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new rr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,t)=>r<<8|t,registerDevice:(r,t)=>{rr.devices[r]={stream_ops:t}},getDevice:r=>rr.devices[r],getMounts:r=>{for(var t=[],e=[r];e.length;){var n=e.pop();t.push(n),e.push.apply(e,n.mounts)}return t},syncfs:(r,t)=>{"function"==typeof r&&(t=r,r=!1),rr.syncFSRequests++,rr.syncFSRequests>1&&d("warning: "+rr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=rr.getMounts(rr.root.mount),n=0;function o(r){return rr.syncFSRequests--,t(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=e.length&&o(null)}e.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,r,a)}))},mount:(r,t,e)=>{var n,o="/"===e,a=!e;if(o&&rr.root)throw new rr.ErrnoError(10);if(!o&&!a){var i=rr.lookupPath(e,{follow_mount:!1});if(e=i.path,n=i.node,rr.isMountpoint(n))throw new rr.ErrnoError(10);if(!rr.isDir(n.mode))throw new rr.ErrnoError(54)}var s={type:r,opts:t,mountpoint:e,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?rr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var t=rr.lookupPath(r,{follow_mount:!1});if(!rr.isMountpoint(t.node))throw new rr.ErrnoError(28);var e=t.node,n=e.mounted,o=rr.getMounts(n);Object.keys(rr.nameTable).forEach((r=>{for(var t=rr.nameTable[r];t;){var e=t.name_next;o.includes(t.mount)&&rr.destroyNode(t),t=e}})),e.mounted=null;var a=e.mount.mounts.indexOf(n);e.mount.mounts.splice(a,1)},lookup:(r,t)=>r.node_ops.lookup(r,t),mknod:(r,t,e)=>{var n=rr.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new rr.ErrnoError(28);var a=rr.mayCreate(n,o);if(a)throw new rr.ErrnoError(a);if(!n.node_ops.mknod)throw new rr.ErrnoError(63);return n.node_ops.mknod(n,o,t,e)},create:(r,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,rr.mknod(r,t,0)),mkdir:(r,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,rr.mknod(r,t,0)),mkdirTree:(r,t)=>{for(var e=r.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{rr.mkdir(n,t)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,t,e)=>(void 0===e&&(e=t,t=438),t|=8192,rr.mknod(r,t,e)),symlink:(r,t)=>{if(!$.resolve(r))throw new rr.ErrnoError(44);var e=rr.lookupPath(t,{parent:!0}).node;if(!e)throw new rr.ErrnoError(44);var n=X.basename(t),o=rr.mayCreate(e,n);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.symlink)throw new rr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:(r,t)=>{var e,n,o=X.dirname(r),a=X.dirname(t),i=X.basename(r),s=X.basename(t);if(e=rr.lookupPath(r,{parent:!0}).node,n=rr.lookupPath(t,{parent:!0}).node,!e||!n)throw new rr.ErrnoError(44);if(e.mount!==n.mount)throw new rr.ErrnoError(75);var u,c=rr.lookupNode(e,i),p=$.relative(r,a);if("."!==p.charAt(0))throw new rr.ErrnoError(28);if("."!==(p=$.relative(t,o)).charAt(0))throw new rr.ErrnoError(55);try{u=rr.lookupNode(n,s)}catch(r){}if(c!==u){var l=rr.isDir(c.mode),f=rr.mayDelete(e,i,l);if(f)throw new rr.ErrnoError(f);if(f=u?rr.mayDelete(n,s,l):rr.mayCreate(n,s))throw new rr.ErrnoError(f);if(!e.node_ops.rename)throw new rr.ErrnoError(63);if(rr.isMountpoint(c)||u&&rr.isMountpoint(u))throw new rr.ErrnoError(10);if(n!==e&&(f=rr.nodePermissions(e,"w")))throw new rr.ErrnoError(f);rr.hashRemoveNode(c);try{e.node_ops.rename(c,n,s)}catch(r){throw r}finally{rr.hashAddNode(c)}}},rmdir:r=>{var t=rr.lookupPath(r,{parent:!0}).node,e=X.basename(r),n=rr.lookupNode(t,e),o=rr.mayDelete(t,e,!0);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.rmdir)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);t.node_ops.rmdir(t,e),rr.destroyNode(n)},readdir:r=>{var t=rr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new rr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var t=rr.lookupPath(r,{parent:!0}).node;if(!t)throw new rr.ErrnoError(44);var e=X.basename(r),n=rr.lookupNode(t,e),o=rr.mayDelete(t,e,!1);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.unlink)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);t.node_ops.unlink(t,e),rr.destroyNode(n)},readlink:r=>{var t=rr.lookupPath(r).node;if(!t)throw new rr.ErrnoError(44);if(!t.node_ops.readlink)throw new rr.ErrnoError(28);return $.resolve(rr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,t)=>{var e=rr.lookupPath(r,{follow:!t}).node;if(!e)throw new rr.ErrnoError(44);if(!e.node_ops.getattr)throw new rr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:r=>rr.stat(r,!0),chmod:(r,t,e)=>{var n;"string"==typeof r?n=rr.lookupPath(r,{follow:!e}).node:n=r;if(!n.node_ops.setattr)throw new rr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,t)=>{rr.chmod(r,t,!0)},fchmod:(r,t)=>{var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);rr.chmod(e.node,t)},chown:(r,t,e,n)=>{var o;"string"==typeof r?o=rr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new rr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,t,e)=>{rr.chown(r,t,e,!0)},fchown:(r,t,e)=>{var n=rr.getStream(r);if(!n)throw new rr.ErrnoError(8);rr.chown(n.node,t,e)},truncate:(r,t)=>{if(t<0)throw new rr.ErrnoError(28);var e;"string"==typeof r?e=rr.lookupPath(r,{follow:!0}).node:e=r;if(!e.node_ops.setattr)throw new rr.ErrnoError(63);if(rr.isDir(e.mode))throw new rr.ErrnoError(31);if(!rr.isFile(e.mode))throw new rr.ErrnoError(28);var n=rr.nodePermissions(e,"w");if(n)throw new rr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:(r,t)=>{var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);if(0==(2097155&e.flags))throw new rr.ErrnoError(28);rr.truncate(e.node,t)},utime:(r,t,e)=>{var n=rr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:(r,t,e)=>{if(""===r)throw new rr.ErrnoError(44);var n;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?rr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)n=r;else{r=X.normalize(r);try{n=rr.lookupPath(r,{follow:!(131072&t)}).node}catch(r){}}var a=!1;if(64&t)if(n){if(128&t)throw new rr.ErrnoError(20)}else n=rr.mknod(r,e,0),a=!0;if(!n)throw new rr.ErrnoError(44);if(rr.isChrdev(n.mode)&&(t&=-513),65536&t&&!rr.isDir(n.mode))throw new rr.ErrnoError(54);if(!a){var i=rr.mayOpen(n,t);if(i)throw new rr.ErrnoError(i)}512&t&&!a&&rr.truncate(n,0),t&=-131713;var s=rr.createStream({node:n,path:rr.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&t||(rr.readFiles||(rr.readFiles={}),r in rr.readFiles||(rr.readFiles[r]=1)),s},close:r=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{rr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,t,e)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new rr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new rr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,t,e),r.ungotten=[],r.position},read:(r,t,e,n,o)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(1==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.read)throw new rr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,t,e,n,o);return a||(r.position+=i),i},write:(r,t,e,n,o,a)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.write)throw new rr.ErrnoError(28);r.seekable&&1024&r.flags&&rr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,t,e,n,o,a);return i||(r.position+=s),s},allocate:(r,t,e)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(t<0||e<=0)throw new rr.ErrnoError(28);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(!rr.isFile(r.node.mode)&&!rr.isDir(r.node.mode))throw new rr.ErrnoError(43);if(!r.stream_ops.allocate)throw new rr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:(r,t,e,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&r.flags))throw new rr.ErrnoError(2);if(1==(2097155&r.flags))throw new rr.ErrnoError(2);if(!r.stream_ops.mmap)throw new rr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o)},msync:(r,t,e,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,t,e,n,o):0,munmap:r=>0,ioctl:(r,t,e)=>{if(!r.stream_ops.ioctl)throw new rr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:(r,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var e,n=rr.open(r,t.flags),o=rr.stat(r).size,a=new Uint8Array(o);return rr.read(n,a,0,o,0),"utf8"===t.encoding?e=A(a,0):"binary"===t.encoding&&(e=a),rr.close(n),e},writeFile:(r,t,e={})=>{e.flags=e.flags||577;var n=rr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(C(t)+1),a=P(t,o,0,o.length);rr.write(n,o,0,a,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");rr.write(n,t,0,t.byteLength,void 0,e.canOwn)}rr.close(n)},cwd:()=>rr.currentPath,chdir:r=>{var t=rr.lookupPath(r,{follow:!0});if(null===t.node)throw new rr.ErrnoError(44);if(!rr.isDir(t.node.mode))throw new rr.ErrnoError(54);var e=rr.nodePermissions(t.node,"x");if(e)throw new rr.ErrnoError(e);rr.currentPath=t.path},createDefaultDirectories:()=>{rr.mkdir("/tmp"),rr.mkdir("/home"),rr.mkdir("/home/web_user")},createDefaultDevices:()=>{rr.mkdir("/dev"),rr.registerDevice(rr.makedev(1,3),{read:()=>0,write:(r,t,e,n,o)=>n}),rr.mkdev("/dev/null",rr.makedev(1,3)),K.register(rr.makedev(5,0),K.default_tty_ops),K.register(rr.makedev(6,0),K.default_tty1_ops),rr.mkdev("/dev/tty",rr.makedev(5,0)),rr.mkdev("/dev/tty1",rr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return()=>(crypto.getRandomValues(r),r[0])}return()=>N("randomDevice")}();rr.createDevice("/dev","random",r),rr.createDevice("/dev","urandom",r),rr.mkdir("/dev/shm"),rr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{rr.mkdir("/proc");var r=rr.mkdir("/proc/self");rr.mkdir("/proc/self/fd"),rr.mount({mount:()=>{var t=rr.createNode(r,"fd",16895,73);return t.node_ops={lookup:(r,t)=>{var e=+t,n=rr.getStream(e);if(!n)throw new rr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?rr.createDevice("/dev","stdin",o.stdin):rr.symlink("/dev/tty","/dev/stdin"),o.stdout?rr.createDevice("/dev","stdout",null,o.stdout):rr.symlink("/dev/tty","/dev/stdout"),o.stderr?rr.createDevice("/dev","stderr",null,o.stderr):rr.symlink("/dev/tty1","/dev/stderr"),rr.open("/dev/stdin",0),rr.open("/dev/stdout",1),rr.open("/dev/stderr",1)},ensureErrnoError:()=>{rr.ErrnoError||(rr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},rr.ErrnoError.prototype=new Error,rr.ErrnoError.prototype.constructor=rr.ErrnoError,[44].forEach((r=>{rr.genericErrors[r]=new rr.ErrnoError(r),rr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{rr.ensureErrnoError(),rr.nameTable=new Array(4096),rr.mount(Z,{},"/"),rr.createDefaultDirectories(),rr.createDefaultDevices(),rr.createSpecialDirectories(),rr.filesystems={MEMFS:Z}},init:(r,t,e)=>{rr.init.initialized=!0,rr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=t||o.stdout,o.stderr=e||o.stderr,rr.createStandardStreams()},quit:()=>{rr.init.initialized=!1;for(var r=0;r<rr.streams.length;r++){var t=rr.streams[r];t&&rr.close(t)}},getMode:(r,t)=>{var e=0;return r&&(e|=365),t&&(e|=146),e},findObject:(r,t)=>{var e=rr.analyzePath(r,t);return e.exists?e.object:null},analyzePath:(r,t)=>{try{r=(n=rr.lookupPath(r,{follow:!t})).path}catch(r){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=rr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=X.basename(r),n=rr.lookupPath(r,{follow:!t}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(r){e.error=r.errno}return e},createPath:(r,t,e,n)=>{r="string"==typeof r?r:rr.getPath(r);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=X.join2(r,a);try{rr.mkdir(i)}catch(r){}r=i}}return i},createFile:(r,t,e,n,o)=>{var a=X.join2("string"==typeof r?r:rr.getPath(r),t),i=rr.getMode(n,o);return rr.create(a,i)},createDataFile:(r,t,e,n,o,a)=>{var i=t;r&&(r="string"==typeof r?r:rr.getPath(r),i=t?X.join2(r,t):r);var s=rr.getMode(n,o),u=rr.create(i,s);if(e){if("string"==typeof e){for(var c=new Array(e.length),p=0,l=e.length;p<l;++p)c[p]=e.charCodeAt(p);e=c}rr.chmod(u,146|s);var f=rr.open(u,577);rr.write(f,e,0,e.length,0,a),rr.close(f),rr.chmod(u,s)}return u},createDevice:(r,t,e,n)=>{var o=X.join2("string"==typeof r?r:rr.getPath(r),t),a=rr.getMode(!!e,!!n);rr.createDevice.major||(rr.createDevice.major=64);var i=rr.makedev(rr.createDevice.major++,0);return rr.registerDevice(i,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,t,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=e()}catch(r){throw new rr.ErrnoError(29)}if(void 0===u&&0===i)throw new rr.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(r.node.timestamp=Date.now()),i},write:(r,t,e,o,a)=>{for(var i=0;i<o;i++)try{n(t[e+i])}catch(r){throw new rr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),rr.mkdev(o,a,i)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Y(a(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new rr.ErrnoError(29)}},createLazyFile:(r,t,e,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var t=r%this.chunkSize,e=r/this.chunkSize|0;return this.getter(e)[t]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",e,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+e+". Status: "+r.status);var t,n=Number(r.getResponseHeader("Content-length")),o=(t=r.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=r.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((r=>{var t=r*i,o=(r+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,t)=>{if(r>t)throw new Error("invalid range ("+r+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",e,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Y(o.responseText||"",!0)})(t,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:e},s=rr.createFile(r,t,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(r,t,e,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[e+s]=a[o+s];else for(s=0;s<i;s++)t[e+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach((r=>{var t=s.stream_ops[r];u[r]=function(){return rr.forceLoadFile(s),t.apply(null,arguments)}})),u.read=(r,t,e,n,o)=>(rr.forceLoadFile(s),c(r,t,e,n,o)),u.mmap=(r,t,e,n,o)=>{rr.forceLoadFile(s);var a=Q(t);if(!a)throw new rr.ErrnoError(48);return c(r,w,a,t,e),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(r,t,e,n,o,a,s,u,c,p)=>{var l=t?$.resolve(X.join2(r,t)):r;function f(e){function i(e){p&&p(),u||rr.createDataFile(r,t,e,n,o,c),a&&a(),B()}Browser.handledByPreloadPlugin(e,l,i,(()=>{s&&s(),B()}))||i(e)}O(),"string"==typeof e?function(r,t,e,n){var o=n?"":"al "+r;i(r,(e=>{v(e,'Loading data file "'+r+'" failed (no arrayBuffer).'),t(new Uint8Array(e)),o&&B()}),(t=>{if(!e)throw'Loading data file "'+r+'" failed.';e()})),o&&O()}(e,(r=>f(r)),s):f(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=()=>{f("creating db"),o.result.createObjectStore(rr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([rr.DB_STORE_NAME],"readwrite"),a=n.objectStore(rr.DB_STORE_NAME),i=0,s=0,u=r.length;function c(){0==s?t():e()}r.forEach((r=>{var t=a.put(rr.analyzePath(r).object.contents,r);t.onsuccess=()=>{++i+s==u&&c()},t.onerror=()=>{s++,i+s==u&&c()}})),n.onerror=e},o.onerror=e},loadFilesFromDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=e,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([rr.DB_STORE_NAME],"readonly")}catch(r){return void e(r)}var i=a.objectStore(rr.DB_STORE_NAME),s=0,u=0,c=r.length;function p(){0==u?t():e()}r.forEach((r=>{var t=i.get(r);t.onsuccess=()=>{rr.analyzePath(r).exists&&rr.unlink(r),rr.createDataFile(X.dirname(r),X.basename(r),t.result,!0,!0,!0),++s+u==c&&p()},t.onerror=()=>{u++,s+u==c&&p()}})),a.onerror=e},o.onerror=e}},tr={DEFAULT_POLLMASK:5,calculateAt:function(r,t,e){if(X.isAbs(t))return t;var n;-100===r?n=rr.cwd():n=tr.getStreamFromFD(r).path;if(0==t.length){if(!e)throw new rr.ErrnoError(44);return n}return X.join2(n,t)},doStat:function(r,t,e){try{var n=r(t)}catch(r){if(r&&r.node&&X.normalize(t)!==X.normalize(rr.getPath(r.node)))return-54;throw r}return b[e>>2]=n.dev,b[e+8>>2]=n.ino,b[e+12>>2]=n.mode,k[e+16>>2]=n.nlink,b[e+20>>2]=n.uid,b[e+24>>2]=n.gid,b[e+28>>2]=n.rdev,U=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+40>>2]=U[0],b[e+44>>2]=U[1],b[e+48>>2]=4096,b[e+52>>2]=n.blocks,U=[Math.floor(n.atime.getTime()/1e3)>>>0,(H=Math.floor(n.atime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+56>>2]=U[0],b[e+60>>2]=U[1],k[e+64>>2]=0,U=[Math.floor(n.mtime.getTime()/1e3)>>>0,(H=Math.floor(n.mtime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+72>>2]=U[0],b[e+76>>2]=U[1],k[e+80>>2]=0,U=[Math.floor(n.ctime.getTime()/1e3)>>>0,(H=Math.floor(n.ctime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+88>>2]=U[0],b[e+92>>2]=U[1],k[e+96>>2]=0,U=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+104>>2]=U[0],b[e+108>>2]=U[1],0},doMsync:function(r,t,e,n,o){var a=E.slice(r,r+e);rr.msync(t,a,o,e,n)},varargs:void 0,get:function(){return tr.varargs+=4,b[tr.varargs-4>>2]},getStr:function(r){return x(r)},getStreamFromFD:function(r){var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);return t}};var er=[];function nr(r){try{return m.grow(r-y.byteLength+65535>>>16),F(m.buffer),1}catch(r){}}var or={};function ar(){if(!ar.strings){var r={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",_:u||"./this.program"};for(var t in or)void 0===or[t]?delete r[t]:r[t]=or[t];var e=[];for(var t in r)e.push(t+"="+r[t]);ar.strings=e}return ar.strings}function ir(r){h||(o.onExit&&o.onExit(r),_=!0),c(r,new q(r))}var sr=function(r,t){ir(r)};var ur=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=rr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n},cr=365,pr=146;Object.defineProperties(ur.prototype,{read:{get:function(){return(this.mode&cr)===cr},set:function(r){r?this.mode|=cr:this.mode&=-366}},write:{get:function(){return(this.mode&pr)===pr},set:function(r){r?this.mode|=pr:this.mode&=-147}},isFolder:{get:function(){return rr.isDir(this.mode)}},isDevice:{get:function(){return rr.isChrdev(this.mode)}}}),rr.FSNode=ur,rr.staticInit();var lr={k:function(r,t,e,n){try{if(t=tr.getStr(t),t=tr.calculateAt(r,t),-8&e)return-28;var o=rr.lookupPath(t,{follow:!0}).node;if(!o)return-44;var a="";return 4&e&&(a+="r"),2&e&&(a+="w"),1&e&&(a+="x"),a&&rr.nodePermissions(o,a)?-2:0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},f:function(r,t,e){tr.varargs=e;try{var n=tr.getStreamFromFD(r);switch(t){case 0:return(o=tr.get())<0?-28:rr.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=tr.get();return n.flags|=o,0;case 5:o=tr.get();return g[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,b[Er()>>2]=a,-1}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}var a},u:function(r,t){try{var e=tr.getStreamFromFD(r);return tr.doStat(rr.stat,e.path,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},v:function(r,t,e){tr.varargs=e;try{var n=tr.getStreamFromFD(r);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=tr.get();return b[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=tr.get();return rr.ioctl(n,t,o);default:return-28}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},s:function(r,t,e,n){try{t=tr.getStr(t);var o=256&n,a=4096&n;return n&=-4353,t=tr.calculateAt(r,t,a),tr.doStat(o?rr.lstat:rr.stat,t,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},c:function(r,t,e,n){tr.varargs=n;try{t=tr.getStr(t),t=tr.calculateAt(r,t);var o=n?tr.get():0;return rr.open(t,e,o).fd}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},t:function(r,t){try{return r=tr.getStr(r),tr.doStat(rr.stat,r,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},n:function(r,t,e){try{return t=tr.getStr(t),t=tr.calculateAt(r,t),0===e?rr.unlink(t):512===e?rr.rmdir(t):N("Invalid flags passed to unlinkat"),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},d:function(){return Date.now()},i:function(){return true},o:function(r,t,e,n,o,a){try{var i=tr.getStreamFromFD(n),s=rr.mmap(i,r,o,t,e),u=s.ptr;return b[a>>2]=s.allocated,u}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},p:function(r,t,e,n,o,a){try{var i=tr.getStreamFromFD(o);2&e&&tr.doMsync(r,i,t,n,a),rr.munmap(i)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},a:function(){N("")},w:function(r,t,e){var n=function(r,t){var e;for(er.length=0,t>>=2;e=E[r++];)t+=105!=e&t,er.push(105==e?b[t]:S[t++>>1]),++t;return er}(t,e);return J[r].apply(null,n)},j:function(r,t,e){E.copyWithin(r,t,t+e)},m:function(r){var t,e,n=E.length,o=2147483648;if((r>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,r+100663296),nr(Math.min(o,(t=Math.max(r,i))+((e=65536)-t%e)%e)))return!0}return!1},q:function(r,t){var e=0;return ar().forEach((function(n,o){var a=t+e;k[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)w[t++>>0]=r.charCodeAt(n);e||(w[t>>0]=0)}(n,a),e+=n.length+1})),0},r:function(r,t){var e=ar();k[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),k[t>>2]=n,0},e:sr,b:function(r){try{var t=tr.getStreamFromFD(r);return rr.close(t),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},g:function(r,t,e,n){try{var o=function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=k[t>>2],s=k[t+4>>2];t+=8;var u=rr.read(r,w,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(tr.getStreamFromFD(r),t,e);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},l:function(r,t,e,n,o){try{var a=(u=e)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*u:NaN;if(isNaN(a))return 61;var i=tr.getStreamFromFD(r);return rr.llseek(i,a,n),U=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[o>>2]=U[0],b[o+4>>2]=U[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}var s,u},h:function(r,t,e,n){try{var o=function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=k[t>>2],s=k[t+4>>2];t+=8;var u=rr.write(r,w,i,s,n);if(u<0)return-1;o+=u}return o}(tr.getStreamFromFD(r),t,e);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}}};!function(){var r={a:lr};function t(r,t){var e,n=r.exports;o.asm=n,F((m=o.asm.x).buffer),o.asm.G,e=o.asm.y,R.unshift(e),B()}function e(r){t(r.instance)}function a(t){return(l||"function"!=typeof fetch?Promise.resolve().then((function(){return W(I)})):fetch(I,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+I+"'";return r.arrayBuffer()})).catch((function(){return W(I)}))).then((function(t){return WebAssembly.instantiate(t,r)})).then((function(r){return r})).then(t,(function(r){d("failed to asynchronously prepare wasm: "+r),N(r)}))}if(O(),o.instantiateWasm)try{return o.instantiateWasm(r,t)}catch(r){return d("Module.instantiateWasm callback failed with error: "+r),!1}(l||"function"!=typeof WebAssembly.instantiateStreaming||G(I)||"function"!=typeof fetch?a(e):fetch(I,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){return d("wasm streaming compile failed: "+r),d("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.y).apply(null,arguments)};var fr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(fr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.z).apply(null,arguments)},dr=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(dr=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.A).apply(null,arguments)},mr=o._emscripten_bind_Graphviz_version_0=function(){return(mr=o._emscripten_bind_Graphviz_version_0=o.asm.B).apply(null,arguments)},hr=o._emscripten_bind_Graphviz_lastError_0=function(){return(hr=o._emscripten_bind_Graphviz_lastError_0=o.asm.C).apply(null,arguments)},_r=o._emscripten_bind_Graphviz_layout_3=function(){return(_r=o._emscripten_bind_Graphviz_layout_3=o.asm.D).apply(null,arguments)},vr=o._emscripten_bind_Graphviz_createFile_2=function(){return(vr=o._emscripten_bind_Graphviz_createFile_2=o.asm.E).apply(null,arguments)},yr=o._emscripten_bind_Graphviz___destroy___0=function(){return(yr=o._emscripten_bind_Graphviz___destroy___0=o.asm.F).apply(null,arguments)};o._free=function(){return(o._free=o.asm.H).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)};var wr,Er=o.___errno_location=function(){return(Er=o.___errno_location=o.asm.J).apply(null,arguments)},gr=o._emscripten_builtin_memalign=function(){return(gr=o._emscripten_builtin_memalign=o.asm.K).apply(null,arguments)};function br(r){function t(){wr||(wr=!0,o.calledRun=!0,_||(o.noFSInit||rr.init.initialized||rr.init(),rr.ignorePermissions=!1,V(R),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;V(z)}()))}j>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),M.unshift(r);var r;V(M)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o.___start_em_js=163664,o.___stop_em_js=163762,T=function r(){wr||br(),wr||(T=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function kr(){}function Sr(r){return(r||kr).__cache__}function Dr(r,t){var e=Sr(t),n=e[r];return n||((n=Object.create((t||kr).prototype)).ptr=r,e[r]=n)}br(),kr.prototype=Object.create(kr.prototype),kr.prototype.constructor=kr,kr.prototype.__class__=kr,kr.__cache__={},o.WrapperObject=kr,o.getCache=Sr,o.wrapPointer=Dr,o.castObject=function(r,t){return Dr(r.ptr,t)},o.NULL=Dr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Sr(r.__class__)[r.ptr]},o.compare=function(r,t){return r.ptr===t.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Ar={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Ar.needed){for(var r=0;r<Ar.temps.length;r++)o._free(Ar.temps[r]);Ar.temps.length=0,o._free(Ar.buffer),Ar.buffer=0,Ar.size+=Ar.needed,Ar.needed=0}Ar.buffer||(Ar.size+=128,Ar.buffer=o._malloc(Ar.size),v(Ar.buffer)),Ar.pos=0},alloc:function(r,t){v(Ar.buffer);var e,n=t.BYTES_PER_ELEMENT,a=r.length*n;return a=a+7&-8,Ar.pos+a>=Ar.size?(v(a>0),Ar.needed+=a,e=o._malloc(a),Ar.temps.push(e)):(e=Ar.buffer+Ar.pos,Ar.pos+=a),e},copy:function(r,t,e){switch(e>>>=0,t.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<r.length;n++)t[e+n]=r[n]}};function xr(r){if("string"==typeof r){var t=Y(r),e=Ar.alloc(t,w);return Ar.copy(t,w,e),e}return r}function Pr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Cr(r,t){r&&"object"==typeof r&&(r=r.ptr),t&&"object"==typeof t&&(t=t.ptr),this.ptr=dr(r,t),Sr(Cr)[this.ptr]=this}return Pr.prototype=Object.create(kr.prototype),Pr.prototype.constructor=Pr,Pr.prototype.__class__=Pr,Pr.__cache__={},o.VoidPtr=Pr,Pr.prototype.__destroy__=Pr.prototype.__destroy__=function(){var r=this.ptr;fr(r)},Cr.prototype=Object.create(kr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.__class__=Cr,Cr.__cache__={},o.Graphviz=Cr,Cr.prototype.version=Cr.prototype.version=function(){var r=this.ptr;return x(mr(r))},Cr.prototype.lastError=Cr.prototype.lastError=function(){var r=this.ptr;return x(hr(r))},Cr.prototype.layout=Cr.prototype.layout=function(r,t,e){var n=this.ptr;return Ar.prepare(),r=r&&"object"==typeof r?r.ptr:xr(r),t=t&&"object"==typeof t?t.ptr:xr(t),e=e&&"object"==typeof e?e.ptr:xr(e),x(_r(n,r,t,e))},Cr.prototype.createFile=Cr.prototype.createFile=function(r,t){var e=this.ptr;Ar.prepare(),r=r&&"object"==typeof r?r.ptr:xr(r),t=t&&"object"==typeof t?t.ptr:xr(t),vr(e,r,t)},Cr.prototype.__destroy__=Cr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},t.ready}})(),d=Object.freeze({__proto__:null,default:f});function m(r){return{path:r.path,data:`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg width="${r.width}" height="${r.height}"></svg>`}}function h(r,t){const e={images:[],files:[],...t};var n;[...e.files,...(n=e.images,n.map(m))].forEach((t=>r.createFile(t.path,t.data)))}const _={layout:(r,t="svg",e="dot",n)=>r?c(d,"graphvizlib",null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then((o=>{const a=new o.Graphviz((null==n?void 0:n.yInvert)?1:0,(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);h(a,n);const i=a.layout(r,t,e);if(o.destroy(a),!i)throw new Error(o.Graphviz.prototype.lastError());return i})):Promise.resolve(""),circo(r,t="svg",e){return this.layout(r,t,"circo",e)},dot(r,t="svg",e){return this.layout(r,t,"dot",e)},fdp(r,t="svg",e){return this.layout(r,t,"fdp",e)},sfdp(r,t="svg",e){return this.layout(r,t,"sfdp",e)},neato(r,t="svg",e){return this.layout(r,t,"neato",e)},osage(r,t="svg",e){return this.layout(r,t,"osage",e)},patchwork(r,t="svg",e){return this.layout(r,t,"patchwork",e)},twopi(r,t="svg",e){return this.layout(r,t,"twopi",e)}};class v{constructor(r){this._wasm=r}layout(r,t="svg",e="dot",n){if(!r)return"";const o=new this._wasm.Graphviz((null==n?void 0:n.yInvert)?1:0,(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);h(o,n);const a=o.layout(r,t,e);if(this._wasm.destroy(o),!a)throw new Error(this._wasm.Graphviz.prototype.lastError());return a}circo(r,t="svg",e){return this.layout(r,t,"circo",e)}dot(r,t="svg",e){return this.layout(r,t,"dot",e)}fdp(r,t="svg",e){return this.layout(r,t,"fdp",e)}sfdp(r,t="svg",e){return this.layout(r,t,"sfdp",e)}neato(r,t="svg",e){return this.layout(r,t,"neato",e)}osage(r,t="svg",e){return this.layout(r,t,"osage",e)}patchwork(r,t="svg",e){return this.layout(r,t,"patchwork",e)}twopi(r,t="svg",e){return this.layout(r,t,"twopi",e)}}r.GraphvizSync=v,r.StackElement=p,r.StackParser=class{constructor(){this._stack=[]}parse(r,t,e){return l(r,this,t,e)}top(){return this._stack[this._stack.length-1]}startElement(r,t){const e=new p(r,t);return this._stack.push(e),e}endElement(r){return this._stack.pop()}characterData(r){this.top().appendContent(r)}},r.expatVersion=function(r,t){return c(n,"expatlib",r,t).then((r=>r.CExpat.prototype.version()))},r.graphviz=_,r.graphvizSync=function(r,t){return c(d,"graphvizlib",r,t).then((r=>new v(r)))},r.graphvizVersion=function(r,t){return c(d,"graphvizlib",r,t).then((r=>r.Graphviz.prototype.version()))},r.parse=l,r.wasmFolder=a,Object.defineProperty(r,"__esModule",{value:!0})}));
1
+ !function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self)["@hpcc-js/wasm"]={})}(this,(function(r){"use strict";var t,e=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise((function(r,t){e=r,n=t}));var a=Object.assign({},o),i="./this.program",s="";"undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),t&&(s=t),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u,c,p=o.print||console.log.bind(console),l=o.printErr||console.warn.bind(console);Object.assign(o,a),a=null,o.arguments&&o.arguments,o.thisProgram&&(i=o.thisProgram),o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&M("no native wasm support detected");var f=!1;function d(r,t){r||M(t)}var m,h,_,v,y,w,E="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.buffer&&E)return E.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function b(r,t){return r?g(_,r,t):""}function k(r){m=r,o.HEAP8=h=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=v=new Int32Array(r),o.HEAPU8=_=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=y=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=w=new Float64Array(r)}o.INITIAL_MEMORY;var S,D,A=[],x=[],P=[],C=0,F=null;function M(r){o.onAbort&&o.onAbort(r),l(r="Aborted("+r+")"),f=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}function R(r){return r.startsWith("data:application/octet-stream;base64,")}function z(r){try{if(r==S&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}catch(r){M(r)}}R(S="expatlib.wasm")||(D=S,S=o.locateFile?o.locateFile(D,s):s+D);var j={11534:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";t.startElement()},11752:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";t.endElement()},11964:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";t.characterData()}};function T(r){for(;r.length>0;)r.shift()(o)}var O=[];function B(r){try{return c.grow(r-m.byteLength+65535>>>16),k(c.buffer),1}catch(r){}}var N={};function I(){if(!I.strings){var r={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",_:i||"./this.program"};for(var t in N)void 0===N[t]?delete r[t]:r[t]=N[t];var e=[];for(var t in r)e.push(t+"="+r[t]);I.strings=e}return I.strings}var L=[null,[],[]];function H(r,t){var e=L[r];0===t||10===t?((1===r?p:l)(g(e,0)),e.length=0):e.push(t)}var U={g:function(r,t,e,n){},j:function(){return Date.now()},c:function(){M("")},a:function(r,t,e){var n=function(r,t){var e;for(O.length=0,t>>=2;e=_[r++];)t+=105!=e&t,O.push(105==e?v[t]:w[t++>>1]),++t;return O}(t,e);return j[r].apply(null,n)},k:function(r,t,e){_.copyWithin(r,t,t+e)},e:function(r){var t,e,n=_.length,o=2147483648;if((r>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,r+100663296),B(Math.min(o,(t=Math.max(r,i))+((e=65536)-t%e)%e)))return!0}return!1},h:function(r,t){var e=0;return I().forEach((function(n,o){var a=t+e;y[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)h[t++>>0]=r.charCodeAt(n);e||(h[t>>0]=0)}(n,a),e+=n.length+1})),0},i:function(r,t){var e=I();y[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),y[t>>2]=n,0},d:function(r){return 52},f:function(r,t,e,n){return 52},l:function(r,t,e,n,o){return 70},b:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=y[t>>2],s=y[t+4>>2];t+=8;for(var u=0;u<s;u++)H(r,_[i+u]);o+=s}return y[n>>2]=o,0}};!function(){var r={a:U};function t(r,t){var e,n=r.exports;o.asm=n,k((c=o.asm.m).buffer),o.asm.G,e=o.asm.n,x.unshift(e),function(r){if(C--,o.monitorRunDependencies&&o.monitorRunDependencies(C),0==C&&F){var t=F;F=null,t()}}()}function e(r){t(r.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return z(S)})):fetch(S,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+S+"'";return r.arrayBuffer()})).catch((function(){return z(S)}))).then((function(t){return WebAssembly.instantiate(t,r)})).then((function(r){return r})).then(t,(function(r){l("failed to asynchronously prepare wasm: "+r),M(r)}))}if(C++,o.monitorRunDependencies&&o.monitorRunDependencies(C),o.instantiateWasm)try{return o.instantiateWasm(r,t)}catch(r){return l("Module.instantiateWasm callback failed with error: "+r),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||R(S)||"function"!=typeof fetch?a(e):fetch(S,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){return l("wasm streaming compile failed: "+r),l("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.n).apply(null,arguments)};var G,W=o._emscripten_bind_CExpat_CExpat_0=function(){return(W=o._emscripten_bind_CExpat_CExpat_0=o.asm.o).apply(null,arguments)},J=o._emscripten_bind_CExpat_version_0=function(){return(J=o._emscripten_bind_CExpat_version_0=o.asm.p).apply(null,arguments)},q=o._emscripten_bind_CExpat_create_0=function(){return(q=o._emscripten_bind_CExpat_create_0=o.asm.q).apply(null,arguments)},V=o._emscripten_bind_CExpat_destroy_0=function(){return(V=o._emscripten_bind_CExpat_destroy_0=o.asm.r).apply(null,arguments)},X=o._emscripten_bind_CExpat_parse_1=function(){return(X=o._emscripten_bind_CExpat_parse_1=o.asm.s).apply(null,arguments)},$=o._emscripten_bind_CExpat_tag_0=function(){return($=o._emscripten_bind_CExpat_tag_0=o.asm.t).apply(null,arguments)},Y=o._emscripten_bind_CExpat_attrs_0=function(){return(Y=o._emscripten_bind_CExpat_attrs_0=o.asm.u).apply(null,arguments)},K=o._emscripten_bind_CExpat_content_0=function(){return(K=o._emscripten_bind_CExpat_content_0=o.asm.v).apply(null,arguments)},Q=o._emscripten_bind_CExpat_startElement_0=function(){return(Q=o._emscripten_bind_CExpat_startElement_0=o.asm.w).apply(null,arguments)},Z=o._emscripten_bind_CExpat_endElement_0=function(){return(Z=o._emscripten_bind_CExpat_endElement_0=o.asm.x).apply(null,arguments)},rr=o._emscripten_bind_CExpat_characterData_0=function(){return(rr=o._emscripten_bind_CExpat_characterData_0=o.asm.y).apply(null,arguments)},tr=o._emscripten_bind_CExpat___destroy___0=function(){return(tr=o._emscripten_bind_CExpat___destroy___0=o.asm.z).apply(null,arguments)},er=o._emscripten_bind_VoidPtr___destroy___0=function(){return(er=o._emscripten_bind_VoidPtr___destroy___0=o.asm.A).apply(null,arguments)},nr=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(nr=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.B).apply(null,arguments)},or=o._emscripten_bind_CExpatJS_startElement_0=function(){return(or=o._emscripten_bind_CExpatJS_startElement_0=o.asm.C).apply(null,arguments)},ar=o._emscripten_bind_CExpatJS_endElement_0=function(){return(ar=o._emscripten_bind_CExpatJS_endElement_0=o.asm.D).apply(null,arguments)},ir=o._emscripten_bind_CExpatJS_characterData_0=function(){return(ir=o._emscripten_bind_CExpatJS_characterData_0=o.asm.E).apply(null,arguments)},sr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(sr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.F).apply(null,arguments)};function ur(r){function t(){G||(G=!0,o.calledRun=!0,f||(T(x),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),P.unshift(r);var r;T(P)}()))}C>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),A.unshift(r);var r;T(A)}(),C>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.H).apply(null,arguments)},o.___start_em_js=11436,o.___stop_em_js=11534,F=function r(){G||ur(),G||(F=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function cr(){}function pr(r){return(r||cr).__cache__}function lr(r,t){var e=pr(t),n=e[r];return n||((n=Object.create((t||cr).prototype)).ptr=r,e[r]=n)}ur(),cr.prototype=Object.create(cr.prototype),cr.prototype.constructor=cr,cr.prototype.__class__=cr,cr.__cache__={},o.WrapperObject=cr,o.getCache=pr,o.wrapPointer=lr,o.castObject=function(r,t){return lr(r.ptr,t)},o.NULL=lr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete pr(r.__class__)[r.ptr]},o.compare=function(r,t){return r.ptr===t.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var fr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(fr.needed){for(var r=0;r<fr.temps.length;r++)o._free(fr.temps[r]);fr.temps.length=0,o._free(fr.buffer),fr.buffer=0,fr.size+=fr.needed,fr.needed=0}fr.buffer||(fr.size+=128,fr.buffer=o._malloc(fr.size),d(fr.buffer)),fr.pos=0},alloc:function(r,t){d(fr.buffer);var e,n=t.BYTES_PER_ELEMENT,a=r.length*n;return a=a+7&-8,fr.pos+a>=fr.size?(d(a>0),fr.needed+=a,e=o._malloc(a),fr.temps.push(e)):(e=fr.buffer+fr.pos,fr.pos+=a),e},copy:function(r,t,e){switch(e>>>=0,t.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<r.length;n++)t[e+n]=r[n]}};function dr(r){if("string"==typeof r){var t=(n=r,i=a>0?a:function(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++e):t+=3}return t}(n)+1,s=new Array(i),u=function(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}(n,s,0,s.length),o&&(s.length=u),s),e=fr.alloc(t,h);return fr.copy(t,h,e),e}var n,o,a,i,s,u;return r}function mr(){this.ptr=W(),pr(mr)[this.ptr]=this}function hr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function _r(){this.ptr=nr(),pr(_r)[this.ptr]=this}return mr.prototype=Object.create(cr.prototype),mr.prototype.constructor=mr,mr.prototype.__class__=mr,mr.__cache__={},o.CExpat=mr,mr.prototype.version=mr.prototype.version=function(){var r=this.ptr;return b(J(r))},mr.prototype.create=mr.prototype.create=function(){var r=this.ptr;return!!q(r)},mr.prototype.destroy=mr.prototype.destroy=function(){var r=this.ptr;V(r)},mr.prototype.parse=mr.prototype.parse=function(r){var t=this.ptr;return fr.prepare(),r=r&&"object"==typeof r?r.ptr:dr(r),!!X(t,r)},mr.prototype.tag=mr.prototype.tag=function(){var r=this.ptr;return b($(r))},mr.prototype.attrs=mr.prototype.attrs=function(){var r=this.ptr;return b(Y(r))},mr.prototype.content=mr.prototype.content=function(){var r=this.ptr;return b(K(r))},mr.prototype.startElement=mr.prototype.startElement=function(){var r=this.ptr;Q(r)},mr.prototype.endElement=mr.prototype.endElement=function(){var r=this.ptr;Z(r)},mr.prototype.characterData=mr.prototype.characterData=function(){var r=this.ptr;rr(r)},mr.prototype.__destroy__=mr.prototype.__destroy__=function(){var r=this.ptr;tr(r)},hr.prototype=Object.create(cr.prototype),hr.prototype.constructor=hr,hr.prototype.__class__=hr,hr.__cache__={},o.VoidPtr=hr,hr.prototype.__destroy__=hr.prototype.__destroy__=function(){var r=this.ptr;er(r)},_r.prototype=Object.create(mr.prototype),_r.prototype.constructor=_r,_r.prototype.__class__=_r,_r.__cache__={},o.CExpatJS=_r,_r.prototype.startElement=_r.prototype.startElement=function(){var r=this.ptr;or(r)},_r.prototype.endElement=_r.prototype.endElement=function(){var r=this.ptr;ar(r)},_r.prototype.characterData=_r.prototype.characterData=function(){var r=this.ptr;ir(r)},_r.prototype.__destroy__=_r.prototype.__destroy__=function(){var r=this.ptr;sr(r)},r.ready}),n=Object.freeze({__proto__:null,default:e});let o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().__hpcc_wasmFolder||void 0;function a(r){if(!arguments.length)return o;const t=o;return o=r,t}let i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:"undefined"!=typeof __filename?__filename:"undefined"!=typeof document&&document.currentScript?document.currentScript.src:"";i=i.substr(0,i.replace(/[?#].*/,"").lastIndexOf("/")+1);const s={};async function u(r,t,e){const n=r.default||r;return e||(e=await async function(r){return fetch(r,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+r+"'";return t.arrayBuffer()})).catch((r=>{throw r}))}(t)),await n({wasmBinary:e})}async function c(r,t,e,n){const o=`${function(r,t){for(;r.charAt(r.length-1)===t;)r=r.substring(0,r.length-1);return r}(e||a()||i||".","/")}/${function(r,t){for(;r.charAt(0)===t;)r=r.substring(1);return r}(`${t}.wasm`,"/")}`;return s[o]||(s[o]=u(r,o,n)),s[o]}class p{constructor(r,t){this.tag=r,this.attrs=t,this._content=""}get content(){return this._content}appendContent(r){this._content+=r}}function l(r,t,e,o){return c(n,"expatlib",e,o).then((e=>{const n=new e.CExpatJS;n.startElement=function(){t.startElement(this.tag(),function(r){const t={},e=r,n=`${String.fromCharCode(1)}`,o=`${n}${n}`;return e.split(o).filter((r=>!!r)).forEach((r=>{const e=r.split(n);t[e[0]]=e[1]})),t}(this.attrs()))},n.endElement=function(){t.endElement(this.tag())},n.characterData=function(){t.characterData(this.content())},n.create();const o=n.parse(r);return n.destroy(),e.destroy(n),o}))}var f=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(t){var e,n,o=void 0!==(t=t||{})?t:{};o.ready=new Promise((function(r,t){e=r,n=t}));var a,i,s=Object.assign({},o),u="./this.program",c=(r,t)=>{throw t},p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText},i=(r,t,e)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):e()},n.onerror=e,n.send(null)};var l,f=o.print||console.log.bind(console),d=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit),o.wasmBinary&&(l=o.wasmBinary);var m,h=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&N("no native wasm support detected");var _=!1;function v(r,t){r||N(t)}var y,w,E,g,b,k,S,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.buffer&&D)return D.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function x(r,t){return r?A(E,r,t):""}function P(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i);if(s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}function C(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++e):t+=3}return t}function F(r){y=r,o.HEAP8=w=new Int8Array(r),o.HEAP16=g=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=E=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=S=new Float64Array(r)}o.INITIAL_MEMORY;var M=[],R=[],z=[];var j=0,T=null;function O(r){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function B(r){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&T){var t=T;T=null,t()}}function N(r){o.onAbort&&o.onAbort(r),d(r="Aborted("+r+")"),_=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}var I,L,H,U;function G(r){return r.startsWith("data:application/octet-stream;base64,")}function W(r){try{if(r==I&&l)return new Uint8Array(l);throw"both async and sync fetching of the wasm failed"}catch(r){N(r)}}G(I="graphvizlib.wasm")||(L=I,I=o.locateFile?o.locateFile(L,p):p+L);var J={163264:(r,t)=>{var e=x(r),n=x(t);rr.createPath("/",X.dirname(e)),rr.writeFile(X.join("/",e),n)}};function q(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function V(r){for(;r.length>0;)r.shift()(o)}var X={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,t)=>{for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e;e--)r.unshift("..");return r},normalize:r=>{var t=X.isAbs(r),e="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:r=>{var t=X.splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:r=>{if("/"===r)return"/";var t=(r=(r=X.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?r:r.substr(t+1)},join:function(){var r=Array.prototype.slice.call(arguments);return X.normalize(r.join("/"))},join2:(r,t)=>X.normalize(r+"/"+t)};var $={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:rr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,t=X.isAbs(n)}return(t?"/":"")+(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!t).join("/"))||"."},relative:(r,t)=>{function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=$.resolve(r).substr(1),t=$.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}};function Y(r,t,e){var n=e>0?e:C(r)+1,o=new Array(n),a=P(r,o,0,o.length);return t&&(o.length=a),o}var K={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){K.ttys[r]={input:[],output:[],ops:t},rr.registerDevice(r,K.stream_ops)},stream_ops:{open:function(r){var t=K.ttys[r.node.rdev];if(!t)throw new rr.ErrnoError(43);r.tty=t,r.seekable=!1},close:function(r){r.tty.ops.fsync(r.tty)},fsync:function(r){r.tty.ops.fsync(r.tty)},read:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.get_char)throw new rr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new rr.ErrnoError(29)}if(void 0===s&&0===a)throw new rr.ErrnoError(6);if(null==s)break;a++,t[e+i]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.put_char)throw new rr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,t[e+a])}catch(r){throw new rr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;r.input=Y(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(f(A(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},fsync:function(r){r.output&&r.output.length>0&&(f(A(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(d(A(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},fsync:function(r){r.output&&r.output.length>0&&(d(A(r.output,0)),r.output=[])}}};function Q(r){r=function(r,t){return Math.ceil(r/t)*t}(r,65536);var t=gr(65536,r);return t?function(r,t){return E.fill(0,r,r+t),r}(t,r):0}var Z={ops_table:null,mount:function(r){return Z.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(rr.isBlkdev(e)||rr.isFIFO(e))throw new rr.ErrnoError(63);Z.ops_table||(Z.ops_table={dir:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,lookup:Z.node_ops.lookup,mknod:Z.node_ops.mknod,rename:Z.node_ops.rename,unlink:Z.node_ops.unlink,rmdir:Z.node_ops.rmdir,readdir:Z.node_ops.readdir,symlink:Z.node_ops.symlink},stream:{llseek:Z.stream_ops.llseek}},file:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:{llseek:Z.stream_ops.llseek,read:Z.stream_ops.read,write:Z.stream_ops.write,allocate:Z.stream_ops.allocate,mmap:Z.stream_ops.mmap,msync:Z.stream_ops.msync}},link:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,readlink:Z.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:rr.chrdev_stream_ops}});var o=rr.createNode(r,t,e,n);return rr.isDir(o.mode)?(o.node_ops=Z.ops_table.dir.node,o.stream_ops=Z.ops_table.dir.stream,o.contents={}):rr.isFile(o.mode)?(o.node_ops=Z.ops_table.file.node,o.stream_ops=Z.ops_table.file.stream,o.usedBytes=0,o.contents=null):rr.isLink(o.mode)?(o.node_ops=Z.ops_table.link.node,o.stream_ops=Z.ops_table.link.stream):rr.isChrdev(o.mode)&&(o.node_ops=Z.ops_table.chrdev.node,o.stream_ops=Z.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,t){var e=r.contents?r.contents.length:0;if(!(e>=t)){t=Math.max(t,e*(e<1048576?2:1.125)>>>0),0!=e&&(t=Math.max(t,256));var n=r.contents;r.contents=new Uint8Array(t),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,t){if(r.usedBytes!=t)if(0==t)r.contents=null,r.usedBytes=0;else{var e=r.contents;r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=rr.isChrdev(r.mode)?r.id:1,t.ino=r.id,t.mode=r.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=r.rdev,rr.isDir(r.mode)?t.size=4096:rr.isFile(r.mode)?t.size=r.usedBytes:rr.isLink(r.mode)?t.size=r.link.length:t.size=0,t.atime=new Date(r.timestamp),t.mtime=new Date(r.timestamp),t.ctime=new Date(r.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(r,t){void 0!==t.mode&&(r.mode=t.mode),void 0!==t.timestamp&&(r.timestamp=t.timestamp),void 0!==t.size&&Z.resizeFileStorage(r,t.size)},lookup:function(r,t){throw rr.genericErrors[44]},mknod:function(r,t,e,n){return Z.createNode(r,t,e,n)},rename:function(r,t,e){if(rr.isDir(r.mode)){var n;try{n=rr.lookupNode(t,e)}catch(r){}if(n)for(var o in n.contents)throw new rr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=e,t.contents[e]=r,t.timestamp=r.parent.timestamp,r.parent=t},unlink:function(r,t){delete r.contents[t],r.timestamp=Date.now()},rmdir:function(r,t){var e=rr.lookupNode(r,t);for(var n in e.contents)throw new rr.ErrnoError(55);delete r.contents[t],r.timestamp=Date.now()},readdir:function(r){var t=[".",".."];for(var e in r.contents)r.contents.hasOwnProperty(e)&&t.push(e);return t},symlink:function(r,t,e){var n=Z.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!rr.isLink(r.mode))throw new rr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,t,e,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),e);else for(var s=0;s<i;s++)t[e+s]=a[o+s];return i},write:function(r,t,e,n,o,a){if(t.buffer===w.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(e,e+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(e,e+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(e,e+n),o),n}if(Z.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(e,e+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[e+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,t,e){var n=t;if(1===e?n+=r.position:2===e&&rr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new rr.ErrnoError(28);return n},allocate:function(r,t,e){Z.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||s.buffer!==y){if((e>0||e+t<s.length)&&(s=s.subarray?s.subarray(e,e+t):Array.prototype.slice.call(s,e,e+t)),i=!0,!(a=Q(t)))throw new rr.ErrnoError(48);w.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:function(r,t,e,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);return 2&o||Z.stream_ops.write(r,t,0,n,e,!1),0}}};var rr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,t={})=>{if(!(r=$.resolve(rr.cwd(),r)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new rr.ErrnoError(32);for(var e=X.normalizeArray(r.split("/").filter((r=>!!r)),!1),n=rr.root,o="/",a=0;a<e.length;a++){var i=a===e.length-1;if(i&&t.parent)break;if(n=rr.lookupNode(n,e[a]),o=X.join2(o,e[a]),rr.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;rr.isLink(n.mode);){var u=rr.readlink(o);if(o=$.resolve(X.dirname(o),u),n=rr.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new rr.ErrnoError(32)}}return{path:o,node:n}},getPath:r=>{for(var t;;){if(rr.isRoot(r)){var e=r.mount.mountpoint;return t?"/"!==e[e.length-1]?e+"/"+t:e+t:e}t=t?r.name+"/"+t:r.name,r=r.parent}},hashName:(r,t)=>{for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(r+e>>>0)%rr.nameTable.length},hashAddNode:r=>{var t=rr.hashName(r.parent.id,r.name);r.name_next=rr.nameTable[t],rr.nameTable[t]=r},hashRemoveNode:r=>{var t=rr.hashName(r.parent.id,r.name);if(rr.nameTable[t]===r)rr.nameTable[t]=r.name_next;else for(var e=rr.nameTable[t];e;){if(e.name_next===r){e.name_next=r.name_next;break}e=e.name_next}},lookupNode:(r,t)=>{var e=rr.mayLookup(r);if(e)throw new rr.ErrnoError(e,r);for(var n=rr.hashName(r.id,t),o=rr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===t)return o}return rr.lookup(r,t)},createNode:(r,t,e,n)=>{var o=new rr.FSNode(r,t,e,n);return rr.hashAddNode(o),o},destroyNode:r=>{rr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var t=rr.flagModes[r];if(void 0===t)throw new Error("Unknown file open mode: "+r);return t},flagsToPermissionString:r=>{var t=["r","w","rw"][3&r];return 512&r&&(t+="w"),t},nodePermissions:(r,t)=>rr.ignorePermissions||(!t.includes("r")||292&r.mode)&&(!t.includes("w")||146&r.mode)&&(!t.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var t=rr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:(r,t)=>{try{rr.lookupNode(r,t);return 20}catch(r){}return rr.nodePermissions(r,"wx")},mayDelete:(r,t,e)=>{var n;try{n=rr.lookupNode(r,t)}catch(r){return r.errno}var o=rr.nodePermissions(r,"wx");if(o)return o;if(e){if(!rr.isDir(n.mode))return 54;if(rr.isRoot(n)||rr.getPath(n)===rr.cwd())return 10}else if(rr.isDir(n.mode))return 31;return 0},mayOpen:(r,t)=>r?rr.isLink(r.mode)?32:rr.isDir(r.mode)&&("r"!==rr.flagsToPermissionString(t)||512&t)?31:rr.nodePermissions(r,rr.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,t=rr.MAX_OPEN_FDS)=>{for(var e=r;e<=t;e++)if(!rr.streams[e])return e;throw new rr.ErrnoError(33)},getStream:r=>rr.streams[r],createStream:(r,t,e)=>{rr.FSStream||(rr.FSStream=function(){this.shared={}},rr.FSStream.prototype={},Object.defineProperties(rr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get:function(){return this.shared.position},set:function(r){this.shared.position=r}}})),r=Object.assign(new rr.FSStream,r);var n=rr.nextfd(t,e);return r.fd=n,rr.streams[n]=r,r},closeStream:r=>{rr.streams[r]=null},chrdev_stream_ops:{open:r=>{var t=rr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new rr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,t)=>r<<8|t,registerDevice:(r,t)=>{rr.devices[r]={stream_ops:t}},getDevice:r=>rr.devices[r],getMounts:r=>{for(var t=[],e=[r];e.length;){var n=e.pop();t.push(n),e.push.apply(e,n.mounts)}return t},syncfs:(r,t)=>{"function"==typeof r&&(t=r,r=!1),rr.syncFSRequests++,rr.syncFSRequests>1&&d("warning: "+rr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=rr.getMounts(rr.root.mount),n=0;function o(r){return rr.syncFSRequests--,t(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=e.length&&o(null)}e.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,r,a)}))},mount:(r,t,e)=>{var n,o="/"===e,a=!e;if(o&&rr.root)throw new rr.ErrnoError(10);if(!o&&!a){var i=rr.lookupPath(e,{follow_mount:!1});if(e=i.path,n=i.node,rr.isMountpoint(n))throw new rr.ErrnoError(10);if(!rr.isDir(n.mode))throw new rr.ErrnoError(54)}var s={type:r,opts:t,mountpoint:e,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?rr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var t=rr.lookupPath(r,{follow_mount:!1});if(!rr.isMountpoint(t.node))throw new rr.ErrnoError(28);var e=t.node,n=e.mounted,o=rr.getMounts(n);Object.keys(rr.nameTable).forEach((r=>{for(var t=rr.nameTable[r];t;){var e=t.name_next;o.includes(t.mount)&&rr.destroyNode(t),t=e}})),e.mounted=null;var a=e.mount.mounts.indexOf(n);e.mount.mounts.splice(a,1)},lookup:(r,t)=>r.node_ops.lookup(r,t),mknod:(r,t,e)=>{var n=rr.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new rr.ErrnoError(28);var a=rr.mayCreate(n,o);if(a)throw new rr.ErrnoError(a);if(!n.node_ops.mknod)throw new rr.ErrnoError(63);return n.node_ops.mknod(n,o,t,e)},create:(r,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,rr.mknod(r,t,0)),mkdir:(r,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,rr.mknod(r,t,0)),mkdirTree:(r,t)=>{for(var e=r.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{rr.mkdir(n,t)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,t,e)=>(void 0===e&&(e=t,t=438),t|=8192,rr.mknod(r,t,e)),symlink:(r,t)=>{if(!$.resolve(r))throw new rr.ErrnoError(44);var e=rr.lookupPath(t,{parent:!0}).node;if(!e)throw new rr.ErrnoError(44);var n=X.basename(t),o=rr.mayCreate(e,n);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.symlink)throw new rr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:(r,t)=>{var e,n,o=X.dirname(r),a=X.dirname(t),i=X.basename(r),s=X.basename(t);if(e=rr.lookupPath(r,{parent:!0}).node,n=rr.lookupPath(t,{parent:!0}).node,!e||!n)throw new rr.ErrnoError(44);if(e.mount!==n.mount)throw new rr.ErrnoError(75);var u,c=rr.lookupNode(e,i),p=$.relative(r,a);if("."!==p.charAt(0))throw new rr.ErrnoError(28);if("."!==(p=$.relative(t,o)).charAt(0))throw new rr.ErrnoError(55);try{u=rr.lookupNode(n,s)}catch(r){}if(c!==u){var l=rr.isDir(c.mode),f=rr.mayDelete(e,i,l);if(f)throw new rr.ErrnoError(f);if(f=u?rr.mayDelete(n,s,l):rr.mayCreate(n,s))throw new rr.ErrnoError(f);if(!e.node_ops.rename)throw new rr.ErrnoError(63);if(rr.isMountpoint(c)||u&&rr.isMountpoint(u))throw new rr.ErrnoError(10);if(n!==e&&(f=rr.nodePermissions(e,"w")))throw new rr.ErrnoError(f);rr.hashRemoveNode(c);try{e.node_ops.rename(c,n,s)}catch(r){throw r}finally{rr.hashAddNode(c)}}},rmdir:r=>{var t=rr.lookupPath(r,{parent:!0}).node,e=X.basename(r),n=rr.lookupNode(t,e),o=rr.mayDelete(t,e,!0);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.rmdir)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);t.node_ops.rmdir(t,e),rr.destroyNode(n)},readdir:r=>{var t=rr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new rr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var t=rr.lookupPath(r,{parent:!0}).node;if(!t)throw new rr.ErrnoError(44);var e=X.basename(r),n=rr.lookupNode(t,e),o=rr.mayDelete(t,e,!1);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.unlink)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);t.node_ops.unlink(t,e),rr.destroyNode(n)},readlink:r=>{var t=rr.lookupPath(r).node;if(!t)throw new rr.ErrnoError(44);if(!t.node_ops.readlink)throw new rr.ErrnoError(28);return $.resolve(rr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,t)=>{var e=rr.lookupPath(r,{follow:!t}).node;if(!e)throw new rr.ErrnoError(44);if(!e.node_ops.getattr)throw new rr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:r=>rr.stat(r,!0),chmod:(r,t,e)=>{var n;"string"==typeof r?n=rr.lookupPath(r,{follow:!e}).node:n=r;if(!n.node_ops.setattr)throw new rr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,t)=>{rr.chmod(r,t,!0)},fchmod:(r,t)=>{var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);rr.chmod(e.node,t)},chown:(r,t,e,n)=>{var o;"string"==typeof r?o=rr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new rr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,t,e)=>{rr.chown(r,t,e,!0)},fchown:(r,t,e)=>{var n=rr.getStream(r);if(!n)throw new rr.ErrnoError(8);rr.chown(n.node,t,e)},truncate:(r,t)=>{if(t<0)throw new rr.ErrnoError(28);var e;"string"==typeof r?e=rr.lookupPath(r,{follow:!0}).node:e=r;if(!e.node_ops.setattr)throw new rr.ErrnoError(63);if(rr.isDir(e.mode))throw new rr.ErrnoError(31);if(!rr.isFile(e.mode))throw new rr.ErrnoError(28);var n=rr.nodePermissions(e,"w");if(n)throw new rr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:(r,t)=>{var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);if(0==(2097155&e.flags))throw new rr.ErrnoError(28);rr.truncate(e.node,t)},utime:(r,t,e)=>{var n=rr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:(r,t,e)=>{if(""===r)throw new rr.ErrnoError(44);var n;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?rr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)n=r;else{r=X.normalize(r);try{n=rr.lookupPath(r,{follow:!(131072&t)}).node}catch(r){}}var a=!1;if(64&t)if(n){if(128&t)throw new rr.ErrnoError(20)}else n=rr.mknod(r,e,0),a=!0;if(!n)throw new rr.ErrnoError(44);if(rr.isChrdev(n.mode)&&(t&=-513),65536&t&&!rr.isDir(n.mode))throw new rr.ErrnoError(54);if(!a){var i=rr.mayOpen(n,t);if(i)throw new rr.ErrnoError(i)}512&t&&!a&&rr.truncate(n,0),t&=-131713;var s=rr.createStream({node:n,path:rr.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&t||(rr.readFiles||(rr.readFiles={}),r in rr.readFiles||(rr.readFiles[r]=1)),s},close:r=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{rr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,t,e)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new rr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new rr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,t,e),r.ungotten=[],r.position},read:(r,t,e,n,o)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(1==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.read)throw new rr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,t,e,n,o);return a||(r.position+=i),i},write:(r,t,e,n,o,a)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.write)throw new rr.ErrnoError(28);r.seekable&&1024&r.flags&&rr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,t,e,n,o,a);return i||(r.position+=s),s},allocate:(r,t,e)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(t<0||e<=0)throw new rr.ErrnoError(28);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(!rr.isFile(r.node.mode)&&!rr.isDir(r.node.mode))throw new rr.ErrnoError(43);if(!r.stream_ops.allocate)throw new rr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:(r,t,e,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&r.flags))throw new rr.ErrnoError(2);if(1==(2097155&r.flags))throw new rr.ErrnoError(2);if(!r.stream_ops.mmap)throw new rr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o)},msync:(r,t,e,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,t,e,n,o):0,munmap:r=>0,ioctl:(r,t,e)=>{if(!r.stream_ops.ioctl)throw new rr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:(r,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var e,n=rr.open(r,t.flags),o=rr.stat(r).size,a=new Uint8Array(o);return rr.read(n,a,0,o,0),"utf8"===t.encoding?e=A(a,0):"binary"===t.encoding&&(e=a),rr.close(n),e},writeFile:(r,t,e={})=>{e.flags=e.flags||577;var n=rr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(C(t)+1),a=P(t,o,0,o.length);rr.write(n,o,0,a,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");rr.write(n,t,0,t.byteLength,void 0,e.canOwn)}rr.close(n)},cwd:()=>rr.currentPath,chdir:r=>{var t=rr.lookupPath(r,{follow:!0});if(null===t.node)throw new rr.ErrnoError(44);if(!rr.isDir(t.node.mode))throw new rr.ErrnoError(54);var e=rr.nodePermissions(t.node,"x");if(e)throw new rr.ErrnoError(e);rr.currentPath=t.path},createDefaultDirectories:()=>{rr.mkdir("/tmp"),rr.mkdir("/home"),rr.mkdir("/home/web_user")},createDefaultDevices:()=>{rr.mkdir("/dev"),rr.registerDevice(rr.makedev(1,3),{read:()=>0,write:(r,t,e,n,o)=>n}),rr.mkdev("/dev/null",rr.makedev(1,3)),K.register(rr.makedev(5,0),K.default_tty_ops),K.register(rr.makedev(6,0),K.default_tty1_ops),rr.mkdev("/dev/tty",rr.makedev(5,0)),rr.mkdev("/dev/tty1",rr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return()=>(crypto.getRandomValues(r),r[0])}return()=>N("randomDevice")}();rr.createDevice("/dev","random",r),rr.createDevice("/dev","urandom",r),rr.mkdir("/dev/shm"),rr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{rr.mkdir("/proc");var r=rr.mkdir("/proc/self");rr.mkdir("/proc/self/fd"),rr.mount({mount:()=>{var t=rr.createNode(r,"fd",16895,73);return t.node_ops={lookup:(r,t)=>{var e=+t,n=rr.getStream(e);if(!n)throw new rr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?rr.createDevice("/dev","stdin",o.stdin):rr.symlink("/dev/tty","/dev/stdin"),o.stdout?rr.createDevice("/dev","stdout",null,o.stdout):rr.symlink("/dev/tty","/dev/stdout"),o.stderr?rr.createDevice("/dev","stderr",null,o.stderr):rr.symlink("/dev/tty1","/dev/stderr"),rr.open("/dev/stdin",0),rr.open("/dev/stdout",1),rr.open("/dev/stderr",1)},ensureErrnoError:()=>{rr.ErrnoError||(rr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},rr.ErrnoError.prototype=new Error,rr.ErrnoError.prototype.constructor=rr.ErrnoError,[44].forEach((r=>{rr.genericErrors[r]=new rr.ErrnoError(r),rr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{rr.ensureErrnoError(),rr.nameTable=new Array(4096),rr.mount(Z,{},"/"),rr.createDefaultDirectories(),rr.createDefaultDevices(),rr.createSpecialDirectories(),rr.filesystems={MEMFS:Z}},init:(r,t,e)=>{rr.init.initialized=!0,rr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=t||o.stdout,o.stderr=e||o.stderr,rr.createStandardStreams()},quit:()=>{rr.init.initialized=!1;for(var r=0;r<rr.streams.length;r++){var t=rr.streams[r];t&&rr.close(t)}},getMode:(r,t)=>{var e=0;return r&&(e|=365),t&&(e|=146),e},findObject:(r,t)=>{var e=rr.analyzePath(r,t);return e.exists?e.object:null},analyzePath:(r,t)=>{try{r=(n=rr.lookupPath(r,{follow:!t})).path}catch(r){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=rr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=X.basename(r),n=rr.lookupPath(r,{follow:!t}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(r){e.error=r.errno}return e},createPath:(r,t,e,n)=>{r="string"==typeof r?r:rr.getPath(r);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=X.join2(r,a);try{rr.mkdir(i)}catch(r){}r=i}}return i},createFile:(r,t,e,n,o)=>{var a=X.join2("string"==typeof r?r:rr.getPath(r),t),i=rr.getMode(n,o);return rr.create(a,i)},createDataFile:(r,t,e,n,o,a)=>{var i=t;r&&(r="string"==typeof r?r:rr.getPath(r),i=t?X.join2(r,t):r);var s=rr.getMode(n,o),u=rr.create(i,s);if(e){if("string"==typeof e){for(var c=new Array(e.length),p=0,l=e.length;p<l;++p)c[p]=e.charCodeAt(p);e=c}rr.chmod(u,146|s);var f=rr.open(u,577);rr.write(f,e,0,e.length,0,a),rr.close(f),rr.chmod(u,s)}return u},createDevice:(r,t,e,n)=>{var o=X.join2("string"==typeof r?r:rr.getPath(r),t),a=rr.getMode(!!e,!!n);rr.createDevice.major||(rr.createDevice.major=64);var i=rr.makedev(rr.createDevice.major++,0);return rr.registerDevice(i,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,t,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=e()}catch(r){throw new rr.ErrnoError(29)}if(void 0===u&&0===i)throw new rr.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(r.node.timestamp=Date.now()),i},write:(r,t,e,o,a)=>{for(var i=0;i<o;i++)try{n(t[e+i])}catch(r){throw new rr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),rr.mkdev(o,a,i)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Y(a(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new rr.ErrnoError(29)}},createLazyFile:(r,t,e,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var t=r%this.chunkSize,e=r/this.chunkSize|0;return this.getter(e)[t]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",e,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+e+". Status: "+r.status);var t,n=Number(r.getResponseHeader("Content-length")),o=(t=r.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=r.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((r=>{var t=r*i,o=(r+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,t)=>{if(r>t)throw new Error("invalid range ("+r+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",e,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Y(o.responseText||"",!0)})(t,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:e},s=rr.createFile(r,t,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(r,t,e,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[e+s]=a[o+s];else for(s=0;s<i;s++)t[e+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach((r=>{var t=s.stream_ops[r];u[r]=function(){return rr.forceLoadFile(s),t.apply(null,arguments)}})),u.read=(r,t,e,n,o)=>(rr.forceLoadFile(s),c(r,t,e,n,o)),u.mmap=(r,t,e,n,o)=>{rr.forceLoadFile(s);var a=Q(t);if(!a)throw new rr.ErrnoError(48);return c(r,w,a,t,e),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(r,t,e,n,o,a,s,u,c,p)=>{var l=t?$.resolve(X.join2(r,t)):r;function f(e){function i(e){p&&p(),u||rr.createDataFile(r,t,e,n,o,c),a&&a(),B()}Browser.handledByPreloadPlugin(e,l,i,(()=>{s&&s(),B()}))||i(e)}O(),"string"==typeof e?function(r,t,e,n){var o=n?"":"al "+r;i(r,(e=>{v(e,'Loading data file "'+r+'" failed (no arrayBuffer).'),t(new Uint8Array(e)),o&&B()}),(t=>{if(!e)throw'Loading data file "'+r+'" failed.';e()})),o&&O()}(e,(r=>f(r)),s):f(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=()=>{f("creating db"),o.result.createObjectStore(rr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([rr.DB_STORE_NAME],"readwrite"),a=n.objectStore(rr.DB_STORE_NAME),i=0,s=0,u=r.length;function c(){0==s?t():e()}r.forEach((r=>{var t=a.put(rr.analyzePath(r).object.contents,r);t.onsuccess=()=>{++i+s==u&&c()},t.onerror=()=>{s++,i+s==u&&c()}})),n.onerror=e},o.onerror=e},loadFilesFromDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=e,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([rr.DB_STORE_NAME],"readonly")}catch(r){return void e(r)}var i=a.objectStore(rr.DB_STORE_NAME),s=0,u=0,c=r.length;function p(){0==u?t():e()}r.forEach((r=>{var t=i.get(r);t.onsuccess=()=>{rr.analyzePath(r).exists&&rr.unlink(r),rr.createDataFile(X.dirname(r),X.basename(r),t.result,!0,!0,!0),++s+u==c&&p()},t.onerror=()=>{u++,s+u==c&&p()}})),a.onerror=e},o.onerror=e}},tr={DEFAULT_POLLMASK:5,calculateAt:function(r,t,e){if(X.isAbs(t))return t;var n;-100===r?n=rr.cwd():n=tr.getStreamFromFD(r).path;if(0==t.length){if(!e)throw new rr.ErrnoError(44);return n}return X.join2(n,t)},doStat:function(r,t,e){try{var n=r(t)}catch(r){if(r&&r.node&&X.normalize(t)!==X.normalize(rr.getPath(r.node)))return-54;throw r}return b[e>>2]=n.dev,b[e+8>>2]=n.ino,b[e+12>>2]=n.mode,k[e+16>>2]=n.nlink,b[e+20>>2]=n.uid,b[e+24>>2]=n.gid,b[e+28>>2]=n.rdev,U=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+40>>2]=U[0],b[e+44>>2]=U[1],b[e+48>>2]=4096,b[e+52>>2]=n.blocks,U=[Math.floor(n.atime.getTime()/1e3)>>>0,(H=Math.floor(n.atime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+56>>2]=U[0],b[e+60>>2]=U[1],k[e+64>>2]=0,U=[Math.floor(n.mtime.getTime()/1e3)>>>0,(H=Math.floor(n.mtime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+72>>2]=U[0],b[e+76>>2]=U[1],k[e+80>>2]=0,U=[Math.floor(n.ctime.getTime()/1e3)>>>0,(H=Math.floor(n.ctime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+88>>2]=U[0],b[e+92>>2]=U[1],k[e+96>>2]=0,U=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+104>>2]=U[0],b[e+108>>2]=U[1],0},doMsync:function(r,t,e,n,o){var a=E.slice(r,r+e);rr.msync(t,a,o,e,n)},varargs:void 0,get:function(){return tr.varargs+=4,b[tr.varargs-4>>2]},getStr:function(r){return x(r)},getStreamFromFD:function(r){var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);return t}};var er=[];function nr(r){try{return m.grow(r-y.byteLength+65535>>>16),F(m.buffer),1}catch(r){}}var or={};function ar(){if(!ar.strings){var r={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",_:u||"./this.program"};for(var t in or)void 0===or[t]?delete r[t]:r[t]=or[t];var e=[];for(var t in r)e.push(t+"="+r[t]);ar.strings=e}return ar.strings}function ir(r){h||(o.onExit&&o.onExit(r),_=!0),c(r,new q(r))}var sr=function(r,t){ir(r)};var ur=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=rr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n},cr=365,pr=146;Object.defineProperties(ur.prototype,{read:{get:function(){return(this.mode&cr)===cr},set:function(r){r?this.mode|=cr:this.mode&=-366}},write:{get:function(){return(this.mode&pr)===pr},set:function(r){r?this.mode|=pr:this.mode&=-147}},isFolder:{get:function(){return rr.isDir(this.mode)}},isDevice:{get:function(){return rr.isChrdev(this.mode)}}}),rr.FSNode=ur,rr.staticInit();var lr={k:function(r,t,e,n){try{if(t=tr.getStr(t),t=tr.calculateAt(r,t),-8&e)return-28;var o=rr.lookupPath(t,{follow:!0}).node;if(!o)return-44;var a="";return 4&e&&(a+="r"),2&e&&(a+="w"),1&e&&(a+="x"),a&&rr.nodePermissions(o,a)?-2:0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},f:function(r,t,e){tr.varargs=e;try{var n=tr.getStreamFromFD(r);switch(t){case 0:return(o=tr.get())<0?-28:rr.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=tr.get();return n.flags|=o,0;case 5:o=tr.get();return g[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,b[Er()>>2]=a,-1}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}var a},u:function(r,t){try{var e=tr.getStreamFromFD(r);return tr.doStat(rr.stat,e.path,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},v:function(r,t,e){tr.varargs=e;try{var n=tr.getStreamFromFD(r);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=tr.get();return b[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=tr.get();return rr.ioctl(n,t,o);default:return-28}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},s:function(r,t,e,n){try{t=tr.getStr(t);var o=256&n,a=4096&n;return n&=-4353,t=tr.calculateAt(r,t,a),tr.doStat(o?rr.lstat:rr.stat,t,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},c:function(r,t,e,n){tr.varargs=n;try{t=tr.getStr(t),t=tr.calculateAt(r,t);var o=n?tr.get():0;return rr.open(t,e,o).fd}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},t:function(r,t){try{return r=tr.getStr(r),tr.doStat(rr.stat,r,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},n:function(r,t,e){try{return t=tr.getStr(t),t=tr.calculateAt(r,t),0===e?rr.unlink(t):512===e?rr.rmdir(t):N("Invalid flags passed to unlinkat"),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},d:function(){return Date.now()},i:function(){return true},o:function(r,t,e,n,o,a){try{var i=tr.getStreamFromFD(n),s=rr.mmap(i,r,o,t,e),u=s.ptr;return b[a>>2]=s.allocated,u}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},p:function(r,t,e,n,o,a){try{var i=tr.getStreamFromFD(o);2&e&&tr.doMsync(r,i,t,n,a),rr.munmap(i)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},a:function(){N("")},w:function(r,t,e){var n=function(r,t){var e;for(er.length=0,t>>=2;e=E[r++];)t+=105!=e&t,er.push(105==e?b[t]:S[t++>>1]),++t;return er}(t,e);return J[r].apply(null,n)},j:function(r,t,e){E.copyWithin(r,t,t+e)},m:function(r){var t,e,n=E.length,o=2147483648;if((r>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,r+100663296),nr(Math.min(o,(t=Math.max(r,i))+((e=65536)-t%e)%e)))return!0}return!1},q:function(r,t){var e=0;return ar().forEach((function(n,o){var a=t+e;k[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)w[t++>>0]=r.charCodeAt(n);e||(w[t>>0]=0)}(n,a),e+=n.length+1})),0},r:function(r,t){var e=ar();k[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),k[t>>2]=n,0},e:sr,b:function(r){try{var t=tr.getStreamFromFD(r);return rr.close(t),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},g:function(r,t,e,n){try{var o=function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=k[t>>2],s=k[t+4>>2];t+=8;var u=rr.read(r,w,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(tr.getStreamFromFD(r),t,e);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},l:function(r,t,e,n,o){try{var a=(u=e)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*u:NaN;if(isNaN(a))return 61;var i=tr.getStreamFromFD(r);return rr.llseek(i,a,n),U=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[o>>2]=U[0],b[o+4>>2]=U[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}var s,u},h:function(r,t,e,n){try{var o=function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=k[t>>2],s=k[t+4>>2];t+=8;var u=rr.write(r,w,i,s,n);if(u<0)return-1;o+=u}return o}(tr.getStreamFromFD(r),t,e);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}}};!function(){var r={a:lr};function t(r,t){var e,n=r.exports;o.asm=n,F((m=o.asm.x).buffer),o.asm.G,e=o.asm.y,R.unshift(e),B()}function e(r){t(r.instance)}function a(t){return(l||"function"!=typeof fetch?Promise.resolve().then((function(){return W(I)})):fetch(I,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+I+"'";return r.arrayBuffer()})).catch((function(){return W(I)}))).then((function(t){return WebAssembly.instantiate(t,r)})).then((function(r){return r})).then(t,(function(r){d("failed to asynchronously prepare wasm: "+r),N(r)}))}if(O(),o.instantiateWasm)try{return o.instantiateWasm(r,t)}catch(r){return d("Module.instantiateWasm callback failed with error: "+r),!1}(l||"function"!=typeof WebAssembly.instantiateStreaming||G(I)||"function"!=typeof fetch?a(e):fetch(I,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){return d("wasm streaming compile failed: "+r),d("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.y).apply(null,arguments)};var fr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(fr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.z).apply(null,arguments)},dr=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(dr=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.A).apply(null,arguments)},mr=o._emscripten_bind_Graphviz_version_0=function(){return(mr=o._emscripten_bind_Graphviz_version_0=o.asm.B).apply(null,arguments)},hr=o._emscripten_bind_Graphviz_lastError_0=function(){return(hr=o._emscripten_bind_Graphviz_lastError_0=o.asm.C).apply(null,arguments)},_r=o._emscripten_bind_Graphviz_layout_3=function(){return(_r=o._emscripten_bind_Graphviz_layout_3=o.asm.D).apply(null,arguments)},vr=o._emscripten_bind_Graphviz_createFile_2=function(){return(vr=o._emscripten_bind_Graphviz_createFile_2=o.asm.E).apply(null,arguments)},yr=o._emscripten_bind_Graphviz___destroy___0=function(){return(yr=o._emscripten_bind_Graphviz___destroy___0=o.asm.F).apply(null,arguments)};o._free=function(){return(o._free=o.asm.H).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)};var wr,Er=o.___errno_location=function(){return(Er=o.___errno_location=o.asm.J).apply(null,arguments)},gr=o._emscripten_builtin_memalign=function(){return(gr=o._emscripten_builtin_memalign=o.asm.K).apply(null,arguments)};function br(r){function t(){wr||(wr=!0,o.calledRun=!0,_||(o.noFSInit||rr.init.initialized||rr.init(),rr.ignorePermissions=!1,V(R),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;V(z)}()))}j>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),M.unshift(r);var r;V(M)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o.___start_em_js=163408,o.___stop_em_js=163506,T=function r(){wr||br(),wr||(T=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function kr(){}function Sr(r){return(r||kr).__cache__}function Dr(r,t){var e=Sr(t),n=e[r];return n||((n=Object.create((t||kr).prototype)).ptr=r,e[r]=n)}br(),kr.prototype=Object.create(kr.prototype),kr.prototype.constructor=kr,kr.prototype.__class__=kr,kr.__cache__={},o.WrapperObject=kr,o.getCache=Sr,o.wrapPointer=Dr,o.castObject=function(r,t){return Dr(r.ptr,t)},o.NULL=Dr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Sr(r.__class__)[r.ptr]},o.compare=function(r,t){return r.ptr===t.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Ar={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Ar.needed){for(var r=0;r<Ar.temps.length;r++)o._free(Ar.temps[r]);Ar.temps.length=0,o._free(Ar.buffer),Ar.buffer=0,Ar.size+=Ar.needed,Ar.needed=0}Ar.buffer||(Ar.size+=128,Ar.buffer=o._malloc(Ar.size),v(Ar.buffer)),Ar.pos=0},alloc:function(r,t){v(Ar.buffer);var e,n=t.BYTES_PER_ELEMENT,a=r.length*n;return a=a+7&-8,Ar.pos+a>=Ar.size?(v(a>0),Ar.needed+=a,e=o._malloc(a),Ar.temps.push(e)):(e=Ar.buffer+Ar.pos,Ar.pos+=a),e},copy:function(r,t,e){switch(e>>>=0,t.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<r.length;n++)t[e+n]=r[n]}};function xr(r){if("string"==typeof r){var t=Y(r),e=Ar.alloc(t,w);return Ar.copy(t,w,e),e}return r}function Pr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Cr(r,t){r&&"object"==typeof r&&(r=r.ptr),t&&"object"==typeof t&&(t=t.ptr),this.ptr=dr(r,t),Sr(Cr)[this.ptr]=this}return Pr.prototype=Object.create(kr.prototype),Pr.prototype.constructor=Pr,Pr.prototype.__class__=Pr,Pr.__cache__={},o.VoidPtr=Pr,Pr.prototype.__destroy__=Pr.prototype.__destroy__=function(){var r=this.ptr;fr(r)},Cr.prototype=Object.create(kr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.__class__=Cr,Cr.__cache__={},o.Graphviz=Cr,Cr.prototype.version=Cr.prototype.version=function(){var r=this.ptr;return x(mr(r))},Cr.prototype.lastError=Cr.prototype.lastError=function(){var r=this.ptr;return x(hr(r))},Cr.prototype.layout=Cr.prototype.layout=function(r,t,e){var n=this.ptr;return Ar.prepare(),r=r&&"object"==typeof r?r.ptr:xr(r),t=t&&"object"==typeof t?t.ptr:xr(t),e=e&&"object"==typeof e?e.ptr:xr(e),x(_r(n,r,t,e))},Cr.prototype.createFile=Cr.prototype.createFile=function(r,t){var e=this.ptr;Ar.prepare(),r=r&&"object"==typeof r?r.ptr:xr(r),t=t&&"object"==typeof t?t.ptr:xr(t),vr(e,r,t)},Cr.prototype.__destroy__=Cr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},t.ready}})(),d=Object.freeze({__proto__:null,default:f});function m(r){return{path:r.path,data:`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg width="${r.width}" height="${r.height}"></svg>`}}function h(r,t){const e={images:[],files:[],...t};var n;[...e.files,...(n=e.images,n.map(m))].forEach((t=>r.createFile(t.path,t.data)))}const _={layout:(r,t="svg",e="dot",n)=>r?c(d,"graphvizlib",null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then((o=>{const a=new o.Graphviz((null==n?void 0:n.yInvert)?1:0,(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);h(a,n);const i=a.layout(r,t,e);if(o.destroy(a),!i)throw new Error(o.Graphviz.prototype.lastError());return i})):Promise.resolve(""),circo(r,t="svg",e){return this.layout(r,t,"circo",e)},dot(r,t="svg",e){return this.layout(r,t,"dot",e)},fdp(r,t="svg",e){return this.layout(r,t,"fdp",e)},sfdp(r,t="svg",e){return this.layout(r,t,"sfdp",e)},neato(r,t="svg",e){return this.layout(r,t,"neato",e)},osage(r,t="svg",e){return this.layout(r,t,"osage",e)},patchwork(r,t="svg",e){return this.layout(r,t,"patchwork",e)},twopi(r,t="svg",e){return this.layout(r,t,"twopi",e)}};class v{constructor(r){this._wasm=r}layout(r,t="svg",e="dot",n){if(!r)return"";const o=new this._wasm.Graphviz((null==n?void 0:n.yInvert)?1:0,(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);h(o,n);const a=o.layout(r,t,e);if(this._wasm.destroy(o),!a)throw new Error(this._wasm.Graphviz.prototype.lastError());return a}circo(r,t="svg",e){return this.layout(r,t,"circo",e)}dot(r,t="svg",e){return this.layout(r,t,"dot",e)}fdp(r,t="svg",e){return this.layout(r,t,"fdp",e)}sfdp(r,t="svg",e){return this.layout(r,t,"sfdp",e)}neato(r,t="svg",e){return this.layout(r,t,"neato",e)}osage(r,t="svg",e){return this.layout(r,t,"osage",e)}patchwork(r,t="svg",e){return this.layout(r,t,"patchwork",e)}twopi(r,t="svg",e){return this.layout(r,t,"twopi",e)}}r.GraphvizSync=v,r.StackElement=p,r.StackParser=class{constructor(){this._stack=[]}parse(r,t,e){return l(r,this,t,e)}top(){return this._stack[this._stack.length-1]}startElement(r,t){const e=new p(r,t);return this._stack.push(e),e}endElement(r){return this._stack.pop()}characterData(r){this.top().appendContent(r)}},r.expatVersion=function(r,t){return c(n,"expatlib",r,t).then((r=>r.CExpat.prototype.version()))},r.graphviz=_,r.graphvizSync=function(r,t){return c(d,"graphvizlib",r,t).then((r=>new v(r)))},r.graphvizVersion=function(r,t){return c(d,"graphvizlib",r,t).then((r=>r.Graphviz.prototype.version()))},r.parse=l,r.wasmFolder=a,Object.defineProperty(r,"__esModule",{value:!0})}));