Newer
Older
safe_production_front / public / js / jessibuca-pro-occlusion-detector-demo.js
dutingting on 8 Apr 76 KB 暂存
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r=e(t((function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}))),n=t((function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),o=e(n),i=t((function(e){var t=n.default;e.exports=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}));e(i);var a=t((function(e){var t=n.default;e.exports=function(e){var r=i(e,"string");return"symbol"===t(r)?r:String(r)},e.exports.__esModule=!0,e.exports.default=e.exports}));e(a);var s=e(t((function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}))),u=t((function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports})),c=e(u),f=t((function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}));e(f);var l,d=e(t((function(e){e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports}))),p=t((function(e){var t=n.default;e.exports=function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return u(e)},e.exports.__esModule=!0,e.exports.default=e.exports})),h=e(p),m=t((function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),v=e(m),y=(l="undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("jessibuca-pro-occlusion-detector-demo.js",document.baseURI).href,function(e){var t,r;(e=void 0!==(e=e||{})?e:{}).ready=new Promise((function(e,n){t=e,r=n})),(e=void 0!==e?e:{}).locateFile=function(e){return"jessibuca-pro-occlusion-detector-decoder.wasm"==e&&"undefined"!=typeof JESSIBUCA_PRO_OCCLUSION_DETECTOR_WASM_URL&&""!=JESSIBUCA_PRO_OCCLUSION_DETECTOR_WASM_URL?JESSIBUCA_PRO_OCCLUSION_DETECTOR_WASM_URL:e};var n,i,a,s,u,c,f=Object.assign({},e),d="./this.program",p="object"==("undefined"==typeof window?"undefined":o(window)),h="function"==typeof importScripts,m="object"==("undefined"==typeof process?"undefined":o(process))&&"object"==o(process.versions)&&"string"==typeof process.versions.node,v="";m?(v=h?require("path").dirname(v)+"/":__dirname+"/",c=function(){u||(s=require("fs"),u=require("path"))},n=function(e,t){return c(),e=u.normalize(e),s.readFileSync(e,t?void 0:"utf8")},a=function(e){var t=n(e,!0);return t.buffer||(t=new Uint8Array(t)),t},i=function(e,t,r){c(),e=u.normalize(e),s.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ee))throw e})),process.on("unhandledRejection",(function(e){throw e})),e.inspect=function(){return"[Emscripten Module object]"}):(p||h)&&(h?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),l&&(v=l),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},h&&(a=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),i=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var y,w,g=e.print||console.log.bind(console),_=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.arguments&&e.arguments,e.thisProgram&&(d=e.thisProgram),e.quit&&e.quit,e.wasmBinary&&(y=e.wasmBinary),e.noExitRuntime,"object"!=("undefined"==typeof WebAssembly?"undefined":o(WebAssembly))&&V("no native wasm support detected");var E=!1;function b(e,t){e||V(t)}var k,P,T,S,D,C,A,F,M,O,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function j(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&x)return x.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<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,t){return e?j(T,e,t):""}function R(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+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(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function N(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t}e.INITIAL_MEMORY;var B=[],U=[],z=[],I=0,L=null;function W(t){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function H(t){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&L){var r=L;L=null,r()}}function V(t){e.onAbort&&e.onAbort(t),_(t="Aborted("+t+")"),E=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw r(n),n}var q,Y,G,J,X="data:application/octet-stream;base64,";function K(e){return e.startsWith(X)}function Z(e){return e.startsWith("file://")}function Q(e){try{if(e==q&&y)return new Uint8Array(y);if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){V(e)}}function ee(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function te(t){for(;t.length>0;)t.shift()(e)}function re(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){A[this.ptr+4>>2]=e},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(e){A[this.ptr+8>>2]=e},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_refcount=function(e){C[this.ptr>>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,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=C[this.ptr>>2];C[this.ptr>>2]=e+1},this.release_ref=function(){var e=C[this.ptr>>2];return C[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){A[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Xt(this.get_type()))return A[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function ne(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)}}e.locateFile?K(q="jessibuca-pro-occlusion-detector-decoder.wasm")||(Y=q,q=e.locateFile?e.locateFile(Y,v):v+Y):q=new URL("jessibuca-pro-occlusion-detector-decoder.wasm","undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("jessibuca-pro-occlusion-detector-demo.js",document.baseURI).href).toString();var oe=void 0;function ie(e){for(var t="",r=e;T[r];)t+=oe[T[r++]];return t}var ae={},se={},ue={},ce=48,fe=57;function le(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=ce&&t<=fe?"_"+e:e}function de(e,t){return e=le(e),new Function("body","return function "+e+'() {\n    "use strict";    return body.apply(this, arguments);\n};\n')(t)}function pe(e,t){var r=de(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var he=void 0;function me(e){throw new he(e)}var ve=void 0;function ye(e){throw new ve(e)}function we(e,t,r){function n(t){var n=r(t);n.length!==e.length&&ye("Mismatched type converter count");for(var o=0;o<e.length;++o)ge(e[o],n[o])}e.forEach((function(e){ue[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){se.hasOwnProperty(e)?o[t]=se[e]:(i.push(e),ae.hasOwnProperty(e)||(ae[e]=[]),ae[e].push((function(){o[t]=se[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function ge(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||me('type "'+n+'" must have a positive integer typeid pointer'),se.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;me("Cannot register type '"+n+"' twice")}if(se[e]=t,delete ue[e],ae.hasOwnProperty(e)){var o=ae[e];delete ae[e],o.forEach((function(e){return e()}))}}function _e(e){if(!(this instanceof Le))return!1;if(!(e instanceof Le))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function Ee(e){me(e.$$.ptrType.registeredClass.name+" instance already deleted")}var be=!1;function ke(e){}function Pe(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 Te(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=Te(e,t,r.baseClass);return null===n?null:r.downcast(n)}var Se={};function De(){return Object.keys(xe).length}function Ce(){var e=[];for(var t in xe)xe.hasOwnProperty(t)&&e.push(xe[t]);return e}var Ae=[];function Fe(){for(;Ae.length;){var e=Ae.pop();e.$$.deleteScheduled=!1,e.delete()}}var Me=void 0;function Oe(e){Me=e,Ae.length&&Me&&Me(Fe)}var xe={};function je(e,t){return t=function(e,t){for(void 0===t&&me("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),xe[t]}function $e(e,t){return t.ptrType&&t.ptr||ye("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&ye("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ne(Object.create(e,{$$:{value:t}}))}function Re(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=je(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?$e(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):$e(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Se[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Te(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?$e(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):$e(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function Ne(e){return"undefined"==typeof FinalizationRegistry?(Ne=function(e){return e},e):(be=new FinalizationRegistry((function(e){Pe(e.$$)})),Ne=function(e){var t=e.$$;if(t.smartPtr){var r={$$:t};be.register(e,r,e)}return e},ke=function(e){return be.unregister(e)},Ne(e))}function Be(){if(this.$$.ptr||Ee(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Ne(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 t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Ue(){this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),ke(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function ze(){return!this.$$.ptr}function Ie(){return this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&me("Object already scheduled for deletion"),Ae.push(this),1===Ae.length&&Me&&Me(Fe),this.$$.deleteScheduled=!0,this}function Le(){}function We(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||me("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function He(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Ve(e,t,r){for(;t!==r;)t.upcast||me("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function qe(e,t){if(null===t)return this.isReference&&me("null is not a valid "+this.name),0;t.$$||me('Cannot pass "'+vt(t)+'" as a '+this.name),t.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Ve(t.$$.ptr,r,this.registeredClass)}function Ye(e,t){var r;if(null===t)return this.isReference&&me("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||me('Cannot pass "'+vt(t)+'" as a '+this.name),t.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&me("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=Ve(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&me("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:me("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,mt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:me("Unsupporting sharing policy")}return r}function Ge(e,t){if(null===t)return this.isReference&&me("null is not a valid "+this.name),0;t.$$||me('Cannot pass "'+vt(t)+'" as a '+this.name),t.$$.ptr||me("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&me("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Ve(t.$$.ptr,r,this.registeredClass)}function Je(e){return this.fromWireType(C[e>>2])}function Xe(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Ke(e){this.rawDestructor&&this.rawDestructor(e)}function Ze(e){null!==e&&e.delete()}function Qe(e,t,r,n,o,i,a,s,u,c,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==t.baseClass?this.toWireType=Ye:n?(this.toWireType=qe,this.destructorFunction=null):(this.toWireType=Ge,this.destructorFunction=null)}var et=[];function tt(e){var t=et[e];return t||(e>=et.length&&(et.length=e+1),et[e]=t=O.get(e)),t}function rt(t,r,n){return t.includes("j")?function(t,r,n){var o=e["dynCall_"+t];return n&&n.length?o.apply(null,[r].concat(n)):o.call(null,r)}(t,r,n):tt(r).apply(null,n)}function nt(e,t){var r,n,o,i=(e=ie(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),rt(r,n,o)}):tt(t);return"function"!=typeof i&&me("unknown function pointer with signature "+e+": "+t),i}var ot=void 0;function it(e){var t=Gt(e),r=ie(t);return Yt(t),r}function at(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||se[t]||(ue[t]?ue[t].forEach(e):(r.push(t),n[t]=!0))})),new ot(e+": "+r.map(it).join([", "]))}function st(e,t){for(var r=[],n=0;n<e;n++)r.push(A[t+4*n>>2]);return r}function ut(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function ct(e,t,r,n,i){var a=t.length;a<2&&me("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var f="void"!==t[0].name,l="",d="";for(c=0;c<a-2;++c)l+=(0!==c?", ":"")+"arg"+c,d+=(0!==c?", ":"")+"arg"+c+"Wired";var p="return function "+le(e)+"("+l+") {\nif (arguments.length !== "+(a-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(a-2)+" args!');\n}\n";u&&(p+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[me,n,i,ut,t[0],t[1]];for(s&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),c=0;c<a-2;++c)p+="var arg"+c+"Wired = argType"+c+".toWireType("+h+", arg"+c+"); // "+t[c+2].name+"\n",m.push("argType"+c),v.push(t[c+2]);if(s&&(d="thisWired"+(d.length>0?", ":"")+d),p+=(f?"var rv = ":"")+"invoker(fn"+(d.length>0?", ":"")+d+");\n",u)p+="runDestructors(destructors);\n";else for(c=s?1:2;c<t.length;++c){var y=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(p+=y+"_dtor("+y+"); // "+t[c].name+"\n",m.push(y+"_dtor"),v.push(t[c].destructorFunction))}return f&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+o(e)+" which is not a function");var r=de(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,i=e.apply(n,t);return i instanceof Object?i:n}(Function,m).apply(null,v)}var ft=[],lt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function dt(e){e>4&&0==--lt[e].refcount&&(lt[e]=void 0,ft.push(e))}function pt(){for(var e=0,t=5;t<lt.length;++t)void 0!==lt[t]&&++e;return e}function ht(){for(var e=5;e<lt.length;++e)if(void 0!==lt[e])return lt[e];return null}var mt={toValue:function(e){return e||me("Cannot use deleted val. handle = "+e),lt[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=ft.length?ft.pop():lt.length;return lt[t]={refcount:1,value:e},t}}};function vt(e){if(null===e)return"null";var t=o(e);return"object"===t||"array"===t||"function"===t?e.toString():""+e}function yt(e,t){switch(t){case 2:return function(e){return this.fromWireType(F[e>>2])};case 3:return function(e){return this.fromWireType(M[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function wt(e,t,r){switch(t){case 0:return r?function(e){return P[e]}:function(e){return T[e]};case 1:return r?function(e){return S[e>>1]}:function(e){return D[e>>1]};case 2:return r?function(e){return C[e>>2]}:function(e){return A[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var gt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function _t(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&D[n];)++n;if((r=n<<1)-e>32&&gt)return gt.decode(T.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=S[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function Et(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);S[t>>1]=a,t+=2}return S[t>>1]=0,t-n}function bt(e){return 2*e.length}function kt(e,t){for(var r=0,n="";!(r>=t/4);){var o=C[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function Pt(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-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)),C[t>>2]=a,(t+=4)+4>o)break}return C[t>>2]=0,t-n}function Tt(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}var St,Dt={};St=m?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Ct={};function At(){if(!At.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==("undefined"==typeof navigator?"undefined":o(navigator))&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var t in Ct)void 0===Ct[t]?delete e[t]:e[t]=Ct[t];var r=[];for(var t in e)r.push(t+"="+e[t]);At.strings=r}return At.strings}var Ft={isAbs:function(e){return"/"===e.charAt(0)},splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t=Ft.isAbs(e),r="/"===e.substr(-1);return(e=Ft.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=Ft.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=Ft.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return Ft.normalize(e.join("/"))},join2:function(e,t){return Ft.normalize(e+"/"+t)}},Mt={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Rt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=Ft.isAbs(n)}return(t?"/":"")+(e=Ft.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Mt.resolve(e).substr(1),t=Mt.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.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("/")}};function Ot(e,t,r){var n=r>0?r:N(e)+1,o=new Array(n),i=R(e,o,0,o.length);return t&&(o.length=i),o}var xt={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){xt.ttys[e]={input:[],output:[],ops:t},Rt.registerDevice(e,xt.stream_ops)},stream_ops:{open:function(e){var t=xt.ttys[e.node.rdev];if(!t)throw new Rt.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Rt.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 Rt.ErrnoError(29)}if(void 0===s&&0===i)throw new Rt.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Rt.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Rt.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(m){var r=Buffer.alloc(256),n=0;try{n=s.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=Ot(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(g(j(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(g(j(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(j(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(j(e.output,0)),e.output=[])}}};function jt(e){V()}var $t={ops_table:null,mount:function(e){return $t.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(Rt.isBlkdev(r)||Rt.isFIFO(r))throw new Rt.ErrnoError(63);$t.ops_table||($t.ops_table={dir:{node:{getattr:$t.node_ops.getattr,setattr:$t.node_ops.setattr,lookup:$t.node_ops.lookup,mknod:$t.node_ops.mknod,rename:$t.node_ops.rename,unlink:$t.node_ops.unlink,rmdir:$t.node_ops.rmdir,readdir:$t.node_ops.readdir,symlink:$t.node_ops.symlink},stream:{llseek:$t.stream_ops.llseek}},file:{node:{getattr:$t.node_ops.getattr,setattr:$t.node_ops.setattr},stream:{llseek:$t.stream_ops.llseek,read:$t.stream_ops.read,write:$t.stream_ops.write,allocate:$t.stream_ops.allocate,mmap:$t.stream_ops.mmap,msync:$t.stream_ops.msync}},link:{node:{getattr:$t.node_ops.getattr,setattr:$t.node_ops.setattr,readlink:$t.node_ops.readlink},stream:{}},chrdev:{node:{getattr:$t.node_ops.getattr,setattr:$t.node_ops.setattr},stream:Rt.chrdev_stream_ops}});var o=Rt.createNode(e,t,r,n);return Rt.isDir(o.mode)?(o.node_ops=$t.ops_table.dir.node,o.stream_ops=$t.ops_table.dir.stream,o.contents={}):Rt.isFile(o.mode)?(o.node_ops=$t.ops_table.file.node,o.stream_ops=$t.ops_table.file.stream,o.usedBytes=0,o.contents=null):Rt.isLink(o.mode)?(o.node_ops=$t.ops_table.link.node,o.stream_ops=$t.ops_table.link.stream):Rt.isChrdev(o.mode)&&(o.node_ops=$t.ops_table.chrdev.node,o.stream_ops=$t.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=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,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=Rt.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Rt.isDir(e.mode)?t.size=4096:Rt.isFile(e.mode)?t.size=e.usedBytes:Rt.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&$t.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Rt.genericErrors[44]},mknod:function(e,t,r,n){return $t.createNode(e,t,r,n)},rename:function(e,t,r){if(Rt.isDir(e.mode)){var n;try{n=Rt.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Rt.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=Rt.lookupNode(e,t);for(var n in r.contents)throw new Rt.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=$t.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!Rt.isLink(e.mode))throw new Rt.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,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)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if($t.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Rt.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Rt.ErrnoError(28);return n},allocate:function(e,t,r){$t.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!Rt.isFile(e.node.mode))throw new Rt.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==k){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=jt()))throw new Rt.ErrnoError(48);P.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!Rt.isFile(e.node.mode))throw new Rt.ErrnoError(43);return 2&o||$t.stream_ops.write(e,t,0,n,r,!1),0}}},Rt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(e=Mt.resolve(Rt.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Rt.ErrnoError(32);for(var r=Ft.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),n=Rt.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Rt.lookupNode(n,r[i]),o=Ft.join2(o,r[i]),Rt.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Rt.isLink(n.mode);){var u=Rt.readlink(o);if(o=Mt.resolve(Ft.dirname(o),u),n=Rt.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Rt.ErrnoError(32)}}return{path:o,node:n}},getPath:function(e){for(var t;;){if(Rt.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Rt.nameTable.length},hashAddNode:function(e){var t=Rt.hashName(e.parent.id,e.name);e.name_next=Rt.nameTable[t],Rt.nameTable[t]=e},hashRemoveNode:function(e){var t=Rt.hashName(e.parent.id,e.name);if(Rt.nameTable[t]===e)Rt.nameTable[t]=e.name_next;else for(var r=Rt.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=Rt.mayLookup(e);if(r)throw new Rt.ErrnoError(r,e);for(var n=Rt.hashName(e.id,t),o=Rt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Rt.lookup(e,t)},createNode:function(e,t,r,n){var o=new Rt.FSNode(e,t,r,n);return Rt.hashAddNode(o),o},destroyNode:function(e){Rt.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 t=Rt.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return Rt.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2},mayLookup:function(e){var t=Rt.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return Rt.lookupNode(e,t),20}catch(e){}return Rt.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=Rt.lookupNode(e,t)}catch(e){return e.errno}var o=Rt.nodePermissions(e,"wx");if(o)return o;if(r){if(!Rt.isDir(n.mode))return 54;if(Rt.isRoot(n)||Rt.getPath(n)===Rt.cwd())return 10}else if(Rt.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?Rt.isLink(e.mode)?32:Rt.isDir(e.mode)&&("r"!==Rt.flagsToPermissionString(t)||512&t)?31:Rt.nodePermissions(e,Rt.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rt.MAX_OPEN_FDS,r=e;r<=t;r++)if(!Rt.streams[r])return r;throw new Rt.ErrnoError(33)},getStream:function(e){return Rt.streams[e]},createStream:function(e,t,r){Rt.FSStream||(Rt.FSStream=function(){this.shared={}},Rt.FSStream.prototype={},Object.defineProperties(Rt.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}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new Rt.FSStream,e);var n=Rt.nextfd(t,r);return e.fd=n,Rt.streams[n]=e,e},closeStream:function(e){Rt.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=Rt.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new Rt.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){Rt.devices[e]={stream_ops:t}},getDevice:function(e){return Rt.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),Rt.syncFSRequests++,Rt.syncFSRequests>1&&_("warning: "+Rt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=Rt.getMounts(Rt.root.mount),n=0;function o(e){return Rt.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:function(e,t,r){var n,o="/"===r,i=!r;if(o&&Rt.root)throw new Rt.ErrnoError(10);if(!o&&!i){var a=Rt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Rt.isMountpoint(n))throw new Rt.ErrnoError(10);if(!Rt.isDir(n.mode))throw new Rt.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Rt.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var t=Rt.lookupPath(e,{follow_mount:!1});if(!Rt.isMountpoint(t.node))throw new Rt.ErrnoError(28);var r=t.node,n=r.mounted,o=Rt.getMounts(n);Object.keys(Rt.nameTable).forEach((function(e){for(var t=Rt.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Rt.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=Rt.lookupPath(e,{parent:!0}).node,o=Ft.basename(e);if(!o||"."===o||".."===o)throw new Rt.ErrnoError(28);var i=Rt.mayCreate(n,o);if(i)throw new Rt.ErrnoError(i);if(!n.node_ops.mknod)throw new Rt.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,Rt.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,Rt.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Rt.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,Rt.mknod(e,t,r)},symlink:function(e,t){if(!Mt.resolve(e))throw new Rt.ErrnoError(44);var r=Rt.lookupPath(t,{parent:!0}).node;if(!r)throw new Rt.ErrnoError(44);var n=Ft.basename(t),o=Rt.mayCreate(r,n);if(o)throw new Rt.ErrnoError(o);if(!r.node_ops.symlink)throw new Rt.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=Ft.dirname(e),i=Ft.dirname(t),a=Ft.basename(e),s=Ft.basename(t);if(r=Rt.lookupPath(e,{parent:!0}).node,n=Rt.lookupPath(t,{parent:!0}).node,!r||!n)throw new Rt.ErrnoError(44);if(r.mount!==n.mount)throw new Rt.ErrnoError(75);var u,c=Rt.lookupNode(r,a),f=Mt.relative(e,i);if("."!==f.charAt(0))throw new Rt.ErrnoError(28);if("."!==(f=Mt.relative(t,o)).charAt(0))throw new Rt.ErrnoError(55);try{u=Rt.lookupNode(n,s)}catch(e){}if(c!==u){var l=Rt.isDir(c.mode),d=Rt.mayDelete(r,a,l);if(d)throw new Rt.ErrnoError(d);if(d=u?Rt.mayDelete(n,s,l):Rt.mayCreate(n,s))throw new Rt.ErrnoError(d);if(!r.node_ops.rename)throw new Rt.ErrnoError(63);if(Rt.isMountpoint(c)||u&&Rt.isMountpoint(u))throw new Rt.ErrnoError(10);if(n!==r&&(d=Rt.nodePermissions(r,"w")))throw new Rt.ErrnoError(d);Rt.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Rt.hashAddNode(c)}}},rmdir:function(e){var t=Rt.lookupPath(e,{parent:!0}).node,r=Ft.basename(e),n=Rt.lookupNode(t,r),o=Rt.mayDelete(t,r,!0);if(o)throw new Rt.ErrnoError(o);if(!t.node_ops.rmdir)throw new Rt.ErrnoError(63);if(Rt.isMountpoint(n))throw new Rt.ErrnoError(10);t.node_ops.rmdir(t,r),Rt.destroyNode(n)},readdir:function(e){var t=Rt.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Rt.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=Rt.lookupPath(e,{parent:!0}).node;if(!t)throw new Rt.ErrnoError(44);var r=Ft.basename(e),n=Rt.lookupNode(t,r),o=Rt.mayDelete(t,r,!1);if(o)throw new Rt.ErrnoError(o);if(!t.node_ops.unlink)throw new Rt.ErrnoError(63);if(Rt.isMountpoint(n))throw new Rt.ErrnoError(10);t.node_ops.unlink(t,r),Rt.destroyNode(n)},readlink:function(e){var t=Rt.lookupPath(e).node;if(!t)throw new Rt.ErrnoError(44);if(!t.node_ops.readlink)throw new Rt.ErrnoError(28);return Mt.resolve(Rt.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=Rt.lookupPath(e,{follow:!t}).node;if(!r)throw new Rt.ErrnoError(44);if(!r.node_ops.getattr)throw new Rt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(e){return Rt.stat(e,!0)},chmod:function(e,t,r){var n;if(!(n="string"==typeof e?Rt.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Rt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){Rt.chmod(e,t,!0)},fchmod:function(e,t){var r=Rt.getStream(e);if(!r)throw new Rt.ErrnoError(8);Rt.chmod(r.node,t)},chown:function(e,t,r,n){var o;if(!(o="string"==typeof e?Rt.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Rt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){Rt.chown(e,t,r,!0)},fchown:function(e,t,r){var n=Rt.getStream(e);if(!n)throw new Rt.ErrnoError(8);Rt.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new Rt.ErrnoError(28);var r;if(!(r="string"==typeof e?Rt.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Rt.ErrnoError(63);if(Rt.isDir(r.mode))throw new Rt.ErrnoError(31);if(!Rt.isFile(r.mode))throw new Rt.ErrnoError(28);var n=Rt.nodePermissions(r,"w");if(n)throw new Rt.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=Rt.getStream(e);if(!r)throw new Rt.ErrnoError(8);if(0==(2097155&r.flags))throw new Rt.ErrnoError(28);Rt.truncate(r.node,t)},utime:function(e,t,r){var n=Rt.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(t,r,n){if(""===t)throw new Rt.ErrnoError(44);var i;if(n=void 0===n?438:n,n=64&(r="string"==typeof r?Rt.modeStringToFlags(r):r)?4095&n|32768:0,"object"==o(t))i=t;else{t=Ft.normalize(t);try{i=Rt.lookupPath(t,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(i){if(128&r)throw new Rt.ErrnoError(20)}else i=Rt.mknod(t,n,0),a=!0;if(!i)throw new Rt.ErrnoError(44);if(Rt.isChrdev(i.mode)&&(r&=-513),65536&r&&!Rt.isDir(i.mode))throw new Rt.ErrnoError(54);if(!a){var s=Rt.mayOpen(i,r);if(s)throw new Rt.ErrnoError(s)}512&r&&!a&&Rt.truncate(i,0),r&=-131713;var u=Rt.createStream({node:i,path:Rt.getPath(i),flags:r,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!e.logReadFiles||1&r||(Rt.readFiles||(Rt.readFiles={}),t in Rt.readFiles||(Rt.readFiles[t]=1)),u},close:function(e){if(Rt.isClosed(e))throw new Rt.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Rt.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(Rt.isClosed(e))throw new Rt.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Rt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Rt.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new Rt.ErrnoError(28);if(Rt.isClosed(e))throw new Rt.ErrnoError(8);if(1==(2097155&e.flags))throw new Rt.ErrnoError(8);if(Rt.isDir(e.node.mode))throw new Rt.ErrnoError(31);if(!e.stream_ops.read)throw new Rt.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Rt.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:function(e,t,r,n,o,i){if(n<0||o<0)throw new Rt.ErrnoError(28);if(Rt.isClosed(e))throw new Rt.ErrnoError(8);if(0==(2097155&e.flags))throw new Rt.ErrnoError(8);if(Rt.isDir(e.node.mode))throw new Rt.ErrnoError(31);if(!e.stream_ops.write)throw new Rt.ErrnoError(28);e.seekable&&1024&e.flags&&Rt.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Rt.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:function(e,t,r){if(Rt.isClosed(e))throw new Rt.ErrnoError(8);if(t<0||r<=0)throw new Rt.ErrnoError(28);if(0==(2097155&e.flags))throw new Rt.ErrnoError(8);if(!Rt.isFile(e.node.mode)&&!Rt.isDir(e.node.mode))throw new Rt.ErrnoError(43);if(!e.stream_ops.allocate)throw new Rt.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Rt.ErrnoError(2);if(1==(2097155&e.flags))throw new Rt.ErrnoError(2);if(!e.stream_ops.mmap)throw new Rt.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new Rt.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var n=Rt.open(e,r.flags),o=Rt.stat(e).size,i=new Uint8Array(o);return Rt.read(n,i,0,o,0),"utf8"===r.encoding?t=j(i,0):"binary"===r.encoding&&(t=i),Rt.close(n),t},writeFile:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.flags=r.flags||577;var n=Rt.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(N(t)+1),i=R(t,o,0,o.length);Rt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Rt.write(n,t,0,t.byteLength,void 0,r.canOwn)}Rt.close(n)},cwd:function(){return Rt.currentPath},chdir:function(e){var t=Rt.lookupPath(e,{follow:!0});if(null===t.node)throw new Rt.ErrnoError(44);if(!Rt.isDir(t.node.mode))throw new Rt.ErrnoError(54);var r=Rt.nodePermissions(t.node,"x");if(r)throw new Rt.ErrnoError(r);Rt.currentPath=t.path},createDefaultDirectories:function(){Rt.mkdir("/tmp"),Rt.mkdir("/home"),Rt.mkdir("/home/web_user")},createDefaultDevices:function(){Rt.mkdir("/dev"),Rt.registerDevice(Rt.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),Rt.mkdev("/dev/null",Rt.makedev(1,3)),xt.register(Rt.makedev(5,0),xt.default_tty_ops),xt.register(Rt.makedev(6,0),xt.default_tty1_ops),Rt.mkdev("/dev/tty",Rt.makedev(5,0)),Rt.mkdev("/dev/tty1",Rt.makedev(6,0));var e=function(){if("object"==("undefined"==typeof crypto?"undefined":o(crypto))&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(m)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){return V("randomDevice")}}();Rt.createDevice("/dev","random",e),Rt.createDevice("/dev","urandom",e),Rt.mkdir("/dev/shm"),Rt.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Rt.mkdir("/proc");var e=Rt.mkdir("/proc/self");Rt.mkdir("/proc/self/fd"),Rt.mount({mount:function(){var t=Rt.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=+t,n=Rt.getStream(r);if(!n)throw new Rt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){e.stdin?Rt.createDevice("/dev","stdin",e.stdin):Rt.symlink("/dev/tty","/dev/stdin"),e.stdout?Rt.createDevice("/dev","stdout",null,e.stdout):Rt.symlink("/dev/tty","/dev/stdout"),e.stderr?Rt.createDevice("/dev","stderr",null,e.stderr):Rt.symlink("/dev/tty1","/dev/stderr"),Rt.open("/dev/stdin",0),Rt.open("/dev/stdout",1),Rt.open("/dev/stderr",1)},ensureErrnoError:function(){Rt.ErrnoError||(Rt.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Rt.ErrnoError.prototype=new Error,Rt.ErrnoError.prototype.constructor=Rt.ErrnoError,[44].forEach((function(e){Rt.genericErrors[e]=new Rt.ErrnoError(e),Rt.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){Rt.ensureErrnoError(),Rt.nameTable=new Array(4096),Rt.mount($t,{},"/"),Rt.createDefaultDirectories(),Rt.createDefaultDevices(),Rt.createSpecialDirectories(),Rt.filesystems={MEMFS:$t}},init:function(t,r,n){Rt.init.initialized=!0,Rt.ensureErrnoError(),e.stdin=t||e.stdin,e.stdout=r||e.stdout,e.stderr=n||e.stderr,Rt.createStandardStreams()},quit:function(){Rt.init.initialized=!1;for(var e=0;e<Rt.streams.length;e++){var t=Rt.streams[e];t&&Rt.close(t)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:function(e,t){var r=Rt.analyzePath(e,t);return r.exists?r.object:null},analyzePath:function(e,t){try{e=(n=Rt.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Rt.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=Ft.basename(e),n=Rt.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:function(e,t,r,n){e="string"==typeof e?e:Rt.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=Ft.join2(e,i);try{Rt.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,r,n,o){var i=Ft.join2("string"==typeof e?e:Rt.getPath(e),t),a=Rt.getMode(n,o);return Rt.create(i,a)},createDataFile:function(e,t,r,n,o,i){var a=t;e&&(e="string"==typeof e?e:Rt.getPath(e),a=t?Ft.join2(e,t):e);var s=Rt.getMode(n,o),u=Rt.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),f=0,l=r.length;f<l;++f)c[f]=r.charCodeAt(f);r=c}Rt.chmod(u,146|s);var d=Rt.open(u,577);Rt.write(d,r,0,r.length,0,i),Rt.close(d),Rt.chmod(u,s)}return u},createDevice:function(e,t,r,n){var o=Ft.join2("string"==typeof e?e:Rt.getPath(e),t),i=Rt.getMode(!!r,!!n);Rt.createDevice.major||(Rt.createDevice.major=64);var a=Rt.makedev(Rt.createDevice.major++,0);return Rt.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Rt.ErrnoError(29)}if(void 0===u&&0===a)throw new Rt.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,o,i){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Rt.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Rt.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(!n)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ot(n(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Rt.ErrnoError(29)}},createLazyFile:function(e,t,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+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",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+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 "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ot(o.responseText||"",!0)}(t,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,g("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){if(!h)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Rt.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function f(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((function(e){var t=u.stream_ops[e];c[e]=function(){return Rt.forceLoadFile(u),t.apply(null,arguments)}})),c.read=function(e,t,r,n,o){return Rt.forceLoadFile(u),f(e,t,r,n,o)},c.mmap=function(e,t,r,n,o){Rt.forceLoadFile(u);var i=jt();if(!i)throw new Rt.ErrnoError(48);return f(e,P,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:function(e,t,r,n,o,a,s,u,c,f){var l=t?Mt.resolve(Ft.join2(e,t)):e;function d(r){function i(r){f&&f(),u||Rt.createDataFile(e,t,r,n,o,c),a&&a(),H()}Browser.handledByPreloadPlugin(r,l,i,(function(){s&&s(),H()}))||i(r)}W(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;i(e,(function(r){b(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&H()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&W()}(r,(function(e){return d(e)}),s):d(r)},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,t,r){t=t||function(){},r=r||function(){};var n=Rt.indexedDB();try{var o=n.open(Rt.DB_NAME(),Rt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){g("creating db"),o.result.createObjectStore(Rt.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Rt.DB_STORE_NAME],"readwrite"),i=n.objectStore(Rt.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((function(e){var t=i.put(Rt.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==u&&c()},t.onerror=function(){s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=Rt.indexedDB();try{var o=n.open(Rt.DB_NAME(),Rt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([Rt.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(Rt.DB_STORE_NAME),s=0,u=0,c=e.length;function f(){0==u?t():r()}e.forEach((function(e){var t=a.get(e);t.onsuccess=function(){Rt.analyzePath(e).exists&&Rt.unlink(e),Rt.createDataFile(Ft.dirname(e),Ft.basename(e),t.result,!0,!0,!0),++s+u==c&&f()},t.onerror=function(){u++,s+u==c&&f()}})),i.onerror=r},o.onerror=r}},Nt={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(Ft.isAbs(t))return t;var n;if(-100===e)n=Rt.cwd();else{var o=Rt.getStream(e);if(!o)throw new Rt.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new Rt.ErrnoError(44);return n}return Ft.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&Ft.normalize(t)!==Ft.normalize(Rt.getPath(e.node)))return-54;throw e}return C[r>>2]=n.dev,C[r+4>>2]=0,C[r+8>>2]=n.ino,C[r+12>>2]=n.mode,C[r+16>>2]=n.nlink,C[r+20>>2]=n.uid,C[r+24>>2]=n.gid,C[r+28>>2]=n.rdev,C[r+32>>2]=0,J=[n.size>>>0,(G=n.size,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],C[r+40>>2]=J[0],C[r+44>>2]=J[1],C[r+48>>2]=4096,C[r+52>>2]=n.blocks,J=[Math.floor(n.atime.getTime()/1e3)>>>0,(G=Math.floor(n.atime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],C[r+56>>2]=J[0],C[r+60>>2]=J[1],C[r+64>>2]=0,J=[Math.floor(n.mtime.getTime()/1e3)>>>0,(G=Math.floor(n.mtime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],C[r+72>>2]=J[0],C[r+76>>2]=J[1],C[r+80>>2]=0,J=[Math.floor(n.ctime.getTime()/1e3)>>>0,(G=Math.floor(n.ctime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],C[r+88>>2]=J[0],C[r+92>>2]=J[1],C[r+96>>2]=0,J=[n.ino>>>0,(G=n.ino,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],C[r+104>>2]=J[0],C[r+108>>2]=J[1],0},doMsync:function(e,t,r,n,o){var i=T.slice(e,e+r);Rt.msync(t,i,o,r,n)},varargs:void 0,get:function(){return Nt.varargs+=4,C[Nt.varargs-4>>2]},getStr:function(e){return $(e)},getStreamFromFD:function(e){var t=Rt.getStream(e);if(!t)throw new Rt.ErrnoError(8);return t}};function Bt(e){return e%4==0&&(e%100!=0||e%400==0)}var Ut=[31,29,31,30,31,30,31,31,30,31,30,31],zt=[31,28,31,30,31,30,31,31,30,31,30,31];function It(e,t,r,n){var o=C[n+40>>2],i={tm_sec:C[n>>2],tm_min:C[n+4>>2],tm_hour:C[n+8>>2],tm_mday:C[n+12>>2],tm_mon:C[n+16>>2],tm_year:C[n+20>>2],tm_wday:C[n+24>>2],tm_yday:C[n+28>>2],tm_isdst:C[n+32>>2],tm_gmtoff:C[n+36>>2],tm_zone:o?$(o):""},a=$(r),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"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return l(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.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 t=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=Bt(r.getFullYear()),o=r.getMonth(),i=(n?Ut:zt)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.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 f[e.tm_mon].substring(0,3)},"%B":function(e){return f[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 l(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 t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(Bt(e.tm_year+1900)?Ut:zt,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 t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Bt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Bt(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in a=a.replace(/%%/g,"\0\0"),v)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var y=Ot(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(function(e,t){P.set(e,t)}(y,e),y.length-1)}!function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);oe=e}(),he=e.BindingError=pe(Error,"BindingError"),ve=e.InternalError=pe(Error,"InternalError"),Le.prototype.isAliasOf=_e,Le.prototype.clone=Be,Le.prototype.delete=Ue,Le.prototype.isDeleted=ze,Le.prototype.deleteLater=Ie,e.getInheritedInstanceCount=De,e.getLiveInheritedInstances=Ce,e.flushPendingDeletes=Fe,e.setDelayFunction=Oe,Qe.prototype.getPointee=Xe,Qe.prototype.destructor=Ke,Qe.prototype.argPackAdvance=8,Qe.prototype.readValueFromPointer=Je,Qe.prototype.deleteObject=Ze,Qe.prototype.fromWireType=Re,ot=e.UnboundTypeError=pe(Error,"UnboundTypeError"),e.count_emval_handles=pt,e.get_first_emval=ht;var Lt=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Rt.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Wt=365,Ht=146;Object.defineProperties(Lt.prototype,{read:{get:function(){return(this.mode&Wt)===Wt},set:function(e){e?this.mode|=Wt:this.mode&=-366}},write:{get:function(){return(this.mode&Ht)===Ht},set:function(e){e?this.mode|=Ht:this.mode&=-147}},isFolder:{get:function(){return Rt.isDir(this.mode)}},isDevice:{get:function(){return Rt.isChrdev(this.mode)}}}),Rt.FSNode=Lt,Rt.staticInit();var Vt={c:function(e){return qt(e+24)+24},d:function(e,t,r){throw new re(e).init(t,r),e},r:function(e,t,r,n,o){},E:function(e,t,r,n,o){var i=ne(r);ge(e,{name:t=ie(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=P;else if(2===r)n=S;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=C}return this.fromWireType(n[e>>i])},destructorFunction:null})},o:function(t,r,n,o,i,a,s,u,c,f,l,d,p){l=ie(l),a=nt(i,a),u&&(u=nt(s,u)),f&&(f=nt(c,f)),p=nt(d,p);var h=le(l);!function(t,r,n){e.hasOwnProperty(t)?((void 0===n||void 0!==e[t].overloadTable&&void 0!==e[t].overloadTable[n])&&me("Cannot register public name '"+t+"' twice"),We(e,t,t),e.hasOwnProperty(n)&&me("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),e[t].overloadTable[n]=r):(e[t]=r,void 0!==n&&(e[t].numArguments=n))}(h,(function(){at("Cannot construct "+l+" due to unbound types",[o])})),we([t,r,n],o?[o]:[],(function(r){var n,i;r=r[0],i=o?(n=r.registeredClass).instancePrototype:Le.prototype;var s=de(h,(function(){if(Object.getPrototypeOf(this)!==c)throw new he("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new he(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new he("Tried to invoke ctor of "+l+" 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 He(l,s,c,p,n,a,u,f),m=new Qe(l,d,!0,!1,!1),v=new Qe(l+"*",d,!1,!1,!1),y=new Qe(l+" const*",d,!1,!0,!1);return Se[t]={pointerType:v,constPointerType:y},function(t,r,n){e.hasOwnProperty(t)||ye("Replacing nonexistant public symbol"),void 0!==e[t].overloadTable&&void 0!==n?e[t].overloadTable[n]=r:(e[t]=r,e[t].argCount=n)}(h,s),[m,v,y]}))},n:function(e,t,r,n,o,i){b(t>0);var a=st(t,r);o=nt(n,o),we([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new he("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=function(){at("Cannot construct "+e.name+" due to unbound types",a)},we([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=ct(r,n,null,o,i),[]})),[]}))},h:function(e,t,r,n,o,i,a,s){var u=st(r,n);t=ie(t),i=nt(o,i),we([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){at("Cannot call "+n+" due to unbound types",u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,f=c[t];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(We(c,t,n),c[t].overloadTable[r-2]=o),we([],u,(function(o){var s=ct(n,o,e,i,a);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},D:function(e,t){ge(e,{name:t=ie(t),fromWireType:function(e){var t=mt.toValue(e);return dt(e),t},toWireType:function(e,t){return mt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Je,destructorFunction:null})},l:function(e,t,r){var n=ne(r);ge(e,{name:t=ie(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:yt(t,n),destructorFunction:null})},b:function(e,t,r,n,o){t=ie(t);var i=ne(r),a=function(e){return e};if(0===n){var s=32-8*r;a=function(e){return e<<s>>>s}}var u=t.includes("unsigned");ge(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:wt(t,i,0!==n),destructorFunction:null})},a:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=A,r=t[e>>=2],o=t[e+1];return new n(k,o,r)}ge(e,{name:r=ie(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},k:function(e,t){var r="std::string"===(t=ie(t));ge(e,{name:t,fromWireType:function(e){var t,n=A[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==T[s]){var u=$(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(T[o+a]);t=c.join("")}return Yt(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||me("Cannot pass non-string to std::string"),n=r&&o?N(t):t.length;var i=qt(4+n+1),a=i+4;if(A[i>>2]=n,r&&o)R(t,T,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Yt(a),me("String has UTF-16 code units that do not fit in 8 bits")),T[a+s]=u}else for(s=0;s<n;++s)T[a+s]=t[s];return null!==e&&e.push(Yt,i),i},argPackAdvance:8,readValueFromPointer:Je,destructorFunction:function(e){Yt(e)}})},g:function(e,t,r){var n,o,i,a,s;r=ie(r),2===t?(n=_t,o=Et,a=bt,i=function(){return D},s=1):4===t&&(n=kt,o=Pt,a=Tt,i=function(){return A},s=2),ge(e,{name:r,fromWireType:function(e){for(var r,o=A[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var f=e+4+c*t;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+t}}return Yt(e),r},toWireType:function(e,n){"string"!=typeof n&&me("Cannot pass non-string to C++ string type "+r);var i=a(n),u=qt(4+i+t);return A[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Yt,u),u},argPackAdvance:8,readValueFromPointer:Je,destructorFunction:function(e){Yt(e)}})},F:function(e,t){ge(e,{isVoid:!0,name:t=ie(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},z:function(){return!0},e:dt,m:function(e){e>4&&(lt[e].refcount+=1)},B:function(e){return mt.toHandle(void 0===(r=Dt[t=e])?ie(t):r);var t,r},G:function(){return mt.toHandle({})},p:function(e,t,r){e=mt.toValue(e),t=mt.toValue(t),r=mt.toValue(r),e[t]=r},s:function(e,t){var r,n,o;n="_emval_take_value",void 0===(o=se[r=e])&&me(n+" has unknown type "+it(r));var i=(e=o).readValueFromPointer(t);return mt.toHandle(i)},f:function(){V("")},y:St,A:function(e,t,r){T.copyWithin(e,t,t+r)},u:function(e){T.length,V("OOM")},v:function(e,t){var r=0;return At().forEach((function(n,o){var i=t+r;A[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)P[t++>>0]=e.charCodeAt(n);r||(P[t>>0]=0)}(n,i),r+=n.length+1})),0},w:function(e,t){var r=At();A[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),A[t>>2]=n,0},C:function(e){try{var t=Nt.getStreamFromFD(e);return Rt.close(t),0}catch(e){if(void 0===Rt||!(e instanceof Rt.ErrnoError))throw e;return e.errno}},x:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=A[t>>2],s=A[t+4>>2];t+=8;var u=Rt.read(e,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(Nt.getStreamFromFD(e),t,r);return C[n>>2]=o,0}catch(e){if(void 0===Rt||!(e instanceof Rt.ErrnoError))throw e;return e.errno}},q:function(e,t,r,n,o){try{var i=(u=r)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*u:NaN;if(isNaN(i))return 61;var a=Nt.getStreamFromFD(e);return Rt.llseek(a,i,n),J=[a.position>>>0,(G=a.position,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],C[o>>2]=J[0],C[o+4>>2]=J[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===Rt||!(e instanceof Rt.ErrnoError))throw e;return e.errno}var s,u},j:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=A[t>>2],s=A[t+4>>2];t+=8;var u=Rt.write(e,P,a,s,n);if(u<0)return-1;o+=u}return o}(Nt.getStreamFromFD(e),t,r);return A[n>>2]=o,0}catch(e){if(void 0===Rt||!(e instanceof Rt.ErrnoError))throw e;return e.errno}},i:function(e){},t:function(e,t,r,n){return It(e,t,r,n)}};!function(){var t={a:Vt};function n(t,r){var n,o,i=t.exports;e.asm=i,w=e.asm.H,n=w.buffer,k=n,e.HEAP8=P=new Int8Array(n),e.HEAP16=S=new Int16Array(n),e.HEAP32=C=new Int32Array(n),e.HEAPU8=T=new Uint8Array(n),e.HEAPU16=D=new Uint16Array(n),e.HEAPU32=A=new Uint32Array(n),e.HEAPF32=F=new Float32Array(n),e.HEAPF64=M=new Float64Array(n),O=e.asm.J,o=e.asm.I,U.unshift(o),H()}function o(e){n(e.instance)}function a(e){return function(){if(!y&&(p||h)){if("function"==typeof fetch&&!Z(q))return fetch(q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+q+"'";return e.arrayBuffer()})).catch((function(){return Q(q)}));if(i)return new Promise((function(e,t){i(q,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return Q(q)}))}().then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(e,(function(e){_("failed to asynchronously prepare wasm: "+e),V(e)}))}if(W(),e.instantiateWasm)try{return e.instantiateWasm(t,n)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}(y||"function"!=typeof WebAssembly.instantiateStreaming||K(q)||Z(q)||m||"function"!=typeof fetch?a(o):fetch(q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(o,(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(r)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.I).apply(null,arguments)};var qt=e._malloc=function(){return(qt=e._malloc=e.asm.K).apply(null,arguments)},Yt=e._free=function(){return(Yt=e._free=e.asm.L).apply(null,arguments)},Gt=e.___getTypeName=function(){return(Gt=e.___getTypeName=e.asm.M).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.N).apply(null,arguments)};var Jt,Xt=e.___cxa_is_pointer_type=function(){return(Xt=e.___cxa_is_pointer_type=e.asm.O).apply(null,arguments)};function Kt(r){function n(){Jt||(Jt=!0,e.calledRun=!0,E||(e.noFSInit||Rt.init.initialized||Rt.init(),Rt.ignorePermissions=!1,te(U),t(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),z.unshift(t);var t;te(z)}()))}I>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),B.unshift(t);var t;te(B)}(),I>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),n()}),1)):n()))}if(e.dynCall_ji=function(){return(e.dynCall_ji=e.asm.P).apply(null,arguments)},e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.Q).apply(null,arguments)},e.dynCall_viijii=function(){return(e.dynCall_viijii=e.asm.R).apply(null,arguments)},e.dynCall_iiiiij=function(){return(e.dynCall_iiiiij=e.asm.S).apply(null,arguments)},e.dynCall_iiiiijj=function(){return(e.dynCall_iiiiijj=e.asm.T).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return(e.dynCall_iiiiiijj=e.asm.U).apply(null,arguments)},L=function e(){Jt||Kt(),Jt||(L=e)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return Kt(),e.ready}),w="debug",g="warn",_={debug:!1,debugLevel:g,debugUuid:""},E=s((function e(t){r(this,e),this.log=function(e){if(t._opt.debug&&t._opt.debugLevel==w){for(var r,n=t._opt.debugUuid?"[".concat(t._opt.debugUuid,"]"):"",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console).log.apply(r,["JbPro".concat(n,"[✅✅✅][imageDetector][").concat(e,"]")].concat(i))}},this.warn=function(e){if(t._opt.debug&&(t._opt.debugLevel==w||t._opt.debugLevel==g)){for(var r,n=t._opt.debugUuid?"[".concat(t._opt.debugUuid,"]"):"",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console).log.apply(r,["JbPro".concat(n,"[❗❗❗][imageDetector][").concat(e,"]")].concat(i))}},this.error=function(e){for(var r,n=t._opt.debugUuid?"[".concat(t._opt.debugUuid,"]"):"",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console).error.apply(r,["JbPro".concat(n,"[❌❌❌][imageDetector][").concat(e,"]")].concat(i))}})),b=function(){function e(){r(this,e)}return s(e,[{key:"on",value:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this}},{key:"once",value:function(e,t,r){var n=this;function o(){n.off(e,o);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];t.apply(r,a)}return o._=t,this.on(e,o,r)}},{key:"emit",value:function(e){for(var t=((this.e||(this.e={}))[e]||[]).slice(),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0;i<t.length;i+=1)t[i].fn.apply(t[i].ctx,n);return this}},{key:"off",value:function(e,t){var r=this.e||(this.e={});if(!e)return Object.keys(r).forEach((function(e){delete r[e]})),void delete this.e;var n=r[e],o=[];if(n&&t)for(var i=0,a=n.length;i<a;i+=1)n[i].fn!==t&&n[i].fn._!==t&&o.push(n[i]);return o.length?r[e]=o:delete r[e],this}}]),e}();function k(e){return!function(e){return e&&0===Object.keys(e).length}(e)}function P(){return function(e){var t="";if("object"===o(e))try{t=JSON.stringify(e),t=JSON.parse(t)}catch(r){t=e}else t=e;return t}(_)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var o=v(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return h(this,r)}}var S=function(e){d(n,e);var t=T(n);function n(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,n),(e=t.call(this))._opt={},e.TAG_NAME="OcclusionDetector",Object.keys(o).forEach((function(e){if(void 0===o[e])throw new Error('JbProOcclusionDetector option "'.concat(e,'" can not be undefined'))})),e.originalOptions=o;var i=P(),a=Object.assign({},i,o);return e._opt=a,e.debug=new E(c(e)),e.module=null,e.detector=null,e.startTimestamp=null,e.width=o.width||0,e.height=o.height||0,e.debug.log(e.TAG_NAME,"init",JSON.stringify(e._opt)),e}return s(n,[{key:"destroy",value:function(){this.off(),this.detector&&(this.detector.clear(),this.detector.delete(),this.detector=null),this.module&&(this.module=null),this.startTimestamp=null,this.debug.log(this.TAG_NAME,"destroy")}},{key:"load",value:function(){var e=this;return new Promise((function(t,r){y().then((function(n){e.module=n,e.module.OcclusionDetector?(e.detector=new e.module.OcclusionDetector(e),t()):r("load jessibuca occlusion detector fail")})).catch((function(e){console.error(e),r("load jessibuca occlusion detector error")}))}))}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.width&&e.height&&(this.width=e.width,this.height=e.height)}},{key:"check",value:function(e){return this._isVideoOcclusion(e.data,e.width,e.height)}},{key:"_isVideoOcclusion",value:function(e,t,r){return this._check("isVideoOcclusion",e,t,r)}},{key:"_check",value:function(e,t,r,n){if(function(e){return null==e}(t)||!k(this.detector))return!1;if(!e||!this.detector[e])return!1;if(!(r&&n&&this.width&&this.height))return!1;var o=r||this.width,i=n||this.height;if(null===this.startTimestamp&&(this.startTimestamp=Date.now()),Date.now()-this.startTimestamp>6e5)return!1;var a=this.detector[e](t,o,i),s=!1;return a&&(s=a.result),s}}]),n}(b);window.JessibucaProOcclusionDetector=S}));