-
Notifications
You must be signed in to change notification settings - Fork 1
/
889.zappar-imagetraining.worker.js
1 lines (1 loc) · 68.9 KB
/
889.zappar-imagetraining.worker.js
1
(self.webpackChunkZapparImageTraining=self.webpackChunkZapparImageTraining||[]).push([[889],{889:(e,r,t)=>{var n=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(e){var r,n;(e=void 0!==(e=e||{})?e:{}).ready=new Promise((function(e,t){r=e,n=t}));var o,i={};for(o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);var a,s,u,c,l=[],f="./this.program";a=function(e,r){return u||(u=t(351)),c||(c=t(606)),e=c.normalize(e),u.readFileSync(e,r?null:"utf8")},s=function(e){var r=a(e,!0);return r.buffer||(r=new Uint8Array(r)),g(r.buffer),r},process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),l=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof kr))throw e})),process.on("unhandledRejection",K),e.inspect=function(){return"[Emscripten Module object]"};var d,p,h=e.print||console.log.bind(console),m=e.printErr||console.warn.bind(console);for(o in i)i.hasOwnProperty(o)&&(e[o]=i[o]);i=null,e.arguments&&(l=e.arguments),e.thisProgram&&(f=e.thisProgram),e.quit&&e.quit,e.wasmBinary&&(d=e.wasmBinary),e.noExitRuntime,"object"!=typeof WebAssembly&&K("no native wasm support detected");var v=!1;function g(e,r){e||K("Assertion failed: "+r)}var y="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function w(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.subarray&&y)return y.decode(e.subarray(r,o));for(var i="";r<o;){var a=e[r++];if(128&a){var s=63&e[r++];if(192!=(224&a)){var u=63&e[r++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[r++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function E(e,r){return e?w(T,e,r):""}function _(e,r,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(t>=i)break;r[t++]=s}else if(s<=2047){if(t+1>=i)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=i)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function b(e,r,t){return _(e,T,r,t)}function k(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++t)),n<=127?++r:r+=n<=2047?2:n<=65535?3:4}return r}var D,P,T,F,C,S,A,$,M,O="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function x(e,r){for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&C[n];)++n;if((t=n<<1)-e>32&&O)return O.decode(T.subarray(e,t));for(var i="",a=0;!(a>=r/2);++a){var s=F[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function R(e,r,t){if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);F[r>>1]=a,r+=2}return F[r>>1]=0,r-n}function j(e){return 2*e.length}function B(e,r){for(var t=0,n="";!(t>=r/4);){var o=S[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function z(e,r,t){if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),S[r>>2]=a,(r+=4)+4>o)break}return S[r>>2]=0,r-n}function N(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r}function W(r){D=r,e.HEAP8=P=new Int8Array(r),e.HEAP16=F=new Int16Array(r),e.HEAP32=S=new Int32Array(r),e.HEAPU8=T=new Uint8Array(r),e.HEAPU16=C=new Uint16Array(r),e.HEAPU32=A=new Uint32Array(r),e.HEAPF32=$=new Float32Array(r),e.HEAPF64=M=new Float64Array(r)}e.INITIAL_MEMORY;var I,U=[],L=[],H=[],Y=[],V=0,q=null,G=null;function X(r){V++,e.monitorRunDependencies&&e.monitorRunDependencies(V)}function J(r){if(V--,e.monitorRunDependencies&&e.monitorRunDependencies(V),0==V&&(null!==q&&(clearInterval(q),q=null),G)){var t=G;G=null,t()}}function K(r){e.onAbort&&e.onAbort(r),m(r+=""),v=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}function Z(e){return r=e,t="data:application/octet-stream;base64,",String.prototype.startsWith?r.startsWith(t):0===r.indexOf(t);var r,t}e.preloadedImages={},e.preloadedAudios={};var Q,ee,re,te="ImageTraining.wasm";function ne(r){for(;r.length>0;){var t=r.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?I.get(n)():I.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(e)}}Z(te)||(Q=te,te=e.locateFile?e.locateFile(Q,"//"):"//"+Q);function oe(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){S[this.ptr+8>>2]=e},this.get_type=function(){return S[this.ptr+8>>2]},this.set_destructor=function(e){S[this.ptr+0>>2]=e},this.get_destructor=function(){return S[this.ptr+0>>2]},this.set_refcount=function(e){S[this.ptr+4>>2]=e},this.set_caught=function(e){e=e?1:0,P[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=P[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,P[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=P[this.ptr+13>>0]},this.init=function(e,r){this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=S[this.ptr+4>>2];S[this.ptr+4>>2]=e+1},this.release_ref=function(){var e=S[this.ptr+4>>2];return S[this.ptr+4>>2]=e-1,1===e}}function ie(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var ae=void 0;function se(e){for(var r="",t=e;T[t];)r+=ae[T[t++]];return r}var ue={},ce={},le={};function fe(e){if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?"_"+e:e}function de(e,r){return e=fe(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(r)}function pe(e,r){var t=de(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},t}var he=void 0;function me(e){throw new he(e)}var ve=void 0;function ge(e){throw new ve(e)}function ye(e,r,t){function n(r){var n=t(r);n.length!==e.length&&ge("Mismatched type converter count");for(var o=0;o<e.length;++o)we(e[o],n[o])}e.forEach((function(e){le[e]=r}));var o=new Array(r.length),i=[],a=0;r.forEach((function(e,r){ce.hasOwnProperty(e)?o[r]=ce[e]:(i.push(e),ue.hasOwnProperty(e)||(ue[e]=[]),ue[e].push((function(){o[r]=ce[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function we(e,r,t){if(t=t||{},!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=r.name;if(e||me('type "'+n+'" must have a positive integer typeid pointer'),ce.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;me("Cannot register type '"+n+"' twice")}if(ce[e]=r,delete le[e],ue.hasOwnProperty(e)){var o=ue[e];delete ue[e],o.forEach((function(e){e()}))}}function Ee(e){me(e.$$.ptrType.registeredClass.name+" instance already deleted")}var _e=!1;function be(e){}function ke(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function De(e){return"undefined"==typeof FinalizationGroup?(De=function(e){return e},e):(_e=new FinalizationGroup((function(e){for(var r=e.next();!r.done;r=e.next()){var t=r.value;t.ptr?ke(t):console.warn("object already deleted: "+t.ptr)}})),De=function(e){return _e.register(e,e.$$,e.$$),e},be=function(e){_e.unregister(e.$$)},De(e))}var Pe=void 0,Te=[];function Fe(){for(;Te.length;){var e=Te.pop();e.$$.deleteScheduled=!1,e.delete()}}function Ce(){}var Se={};function Ae(e,r,t){if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||me("Function '"+t+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}}function $e(e,r,t,n,o,i,a,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Me(e,r,t){for(;r!==t;)r.upcast||me("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function Oe(e,r){if(null===r)return this.isReference&&me("null is not a valid "+this.name),0;r.$$||me('Cannot pass "'+Ze(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return Me(r.$$.ptr,t,this.registeredClass)}function xe(e,r){var t;if(null===r)return this.isReference&&me("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||me('Cannot pass "'+Ze(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&me("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var n=r.$$.ptrType.registeredClass;if(t=Me(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&me("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:me("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,Ke((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,t)}break;default:me("Unsupporting sharing policy")}return t}function Re(e,r){if(null===r)return this.isReference&&me("null is not a valid "+this.name),0;r.$$||me('Cannot pass "'+Ze(r)+'" as a '+this.name),r.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&me("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return Me(r.$$.ptr,t,this.registeredClass)}function je(e){return this.fromWireType(A[e>>2])}function Be(e,r,t){if(r===t)return e;if(void 0===t.baseClass)return null;var n=Be(e,r,t.baseClass);return null===n?null:t.downcast(n)}var ze={};function Ne(e,r){return r.ptrType&&r.ptr||ge("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ge("Both smartPtrType and smartPtr must be specified"),r.count={value:1},De(Object.create(e,{$$:{value:r}}))}function We(e,r,t,n,o,i,a,s,u,c,l){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==r.baseClass?this.toWireType=xe:n?(this.toWireType=Oe,this.destructorFunction=null):(this.toWireType=Re,this.destructorFunction=null)}function Ie(r,t,n){return-1!=r.indexOf("j")?function(r,t,n){var o=e["dynCall_"+r];return n&&n.length?o.apply(null,[t].concat(n)):o.call(null,t)}(r,t,n):I.get(t).apply(null,n)}function Ue(e,r){var t,n,o,i=-1!=(e=se(e)).indexOf("j")?(t=e,n=r,o=[],function(){o.length=arguments.length;for(var e=0;e<arguments.length;e++)o[e]=arguments[e];return Ie(t,n,o)}):I.get(r);return"function"!=typeof i&&me("unknown function pointer with signature "+e+": "+r),i}var Le=void 0;function He(e){var r=br(e),t=se(r);return _r(r),t}function Ye(e,r){var t=[],n={};throw r.forEach((function e(r){n[r]||ce[r]||(le[r]?le[r].forEach(e):(t.push(r),n[r]=!0))})),new Le(e+": "+t.map(He).join([", "]))}function Ve(e,r){for(var t=[],n=0;n<e;n++)t.push(S[(r>>2)+n]);return t}function qe(e){for(;e.length;){var r=e.pop();e.pop()(r)}}var Ge=[],Xe=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Je(e){e>4&&0==--Xe[e].refcount&&(Xe[e]=void 0,Ge.push(e))}function Ke(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var r=Ge.length?Ge.pop():Xe.length;return Xe[r]={refcount:1,value:e},r}}function Ze(e){if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e}function Qe(e,r){switch(r){case 2:return function(e){return this.fromWireType($[e>>2])};case 3:return function(e){return this.fromWireType(M[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function er(e,r,t){switch(r){case 0:return t?function(e){return P[e]}:function(e){return T[e]};case 1:return t?function(e){return F[e>>1]}:function(e){return C[e>>1]};case 2:return t?function(e){return S[e>>2]}:function(e){return A[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function rr(e,r){var t=ce[e];return void 0===t&&me(r+" has unknown type "+He(e)),t}function tr(e){try{return p.grow(e-D.byteLength+65535>>>16),W(p.buffer),1}catch(e){}}var nr={};function or(){if(!or.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var r in nr)e[r]=nr[r];var t=[];for(var r in e)t.push(r+"="+e[r]);or.strings=t}return or.strings}var ir={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=ir.normalizeArray(e.split("/").filter((function(e){return!!e})),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var r=ir.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(e){if("/"===e)return"/";var r=(e=(e=ir.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return ir.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ir.normalize(e.join("/"))},join2:function(e,r){return ir.normalize(e+"/"+r)}},ar={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:cr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=ir.normalizeArray(e.split("/").filter((function(e){return!!e})),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ar.resolve(e).substr(1),r=ar.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},sr={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){sr.ttys[e]={input:[],output:[],ops:r},cr.registerDevice(e,sr.stream_ops)},stream_ops:{open:function(e){var r=sr.ttys[e.node.rdev];if(!r)throw new cr.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new cr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new cr.ErrnoError(29)}if(void 0===s&&0===i)throw new cr.ErrnoError(6);if(null==s)break;i++,r[t+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new cr.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(e){throw new cr.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var r,t=Buffer.alloc?Buffer.alloc(256):new Buffer(256),n=0;try{n=u.readSync(process.stdin.fd,t,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;n=0}if(!(r=n>0?t.slice(0,n).toString("utf-8"):null))return null;e.input=gr(r,!0)}return e.input.shift()},put_char:function(e,r){null===r||10===r?(h(w(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},flush:function(e){e.output&&e.output.length>0&&(h(w(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(m(w(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},flush:function(e){e.output&&e.output.length>0&&(m(w(e.output,0)),e.output=[])}}};var ur={ops_table:null,mount:function(e){return ur.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(cr.isBlkdev(t)||cr.isFIFO(t))throw new cr.ErrnoError(63);ur.ops_table||(ur.ops_table={dir:{node:{getattr:ur.node_ops.getattr,setattr:ur.node_ops.setattr,lookup:ur.node_ops.lookup,mknod:ur.node_ops.mknod,rename:ur.node_ops.rename,unlink:ur.node_ops.unlink,rmdir:ur.node_ops.rmdir,readdir:ur.node_ops.readdir,symlink:ur.node_ops.symlink},stream:{llseek:ur.stream_ops.llseek}},file:{node:{getattr:ur.node_ops.getattr,setattr:ur.node_ops.setattr},stream:{llseek:ur.stream_ops.llseek,read:ur.stream_ops.read,write:ur.stream_ops.write,allocate:ur.stream_ops.allocate,mmap:ur.stream_ops.mmap,msync:ur.stream_ops.msync}},link:{node:{getattr:ur.node_ops.getattr,setattr:ur.node_ops.setattr,readlink:ur.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ur.node_ops.getattr,setattr:ur.node_ops.setattr},stream:cr.chrdev_stream_ops}});var o=cr.createNode(e,r,t,n);return cr.isDir(o.mode)?(o.node_ops=ur.ops_table.dir.node,o.stream_ops=ur.ops_table.dir.stream,o.contents={}):cr.isFile(o.mode)?(o.node_ops=ur.ops_table.file.node,o.stream_ops=ur.ops_table.file.stream,o.usedBytes=0,o.contents=null):cr.isLink(o.mode)?(o.node_ops=ur.ops_table.link.node,o.stream_ops=ur.ops_table.link.stream):cr.isChrdev(o.mode)&&(o.node_ops=ur.ops_table.chrdev.node,o.stream_ops=ur.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr:function(e){var r={};return r.dev=cr.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,cr.isDir(e.mode)?r.size=4096:cr.isFile(e.mode)?r.size=e.usedBytes:cr.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&ur.resizeFileStorage(e,r.size)},lookup:function(e,r){throw cr.genericErrors[44]},mknod:function(e,r,t,n){return ur.createNode(e,r,t,n)},rename:function(e,r,t){if(cr.isDir(e.mode)){var n;try{n=cr.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new cr.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=cr.lookupNode(e,r);for(var n in t.contents)throw new cr.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=ur.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!cr.isLink(e.mode))throw new cr.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)r.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)r[t+s]=i[o+s];return a},write:function(e,r,t,n,o,i){if(r.buffer===P.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),r.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=r.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=r.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(r.subarray(t,t+n),o),n}if(ur.expandFileStorage(a,o+n),a.contents.subarray&&r.subarray)a.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=r[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&cr.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new cr.ErrnoError(28);return n},allocate:function(e,r,t){ur.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap:function(e,r,t,n,o,i){if(0!==r)throw new cr.ErrnoError(28);if(!cr.isFile(e.node.mode))throw new cr.ErrnoError(43);var a,s,u=e.node.contents;if(2&i||u.buffer!==D){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=function(e){for(var r=function(e,r){return r||(r=16),Math.ceil(e/r)*r}(e,16384),t=Er(r);e<r;)P[t+e++]=0;return t}(t)))throw new cr.ErrnoError(48);P.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(e,r,t,n,o){if(!cr.isFile(e.node.mode))throw new cr.ErrnoError(43);return 2&o||ur.stream_ops.write(e,r,0,n,t,!1),0}}},cr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,r){if(r=r||{},!(e=ar.resolve(cr.cwd(),e)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===r[n]&&(r[n]=t[n]);if(r.recurse_count>8)throw new cr.ErrnoError(32);for(var o=ir.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),i=cr.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&r.parent)break;if(i=cr.lookupNode(i,o[s]),a=ir.join2(a,o[s]),cr.isMountpoint(i)&&(!u||u&&r.follow_mount)&&(i=i.mounted.root),!u||r.follow)for(var c=0;cr.isLink(i.mode);){var l=cr.readlink(a);if(a=ar.resolve(ir.dirname(a),l),i=cr.lookupPath(a,{recurse_count:r.recurse_count}).node,c++>40)throw new cr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(e){for(var r;;){if(cr.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?t+"/"+r:t+r:t}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:function(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%cr.nameTable.length},hashAddNode:function(e){var r=cr.hashName(e.parent.id,e.name);e.name_next=cr.nameTable[r],cr.nameTable[r]=e},hashRemoveNode:function(e){var r=cr.hashName(e.parent.id,e.name);if(cr.nameTable[r]===e)cr.nameTable[r]=e.name_next;else for(var t=cr.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=cr.mayLookup(e);if(t)throw new cr.ErrnoError(t,e);for(var n=cr.hashName(e.id,r),o=cr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return cr.lookup(e,r)},createNode:function(e,r,t,n){var o=new cr.FSNode(e,r,t,n);return cr.hashAddNode(o),o},destroyNode:function(e){cr.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var r=cr.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return cr.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){return cr.nodePermissions(e,"x")||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{return cr.lookupNode(e,r),20}catch(e){}return cr.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=cr.lookupNode(e,r)}catch(e){return e.errno}var o=cr.nodePermissions(e,"wx");if(o)return o;if(t){if(!cr.isDir(n.mode))return 54;if(cr.isRoot(n)||cr.getPath(n)===cr.cwd())return 10}else if(cr.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?cr.isLink(e.mode)?32:cr.isDir(e.mode)&&("r"!==cr.flagsToPermissionString(r)||512&r)?31:cr.nodePermissions(e,cr.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){e=e||0,r=r||cr.MAX_OPEN_FDS;for(var t=e;t<=r;t++)if(!cr.streams[t])return t;throw new cr.ErrnoError(33)},getStream:function(e){return cr.streams[e]},createStream:function(e,r,t){cr.FSStream||(cr.FSStream=function(){},cr.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new cr.FSStream;for(var o in e)n[o]=e[o];e=n;var i=cr.nextfd(r,t);return e.fd=i,cr.streams[i]=e,e},closeStream:function(e){cr.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=cr.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new cr.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){cr.devices[e]={stream_ops:r}},getDevice:function(e){return cr.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(e,r){"function"==typeof e&&(r=e,e=!1),cr.syncFSRequests++,cr.syncFSRequests>1&&m("warning: "+cr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=cr.getMounts(cr.root.mount),n=0;function o(e){return cr.syncFSRequests--,r(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((function(r){if(!r.type.syncfs)return i(null);r.type.syncfs(r,e,i)}))},mount:function(e,r,t){var n,o="/"===t,i=!t;if(o&&cr.root)throw new cr.ErrnoError(10);if(!o&&!i){var a=cr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,cr.isMountpoint(n))throw new cr.ErrnoError(10);if(!cr.isDir(n.mode))throw new cr.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?cr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var r=cr.lookupPath(e,{follow_mount:!1});if(!cr.isMountpoint(r.node))throw new cr.ErrnoError(28);var t=r.node,n=t.mounted,o=cr.getMounts(n);Object.keys(cr.nameTable).forEach((function(e){for(var r=cr.nameTable[e];r;){var t=r.name_next;-1!==o.indexOf(r.mount)&&cr.destroyNode(r),r=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=cr.lookupPath(e,{parent:!0}).node,o=ir.basename(e);if(!o||"."===o||".."===o)throw new cr.ErrnoError(28);var i=cr.mayCreate(n,o);if(i)throw new cr.ErrnoError(i);if(!n.node_ops.mknod)throw new cr.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:function(e,r){return r=void 0!==r?r:438,r&=4095,r|=32768,cr.mknod(e,r,0)},mkdir:function(e,r){return r=void 0!==r?r:511,r&=1023,r|=16384,cr.mknod(e,r,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{cr.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,r,t){return void 0===t&&(t=r,r=438),r|=8192,cr.mknod(e,r,t)},symlink:function(e,r){if(!ar.resolve(e))throw new cr.ErrnoError(44);var t=cr.lookupPath(r,{parent:!0}).node;if(!t)throw new cr.ErrnoError(44);var n=ir.basename(r),o=cr.mayCreate(t,n);if(o)throw new cr.ErrnoError(o);if(!t.node_ops.symlink)throw new cr.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:function(e,r){var t,n,o=ir.dirname(e),i=ir.dirname(r),a=ir.basename(e),s=ir.basename(r);if(t=cr.lookupPath(e,{parent:!0}).node,n=cr.lookupPath(r,{parent:!0}).node,!t||!n)throw new cr.ErrnoError(44);if(t.mount!==n.mount)throw new cr.ErrnoError(75);var u,c=cr.lookupNode(t,a),l=ar.relative(e,i);if("."!==l.charAt(0))throw new cr.ErrnoError(28);if("."!==(l=ar.relative(r,o)).charAt(0))throw new cr.ErrnoError(55);try{u=cr.lookupNode(n,s)}catch(e){}if(c!==u){var f=cr.isDir(c.mode),d=cr.mayDelete(t,a,f);if(d)throw new cr.ErrnoError(d);if(d=u?cr.mayDelete(n,s,f):cr.mayCreate(n,s))throw new cr.ErrnoError(d);if(!t.node_ops.rename)throw new cr.ErrnoError(63);if(cr.isMountpoint(c)||u&&cr.isMountpoint(u))throw new cr.ErrnoError(10);if(n!==t&&(d=cr.nodePermissions(t,"w")))throw new cr.ErrnoError(d);try{cr.trackingDelegate.willMovePath&&cr.trackingDelegate.willMovePath(e,r)}catch(t){m("FS.trackingDelegate['willMovePath']('"+e+"', '"+r+"') threw an exception: "+t.message)}cr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{cr.hashAddNode(c)}try{cr.trackingDelegate.onMovePath&&cr.trackingDelegate.onMovePath(e,r)}catch(t){m("FS.trackingDelegate['onMovePath']('"+e+"', '"+r+"') threw an exception: "+t.message)}}},rmdir:function(e){var r=cr.lookupPath(e,{parent:!0}).node,t=ir.basename(e),n=cr.lookupNode(r,t),o=cr.mayDelete(r,t,!0);if(o)throw new cr.ErrnoError(o);if(!r.node_ops.rmdir)throw new cr.ErrnoError(63);if(cr.isMountpoint(n))throw new cr.ErrnoError(10);try{cr.trackingDelegate.willDeletePath&&cr.trackingDelegate.willDeletePath(e)}catch(r){m("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+r.message)}r.node_ops.rmdir(r,t),cr.destroyNode(n);try{cr.trackingDelegate.onDeletePath&&cr.trackingDelegate.onDeletePath(e)}catch(r){m("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+r.message)}},readdir:function(e){var r=cr.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new cr.ErrnoError(54);return r.node_ops.readdir(r)},unlink:function(e){var r=cr.lookupPath(e,{parent:!0}).node,t=ir.basename(e),n=cr.lookupNode(r,t),o=cr.mayDelete(r,t,!1);if(o)throw new cr.ErrnoError(o);if(!r.node_ops.unlink)throw new cr.ErrnoError(63);if(cr.isMountpoint(n))throw new cr.ErrnoError(10);try{cr.trackingDelegate.willDeletePath&&cr.trackingDelegate.willDeletePath(e)}catch(r){m("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+r.message)}r.node_ops.unlink(r,t),cr.destroyNode(n);try{cr.trackingDelegate.onDeletePath&&cr.trackingDelegate.onDeletePath(e)}catch(r){m("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+r.message)}},readlink:function(e){var r=cr.lookupPath(e).node;if(!r)throw new cr.ErrnoError(44);if(!r.node_ops.readlink)throw new cr.ErrnoError(28);return ar.resolve(cr.getPath(r.parent),r.node_ops.readlink(r))},stat:function(e,r){var t=cr.lookupPath(e,{follow:!r}).node;if(!t)throw new cr.ErrnoError(44);if(!t.node_ops.getattr)throw new cr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(e){return cr.stat(e,!0)},chmod:function(e,r,t){var n;if(!(n="string"==typeof e?cr.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new cr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,r){cr.chmod(e,r,!0)},fchmod:function(e,r){var t=cr.getStream(e);if(!t)throw new cr.ErrnoError(8);cr.chmod(t.node,r)},chown:function(e,r,t,n){var o;if(!(o="string"==typeof e?cr.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new cr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,r,t){cr.chown(e,r,t,!0)},fchown:function(e,r,t){var n=cr.getStream(e);if(!n)throw new cr.ErrnoError(8);cr.chown(n.node,r,t)},truncate:function(e,r){if(r<0)throw new cr.ErrnoError(28);var t;if(!(t="string"==typeof e?cr.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new cr.ErrnoError(63);if(cr.isDir(t.mode))throw new cr.ErrnoError(31);if(!cr.isFile(t.mode))throw new cr.ErrnoError(28);var n=cr.nodePermissions(t,"w");if(n)throw new cr.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:function(e,r){var t=cr.getStream(e);if(!t)throw new cr.ErrnoError(8);if(0==(2097155&t.flags))throw new cr.ErrnoError(28);cr.truncate(t.node,r)},utime:function(e,r,t){var n=cr.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:function(r,t,n,o,i){if(""===r)throw new cr.ErrnoError(44);var a;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?cr.modeStringToFlags(t):t)?4095&n|32768:0,"object"==typeof r)a=r;else{r=ir.normalize(r);try{a=cr.lookupPath(r,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new cr.ErrnoError(20)}else a=cr.mknod(r,n,0),s=!0;if(!a)throw new cr.ErrnoError(44);if(cr.isChrdev(a.mode)&&(t&=-513),65536&t&&!cr.isDir(a.mode))throw new cr.ErrnoError(54);if(!s){var u=cr.mayOpen(a,t);if(u)throw new cr.ErrnoError(u)}512&t&&cr.truncate(a,0),t&=-131713;var c=cr.createStream({node:a,path:cr.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},o,i);c.stream_ops.open&&c.stream_ops.open(c),!e.logReadFiles||1&t||(cr.readFiles||(cr.readFiles={}),r in cr.readFiles||(cr.readFiles[r]=1,m("FS.trackingDelegate error on read file: "+r)));try{if(cr.trackingDelegate.onOpenFile){var l=0;1!=(2097155&t)&&(l|=cr.tracking.openFlags.READ),0!=(2097155&t)&&(l|=cr.tracking.openFlags.WRITE),cr.trackingDelegate.onOpenFile(r,l)}}catch(e){m("FS.trackingDelegate['onOpenFile']('"+r+"', flags) threw an exception: "+e.message)}return c},close:function(e){if(cr.isClosed(e))throw new cr.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{cr.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,r,t){if(cr.isClosed(e))throw new cr.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new cr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new cr.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:function(e,r,t,n,o){if(n<0||o<0)throw new cr.ErrnoError(28);if(cr.isClosed(e))throw new cr.ErrnoError(8);if(1==(2097155&e.flags))throw new cr.ErrnoError(8);if(cr.isDir(e.node.mode))throw new cr.ErrnoError(31);if(!e.stream_ops.read)throw new cr.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new cr.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=a),a},write:function(e,r,t,n,o,i){if(n<0||o<0)throw new cr.ErrnoError(28);if(cr.isClosed(e))throw new cr.ErrnoError(8);if(0==(2097155&e.flags))throw new cr.ErrnoError(8);if(cr.isDir(e.node.mode))throw new cr.ErrnoError(31);if(!e.stream_ops.write)throw new cr.ErrnoError(28);e.seekable&&1024&e.flags&&cr.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new cr.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,i);a||(e.position+=s);try{e.path&&cr.trackingDelegate.onWriteToFile&&cr.trackingDelegate.onWriteToFile(e.path)}catch(r){m("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+r.message)}return s},allocate:function(e,r,t){if(cr.isClosed(e))throw new cr.ErrnoError(8);if(r<0||t<=0)throw new cr.ErrnoError(28);if(0==(2097155&e.flags))throw new cr.ErrnoError(8);if(!cr.isFile(e.node.mode)&&!cr.isDir(e.node.mode))throw new cr.ErrnoError(43);if(!e.stream_ops.allocate)throw new cr.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:function(e,r,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new cr.ErrnoError(2);if(1==(2097155&e.flags))throw new cr.ErrnoError(2);if(!e.stream_ops.mmap)throw new cr.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o,i)},msync:function(e,r,t,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},munmap:function(e){return 0},ioctl:function(e,r,t){if(!e.stream_ops.ioctl)throw new cr.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:function(e,r){if((r=r||{}).flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var t,n=cr.open(e,r.flags),o=cr.stat(e).size,i=new Uint8Array(o);return cr.read(n,i,0,o,0),"utf8"===r.encoding?t=w(i,0):"binary"===r.encoding&&(t=i),cr.close(n),t},writeFile:function(e,r,t){(t=t||{}).flags=t.flags||577;var n=cr.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(k(r)+1),i=_(r,o,0,o.length);cr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");cr.write(n,r,0,r.byteLength,void 0,t.canOwn)}cr.close(n)},cwd:function(){return cr.currentPath},chdir:function(e){var r=cr.lookupPath(e,{follow:!0});if(null===r.node)throw new cr.ErrnoError(44);if(!cr.isDir(r.node.mode))throw new cr.ErrnoError(54);var t=cr.nodePermissions(r.node,"x");if(t)throw new cr.ErrnoError(t);cr.currentPath=r.path},createDefaultDirectories:function(){cr.mkdir("/tmp"),cr.mkdir("/home"),cr.mkdir("/home/web_user")},createDefaultDevices:function(){cr.mkdir("/dev"),cr.registerDevice(cr.makedev(1,3),{read:function(){return 0},write:function(e,r,t,n,o){return n}}),cr.mkdev("/dev/null",cr.makedev(1,3)),sr.register(cr.makedev(5,0),sr.default_tty_ops),sr.register(cr.makedev(6,0),sr.default_tty1_ops),cr.mkdev("/dev/tty",cr.makedev(5,0)),cr.mkdev("/dev/tty1",cr.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}try{var r=t(85);return function(){return r.randomBytes(1)[0]}}catch(e){}return function(){K("randomDevice")}}();cr.createDevice("/dev","random",e),cr.createDevice("/dev","urandom",e),cr.mkdir("/dev/shm"),cr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){cr.mkdir("/proc");var e=cr.mkdir("/proc/self");cr.mkdir("/proc/self/fd"),cr.mount({mount:function(){var r=cr.createNode(e,"fd",16895,73);return r.node_ops={lookup:function(e,r){var t=+r,n=cr.getStream(t);if(!n)throw new cr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams:function(){e.stdin?cr.createDevice("/dev","stdin",e.stdin):cr.symlink("/dev/tty","/dev/stdin"),e.stdout?cr.createDevice("/dev","stdout",null,e.stdout):cr.symlink("/dev/tty","/dev/stdout"),e.stderr?cr.createDevice("/dev","stderr",null,e.stderr):cr.symlink("/dev/tty1","/dev/stderr"),cr.open("/dev/stdin",0),cr.open("/dev/stdout",1),cr.open("/dev/stderr",1)},ensureErrnoError:function(){cr.ErrnoError||(cr.ErrnoError=function(e,r){this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},cr.ErrnoError.prototype=new Error,cr.ErrnoError.prototype.constructor=cr.ErrnoError,[44].forEach((function(e){cr.genericErrors[e]=new cr.ErrnoError(e),cr.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){cr.ensureErrnoError(),cr.nameTable=new Array(4096),cr.mount(ur,{},"/"),cr.createDefaultDirectories(),cr.createDefaultDevices(),cr.createSpecialDirectories(),cr.filesystems={MEMFS:ur}},init:function(r,t,n){cr.init.initialized=!0,cr.ensureErrnoError(),e.stdin=r||e.stdin,e.stdout=t||e.stdout,e.stderr=n||e.stderr,cr.createStandardStreams()},quit:function(){cr.init.initialized=!1;var r=e._fflush;r&&r(0);for(var t=0;t<cr.streams.length;t++){var n=cr.streams[t];n&&cr.close(n)}},getMode:function(e,r){var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:function(e,r){var t=cr.analyzePath(e,r);return t.exists?t.object:null},analyzePath:function(e,r){try{e=(n=cr.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=cr.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=ir.basename(e),n=cr.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath:function(e,r,t,n){e="string"==typeof e?e:cr.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ir.join2(e,i);try{cr.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,r,t,n,o){var i=ir.join2("string"==typeof e?e:cr.getPath(e),r),a=cr.getMode(n,o);return cr.create(i,a)},createDataFile:function(e,r,t,n,o,i){var a=r?ir.join2("string"==typeof e?e:cr.getPath(e),r):e,s=cr.getMode(n,o),u=cr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),l=0,f=t.length;l<f;++l)c[l]=t.charCodeAt(l);t=c}cr.chmod(u,146|s);var d=cr.open(u,577);cr.write(d,t,0,t.length,0,i),cr.close(d),cr.chmod(u,s)}return u},createDevice:function(e,r,t,n){var o=ir.join2("string"==typeof e?e:cr.getPath(e),r),i=cr.getMode(!!t,!!n);cr.createDevice.major||(cr.createDevice.major=64);var a=cr.makedev(cr.createDevice.major++,0);return cr.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,r,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new cr.ErrnoError(29)}if(void 0===u&&0===a)throw new cr.ErrnoError(6);if(null==u)break;a++,r[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,r,t,o,i){for(var a=0;a<o;a++)try{n(r[t+a])}catch(e){throw new cr.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),cr.mkdev(o,i,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=gr(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new cr.ErrnoError(29)}},createLazyFile:function(e,r,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,i=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,a=1048576;o||(a=n);var s=this;s.setDataGetter((function(e){var r=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,r){if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+r),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):gr(o.responseText||"",!0)}(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,h("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,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 a={isDevice:!1,url:t},s=cr.createFile(e,r,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach((function(e){var r=s.stream_ops[e];u[e]=function(){return cr.forceLoadFile(s),r.apply(null,arguments)}})),u.read=function(e,r,t,n,o){cr.forceLoadFile(s);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)r[t+u]=i[o+u];else for(u=0;u<a;u++)r[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,t,n,o,i,a,s,u,c,l){Browser.init();var f=t?ar.resolve(ir.join2(r,t)):r;function d(n){function d(e){l&&l(),u||cr.createDataFile(r,t,e,o,i,c),a&&a(),J()}var p=!1;e.preloadPlugins.forEach((function(e){p||e.canHandle(f)&&(e.handle(n,f,d,(function(){s&&s(),J()})),p=!0)})),p||d(n)}X(),"string"==typeof n?Browser.asyncLoad(n,(function(e){d(e)}),s):d(n)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,r,t){r=r||function(){},t=t||function(){};var n=cr.indexedDB();try{var o=n.open(cr.DB_NAME(),cr.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=function(){h("creating db"),o.result.createObjectStore(cr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([cr.DB_STORE_NAME],"readwrite"),i=n.objectStore(cr.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?r():t()}e.forEach((function(e){var r=i.put(cr.analyzePath(e).object.contents,e);r.onsuccess=function(){++a+s==u&&c()},r.onerror=function(){s++,a+s==u&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:function(e,r,t){r=r||function(){},t=t||function(){};var n=cr.indexedDB();try{var o=n.open(cr.DB_NAME(),cr.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([cr.DB_STORE_NAME],"readonly")}catch(e){return void t(e)}var a=i.objectStore(cr.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?r():t()}e.forEach((function(e){var r=a.get(e);r.onsuccess=function(){cr.analyzePath(e).exists&&cr.unlink(e),cr.createDataFile(ir.dirname(e),ir.basename(e),r.result,!0,!0,!0),++s+u==c&&l()},r.onerror=function(){u++,s+u==c&&l()}})),i.onerror=t},o.onerror=t}},lr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,r,t){if("/"===r[0])return r;var n;if(-100===e)n=cr.cwd();else{var o=cr.getStream(e);if(!o)throw new cr.ErrnoError(8);n=o.path}if(0==r.length){if(!t)throw new cr.ErrnoError(44);return n}return ir.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&ir.normalize(r)!==ir.normalize(cr.getPath(e.node)))return-54;throw e}return S[t>>2]=n.dev,S[t+4>>2]=0,S[t+8>>2]=n.ino,S[t+12>>2]=n.mode,S[t+16>>2]=n.nlink,S[t+20>>2]=n.uid,S[t+24>>2]=n.gid,S[t+28>>2]=n.rdev,S[t+32>>2]=0,re=[n.size>>>0,(ee=n.size,+Math.abs(ee)>=1?ee>0?(0|Math.min(+Math.floor(ee/4294967296),4294967295))>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],S[t+40>>2]=re[0],S[t+44>>2]=re[1],S[t+48>>2]=4096,S[t+52>>2]=n.blocks,S[t+56>>2]=n.atime.getTime()/1e3|0,S[t+60>>2]=0,S[t+64>>2]=n.mtime.getTime()/1e3|0,S[t+68>>2]=0,S[t+72>>2]=n.ctime.getTime()/1e3|0,S[t+76>>2]=0,re=[n.ino>>>0,(ee=n.ino,+Math.abs(ee)>=1?ee>0?(0|Math.min(+Math.floor(ee/4294967296),4294967295))>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],S[t+80>>2]=re[0],S[t+84>>2]=re[1],0},doMsync:function(e,r,t,n,o){var i=T.slice(e,e+t);cr.msync(r,i,o,t,n)},doMkdir:function(e,r){return"/"===(e=ir.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),cr.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return cr.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-28;var n=cr.readlink(e),o=Math.min(t,k(n)),i=P[r+o];return b(n,r,t+1),P[r+o]=i,o},doAccess:function(e,r){if(-8&r)return-28;var t;if(!(t=cr.lookupPath(e,{follow:!0}).node))return-44;var n="";return 4&r&&(n+="r"),2&r&&(n+="w"),1&r&&(n+="x"),n&&cr.nodePermissions(t,n)?-2:0},doDup:function(e,r,t){var n=cr.getStream(t);return n&&cr.close(n),cr.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var o=0,i=0;i<t;i++){var a=S[r+8*i>>2],s=S[r+(8*i+4)>>2],u=cr.read(e,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(e,r,t,n){for(var o=0,i=0;i<t;i++){var a=S[r+8*i>>2],s=S[r+(8*i+4)>>2],u=cr.write(e,P,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return lr.varargs+=4,S[lr.varargs-4>>2]},getStr:function(e){return E(e)},getStreamFromFD:function(e){var r=cr.getStream(e);if(!r)throw new cr.ErrnoError(8);return r},get64:function(e,r){return e}};function fr(e){return e%4==0&&(e%100!=0||e%400==0)}function dr(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}var pr=[31,29,31,30,31,30,31,31,30,31,30,31],hr=[31,28,31,30,31,30,31,31,30,31,30,31];function mr(e,r){for(var t=new Date(e.getTime());r>0;){var n=fr(t.getFullYear()),o=t.getMonth(),i=(n?pr:hr)[o];if(!(r>i-t.getDate()))return t.setDate(t.getDate()+r),t;r-=i-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}!function(){for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);ae=e}(),he=e.BindingError=pe(Error,"BindingError"),ve=e.InternalError=pe(Error,"InternalError"),Ce.prototype.isAliasOf=function(e){if(!(this instanceof Ce))return!1;if(!(e instanceof Ce))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},Ce.prototype.clone=function(){if(this.$$.ptr||Ee(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=De(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},Ce.prototype.delete=function(){this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),be(this),ke(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Ce.prototype.isDeleted=function(){return!this.$$.ptr},Ce.prototype.deleteLater=function(){return this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),Te.push(this),1===Te.length&&Pe&&Pe(Fe),this.$$.deleteScheduled=!0,this},We.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},We.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},We.prototype.argPackAdvance=8,We.prototype.readValueFromPointer=je,We.prototype.deleteObject=function(e){null!==e&&e.delete()},We.prototype.fromWireType=function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=function(e,r){return r=function(e,r){for(void 0===r&&me("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}(e,r),ze[r]}(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ne(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ne(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(r),s=Se[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Be(r,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Ne(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):Ne(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},e.getInheritedInstanceCount=function(){return Object.keys(ze).length},e.getLiveInheritedInstances=function(){var e=[];for(var r in ze)ze.hasOwnProperty(r)&&e.push(ze[r]);return e},e.flushPendingDeletes=Fe,e.setDelayFunction=function(e){Pe=e,Te.length&&Pe&&Pe(Fe)},Le=e.UnboundTypeError=pe(Error,"UnboundTypeError"),e.count_emval_handles=function(){for(var e=0,r=5;r<Xe.length;++r)void 0!==Xe[r]&&++e;return e},e.get_first_emval=function(){for(var e=5;e<Xe.length;++e)if(void 0!==Xe[e])return Xe[e];return null};var vr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=cr.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function gr(e,r,t){var n=t>0?t:k(e)+1,o=new Array(n),i=_(e,o,0,o.length);return r&&(o.length=i),o}Object.defineProperties(vr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return cr.isDir(this.mode)}},isDevice:{get:function(){return cr.isChrdev(this.mode)}}}),cr.FSNode=vr,cr.staticInit();var yr,wr={B:function(e){return Er(e+16)+16},A:function(e,r,t){throw new oe(e).init(r,t),e},z:function(e,r,t,n,o){var i=ie(t);we(e,{name:r=se(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===t)n=P;else if(2===t)n=F;else{if(4!==t)throw new TypeError("Unknown boolean type size: "+r);n=S}return this.fromWireType(n[e>>i])},destructorFunction:null})},m:function(r,t,n,o,i,a,s,u,c,l,f,d,p){f=se(f),a=Ue(i,a),u&&(u=Ue(s,u)),l&&(l=Ue(c,l)),p=Ue(d,p);var h=fe(f);!function(r,t,n){e.hasOwnProperty(r)?(me("Cannot register public name '"+r+"' twice"),Ae(e,r,r),e.hasOwnProperty(n)&&me("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),e[r].overloadTable[void 0]=t):e[r]=t}(h,(function(){Ye("Cannot construct "+f+" due to unbound types",[o])})),ye([r,t,n],o?[o]:[],(function(t){var n,i;t=t[0],i=o?(n=t.registeredClass).instancePrototype:Ce.prototype;var s=de(h,(function(){if(Object.getPrototypeOf(this)!==c)throw new he("Use 'new' to construct "+f);if(void 0===d.constructor_body)throw new he(f+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new he("Tried to invoke ctor of "+f+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(i,{constructor:{value:s}});s.prototype=c;var d=new $e(f,s,c,p,n,a,u,l),m=new We(f,d,!0,!1,!1),v=new We(f+"*",d,!1,!1,!1),g=new We(f+" const*",d,!1,!0,!1);return Se[r]={pointerType:v,constPointerType:g},function(r,t,n){e.hasOwnProperty(r)||ge("Replacing nonexistant public symbol"),e[r].overloadTable,e[r]=t,e[r].argCount=n}(h,s),[m,v,g]}))},l:function(e,r,t,n,o,i){g(r>0);var a=Ve(r,t);o=Ue(n,o);var s=[i],u=[];ye([],[e],(function(e){var t="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new he("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[r-1]=function(){Ye("Cannot construct "+e.name+" due to unbound types",a)},ye([],a,(function(n){return e.registeredClass.constructor_body[r-1]=function(){arguments.length!==r-1&&me(t+" called with "+arguments.length+" arguments, expected "+(r-1)),u.length=0,s.length=r;for(var e=1;e<r;++e)s[e]=n[e].toWireType(u,arguments[e-1]);var i=o.apply(null,s);return qe(u),n[0].fromWireType(i)},[]})),[]}))},c:function(e,r,t,n,o,i,a,s){var u=Ve(t,n);r=se(r),i=Ue(o,i),ye([],[e],(function(e){var n=(e=e[0]).name+"."+r;function o(){Ye("Cannot call "+n+" due to unbound types",u)}s&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,l=c[r];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===t-2?(o.argCount=t-2,o.className=e.name,c[r]=o):(Ae(c,r,n),c[r].overloadTable[t-2]=o),ye([],u,(function(o){var s=function(e,r,t,n,o){var i=r.length;i<2&&me("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==r[1]&&null!==t,s=!1,u=1;u<r.length;++u)if(null!==r[u]&&void 0===r[u].destructorFunction){s=!0;break}var c="void"!==r[0].name,l="",f="";for(u=0;u<i-2;++u)l+=(0!==u?", ":"")+"arg"+u,f+=(0!==u?", ":"")+"arg"+u+"Wired";var d="return function "+fe(e)+"("+l+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var p=s?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[me,n,o,qe,r[0],r[1]];for(a&&(d+="var thisWired = classParam.toWireType("+p+", this);\n"),u=0;u<i-2;++u)d+="var arg"+u+"Wired = argType"+u+".toWireType("+p+", arg"+u+"); // "+r[u+2].name+"\n",h.push("argType"+u),m.push(r[u+2]);if(a&&(f="thisWired"+(f.length>0?", ":"")+f),d+=(c?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",s)d+="runDestructors(destructors);\n";else for(u=a?1:2;u<r.length;++u){var v=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==r[u].destructorFunction&&(d+=v+"_dtor("+v+"); // "+r[u].name+"\n",h.push(v+"_dtor"),m.push(r[u].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",h.push(d),function(e,r){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var t=de(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}(Function,h).apply(null,m)}(n,o,e,i,a);return void 0===c[r].overloadTable?(s.argCount=t-2,c[r]=s):c[r].overloadTable[t-2]=s,[]})),[]}))},y:function(e,r){we(e,{name:r=se(r),fromWireType:function(e){var r=Xe[e].value;return Je(e),r},toWireType:function(e,r){return Ke(r)},argPackAdvance:8,readValueFromPointer:je,destructorFunction:null})},i:function(e,r,t){var n=ie(t);we(e,{name:r=se(r),fromWireType:function(e){return e},toWireType:function(e,r){if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError('Cannot convert "'+Ze(r)+'" to '+this.name);return r},argPackAdvance:8,readValueFromPointer:Qe(r,n),destructorFunction:null})},b:function(e,r,t,n,o){r=se(r),-1===o&&(o=4294967295);var i=ie(t),a=function(e){return e};if(0===n){var s=32-8*t;a=function(e){return e<<s>>>s}}var u=-1!=r.indexOf("unsigned");we(e,{name:r,fromWireType:a,toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Ze(t)+'" to '+this.name);if(t<n||t>o)throw new TypeError('Passing a number "'+Ze(t)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+n+", "+o+"]!");return u?t>>>0:0|t},argPackAdvance:8,readValueFromPointer:er(r,i,0!==n),destructorFunction:null})},a:function(e,r,t){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=A,t=r[e>>=2],o=r[e+1];return new n(D,o,t)}we(e,{name:t=se(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},j:function(e,r){var t="std::string"===(r=se(r));we(e,{name:r,fromWireType:function(e){var r,n=A[e>>2];if(t)for(var o=e+4,i=0;i<=n;++i){var a=e+4+i;if(i==n||0==T[a]){var s=E(o,a-o);void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),o=a+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(T[e+4+i]);r=u.join("")}return _r(e),r},toWireType:function(e,r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||me("Cannot pass non-string to std::string");var o=(t&&n?function(){return k(r)}:function(){return r.length})(),i=Er(4+o+1);if(A[i>>2]=o,t&&n)b(r,i+4,o+1);else if(n)for(var a=0;a<o;++a){var s=r.charCodeAt(a);s>255&&(_r(i),me("String has UTF-16 code units that do not fit in 8 bits")),T[i+4+a]=s}else for(a=0;a<o;++a)T[i+4+a]=r[a];return null!==e&&e.push(_r,i),i},argPackAdvance:8,readValueFromPointer:je,destructorFunction:function(e){_r(e)}})},e:function(e,r,t){var n,o,i,a,s;t=se(t),2===r?(n=x,o=R,a=j,i=function(){return C},s=1):4===r&&(n=B,o=z,a=N,i=function(){return A},s=2),we(e,{name:t,fromWireType:function(e){for(var t,o=A[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var l=e+4+c*r;if(c==o||0==a[l>>s]){var f=n(u,l-u);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),u=l+r}}return _r(e),t},toWireType:function(e,n){"string"!=typeof n&&me("Cannot pass non-string to C++ string type "+t);var i=a(n),u=Er(4+i+r);return A[u>>2]=i>>s,o(n,u+4,i+r),null!==e&&e.push(_r,u),u},argPackAdvance:8,readValueFromPointer:je,destructorFunction:function(e){_r(e)}})},k:function(e,r){we(e,{isVoid:!0,name:r=se(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})},o:function(e,r,t,n){e=function(e){return e||me("Cannot use deleted val. handle = "+e),Xe[e].value}(e);for(var o=function(e,r){for(var t=new Array(e),n=0;n<e;++n)t[n]=rr(S[(r>>2)+n],"parameter "+n);return t}(r,t),i=new Array(r),a=0;a<r;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}return Ke(e.apply(void 0,i))},d:Je,f:function(e){e>4&&(Xe[e].refcount+=1)},n:function(e,r){return Ke((e=rr(e,"_emval_take_value")).readValueFromPointer(r))},g:function(){K()},r:function(e,r,t){T.copyWithin(e,r,r+t)},s:function(e){var r,t=T.length,n=2147483648;if(e>n)return!1;for(var o=1;o<=4;o*=2){var i=t*(1+.2/o);if(i=Math.min(i,e+100663296),tr(Math.min(n,((r=Math.max(e,i))%65536>0&&(r+=65536-r%65536),r))))return!0}return!1},u:function(e,r){try{var t=0;return or().forEach((function(n,o){var i=r+t;S[e+4*o>>2]=i,function(e,r,t){for(var n=0;n<e.length;++n)P[r++>>0]=e.charCodeAt(n);P[r>>0]=0}(n,i),t+=n.length+1})),0}catch(e){return void 0!==cr&&e instanceof cr.ErrnoError||K(e),e.errno}},v:function(e,r){try{var t=or();S[e>>2]=t.length;var n=0;return t.forEach((function(e){n+=e.length+1})),S[r>>2]=n,0}catch(e){return void 0!==cr&&e instanceof cr.ErrnoError||K(e),e.errno}},w:function(e){try{var r=lr.getStreamFromFD(e);return cr.close(r),0}catch(e){return void 0!==cr&&e instanceof cr.ErrnoError||K(e),e.errno}},x:function(e,r,t,n){try{var o=lr.getStreamFromFD(e),i=lr.doReadv(o,r,t);return S[n>>2]=i,0}catch(e){return void 0!==cr&&e instanceof cr.ErrnoError||K(e),e.errno}},p:function(e,r,t,n,o){try{var i=lr.getStreamFromFD(e),a=4294967296*t+(r>>>0),s=9007199254740992;return a<=-s||a>=s?-61:(cr.llseek(i,a,n),re=[i.position>>>0,(ee=i.position,+Math.abs(ee)>=1?ee>0?(0|Math.min(+Math.floor(ee/4294967296),4294967295))>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],S[o>>2]=re[0],S[o+4>>2]=re[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(e){return void 0!==cr&&e instanceof cr.ErrnoError||K(e),e.errno}},h:function(e,r,t,n){try{var o=lr.getStreamFromFD(e),i=lr.doWritev(o,r,t);return S[n>>2]=i,0}catch(e){return void 0!==cr&&e instanceof cr.ErrnoError||K(e),e.errno}},q:function(e){},t:function(e,r,t,n){return function(e,r,t,n){var o=S[n+40>>2],i={tm_sec:S[n>>2],tm_min:S[n+4>>2],tm_hour:S[n+8>>2],tm_mday:S[n+12>>2],tm_mon:S[n+16>>2],tm_year:S[n+20>>2],tm_wday:S[n+24>>2],tm_yday:S[n+28>>2],tm_isdst:S[n+32>>2],tm_gmtoff:S[n+36>>2],tm_zone:o?E(o):""},a=E(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function d(e,r){return f(e,r,"0")}function p(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var r=mr(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=h(t),i=h(n);return p(o,r)<=0?p(i,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var v={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),d(r,2)},"%j":function(e){return d(e.tm_mday+dr(fr(e.tm_year+1900)?pr:hr,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var r=new Date(e.tm_year+1900,0,1),t=0===r.getDay()?r:mr(r,7-r.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(p(t,n)<0){var o=dr(fr(n.getFullYear())?pr:hr,n.getMonth()-1)-31,i=31-t.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===p(t,r)?"01":"00"},"%V":function(e){var r,t=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=h(t),i=h(n),a=mr(new Date(e.tm_year+1900,0,1),e.tm_yday);return p(a,o)<0?"53":p(i,a)<=0?"01":(r=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),d(Math.ceil(r/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var r=new Date(e.tm_year,0,1),t=1===r.getDay()?r:mr(r,0===r.getDay()?1:7-r.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(p(t,n)<0){var o=dr(fr(n.getFullYear())?pr:hr,n.getMonth()-1)-31,i=31-t.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===p(t,r)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in v)a.indexOf(u)>=0&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var g=gr(a,!1);return g.length>r?0:(function(e,r){P.set(e,r)}(g,e),g.length-1)}(e,r,t,n)}},Er=(function(){var r={a:wr};function t(r,t){var n,o=r.exports;e.asm=o,W((p=e.asm.C).buffer),I=e.asm.G,n=e.asm.D,L.unshift(n),J()}function o(e){t(e.instance)}function i(e){return Promise.resolve().then((function(){return function(e){try{if(e==te&&d)return new Uint8Array(d);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){K(e)}}(te)})).then((function(e){return WebAssembly.instantiate(e,r)})).then(e,(function(e){m("failed to asynchronously prepare wasm: "+e),K(e)}))}if(X(),e.instantiateWasm)try{return e.instantiateWasm(r,t)}catch(e){return m("Module.instantiateWasm callback failed with error: "+e),!1}(d||"function"!=typeof WebAssembly.instantiateStreaming||Z(te)||"function"!=typeof fetch?i(o):fetch(te,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return m("wasm streaming compile failed: "+e),m("falling back to ArrayBuffer instantiation"),i(o)}))}))).catch(n)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.D).apply(null,arguments)},e._malloc=function(){return(Er=e._malloc=e.asm.E).apply(null,arguments)}),_r=e._free=function(){return(_r=e._free=e.asm.F).apply(null,arguments)},br=e.___getTypeName=function(){return(br=e.___getTypeName=e.asm.H).apply(null,arguments)};function kr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Dr(t){function n(){yr||(yr=!0,e.calledRun=!0,v||(e.noFSInit||cr.init.initialized||cr.init(),sr.init(),ne(L),cr.ignorePermissions=!1,ne(H),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)r=e.postRun.shift(),Y.unshift(r);var r;ne(Y)}()))}t=t||l,V>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)r=e.preRun.shift(),U.unshift(r);var r;ne(U)}(),V>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),n()}),1)):n()))}if(e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.I).apply(null,arguments)},e.dynCall_viijii=function(){return(e.dynCall_viijii=e.asm.J).apply(null,arguments)},e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.K).apply(null,arguments)},e.dynCall_iiiiij=function(){return(e.dynCall_iiiiij=e.asm.L).apply(null,arguments)},e.dynCall_iiiiijj=function(){return(e.dynCall_iiiiijj=e.asm.M).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return(e.dynCall_iiiiiijj=e.asm.N).apply(null,arguments)},G=function e(){yr||Dr(),yr||(G=e)},e.run=Dr,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return Dr(),e.ready});e.exports=n},85:()=>{},351:()=>{},606:()=>{}}]);