-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Expand file tree
/
Copy path523d49a98c9fd3340800.js
More file actions
1 lines (1 loc) · 28.1 KB
/
Copy path523d49a98c9fd3340800.js
File metadata and controls
1 lines (1 loc) · 28.1 KB
1
var BASIS=(()=>{var e="undefined"!=typeof document?document.currentScript?.src:void 0;return"undefined"!=typeof __filename&&(e||=__filename),function(r={}){var t,n,a,o,s=r,i=new Promise(((e,r)=>{t=e,n=r})),u="object"==typeof window,l="function"==typeof importScripts,c="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p=Object.assign({},s),d="";if(c){var h=require("fs"),f=require("path");d=__dirname+"/",o=e=>(e=V(e)?new URL(e):f.normalize(e),h.readFileSync(e)),a=(e,r=!0)=>(e=V(e)?new URL(e):f.normalize(e),new Promise(((t,n)=>{h.readFile(e,r?void 0:"utf8",((e,a)=>{e?n(e):t(r?a.buffer:a)}))}))),!s.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else(u||l)&&(l?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),e&&(d=e),d=d.startsWith("blob:")?"":d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1),l&&(o=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),a=e=>V(e)?new Promise(((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{(200==n.status||0==n.status&&n.response)&&t(n.response),r(n.status)},n.onerror=r,n.send(null)})):fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url)))));var v,y,m=s.print||console.log.bind(console),g=s.printErr||console.error.bind(console);Object.assign(s,p),p=null,s.arguments&&s.arguments,s.thisProgram&&s.thisProgram,s.quit&&s.quit,s.wasmBinary&&(v=s.wasmBinary);var $,w,T,b,C,P,A,W,_=!1;function S(){var e=y.buffer;s.HEAP8=$=new Int8Array(e),s.HEAP16=T=new Int16Array(e),s.HEAPU8=w=new Uint8Array(e),s.HEAPU16=b=new Uint16Array(e),s.HEAP32=C=new Int32Array(e),s.HEAPU32=P=new Uint32Array(e),s.HEAPF32=A=new Float32Array(e),s.HEAPF64=W=new Float64Array(e)}var F=[],j=[],E=[],k=0,O=null,R=null;function D(e){s.onAbort?.(e),g(e="Aborted("+e+")"),_=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var I,x=e=>e.startsWith("data:application/octet-stream;base64,"),V=e=>e.startsWith("file://");function U(e){if(e==I&&v)return new Uint8Array(v);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}function H(e,r,t){return function(e){return v?Promise.resolve().then((()=>U(e))):a(e).then((e=>new Uint8Array(e)),(()=>U(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then(t,(e=>{g(`failed to asynchronously prepare wasm: ${e}`),D(e)}))}var B=e=>{for(;e.length>0;)e.shift()(s)};s.noExitRuntime;class M{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){P[this.ptr+4>>2]=e}get_type(){return P[this.ptr+4>>2]}set_destructor(e){P[this.ptr+8>>2]=e}get_destructor(){return P[this.ptr+8>>2]}set_caught(e){e=e?1:0,$[this.ptr+12]=e}get_caught(){return 0!=$[this.ptr+12]}set_rethrown(e){e=e?1:0,$[this.ptr+13]=e}get_rethrown(){return 0!=$[this.ptr+13]}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){P[this.ptr+16>>2]=e}get_adjusted_ptr(){return P[this.ptr+16>>2]}get_exception_ptr(){if(gr(this.get_type()))return P[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var q={},N=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function z(e){return this.fromWireType(P[e>>2])}var L,G,X,J={},K={},Q={},Z=e=>{throw new L(e)},Y=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Z("Mismatched type converter count");for(var a=0;a<e.length;++a)te(e[a],n[a])}e.forEach((function(e){Q[e]=r}));var a=new Array(r.length),o=[],s=0;r.forEach(((e,r)=>{K.hasOwnProperty(e)?a[r]=K[e]:(o.push(e),J.hasOwnProperty(e)||(J[e]=[]),J[e].push((()=>{a[r]=K[e],++s===o.length&&n(a)})))})),0===o.length&&n(a)},ee=e=>{for(var r="",t=e;w[t];)r+=G[w[t++]];return r},re=e=>{throw new X(e)};function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||re(`type "${n}" must have a positive integer typeid pointer`),K.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;re(`Cannot register type '${n}' twice`)}if(K[e]=r,delete Q[e],J.hasOwnProperty(e)){var a=J[e];delete J[e],a.forEach((e=>e()))}}(e,r,t)}var ne,ae=e=>{re(e.$$.ptrType.registeredClass.name+" instance already deleted")},oe=!1,se=e=>{},ie=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},ue=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=ue(e,r,t.baseClass);return null===n?null:t.downcast(n)},le={},ce=[],pe=()=>{for(;ce.length;){var e=ce.pop();e.$$.deleteScheduled=!1,e.delete()}},de={},he=(e,r)=>(r.ptrType&&r.ptr||Z("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Z("Both smartPtrType and smartPtr must be specified"),r.count={value:1},fe(Object.create(e,{$$:{value:r,writable:!0}})));var fe=e=>"undefined"==typeof FinalizationRegistry?(fe=e=>e,e):(oe=new FinalizationRegistry((e=>{ie(e.$$)})),fe=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r};oe.register(e,t,e)}return e},se=e=>oe.unregister(e),fe(e));function ve(){}var ye=(e,r)=>Object.defineProperty(r,"name",{value:e}),me=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||re(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},ge=(e,r,t)=>{s.hasOwnProperty(e)?((void 0===t||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[t])&&re(`Cannot register public name '${e}' twice`),me(s,e,e),s.hasOwnProperty(t)&&re(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),s[e].overloadTable[t]=r):(s[e]=r,void 0!==t&&(s[e].numArguments=t))};function $e(e,r,t,n,a,o,s,i){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=i,this.pureVirtualFunctions=[]}var we=(e,r,t)=>{for(;r!==t;)r.upcast||re(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Te(e,r){if(null===r)return this.isReference&&re(`null is not a valid ${this.name}`),0;r.$$||re(`Cannot pass "${Ge(r)}" as a ${this.name}`),r.$$.ptr||re(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return we(r.$$.ptr,t,this.registeredClass)}function be(e,r){var t;if(null===r)return this.isReference&&re(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||re(`Cannot pass "${Ge(r)}" as a ${this.name}`),r.$$.ptr||re(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&re(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=we(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&re("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:re(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var a=r.clone();t=this.rawShare(t,qe.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:re("Unsupporting sharing policy")}return t}function Ce(e,r){if(null===r)return this.isReference&&re(`null is not a valid ${this.name}`),0;r.$$||re(`Cannot pass "${Ge(r)}" as a ${this.name}`),r.$$.ptr||re(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&re(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return we(r.$$.ptr,t,this.registeredClass)}function Pe(e,r,t,n,a,o,s,i,u,l,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,a||void 0!==r.baseClass?this.toWireType=be:n?(this.toWireType=Te,this.destructorFunction=null):(this.toWireType=Ce,this.destructorFunction=null)}var Ae,We,_e=(e,r,t)=>{s.hasOwnProperty(e)||Z("Replacing nonexistent public symbol"),void 0!==s[e].overloadTable&&void 0!==t?s[e].overloadTable[t]=r:(s[e]=r,s[e].argCount=t)},Se=[],Fe=e=>{var r=Se[e];return r||(e>=Se.length&&(Se.length=e+1),Se[e]=r=Ae.get(e)),r},je=(e,r)=>{var t,n,a=(e=ee(e)).includes("j")?(t=e,n=r,(...e)=>((e,r,t=[])=>e.includes("j")?((e,r,t)=>(e=e.replace(/p/g,"i"),(0,s["dynCall_"+e])(r,...t)))(e,r,t):Fe(r)(...t))(t,n,e)):Fe(r);return"function"!=typeof a&&re(`unknown function pointer with signature ${e}: ${r}`),a},Ee=e=>{var r=vr(e),t=ee(r);return mr(r),t},ke=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||K[r]||(Q[r]?Q[r].forEach(e):(t.push(r),n[r]=!0))})),new We(`${e}: `+t.map(Ee).join([", "]))},Oe=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(P[r+4*n>>2]);return t};function Re(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function De(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=ye(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,a=e.apply(n,r);return a instanceof Object?a:n}function Ie(e,r,t,n,a,o){var s=r.length;s<2&&re("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==r[1]&&null!==t,u=Re(r),l="void"!==r[0].name,c=[e,re,n,a,N,r[0],r[1]],p=0;p<s-2;++p)c.push(r[p+2]);if(!u)for(p=i?1:2;p<r.length;++p)null!==r[p].destructorFunction&&c.push(r[p].destructorFunction);let[d,h]=function(e,r,t,n){for(var a=Re(e),o=e.length,s="",i="",u=0;u<o-2;++u)s+=(0!==u?", ":"")+"arg"+u,i+=(0!==u?", ":"")+"arg"+u+"Wired";var l=`\n return function (${s}) {\n if (arguments.length !== ${o-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${o-2}');\n }`;a&&(l+="var destructors = [];\n");var c=a?"destructors":"null",p=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(l+="var thisWired = classParam['toWireType']("+c+", this);\n"),u=0;u<o-2;++u)l+="var arg"+u+"Wired = argType"+u+"['toWireType']("+c+", arg"+u+");\n",p.push("argType"+u);if(r&&(i="thisWired"+(i.length>0?", ":"")+i),l+=(t||n?"var rv = ":"")+"invoker(fn"+(i.length>0?", ":"")+i+");\n",a)l+="runDestructors(destructors);\n";else for(u=r?1:2;u<e.length;++u){var d=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(l+=`${d}_dtor(${d});\n`,p.push(`${d}_dtor`))}return t&&(l+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[p,l+="}\n"]}(r,i,l,o);d.push(h);var f=De(Function,d)(...c);return ye(e,f)}var xe,Ve,Ue=e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?e.substr(0,r):e},He=[],Be=[],Me=e=>{e>9&&0==--Be[e+1]&&(Be[e]=void 0,He.push(e))},qe={toValue:e=>(e||re("Cannot use deleted val. handle = "+e),Be[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=He.pop()||Be.length;return Be[r]=e,Be[r+1]=1,r}}}},Ne={name:"emscripten::val",fromWireType:e=>{var r=qe.toValue(e);return Me(e),r},toWireType:(e,r)=>qe.toHandle(r),argPackAdvance:8,readValueFromPointer:z,destructorFunction:null},ze=(e,r,t)=>{switch(r){case 1:return t?function(e){return this.fromWireType($[e])}:function(e){return this.fromWireType(w[e])};case 2:return t?function(e){return this.fromWireType(T[e>>1])}:function(e){return this.fromWireType(b[e>>1])};case 4:return t?function(e){return this.fromWireType(C[e>>2])}:function(e){return this.fromWireType(P[e>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Le=(e,r)=>{var t=K[e];return void 0===t&&re(`${r} has unknown type ${Ee(e)}`),t},Ge=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},Xe=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(A[e>>2])};case 8:return function(e){return this.fromWireType(W[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Je=(e,r,t)=>{switch(r){case 1:return t?e=>$[e]:e=>w[e];case 2:return t?e=>T[e>>1]:e=>b[e>>1];case 4:return t?e=>C[e>>2]:e=>P[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Ke="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Qe=(e,r,t)=>{for(var n=r+t,a=r;e[a]&&!(a>=n);)++a;if(a-r>16&&e.buffer&&Ke)return Ke.decode(e.subarray(r,a));for(var o="";r<a;){var s=e[r++];if(128&s){var i=63&e[r++];if(192!=(224&s)){var u=63&e[r++];if((s=224==(240&s)?(15&s)<<12|i<<6|u:(7&s)<<18|i<<12|u<<6|63&e[r++])<65536)o+=String.fromCharCode(s);else{var l=s-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&s)<<6|i)}else o+=String.fromCharCode(s)}return o},Ze="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ye=(e,r)=>{for(var t=e,n=t>>1,a=n+r/2;!(n>=a)&&b[n];)++n;if((t=n<<1)-e>32&&Ze)return Ze.decode(w.subarray(e,t));for(var o="",s=0;!(s>=r/2);++s){var i=T[e+2*s>>1];if(0==i)break;o+=String.fromCharCode(i)}return o},er=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,o=0;o<a;++o){var s=e.charCodeAt(o);T[r>>1]=s,r+=2}return T[r>>1]=0,r-n},rr=e=>2*e.length,tr=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var a=C[e+4*t>>2];if(0==a)break;if(++t,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(a)}return n},nr=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,a=n+t-4,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)),C[r>>2]=s,(r+=4)+4>a)break}return C[r>>2]=0,r-n},ar=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},or=(e,r,t)=>{var n=[],a=e.toWireType(n,t);return n.length&&(P[r>>2]=qe.toHandle(n)),a},sr=[],ir={},ur=e=>{var r=ir[e];return void 0===r?ee(e):r},lr=()=>"object"==typeof globalThis?globalThis:Function("return this")(),cr=(Reflect.construct,e=>{var r=(e-y.buffer.byteLength+65535)/65536;try{return y.grow(r),S(),1}catch(e){}}),pr=[null,[],[]];L=s.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);G=e})(),X=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(ve.prototype,{isAliasOf(e){if(!(this instanceof ve))return!1;if(!(e instanceof ve))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return r===n&&t===a},clone(){if(this.$$.ptr||ae(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=fe(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||ae(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&re("Object already scheduled for deletion"),se(this),ie(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||ae(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&re("Object already scheduled for deletion"),ce.push(this),1===ce.length&&ne&&ne(pe),this.$$.deleteScheduled=!0,this}}),s.getInheritedInstanceCount=()=>Object.keys(de).length,s.getLiveInheritedInstances=()=>{var e=[];for(var r in de)de.hasOwnProperty(r)&&e.push(de[r]);return e},s.flushPendingDeletes=pe,s.setDelayFunction=e=>{ne=e,ce.length&&ne&&ne(pe)},Object.assign(Pe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:z,fromWireType:function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&re("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),de[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?he(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):he(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,s=this.registeredClass.getActualType(r),i=le[s];if(!i)return a.call(this);o=this.isConst?i.constPointerType:i.pointerType;var u=ue(r,this.registeredClass,o.registeredClass);return null===u?a.call(this):this.isSmartPointer?he(o.registeredClass.instancePrototype,{ptrType:o,ptr:u,smartPtrType:this,smartPtr:e}):he(o.registeredClass.instancePrototype,{ptrType:o,ptr:u})}}),We=s.UnboundTypeError=(xe=Error,(Ve=ye("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(xe.prototype),Ve.prototype.constructor=Ve,Ve.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Ve),Be.push(0,1,void 0,1,null,1,!0,1,!1,1),s.count_emval_handles=()=>Be.length/2-5-He.length;var dr,hr={K:(e,r,t)=>{throw new M(e).init(r,t),e},G:()=>{D("")},s:e=>{var r=q[e];delete q[e];var t=r.rawConstructor,n=r.rawDestructor,a=r.fields,o=a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType)));Y([e],o,(e=>{var o={};return a.forEach(((r,t)=>{var n=r.fieldName,s=e[t],i=r.getter,u=r.getterContext,l=e[t+a.length],c=r.setter,p=r.setterContext;o[n]={read:e=>s.fromWireType(i(u,e)),write:(e,r)=>{var t=[];c(p,e,l.toWireType(t,r)),N(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in o)r[t]=o[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var a in o)if(!(a in r))throw new TypeError(`Missing field: "${a}"`);var s=t();for(a in o)o[a].write(s,r[a]);return null!==e&&e.push(n,s),s},argPackAdvance:8,readValueFromPointer:z,destructorFunction:n}]}))},C:(e,r,t,n,a)=>{},I:(e,r,t,n)=>{te(e,{name:r=ee(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(w[e])},destructorFunction:null})},w:(e,r,t,n,a,o,s,i,u,l,c,p,d)=>{c=ee(c),o=je(a,o),i&&=je(s,i),l&&=je(u,l),d=je(p,d);var h=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(c);ge(h,(function(){ke(`Cannot construct ${c} due to unbound types`,[n])})),Y([e,r,t],n?[n]:[],(r=>{var t,a;r=r[0],a=n?(t=r.registeredClass).instancePrototype:ve.prototype;var s=ye(c,(function(...e){if(Object.getPrototypeOf(this)!==u)throw new X("Use 'new' to construct "+c);if(void 0===p.constructor_body)throw new X(c+" has no accessible constructor");var r=p.constructor_body[e.length];if(void 0===r)throw new X(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)})),u=Object.create(a,{constructor:{value:s}});s.prototype=u;var p=new $e(c,s,u,d,t,o,i,l);p.baseClass&&(p.baseClass.__derivedClasses??=[],p.baseClass.__derivedClasses.push(p));var f=new Pe(c,p,!0,!1,!1),v=new Pe(c+"*",p,!1,!1,!1),y=new Pe(c+" const*",p,!1,!0,!1);return le[e]={pointerType:v,constPointerType:y},_e(h,s),[f,v,y]}))},v:(e,r,t,n,a,o)=>{var s=Oe(r,t);a=je(n,a),Y([],[e],(e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new X(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{ke(`Cannot construct ${e.name} due to unbound types`,s)},Y([],s,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=Ie(t,n,null,a,o),[]))),[]}))},d:(e,r,t,n,a,o,s,i,u)=>{var l=Oe(t,n);r=ee(r),r=Ue(r),o=je(a,o),Y([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function a(){ke(`Cannot call ${n} due to unbound types`,l)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,p=c[r];return void 0===p||void 0===p.overloadTable&&p.className!==e.name&&p.argCount===t-2?(a.argCount=t-2,a.className=e.name,c[r]=a):(me(c,r,n),c[r].overloadTable[t-2]=a),Y([],l,(a=>{var i=Ie(n,a,e,o,s,u);return void 0===c[r].overloadTable?(i.argCount=t-2,c[r]=i):c[r].overloadTable[t-2]=i,[]})),[]}))},m:(e,r,t)=>{e=ee(e),Y([],[r],(r=>(r=r[0],s[e]=r.fromWireType(t),[])))},H:e=>te(e,Ne),o:(e,r,t,n)=>{function a(){}r=ee(r),a.values={},te(e,{name:r,constructor:a,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,r)=>r.value,argPackAdvance:8,readValueFromPointer:ze(r,t,n),destructorFunction:null}),ge(r,a)},a:(e,r,t)=>{var n=Le(e,"enum");r=ee(r);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:ye(`${n.name}_${r}`,(function(){}))}});a.values[t]=o,a[r]=o},A:(e,r,t)=>{te(e,{name:r=ee(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:Xe(r,t),destructorFunction:null})},i:(e,r,t,n,a,o,s)=>{var i=Oe(r,t);e=ee(e),e=Ue(e),a=je(n,a),ge(e,(function(){ke(`Cannot call ${e} due to unbound types`,i)}),r-1),Y([],i,(t=>{var n=[t[0],null].concat(t.slice(1));return _e(e,Ie(e,n,null,a,o,s),r-1),[]}))},l:(e,r,t,n,a)=>{r=ee(r),-1===a&&(a=4294967295);var o=e=>e;if(0===n){var s=32-8*t;o=e=>e<<s>>>s}var i=r.includes("unsigned");te(e,{name:r,fromWireType:o,toWireType:i?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:Je(r,t,0!==n),destructorFunction:null})},f:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=P[e>>2],t=P[e+4>>2];return new n($.buffer,t,r)}te(e,{name:t=ee(t),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},z:(e,r)=>{var t="std::string"===(r=ee(r));te(e,{name:r,fromWireType(e){var r,n,a=P[e>>2],o=e+4;if(t)for(var s=o,i=0;i<=a;++i){var u=o+i;if(i==a||0==w[u]){var l=(n=s)?Qe(w,n,u-s):"";void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),s=u+1}}else{var c=new Array(a);for(i=0;i<a;++i)c[i]=String.fromCharCode(w[o+i]);r=c.join("")}return mr(e),r},toWireType(e,r){var n;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var a="string"==typeof r;a||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||re("Cannot pass non-string to std::string"),n=t&&a?(e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r})(r):r.length;var o=yr(4+n+1),s=o+4;if(P[o>>2]=n,t&&a)((e,r,t,n)=>{if(!(n>0))return 0;for(var a=t+n-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(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}r[t]=0})(r,w,s,n+1);else if(a)for(var i=0;i<n;++i){var u=r.charCodeAt(i);u>255&&(mr(s),re("String has UTF-16 code units that do not fit in 8 bits")),w[s+i]=u}else for(i=0;i<n;++i)w[s+i]=r[i];return null!==e&&e.push(mr,o),o},argPackAdvance:8,readValueFromPointer:z,destructorFunction(e){mr(e)}})},u:(e,r,t)=>{var n,a,o,s;t=ee(t),2===r?(n=Ye,a=er,s=rr,o=e=>b[e>>1]):4===r&&(n=tr,a=nr,s=ar,o=e=>P[e>>2]),te(e,{name:t,fromWireType:e=>{for(var t,a=P[e>>2],s=e+4,i=0;i<=a;++i){var u=e+4+i*r;if(i==a||0==o(u)){var l=n(s,u-s);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),s=u+r}}return mr(e),t},toWireType:(e,n)=>{"string"!=typeof n&&re(`Cannot pass non-string to C++ string type ${t}`);var o=s(n),i=yr(4+o+r);return P[i>>2]=o/r,a(n,i+4,o+r),null!==e&&e.push(mr,i),i},argPackAdvance:8,readValueFromPointer:z,destructorFunction(e){mr(e)}})},t:(e,r,t,n,a,o)=>{q[e]={name:ee(r),rawConstructor:je(t,n),rawDestructor:je(a,o),fields:[]}},c:(e,r,t,n,a,o,s,i,u,l)=>{q[e].fields.push({fieldName:ee(r),getterReturnType:t,getter:je(n,a),getterContext:o,setterArgumentType:s,setter:je(i,u),setterContext:l})},J:(e,r)=>{te(e,{isVoid:!0,name:r=ee(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},F:(e,r,t)=>w.copyWithin(e,r,r+t),n:(e,r,t)=>(e=qe.toValue(e),r=Le(r,"emval::as"),or(r,t,e)),q:(e,r,t,n)=>(e=sr[e])(null,r=qe.toValue(r),t,n),p:(e,r,t,n,a)=>(e=sr[e])(r=qe.toValue(r),r[t=ur(t)],n,a),b:Me,x:e=>0===e?qe.toHandle(lr()):(e=ur(e),qe.toHandle(lr()[e])),j:(e,r,t)=>{var n=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=Le(P[r+4*n>>2],"parameter "+n);return t})(e,r),a=n.shift();e--;var o="return function (obj, func, destructorsRef, args) {\n",s=0,i=[];0===t&&i.push("obj");for(var u=["retType"],l=[a],c=0;c<e;++c)i.push("arg"+c),u.push("argType"+c),l.push(n[c]),o+=` var arg${c} = argType${c}.readValueFromPointer(args${s?"+"+s:""});\n`,s+=n[c].argPackAdvance;o+=` var rv = ${1===t?"new func":"func.call"}(${i.join(", ")});\n`,a.isVoid||(u.push("emval_returnValue"),l.push(or),o+=" return emval_returnValue(retType, destructorsRef, rv);\n"),o+="};\n",u.push(o);var p,d,h=De(Function,u)(...l),f=`methodCaller<(${n.map((e=>e.name)).join(", ")}) => ${a.name}>`;return p=ye(f,h),d=sr.length,sr.push(p),d},r:e=>(e=ur(e),qe.toHandle(s[e])),g:(e,r)=>(e=qe.toValue(e),r=qe.toValue(r),qe.toHandle(e[r])),k:e=>{e>9&&(Be[e+1]+=1)},h:e=>qe.toHandle(ur(e)),e:e=>{var r=qe.toValue(e);N(r),Me(e)},D:e=>{var r=w.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n,a=1;a<=4;a*=2){var o=r*(1+.2/a);o=Math.min(o,e+100663296);var s=Math.min(t,(n=Math.max(e,o))+(65536-n%65536)%65536);if(cr(s))return!0}return!1},E:e=>52,B:function(e,r,t,n,a){return 70},y:(e,r,t,n)=>{for(var a,o,s,i=0,u=0;u<t;u++){var l=P[r>>2],c=P[r+4>>2];r+=8;for(var p=0;p<c;p++)a=e,o=w[l+p],s=void 0,s=pr[a],0===o||10===o?((1===a?m:g)(Qe(s,0)),s.length=0):s.push(o);i+=c}return P[n>>2]=i,0}},fr=function(){var e,r,t,a,o,i,u={a:hr};function l(e,r){var t;return fr=e.exports,y=fr.L,S(),Ae=fr.P,t=fr.M,j.unshift(t),function(){if(k--,s.monitorRunDependencies?.(k),0==k&&(null!==O&&(clearInterval(O),O=null),R)){var e=R;R=null,e()}}(),fr}if(k++,s.monitorRunDependencies?.(k),s.instantiateWasm)try{return s.instantiateWasm(u,l)}catch(e){g(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return I||(I=x(i="basis_transcoder.wasm")?i:(o=i,s.locateFile?s.locateFile(o,d):d+o)),(e=v,r=I,t=u,a=function(e){l(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||x(r)||V(r)||c||"function"!=typeof fetch?H(r,t,a):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(a,(function(e){return g(`wasm streaming compile failed: ${e}`),g("falling back to ArrayBuffer instantiation"),H(r,t,a)}))))).catch(n),{}}(),vr=e=>(vr=fr.N)(e),yr=e=>(yr=fr.O)(e),mr=e=>(mr=fr.Q)(e),gr=e=>(gr=fr.R)(e);function $r(){function e(){dr||(dr=!0,s.calledRun=!0,_||(B(j),t(s),s.onRuntimeInitialized?.(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),E.unshift(e);var e;B(E)}()))}k>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),F.unshift(e);var e;B(F)}(),k>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.dynCall_jiji=(e,r,t,n,a)=>(s.dynCall_jiji=fr.S)(e,r,t,n,a),R=function e(){dr||$r(),dr||(R=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return $r(),i}})();"object"==typeof exports&&"object"==typeof module?module.exports=BASIS:"function"==typeof define&&define.amd&&define([],(()=>BASIS));