UNPKG

clvm

Version:

Javascript implementation of chia lisp

1 lines 92.9 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.clvm=e():t.clvm=e()}(this,(()=>(()=>{var t={530:(t,e,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,n||="/index.js",function(t={}){var e,o,i=t;i.ready=new Promise(((t,r)=>{e=t,o=r}));var a,s,u,f=Object.assign({},i),c="./this.program",l="object"==typeof window,_="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(h){var d=r(273),y=r(229);p=_?y.dirname(p)+"/":"//",a=(t,e)=>(t=k(t)?new URL(t):y.normalize(t),d.readFileSync(t,e?void 0:"utf8")),u=t=>((t=a(t,!0)).buffer||(t=new Uint8Array(t)),t),s=(t,e,r,n=!0)=>{t=k(t)?new URL(t):y.normalize(t),d.readFile(t,n?void 0:"utf8",((t,o)=>{t?r(t):e(n?o.buffer:o)}))},!i.thisProgram&&1<process.argv.length&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2)}else(l||_)&&(_?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),n&&(p=n),p=p.startsWith("blob:")?"":p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});i.print||console.log.bind(console);var g,w=i.printErr||console.error.bind(console);Object.assign(i,f),f=null,i.thisProgram&&(c=i.thisProgram),i.wasmBinary&&(g=i.wasmBinary);var m,E,v,b,S,O,T,A,B=!1,C=[],R=[],P=[];function I(){var t=i.preRun.shift();C.unshift(t)}var M=0,x=null,L=null;function U(t){throw i.onAbort?.(t),w(t="Aborted("+t+")"),B=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),o(t),t}var j,N=t=>t.startsWith("data:application/octet-stream;base64,"),k=t=>t.startsWith("file://");if(!N(j="blsjs.wasm")){var F=j;j=i.locateFile?i.locateFile(F,p):p+F}function $(t){if(t==j&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}function Y(t,e,r){return function(t){if(!g&&(l||_)){if("function"==typeof fetch&&!k(t))return fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw`failed to load wasm binary file at '${t}'`;return e.arrayBuffer()})).catch((()=>$(t)));if(s)return new Promise(((e,r)=>{s(t,(t=>e(new Uint8Array(t))),r)}))}return Promise.resolve().then((()=>$(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then(r,(t=>{w(`failed to asynchronously prepare wasm: ${t}`),U(t)}))}var D={24880:()=>i.oa(),24916:()=>{if(void 0===i.oa)try{var t="object"==typeof window?window:self,e=void 0!==t.crypto?t.crypto:t.msCrypto;(t=function(){var t=new Uint32Array(1);return e.getRandomValues(t),t[0]>>>0})(),i.oa=t}catch(e){try{var n=r(659);(t=function(){var t=n.randomBytes(4);return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0})(),i.oa=t}catch(t){throw"No secure random number generator found"}}}},G=t=>{for(;0<t.length;)t.shift()(i)};class W{constructor(t){this.S=t-24}}var H,V,z,q=t=>{for(var e="";E[t];)e+=H[E[t++]];return e},K={},X={},Z={},Q=t=>{throw new V(t)},J=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new z("Mismatched type converter count");for(var n=0;n<t.length;++n)tt(t[n],e[n])}t.forEach((function(t){Z[t]=e}));var o=Array(e.length),i=[],a=0;e.forEach(((t,e)=>{X.hasOwnProperty(t)?o[e]=X[t]:(i.push(t),K.hasOwnProperty(t)||(K[t]=[]),K[t].push((()=>{o[e]=X[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)};function tt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,r={}){var n=e.name;if(!t)throw new V(`type "${n}" must have a positive integer typeid pointer`);if(X.hasOwnProperty(t)){if(r.xa)return;throw new V(`Cannot register type '${n}' twice`)}X[t]=e,delete Z[t],K.hasOwnProperty(t)&&(e=K[t],delete K[t],e.forEach((t=>t())))}(t,e,r)}var et,rt=t=>{throw new V(t.M.T.R.name+" instance already deleted")},nt=!1,ot=()=>{},it=(t,e,r)=>e===r?t:void 0===r.V||null===(t=it(t,e,r.V))?null:r.ua(t),at={},st=[],ut=()=>{for(;st.length;){var t=st.pop();t.M.fa=!1,t.delete()}},ft={},ct=(t,e)=>{if(!e.T||!e.S)throw new z("makeClassHandle requires ptr and ptrType");if(!!e.X!=!!e.U)throw new z("Both smartPtrType and smartPtr must be specified");return e.count={value:1},lt(Object.create(t,{M:{value:e,writable:!0}}))},lt=t=>"undefined"==typeof FinalizationRegistry?(lt=t=>t,t):(nt=new FinalizationRegistry((t=>{--(t=t.M).count.value,0===t.count.value&&(t.U?t.X.$(t.U):t.T.R.$(t.S))})),ot=t=>{nt.unregister(t)},(lt=t=>{var e=t.M;return e.U&&nt.register(t,{M:e},t),t})(t));function _t(){}var ht=(t,e)=>Object.defineProperty(e,"name",{value:t}),pt=(t,e,r)=>{if(void 0===t[e].W){var n=t[e];t[e]=function(...n){if(!t[e].W.hasOwnProperty(n.length))throw new V(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].W})!`);return t[e].W[n.length].apply(this,n)},t[e].W=[],t[e].W[n.ea]=n}};function dt(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.ga=r,this.$=n,this.V=o,this.va=i,this.ia=a,this.ua=s,this.Aa=[]}var yt=(t,e,r)=>{for(;e!==r;){if(!e.ia)throw new V(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.ia(t),e=e.V}return t};function gt(t,e){if(null===e){if(this.pa)throw new V(`null is not a valid ${this.name}`);return 0}if(!e.M)throw new V(`Cannot pass "${Wt(e)}" as a ${this.name}`);if(!e.M.S)throw new V(`Cannot pass deleted object as a pointer of type ${this.name}`);return yt(e.M.S,e.M.T.R,this.R)}function wt(t,e){if(null===e){if(this.pa)throw new V(`null is not a valid ${this.name}`);if(this.la){var r=this.Ba();return null!==t&&t.push(this.$,r),r}return 0}if(!e||!e.M)throw new V(`Cannot pass "${Wt(e)}" as a ${this.name}`);if(!e.M.S)throw new V(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ka&&e.M.T.ka)throw new V(`Cannot convert argument of type ${e.M.X?e.M.X.name:e.M.T.name} to parameter type ${this.name}`);if(r=yt(e.M.S,e.M.T.R,this.R),this.la){if(void 0===e.M.U)throw new V("Passing raw pointer to smart pointer is illegal");switch(this.Da){case 0:if(e.M.X!==this)throw new V(`Cannot convert argument of type ${e.M.X?e.M.X.name:e.M.T.name} to parameter type ${this.name}`);r=e.M.U;break;case 1:r=e.M.U;break;case 2:if(e.M.X===this)r=e.M.U;else{var n=e.clone();r=this.Ca(r,Dt((()=>n.delete()))),null!==t&&t.push(this.$,r)}break;default:throw new V("Unsupporting sharing policy")}}return r}function mt(t,e){if(null===e){if(this.pa)throw new V(`null is not a valid ${this.name}`);return 0}if(!e.M)throw new V(`Cannot pass "${Wt(e)}" as a ${this.name}`);if(!e.M.S)throw new V(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.M.T.ka)throw new V(`Cannot convert argument of type ${e.M.T.name} to parameter type ${this.name}`);return yt(e.M.S,e.M.T.R,this.R)}function Et(t){return this.fromWireType(O[t>>2])}function vt(t,e,r,n,o,i,a,s,u,f,c){this.name=t,this.R=e,this.pa=r,this.ka=n,this.la=o,this.za=i,this.Da=a,this.sa=s,this.Ba=u,this.Ca=f,this.$=c,o||void 0!==e.V?this.toWireType=wt:(this.toWireType=n?gt:mt,this.Y=null)}var bt,St,Ot=(t,e)=>(...r)=>((t,e,r=[])=>t.includes("j")?(0,i["dynCall_"+t])(e,...r):bt.get(e)(...r))(t,e,r),Tt=(t,e)=>{var r=(t=q(t)).includes("j")?Ot(t,e):bt.get(e);if("function"!=typeof r)throw new V(`unknown function pointer with signature ${t}: ${e}`);return r},At=t=>{t=Oe(t);var e=q(t);return Se(t),e},Bt=(t,e)=>{var r=[],n={};throw e.forEach((function t(e){n[e]||X[e]||(Z[e]?Z[e].forEach(t):(r.push(e),n[e]=!0))})),new St(`${t}: `+r.map(At).join([", "]))},Ct=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function Rt(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].Y)return!0;return!1}function Pt(t){var e=Function;if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=ht(e.name||"unknownFunctionName",(function(){}));return r.prototype=e.prototype,r=new r,(t=e.apply(r,t))instanceof Object?t:r}function It(t,e,r,n,o,i){var a=e.length;if(2>a)throw new V("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==e[1]&&null!==r,u=Rt(e);for(r="void"!==e[0].name,n=[t,Q,n,o,Ct,e[0],e[1]],o=0;o<a-2;++o)n.push(e[o+2]);if(!u)for(o=s?1:2;o<e.length;++o)null!==e[o].Y&&n.push(e[o].Y);u=Rt(e),o=e.length;var f="",c="";for(a=0;a<o-2;++a)f+=(0!==a?", ":"")+"arg"+a,c+=(0!==a?", ":"")+"arg"+a+"Wired";f=`\n return function (${f}) {\n if (arguments.length !== ${o-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${o-2}');\n }`,u&&(f+="var destructors = [];\n");var l=u?"destructors":"null",_="humanName throwBindingError invoker fn runDestructors retType classParam".split(" ");for(s&&(f+="var thisWired = classParam['toWireType']("+l+", this);\n"),a=0;a<o-2;++a)f+="var arg"+a+"Wired = argType"+a+"['toWireType']("+l+", arg"+a+");\n",_.push("argType"+a);if(s&&(c="thisWired"+(0<c.length?", ":"")+c),f+=(r||i?"var rv = ":"")+"invoker(fn"+(0<c.length?", ":"")+c+");\n",u)f+="runDestructors(destructors);\n";else for(a=s?1:2;a<e.length;++a)i=1===a?"thisWired":"arg"+(a-2)+"Wired",null!==e[a].Y&&(f+=`${i}_dtor(${i});\n`,_.push(`${i}_dtor`));r&&(f+="var ret = retType['fromWireType'](rv);\nreturn ret;\n");let[h,p]=[_,f+"}\n"];return h.push(p),e=Pt(h)(...n),ht(t,e)}for(var Mt,xt,Lt,Ut,jt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(O[e+4*n>>2]);return r},Nt=t=>{const e=(t=t.trim()).indexOf("(");return-1!==e?t.substr(0,e):t},kt=[],Ft=[],$t=t=>{9<t&&0==--Ft[t+1]&&(Ft[t]=void 0,kt.push(t))},Yt=t=>{if(!t)throw new V("Cannot use deleted val. handle = "+t);return Ft[t]},Dt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=kt.pop()||Ft.length;return Ft[e]=t,Ft[e+1]=1,e}},Gt={name:"emscripten::val",fromWireType:t=>{var e=Yt(t);return $t(t),e},toWireType:(t,e)=>Dt(e),argPackAdvance:8,readValueFromPointer:Et,Y:null},Wt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},Ht=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(T[t>>2])};case 8:return function(t){return this.fromWireType(A[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Vt=(t,e,r)=>{switch(e){case 1:return r?t=>m[t]:t=>E[t];case 2:return r?t=>v[t>>1]:t=>b[t>>1];case 4:return r?t=>S[t>>2]:t=>O[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},zt=(t,e,r,n)=>{if(0<n){n=r+n-1;for(var o=0;o<t.length;++o){var i=t.charCodeAt(o);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++o)),127>=i){if(r>=n)break;e[r++]=i}else{if(2047>=i){if(r+1>=n)break;e[r++]=192|i>>6}else{if(65535>=i){if(r+2>=n)break;e[r++]=224|i>>12}else{if(r+3>=n)break;e[r++]=240|i>>18,e[r++]=128|i>>12&63}e[r++]=128|i>>6&63}e[r++]=128|63&i}}e[r]=0}},qt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},Kt="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Xt=(t,e)=>{var r=E,n=t+e;for(e=t;r[e]&&!(e>=n);)++e;if(16<e-t&&r.buffer&&Kt)return Kt.decode(r.subarray(t,e));for(n="";t<e;){var o=r[t++];if(128&o){var i=63&r[t++];if(192==(224&o))n+=String.fromCharCode((31&o)<<6|i);else{var a=63&r[t++];65536>(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&r[t++])?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else n+=String.fromCharCode(o)}return n},Zt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Qt=(t,e)=>{for(var r=t>>1,n=r+e/2;!(r>=n)&&b[r];)++r;if(32<(r<<=1)-t&&Zt)return Zt.decode(E.subarray(t,r));for(r="",n=0;!(n>=e/2);++n){var o=v[t+2*n>>1];if(0==o)break;r+=String.fromCharCode(o)}return r},Jt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var o=0;o<r;++o)v[e>>1]=t.charCodeAt(o),e+=2;return v[e>>1]=0,e-n},te=t=>2*t.length,ee=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var o=S[t+4*r>>2];if(0==o)break;++r,65536<=o?(o-=65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o)):n+=String.fromCharCode(o)}return n},re=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var o=0;o<t.length;++o){var i=t.charCodeAt(o);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++o)),S[e>>2]=i,(e+=4)+4>r)break}return S[e>>2]=0,e-n},ne=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);55296<=n&&57343>=n&&++r,e+=4}return e},oe=(t,e)=>{var r=X[t];if(void 0===r)throw t=`${e} has unknown type ${At(t)}`,new V(t);return r},ie=(t,e,r)=>{var n=[];return t=t.toWireType(n,r),n.length&&(O[e>>2]=Dt(n)),t},ae=[],se={},ue=t=>{var e=se[t];return void 0===e?q(t):e},fe=()=>"object"==typeof globalThis?globalThis:Function("return this")(),ce=[],le={},_e=()=>{if(!Mt){var t,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",_:c||"./this.program"};for(t in le)void 0===le[t]?delete e[t]:e[t]=le[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);Mt=r}return Mt},he=t=>0==t%4&&(0!=t%100||0==t%400),pe=[31,29,31,30,31,30,31,31,30,31,30,31],de=[31,28,31,30,31,30,31,31,30,31,30,31],ye=(t,e,r,n)=>{function o(t,e,r){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=r[0]+t;return t}function i(t,e){return o(t,e,"0")}function a(t,e){function r(t){return 0>t?-1:0<t?1:0}var n;return 0===(n=r(t.getFullYear()-e.getFullYear()))&&0===(n=r(t.getMonth()-e.getMonth()))&&(n=r(t.getDate()-e.getDate())),n}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){var e=t.ba;for(t=new Date(new Date(t.da+1900,0,1).getTime());0<e;){var r=t.getMonth(),n=(he(t.getFullYear())?pe:de)[r];if(!(e>n-t.getDate())){t.setDate(t.getDate()+e);break}e-=n-t.getDate()+1,t.setDate(1),11>r?t.setMonth(r+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return r=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),r=s(r),0>=a(e,t)?0>=a(r,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=O[n+40>>2];for(var c in n={Ga:S[n>>2],Fa:S[n+4>>2],ma:S[n+8>>2],qa:S[n+12>>2],na:S[n+16>>2],da:S[n+20>>2],Z:S[n+24>>2],ba:S[n+28>>2],Ia:S[n+32>>2],Ea:S[n+36>>2],Ha:f&&f?Xt(f):""},r=r?Xt(r):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(c,"g"),f[c]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),_="January February March April May June July August September October November December".split(" ");for(c in f={"%a":t=>l[t.Z].substring(0,3),"%A":t=>l[t.Z],"%b":t=>_[t.na].substring(0,3),"%B":t=>_[t.na],"%C":t=>i((t.da+1900)/100|0,2),"%d":t=>i(t.qa,2),"%e":t=>o(t.qa,2," "),"%g":t=>u(t).toString().substring(2),"%G":u,"%H":t=>i(t.ma,2),"%I":t=>(0==(t=t.ma)?t=12:12<t&&(t-=12),i(t,2)),"%j":t=>{for(var e=0,r=0;r<=t.na-1;e+=(he(t.da+1900)?pe:de)[r++]);return i(t.qa+e,3)},"%m":t=>i(t.na+1,2),"%M":t=>i(t.Fa,2),"%n":()=>"\n","%p":t=>0<=t.ma&&12>t.ma?"AM":"PM","%S":t=>i(t.Ga,2),"%t":()=>"\t","%u":t=>t.Z||7,"%U":t=>i(Math.floor((t.ba+7-t.Z)/7),2),"%V":t=>{var e=Math.floor((t.ba+7-(t.Z+6)%7)/7);if(2>=(t.Z+371-t.ba-2)%7&&e++,e)53==e&&(4==(r=(t.Z+371-t.ba)%7)||3==r&&he(t.da)||(e=1));else{e=52;var r=(t.Z+7-t.ba-1)%7;(4==r||5==r&&he(t.da%400-1))&&e++}return i(e,2)},"%w":t=>t.Z,"%W":t=>i(Math.floor((t.ba+7-(t.Z+6)%7)/7),2),"%y":t=>(t.da+1900).toString().substring(2),"%Y":t=>t.da+1900,"%z":t=>{var e=0<=(t=t.Ea);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":t=>t.Ha,"%%":()=>"%"},r=r.replace(/%%/g,"\0\0"),f)r.includes(c)&&(r=r.replace(new RegExp(c,"g"),f[c](n)));return c=function(t){var e=Array(qt(t)+1);return zt(t,e,0,e.length),e}(r=r.replace(/\0\0/g,"%")),c.length>e?0:(m.set(c,t),c.length-1)},ge=Array(256),we=0;256>we;++we)ge[we]=String.fromCharCode(we);H=ge,V=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},z=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(_t.prototype,{isAliasOf:function(t){if(!(this instanceof _t&&t instanceof _t))return!1;var e=this.M.T.R,r=this.M.S;t.M=t.M;var n=t.M.T.R;for(t=t.M.S;e.V;)r=e.ia(r),e=e.V;for(;n.V;)t=n.ia(t),n=n.V;return e===n&&r===t},clone:function(){if(this.M.S||rt(this),this.M.ha)return this.M.count.value+=1,this;var t=lt,e=Object,r=e.create,n=Object.getPrototypeOf(this),o=this.M;return(t=t(r.call(e,n,{M:{value:{count:o.count,fa:o.fa,ha:o.ha,S:o.S,T:o.T,U:o.U,X:o.X}}}))).M.count.value+=1,t.M.fa=!1,t},delete(){if(this.M.S||rt(this),this.M.fa&&!this.M.ha)throw new V("Object already scheduled for deletion");ot(this);var t=this.M;--t.count.value,0===t.count.value&&(t.U?t.X.$(t.U):t.T.R.$(t.S)),this.M.ha||(this.M.U=void 0,this.M.S=void 0)},isDeleted:function(){return!this.M.S},deleteLater:function(){if(this.M.S||rt(this),this.M.fa&&!this.M.ha)throw new V("Object already scheduled for deletion");return st.push(this),1===st.length&&et&&et(ut),this.M.fa=!0,this}}),i.getInheritedInstanceCount=()=>Object.keys(ft).length,i.getLiveInheritedInstances=()=>{var t,e=[];for(t in ft)ft.hasOwnProperty(t)&&e.push(ft[t]);return e},i.flushPendingDeletes=ut,i.setDelayFunction=t=>{et=t,st.length&&et&&et(ut)},Object.assign(vt.prototype,{wa(t){return this.sa&&(t=this.sa(t)),t},ra(t){this.$?.(t)},argPackAdvance:8,readValueFromPointer:Et,fromWireType:function(t){function e(){return this.la?ct(this.R.ga,{T:this.za,S:r,X:this,U:t}):ct(this.R.ga,{T:this,S:t})}var r=this.wa(t);if(!r)return this.ra(t),null;var n=((t,e)=>{if(void 0===e)throw new V("ptr should not be undefined");for(;t.V;)e=t.ia(e),t=t.V;return ft[e]})(this.R,r);if(void 0!==n)return 0===n.M.count.value?(n.M.S=r,n.M.U=t,n.clone()):(n=n.clone(),this.ra(t),n);if(n=this.R.va(r),!(n=at[n]))return e.call(this);n=this.ka?n.ta:n.pointerType;var o=it(r,this.R,n.R);return null===o?e.call(this):this.la?ct(n.R.ga,{T:n,S:o,X:this,U:t}):ct(n.R.ga,{T:n,S:o})}}),St=i.UnboundTypeError=(xt=Error,(Ut=ht(Lt="UnboundTypeError",(function(t){this.name=Lt,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(xt.prototype),Ut.prototype.constructor=Ut,Ut.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Ut),Ft.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=()=>Ft.length/2-5-kt.length;var me,Ee={d:(t,e,r)=>{var n=new W(t);throw O[n.S+16>>2]=0,O[n.S+4>>2]=e,O[n.S+8>>2]=r,t},x:()=>{},D:(t,e,r,n)=>{tt(t,{name:e=q(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:n},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(E[t])},Y:null})},k:(t,e,r,n,o,a,s,u,f,c,l,_,h)=>{l=q(l),a=Tt(o,a),u&&=Tt(s,u),c&&=Tt(f,c),h=Tt(_,h);var p=(t=>{if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(l);((t,e)=>{if(i.hasOwnProperty(t))throw new V(`Cannot register public name '${t}' twice`);i[t]=e})(p,(function(){Bt(`Cannot construct ${l} due to unbound types`,[n])})),J([t,e,r],n?[n]:[],(e=>{if(e=e[0],n)var r=e.R,o=r.ga;else o=_t.prototype;e=ht(l,(function(...t){if(Object.getPrototypeOf(this)!==s)throw new V("Use 'new' to construct "+l);if(void 0===_.aa)throw new V(l+" has no accessible constructor");var e=_.aa[t.length];if(void 0===e)throw new V(`Tried to invoke ctor of ${l} with invalid number of parameters (${t.length}) - expected (${Object.keys(_.aa).toString()}) parameters instead!`);return e.apply(this,t)}));var s=Object.create(o,{constructor:{value:e}});e.prototype=s;var f,_=new dt(l,e,s,h,r,a,u,c);return _.V&&((f=_.V).ja??(f.ja=[]),_.V.ja.push(_)),r=new vt(l,_,!0,!1,!1),f=new vt(l+"*",_,!1,!1,!1),o=new vt(l+" const*",_,!1,!0,!1),at[t]={pointerType:f,ta:o},((t,e)=>{if(!i.hasOwnProperty(t))throw new z("Replacing nonexistent public symbol");i[t]=e,i[t].ea=void 0})(p,e),[r,f,o]}))},b:(t,e,r,n,o,i,a,s)=>{var u=jt(r,n);e=q(e),e=Nt(e),i=Tt(o,i),J([],[t],(t=>{function n(){Bt(`Cannot call ${o} due to unbound types`,u)}var o=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var f=t.R.constructor;return void 0===f[e]?(n.ea=r-1,f[e]=n):(pt(f,e,o),f[e].W[r-1]=n),J([],u,(n=>{if(n=[n[0],null].concat(n.slice(1)),n=It(o,n,null,i,a,s),void 0===f[e].W?(n.ea=r-1,f[e]=n):f[e].W[r-1]=n,t.R.ja)for(const r of t.R.ja)r.constructor.hasOwnProperty(e)||(r.constructor[e]=n);return[]})),[]}))},o:(t,e,r,n,o,i,a,s)=>{e=q(e),i=Tt(o,i),J([],[t],(t=>{var o=`${(t=t[0]).name}.${e}`,u={get(){Bt(`Cannot access ${o} due to unbound types`,[r])},enumerable:!0,configurable:!0};return u.set=s?()=>{Bt(`Cannot access ${o} due to unbound types`,[r])}:()=>{throw new V(`${o} is a read-only property`)},Object.defineProperty(t.R.constructor,e,u),J([],[r],(r=>{r=r[0];var o={get:()=>r.fromWireType(i(n)),enumerable:!0};return s&&(s=Tt(a,s),o.set=t=>{var e=[];s(n,r.toWireType(e,t)),Ct(e)}),Object.defineProperty(t.R.constructor,e,o),[]})),[]}))},q:(t,e,r,n,o,i)=>{var a=jt(e,r);o=Tt(n,o),J([],[t],(t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.R.aa&&(t.R.aa=[]),void 0!==t.R.aa[e-1])throw new V(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.R.aa[e-1]=()=>{Bt(`Cannot construct ${t.name} due to unbound types`,a)},J([],a,(n=>(n.splice(1,0,null),t.R.aa[e-1]=It(r,n,null,o,i),[]))),[]}))},f:(t,e,r,n,o,i,a,s,u)=>{var f=jt(r,n);e=q(e),e=Nt(e),i=Tt(o,i),J([],[t],(t=>{function n(){Bt(`Cannot call ${o} due to unbound types`,f)}var o=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.R.Aa.push(e);var c=t.R.ga,l=c[e];return void 0===l||void 0===l.W&&l.className!==t.name&&l.ea===r-2?(n.ea=r-2,n.className=t.name,c[e]=n):(pt(c,e,o),c[e].W[r-2]=n),J([],f,(n=>(n=It(o,n,t,i,a,u),void 0===c[e].W?(n.ea=r-2,c[e]=n):c[e].W[r-2]=n,[]))),[]}))},C:t=>tt(t,Gt),s:(t,e,r)=>{tt(t,{name:e=q(e),fromWireType:t=>t,toWireType:(t,e)=>e,argPackAdvance:8,readValueFromPointer:Ht(e,r),Y:null})},j:(t,e,r,n,o)=>{if(e=q(e),-1===o&&(o=4294967295),o=t=>t,0===n){var i=32-8*r;o=t=>t<<i>>>i}var a=e.includes("unsigned")?function(t,e){return e>>>0}:function(t,e){return e};tt(t,{name:e,fromWireType:o,toWireType:a,argPackAdvance:8,readValueFromPointer:Vt(e,r,0!==n),Y:null})},e:(t,e,r)=>{function n(t){return new o(m.buffer,O[t+4>>2],O[t>>2])}var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];tt(t,{name:r=q(r),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{xa:!0})},r:(t,e)=>{var r="std::string"===(e=q(e));tt(t,{name:e,fromWireType:function(t){var e=O[t>>2],n=t+4;if(r)for(var o=n,i=0;i<=e;++i){var a=n+i;if(i==e||0==E[a]){if(o=o?Xt(o,a-o):"",void 0===s)var s=o;else s+=String.fromCharCode(0),s+=o;o=a+1}}else{for(s=Array(e),i=0;i<e;++i)s[i]=String.fromCharCode(E[n+i]);s=s.join("")}return Se(t),s},toWireType:function(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;if(!(n||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array))throw new V("Cannot pass non-string to std::string");var o=r&&n?qt(e):e.length,i=be(4+o+1),a=i+4;if(O[i>>2]=o,r&&n)zt(e,E,a,o+1);else if(n)for(n=0;n<o;++n){var s=e.charCodeAt(n);if(255<s)throw Se(a),new V("String has UTF-16 code units that do not fit in 8 bits");E[a+n]=s}else for(n=0;n<o;++n)E[a+n]=e[n];return null!==t&&t.push(Se,i),i},argPackAdvance:8,readValueFromPointer:Et,Y(t){Se(t)}})},n:(t,e,r)=>{if(r=q(r),2===e)var n=Qt,o=Jt,i=te,a=t=>b[t>>1];else 4===e&&(n=ee,o=re,i=ne,a=t=>O[t>>2]);tt(t,{name:r,fromWireType:t=>{for(var r,o=O[t>>2],i=t+4,s=0;s<=o;++s){var u=t+4+s*e;s!=o&&0!=a(u)||(i=n(i,u-i),void 0===r?r=i:(r+=String.fromCharCode(0),r+=i),i=u+e)}return Se(t),r},toWireType:(t,n)=>{if("string"!=typeof n)throw new V(`Cannot pass non-string to C++ string type ${r}`);var a=i(n),s=be(4+a+e);return O[s>>2]=a/e,o(n,s+4,a+e),null!==t&&t.push(Se,s),s},argPackAdvance:8,readValueFromPointer:Et,Y(t){Se(t)}})},E:(t,e)=>{tt(t,{ya:!0,name:e=q(e),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},h:(t,e,r)=>(t=Yt(t),e=oe(e,"emval::as"),ie(e,r,t)),F:(t,e,r,n)=>(t=ae[t])(null,e=Yt(e),r,n),v:(t,e,r,n,o)=>(t=ae[t])(e=Yt(e),e[r=ue(r)],n,o),a:$t,w:t=>0===t?Dt(fe()):(t=ue(t),Dt(fe()[t])),p:(t,e,r)=>{e=((t,e)=>{for(var r=Array(t),n=0;n<t;++n)r[n]=oe(O[e+4*n>>2],"parameter "+n);return r})(t,e);var n=e.shift();t--;var o="return function (obj, func, destructorsRef, args) {\n",i=0,a=[];0===r&&a.push("obj");for(var s=["retType"],u=[n],f=0;f<t;++f)a.push("arg"+f),s.push("argType"+f),u.push(e[f]),o+=` var arg${f} = argType${f}.readValueFromPointer(args${i?"+"+i:""});\n`,i+=e[f].argPackAdvance;return o+=` var rv = ${1===r?"new func":"func.call"}(${a.join(", ")});\n`,n.ya||(s.push("emval_returnValue"),u.push(ie),o+=" return emval_returnValue(retType, destructorsRef, rv);\n"),s.push(o+"};\n"),t=Pt(s)(...u),r=`methodCaller<(${e.map((t=>t.name)).join(", ")}) => ${n.name}>`,(t=>{var e=ae.length;return ae.push(t),e})(ht(r,t))},i:(t,e)=>(t=Yt(t),e=Yt(e),Dt(t[e])),c:t=>{9<t&&(Ft[t+1]+=1)},l:t=>Dt(ue(t)),g:t=>{var e=Yt(t);Ct(e),$t(t)},m:(t,e)=>(t=(t=oe(t,"_emval_take_value")).readValueFromPointer(e),Dt(t)),t:()=>{U("")},u:(t,e,r)=>{ce.length=0;for(var n;n=E[e++];){var o=105!=n;r+=(o&=112!=n)&&r%8?4:0,ce.push(112==n?O[r>>2]:105==n?S[r>>2]:A[r>>3]),r+=o?8:4}return D[t](...ce)},B:()=>{U("OOM")},z:(t,e)=>{var r=0;return _e().forEach(((n,o)=>{var i=e+r;for(o=O[t+4*o>>2]=i,i=0;i<n.length;++i)m[o++]=n.charCodeAt(i);m[o]=0,r+=n.length+1})),0},A:(t,e)=>{var r=_e();O[t>>2]=r.length;var n=0;return r.forEach((t=>n+=t.length+1)),O[e>>2]=n,0},y:(t,e,r,n)=>ye(t,e,r,n)},ve=function(){function t(t){return ve=t.exports,t=ve.G.buffer,i.HEAP8=m=new Int8Array(t),i.HEAP16=v=new Int16Array(t),i.HEAPU8=E=new Uint8Array(t),i.HEAPU16=b=new Uint16Array(t),i.HEAP32=S=new Int32Array(t),i.HEAPU32=O=new Uint32Array(t),i.HEAPF32=T=new Float32Array(t),i.HEAPF64=A=new Float64Array(t),bt=ve.J,R.unshift(ve.H),M--,i.monitorRunDependencies?.(M),0==M&&(null!==x&&(clearInterval(x),x=null),L&&(t=L,L=null,t())),ve}var e={a:Ee};if(M++,i.monitorRunDependencies?.(M),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(t){w(`Module.instantiateWasm callback failed with error: ${t}`),o(t)}return function(t,e){var r=j;return g||"function"!=typeof WebAssembly.instantiateStreaming||N(r)||k(r)||h||"function"!=typeof fetch?Y(r,t,e):fetch(r,{credentials:"same-origin"}).then((n=>WebAssembly.instantiateStreaming(n,t).then(e,(function(n){return w(`wasm streaming compile failed: ${n}`),w("falling back to ArrayBuffer instantiation"),Y(r,t,e)}))))}(e,(function(e){t(e.instance)})).catch(o),{}}(),be=t=>(be=ve.I)(t),Se=t=>(Se=ve.K)(t),Oe=t=>(Oe=ve.L)(t);function Te(){function t(){if(!me&&(me=!0,i.calledRun=!0,!B)){if(G(R),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;){var t=i.postRun.shift();P.unshift(t)}G(P)}}if(!(0<M)){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)I();G(C),0<M||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t())}}if(i.dynCall_viijii=(t,e,r,n,o,a,s)=>(i.dynCall_viijii=ve.N)(t,e,r,n,o,a,s),i.dynCall_iiiiij=(t,e,r,n,o,a,s)=>(i.dynCall_iiiiij=ve.O)(t,e,r,n,o,a,s),i.dynCall_iiiiijj=(t,e,r,n,o,a,s,u,f)=>(i.dynCall_iiiiijj=ve.P)(t,e,r,n,o,a,s,u,f),i.dynCall_iiiiiijj=(t,e,r,n,o,a,s,u,f,c)=>(i.dynCall_iiiiiijj=ve.Q)(t,e,r,n,o,a,s,u,f,c),L=function t(){me||Te(),me||(L=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.pop()();return Te(),t.ready});t.exports=o},606:function(t,e,r){t.exports=function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"t",{value:!0})};var e={};t.r(e),t.d(e,{Hex:function(){return u}});var n,o="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i=(n=parseInt((/msie (\d+)/.exec(o)||[])[1],10),isNaN(n)?(n=parseInt((/trident\/.*; rv:(\d+)/.exec(o)||[])[1],10),!isNaN(n)&&n):n),a=function(){if("undefined"!=typeof window){var e=window.crypto||window.msCrypto;if(!e){if(function(t,e){return!1!==i&&(!e||("<"===t?i<e:"<="===t?i<=e:">"===t?i>e:">="===t?i>=e:i===e))}("<",11))return console.warn("IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser"),function(){return Math.floor(512*Math.random())%256};throw new Error("Crypto module not found")}return function(){return e.getRandomValues(new Uint32Array(1))[0]}}return void 0!==t.g&&t.g.crypto?function(){return t.g.crypto.randomBytes(4).readInt32LE()}:function(){return r(378).randomBytes(4).readInt32LE()}}(),s=function(){function t(e,r){if(Array.isArray(e)||!e)return this.i=Array.isArray(e)?e:[],void(this.u="number"==typeof r?r:4*this.i.length);if(e instanceof t)return this.i=e.words.slice(),void(this.u=e.nSigBytes);var n;try{e instanceof ArrayBuffer?n=new Uint8Array(e):(e instanceof Uint8Array||e instanceof Int8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}catch(t){throw new Error("Invalid argument")}if(!n)throw new Error("Invalid argument");for(var o=n.byteLength,i=[],a=0;a<o;a++)i[a>>>2]|=n[a]<<24-a%4*8;this.i=i,this.u=o}return Object.defineProperty(t.prototype,"nSigBytes",{get:function(){return this.u},set:function(t){this.u=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"words",{get:function(){return this.i},enumerable:!1,configurable:!0}),t.prototype.toString=function(t){return t?t.stringify(this):u.stringify(this)},t.prototype.toUint8Array=function(){for(var t=this.i,e=this.u,r=new Uint8Array(e),n=0;n<e;n++)r[n]=t[n>>>2]>>>24-n%4*8&255;return r},t.prototype.concat=function(t){var e=t.words.slice(),r=t.nSigBytes;if(this.clamp(),this.u%4)for(var n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;this.i[this.u+n>>>2]|=o<<24-(this.u+n)%4*8}else for(n=0;n<r;n+=4)this.i[this.u+n>>>2]=e[n>>>2];return this.u+=r,this},t.prototype.clamp=function(){var t=this.u;this.i[t>>>2]&=4294967295<<32-t%4*8,this.i.length=Math.ceil(t/4)},t.prototype.clone=function(){return new t(this.i.slice(),this.u)},t.random=function(e){for(var r=[],n=0;n<e;n+=4)r.push(a());return new t(r,e)},t}(),u={stringify:function(t){for(var e=t.nSigBytes,r=t.words,n=[],o=0;o<e;o++){var i=r[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){var e=t.length;if(e%2!=0)throw new Error("Hex string count must be even");if(!/^[a-fA-F0-9]+$/.test(t))throw new Error("Invalid Hex string: "+t);for(var r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s(r,e/2)}};return e}()},876:function(t,e,r){t.exports=function(){"use strict";var t={3354:function(t,e,r){r.d(e,{e:function(){return i}});var n=r(5720),o=r(9054),i=function(){function t(e,r){if(Array.isArray(e)||!e)return this.t=Array.isArray(e)?e:[],void(this.i="number"==typeof r?r:4*this.t.length);if(e instanceof t)return this.t=e.words.slice(),void(this.i=e.nSigBytes);var n;try{e instanceof ArrayBuffer?n=new Uint8Array(e):(e instanceof Uint8Array||e instanceof Int8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}catch(t){throw new Error("Invalid argument")}if(!n)throw new Error("Invalid argument");for(var o=n.byteLength,i=[],a=0;a<o;a++)i[a>>>2]|=n[a]<<24-a%4*8;this.t=i,this.i=o}return Object.defineProperty(t.prototype,"nSigBytes",{get:function(){return this.i},set:function(t){this.i=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"words",{get:function(){return this.t},enumerable:!1,configurable:!0}),t.prototype.toString=function(t){return t?t.stringify(this):n.p.stringify(this)},t.prototype.toUint8Array=function(){for(var t=this.t,e=this.i,r=new Uint8Array(e),n=0;n<e;n++)r[n]=t[n>>>2]>>>24-n%4*8&255;return r},t.prototype.concat=function(t){var e=t.words.slice(),r=t.nSigBytes;if(this.clamp(),this.i%4)for(var n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;this.t[this.i+n>>>2]|=o<<24-(this.i+n)%4*8}else for(n=0;n<r;n+=4)this.t[this.i+n>>>2]=e[n>>>2];return this.i+=r,this},t.prototype.clamp=function(){var t=this.i;this.t[t>>>2]&=4294967295<<32-t%4*8,this.t.length=Math.ceil(t/4)},t.prototype.clone=function(){return new t(this.t.slice(),this.i)},t.random=function(e){for(var r=[],n=0;n<e;n+=4)r.push((0,o.M)());return new t(r,e)},t}()},7211:function(t,e,r){r.d(e,{C:function(){return i}});var n=r(3354),o=r(4768),i=function(){function t(t){this.u=0,this.h=0,this.v=t,this.l=t&&void 0!==t.data?t.data.clone():new n.e,this.A=t&&"number"==typeof t.nBytes?t.nBytes:0}return Object.defineProperty(t.prototype,"blockSize",{get:function(){return this.h},enumerable:!1,configurable:!0}),t.prototype.reset=function(t,e){this.l=void 0!==t?t.clone():new n.e,this.A="number"==typeof e?e:0},t.prototype.j=function(t){var e="string"==typeof t?o.d.parse(t):t;this.l.concat(e),this.A+=e.nSigBytes},t.prototype.O=function(t){var e,r=this.l.words,o=this.l.nSigBytes,i=this.h,a=o/(4*this.h),s=(a=t?Math.ceil(a):Math.max((0|a)-this.u,0))*i,u=Math.min(4*s,o);if(s){for(var f=0;f<s;f+=i)this.I(r,f);e=r.splice(0,s),this.l.nSigBytes-=u}return new n.e(e,u)},t.prototype.I=function(t,e){throw new Error("Not implemented")},t}()},1868:function(t,e,r){r.d(e,{P:function(){return a}});var n,o=r(7211),i=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(t){function e(e){var r=t.call(this,e)||this;return r.h=16,r.v=e,e&&"number"==typeof e.blockSize&&(r.h=e.blockSize),r.reset(e?e.data:void 0,e?e.nBytes:void 0),r}return i(e,t),Object.defineProperty(e.prototype,"blockSize",{get:function(){return this.h},enumerable:!1,configurable:!0}),e.prototype.reset=function(e,r){t.prototype.reset.call(this,e,r),this.U()},e.prototype.update=function(t){return this.j(t),this.O(),this},e.prototype.finalize=function(t){return t&&this.j(t),this._()},e.prototype.U=function(){throw new Error("Not implemented")},e.prototype._=function(){throw new Error("Not implemented")},e}(o.C)},1756:function(t,e,r){r.d(e,{w:function(){return a}});var n,o="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i=(n=parseInt((/msie (\d+)/.exec(o)||[])[1],10),isNaN(n)?(n=parseInt((/trident\/.*; rv:(\d+)/.exec(o)||[])[1],10),!isNaN(n)&&n):n);function a(t,e){return!1!==i&&(!e||("<"===t?i<e:"<="===t?i<=e:">"===t?i>e:">="===t?i>=e:i===e))}},5720:function(t,e,r){r.d(e,{p:function(){return o}});var n=r(3354),o={stringify:function(t){for(var e=t.nSigBytes,r=t.words,n=[],o=0;o<e;o++){var i=r[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){var e=t.length;if(e%2!=0)throw new Error("Hex string count must be even");if(!/^[a-fA-F0-9]+$/.test(t))throw new Error("Invalid Hex string: "+t);for(var r=[],o=0;o<e;o+=2)r[o>>>3]|=parseInt(t.substr(o,2),16)<<24-o%8*4;return new n.e(r,e/2)}}},8702:function(t,e,r){r.d(e,{m:function(){return o}});var n=r(3354),o={stringify:function(t){for(var e=t.nSigBytes,r=t.words,n=[],o=0;o<e;o++){var i=r[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],o=0;o<e;o++)r[o>>>2]|=(255&t.charCodeAt(o))<<24-o%4*8;return new n.e(r,e)}}},4768:function(t,e,r){r.d(e,{d:function(){return o}});var n=r(8702),o={stringify:function(t){try{return decodeURIComponent(escape(n.m.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return n.m.parse(unescape(encodeURIComponent(t)))}}},9054:function(t,e,n){n.d(e,{M:function(){return i}});var o=n(1756),i=function(){if("undefined"!=typeof window){var t=window.crypto||window.msCrypto;if(!t){if((0,o.w)("<",11))return console.warn("IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser"),function(){return Math.floor(512*Math.random())%256};throw new Error("Crypto module not found")}return function(){return t.getRandomValues(new Uint32Array(1))[0]}}return void 0!==n.g&&n.g.crypto?function(){return n.g.crypto.randomBytes(4).readInt32LE()}:function(){return r(378).randomBytes(4).readInt32LE()}}()}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"S",{value:!0})};var o={};return function(){n.r(o),n.d(o,{SHA256:function(){return l}});var t,e=n(1868),r=n(3354),i=(t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)},function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),a=[],s=[];function u(t){for(var e=Math.sqrt(t),r=2;r<=e;r++)if(!(t%r))return!1;return!0}function f(t){return 4294967296*(t-(0|t))|0}!function(){for(var t=2,e=0;e<64;)u(t)&&(e<8&&(a[e]=f(Math.pow(t,.5))),s[e]=f(Math.pow(t,1/3)),e++),t++}();var c=[],l=function(t){function e(e){var n=t.call(this,e)||this;return n.N=new r.e(a.slice(0)),n.v=e,e&&void 0!==e.hash&&(n.N=e.hash.clone()),n}return i(e,t),e.prototype.U=function(){this.N=new r.e(a.slice(0))},e.prototype.I=function(t,e){for(var r=this.N.words,n=r[0],o=r[1],i=r[2],a=r[3],u=r[4],f=r[5],l=r[6],_=r[7],h=0;h<64;h++){if(h<16)c[h]=0|t[e+h];else{var p=c[h-15],d=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=c[h-2],g=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;c[h]=d+c[h-7]+g+c[h-16]}var w=n&o^n&i^o&i,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),E=_+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&f^~u&l)+s[h]+c[h];_=l,l=f,f=u,u=a+E|0,a=i,i=o,o=n,n=E+(m+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+_|0},e.prototype._=function(){var t=this.l.words,e=8*this.A,r=8*this.l.nSigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(e/4294967296),t[15+(r+64>>>9<<4)]=e,this.l.nSigBytes=4*t.length,this.O(),this.N},e.prototype.clone=function(){return new e({hash:this.N,blockSize:this.h,data:this.l,nBytes:this.A})},e.hash=function(t,r){return new e(r).finalize(t)},e}(e.P)}(),o}()},852:function(t,e,r){t.exports=function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"t",{value:!0})};var e={};t.r(e),t.d(e,{Utf8:function(){return l}});var n,o=function(t){for(var e=t.nSigBytes,r=t.words,n=[],o=0;o<e;o++){var i=r[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},i="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",a=(n=parseInt((/msie (\d+)/.exec(i)||[])[1],10),isNaN(n)?(n=parseInt((/trident\/.*; rv:(\d+)/.exec(i)||[])[1],10),!isNaN(n)&&n):n),s=function(){if("undefined"!=typeof window){var e=window.crypto||window.msCrypto;if(!e){if(function(t,e){return!1!==a&&(!e||("<"===t?a<e:"<="===t?a<=e:">"===t?a>e:">="===t?a>=e:a===e))}("<",11))return console.warn("IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser"),function(){return Math.floor(512*Math.random())%256};throw new Error("Crypto module not found")}return function(){return e.getRandomValues(new Uint32Array(1))[0]}}return void 0!==t.g&&t.g.crypto?function(){return t.g.crypto.randomBytes(4).readInt32LE()}:function(){return r(378).randomBytes(4).readInt32LE()}}(),u=function(){function t(e,r){if(Array.isArray(e)||!e)return this.i=Array.isArray(e)?e:[],void(this.u="number"==typeof r?r:4*this.i.length);if(e instanceof t)return this.i=e.words.slice(),void(this.u=e.nSigBytes);var n;try{e instanceof ArrayBuffer?n=new Uint8Array(e):(e instanceof Uint8Array||e instanceof Int8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}catch(t){throw new Error("Invalid argument")}if(!n)throw new Error("Invalid argument");for(var o=n.byteLength,i=[],a=0;a<o;a++)i[a>>>2]|=n[a]<<24-a%4*8;this.i=i,this.u=o}return Object.defineProperty(t.prototype,"nSigBytes",{get:function(){return this.u},set:function(t){this.u=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"words",{get:function(){return this.i},enumerable:!1,configurable:!0}),t.prototype.toString=function(t){return t?t.stringify(this):o(this)},t.prototype.toUint8Array=function(){for(var t=this.i,e=this.u,r=new Uint8Array(e),n=0;n<e;n++)r[n]=t[n>>>2]>>>24-n%4*8&255;return r},t.prototype.concat=function(t){var e=t.words.slice(),r=t.nSigBytes;if(this.clamp(),this.u%4)for(var n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;this.i[this.u+n>>>2]|=o<<24-(this.u+n)%4*8}else for(n=0;n<r;n+=4)this.i[this.u+n>>>2]=e[n>>>2];return this.u+=r,this},t.prototype.clamp=function(){var t=this.u;this.i[t>>>2]&=4294967295<<32-t%4*8,this.i.length=Math.ceil(t/4)},t.prototype.clone=function(){return new t(this.i.slice(),this.u)},t.random=function(e){for(var r=[],n=0;n<e;n+=4)r.push(s());return new t(r,e)},t}(),f=function(t){for(var e=t.nSigBytes,r=t.words,n=[],o=0;o<e;o++){var i=r[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},c=function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u(r,e)},l={stringify:function(t){try{return decodeURIComponent(escape(f(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c(unescape(encodeURIComponent(t)))}};return e}()},157:function(t,e,r){t.exports=function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"t",{value:!0})};var e={};t.r(e),t.d(e,{Word32Array:function(){return u}});var n,o=function(t){for(var e=t.nSigBytes,r=t.words,n=[],o=0;o<e;o++){var i=r[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},i="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",a=(n=parseInt((/msie (\d+)/.exec(i)||[])[1],10),isNaN(n)?(n=parseInt((/trident\/.*; rv:(\d+)/.exec(i)||[])[1],10),!isNaN(n)&&n):n),s=function(){if("undefined"!=typeof window){var e=window.crypto||window.msCrypto;if(!e){if(function(t,e){return!1!==a&&(!e||("<"===t?a<e:"<="===t?a<=e:">"===t?a>e:">="===t?a>=e:a===e))}("<",11))return console.warn("IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser"),function(){return Math.floor(512*Math.random())%256};throw new Error("Crypto module not found")}return function(){return e.getRandomValues(new Uint32Array(1))[0]}}return void 0!==t.g&&t.g.crypto?function(){return t.g.crypto.randomBytes(4).readInt32LE()}:function(){return r(378).randomBytes(4).readInt32LE()}}(),u=function(){function t(e,r){if(Array.isArray(e)||!e)return this.i=Array.isArray(e)?e:[],void(this.u="number"==typeof r?r:4*this.i.length);if(e instanceof t)return this.i=e.words.slice(),void(this.u=e.nSigBytes);var n;try{e instanceof ArrayBuffer?n=new Uint8Array(e):(e instanceof Uint8Array||e instanceof Int8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}catch(t){throw new Error("Invalid argument")}if(!n)throw new Error("Invalid argument");for(var o=n.byteLength,i=[],a=0;a<o;a++)i[a>>>2]|=n[a]<<24-a%4*8;this.i=i,this.u=o}return Object.defineProperty(t.prototype,"nSigBytes",{get:function(){return this.u},set:function(t){this.u=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"words",{get:function(){return this.i},enumerable:!1,configurable:!0}),t.prototype.toString=function(t){return t?t.stringify(this):o(this)},t.prototype.toUint8Array=function(){for(var t=this.i,e=this.u,r=new Uint8Array(e),n=0;n<e;n++)r[n]=t[n>>>2]>>>24-n%4*8&255;return r},t.prototype.concat=function(t){var e=t.words.slice(),r=t.nSigBytes;if(this.clamp(),this.u%4)for(var n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;this.i[this.u+n>>>2]|=o<<24-(this.u+n)%4*8}else for(n=0;n<r;n+=4)this.i[this.u+n>>>2]=e[n>>>2];return this.u+=r,this},t.prototype.clamp=function(){var t=this.u;this.i[t>>>2]&=4294967295<<32-t%4*8,this.i.length=Math.ceil(t/4)},t.prototype.clone=function(){return new t(this.i.slice(),this.u)},t.random=function(e){for(var r=[],n=0;n<e;n+=4)r.push(s());return new t(r,e)},t}();return e}()},241:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isCons=e.isAtom=e.CLVMObject=void 0;const n=r(796),o=r(859),i=r(718);class a{get atom(){return this._atom}get pair(){return this._pair}constructor(t){this._atom=n.None,this._pair=n.None,t instanceof a||t&&("object"==typeof t||"function"==typeof t)&&"atom"in t&&"pair"in t?(this._atom=t.atom,this._pair=t.pair):(0,o.isTuple)(t)?(this._pair=t,this._atom=n.None):(this._atom=t,this._pair=n.None)}}e.CLVMObject=a,e.isAtom=function(t){if(t.atom&&t.pair||!t.atom&&!t.pair)throw new i.EvalError("Invalid clvm",t);return Boolean(t.atom&&!t.pair)},e.isCons=function(t){if(t.atom&&t.pair||!t.atom&&!t.pair)throw new i.EvalError("Invalid clvm",t);return Boolean(!t.atom&&t.pair)}},718:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EvalError=void 0;class r extends Error{constructor(t,e){super(t),this.name="EvalError",this._sexp=e}}e.EvalError=r},668:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SExp=e.to_sexp_type=e.convert_atom_to_bytes=e.looks_like_clvm_object=void 0;const n=r(796),o=r(241),i=r(859),a=r(750),s=r(256),u=r(388),f=r(718);function c(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&Boolean("atom"in t&&"pair"in t)}function l(t){if((0,i.isBytes)(t))return t;if("string"==typeof t)return i.Bytes.from(t,"utf8");if("number"==typeof t)return(0,a.int_to_bytes)(t,{signed:!0});if("boolean"==typeof t)return(0,a.int_to_bytes)(t?1:0,{signed:!0});if("bigint"==typeof t)return(0,a.bigint_to_bytes)(t,{signed:!0});if(t===n.None||!t)return i.Bytes.NULL;if((0,i.isIterable)(t)){if(t.length>0)throw new Error(`can't cast ${JSON.stringify(t)} to bytes`);return i.Bytes.NULL}if("function"==typeof t.serialize)return i.Bytes.from(t,"G1Element");if("function"==typeof t.toBytes)return t.toBytes();try{return i.Bytes.from(t)}catch(e){throw new Error(`can't cast ${JSON.stringify(t)} to bytes`)}}e.looks_like_clvm_object=c,e.convert_atom_to_bytes=l;function _(t){let e=t;const r=[e],a=[(0,i.t)(0,n.None)];for(;a.length;){const t=a.pop(),s=t[0];let u=t[1];if(0!==s){if(u===n.None)throw new Error("Invalid target. target is None");1===s?r[u]=new o.CLVMObject((0,i.t)(new o.CLVMObject(r.pop()),r[u].pair[1])):2===s?r[u]=new o.CLVMObject((0,i.t)(r[u].p