nlopt-js
Version:
NLopt-js is a port of [NLopt](https://nlopt.readthedocs.io/en/latest/) C++ optimization library
1 lines • 909 kB
JavaScript
!function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I():"function"==typeof define&&define.amd?define([],I):"object"==typeof exports?exports.nlopt=I():A.nlopt=I()}(global,(function(){return function(A){var I={};function Q(C){if(I[C])return I[C].exports;var g=I[C]={i:C,l:!1,exports:{}};return A[C].call(g.exports,g,g.exports,Q),g.l=!0,g.exports}return Q.m=A,Q.c=I,Q.d=function(A,I,C){Q.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:C})},Q.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},Q.t=function(A,I){if(1&I&&(A=Q(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var C=Object.create(null);if(Q.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var g in A)Q.d(C,g,function(I){return A[I]}.bind(null,g));return C},Q.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return Q.d(I,"a",I),I},Q.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},Q.p="",Q(Q.s=7)}([function(A,I){A.exports=require("path")},function(A,I,Q){(function(I,C){var g,B=(g=(g="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||I,function(A){var I,B;(A=void 0!==(A=A||{})?A:{}).ready=new Promise((function(A,Q){I=A,B=Q})),Object.getOwnPropertyDescriptor(A.ready,"_main")||(Object.defineProperty(A.ready,"_main",{configurable:!0,get:function(){OA("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_main",{configurable:!0,set:function(){OA("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_malloc")||(Object.defineProperty(A.ready,"_malloc",{configurable:!0,get:function(){OA("You are getting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_malloc",{configurable:!0,set:function(){OA("You are setting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_free")||(Object.defineProperty(A.ready,"_free",{configurable:!0,get:function(){OA("You are getting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_free",{configurable:!0,set:function(){OA("You are setting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_stackSave")||(Object.defineProperty(A.ready,"_stackSave",{configurable:!0,get:function(){OA("You are getting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_stackSave",{configurable:!0,set:function(){OA("You are setting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_stackRestore")||(Object.defineProperty(A.ready,"_stackRestore",{configurable:!0,get:function(){OA("You are getting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_stackRestore",{configurable:!0,set:function(){OA("You are setting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_stackAlloc")||(Object.defineProperty(A.ready,"_stackAlloc",{configurable:!0,get:function(){OA("You are getting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_stackAlloc",{configurable:!0,set:function(){OA("You are setting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"___data_end")||(Object.defineProperty(A.ready,"___data_end",{configurable:!0,get:function(){OA("You are getting ___data_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"___data_end",{configurable:!0,set:function(){OA("You are setting ___data_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"___wasm_call_ctors")||(Object.defineProperty(A.ready,"___wasm_call_ctors",{configurable:!0,get:function(){OA("You are getting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"___wasm_call_ctors",{configurable:!0,set:function(){OA("You are setting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_fflush")||(Object.defineProperty(A.ready,"_fflush",{configurable:!0,get:function(){OA("You are getting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_fflush",{configurable:!0,set:function(){OA("You are setting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"___errno_location")||(Object.defineProperty(A.ready,"___errno_location",{configurable:!0,get:function(){OA("You are getting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"___errno_location",{configurable:!0,set:function(){OA("You are setting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"_setThrew")||(Object.defineProperty(A.ready,"_setThrew",{configurable:!0,get:function(){OA("You are getting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"_setThrew",{configurable:!0,set:function(){OA("You are setting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(A.ready,"onRuntimeInitialized")||(Object.defineProperty(A.ready,"onRuntimeInitialized",{configurable:!0,get:function(){OA("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(A.ready,"onRuntimeInitialized",{configurable:!0,set:function(){OA("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}));var E,D={};for(E in A)A.hasOwnProperty(E)&&(D[E]=A[E]);var i=[],o="./this.program",w=function(A,I){throw I},h=!1,s=!1,a=!1,M=!1;if(h="object"==typeof window,s="function"==typeof importScripts,a="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,M=!h&&!a&&!s,A.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var t,k,F,e,N="";function y(I){return A.locateFile?A.locateFile(I,N):N+I}if(a)N=s?Q(0).dirname(N)+"/":C+"/",t=function(A,I){return F||(F=Q(4)),e||(e=Q(0)),A=e.normalize(A),F.readFileSync(A,I?null:"utf8")},k=function(A){var I=t(A,!0);return I.buffer||(I=new Uint8Array(I)),L(I.buffer),I},process.argv.length>1&&(o=process.argv[1].replace(/\\/g,"/")),i=process.argv.slice(2),process.on("uncaughtException",(function(A){if(!(A instanceof wg))throw A})),process.on("unhandledRejection",OA),w=function(A){process.exit(A)},A.inspect=function(){return"[Emscripten Module object]"};else if(M)"undefined"!=typeof read&&(t=function(A){return read(A)}),k=function(A){var I;return"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(L("object"==typeof(I=read(A,"binary"))),I)},"undefined"!=typeof scriptArgs?i=scriptArgs:void 0!==arguments&&(i=arguments),"function"==typeof quit&&(w=function(A){quit(A)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);else{if(!h&&!s)throw new Error("environment detection error");s?N=self.location.href:document.currentScript&&(N=document.currentScript.src),g&&(N=g),N=0!==N.indexOf("blob:")?N.substr(0,N.lastIndexOf("/")+1):"",t=function(A){var I=new XMLHttpRequest;return I.open("GET",A,!1),I.send(null),I.responseText},s&&(k=function(A){var I=new XMLHttpRequest;return I.open("GET",A,!1),I.responseType="arraybuffer",I.send(null),new Uint8Array(I.response)})}var R=A.print||console.log.bind(console),G=A.printErr||console.warn.bind(console);for(E in D)D.hasOwnProperty(E)&&(A[E]=D[E]);function r(A){r.shown||(r.shown={}),r.shown[A]||(r.shown[A]=1,G(A))}D=null,A.arguments&&(i=A.arguments),Object.getOwnPropertyDescriptor(A,"arguments")||Object.defineProperty(A,"arguments",{configurable:!0,get:function(){OA("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),A.thisProgram&&(o=A.thisProgram),Object.getOwnPropertyDescriptor(A,"thisProgram")||Object.defineProperty(A,"thisProgram",{configurable:!0,get:function(){OA("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),A.quit&&(w=A.quit),Object.getOwnPropertyDescriptor(A,"quit")||Object.defineProperty(A,"quit",{configurable:!0,get:function(){OA("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(void 0===A.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===A.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),L(void 0===A.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===A.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),L(void 0===A.read,"Module.read option was removed (modify read_ in JS)"),L(void 0===A.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),L(void 0===A.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),L(void 0===A.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),L(void 0===A.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(A,"read")||Object.defineProperty(A,"read",{configurable:!0,get:function(){OA("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(A,"readAsync")||Object.defineProperty(A,"readAsync",{configurable:!0,get:function(){OA("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(A,"readBinary")||Object.defineProperty(A,"readBinary",{configurable:!0,get:function(){OA("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(A,"setWindowTitle")||Object.defineProperty(A,"setWindowTitle",{configurable:!0,get:function(){OA("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var J,S,c,U=function(A){};A.wasmBinary&&(J=A.wasmBinary),Object.getOwnPropertyDescriptor(A,"wasmBinary")||Object.defineProperty(A,"wasmBinary",{configurable:!0,get:function(){OA("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),A.noExitRuntime&&(S=A.noExitRuntime),Object.getOwnPropertyDescriptor(A,"noExitRuntime")||Object.defineProperty(A,"noExitRuntime",{configurable:!0,get:function(){OA("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),"object"!=typeof WebAssembly&&OA("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");var n=new WebAssembly.Table({initial:522,maximum:522,element:"anyfunc"}),K=!1;function L(A,I){A||OA("Assertion failed: "+I)}var Y="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function d(A,I,Q){for(var C=I+Q,g=I;A[g]&&!(g>=C);)++g;if(g-I>16&&A.subarray&&Y)return Y.decode(A.subarray(I,g));for(var B="";I<g;){var E=A[I++];if(128&E){var D=63&A[I++];if(192!=(224&E)){var i=63&A[I++];if(224==(240&E)?E=(15&E)<<12|D<<6|i:(240!=(248&E)&&r("Invalid UTF-8 leading byte 0x"+E.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"),E=(7&E)<<18|D<<12|i<<6|63&A[I++]),E<65536)B+=String.fromCharCode(E);else{var o=E-65536;B+=String.fromCharCode(55296|o>>10,56320|1023&o)}}else B+=String.fromCharCode((31&E)<<6|D)}else B+=String.fromCharCode(E)}return B}function H(A,I){return A?d(Z,A,I):""}function q(A,I,Q,C){if(!(C>0))return 0;for(var g=Q,B=Q+C-1,E=0;E<A.length;++E){var D=A.charCodeAt(E);if(D>=55296&&D<=57343&&(D=65536+((1023&D)<<10)|1023&A.charCodeAt(++E)),D<=127){if(Q>=B)break;I[Q++]=D}else if(D<=2047){if(Q+1>=B)break;I[Q++]=192|D>>6,I[Q++]=128|63&D}else if(D<=65535){if(Q+2>=B)break;I[Q++]=224|D>>12,I[Q++]=128|D>>6&63,I[Q++]=128|63&D}else{if(Q+3>=B)break;D>=2097152&&r("Invalid Unicode code point 0x"+D.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."),I[Q++]=240|D>>18,I[Q++]=128|D>>12&63,I[Q++]=128|D>>6&63,I[Q++]=128|63&D}}return I[Q]=0,Q-g}function l(A,I,Q){return L("number"==typeof Q,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),q(A,Z,I,Q)}function p(A){for(var I=0,Q=0;Q<A.length;++Q){var C=A.charCodeAt(Q);C>=55296&&C<=57343&&(C=65536+((1023&C)<<10)|1023&A.charCodeAt(++Q)),C<=127?++I:I+=C<=2047?2:C<=65535?3:4}return I}var f="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function O(A,I){L(A%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var Q=A,C=Q>>1,g=C+I/2;!(C>=g)&&v[C];)++C;if((Q=C<<1)-A>32&&f)return f.decode(Z.subarray(A,Q));for(var B=0,E="";;){var D=V[A+2*B>>1];if(0==D||B==I/2)return E;++B,E+=String.fromCharCode(D)}}function T(A,I,Q){if(L(I%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),L("number"==typeof Q,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===Q&&(Q=2147483647),Q<2)return 0;for(var C=I,g=(Q-=2)<2*A.length?Q/2:A.length,B=0;B<g;++B){var E=A.charCodeAt(B);V[I>>1]=E,I+=2}return V[I>>1]=0,I-C}function u(A){return 2*A.length}function m(A,I){L(A%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var Q=0,C="";!(Q>=I/4);){var g=z[A+4*Q>>2];if(0==g)break;if(++Q,g>=65536){var B=g-65536;C+=String.fromCharCode(55296|B>>10,56320|1023&B)}else C+=String.fromCharCode(g)}return C}function x(A,I,Q){if(L(I%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),L("number"==typeof Q,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===Q&&(Q=2147483647),Q<4)return 0;for(var C=I,g=C+Q-4,B=0;B<A.length;++B){var E=A.charCodeAt(B);if(E>=55296&&E<=57343&&(E=65536+((1023&E)<<10)|1023&A.charCodeAt(++B)),z[I>>2]=E,(I+=4)+4>g)break}return z[I>>2]=0,I-C}function P(A){for(var I=0,Q=0;Q<A.length;++Q){var C=A.charCodeAt(Q);C>=55296&&C<=57343&&++Q,I+=4}return I}function b(A,I){L(A.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),X.set(A,I)}function W(A,I,Q){for(var C=0;C<A.length;++C)L(A.charCodeAt(C)==A.charCodeAt(C)&255),X[I++>>0]=A.charCodeAt(C);Q||(X[I>>0]=0)}var j,X,Z,V,v,z,_,$,AA,IA=65536;function QA(A,I){return A%I>0&&(A+=I-A%I),A}function CA(I){j=I,A.HEAP8=X=new Int8Array(I),A.HEAP16=V=new Int16Array(I),A.HEAP32=z=new Int32Array(I),A.HEAPU8=Z=new Uint8Array(I),A.HEAPU16=v=new Uint16Array(I),A.HEAPU32=_=new Uint32Array(I),A.HEAPF32=$=new Float32Array(I),A.HEAPF64=AA=new Float64Array(I)}var gA=5344912,BA=102032,EA=5344912,DA=101872;L(gA%16==0,"stack must start aligned"),L(EA%16==0,"heap must start aligned");var iA=5242880;A.TOTAL_STACK&&L(iA===A.TOTAL_STACK,"the stack size can no longer be determined at runtime");var oA=A.INITIAL_MEMORY||16777216;function wA(){L(0==(3&BA)),_[1+(BA>>2)]=34821223,_[2+(BA>>2)]=2310721022,z[0]=1668509029}function hA(){var A=_[1+(BA>>2)],I=_[2+(BA>>2)];34821223==A&&2310721022==I||OA("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+I.toString(16)+" "+A.toString(16)),1668509029!==z[0]&&OA("Runtime error: The application has corrupted its heap memory area (address zero)!")}function sA(I){for(;I.length>0;){var Q=I.shift();if("function"!=typeof Q){var C=Q.func;"number"==typeof C?void 0===Q.arg?A.dynCall_v(C):A.dynCall_vi(C,Q.arg):C(void 0===Q.arg?null:Q.arg)}else Q(A)}}Object.getOwnPropertyDescriptor(A,"INITIAL_MEMORY")||Object.defineProperty(A,"INITIAL_MEMORY",{configurable:!0,get:function(){OA("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(oA>=iA,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+oA+"! (TOTAL_STACK="+iA+")"),L("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),(c=A.wasmMemory?A.wasmMemory:new WebAssembly.Memory({initial:oA/IA,maximum:2147483648/IA}))&&(j=c.buffer),L((oA=j.byteLength)%IA==0),L(65536%IA==0),CA(j),z[DA>>2]=EA,function(){var A=new Int16Array(1),I=new Int8Array(A.buffer);if(A[0]=25459,115!==I[0]||99!==I[1])throw"Runtime error: expected the system to be little-endian!"}();var aA=[],MA=[],tA=[],kA=[],FA=[],eA=!1,NA=!1;function yA(){if(A.preRun)for("function"==typeof A.preRun&&(A.preRun=[A.preRun]);A.preRun.length;)SA(A.preRun.shift());sA(aA)}function RA(){hA(),L(!eA),eA=!0,A.noFSInit||kI.init.initialized||kI.init(),sI.init(),sA(MA)}function GA(){hA(),kI.ignorePermissions=!1,sA(tA)}function rA(){hA(),NA=!0}function JA(){if(hA(),A.postRun)for("function"==typeof A.postRun&&(A.postRun=[A.postRun]);A.postRun.length;)cA(A.postRun.shift());sA(FA)}function SA(A){aA.unshift(A)}function cA(A){FA.unshift(A)}L(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var UA=Math.abs,nA=(Math.cos,Math.sin,Math.tan,Math.acos,Math.asin,Math.atan,Math.atan2,Math.exp,Math.log,Math.sqrt,Math.ceil),KA=Math.floor,LA=(Math.pow,Math.imul,Math.fround,Math.round,Math.min),YA=(Math.max,Math.clz32,Math.trunc,0),dA=null,HA=null,qA={};function lA(A){for(var I=A;;){if(!qA[A])return A;A=I+Math.random()}}function pA(I){YA++,A.monitorRunDependencies&&A.monitorRunDependencies(YA),I?(L(!qA[I]),qA[I]=1,null===dA&&"undefined"!=typeof setInterval&&(dA=setInterval((function(){if(K)return clearInterval(dA),void(dA=null);var A=!1;for(var I in qA)A||(A=!0,G("still waiting on run dependencies:")),G("dependency: "+I);A&&G("(end of list)")}),1e4))):G("warning: run dependency added without ID")}function fA(I){if(YA--,A.monitorRunDependencies&&A.monitorRunDependencies(YA),I?(L(qA[I]),delete qA[I]):G("warning: run dependency removed without ID"),0==YA&&(null!==dA&&(clearInterval(dA),dA=null),HA)){var Q=HA;HA=null,Q()}}function OA(I){throw A.onAbort&&A.onAbort(I),R(I+=""),G(I),K=!0,I="abort("+I+") at "+AI(),new WebAssembly.RuntimeError(I)}function TA(A,I){return String.prototype.startsWith?A.startsWith(I):0===A.indexOf(I)}A.preloadedImages={},A.preloadedAudios={};var uA="data:application/octet-stream;base64,";function mA(A){return TA(A,uA)}var xA="file://";function PA(A){return TA(A,xA)}function bA(I,Q){return function(){var C=I,g=Q;return Q||(g=A.asm),L(eA,"native function `"+C+"` called before runtime initialization"),L(!NA,"native function `"+C+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),g[I]||L(g[I],"exported native function `"+C+"` not found"),g[I].apply(null,arguments)}}var WA,jA,XA="nlopt_gen.wasm";function ZA(){try{if(J)return new Uint8Array(J);if(k)return k(XA);throw"both async and sync fetching of the wasm failed"}catch(A){OA(A)}}function VA(){return J||!h&&!s||"function"!=typeof fetch||PA(XA)?new Promise((function(A,I){A(ZA())})):fetch(XA,{credentials:"same-origin"}).then((function(A){if(!A.ok)throw"failed to load wasm binary file at '"+XA+"'";return A.arrayBuffer()})).catch((function(){return ZA()}))}function vA(){var I={env:gg,wasi_snapshot_preview1:gg};function Q(I,Q){var C=I.exports;A.asm=C,fA("wasm-instantiate")}pA("wasm-instantiate");var C=A;function g(I){L(A===C,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),C=null,Q(I.instance)}function B(A){return VA().then((function(A){return WebAssembly.instantiate(A,I)})).then(A,(function(A){G("failed to asynchronously prepare wasm: "+A),OA(A)}))}if(A.instantiateWasm)try{return A.instantiateWasm(I,Q)}catch(A){return G("Module.instantiateWasm callback failed with error: "+A),!1}return function(){if(J||"function"!=typeof WebAssembly.instantiateStreaming||mA(XA)||PA(XA)||"function"!=typeof fetch)return B(g);fetch(XA,{credentials:"same-origin"}).then((function(A){return WebAssembly.instantiateStreaming(A,I).then(g,(function(A){return G("wasm streaming compile failed: "+A),G("falling back to ArrayBuffer instantiation"),B(g)}))}))}(),{}}function zA(A){return r("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),A}function _A(A){return A.replace(/\b_Z[\w\d_]+/g,(function(A){var I=zA(A);return A===I?A:I+" ["+A+"]"}))}function $A(){var A=new Error;if(!A.stack){try{throw new Error}catch(I){A=I}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function AI(){var I=$A();return A.extraStackTrace&&(I+="\n"+A.extraStackTrace()),_A(I)}function II(A){return Dg(A)}function QI(A,I){r("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"),kA.unshift({func:A,arg:I})}function CI(A,I){return QI(A,I)}mA(XA)||(XA=y(XA)),MA.push({func:function(){Bg()}});var gI={};function BI(){return BI.uncaught_exceptions>0}function EI(A,I,Q){throw gI[A]={ptr:A,adjusted:[A],type:I,destructor:Q,refcount:0,caught:!1,rethrown:!1},"uncaught_exception"in BI?BI.uncaught_exceptions++:BI.uncaught_exceptions=1,A+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function DI(){OA("stack overflow")}function iI(A){return z[og()>>2]=A,A}function oI(A,I){return iI(63),-1}var wI={splitPath:function(A){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(A).slice(1)},normalizeArray:function(A,I){for(var Q=0,C=A.length-1;C>=0;C--){var g=A[C];"."===g?A.splice(C,1):".."===g?(A.splice(C,1),Q++):Q&&(A.splice(C,1),Q--)}if(I)for(;Q;Q--)A.unshift("..");return A},normalize:function(A){var I="/"===A.charAt(0),Q="/"===A.substr(-1);return(A=wI.normalizeArray(A.split("/").filter((function(A){return!!A})),!I).join("/"))||I||(A="."),A&&Q&&(A+="/"),(I?"/":"")+A},dirname:function(A){var I=wI.splitPath(A),Q=I[0],C=I[1];return Q||C?(C&&(C=C.substr(0,C.length-1)),Q+C):"."},basename:function(A){if("/"===A)return"/";var I=A.lastIndexOf("/");return-1===I?A:A.substr(I+1)},extname:function(A){return wI.splitPath(A)[3]},join:function(){var A=Array.prototype.slice.call(arguments,0);return wI.normalize(A.join("/"))},join2:function(A,I){return wI.normalize(A+"/"+I)}},hI={resolve:function(){for(var A="",I=!1,Q=arguments.length-1;Q>=-1&&!I;Q--){var C=Q>=0?arguments[Q]:kI.cwd();if("string"!=typeof C)throw new TypeError("Arguments to path.resolve must be strings");if(!C)return"";A=C+"/"+A,I="/"===C.charAt(0)}return(I?"/":"")+(A=wI.normalizeArray(A.split("/").filter((function(A){return!!A})),!I).join("/"))||"."},relative:function(A,I){function Q(A){for(var I=0;I<A.length&&""===A[I];I++);for(var Q=A.length-1;Q>=0&&""===A[Q];Q--);return I>Q?[]:A.slice(I,Q-I+1)}A=hI.resolve(A).substr(1),I=hI.resolve(I).substr(1);for(var C=Q(A.split("/")),g=Q(I.split("/")),B=Math.min(C.length,g.length),E=B,D=0;D<B;D++)if(C[D]!==g[D]){E=D;break}var i=[];for(D=E;D<C.length;D++)i.push("..");return(i=i.concat(g.slice(E))).join("/")}},sI={ttys:[],init:function(){},shutdown:function(){},register:function(A,I){sI.ttys[A]={input:[],output:[],ops:I},kI.registerDevice(A,sI.stream_ops)},stream_ops:{open:function(A){var I=sI.ttys[A.node.rdev];if(!I)throw new kI.ErrnoError(43);A.tty=I,A.seekable=!1},close:function(A){A.tty.ops.flush(A.tty)},flush:function(A){A.tty.ops.flush(A.tty)},read:function(A,I,Q,C,g){if(!A.tty||!A.tty.ops.get_char)throw new kI.ErrnoError(60);for(var B=0,E=0;E<C;E++){var D;try{D=A.tty.ops.get_char(A.tty)}catch(A){throw new kI.ErrnoError(29)}if(void 0===D&&0===B)throw new kI.ErrnoError(6);if(null==D)break;B++,I[Q+E]=D}return B&&(A.node.timestamp=Date.now()),B},write:function(A,I,Q,C,g){if(!A.tty||!A.tty.ops.put_char)throw new kI.ErrnoError(60);try{for(var B=0;B<C;B++)A.tty.ops.put_char(A.tty,I[Q+B])}catch(A){throw new kI.ErrnoError(29)}return C&&(A.node.timestamp=Date.now()),B}},default_tty_ops:{get_char:function(A){if(!A.input.length){var I=null;if(a){var Q=Buffer.alloc?Buffer.alloc(256):new Buffer(256),C=0;try{C=F.readSync(process.stdin.fd,Q,0,256,null)}catch(A){if(-1==A.toString().indexOf("EOF"))throw A;C=0}I=C>0?Q.slice(0,C).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(I=window.prompt("Input: "))&&(I+="\n"):"function"==typeof readline&&null!==(I=readline())&&(I+="\n");if(!I)return null;A.input=Qg(I,!0)}return A.input.shift()},put_char:function(A,I){null===I||10===I?(R(d(A.output,0)),A.output=[]):0!=I&&A.output.push(I)},flush:function(A){A.output&&A.output.length>0&&(R(d(A.output,0)),A.output=[])}},default_tty1_ops:{put_char:function(A,I){null===I||10===I?(G(d(A.output,0)),A.output=[]):0!=I&&A.output.push(I)},flush:function(A){A.output&&A.output.length>0&&(G(d(A.output,0)),A.output=[])}}},aI={ops_table:null,mount:function(A){return aI.createNode(null,"/",16895,0)},createNode:function(A,I,Q,C){if(kI.isBlkdev(Q)||kI.isFIFO(Q))throw new kI.ErrnoError(63);aI.ops_table||(aI.ops_table={dir:{node:{getattr:aI.node_ops.getattr,setattr:aI.node_ops.setattr,lookup:aI.node_ops.lookup,mknod:aI.node_ops.mknod,rename:aI.node_ops.rename,unlink:aI.node_ops.unlink,rmdir:aI.node_ops.rmdir,readdir:aI.node_ops.readdir,symlink:aI.node_ops.symlink},stream:{llseek:aI.stream_ops.llseek}},file:{node:{getattr:aI.node_ops.getattr,setattr:aI.node_ops.setattr},stream:{llseek:aI.stream_ops.llseek,read:aI.stream_ops.read,write:aI.stream_ops.write,allocate:aI.stream_ops.allocate,mmap:aI.stream_ops.mmap,msync:aI.stream_ops.msync}},link:{node:{getattr:aI.node_ops.getattr,setattr:aI.node_ops.setattr,readlink:aI.node_ops.readlink},stream:{}},chrdev:{node:{getattr:aI.node_ops.getattr,setattr:aI.node_ops.setattr},stream:kI.chrdev_stream_ops}});var g=kI.createNode(A,I,Q,C);return kI.isDir(g.mode)?(g.node_ops=aI.ops_table.dir.node,g.stream_ops=aI.ops_table.dir.stream,g.contents={}):kI.isFile(g.mode)?(g.node_ops=aI.ops_table.file.node,g.stream_ops=aI.ops_table.file.stream,g.usedBytes=0,g.contents=null):kI.isLink(g.mode)?(g.node_ops=aI.ops_table.link.node,g.stream_ops=aI.ops_table.link.stream):kI.isChrdev(g.mode)&&(g.node_ops=aI.ops_table.chrdev.node,g.stream_ops=aI.ops_table.chrdev.stream),g.timestamp=Date.now(),A&&(A.contents[I]=g),g},getFileDataAsRegularArray:function(A){if(A.contents&&A.contents.subarray){for(var I=[],Q=0;Q<A.usedBytes;++Q)I.push(A.contents[Q]);return I}return A.contents},getFileDataAsTypedArray:function(A){return A.contents?A.contents.subarray?A.contents.subarray(0,A.usedBytes):new Uint8Array(A.contents):new Uint8Array(0)},expandFileStorage:function(A,I){var Q=A.contents?A.contents.length:0;if(!(Q>=I)){I=Math.max(I,Q*(Q<1048576?2:1.125)>>>0),0!=Q&&(I=Math.max(I,256));var C=A.contents;A.contents=new Uint8Array(I),A.usedBytes>0&&A.contents.set(C.subarray(0,A.usedBytes),0)}},resizeFileStorage:function(A,I){if(A.usedBytes!=I){if(0==I)return A.contents=null,void(A.usedBytes=0);if(!A.contents||A.contents.subarray){var Q=A.contents;return A.contents=new Uint8Array(I),Q&&A.contents.set(Q.subarray(0,Math.min(I,A.usedBytes))),void(A.usedBytes=I)}if(A.contents||(A.contents=[]),A.contents.length>I)A.contents.length=I;else for(;A.contents.length<I;)A.contents.push(0);A.usedBytes=I}},node_ops:{getattr:function(A){var I={};return I.dev=kI.isChrdev(A.mode)?A.id:1,I.ino=A.id,I.mode=A.mode,I.nlink=1,I.uid=0,I.gid=0,I.rdev=A.rdev,kI.isDir(A.mode)?I.size=4096:kI.isFile(A.mode)?I.size=A.usedBytes:kI.isLink(A.mode)?I.size=A.link.length:I.size=0,I.atime=new Date(A.timestamp),I.mtime=new Date(A.timestamp),I.ctime=new Date(A.timestamp),I.blksize=4096,I.blocks=Math.ceil(I.size/I.blksize),I},setattr:function(A,I){void 0!==I.mode&&(A.mode=I.mode),void 0!==I.timestamp&&(A.timestamp=I.timestamp),void 0!==I.size&&aI.resizeFileStorage(A,I.size)},lookup:function(A,I){throw kI.genericErrors[44]},mknod:function(A,I,Q,C){return aI.createNode(A,I,Q,C)},rename:function(A,I,Q){if(kI.isDir(A.mode)){var C;try{C=kI.lookupNode(I,Q)}catch(A){}if(C)for(var g in C.contents)throw new kI.ErrnoError(55)}delete A.parent.contents[A.name],A.name=Q,I.contents[Q]=A,A.parent=I},unlink:function(A,I){delete A.contents[I]},rmdir:function(A,I){var Q=kI.lookupNode(A,I);for(var C in Q.contents)throw new kI.ErrnoError(55);delete A.contents[I]},readdir:function(A){var I=[".",".."];for(var Q in A.contents)A.contents.hasOwnProperty(Q)&&I.push(Q);return I},symlink:function(A,I,Q){var C=aI.createNode(A,I,41471,0);return C.link=Q,C},readlink:function(A){if(!kI.isLink(A.mode))throw new kI.ErrnoError(28);return A.link}},stream_ops:{read:function(A,I,Q,C,g){var B=A.node.contents;if(g>=A.node.usedBytes)return 0;var E=Math.min(A.node.usedBytes-g,C);if(L(E>=0),E>8&&B.subarray)I.set(B.subarray(g,g+E),Q);else for(var D=0;D<E;D++)I[Q+D]=B[g+D];return E},write:function(A,I,Q,C,g,B){if(L(!(I instanceof ArrayBuffer)),I.buffer===X.buffer&&(B&&r("file packager has copied file data into memory, but in memory growth we are forced to copy it again (see --no-heap-copy)"),B=!1),!C)return 0;var E=A.node;if(E.timestamp=Date.now(),I.subarray&&(!E.contents||E.contents.subarray)){if(B)return L(0===g,"canOwn must imply no weird position inside the file"),E.contents=I.subarray(Q,Q+C),E.usedBytes=C,C;if(0===E.usedBytes&&0===g)return E.contents=I.slice(Q,Q+C),E.usedBytes=C,C;if(g+C<=E.usedBytes)return E.contents.set(I.subarray(Q,Q+C),g),C}if(aI.expandFileStorage(E,g+C),E.contents.subarray&&I.subarray)E.contents.set(I.subarray(Q,Q+C),g);else for(var D=0;D<C;D++)E.contents[g+D]=I[Q+D];return E.usedBytes=Math.max(E.usedBytes,g+C),C},llseek:function(A,I,Q){var C=I;if(1===Q?C+=A.position:2===Q&&kI.isFile(A.node.mode)&&(C+=A.node.usedBytes),C<0)throw new kI.ErrnoError(28);return C},allocate:function(A,I,Q){aI.expandFileStorage(A.node,I+Q),A.node.usedBytes=Math.max(A.node.usedBytes,I+Q)},mmap:function(A,I,Q,C,g,B){if(L(0===I),!kI.isFile(A.node.mode))throw new kI.ErrnoError(43);var E,D,i=A.node.contents;if(2&B||i.buffer!==j){if((C>0||C+Q<i.length)&&(i=i.subarray?i.subarray(C,C+Q):Array.prototype.slice.call(i,C,C+Q)),D=!0,!(E=Dg(Q)))throw new kI.ErrnoError(48);X.set(i,E)}else D=!1,E=i.byteOffset;return{ptr:E,allocated:D}},msync:function(A,I,Q,C,g){if(!kI.isFile(A.node.mode))throw new kI.ErrnoError(43);return 2&g?0:(aI.stream_ops.write(A,I,0,C,Q,!1),0)}}},MI={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},tI={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},kI={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,handleFSError:function(A){if(!(A instanceof kI.ErrnoError))throw A+" : "+AI();return iI(A.errno)},lookupPath:function(A,I){if(I=I||{},!(A=hI.resolve(kI.cwd(),A)))return{path:"",node:null};var Q={follow_mount:!0,recurse_count:0};for(var C in Q)void 0===I[C]&&(I[C]=Q[C]);if(I.recurse_count>8)throw new kI.ErrnoError(32);for(var g=wI.normalizeArray(A.split("/").filter((function(A){return!!A})),!1),B=kI.root,E="/",D=0;D<g.length;D++){var i=D===g.length-1;if(i&&I.parent)break;if(B=kI.lookupNode(B,g[D]),E=wI.join2(E,g[D]),kI.isMountpoint(B)&&(!i||i&&I.follow_mount)&&(B=B.mounted.root),!i||I.follow)for(var o=0;kI.isLink(B.mode);){var w=kI.readlink(E);if(E=hI.resolve(wI.dirname(E),w),B=kI.lookupPath(E,{recurse_count:I.recurse_count}).node,o++>40)throw new kI.ErrnoError(32)}}return{path:E,node:B}},getPath:function(A){for(var I;;){if(kI.isRoot(A)){var Q=A.mount.mountpoint;return I?"/"!==Q[Q.length-1]?Q+"/"+I:Q+I:Q}I=I?A.name+"/"+I:A.name,A=A.parent}},hashName:function(A,I){for(var Q=0,C=0;C<I.length;C++)Q=(Q<<5)-Q+I.charCodeAt(C)|0;return(A+Q>>>0)%kI.nameTable.length},hashAddNode:function(A){var I=kI.hashName(A.parent.id,A.name);A.name_next=kI.nameTable[I],kI.nameTable[I]=A},hashRemoveNode:function(A){var I=kI.hashName(A.parent.id,A.name);if(kI.nameTable[I]===A)kI.nameTable[I]=A.name_next;else for(var Q=kI.nameTable[I];Q;){if(Q.name_next===A){Q.name_next=A.name_next;break}Q=Q.name_next}},lookupNode:function(A,I){var Q=kI.mayLookup(A);if(Q)throw new kI.ErrnoError(Q,A);for(var C=kI.hashName(A.id,I),g=kI.nameTable[C];g;g=g.name_next){var B=g.name;if(g.parent.id===A.id&&B===I)return g}return kI.lookup(A,I)},createNode:function(A,I,Q,C){var g=new kI.FSNode(A,I,Q,C);return kI.hashAddNode(g),g},destroyNode:function(A){kI.hashRemoveNode(A)},isRoot:function(A){return A===A.parent},isMountpoint:function(A){return!!A.mounted},isFile:function(A){return 32768==(61440&A)},isDir:function(A){return 16384==(61440&A)},isLink:function(A){return 40960==(61440&A)},isChrdev:function(A){return 8192==(61440&A)},isBlkdev:function(A){return 24576==(61440&A)},isFIFO:function(A){return 4096==(61440&A)},isSocket:function(A){return 49152==(49152&A)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(A){var I=kI.flagModes[A];if(void 0===I)throw new Error("Unknown file open mode: "+A);return I},flagsToPermissionString:function(A){var I=["r","w","rw"][3&A];return 512&A&&(I+="w"),I},nodePermissions:function(A,I){return kI.ignorePermissions?0:(-1===I.indexOf("r")||292&A.mode)&&(-1===I.indexOf("w")||146&A.mode)&&(-1===I.indexOf("x")||73&A.mode)?0:2},mayLookup:function(A){var I=kI.nodePermissions(A,"x");return I||(A.node_ops.lookup?0:2)},mayCreate:function(A,I){try{return kI.lookupNode(A,I),20}catch(A){}return kI.nodePermissions(A,"wx")},mayDelete:function(A,I,Q){var C;try{C=kI.lookupNode(A,I)}catch(A){return A.errno}var g=kI.nodePermissions(A,"wx");if(g)return g;if(Q){if(!kI.isDir(C.mode))return 54;if(kI.isRoot(C)||kI.getPath(C)===kI.cwd())return 10}else if(kI.isDir(C.mode))return 31;return 0},mayOpen:function(A,I){return A?kI.isLink(A.mode)?32:kI.isDir(A.mode)&&("r"!==kI.flagsToPermissionString(I)||512&I)?31:kI.nodePermissions(A,kI.flagsToPermissionString(I)):44},MAX_OPEN_FDS:4096,nextfd:function(A,I){A=A||0,I=I||kI.MAX_OPEN_FDS;for(var Q=A;Q<=I;Q++)if(!kI.streams[Q])return Q;throw new kI.ErrnoError(33)},getStream:function(A){return kI.streams[A]},createStream:function(A,I,Q){kI.FSStream||(kI.FSStream=function(){},kI.FSStream.prototype={object:{get:function(){return this.node},set:function(A){this.node=A}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var C=new kI.FSStream;for(var g in A)C[g]=A[g];A=C;var B=kI.nextfd(I,Q);return A.fd=B,kI.streams[B]=A,A},closeStream:function(A){kI.streams[A]=null},chrdev_stream_ops:{open:function(A){var I=kI.getDevice(A.node.rdev);A.stream_ops=I.stream_ops,A.stream_ops.open&&A.stream_ops.open(A)},llseek:function(){throw new kI.ErrnoError(70)}},major:function(A){return A>>8},minor:function(A){return 255&A},makedev:function(A,I){return A<<8|I},registerDevice:function(A,I){kI.devices[A]={stream_ops:I}},getDevice:function(A){return kI.devices[A]},getMounts:function(A){for(var I=[],Q=[A];Q.length;){var C=Q.pop();I.push(C),Q.push.apply(Q,C.mounts)}return I},syncfs:function(A,I){"function"==typeof A&&(I=A,A=!1),kI.syncFSRequests++,kI.syncFSRequests>1&&G("warning: "+kI.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var Q=kI.getMounts(kI.root.mount),C=0;function g(A){return L(kI.syncFSRequests>0),kI.syncFSRequests--,I(A)}function B(A){if(A)return B.errored?void 0:(B.errored=!0,g(A));++C>=Q.length&&g(null)}Q.forEach((function(I){if(!I.type.syncfs)return B(null);I.type.syncfs(I,A,B)}))},mount:function(A,I,Q){if("string"==typeof A)throw A;var C,g="/"===Q,B=!Q;if(g&&kI.root)throw new kI.ErrnoError(10);if(!g&&!B){var E=kI.lookupPath(Q,{follow_mount:!1});if(Q=E.path,C=E.node,kI.isMountpoint(C))throw new kI.ErrnoError(10);if(!kI.isDir(C.mode))throw new kI.ErrnoError(54)}var D={type:A,opts:I,mountpoint:Q,mounts:[]},i=A.mount(D);return i.mount=D,D.root=i,g?kI.root=i:C&&(C.mounted=D,C.mount&&C.mount.mounts.push(D)),i},unmount:function(A){var I=kI.lookupPath(A,{follow_mount:!1});if(!kI.isMountpoint(I.node))throw new kI.ErrnoError(28);var Q=I.node,C=Q.mounted,g=kI.getMounts(C);Object.keys(kI.nameTable).forEach((function(A){for(var I=kI.nameTable[A];I;){var Q=I.name_next;-1!==g.indexOf(I.mount)&&kI.destroyNode(I),I=Q}})),Q.mounted=null;var B=Q.mount.mounts.indexOf(C);L(-1!==B),Q.mount.mounts.splice(B,1)},lookup:function(A,I){return A.node_ops.lookup(A,I)},mknod:function(A,I,Q){var C=kI.lookupPath(A,{parent:!0}).node,g=wI.basename(A);if(!g||"."===g||".."===g)throw new kI.ErrnoError(28);var B=kI.mayCreate(C,g);if(B)throw new kI.ErrnoError(B);if(!C.node_ops.mknod)throw new kI.ErrnoError(63);return C.node_ops.mknod(C,g,I,Q)},create:function(A,I){return I=void 0!==I?I:438,I&=4095,I|=32768,kI.mknod(A,I,0)},mkdir:function(A,I){return I=void 0!==I?I:511,I&=1023,I|=16384,kI.mknod(A,I,0)},mkdirTree:function(A,I){for(var Q=A.split("/"),C="",g=0;g<Q.length;++g)if(Q[g]){C+="/"+Q[g];try{kI.mkdir(C,I)}catch(A){if(20!=A.errno)throw A}}},mkdev:function(A,I,Q){return void 0===Q&&(Q=I,I=438),I|=8192,kI.mknod(A,I,Q)},symlink:function(A,I){if(!hI.resolve(A))throw new kI.ErrnoError(44);var Q=kI.lookupPath(I,{parent:!0}).node;if(!Q)throw new kI.ErrnoError(44);var C=wI.basename(I),g=kI.mayCreate(Q,C);if(g)throw new kI.ErrnoError(g);if(!Q.node_ops.symlink)throw new kI.ErrnoError(63);return Q.node_ops.symlink(Q,C,A)},rename:function(A,I){var Q,C,g=wI.dirname(A),B=wI.dirname(I),E=wI.basename(A),D=wI.basename(I);try{Q=kI.lookupPath(A,{parent:!0}).node,C=kI.lookupPath(I,{parent:!0}).node}catch(A){throw new kI.ErrnoError(10)}if(!Q||!C)throw new kI.ErrnoError(44);if(Q.mount!==C.mount)throw new kI.ErrnoError(75);var i,o=kI.lookupNode(Q,E),w=hI.relative(A,B);if("."!==w.charAt(0))throw new kI.ErrnoError(28);if("."!==(w=hI.relative(I,g)).charAt(0))throw new kI.ErrnoError(55);try{i=kI.lookupNode(C,D)}catch(A){}if(o!==i){var h=kI.isDir(o.mode),s=kI.mayDelete(Q,E,h);if(s)throw new kI.ErrnoError(s);if(s=i?kI.mayDelete(C,D,h):kI.mayCreate(C,D))throw new kI.ErrnoError(s);if(!Q.node_ops.rename)throw new kI.ErrnoError(63);if(kI.isMountpoint(o)||i&&kI.isMountpoint(i))throw new kI.ErrnoError(10);if(C!==Q&&(s=kI.nodePermissions(Q,"w")))throw new kI.ErrnoError(s);try{kI.trackingDelegate.willMovePath&&kI.trackingDelegate.willMovePath(A,I)}catch(Q){G("FS.trackingDelegate['willMovePath']('"+A+"', '"+I+"') threw an exception: "+Q.message)}kI.hashRemoveNode(o);try{Q.node_ops.rename(o,C,D)}catch(A){throw A}finally{kI.hashAddNode(o)}try{kI.trackingDelegate.onMovePath&&kI.trackingDelegate.onMovePath(A,I)}catch(Q){G("FS.trackingDelegate['onMovePath']('"+A+"', '"+I+"') threw an exception: "+Q.message)}}},rmdir:function(A){var I=kI.lookupPath(A,{parent:!0}).node,Q=wI.basename(A),C=kI.lookupNode(I,Q),g=kI.mayDelete(I,Q,!0);if(g)throw new kI.ErrnoError(g);if(!I.node_ops.rmdir)throw new kI.ErrnoError(63);if(kI.isMountpoint(C))throw new kI.ErrnoError(10);try{kI.trackingDelegate.willDeletePath&&kI.trackingDelegate.willDeletePath(A)}catch(I){G("FS.trackingDelegate['willDeletePath']('"+A+"') threw an exception: "+I.message)}I.node_ops.rmdir(I,Q),kI.destroyNode(C);try{kI.trackingDelegate.onDeletePath&&kI.trackingDelegate.onDeletePath(A)}catch(I){G("FS.trackingDelegate['onDeletePath']('"+A+"') threw an exception: "+I.message)}},readdir:function(A){var I=kI.lookupPath(A,{follow:!0}).node;if(!I.node_ops.readdir)throw new kI.ErrnoError(54);return I.node_ops.readdir(I)},unlink:function(A){var I=kI.lookupPath(A,{parent:!0}).node,Q=wI.basename(A),C=kI.lookupNode(I,Q),g=kI.mayDelete(I,Q,!1);if(g)throw new kI.ErrnoError(g);if(!I.node_ops.unlink)throw new kI.ErrnoError(63);if(kI.isMountpoint(C))throw new kI.ErrnoError(10);try{kI.trackingDelegate.willDeletePath&&kI.trackingDelegate.willDeletePath(A)}catch(I){G("FS.trackingDelegate['willDeletePath']('"+A+"') threw an exception: "+I.message)}I.node_ops.unlink(I,Q),kI.destroyNode(C);try{kI.trackingDelegate.onDeletePath&&kI.trackingDelegate.onDeletePath(A)}catch(I){G("FS.trackingDelegate['onDeletePath']('"+A+"') threw an exception: "+I.message)}},readlink:function(A){var I=kI.lookupPath(A).node;if(!I)throw new kI.ErrnoError(44);if(!I.node_ops.readlink)throw new kI.ErrnoError(28);return hI.resolve(kI.getPath(I.parent),I.node_ops.readlink(I))},stat:function(A,I){var Q=kI.lookupPath(A,{follow:!I}).node;if(!Q)throw new kI.ErrnoError(44);if(!Q.node_ops.getattr)throw new kI.ErrnoError(63);return Q.node_ops.getattr(Q)},lstat:function(A){return kI.stat(A,!0)},chmod:function(A,I,Q){var C;if(!(C="string"==typeof A?kI.lookupPath(A,{follow:!Q}).node:A).node_ops.setattr)throw new kI.ErrnoError(63);C.node_ops.setattr(C,{mode:4095&I|-4096&C.mode,timestamp:Date.now()})},lchmod:function(A,I){kI.chmod(A,I,!0)},fchmod:function(A,I){var Q=kI.getStream(A);if(!Q)throw new kI.ErrnoError(8);kI.chmod(Q.node,I)},chown:function(A,I,Q,C){var g;if(!(g="string"==typeof A?kI.lookupPath(A,{follow:!C}).node:A).node_ops.setattr)throw new kI.ErrnoError(63);g.node_ops.setattr(g,{timestamp:Date.now()})},lchown:function(A,I,Q){kI.chown(A,I,Q,!0)},fchown:function(A,I,Q){var C=kI.getStream(A);if(!C)throw new kI.