1 line
32 KiB
JavaScript
1 line
32 KiB
JavaScript
var BASIS=function(){var Pt="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(Pt=Pt||__filename),function(e){var r,i,a=void 0!==(e=e||{})?e:{};a.ready=new Promise(function(e,t){r=e,readyPromiseRejectza=t});var t,n={};for(t in a)a.hasOwnProperty(t)&&(n[t]=a[t]);var o,u,s,c,f,l=!1,p=!1,l="object"==typeof window,p="function"==typeof importScripts,d="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,h=!l&&!d&&!p,y="";d?(y=p?require("path").dirname(y)+"/":__dirname+"/",o=function(e,t){return c=c||require("fs"),e=(f=f||require("path")).normalize(e),c.readFileSync(e,t?null:"utf8")},s=function(e){e=o(e,!0);return T((e=!e.buffer?new Uint8Array(e):e).buffer),e},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof function(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}))throw e}),process.on("unhandledRejection",Z),a.inspect=function(){return"[Emscripten Module object]"}):h?("undefined"!=typeof read&&(o=function(e){return read(e)}),s=function(e){return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(T("object"==typeof(e=read(e,"binary"))),e)},"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(l||p)&&(p?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),y=0!==(y=Pt?Pt:y).indexOf("blob:")?y.substr(0,y.lastIndexOf("/")+1):"",o=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},p&&(s=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var v=a.print||console.log.bind(console),m=a.printErr||console.warn.bind(console);for(t in n)n.hasOwnProperty(t)&&(a[t]=n[t]);n=null,a.arguments&&a.arguments,a.thisProgram&&a.thisProgram,a.quit&&a.quit;var g;a.wasmBinary&&(g=a.wasmBinary);var w;a.noExitRuntime;"object"!=typeof WebAssembly&&Z("no native wasm support detected");var b=!1;function T(e,t){e||Z("Assertion failed: "+t)}var C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(e,t,r){for(var n=t+r,o=t;e[o]&&!(n<=o);)++o;if(16<o-t&&e.subarray&&C)return C.decode(e.subarray(t,o));for(var i="";t<o;){var a,u,s=e[t++];128&s?(a=63&e[t++],192!=(224&s)?(u=63&e[t++],(s=224==(240&s)?(15&s)<<12|a<<6|u:(7&s)<<18|a<<12|u<<6|63&e[t++])<65536?i+=String.fromCharCode(s):(u=s-65536,i+=String.fromCharCode(55296|u>>10,56320|1023&u))):i+=String.fromCharCode((31&s)<<6|a)):i+=String.fromCharCode(s)}return i}function P(e,t){return e?$(W,e,t):""}function A(e,t,r){return function(e,t,r,n){if(!(0<n))return;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var u=e.charCodeAt(a);if((u=55296<=u&&u<=57343?65536+((1023&u)<<10)|1023&e.charCodeAt(++a):u)<=127){if(i<=r)break;t[r++]=u}else if(u<=2047){if(i<=r+1)break;t[r++]=192|u>>6,t[r++]=128|63&u}else if(u<=65535){if(i<=r+2)break;t[r++]=224|u>>12,t[r++]=128|u>>6&63,t[r++]=128|63&u}else{if(i<=r+3)break;t[r++]=240|u>>18,t[r++]=128|u>>12&63,t[r++]=128|u>>6&63,t[r++]=128|63&u}}return t[r]=0,r-o}(e,W,t,r)}var _,S,W,E,F,k,O,j,R,I="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function x(e,t){for(var r,n=e>>1,o=n+t/2;!(o<=n)&&F[n];)++n;if(32<(r=n<<1)-e&&I)return I.decode(W.subarray(e,r));for(var i="",a=0;!(t/2<=a);++a){var u=E[e+2*a>>1];if(0==u)break;i+=String.fromCharCode(u)}return i}function D(e,t,r){if((r=void 0===r?2147483647:r)<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);E[t>>1]=a,t+=2}return E[t>>1]=0,t-n}function U(e){return 2*e.length}function B(e,t){for(var r=0,n="";!(t/4<=r);){var o,i=k[e+4*r>>2];if(0==i)break;++r,65536<=i?(o=i-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o)):n+=String.fromCharCode(i)}return n}function M(e,t,r){if((r=void 0===r?2147483647:r)<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),k[t>>2]=a,o<(t+=4)+4)break}return k[t>>2]=0,t-n}function V(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);55296<=n&&n<=57343&&++r,t+=4}return t}function H(e){_=e,a.HEAP8=S=new Int8Array(e),a.HEAP16=E=new Int16Array(e),a.HEAP32=k=new Int32Array(e),a.HEAPU8=W=new Uint8Array(e),a.HEAPU16=F=new Uint16Array(e),a.HEAPU32=O=new Uint32Array(e),a.HEAPF32=j=new Float32Array(e),a.HEAPF64=R=new Float64Array(e)}a.INITIAL_MEMORY;var q,z=[],N=[],G=[],L=[];function X(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),z.unshift(e);var e;se(z)}function J(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),L.unshift(e);var e;se(L)}var K=0,Q=null,Y=null;function Z(e){a.onAbort&&a.onAbort(e),m(e+=""),b=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";e=new WebAssembly.RuntimeError(e);throw i(e),e}function ee(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}a.preloadedImages={},a.preloadedAudios={};var te="data:application/octet-stream;base64,";function re(e){return ee(e,te)}var ne="file://";function oe(e){return ee(e,ne)}var ie,ae="basis_transcoder.wasm";function ue(e){try{if(e==ae&&g)return new Uint8Array(g);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){Z(e)}}function se(e){for(;0<e.length;){var t,r=e.shift();"function"!=typeof r?"number"==typeof(t=r.func)?void 0===r.arg?q.get(t)():q.get(t)(r.arg):t(void 0===r.arg?null:r.arg):r(a)}}re(ae)||(ie=ae,ae=a.locateFile?a.locateFile(ie,y):y+ie);var ce={};function fe(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function le(e){return this.fromWireType(O[e>>2])}var pe={},de={},he={},ye=48,ve=57;function me(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return ye<=t&&t<=ve?"_"+e:e}function ge(e,t){return e=me(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function we(e,t){var r=ge(t,function(e){this.name=t,this.message=e;e=new Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(e.prototype),(r.prototype.constructor=r).prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var be=void 0;function Te(e){throw new be(e)}function Ce(n,t,o){function r(e){var t=o(e);t.length!==n.length&&Te("Mismatched type converter count");for(var r=0;r<n.length;++r)We(n[r],t[r])}n.forEach(function(e){he[e]=t});var i=new Array(t.length),a=[],u=0;t.forEach(function(e,t){de.hasOwnProperty(e)?i[t]=de[e]:(a.push(e),pe.hasOwnProperty(e)||(pe[e]=[]),pe[e].push(function(){i[t]=de[e],++u===a.length&&r(i)}))}),0===a.length&&r(i)}function $e(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 Pe=void 0;function Ae(e){for(var t="",r=e;W[r];)t+=Pe[W[r++]];return t}var _e=void 0;function Se(e){throw new _e(e)}function We(e,t,r){if(r=r||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||Se('type "'+n+'" must have a positive integer typeid pointer'),de.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Se("Cannot register type '"+n+"' twice")}de[e]=t,delete he[e],pe.hasOwnProperty(e)&&(t=pe[e],delete pe[e],t.forEach(function(e){e()}))}function Ee(e){Se(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Fe=!1;function ke(e){}function Oe(e){--e.count.value,0===e.count.value&&((e=e).smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr))}function je(e){return"undefined"==typeof FinalizationGroup?(je=function(e){return e},e):(Fe=new FinalizationGroup(function(e){for(var t=e.next();!t.done;t=e.next()){var r=t.value;r.ptr?Oe(r):console.warn("object already deleted: "+r.ptr)}}),ke=function(e){Fe.unregister(e.$$)},(je=function(e){return Fe.register(e,e.$$,e.$$),e})(e))}var Re=void 0,Ie=[];function xe(){for(;Ie.length;){var e=Ie.pop();e.$$.deleteScheduled=!1,e.delete()}}function De(){}var Ue={};function Be(e,t,r){var n;void 0===e[t].overloadTable&&(n=e[t],e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Se("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n)}function Me(e,t,r){a.hasOwnProperty(e)?((void 0===r||void 0!==a[e].overloadTable&&void 0!==a[e].overloadTable[r])&&Se("Cannot register public name '"+e+"' twice"),Be(a,e,e),a.hasOwnProperty(r)&&Se("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),a[e].overloadTable[r]=t):(a[e]=t,void 0!==r&&(a[e].numArguments=r))}function Ve(e,t,r,n,o,i,a,u){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=u,this.pureVirtualFunctions=[]}function He(e,t,r){for(;t!==r;)t.upcast||Se("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function qe(e,t){if(null===t)return this.isReference&&Se("null is not a valid "+this.name),0;t.$$||Se('Cannot pass "'+ft(t)+'" as a '+this.name),t.$$.ptr||Se("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return He(t.$$.ptr,r,this.registeredClass)}function ze(e,t){if(null===t)return this.isReference&&Se("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||Se('Cannot pass "'+ft(t)+'" as a '+this.name),t.$$.ptr||Se("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Se("Cannot convert argument of type "+(t.$$.smartPtrType||t.$$.ptrType).name+" to parameter type "+this.name);var r,n,o=t.$$.ptrType.registeredClass;if(n=He(t.$$.ptr,o,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Se("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Se("Cannot convert argument of type "+(t.$$.smartPtrType||t.$$.ptrType).name+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:t.$$.smartPtrType===this?n=t.$$.smartPtr:(r=t.clone(),n=this.rawShare(n,st(function(){r.delete()})),null!==e&&e.push(this.rawDestructor,n));break;default:Se("Unsupporting sharing policy")}return n}function Ne(e,t){if(null===t)return this.isReference&&Se("null is not a valid "+this.name),0;t.$$||Se('Cannot pass "'+ft(t)+'" as a '+this.name),t.$$.ptr||Se("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Se("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return He(t.$$.ptr,r,this.registeredClass)}var Ge={};function Le(e,t){return t=function(e,t){for(void 0===t&&Se("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Ge[t]}function Xe(e,t){return t.ptrType&&t.ptr||Te("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Te("Both smartPtrType and smartPtr must be specified"),t.count={value:1},je(Object.create(e,{$$:{value:t}}))}function Je(e,t,r,n,o,i,a,u,s,c,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=u,this.rawConstructor=s,this.rawShare=c,this.rawDestructor=f,o||void 0!==t.baseClass?this.toWireType=ze:(this.toWireType=n?qe:Ne,this.destructorFunction=null)}function Ke(e,t,r){a.hasOwnProperty(e)||Te("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==r?a[e].overloadTable[r]=t:(a[e]=t,a[e].argCount=r)}function Qe(e,t,r){return-1!=e.indexOf("j")?(n=t,o=r,e=a["dynCall_"+(e=e)],o&&o.length?e.apply(null,[n].concat(o)):e.call(null,n)):q.get(t).apply(null,r);var n,o}function Ye(e,t){var r,n,o,i=-1!=(e=Ae(e)).indexOf("j")?(r=e,n=t,o=[],function(){o.length=arguments.length;for(var e=0;e<arguments.length;e++)o[e]=arguments[e];return Qe(r,n,o)}):q.get(t);return"function"!=typeof i&&Se("unknown function pointer with signature "+e+": "+t),i}var Ze=void 0;function et(e){var t=Ct(e),e=Ae(t);return Tt(t),e}function tt(e,t){var r=[],n={};throw t.forEach(function e(t){n[t]||de[t]||(he[t]?he[t].forEach(e):(r.push(t),n[t]=!0))}),new Ze(e+": "+r.map(et).join([", "]))}function rt(e,t){for(var r=[],n=0;n<e;n++)r.push(k[(t>>2)+n]);return r}function nt(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=ge(e.name||"unknownFunctionName",function(){});r.prototype=e.prototype;r=new r,t=e.apply(r,t);return t instanceof Object?t:r}function ot(e,t,r,n,o){var i=t.length;i<2&&Se("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,u=!1,s=1;s<t.length;++s)if(null!==t[s]&&void 0===t[s].destructorFunction){u=!0;break}for(var r="void"!==t[0].name,c="",f="",s=0;s<i-2;++s)c+=(0!==s?", ":"")+"arg"+s,f+=(0!==s?", ":"")+"arg"+s+"Wired";var l="return function "+me(e)+"("+c+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";u&&(l+="var destructors = [];\n");var p=u?"destructors":"null",d=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],h=[Se,n,o,fe,t[0],t[1]];a&&(l+="var thisWired = classParam.toWireType("+p+", this);\n");for(s=0;s<i-2;++s)l+="var arg"+s+"Wired = argType"+s+".toWireType("+p+", arg"+s+"); // "+t[s+2].name+"\n",d.push("argType"+s),h.push(t[s+2]);if(l+=(r?"var rv = ":"")+"invoker(fn"+(0<(f=a?"thisWired"+(0<f.length?", ":"")+f:f).length?", ":"")+f+");\n",u)l+="runDestructors(destructors);\n";else for(s=a?1:2;s<t.length;++s){var y=1===s?"thisWired":"arg"+(s-2)+"Wired";null!==t[s].destructorFunction&&(l+=y+"_dtor("+y+"); // "+t[s].name+"\n",d.push(y+"_dtor"),h.push(t[s].destructorFunction))}return r&&(l+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d.push(l+="}\n"),nt(Function,d).apply(null,h)}var it=[],at=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ut(e){4<e&&0==--at[e].refcount&&(at[e]=void 0,it.push(e))}function st(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=it.length?it.pop():at.length;return at[t]={refcount:1,value:e},t}}function ct(e,t){var r=de[e];return void 0===r&&Se(t+" has unknown type "+et(e)),r}function ft(e){if(null===e)return"null";var t=typeof e;return"object"==t||"array"==t||"function"==t?e.toString():""+e}function lt(e){return e||Se("Cannot use deleted val. handle = "+e),at[e].value}var pt={};function dt(e){var t=pt[e];return void 0===t?Ae(e):t}var ht=[];function yt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var vt={};var mt={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var r=mt.buffers[e];0===t||10===t?((1===e?v:m)($(r,0)),r.length=0):r.push(t)},varargs:void 0,get:function(){return mt.varargs+=4,k[mt.varargs-4>>2]},getStr:function(e){return P(e)},get64:function(e,t){return e}};be=a.InternalError=we(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Pe=e}(),_e=a.BindingError=we(Error,"BindingError"),De.prototype.isAliasOf=function(e){if(!(this instanceof De))return!1;if(!(e instanceof De))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},De.prototype.clone=function(){if(this.$$.ptr||Ee(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=je(Object.create(Object.getPrototypeOf(this),{$$:{value:{count:(e=this.$$).count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},De.prototype.delete=function(){this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),ke(this),Oe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},De.prototype.isDeleted=function(){return!this.$$.ptr},De.prototype.deleteLater=function(){return this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),Ie.push(this),1===Ie.length&&Re&&Re(xe),this.$$.deleteScheduled=!0,this},Je.prototype.getPointee=function(e){return e=this.rawGetPointee?this.rawGetPointee(e):e},Je.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},Je.prototype.argPackAdvance=8,Je.prototype.readValueFromPointer=le,Je.prototype.deleteObject=function(e){null!==e&&e.delete()},Je.prototype.fromWireType=function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Le(this.registeredClass,t);if(void 0===r)return r=this.registeredClass.getActualType(t),(o=Ue[r])?(r=this.isConst?o.constPointerType:o.pointerType,null===(o=function e(t,r,n){if(r===n)return t;if(void 0===n.baseClass)return null;r=e(t,r,n.baseClass);return null===r?null:n.downcast(r)}(t,this.registeredClass,r.registeredClass))?n.call(this):this.isSmartPointer?Xe(r.registeredClass.instancePrototype,{ptrType:r,ptr:o,smartPtrType:this,smartPtr:e}):Xe(r.registeredClass.instancePrototype,{ptrType:r,ptr:o})):n.call(this);function n(){return this.isSmartPointer?Xe(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Xe(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var o=r.clone();return this.destructor(e),o},a.getInheritedInstanceCount=function(){return Object.keys(Ge).length},a.getLiveInheritedInstances=function(){var e,t=[];for(e in Ge)Ge.hasOwnProperty(e)&&t.push(Ge[e]);return t},a.flushPendingDeletes=xe,a.setDelayFunction=function(e){Re=e,Ie.length&&Re&&Re(xe)},Ze=a.UnboundTypeError=we(Error,"UnboundTypeError"),a.count_emval_handles=function(){for(var e=0,t=5;t<at.length;++t)void 0!==at[t]&&++e;return e},a.get_first_emval=function(){for(var e=5;e<at.length;++e)if(void 0!==at[e])return at[e];return null};var gt,wt={t:function(e){var t=ce[e];delete ce[e];var o=t.rawConstructor,i=t.rawDestructor,l=t.fields;Ce([e],l.map(function(e){return e.getterReturnType}).concat(l.map(function(e){return e.setterArgumentType})),function(c){var f={};return l.forEach(function(e,t){var r=e.fieldName,n=c[t],o=e.getter,i=e.getterContext,a=c[t+l.length],u=e.setter,s=e.setterContext;f[r]={read:function(e){return n.fromWireType(o(i,e))},write:function(e,t){var r=[];u(s,e,a.toWireType(r,t)),fe(r)}}}),[{name:t.name,fromWireType:function(e){var t,r={};for(t in f)r[t]=f[t].read(e);return i(e),r},toWireType:function(e,t){for(var r in f)if(!(r in t))throw new TypeError('Missing field: "'+r+'"');var n=o();for(r in f)f[r].write(n,t[r]);return null!==e&&e.push(i,n),n},argPackAdvance:8,readValueFromPointer:le,destructorFunction:i}]})},I:function(e,r,n,o,i){var a=$e(n);We(e,{name:r=Ae(r),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?o:i},argPackAdvance:8,readValueFromPointer:function(e){var t;if(1===n)t=S;else if(2===n)t=E;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+r);t=k}return this.fromWireType(t[e>>a])},destructorFunction:null})},x:function(a,e,t,u,r,s,n,c,o,f,l,i,p){l=Ae(l),s=Ye(r,s),c=c&&Ye(n,c),f=f&&Ye(o,f),p=Ye(i,p);var d=me(l);Me(d,function(){tt("Cannot construct "+l+" due to unbound types",[u])}),Ce([a,e,t],u?[u]:[],function(e){e=e[0];var t=u?(i=e.registeredClass).instancePrototype:De.prototype,r=ge(d,function(){if(Object.getPrototypeOf(this)!==n)throw new _e("Use 'new' to construct "+l);if(void 0===o.constructor_body)throw new _e(l+" has no accessible constructor");var e=o.constructor_body[arguments.length];if(void 0===e)throw new _e("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(o.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)}),n=Object.create(t,{constructor:{value:r}});r.prototype=n;var o=new Ve(l,r,n,p,i,s,c,f),e=new Je(l,o,!0,!1,!1),t=new Je(l+"*",o,!1,!1,!1),i=new Je(l+" const*",o,!1,!0,!1);return Ue[a]={pointerType:t,constPointerType:i},Ke(d,r),[e,t,i]})},w:function(e,o,t,r,i,n){T(0<o);var a=rt(o,t);i=Ye(r,i);var u=[n],s=[];Ce([],[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[o-1])throw new _e("Cannot register multiple constructors with identical number of parameters ("+(o-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[o-1]=function(){tt("Cannot construct "+e.name+" due to unbound types",a)},Ce([],a,function(r){return e.registeredClass.constructor_body[o-1]=function(){arguments.length!==o-1&&Se(n+" called with "+arguments.length+" arguments, expected "+(o-1)),s.length=0,u.length=o;for(var e=1;e<o;++e)u[e]=r[e].toWireType(s,arguments[e-1]);var t=i.apply(null,u);return fe(s),r[0].fromWireType(t)},[]}),[]})},d:function(e,i,a,t,r,u,s,c){var f=rt(a,t);i=Ae(i),u=Ye(r,u),Ce([],[e],function(t){var r=(t=t[0]).name+"."+i;function e(){tt("Cannot call "+r+" due to unbound types",f)}c&&t.registeredClass.pureVirtualFunctions.push(i);var n=t.registeredClass.instancePrototype,o=n[i];return void 0===o||void 0===o.overloadTable&&o.className!==t.name&&o.argCount===a-2?(e.argCount=a-2,e.className=t.name,n[i]=e):(Be(n,i,r),n[i].overloadTable[a-2]=e),Ce([],f,function(e){e=ot(r,e,t,u,s);return void 0===n[i].overloadTable?(e.argCount=a-2,n[i]=e):n[i].overloadTable[a-2]=e,[]}),[]})},k:function(t,e,r){t=Ae(t),Ce([],[e],function(e){return e=e[0],a[t]=e.fromWireType(r),[]})},H:function(e,t){We(e,{name:t=Ae(t),fromWireType:function(e){var t=at[e].value;return ut(e),t},toWireType:function(e,t){return st(t)},argPackAdvance:8,readValueFromPointer:le,destructorFunction:null})},n:function(e,t,r,n){function o(){}r=$e(r),t=Ae(t),o.values={},We(e,{name:t,constructor:o,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:function(e,t,r){switch(t){case 0:return function(e){var t=r?S:W;return this.fromWireType(t[e])};case 1:return function(e){var t=r?E:F;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?k:O;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}(t,r,n),destructorFunction:null}),Me(t,o)},a:function(e,t,r){var n=ct(e,"enum");t=Ae(t),e=n.constructor,n=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ge(n.name+"_"+t,function(){})}}),e.values[r]=n,e[t]=n},A:function(e,t,r){r=$e(r),We(e,{name:t=Ae(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+ft(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:function(e,t){switch(t){case 2:return function(e){return this.fromWireType(j[e>>2])};case 3:return function(e){return this.fromWireType(R[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}(t,r),destructorFunction:null})},i:function(t,r,e,n,o,i){var a=rt(r,e);t=Ae(t),o=Ye(n,o),Me(t,function(){tt("Cannot call "+t+" due to unbound types",a)},r-1),Ce([],a,function(e){e=[e[0],null].concat(e.slice(1));return Ke(t,ot(t,e,null,o,i),r-1),[]})},j:function(e,r,t,n,o){r=Ae(r),-1===o&&(o=4294967295);var i,a=$e(t),u=function(e){return e};0===n&&(i=32-8*t,u=function(e){return e<<i>>>i});var s=-1!=r.indexOf("unsigned");We(e,{name:r,fromWireType:u,toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+ft(t)+'" to '+this.name);if(t<n||o<t)throw new TypeError('Passing a number "'+ft(t)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+n+", "+o+"]!");return s?t>>>0:0|t},argPackAdvance:8,readValueFromPointer:function(e,t,r){switch(t){case 0:return r?function(e){return S[e]}:function(e){return W[e]};case 1:return r?function(e){return E[e>>1]}:function(e){return F[e>>1]};case 2:return r?function(e){return k[e>>2]}:function(e){return O[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}(r,a,0!==n),destructorFunction:null})},h:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=O,r=t[e>>=2],e=t[e+1];return new n(_,e,r)}We(e,{name:r=Ae(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},B:function(e,t){var s="std::string"===(t=Ae(t));We(e,{name:t,fromWireType:function(e){var t,r=O[e>>2];if(s)for(var n=e+4,o=0;o<=r;++o){var i,a=e+4+o;o!=r&&0!=W[a]||(i=P(n,a-n),void 0===t?t=i:(t+=String.fromCharCode(0),t+=i),n=a+1)}else{for(var u=new Array(r),o=0;o<r;++o)u[o]=String.fromCharCode(W[e+4+o]);t=u.join("")}return Tt(e),t},toWireType:function(e,t){var r="string"==typeof(t=t instanceof ArrayBuffer?new Uint8Array(t):t);r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Se("Cannot pass non-string to std::string");var n=(s&&r?function(){return function(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);(n=55296<=n&&n<=57343?65536+((1023&n)<<10)|1023&e.charCodeAt(++r):n)<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}(t)}:function(){return t.length})(),o=bt(4+n+1);if(O[o>>2]=n,s&&r)A(t,o+4,n+1);else if(r)for(var i=0;i<n;++i){var a=t.charCodeAt(i);255<a&&(Tt(o),Se("String has UTF-16 code units that do not fit in 8 bits")),W[o+4+i]=a}else for(i=0;i<n;++i)W[o+4+i]=t[i];return null!==e&&e.push(Tt,o),o},argPackAdvance:8,readValueFromPointer:le,destructorFunction:function(e){Tt(e)}})},v:function(e,s,o){var c,i,f,a,l;o=Ae(o),2===s?(c=x,i=D,a=U,f=function(){return F},l=1):4===s&&(c=B,i=M,a=V,f=function(){return O},l=2),We(e,{name:o,fromWireType:function(e){for(var t,r=O[e>>2],n=f(),o=e+4,i=0;i<=r;++i){var a,u=e+4+i*s;i!=r&&0!=n[u>>l]||(a=c(o,u-o),void 0===t?t=a:(t+=String.fromCharCode(0),t+=a),o=u+s)}return Tt(e),t},toWireType:function(e,t){"string"!=typeof t&&Se("Cannot pass non-string to C++ string type "+o);var r=a(t),n=bt(4+r+s);return O[n>>2]=r>>l,i(t,n+4,r+s),null!==e&&e.push(Tt,n),n},argPackAdvance:8,readValueFromPointer:le,destructorFunction:function(e){Tt(e)}})},u:function(e,t,r,n,o,i){ce[e]={name:Ae(t),rawConstructor:Ye(r,n),rawDestructor:Ye(o,i),fields:[]}},c:function(e,t,r,n,o,i,a,u,s,c){ce[e].fields.push({fieldName:Ae(t),getterReturnType:r,getter:Ye(n,o),getterContext:i,setterArgumentType:a,setter:Ye(u,s),setterContext:c})},J:function(e,t){We(e,{isVoid:!0,name:t=Ae(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},m:function(e,t,r){e=lt(e),t=ct(t,"emval::as");var n=[],o=st(n);return k[r>>2]=o,t.toWireType(n,e)},s:function(e,t,r,n){(e=ht[e])(t=lt(t),r=dt(r),null,n)},b:ut,y:function(e){return 0===e?st(yt()):(e=dt(e),st(yt()[e]))},p:function(e,t){for(var r=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=ct(k[(t>>2)+n],"parameter "+n);return r}(e,t),n=r[0],t=n.name+"_$"+r.slice(1).map(function(e){return e.name}).join("_")+"$",o=["retType"],i=[n],a="",u=0;u<e-1;++u)a+=(0!==u?", ":"")+"arg"+u,o.push("argType"+u),i.push(r[1+u]);for(var s="return function "+me("methodCaller_"+t)+"(handle, name, destructors, args) {\n",c=0,u=0;u<e-1;++u)s+=" var arg"+u+" = argType"+u+".readValueFromPointer(args"+(c?"+"+c:"")+");\n",c+=r[u+1].argPackAdvance;for(s+=" var rv = handle[name]("+a+");\n",u=0;u<e-1;++u)r[u+1].deleteObject&&(s+=" argType"+u+".deleteObject(arg"+u+");\n");return n.isVoid||(s+=" return retType.toWireType(destructors, rv);\n"),o.push(s+="};\n"),t=nt(Function,o).apply(null,i),n=ht.length,ht.push(t),n},r:function(e){return e=dt(e),st(a[e])},e:function(e,t){return st((e=lt(e))[t=lt(t)])},g:function(e){4<e&&(at[e].refcount+=1)},q:function(e,t,r,n){e=lt(e);var o=vt[t];return o||(o=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;for(var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n",r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+r+'], "parameter '+r+'");\nvar arg'+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\n";return n+="var obj = new constructor("+t+");\nreturn __emval_register(obj);\n}\n",new Function("requireRegisteredType","Module","__emval_register",n)(ct,a,st)}(t),vt[t]=o),o(e,r,n)},f:function(e){return st(dt(e))},l:function(e){fe(at[e].value),ut(e)},o:function(){Z()},E:function(e,t,r){W.copyWithin(e,t,t+r)},F:function(e){var t=W.length,r=2147483648;if(r<(e>>>=0))return!1;for(var n,o=1;o<=4;o*=2){var i=t*(1+.2/o),i=Math.min(i,e+100663296);if(function(e){try{return w.grow(e-_.byteLength+65535>>>16),H(w.buffer),1}catch(e){}}(Math.min(r,(0<(n=Math.max(e,i))%(i=65536)&&(n+=i-n%i),n))))return!0}return!1},G:function(e){return 0},C:function(e,t,r,n,o){},z:function(e,t,r,n){for(var o=0,i=0;i<r;i++){for(var a=k[t+8*i>>2],u=k[t+(8*i+4)>>2],s=0;s<u;s++)mt.printChar(e,W[a+s]);o+=u}return k[n>>2]=o,0},D:function(e){0}},bt=(function(){var t={a:wt};function r(e,t){e=e.exports;a.asm=e,H((w=a.asm.K).buffer),q=a.asm.O,e=a.asm.L,N.unshift(e),K--,a.monitorRunDependencies&&a.monitorRunDependencies(K),0==K&&(null!==Q&&(clearInterval(Q),Q=null),Y&&(e=Y,Y=null,e()))}function n(e){r(e.instance)}function o(e){return function(){if(!g&&(l||p)){if("function"==typeof fetch&&!oe(ae))return fetch(ae,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ae+"'";return e.arrayBuffer()}).catch(function(){return ue(ae)});if(u)return new Promise(function(t,e){u(ae,function(e){t(new Uint8Array(e))},e)})}return Promise.resolve().then(function(){return ue(ae)})}().then(function(e){return WebAssembly.instantiate(e,t)}).then(e,function(e){m("failed to asynchronously prepare wasm: "+e),Z(e)})}if(K++,a.monitorRunDependencies&&a.monitorRunDependencies(K),a.instantiateWasm)try{return a.instantiateWasm(t,r)}catch(e){return m("Module.instantiateWasm callback failed with error: "+e)}(g||"function"!=typeof WebAssembly.instantiateStreaming||re(ae)||oe(ae)||"function"!=typeof fetch?o(n):fetch(ae,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,t).then(n,function(e){return m("wasm streaming compile failed: "+e),m("falling back to ArrayBuffer instantiation"),o(n)})})).catch(i)}(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.L).apply(null,arguments)},a._malloc=function(){return(bt=a._malloc=a.asm.M).apply(null,arguments)}),Tt=a._free=function(){return(Tt=a._free=a.asm.N).apply(null,arguments)},Ct=a.___getTypeName=function(){return(Ct=a.___getTypeName=a.asm.P).apply(null,arguments)};a.___embind_register_native_and_builtin_types=function(){return(a.___embind_register_native_and_builtin_types=a.asm.Q).apply(null,arguments)},a.dynCall_jiji=function(){return(a.dynCall_jiji=a.asm.R).apply(null,arguments)};function $t(e){function t(){gt||(gt=!0,a.calledRun=!0,b||(se(N),se(G),r(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),J()))}0<K||(X(),0<K||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),t()},1)):t()))}if(Y=function e(){gt||$t(),gt||(Y=e)},a.run=$t,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return $t(),e.ready}}();"object"==typeof exports&&"object"==typeof module?module.exports=BASIS:"function"==typeof define&&define.amd?define([],function(){return BASIS}):"object"==typeof exports&&(exports.BASIS=BASIS); |