UNPKG

dicomweb-proxy

Version:

A proxy to translate between dicomweb and dimse

2 lines 7.23 MB
/*! For license information please see app.bundle.ae8cec4222aad690a22d.js.LICENSE.txt */ (()=>{var e,t,n,r,a={93720:(e,t,n)=>{var r,a=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,a,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,n){t=e,a=n}));var o,s,l,c=Object.assign({},i),u=[],d="object"==typeof window,m="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(h){var f=n(84595),v=n(53615);p=m?v.dirname(p)+"/":"//",o=(e,t)=>(e=q(e)?new URL(e):v.normalize(e),f.readFileSync(e,t?void 0:"utf8")),l=e=>{var t=o(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,n)=>{e=q(e)?new URL(e):v.normalize(e),f.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),u=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof $))throw e})),process.on("unhandledRejection",(function(e){throw e})),i.inspect=function(){return"[Emscripten Module object]"}}else(d||m)&&(m?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});i.print||console.log.bind(console);var g,y=i.printErr||console.warn.bind(console);Object.assign(i,c),c=null,i.arguments&&(u=i.arguments),i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(g=i.wasmBinary);var S;i.noExitRuntime;"object"!=typeof WebAssembly&&B("no native wasm support detected");var b,M,w,C,E,I,_,D,x,T=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(e,t){return e?function(e,t,n){for(var r=t+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&P)return P.decode(e.subarray(t,a));for(var i="";t<a;){var o=e[t++];if(128&o){var s=63&e[t++];if(192!=(224&o)){var l=63&e[t++];if((o=224==(240&o)?(15&o)<<12|s<<6|l:(7&o)<<18|s<<12|l<<6|63&e[t++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i}(w,e,t):""}function k(e,t,n){return function(e,t,n,r){if(!(r>0))return 0;for(var a=n,i=n+r-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-a}(e,w,t,n)}function O(e){b=e,i.HEAP8=M=new Int8Array(e),i.HEAP16=C=new Int16Array(e),i.HEAP32=I=new Int32Array(e),i.HEAPU8=w=new Uint8Array(e),i.HEAPU16=E=new Uint16Array(e),i.HEAPU32=_=new Uint32Array(e),i.HEAPF32=D=new Float32Array(e),i.HEAPF64=x=new Float64Array(e)}i.INITIAL_MEMORY;var R,L=[],N=[],F=[],V=0,U=null,j=null;function B(e){i.onAbort&&i.onAbort(e),y(e="Aborted("+e+")"),T=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw a(t),t}var G,H,W="data:application/octet-stream;base64,";function z(e){return e.startsWith(W)}function q(e){return e.startsWith("file://")}function Y(e){try{if(e==G&&g)return new Uint8Array(g);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(e){B(e)}}function $(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function K(e){for(;e.length>0;)e.shift()(i)}function Q(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_refcount=function(e){I[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,M[this.ptr+12|0]=e},this.get_caught=function(){return 0!=M[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,M[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=M[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=I[this.ptr>>2];I[this.ptr>>2]=e+1},this.release_ref=function(){var e=I[this.ptr>>2];return I[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Nt(this.get_type()))return _[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}z(G="charlswasm_decode.wasm")||(H=G,G=i.locateFile?i.locateFile(H,p):p+H);var X={};function J(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Z(e){return this.fromWireType(I[e>>2])}var ee={},te={},ne={},re=48,ae=57;function ie(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=re&&t<=ae?"_"+e:e}function oe(e,t){return e=ie(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function se(e,t){var n=oe(t,(function(e){this.name=t,this.message=e;var n=new Error(e).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var le=void 0;function ce(e){throw new le(e)}function ue(e,t,n){function r(t){var r=n(t);r.length!==e.length&&ce("Mismatched type converter count");for(var a=0;a<e.length;++a)ve(e[a],r[a])}e.forEach((function(e){ne[e]=t}));var a=new Array(t.length),i=[],o=0;t.forEach(((e,t)=>{te.hasOwnProperty(e)?a[t]=te[e]:(i.push(e),ee.hasOwnProperty(e)||(ee[e]=[]),ee[e].push((()=>{a[t]=te[e],++o===i.length&&r(a)})))})),0===i.length&&r(a)}function de(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var me=void 0;function he(e){for(var t="",n=e;w[n];)t+=me[w[n++]];return t}var pe=void 0;function fe(e){throw new pe(e)}function ve(e,t,n={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(e||fe('type "'+r+'" must have a positive integer typeid pointer'),te.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;fe("Cannot register type '"+r+"' twice")}if(te[e]=t,delete ne[e],ee.hasOwnProperty(e)){var a=ee[e];delete ee[e],a.forEach((e=>e()))}}function ge(e){if(!(this instanceof Ue))return!1;if(!(e instanceof Ue))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)a=r.upcast(a),r=r.baseClass;return t===r&&n===a}function ye(e){fe(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Se=!1;function be(e){}function Me(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 we(e,t,n){if(t===n)return e;if(void 0===n.baseClass)return null;var r=we(e,t,n.baseClass);return null===r?null:n.downcast(r)}var Ce={};function Ee(){return Object.keys(Pe).length}function Ie(){var e=[];for(var t in Pe)Pe.hasOwnProperty(t)&&e.push(Pe[t]);return e}var _e=[];function De(){for(;_e.length;){var e=_e.pop();e.$$.deleteScheduled=!1,e.delete()}}var xe=void 0;function Te(e){xe=e,_e.length&&xe&&xe(De)}var Pe={};function Ae(e,t){return t=function(e,t){for(void 0===t&&fe("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Pe[t]}function ke(e,t){return t.ptrType&&t.ptr||ce("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&ce("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Re(Object.create(e,{$$:{value:t}}))}function Oe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=Ae(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function a(){return this.isSmartPointer?ke(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ke(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(t),s=Ce[o];if(!s)return a.call(this);i=this.isConst?s.constPointerType:s.pointerType;var l=we(t,this.registeredClass,i.registeredClass);return null===l?a.call(this):this.isSmartPointer?ke(i.registeredClass.instancePrototype,{ptrType:i,ptr:l,smartPtrType:this,smartPtr:e}):ke(i.registeredClass.instancePrototype,{ptrType:i,ptr:l})}function Re(e){return"undefined"==typeof FinalizationRegistry?(Re=e=>e,e):(Se=new FinalizationRegistry((e=>{Me(e.$$)})),Re=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Se.register(e,n,e)}return e},be=e=>Se.unregister(e),Re(e))}function Le(){if(this.$$.ptr||ye(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Re(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 Ne(){this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&fe("Object already scheduled for deletion"),be(this),Me(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Fe(){return!this.$$.ptr}function Ve(){return this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&fe("Object already scheduled for deletion"),_e.push(this),1===_e.length&&xe&&xe(De),this.$$.deleteScheduled=!0,this}function Ue(){}function je(e,t,n){if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||fe("Function '"+n+"' 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[r.argCount]=r}}function Be(e,t,n){i.hasOwnProperty(e)?((void 0===n||void 0!==i[e].overloadTable&&void 0!==i[e].overloadTable[n])&&fe("Cannot register public name '"+e+"' twice"),je(i,e,e),i.hasOwnProperty(n)&&fe("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),i[e].overloadTable[n]=t):(i[e]=t,void 0!==n&&(i[e].numArguments=n))}function Ge(e,t,n,r,a,i,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=a,this.getActualType=i,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}function He(e,t,n){for(;t!==n;)t.upcast||fe("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function We(e,t){if(null===t)return this.isReference&&fe("null is not a valid "+this.name),0;t.$$||fe('Cannot pass "'+ht(t)+'" as a '+this.name),t.$$.ptr||fe("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass;return He(t.$$.ptr,n,this.registeredClass)}function ze(e,t){var n;if(null===t)return this.isReference&&fe("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||fe('Cannot pass "'+ht(t)+'" as a '+this.name),t.$$.ptr||fe("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&fe("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;if(n=He(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&fe("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:fe("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var a=t.clone();n=this.rawShare(n,mt.toHandle((function(){a.delete()}))),null!==e&&e.push(this.rawDestructor,n)}break;default:fe("Unsupporting sharing policy")}return n}function qe(e,t){if(null===t)return this.isReference&&fe("null is not a valid "+this.name),0;t.$$||fe('Cannot pass "'+ht(t)+'" as a '+this.name),t.$$.ptr||fe("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&fe("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;return He(t.$$.ptr,n,this.registeredClass)}function Ye(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function $e(e){this.rawDestructor&&this.rawDestructor(e)}function Ke(e){null!==e&&e.delete()}function Qe(e,t,n,r,a,i,o,s,l,c,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,a||void 0!==t.baseClass?this.toWireType=ze:r?(this.toWireType=We,this.destructorFunction=null):(this.toWireType=qe,this.destructorFunction=null)}function Xe(e,t,n){i.hasOwnProperty(e)||ce("Replacing nonexistant public symbol"),void 0!==i[e].overloadTable&&void 0!==n?i[e].overloadTable[n]=t:(i[e]=t,i[e].argCount=n)}var Je=[];function Ze(e){var t=Je[e];return t||(e>=Je.length&&(Je.length=e+1),Je[e]=t=R.get(e)),t}function et(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):Ze(t).apply(null,n)}function tt(e,t){var n,r,a,i=(e=he(e)).includes("j")?(n=e,r=t,a=[],function(){return a.length=0,Object.assign(a,arguments),et(n,r,a)}):Ze(t);return"function"!=typeof i&&fe("unknown function pointer with signature "+e+": "+t),i}var nt=void 0;function rt(e){var t=At(e),n=he(t);return kt(t),n}function at(e,t){var n=[],r={};throw t.forEach((function e(t){r[t]||te[t]||(ne[t]?ne[t].forEach(e):(n.push(t),r[t]=!0))})),new nt(e+": "+n.map(rt).join([", "]))}function it(e,t){for(var n=[],r=0;r<e;r++)n.push(_[t+4*r>>2]);return n}function ot(e,t,n,r,a){var i=t.length;i<2&&fe("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==t[1]&&null!==n,s=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){s=!0;break}var c="void"!==t[0].name,u="",d="";for(l=0;l<i-2;++l)u+=(0!==l?", ":"")+"arg"+l,d+=(0!==l?", ":"")+"arg"+l+"Wired";var m="return function "+ie(e)+"("+u+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(m+="var destructors = [];\n");var h=s?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],f=[fe,r,a,J,t[0],t[1]];for(o&&(m+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<i-2;++l)m+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",p.push("argType"+l),f.push(t[l+2]);if(o&&(d="thisWired"+(d.length>0?", ":"")+d),m+=(c?"var rv = ":"")+"invoker(fn"+(d.length>0?", ":"")+d+");\n",s)m+="runDestructors(destructors);\n";else for(l=o?1:2;l<t.length;++l){var v=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(m+=v+"_dtor("+v+"); // "+t[l].name+"\n",p.push(v+"_dtor"),f.push(t[l].destructorFunction))}return c&&(m+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),m+="}\n",p.push(m),function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=oe(e.name||"unknownFunctionName",(function(){}));n.prototype=e.prototype;var r=new n,a=e.apply(r,t);return a instanceof Object?a:r}(Function,p).apply(null,f)}var st=[],lt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ct(e){e>4&&0==--lt[e].refcount&&(lt[e]=void 0,st.push(e))}function ut(){for(var e=0,t=5;t<lt.length;++t)void 0!==lt[t]&&++e;return e}function dt(){for(var e=5;e<lt.length;++e)if(void 0!==lt[e])return lt[e];return null}var mt={toValue:e=>(e||fe("Cannot use deleted val. handle = "+e),lt[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=st.length?st.pop():lt.length;return lt[t]={refcount:1,value:e},t}}};function ht(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function pt(e,t){switch(t){case 2:return function(e){return this.fromWireType(D[e>>2])};case 3:return function(e){return this.fromWireType(x[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function ft(e,t,n){switch(t){case 0:return n?function(e){return M[e]}:function(e){return w[e]};case 1:return n?function(e){return C[e>>1]}:function(e){return E[e>>1]};case 2:return n?function(e){return I[e>>2]}:function(e){return _[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var vt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function gt(e,t){for(var n=e,r=n>>1,a=r+t/2;!(r>=a)&&E[r];)++r;if((n=r<<1)-e>32&&vt)return vt.decode(w.subarray(e,n));for(var i="",o=0;!(o>=t/2);++o){var s=C[e+2*o>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function yt(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,a=(n-=2)<2*e.length?n/2:e.length,i=0;i<a;++i){var o=e.charCodeAt(i);C[t>>1]=o,t+=2}return C[t>>1]=0,t-r}function St(e){return 2*e.length}function bt(e,t){for(var n=0,r="";!(n>=t/4);){var a=I[e+4*n>>2];if(0==a)break;if(++n,a>=65536){var i=a-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(a)}return r}function Mt(e,t,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t,a=r+n-4,i=0;i<e.length;++i){var o=e.charCodeAt(i);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),I[t>>2]=o,(t+=4)+4>a)break}return I[t>>2]=0,t-r}function wt(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t}var Ct={};function Et(){return"object"==typeof globalThis?globalThis:Function("return this")()}function It(e,t){var n=te[e];return void 0===n&&fe(t+" has unknown type "+rt(e)),n}var _t={};function Dt(e){try{return S.grow(e-b.byteLength+65535>>>16),O(S.buffer),1}catch(e){}}le=i.InternalError=se(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);me=e}(),pe=i.BindingError=se(Error,"BindingError"),Ue.prototype.isAliasOf=ge,Ue.prototype.clone=Le,Ue.prototype.delete=Ne,Ue.prototype.isDeleted=Fe,Ue.prototype.deleteLater=Ve,i.getInheritedInstanceCount=Ee,i.getLiveInheritedInstances=Ie,i.flushPendingDeletes=De,i.setDelayFunction=Te,Qe.prototype.getPointee=Ye,Qe.prototype.destructor=$e,Qe.prototype.argPackAdvance=8,Qe.prototype.readValueFromPointer=Z,Qe.prototype.deleteObject=Ke,Qe.prototype.fromWireType=Oe,nt=i.UnboundTypeError=se(Error,"UnboundTypeError"),i.count_emval_handles=ut,i.get_first_emval=dt;var xt,Tt={h:function(e,t,n){throw new Q(e).init(t,n),e},q:function(e){var t=X[e];delete X[e];var n=t.rawConstructor,r=t.rawDestructor,a=t.fields;ue([e],a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType))),(e=>{var i={};return a.forEach(((t,n)=>{var r=t.fieldName,o=e[n],s=t.getter,l=t.getterContext,c=e[n+a.length],u=t.setter,d=t.setterContext;i[r]={read:e=>o.fromWireType(s(l,e)),write:(e,t)=>{var n=[];u(d,e,c.toWireType(n,t)),J(n)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var n in i)t[n]=i[n].read(e);return r(e),t},toWireType:function(e,t){for(var a in i)if(!(a in t))throw new TypeError('Missing field: "'+a+'"');var o=n();for(a in i)i[a].write(o,t[a]);return null!==e&&e.push(r,o),o},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:r}]}))},r:function(e,t,n,r,a){},w:function(e,t,n,r,a){var i=de(n);ve(e,{name:t=he(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:a},argPackAdvance:8,readValueFromPointer:function(e){var r;if(1===n)r=M;else if(2===n)r=C;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+t);r=I}return this.fromWireType(r[e>>i])},destructorFunction:null})},p:function(e,t,n,r,a,i,o,s,l,c,u,d,m){u=he(u),i=tt(a,i),s&&(s=tt(o,s)),c&&(c=tt(l,c)),m=tt(d,m);var h=ie(u);Be(h,(function(){at("Cannot construct "+u+" due to unbound types",[r])})),ue([e,t,n],r?[r]:[],(function(t){var n,a;t=t[0],a=r?(n=t.registeredClass).instancePrototype:Ue.prototype;var o=oe(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new pe("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new pe(u+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new pe("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),l=Object.create(a,{constructor:{value:o}});o.prototype=l;var d=new Ge(u,o,l,m,n,i,s,c),p=new Qe(u,d,!0,!1,!1),f=new Qe(u+"*",d,!1,!1,!1),v=new Qe(u+" const*",d,!1,!0,!1);return Ce[e]={pointerType:f,constPointerType:v},Xe(h,o),[p,f,v]}))},o:function(e,t,n,r,a,i){var o;t>0||B(o);var s=it(t,n);a=tt(r,a),ue([],[e],(function(e){var n="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 pe("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]=()=>{at("Cannot construct "+e.name+" due to unbound types",s)},ue([],s,(function(r){return r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=ot(n,r,null,a,i),[]})),[]}))},c:function(e,t,n,r,a,i,o,s){var l=it(n,r);t=he(t),i=tt(a,i),ue([],[e],(function(e){var r=(e=e[0]).name+"."+t;function a(){at("Cannot call "+r+" due to unbound types",l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,u=c[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===n-2?(a.argCount=n-2,a.className=e.name,c[t]=a):(je(c,t,r),c[t].overloadTable[n-2]=a),ue([],l,(function(a){var s=ot(r,a,e,i,o);return void 0===c[t].overloadTable?(s.argCount=n-2,c[t]=s):c[t].overloadTable[n-2]=s,[]})),[]}))},v:function(e,t){ve(e,{name:t=he(t),fromWireType:function(e){var t=mt.toValue(e);return ct(e),t},toWireType:function(e,t){return mt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:null})},k:function(e,t,n){var r=de(n);ve(e,{name:t=he(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:pt(t,r),destructorFunction:null})},e:function(e,t,n,r,a,i){var o=it(t,n);e=he(e),a=tt(r,a),Be(e,(function(){at("Cannot call "+e+" due to unbound types",o)}),t-1),ue([],o,(function(n){var r=[n[0],null].concat(n.slice(1));return Xe(e,ot(e,r,null,a,i),t-1),[]}))},b:function(e,t,n,r,a){t=he(t),-1===a&&(a=4294967295);var i=de(n),o=e=>e;if(0===r){var s=32-8*n;o=e=>e<<s>>>s}var l=t.includes("unsigned");ve(e,{name:t,fromWireType:o,toWireType:l?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:ft(t,i,0!==r),destructorFunction:null})},a:function(e,t,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function a(e){var t=_,n=t[e>>=2],a=t[e+1];return new r(b,a,n)}ve(e,{name:n=he(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},j:function(e,t){var n="std::string"===(t=he(t));ve(e,{name:t,fromWireType:function(e){var t,r=_[e>>2],a=e+4;if(n)for(var i=a,o=0;o<=r;++o){var s=a+o;if(o==r||0==w[s]){var l=A(i,s-i);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),i=s+1}}else{var c=new Array(r);for(o=0;o<r;++o)c[o]=String.fromCharCode(w[a+o]);t=c.join("")}return kt(e),t},toWireType:function(e,t){var r;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||fe("Cannot pass non-string to std::string"),r=n&&a?function(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t}(t):t.length;var i=Pt(4+r+1),o=i+4;if(_[i>>2]=r,n&&a)k(t,o,r+1);else if(a)for(var s=0;s<r;++s){var l=t.charCodeAt(s);l>255&&(kt(o),fe("String has UTF-16 code units that do not fit in 8 bits")),w[o+s]=l}else for(s=0;s<r;++s)w[o+s]=t[s];return null!==e&&e.push(kt,i),i},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:function(e){kt(e)}})},g:function(e,t,n){var r,a,i,o,s;n=he(n),2===t?(r=gt,a=yt,o=St,i=()=>E,s=1):4===t&&(r=bt,a=Mt,o=wt,i=()=>_,s=2),ve(e,{name:n,fromWireType:function(e){for(var n,a=_[e>>2],o=i(),l=e+4,c=0;c<=a;++c){var u=e+4+c*t;if(c==a||0==o[u>>s]){var d=r(l,u-l);void 0===n?n=d:(n+=String.fromCharCode(0),n+=d),l=u+t}}return kt(e),n},toWireType:function(e,r){"string"!=typeof r&&fe("Cannot pass non-string to C++ string type "+n);var i=o(r),l=Pt(4+i+t);return _[l>>2]=i>>s,a(r,l+4,i+t),null!==e&&e.push(kt,l),l},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:function(e){kt(e)}})},u:function(e,t,n,r,a,i){X[e]={name:he(t),rawConstructor:tt(n,r),rawDestructor:tt(a,i),fields:[]}},d:function(e,t,n,r,a,i,o,s,l,c){X[e].fields.push({fieldName:he(t),getterReturnType:n,getter:tt(r,a),getterContext:i,setterArgumentType:o,setter:tt(s,l),setterContext:c})},x:function(e,t){ve(e,{isVoid:!0,name:t=he(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},i:ct,m:function(e){return 0===e?mt.toHandle(Et()):(e=void 0===(n=Ct[t=e])?he(t):n,mt.toHandle(Et()[e]));var t,n},l:function(e){e>4&&(lt[e].refcount+=1)},y:function(e,t,n,r){e=mt.toValue(e);var a=_t[t];return a||(a=function(e){for(var t="",n=0;n<e;++n)t+=(0!==n?", ":"")+"arg"+n;var r="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(n=0;n<e;++n)r+="var argType"+n+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+n+"');\nvar arg"+n+" = argType"+n+".readValueFromPointer(args);\nargs += argType"+n+"['argPackAdvance'];\nargTypes += 4;\n";return r+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",r)(It,i,mt.toHandle,(()=>_))}(t),_t[t]=a),a(e,n,r)},n:function(e,t){var n=(e=It(e,"_emval_take_value")).readValueFromPointer(t);return mt.toHandle(n)},f:function(){B("")},t:function(e,t,n){w.copyWithin(e,t,t+n)},s:function(e){var t,n,r=w.length,a=2147483648;if((e>>>=0)>a)return!1;for(var i=1;i<=4;i*=2){var o=r*(1+.2/i);if(o=Math.min(o,e+100663296),Dt(Math.min(a,(t=Math.max(e,o))+((n=65536)-t%n)%n)))return!0}return!1}},Pt=(function(){var e={a:Tt};function t(e,t){var n,r=e.exports;i.asm=r,O((S=i.asm.z).buffer),R=i.asm.C,n=i.asm.A,N.unshift(n),function(e){if(V--,i.monitorRunDependencies&&i.monitorRunDependencies(V),0==V&&(null!==U&&(clearInterval(U),U=null),j)){var t=j;j=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||m)){if("function"==typeof fetch&&!q(G))return fetch(G,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+G+"'";return e.arrayBuffer()})).catch((function(){return Y(G)}));if(s)return new Promise((function(e,t){s(G,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return Y(G)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),B(e)}))}if(V++,i.monitorRunDependencies&&i.monitorRunDependencies(V),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){y("Module.instantiateWasm callback failed with error: "+e),a(e)}(g||"function"!=typeof WebAssembly.instantiateStreaming||z(G)||q(G)||h||"function"!=typeof fetch?r(n):fetch(G,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.A).apply(null,arguments)},i._malloc=function(){return(Pt=i._malloc=i.asm.B).apply(null,arguments)}),At=i.___getTypeName=function(){return(At=i.___getTypeName=i.asm.D).apply(null,arguments)},kt=(i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm.E).apply(null,arguments)},i._free=function(){return(kt=i._free=i.asm.F).apply(null,arguments)}),Ot=i.stackSave=function(){return(Ot=i.stackSave=i.asm.G).apply(null,arguments)},Rt=i.stackRestore=function(){return(Rt=i.stackRestore=i.asm.H).apply(null,arguments)},Lt=i.stackAlloc=function(){return(Lt=i.stackAlloc=i.asm.I).apply(null,arguments)},Nt=i.___cxa_is_pointer_type=function(){return(Nt=i.___cxa_is_pointer_type=i.asm.J).apply(null,arguments)};function Ft(e){function n(){xt||(xt=!0,i.calledRun=!0,T||(K(N),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),F.unshift(e);var e;K(F)}()))}e=e||u,V>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),L.unshift(e);var e;K(L)}(),V>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),n()}),1)):n()))}if(i.ccall=function(e,t,n,r,a){var o={string:e=>{var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);k(e,t=Lt(n),n)}return t},array:e=>{var t=Lt(e.length);return function(e,t){M.set(e,t)}(e,t),t}},s=function(e){return i["_"+e]}(e),l=[],c=0;if(r)for(var u=0;u<r.length;u++){var d=o[n[u]];d?(0===c&&(c=Ot()),l[u]=d(r[u])):l[u]=r[u]}var m=s.apply(null,l);return m=function(e){return 0!==c&&Rt(c),function(e){return"string"===t?A(e):"boolean"===t?Boolean(e):e}(e)}(m)},j=function e(){xt||Ft(),xt||(j=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ft(),e.ready});e.exports=a},36317:(e,t,n)=>{var r,a=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,a,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,n){t=e,a=n}));var o,s,l,c=Object.assign({},i),u=[],d="./this.program",m=(e,t)=>{throw t},h="object"==typeof window,p="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";if(f){var g=n(1404),y=n(40604);v=p?y.dirname(v)+"/":"//",o=(e,t)=>(e=J(e)?new URL(e):y.normalize(e),g.readFileSync(e,t?void 0:"utf8")),l=e=>{var t=o(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,n)=>{e=J(e)?new URL(e):y.normalize(e),g.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),u=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ee))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(H())throw process.exitCode=e,t;!function(e){e instanceof ee||M("exiting due to exception: "+e)}(t),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}}else(h||p)&&(p?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),r&&(v=r),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},p&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var S,b=i.print||console.log.bind(console),M=i.printErr||console.warn.bind(console);Object.assign(i,c),c=null,i.arguments&&(u=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(S=i.wasmBinary);var w,C=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&Y("no native wasm support detected");var E,I,_,D,x,T,P,A,k,O=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(e,t,n){for(var r=t+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&R)return R.decode(e.subarray(t,a));for(var i="";t<a;){var o=e[t++];if(128&o){var s=63&e[t++];if(192!=(224&o)){var l=63&e[t++];if((o=224==(240&o)?(15&o)<<12|s<<6|l:(7&o)<<18|s<<12|l<<6|63&e[t++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i}function N(e,t){return e?L(_,e,t):""}function F(e,t,n){return function(e,t,n,r){if(!(r>0))return 0;for(var a=n,i=n+r-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-a}(e,_,t,n)}function V(e){E=e,i.HEAP8=I=new Int8Array(e),i.HEAP16=D=new Int16Array(e),i.HEAP32=T=new Int32Array(e),i.HEAPU8=_=new Uint8Array(e),i.HEAPU16=x=new Uint16Array(e),i.HEAPU32=P=new Uint32Array(e),i.HEAPF32=A=new Float32Array(e),i.HEAPF64=k=new Float64Array(e)}i.INITIAL_MEMORY;var U,j=[],B=[],G=[];function H(){return C}var W=0,z=null,q=null;function Y(e){i.onAbort&&i.onAbort(e),M(e="Aborted("+e+")"),O=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw a(t),t}var $,K,Q="data:application/octet-stream;base64,";function X(e){return e.startsWith(Q)}function J(e){return e.startsWith("file://")}function Z(e){try{if(e==$&&S)return new Uint8Array(S);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(e){Y(e)}}function ee(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function te(e){for(;e.length>0;)e.shift()(i)}function ne(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){P[this.ptr+4>>2]=e},this.get_type=function(){return P[this.ptr+4>>2]},this.set_destructor=function(e){P[this.ptr+8>>2]=e},this.get_destructor=function(){return P[this.ptr+8>>2]},this.set_refcount=function(e){T[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,I[this.ptr+12|0]=e},this.get_caught=function(){return 0!=I[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,I[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=I[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=T[this.ptr>>2];T[this.ptr>>2]=e+1},this.release_ref=function(){var e=T[this.ptr>>2];return T[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){P[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return P[this.ptr+16>>2]},this.get_exception_ptr=function(){if(qt(this.get_type()))return P[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}X($="libjpegturbowasm_decode.wasm")||(K=$,$=i.locateFile?i.locateFile(K,v):v+K);var re={};function ae(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function ie(e){return this.fromWireType(T[e>>2])}var oe={},se={},le={},ce=48,ue=57;function de(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=ce&&t<=ue?"_"+e:e}function me(e,t){return e=de(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function he(e,t){var n=me(t,(function(e){this.name=t,this.message=e;var n=new Error(e).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var pe=void 0;function fe(e){throw new pe(e)}function ve(e,t,n){function r(t){var r=n(t);r.length!==e.length&&fe("Mismatched type converter count");for(var a=0;a<e.length;++a)we(e[a],r[a])}e.forEach((function(e){le[e]=t}));var a=new Array(t.length),i=[],o=0;t.forEach(((e,t)=>{se.hasOwnProperty(e)?a[t]=se[e]:(i.push(e),oe.hasOwnProperty(e)||(oe[e]=[]),oe[e].push((()=>{a[t]=se[e],++o===i.length&&r(a)})))})),0===i.length&&r(a)}function ge(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var ye=void 0;function Se(e){for(var t="",n=e;_[n];)t+=ye[_[n++]];return t}var be=void 0;function Me(e){throw new be(e)}function we(e,t,n={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(e||Me('type "'+r+'" must have a positive integer typeid pointer'),se.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Me("Cannot register type '"+r+"' twice")}if(se[e]=t,delete le[e],oe.hasOwnProperty(e)){var a=oe[e];delete oe[e],a.forEach((e=>e()))}}function Ce(e){if(!(this instanceof ze))return!1;if(!(e instanceof ze))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)a=r.upcast(a),r=r.baseClass;return t===r&&n===a}function Ee(e){Me(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ie=!1;function _e(e){}function De(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 xe(e,t,n){if(t===n)return e;if(void 0===n.baseClass)return null;var r=xe(e,t,n.baseClass);return null===r?null:n.downcast(r)}var Te={};function Pe(){return Object.keys(Ne).length}function Ae(){var e=[];for(var t in Ne)Ne.hasOwnProperty(t)&&e.push(Ne[t]);return e}var ke=[];function Oe(){for(;ke.length;){var e=ke.pop();e.$$.deleteScheduled=!1,e.delete()}}var Re=void 0;function Le(e){Re=e,ke.length&&Re&&Re(Oe)}var Ne={};function Fe(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),Ne[t]}function Ve(e,t){return t.ptrType&&t.ptr||fe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&fe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},je(Object.create(e,{$$:{value:t}}))}function Ue(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=Fe(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function a(){return this.isSmartPointer?Ve(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ve(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,o=this.registeredClass.getActualType(t),s=Te[o];if(!s)return a.call(this);i=this.isConst?s.constPointerType:s.pointerType;var l=xe(t,this.registeredClass,i.registeredClass);return null===l?a.call(this):this.isSmartPointer?Ve(i.registeredClass.instancePrototype,{ptrType:i,ptr:l,smartPtrType:this,smartPtr:e}):Ve(i.registeredClass.instancePrototype,{ptrType:i,ptr:l})}function je(e){return"undefined"==typeof FinalizationRegistry?(je=e=>e,e):(Ie=new FinalizationRegistry((e=>{De(e.$$)})),je=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Ie.register(e,n,e)}return e},_e=e=>Ie.unregister(e),je(e))}function Be(){if(this.$$.ptr||Ee(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=je(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 Ge(){this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Me("Object already scheduled for deletion"),_e(this),De(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function He(){return!this.$$.ptr}function We(){return this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Me("Object already scheduled for deletion"),ke.push(this),1===ke.length&&Re&&Re(Oe),this.$$.deleteScheduled=!0,this}function ze(){}function qe(e,t,n){if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Me("Function '"+n+"' 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[r.argCount]=r}}function Ye(e,t,n,r,a,i,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=a,this.getActualType=i,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}function $e(e,t,n){for(;t!==n;)t.upcast||Me("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Ke(e,t){if(null===t)return this.isReference&&Me("null is not a valid "+this.name),0;t.$$||Me('Cannot pass "'+gt(t)+'" as a '+this.name),t.$$.ptr||Me("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass;return $e(t.$$.ptr,n,this.registeredClass)}function Qe(e,t){var n;if(null===t)return this.isReference&&Me("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||Me('Cannot pass "'+gt(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 r=t.$$.ptrType.registeredClass;if(n=$e(t.$$.ptr,r,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?n=t.$$.smartPtr:Me("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var a=t.clone();n=this.rawShare(n,vt.toHandle((function(){a.delete()}))),null!==e&&e.push(this.rawDestructor,n)}break;default:Me("Unsupporting sharing policy")}return n}function Xe(e,t){if(null===t)return this.isReference&&Me("null is not a valid "+this.name),0;t.$$||Me('Cannot pass "'+gt(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 n=t.$$.ptrType.registeredClass;return $e(t.$$.ptr,n,this.registeredClass)}function Je(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Ze(e){this.rawDestructor&&this.rawDestructor(e)}function et(e){null!==e&&e.delete()}function tt(e,t,n,r,a,i,o,s,l,c,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,a||void 0!==t.baseClass?this.toWireType=Qe:r?(this.toWireType=Ke,this.destructorFunction=null):(this.toWireType=Xe,this.destructorFunction=null)}var nt=[];function rt(e){var t=nt[e];return t||(e>=nt.length&&(nt.length=e+1),nt[e]=t=U.get(e)),t}function at(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):rt(t).apply(null,n)}function it(e,t){var n,r,a,i=(e=Se(e)).includes("j")?(n=e,r=t,a=[],function(){return a.length=0,Object.assign(a,arguments),at(n,r,a)}):rt(t);return"function"!=typeof i&&Me("unknown function pointer with signature "+e+": "+t),i}var ot=void 0;function st(e){var t=Bt(e),n=Se(t);return jt(t),n}function lt(e,t){var n=[],r={};throw t.forEach((function e(t){r[t]||se[t]||(le[t]?le[t].forEach(e):(n.push(t),r[t]=!0))})),new ot(e+": "+n.map(st).join([", "]))}function ct(e,t){for(var n=[],r=0;r<e;r++)n.push(P[t+4*r>>2]);return n}function ut(e,t,n,r,a){var i=t.length;i<2&&Me("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==t[1]&&null!==n,s=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){s=!0;break}var c="void"!==t[0].name,u="",d="";for(l=0;l<i-2;++l)u+=(0!==l?", ":"")+"arg"+l,d+=(0!==l?", ":"")+"arg"+l+"Wired";var m="return function "+de(e)+"("+u+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(m+="var destructors = [];\n");var h=s?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],f=[Me,r,a,ae,t[0],t[1]];for(o&&(m+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<i-2;++l)m+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",p.push("argType"+l),f.push(t[l+2]);if(o&&(d="thisWired"+(d.length>0?", ":"")+d),m+=(c?"var rv = ":"")+"invoker(fn"+(d.length>0?", ":"")+d+");\n",s)m+="runDestructors(destructors);\n";else for(l=o?1:2;l<t.length;++l){var v=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(m+=v+"_dtor("+v+"); // "+t[l].name+"\n",p.push(v+"_dtor"),f.push(t[l].destructorFunction))}return c&&(m+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),m+="}\n",p.push(m),function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=me(e.name||"unknownFunctionName",(function(){}));n.prototype=e.prototype;var r=new n,a=e.apply(r,t);return a instanceof Object?a:r}(Function,p).apply(null,f)}var dt=[],mt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ht(e){e>4&&0==--mt[e].refcount&&(mt[e]=void 0,dt.push(e))}function pt(){for(var e=0,t=5;t<mt.length;++t)void 0!==mt[t]&&++e;return e}function ft(){for(var e=5;e<mt.length;++e)if(void 0!==mt[e])return mt[e];return null}var vt={toValue:e=>(e||Me("Cannot use deleted val. handle = "+e),mt[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=dt.length?dt.pop():mt.length;return mt[t]={refcount:1,value:e},t}}};function gt(e){if(null===e)return"null";var t=typeof 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(A[e>>2])};case 3:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function St(e,t,n){switch(t){case 0:return n?function(e){return I[e]}:function(e){return _[e]};case 1:return n?function(e){return D[e>>1]}:function(e){return x[e>>1]};case 2:return n?function(e){return T[e>>2]}:function(e){return P[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var bt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Mt(e,t){for(var n=e,r=n>>1,a=r+t/2;!(r>=a)&&x[r];)++r;if((n=r<<1)-e>32&&bt)return bt.decode(_.subarray(e,n));for(var i="",o=0;!(o>=t/2);++o){var s=D[e+2*o>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function wt(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,a=(n-=2)<2*e.length?n/2:e.length,i=0;i<a;++i){var o=e.charCodeAt(i);D[t>>1]=o,t+=2}return D[t>>1]=0,t-r}function Ct(e){return 2*e.length}function Et(e,t){for(var n=0,r="";!(n>=t/4);){var a=T[e+4*n>>2];if(0==a)break;if(++n,a>=65536){var i=a-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(a)}return r}function It(e,t,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t,a=r+n-4,i=0;i<e.length;++i){var o=e.charCodeAt(i);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),T[t>>2]=o,(t+=4)+4>a)break}return T[t>>2]=0,t-r}function _t(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t}var Dt={};function xt(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Tt(e,t){var n=se[e];return void 0===n&&Me(t+" has unknown type "+st(e)),n}var Pt={};function At(e){try{return w.grow(e-E.byteLength+65535>>>16),V(w.buffer),1}catch(e){}}var kt={};function Ot(){if(!Ot.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var t in kt)void 0===kt[t]?delete e[t]:e[t]=kt[t];var n=[];for(var t in e)n.push(t+"="+e[t]);Ot.strings=n}return Ot.strings}var Rt=function(e,t){var n;n=e,H()||(i.onExit&&i.onExit(n),O=!0),m(n,new ee(n))},Lt=[null,[],[]];function Nt(e,t){var n=Lt[e];0===t||10===t