o1js
Version:
TypeScript framework for zk-SNARKs and zkApps
15 lines • 14.6 MB
JavaScript
var K2=Object.create;var gc=Object.defineProperty;var v2=Object.getOwnPropertyDescriptor;var q2=Object.getOwnPropertyNames;var S2=Object.getPrototypeOf,L2=Object.prototype.hasOwnProperty;var og=(g,A)=>()=>(A||g((A={exports:{}}).exports,A),A.exports),Dt=(g,A)=>{for(var _ in A)gc(g,_,{get:A[_],enumerable:!0})},J2=(g,A,_,t)=>{if(A&&typeof A=="object"||typeof A=="function")for(let a of q2(A))!L2.call(g,a)&&a!==_&&gc(g,a,{get:()=>A[a],enumerable:!(t=v2(A,a))||t.enumerable});return g};var gr=(g,A,_)=>(_=g!=null?K2(S2(g)):{},J2(A||!g||!g.__esModule?gc(_,"default",{value:g,enumerable:!0}):_,g));var An=og((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});var createOutputMethod=function(g,A){return function(_){return new Sha256(A,!0).update(_)[g]()}},createMethod=function(g){var A=createOutputMethod("hex",g);NODE_JS&&(A=nodeWrap(A,g)),A.create=function(){return new Sha256(g)},A.update=function(a){return A.create().update(a)};for(var _=0;_<OUTPUT_TYPES.length;++_){var t=OUTPUT_TYPES[_];A[t]=createOutputMethod(t,g)}return A},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(g){if(typeof g=="string")return crypto.createHash(algorithm).update(g,"utf8").digest("hex");if(g==null)throw new Error(ERROR);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(g)).digest("hex"):method(g)};return nodeMethod},createHmacOutputMethod=function(g,A){return function(_,t){return new HmacSha256(_,A,!0).update(t)[g]()}},createHmacMethod=function(g){var A=createHmacOutputMethod("hex",g);A.create=function(a){return new HmacSha256(a,g)},A.update=function(a,I){return A.create(a).update(I)};for(var _=0;_<OUTPUT_TYPES.length;++_){var t=OUTPUT_TYPES[_];A[t]=createHmacOutputMethod(t,g)}return A};function Sha256(g,A){A?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=g}Sha256.prototype.update=function(g){if(!this.finalized){var A,_=typeof g;if(_!=="string"){if(_==="object"){if(g===null)throw new Error(ERROR);if(ARRAY_BUFFER&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(g)))throw new Error(ERROR)}else throw new Error(ERROR);A=!0}for(var t,a=0,I,Q=g.length,B=this.blocks;a<Q;){if(this.hashed&&(this.hashed=!1,B[0]=this.block,B[16]=B[1]=B[2]=B[3]=B[4]=B[5]=B[6]=B[7]=B[8]=B[9]=B[10]=B[11]=B[12]=B[13]=B[14]=B[15]=0),A)for(I=this.start;a<Q&&I<64;++a)B[I>>2]|=g[a]<<SHIFT[I++&3];else for(I=this.start;a<Q&&I<64;++a)t=g.charCodeAt(a),t<128?B[I>>2]|=t<<SHIFT[I++&3]:t<2048?(B[I>>2]|=(192|t>>6)<<SHIFT[I++&3],B[I>>2]|=(128|t&63)<<SHIFT[I++&3]):t<55296||t>=57344?(B[I>>2]|=(224|t>>12)<<SHIFT[I++&3],B[I>>2]|=(128|t>>6&63)<<SHIFT[I++&3],B[I>>2]|=(128|t&63)<<SHIFT[I++&3]):(t=65536+((t&1023)<<10|g.charCodeAt(++a)&1023),B[I>>2]|=(240|t>>18)<<SHIFT[I++&3],B[I>>2]|=(128|t>>12&63)<<SHIFT[I++&3],B[I>>2]|=(128|t>>6&63)<<SHIFT[I++&3],B[I>>2]|=(128|t&63)<<SHIFT[I++&3]);this.lastByteIndex=I,this.bytes+=I-this.start,I>=64?(this.block=B[16],this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,A=this.lastByteIndex;g[16]=this.block,g[A>>2]|=EXTRA[A&3],this.block=g[16],A>=56&&(this.hashed||this.hash(),g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),g[14]=this.hBytes<<3|this.bytes>>>29,g[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var g=this.h0,A=this.h1,_=this.h2,t=this.h3,a=this.h4,I=this.h5,Q=this.h6,B=this.h7,i=this.blocks,C,c,l,u,D,o,m,y,k,F,n;for(C=16;C<64;++C)D=i[C-15],c=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3,D=i[C-2],l=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10,i[C]=i[C-16]+c+i[C-7]+l<<0;for(n=A&_,C=0;C<64;C+=4)this.first?(this.is224?(y=300032,D=i[0]-1413257819,B=D-150054599<<0,t=D+24177077<<0):(y=704751109,D=i[0]-210244248,B=D-1521486534<<0,t=D+143694565<<0),this.first=!1):(c=(g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),l=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),y=g&A,u=y^g&_^n,m=a&I^~a&Q,D=B+l+m+K[C]+i[C],o=c+u,B=t+D<<0,t=D+o<<0),c=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),l=(B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7),k=t&g,u=k^t&A^y,m=B&a^~B&I,D=Q+l+m+K[C+1]+i[C+1],o=c+u,Q=_+D<<0,_=D+o<<0,c=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),l=(Q>>>6|Q<<26)^(Q>>>11|Q<<21)^(Q>>>25|Q<<7),F=_&t,u=F^_&g^k,m=Q&B^~Q&a,D=I+l+m+K[C+2]+i[C+2],o=c+u,I=A+D<<0,A=D+o<<0,c=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),l=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),n=A&_,u=n^A&t^F,m=I&Q^~I&B,D=a+l+m+K[C+3]+i[C+3],o=c+u,a=g+D<<0,g=D+o<<0;this.h0=this.h0+g<<0,this.h1=this.h1+A<<0,this.h2=this.h2+_<<0,this.h3=this.h3+t<<0,this.h4=this.h4+a<<0,this.h5=this.h5+I<<0,this.h6=this.h6+Q<<0,this.h7=this.h7+B<<0},Sha256.prototype.hex=function(){this.finalize();var g=this.h0,A=this.h1,_=this.h2,t=this.h3,a=this.h4,I=this.h5,Q=this.h6,B=this.h7,i=HEX_CHARS[g>>28&15]+HEX_CHARS[g>>24&15]+HEX_CHARS[g>>20&15]+HEX_CHARS[g>>16&15]+HEX_CHARS[g>>12&15]+HEX_CHARS[g>>8&15]+HEX_CHARS[g>>4&15]+HEX_CHARS[g&15]+HEX_CHARS[A>>28&15]+HEX_CHARS[A>>24&15]+HEX_CHARS[A>>20&15]+HEX_CHARS[A>>16&15]+HEX_CHARS[A>>12&15]+HEX_CHARS[A>>8&15]+HEX_CHARS[A>>4&15]+HEX_CHARS[A&15]+HEX_CHARS[_>>28&15]+HEX_CHARS[_>>24&15]+HEX_CHARS[_>>20&15]+HEX_CHARS[_>>16&15]+HEX_CHARS[_>>12&15]+HEX_CHARS[_>>8&15]+HEX_CHARS[_>>4&15]+HEX_CHARS[_&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[I>>28&15]+HEX_CHARS[I>>24&15]+HEX_CHARS[I>>20&15]+HEX_CHARS[I>>16&15]+HEX_CHARS[I>>12&15]+HEX_CHARS[I>>8&15]+HEX_CHARS[I>>4&15]+HEX_CHARS[I&15]+HEX_CHARS[Q>>28&15]+HEX_CHARS[Q>>24&15]+HEX_CHARS[Q>>20&15]+HEX_CHARS[Q>>16&15]+HEX_CHARS[Q>>12&15]+HEX_CHARS[Q>>8&15]+HEX_CHARS[Q>>4&15]+HEX_CHARS[Q&15];return this.is224||(i+=HEX_CHARS[B>>28&15]+HEX_CHARS[B>>24&15]+HEX_CHARS[B>>20&15]+HEX_CHARS[B>>16&15]+HEX_CHARS[B>>12&15]+HEX_CHARS[B>>8&15]+HEX_CHARS[B>>4&15]+HEX_CHARS[B&15]),i},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var g=this.h0,A=this.h1,_=this.h2,t=this.h3,a=this.h4,I=this.h5,Q=this.h6,B=this.h7,i=[g>>24&255,g>>16&255,g>>8&255,g&255,A>>24&255,A>>16&255,A>>8&255,A&255,_>>24&255,_>>16&255,_>>8&255,_&255,t>>24&255,t>>16&255,t>>8&255,t&255,a>>24&255,a>>16&255,a>>8&255,a&255,I>>24&255,I>>16&255,I>>8&255,I&255,Q>>24&255,Q>>16&255,Q>>8&255,Q&255];return this.is224||i.push(B>>24&255,B>>16&255,B>>8&255,B&255),i},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var g=new ArrayBuffer(this.is224?28:32),A=new DataView(g);return A.setUint32(0,this.h0),A.setUint32(4,this.h1),A.setUint32(8,this.h2),A.setUint32(12,this.h3),A.setUint32(16,this.h4),A.setUint32(20,this.h5),A.setUint32(24,this.h6),this.is224||A.setUint32(28,this.h7),g};function HmacSha256(g,A,_){var t,a=typeof g;if(a==="string"){var I=[],Q=g.length,B=0,i;for(t=0;t<Q;++t)i=g.charCodeAt(t),i<128?I[B++]=i:i<2048?(I[B++]=192|i>>6,I[B++]=128|i&63):i<55296||i>=57344?(I[B++]=224|i>>12,I[B++]=128|i>>6&63,I[B++]=128|i&63):(i=65536+((i&1023)<<10|g.charCodeAt(++t)&1023),I[B++]=240|i>>18,I[B++]=128|i>>12&63,I[B++]=128|i>>6&63,I[B++]=128|i&63);g=I}else if(a==="object"){if(g===null)throw new Error(ERROR);if(ARRAY_BUFFER&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(g)))throw new Error(ERROR)}else throw new Error(ERROR);g.length>64&&(g=new Sha256(A,!0).update(g).array());var C=[],c=[];for(t=0;t<64;++t){var l=g[t]||0;C[t]=92^l,c[t]=54^l}Sha256.call(this,A,_),this.update(c),this.oKeyPad=C,this.inner=!0,this.sharedMemory=_}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var g=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(g),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var Gn=og((zK,ef)=>{var Fk="Input must be an string, Buffer or Uint8Array";function pk(g){let A;if(g instanceof Uint8Array)A=g;else if(typeof g=="string")A=new TextEncoder().encode(g);else throw new Error(Fk);return A}function dk(g){return Array.prototype.map.call(g,function(A){return(A<16?"0":"")+A.toString(16)}).join("")}function Ii(g){return(4294967296+g).toString(16).substring(1)}function kk(g,A,_){let t=`
`+g+" = ";for(let a=0;a<A.length;a+=2){if(_===32)t+=Ii(A[a]).toUpperCase(),t+=" ",t+=Ii(A[a+1]).toUpperCase();else if(_===64)t+=Ii(A[a+1]).toUpperCase(),t+=Ii(A[a]).toUpperCase();else throw new Error("Invalid size "+_);a%6===4?t+=`
`+new Array(g.length+4).join(" "):a<A.length-2&&(t+=" ")}console.log(t)}function hk(g,A,_){let t=new Date().getTime(),a=new Uint8Array(A);for(let Q=0;Q<A;Q++)a[Q]=Q%256;let I=new Date().getTime();console.log("Generated random input in "+(I-t)+"ms"),t=I;for(let Q=0;Q<_;Q++){let B=g(a),i=new Date().getTime(),C=i-t;t=i,console.log("Hashed in "+C+"ms: "+B.substring(0,20)+"..."),console.log(Math.round(A/(1<<20)/(C/1e3)*100)/100+" MB PER SECOND")}}ef.exports={normalizeInput:pk,toHex:dk,debugPrint:kk,testSpeed:hk}});var Ef=og((VK,of)=>{var Bi=Gn();function Qi(g,A,_){let t=g[A]+g[_],a=g[A+1]+g[_+1];t>=4294967296&&a++,g[A]=t,g[A+1]=a}function If(g,A,_,t){let a=g[A]+_;_<0&&(a+=4294967296);let I=g[A+1]+t;a>=4294967296&&I++,g[A]=a,g[A+1]=I}function Qf(g,A){return g[A]^g[A+1]<<8^g[A+2]<<16^g[A+3]<<24}function w0(g,A,_,t,a,I){let Q=OQ[a],B=OQ[a+1],i=OQ[I],C=OQ[I+1];Qi(qA,g,A),If(qA,g,Q,B);let c=qA[t]^qA[g],l=qA[t+1]^qA[g+1];qA[t]=l,qA[t+1]=c,Qi(qA,_,t),c=qA[A]^qA[_],l=qA[A+1]^qA[_+1],qA[A]=c>>>24^l<<8,qA[A+1]=l>>>24^c<<8,Qi(qA,g,A),If(qA,g,i,C),c=qA[t]^qA[g],l=qA[t+1]^qA[g+1],qA[t]=c>>>16^l<<16,qA[t+1]=l>>>16^c<<16,Qi(qA,_,t),c=qA[A]^qA[_],l=qA[A+1]^qA[_+1],qA[A]=l>>>31^c<<1,qA[A+1]=c>>>31^l<<1}var Bf=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Nk=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],Gg=new Uint8Array(Nk.map(function(g){return g*2})),qA=new Uint32Array(32),OQ=new Uint32Array(32);function rf(g,A){let _=0;for(_=0;_<16;_++)qA[_]=g.h[_],qA[_+16]=Bf[_];for(qA[24]=qA[24]^g.t,qA[25]=qA[25]^g.t/4294967296,A&&(qA[28]=~qA[28],qA[29]=~qA[29]),_=0;_<32;_++)OQ[_]=Qf(g.b,4*_);for(_=0;_<12;_++)w0(0,8,16,24,Gg[_*16+0],Gg[_*16+1]),w0(2,10,18,26,Gg[_*16+2],Gg[_*16+3]),w0(4,12,20,28,Gg[_*16+4],Gg[_*16+5]),w0(6,14,22,30,Gg[_*16+6],Gg[_*16+7]),w0(0,10,20,30,Gg[_*16+8],Gg[_*16+9]),w0(2,12,22,24,Gg[_*16+10],Gg[_*16+11]),w0(4,14,16,26,Gg[_*16+12],Gg[_*16+13]),w0(6,8,18,28,Gg[_*16+14],Gg[_*16+15]);for(_=0;_<16;_++)g.h[_]=g.h[_]^qA[_]^qA[_+16]}var y0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Cf(g,A,_,t){if(g===0||g>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(A&&A.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(_&&_.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(t&&t.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");let a={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:g};y0.fill(0),y0[0]=g,A&&(y0[1]=A.length),y0[2]=1,y0[3]=1,_&&y0.set(_,32),t&&y0.set(t,48);for(let I=0;I<16;I++)a.h[I]=Bf[I]^Qf(y0,I*4);return A&&(bn(a,A),a.c=128),a}function bn(g,A){for(let _=0;_<A.length;_++)g.c===128&&(g.t+=g.c,rf(g,!1),g.c=0),g.b[g.c++]=A[_]}function cf(g){for(g.t+=g.c;g.c<128;)g.b[g.c++]=0;rf(g,!0);let A=new Uint8Array(g.outlen);for(let _=0;_<g.outlen;_++)A[_]=g.h[_>>2]>>8*(_&3);return A}function nf(g,A,_,t,a){_=_||64,g=Bi.normalizeInput(g),t&&(t=Bi.normalizeInput(t)),a&&(a=Bi.normalizeInput(a));let I=Cf(_,A,t,a);return bn(I,g),cf(I)}function xk(g,A,_,t,a){let I=nf(g,A,_,t,a);return Bi.toHex(I)}of.exports={blake2b:nf,blake2bHex:xk,blake2bInit:Cf,blake2bUpdate:bn,blake2bFinal:cf}});var yf=og((TK,wf)=>{var sf=Gn();function Gk(g,A){return g[A]^g[A+1]<<8^g[A+2]<<16^g[A+3]<<24}function F0(g,A,_,t,a,I){B_[g]=B_[g]+B_[A]+a,B_[t]=ri(B_[t]^B_[g],16),B_[_]=B_[_]+B_[t],B_[A]=ri(B_[A]^B_[_],12),B_[g]=B_[g]+B_[A]+I,B_[t]=ri(B_[t]^B_[g],8),B_[_]=B_[_]+B_[t],B_[A]=ri(B_[A]^B_[_],7)}function ri(g,A){return g>>>A^g<<32-A}var lf=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bg=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),B_=new Uint32Array(16),fg=new Uint32Array(16);function uf(g,A){let _=0;for(_=0;_<8;_++)B_[_]=g.h[_],B_[_+8]=lf[_];for(B_[12]^=g.t,B_[13]^=g.t/4294967296,A&&(B_[14]=~B_[14]),_=0;_<16;_++)fg[_]=Gk(g.b,4*_);for(_=0;_<10;_++)F0(0,4,8,12,fg[bg[_*16+0]],fg[bg[_*16+1]]),F0(1,5,9,13,fg[bg[_*16+2]],fg[bg[_*16+3]]),F0(2,6,10,14,fg[bg[_*16+4]],fg[bg[_*16+5]]),F0(3,7,11,15,fg[bg[_*16+6]],fg[bg[_*16+7]]),F0(0,5,10,15,fg[bg[_*16+8]],fg[bg[_*16+9]]),F0(1,6,11,12,fg[bg[_*16+10]],fg[bg[_*16+11]]),F0(2,7,8,13,fg[bg[_*16+12]],fg[bg[_*16+13]]),F0(3,4,9,14,fg[bg[_*16+14]],fg[bg[_*16+15]]);for(_=0;_<8;_++)g.h[_]^=B_[_]^B_[_+8]}function ff(g,A){if(!(g>0&&g<=32))throw new Error("Incorrect output length, should be in [1, 32]");let _=A?A.length:0;if(A&&!(_>0&&_<=32))throw new Error("Incorrect key length, should be in [1, 32]");let t={h:new Uint32Array(lf),b:new Uint8Array(64),c:0,t:0,outlen:g};return t.h[0]^=16842752^_<<8^g,_>0&&(Mn(t,A),t.c=64),t}function Mn(g,A){for(let _=0;_<A.length;_++)g.c===64&&(g.t+=g.c,uf(g,!1),g.c=0),g.b[g.c++]=A[_]}function Df(g){for(g.t+=g.c;g.c<64;)g.b[g.c++]=0;uf(g,!0);let A=new Uint8Array(g.outlen);for(let _=0;_<g.outlen;_++)A[_]=g.h[_>>2]>>8*(_&3)&255;return A}function mf(g,A,_){_=_||32,g=sf.normalizeInput(g);let t=ff(_,A);return Mn(t,g),Df(t)}function bk(g,A,_){let t=mf(g,A,_);return sf.toHex(t)}wf.exports={blake2s:mf,blake2sHex:bk,blake2sInit:ff,blake2sUpdate:Mn,blake2sFinal:Df}});var pf=og((OK,Ff)=>{var ZQ=Ef(),WQ=yf();Ff.exports={blake2b:ZQ.blake2b,blake2bHex:ZQ.blake2bHex,blake2bInit:ZQ.blake2bInit,blake2bUpdate:ZQ.blake2bUpdate,blake2bFinal:ZQ.blake2bFinal,blake2s:WQ.blake2s,blake2sHex:WQ.blake2sHex,blake2sInit:WQ.blake2sInit,blake2sUpdate:WQ.blake2sUpdate,blake2sFinal:WQ.blake2sFinal}});var GC=og((JE,Lm)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],A):typeof JE=="object"?Lm.exports=A():g.StackFrame=A()})(JE,function(){"use strict";function g(D){return!isNaN(parseFloat(D))&&isFinite(D)}function A(D){return D.charAt(0).toUpperCase()+D.substring(1)}function _(D){return function(){return this[D]}}var t=["isConstructor","isEval","isNative","isToplevel"],a=["columnNumber","lineNumber"],I=["fileName","functionName","source"],Q=["args"],B=["evalOrigin"],i=t.concat(a,I,Q,B);function C(D){if(D)for(var o=0;o<i.length;o++)D[i[o]]!==void 0&&this["set"+A(i[o])](D[i[o]])}C.prototype={getArgs:function(){return this.args},setArgs:function(D){if(Object.prototype.toString.call(D)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=D},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(D){if(D instanceof C)this.evalOrigin=D;else if(D instanceof Object)this.evalOrigin=new C(D);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var D=this.getFileName()||"",o=this.getLineNumber()||"",m=this.getColumnNumber()||"",y=this.getFunctionName()||"";return this.getIsEval()?D?"[eval] ("+D+":"+o+":"+m+")":"[eval]:"+o+":"+m:y?y+" ("+D+":"+o+":"+m+")":D+":"+o+":"+m}},C.fromString=function(o){var m=o.indexOf("("),y=o.lastIndexOf(")"),k=o.substring(0,m),F=o.substring(m+1,y).split(","),n=o.substring(y+1);if(n.indexOf("@")===0)var d=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(n,""),p=d[1],U=d[2],M=d[3];return new C({functionName:k,args:F||void 0,fileName:p,lineNumber:U||void 0,columnNumber:M||void 0})};for(var c=0;c<t.length;c++)C.prototype["get"+A(t[c])]=_(t[c]),C.prototype["set"+A(t[c])]=function(D){return function(o){this[D]=!!o}}(t[c]);for(var l=0;l<a.length;l++)C.prototype["get"+A(a[l])]=_(a[l]),C.prototype["set"+A(a[l])]=function(D){return function(o){if(!g(o))throw new TypeError(D+" must be a Number");this[D]=Number(o)}}(a[l]);for(var u=0;u<I.length;u++)C.prototype["get"+A(I[u])]=_(I[u]),C.prototype["set"+A(I[u])]=function(D){return function(o){this[D]=String(o)}}(I[u]);return C})});var Ym=og((YE,Jm)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],A):typeof YE=="object"?Jm.exports=A(GC()):g.ErrorStackParser=A(g.StackFrame)})(YE,function(A){"use strict";var _=/(^|@)\S+:\d+/,t=/^\s*at .*(\S+:\d+|\(native\))/m,a=/^(eval@)?(\[native code])?$/;return{parse:function(Q){if(typeof Q.stacktrace<"u"||typeof Q["opera#sourceloc"]<"u")return this.parseOpera(Q);if(Q.stack&&Q.stack.match(t))return this.parseV8OrIE(Q);if(Q.stack)return this.parseFFOrSafari(Q);throw new Error("Cannot parse given Error object")},extractLocation:function(Q){if(Q.indexOf(":")===-1)return[Q];var B=/(.+?)(?::(\d+))?(?::(\d+))?$/,i=B.exec(Q.replace(/[()]/g,""));return[i[1],i[2]||void 0,i[3]||void 0]},parseV8OrIE:function(Q){var B=Q.stack.split(`
`).filter(function(i){return!!i.match(t)},this);return B.map(function(i){i.indexOf("(eval ")>-1&&(i=i.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var C=i.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),c=C.match(/ (\(.+\)$)/);C=c?C.replace(c[0],""):C;var l=this.extractLocation(c?c[1]:C),u=c&&C||void 0,D=["eval","<anonymous>"].indexOf(l[0])>-1?void 0:l[0];return new A({functionName:u,fileName:D,lineNumber:l[1],columnNumber:l[2],source:i})},this)},parseFFOrSafari:function(Q){var B=Q.stack.split(`
`).filter(function(i){return!i.match(a)},this);return B.map(function(i){if(i.indexOf(" > eval")>-1&&(i=i.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),i.indexOf("@")===-1&&i.indexOf(":")===-1)return new A({functionName:i});var C=/((.*".+"[^@]*)?[^@]*)(?:@)/,c=i.match(C),l=c&&c[1]?c[1]:void 0,u=this.extractLocation(i.replace(C,""));return new A({functionName:l,fileName:u[0],lineNumber:u[1],columnNumber:u[2],source:i})},this)},parseOpera:function(Q){return!Q.stacktrace||Q.message.indexOf(`
`)>-1&&Q.message.split(`
`).length>Q.stacktrace.split(`
`).length?this.parseOpera9(Q):Q.stack?this.parseOpera11(Q):this.parseOpera10(Q)},parseOpera9:function(Q){for(var B=/Line (\d+).*script (?:in )?(\S+)/i,i=Q.message.split(`
`),C=[],c=2,l=i.length;c<l;c+=2){var u=B.exec(i[c]);u&&C.push(new A({fileName:u[2],lineNumber:u[1],source:i[c]}))}return C},parseOpera10:function(Q){for(var B=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=Q.stacktrace.split(`
`),C=[],c=0,l=i.length;c<l;c+=2){var u=B.exec(i[c]);u&&C.push(new A({functionName:u[3]||void 0,fileName:u[2],lineNumber:u[1],source:i[c]}))}return C},parseOpera11:function(Q){var B=Q.stack.split(`
`).filter(function(i){return!!i.match(_)&&!i.match(/^Error created at/)},this);return B.map(function(i){var C=i.split("@"),c=this.extractLocation(C.pop()),l=C.shift()||"",u=l.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,D;l.match(/\(([^)]*)\)/)&&(D=l.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var o=D===void 0||D==="[arguments not available]"?void 0:D.split(",");return new A({functionName:u,args:o,fileName:c[0],lineNumber:c[1],columnNumber:c[2],source:i})},this)}}})});var jm=og((HE,Hm)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],A):typeof HE=="object"?Hm.exports=A(GC()):g.StackGenerator=A(g.StackFrame)})(HE,function(g){return{backtrace:function(_){var t=[],a=10;typeof _=="object"&&typeof _.maxStackSize=="number"&&(a=_.maxStackSize);for(var I=arguments.callee;I&&t.length<a&&I.arguments;){for(var Q=new Array(I.arguments.length),B=0;B<Q.length;++B)Q[B]=I.arguments[B];/function(?:\s+([\w$]+))+\s*\(/.test(I.toString())?t.push(new g({functionName:RegExp.$1||void 0,args:Q})):t.push(new g({args:Q}));try{I=I.caller}catch{break}}return t}}})});var jE=og(tt=>{function dx(g,A,_){if(A in g)return g[A];if(arguments.length===3)return _;throw new Error('"'+A+'" is a required argument.')}tt.getArg=dx;var zm=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,kx=/^data:.+\,.+$/;function bC(g){var A=g.match(zm);return A?{scheme:A[1],auth:A[2],host:A[3],port:A[4],path:A[5]}:null}tt.urlParse=bC;function UB(g){var A="";return g.scheme&&(A+=g.scheme+":"),A+="//",g.auth&&(A+=g.auth+"@"),g.host&&(A+=g.host),g.port&&(A+=":"+g.port),g.path&&(A+=g.path),A}tt.urlGenerate=UB;function Vm(g){var A=g,_=bC(g);if(_){if(!_.path)return g;A=_.path}for(var t=tt.isAbsolute(A),a=A.split(/\/+/),I,Q=0,B=a.length-1;B>=0;B--)I=a[B],I==="."?a.splice(B,1):I===".."?Q++:Q>0&&(I===""?(a.splice(B+1,Q),Q=0):(a.splice(B,2),Q--));return A=a.join("/"),A===""&&(A=t?"/":"."),_?(_.path=A,UB(_)):A}tt.normalize=Vm;function hx(g,A){g===""&&(g="."),A===""&&(A=".");var _=bC(A),t=bC(g);if(t&&(g=t.path||"/"),_&&!_.scheme)return t&&(_.scheme=t.scheme),UB(_);if(_||A.match(kx))return A;if(t&&!t.host&&!t.path)return t.host=A,UB(t);var a=A.charAt(0)==="/"?A:Vm(g.replace(/\/+$/,"")+"/"+A);return t?(t.path=a,UB(t)):a}tt.join=hx;tt.isAbsolute=function(g){return g.charAt(0)==="/"||!!g.match(zm)};function Nx(g,A){g===""&&(g="."),g=g.replace(/\/$/,"");for(var _=0;A.indexOf(g+"/")!==0;){var t=g.lastIndexOf("/");if(t<0||(g=g.slice(0,t),g.match(/^([^\/]+:\/)?\/*$/)))return A;++_}return Array(_+1).join("../")+A.substr(g.length+1)}tt.relative=Nx;var Tm=function(){var g=Object.create(null);return!("__proto__"in g)}();function Om(g){return g}function xx(g){return Zm(g)?"$"+g:g}tt.toSetString=Tm?Om:xx;function Gx(g){return Zm(g)?g.slice(1):g}tt.fromSetString=Tm?Om:Gx;function Zm(g){if(!g)return!1;var A=g.length;if(A<9||g.charCodeAt(A-1)!==95||g.charCodeAt(A-2)!==95||g.charCodeAt(A-3)!==111||g.charCodeAt(A-4)!==116||g.charCodeAt(A-5)!==111||g.charCodeAt(A-6)!==114||g.charCodeAt(A-7)!==112||g.charCodeAt(A-8)!==95||g.charCodeAt(A-9)!==95)return!1;for(var _=A-10;_>=0;_--)if(g.charCodeAt(_)!==36)return!1;return!0}function bx(g,A,_){var t=g.source-A.source;return t!==0||(t=g.originalLine-A.originalLine,t!==0)||(t=g.originalColumn-A.originalColumn,t!==0||_)||(t=g.generatedColumn-A.generatedColumn,t!==0)||(t=g.generatedLine-A.generatedLine,t!==0)?t:g.name-A.name}tt.compareByOriginalPositions=bx;function Mx(g,A,_){var t=g.generatedLine-A.generatedLine;return t!==0||(t=g.generatedColumn-A.generatedColumn,t!==0||_)||(t=g.source-A.source,t!==0)||(t=g.originalLine-A.originalLine,t!==0)||(t=g.originalColumn-A.originalColumn,t!==0)?t:g.name-A.name}tt.compareByGeneratedPositionsDeflated=Mx;function Pm(g,A){return g===A?0:g>A?1:-1}function Ux(g,A){var _=g.generatedLine-A.generatedLine;return _!==0||(_=g.generatedColumn-A.generatedColumn,_!==0)||(_=Pm(g.source,A.source),_!==0)||(_=g.originalLine-A.originalLine,_!==0)||(_=g.originalColumn-A.originalColumn,_!==0)?_:Pm(g.name,A.name)}tt.compareByGeneratedPositionsInflated=Ux});var Wm=og(qe=>{qe.GREATEST_LOWER_BOUND=1;qe.LEAST_UPPER_BOUND=2;function PE(g,A,_,t,a,I){var Q=Math.floor((A-g)/2)+g,B=a(_,t[Q],!0);return B===0?Q:B>0?A-Q>1?PE(Q,A,_,t,a,I):I==qe.LEAST_UPPER_BOUND?A<t.length?A:-1:Q:Q-g>1?PE(g,Q,_,t,a,I):I==qe.LEAST_UPPER_BOUND?Q:g<0?-1:g}qe.search=function(A,_,t,a){if(_.length===0)return-1;var I=PE(-1,_.length,A,_,t,a||qe.GREATEST_LOWER_BOUND);if(I<0)return-1;for(;I-1>=0&&t(_[I],_[I-1],!0)===0;)--I;return I}});var Aw=og(Xm=>{var zE=jE(),VE=Object.prototype.hasOwnProperty;function a0(){this._array=[],this._set=Object.create(null)}a0.fromArray=function(A,_){for(var t=new a0,a=0,I=A.length;a<I;a++)t.add(A[a],_);return t};a0.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length};a0.prototype.add=function(A,_){var t=zE.toSetString(A),a=VE.call(this._set,t),I=this._array.length;(!a||_)&&this._array.push(A),a||(this._set[t]=I)};a0.prototype.has=function(A){var _=zE.toSetString(A);return VE.call(this._set,_)};a0.prototype.indexOf=function(A){var _=zE.toSetString(A);if(VE.call(this._set,_))return this._set[_];throw new Error('"'+A+'" is not in the set.')};a0.prototype.at=function(A){if(A>=0&&A<this._array.length)return this._array[A];throw new Error("No element indexed by "+A)};a0.prototype.toArray=function(){return this._array.slice()};Xm.ArraySet=a0});var gw=og(TE=>{var _w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");TE.encode=function(g){if(0<=g&&g<_w.length)return _w[g];throw new TypeError("Must be between 0 and 63: "+g)};TE.decode=function(g){var A=65,_=90,t=97,a=122,I=48,Q=57,B=43,i=47,C=26,c=52;return A<=g&&g<=_?g-A:t<=g&&g<=a?g-t+C:I<=g&&g<=Q?g-I+c:g==B?62:g==i?63:-1}});var Qw=og(ZE=>{var tw=gw(),OE=5,aw=1<<OE,ew=aw-1,Iw=aw;function Rx(g){return g<0?(-g<<1)+1:(g<<1)+0}function $x(g){var A=(g&1)===1,_=g>>1;return A?-_:_}ZE.encode=function(A){var _="",t,a=Rx(A);do t=a&ew,a>>>=OE,a>0&&(t|=Iw),_+=tw.encode(t);while(a>0);return _};ZE.decode=function(A,_,t){var a=A.length,I=0,Q=0,B,i;do{if(_>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(i=tw.decode(A.charCodeAt(_++)),i===-1)throw new Error("Invalid base64 digit: "+A.charAt(_-1));B=!!(i&Iw),i&=ew,I=I+(i<<Q),Q+=OE}while(B);t.value=$x(I),t.rest=_}});var rw=og(Bw=>{function WE(g,A,_){var t=g[A];g[A]=g[_],g[_]=t}function Kx(g,A){return Math.round(g+Math.random()*(A-g))}function XE(g,A,_,t){if(_<t){var a=Kx(_,t),I=_-1;WE(g,a,t);for(var Q=g[t],B=_;B<t;B++)A(g[B],Q)<=0&&(I+=1,WE(g,I,B));WE(g,I+1,B);var i=I+1;XE(g,A,_,i-1),XE(g,A,i+1,t)}}Bw.quickSort=function(g,A){XE(g,A,0,g.length-1)}});var Cw=og(MC=>{var uA=jE(),As=Wm(),jI=Aw().ArraySet,vx=Qw(),RB=rw().quickSort;function G_(g){var A=g;return typeof g=="string"&&(A=JSON.parse(g.replace(/^\)\]\}'/,""))),A.sections!=null?new Tt(A):new Rg(A)}G_.fromSourceMap=function(g){return Rg.fromSourceMap(g)};G_.prototype._version=3;G_.prototype.__generatedMappings=null;Object.defineProperty(G_.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});G_.prototype.__originalMappings=null;Object.defineProperty(G_.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});G_.prototype._charIsMappingSeparator=function(A,_){var t=A.charAt(_);return t===";"||t===","};G_.prototype._parseMappings=function(A,_){throw new Error("Subclasses must implement _parseMappings")};G_.GENERATED_ORDER=1;G_.ORIGINAL_ORDER=2;G_.GREATEST_LOWER_BOUND=1;G_.LEAST_UPPER_BOUND=2;G_.prototype.eachMapping=function(A,_,t){var a=_||null,I=t||G_.GENERATED_ORDER,Q;switch(I){case G_.GENERATED_ORDER:Q=this._generatedMappings;break;case G_.ORIGINAL_ORDER:Q=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var B=this.sourceRoot;Q.map(function(i){var C=i.source===null?null:this._sources.at(i.source);return C!=null&&B!=null&&(C=uA.join(B,C)),{source:C,generatedLine:i.generatedLine,generatedColumn:i.generatedColumn,originalLine:i.originalLine,originalColumn:i.originalColumn,name:i.name===null?null:this._names.at(i.name)}},this).forEach(A,a)};G_.prototype.allGeneratedPositionsFor=function(A){var _=uA.getArg(A,"line"),t={source:uA.getArg(A,"source"),originalLine:_,originalColumn:uA.getArg(A,"column",0)};if(this.sourceRoot!=null&&(t.source=uA.relative(this.sourceRoot,t.source)),!this._sources.has(t.source))return[];t.source=this._sources.indexOf(t.source);var a=[],I=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",uA.compareByOriginalPositions,As.LEAST_UPPER_BOUND);if(I>=0){var Q=this._originalMappings[I];if(A.column===void 0)for(var B=Q.originalLine;Q&&Q.originalLine===B;)a.push({line:uA.getArg(Q,"generatedLine",null),column:uA.getArg(Q,"generatedColumn",null),lastColumn:uA.getArg(Q,"lastGeneratedColumn",null)}),Q=this._originalMappings[++I];else for(var i=Q.originalColumn;Q&&Q.originalLine===_&&Q.originalColumn==i;)a.push({line:uA.getArg(Q,"generatedLine",null),column:uA.getArg(Q,"generatedColumn",null),lastColumn:uA.getArg(Q,"lastGeneratedColumn",null)}),Q=this._originalMappings[++I]}return a};MC.SourceMapConsumer=G_;function Rg(g){var A=g;typeof g=="string"&&(A=JSON.parse(g.replace(/^\)\]\}'/,"")));var _=uA.getArg(A,"version"),t=uA.getArg(A,"sources"),a=uA.getArg(A,"names",[]),I=uA.getArg(A,"sourceRoot",null),Q=uA.getArg(A,"sourcesContent",null),B=uA.getArg(A,"mappings"),i=uA.getArg(A,"file",null);if(_!=this._version)throw new Error("Unsupported version: "+_);t=t.map(String).map(uA.normalize).map(function(C){return I&&uA.isAbsolute(I)&&uA.isAbsolute(C)?uA.relative(I,C):C}),this._names=jI.fromArray(a.map(String),!0),this._sources=jI.fromArray(t,!0),this.sourceRoot=I,this.sourcesContent=Q,this._mappings=B,this.file=i}Rg.prototype=Object.create(G_.prototype);Rg.prototype.consumer=G_;Rg.fromSourceMap=function(A){var _=Object.create(Rg.prototype),t=_._names=jI.fromArray(A._names.toArray(),!0),a=_._sources=jI.fromArray(A._sources.toArray(),!0);_.sourceRoot=A._sourceRoot,_.sourcesContent=A._generateSourcesContent(_._sources.toArray(),_.sourceRoot),_.file=A._file;for(var I=A._mappings.toArray().slice(),Q=_.__generatedMappings=[],B=_.__originalMappings=[],i=0,C=I.length;i<C;i++){var c=I[i],l=new iw;l.generatedLine=c.generatedLine,l.generatedColumn=c.generatedColumn,c.source&&(l.source=a.indexOf(c.source),l.originalLine=c.originalLine,l.originalColumn=c.originalColumn,c.name&&(l.name=t.indexOf(c.name)),B.push(l)),Q.push(l)}return RB(_.__originalMappings,uA.compareByOriginalPositions),_};Rg.prototype._version=3;Object.defineProperty(Rg.prototype,"sources",{get:function(){return this._sources.toArray().map(function(g){return this.sourceRoot!=null?uA.join(this.sourceRoot,g):g},this)}});function iw(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Rg.prototype._parseMappings=function(A,_){for(var t=1,a=0,I=0,Q=0,B=0,i=0,C=A.length,c=0,l={},u={},D=[],o=[],m,y,k,F,n;c<C;)if(A.charAt(c)===";")t++,c++,a=0;else if(A.charAt(c)===",")c++;else{for(m=new iw,m.generatedLine=t,F=c;F<C&&!this._charIsMappingSeparator(A,F);F++);if(y=A.slice(c,F),k=l[y],k)c+=y.length;else{for(k=[];c<F;)vx.decode(A,c,u),n=u.value,c=u.rest,k.push(n);if(k.length===2)throw new Error("Found a source, but no line and column");if(k.length===3)throw new Error("Found a source and line, but no column");l[y]=k}m.generatedColumn=a+k[0],a=m.generatedColumn,k.length>1&&(m.source=B+k[1],B+=k[1],m.originalLine=I+k[2],I=m.originalLine,m.originalLine+=1,m.originalColumn=Q+k[3],Q=m.originalColumn,k.length>4&&(m.name=i+k[4],i+=k[4])),o.push(m),typeof m.originalLine=="number"&&D.push(m)}RB(o,uA.compareByGeneratedPositionsDeflated),this.__generatedMappings=o,RB(D,uA.compareByOriginalPositions),this.__originalMappings=D};Rg.prototype._findMapping=function(A,_,t,a,I,Q){if(A[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+A[t]);if(A[a]<0)throw new TypeError("Column must be greater than or equal to 0, got "+A[a]);return As.search(A,_,I,Q)};Rg.prototype.computeColumnSpans=function(){for(var A=0;A<this._generatedMappings.length;++A){var _=this._generatedMappings[A];if(A+1<this._generatedMappings.length){var t=this._generatedMappings[A+1];if(_.generatedLine===t.generatedLine){_.lastGeneratedColumn=t.generatedColumn-1;continue}}_.lastGeneratedColumn=1/0}};Rg.prototype.originalPositionFor=function(A){var _={generatedLine:uA.getArg(A,"line"),generatedColumn:uA.getArg(A,"column")},t=this._findMapping(_,this._generatedMappings,"generatedLine","generatedColumn",uA.compareByGeneratedPositionsDeflated,uA.getArg(A,"bias",G_.GREATEST_LOWER_BOUND));if(t>=0){var a=this._generatedMappings[t];if(a.generatedLine===_.generatedLine){var I=uA.getArg(a,"source",null);I!==null&&(I=this._sources.at(I),this.sourceRoot!=null&&(I=uA.join(this.sourceRoot,I)));var Q=uA.getArg(a,"name",null);return Q!==null&&(Q=this._names.at(Q)),{source:I,line:uA.getArg(a,"originalLine",null),column:uA.getArg(a,"originalColumn",null),name:Q}}}return{source:null,line:null,column:null,name:null}};Rg.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(A){return A==null}):!1};Rg.prototype.sourceContentFor=function(A,_){if(!this.sourcesContent)return null;if(this.sourceRoot!=null&&(A=uA.relative(this.sourceRoot,A)),this._sources.has(A))return this.sourcesContent[this._sources.indexOf(A)];var t;if(this.sourceRoot!=null&&(t=uA.urlParse(this.sourceRoot))){var a=A.replace(/^file:\/\//,"");if(t.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!t.path||t.path=="/")&&this._sources.has("/"+A))return this.sourcesContent[this._sources.indexOf("/"+A)]}if(_)return null;throw new Error('"'+A+'" is not in the SourceMap.')};Rg.prototype.generatedPositionFor=function(A){var _=uA.getArg(A,"source");if(this.sourceRoot!=null&&(_=uA.relative(this.sourceRoot,_)),!this._sources.has(_))return{line:null,column:null,lastColumn:null};_=this._sources.indexOf(_);var t={source:_,originalLine:uA.getArg(A,"line"),originalColumn:uA.getArg(A,"column")},a=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",uA.compareByOriginalPositions,uA.getArg(A,"bias",G_.GREATEST_LOWER_BOUND));if(a>=0){var I=this._originalMappings[a];if(I.source===t.source)return{line:uA.getArg(I,"generatedLine",null),column:uA.getArg(I,"generatedColumn",null),lastColumn:uA.getArg(I,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};MC.BasicSourceMapConsumer=Rg;function Tt(g){var A=g;typeof g=="string"&&(A=JSON.parse(g.replace(/^\)\]\}'/,"")));var _=uA.getArg(A,"version"),t=uA.getArg(A,"sections");if(_!=this._version)throw new Error("Unsupported version: "+_);this._sources=new jI,this._names=new jI;var a={line:-1,column:0};this._sections=t.map(function(I){if(I.url)throw new Error("Support for url field in sections not implemented.");var Q=uA.getArg(I,"offset"),B=uA.getArg(Q,"line"),i=uA.getArg(Q,"column");if(B<a.line||B===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=Q,{generatedOffset:{generatedLine:B+1,generatedColumn:i+1},consumer:new G_(uA.getArg(I,"map"))}})}Tt.prototype=Object.create(G_.prototype);Tt.prototype.constructor=G_;Tt.prototype._version=3;Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var g=[],A=0;A<this._sections.length;A++)for(var _=0;_<this._sections[A].consumer.sources.length;_++)g.push(this._sections[A].consumer.sources[_]);return g}});Tt.prototype.originalPositionFor=function(A){var _={generatedLine:uA.getArg(A,"line"),generatedColumn:uA.getArg(A,"column")},t=As.search(_,this._sections,function(I,Q){var B=I.generatedLine-Q.generatedOffset.generatedLine;return B||I.generatedColumn-Q.generatedOffset.generatedColumn}),a=this._sections[t];return a?a.consumer.originalPositionFor({line:_.generatedLine-(a.generatedOffset.generatedLine-1),column:_.generatedColumn-(a.generatedOffset.generatedLine===_.generatedLine?a.generatedOffset.generatedColumn-1:0),bias:A.bias}):{source:null,line:null,column:null,name:null}};Tt.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(A){return A.consumer.hasContentsOfAllSources()})};Tt.prototype.sourceContentFor=function(A,_){for(var t=0;t<this._sections.length;t++){var a=this._sections[t],I=a.consumer.sourceContentFor(A,!0);if(I)return I}if(_)return null;throw new Error('"'+A+'" is not in the SourceMap.')};Tt.prototype.generatedPositionFor=function(A){for(var _=0;_<this._sections.length;_++){var t=this._sections[_];if(t.consumer.sources.indexOf(uA.getArg(A,"source"))!==-1){var a=t.consumer.generatedPositionFor(A);if(a){var I={line:a.line+(t.generatedOffset.generatedLine-1),column:a.column+(t.generatedOffset.generatedLine===a.line?t.generatedOffset.generatedColumn-1:0)};return I}}}return{line:null,column:null}};Tt.prototype._parseMappings=function(A,_){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var a=this._sections[t],I=a.consumer._generatedMappings,Q=0;Q<I.length;Q++){var B=I[Q],i=a.consumer._sources.at(B.source);a.consumer.sourceRoot!==null&&(i=uA.join(a.consumer.sourceRoot,i)),this._sources.add(i),i=this._sources.indexOf(i);var C=a.consumer._names.at(B.name);this._names.add(C),C=this._names.indexOf(C);var c={source:i,generatedLine:B.generatedLine+(a.generatedOffset.generatedLine-1),generatedColumn:B.generatedColumn+(a.generatedOffset.generatedLine===B.generatedLine?a.generatedOffset.generatedColumn-1:0),originalLine:B.originalLine,originalColumn:B.originalColumn,name:C};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}RB(this.__generatedMappings,uA.compareByGeneratedPositionsDeflated),RB(this.__originalMappings,uA.compareByOriginalPositions)};MC.IndexedSourceMapConsumer=Tt});var nw=og((_s,cw)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stacktrace-gps",["source-map","stackframe"],A):typeof _s=="object"?cw.exports=A(Cw(),GC()):g.StackTraceGPS=A(g.SourceMap||g.sourceMap,g.StackFrame)})(_s,function(g,A){"use strict";function _(c){return new Promise(function(l,u){var D=new XMLHttpRequest;D.open("get",c),D.onerror=u,D.onreadystatechange=function(){D.readyState===4&&(D.status>=200&&D.status<300||c.substr(0,7)==="file://"&&D.responseText?l(D.responseText):u(new Error("HTTP status: "+D.status+" retrieving "+c)))},D.send()})}function t(c){if(typeof window<"u"&&window.atob)return window.atob(c);throw new Error("You must supply a polyfill for window.atob in this environment")}function a(c){if(typeof JSON<"u"&&JSON.parse)return JSON.parse(c);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function I(c,l){for(var u=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],D=c.split(`
`),o="",m=Math.min(l,20),y=0;y<m;++y){var k=D[l-y-1],F=k.indexOf("//");if(F>=0&&(k=k.substr(0,F)),k){o=k+o;for(var n=u.length,d=0;d<n;d++){var p=u[d].exec(o);if(p&&p[1])return p[1]}}}}function Q(){if(typeof Object.defineProperty!="function"||typeof Object.create!="function")throw new Error("Unable to consume source maps in older browsers")}function B(c){if(typeof c!="object")throw new TypeError("Given StackFrame is not an object");if(typeof c.fileName!="string")throw new TypeError("Given file name is not a String");if(typeof c.lineNumber!="number"||c.lineNumber%1!==0||c.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if(typeof c.columnNumber!="number"||c.columnNumber%1!==0||c.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function i(c){for(var l=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg,u,D;D=l.exec(c);)u=D[1];if(u)return u;throw new Error("sourceMappingURL not found")}function C(c,l,u){return new Promise(function(D,o){var m=l.originalPositionFor({line:c.lineNumber,column:c.columnNumber});if(m.source){var y=l.sourceContentFor(m.source);y&&(u[m.source]=y),D(new A({functionName:m.name||c.functionName,args:c.args,fileName:m.source,lineNumber:m.line,columnNumber:m.column}))}else o(new Error("Could not get original source for given stackframe and source map"))})}return function c(l){if(!(this instanceof c))return new c(l);l=l||{},this.sourceCache=l.sourceCache||{},this.sourceMapConsumerCache=l.sourceMapConsumerCache||{},this.ajax=l.ajax||_,this._atob=l.atob||t,this._get=function(D){return new Promise(function(o,m){var y=D.substr(0,5)==="data:";if(this.sourceCache[D])o(this.sourceCache[D]);else if(l.offline&&!y)m(new Error("Cannot make network requests in offline mode"));else if(y){var k=/^data:application\/json;([\w=:"-]+;)*base64,/,F=D.match(k);if(F){var n=F[0].length,d=D.substr(n),p=this._atob(d);this.sourceCache[D]=p,o(p)}else m(new Error("The encoding of the inline sourcemap is not supported"))}else{var U=this.ajax(D,{method:"get"});this.sourceCache[D]=U,U.then(o,m)}}.bind(this))},this._getSourceMapConsumer=function(D,o){return new Promise(function(m){if(this.sourceMapConsumerCache[D])m(this.sourceMapConsumerCache[D]);else{var y=new Promise(function(k,F){return this._get(D).then(function(n){typeof n=="string"&&(n=a(n.replace(/^\)\]\}'/,""))),typeof n.sourceRoot>"u"&&(n.sourceRoot=o),k(new g.SourceMapConsumer(n))}).catch(F)}.bind(this));this.sourceMapConsumerCache[D]=y,m(y)}}.bind(this))},this.pinpoint=function(D){return new Promise(function(o,m){this.getMappedLocation(D).then(function(y){function k(){o(y)}this.findFunctionName(y).then(o,k).catch(k)}.bind(this),m)}.bind(this))},this.findFunctionName=function(D){return new Promise(function(o,m){B(D),this._get(D.fileName).then(function(k){var F=D.lineNumber,n=D.columnNumber,d=I(k,F,n);o(d?new A({functionName:d,args:D.args,fileName:D.fileName,lineNumber:F,columnNumber:n}):D)},m).catch(m)}.bind(this))},this.getMappedLocation=function(D){return new Promise(function(o,m){Q(),B(D);var y=this.sourceCache,k=D.fileName;this._get(k).then(function(F){var n=i(F),d=n.substr(0,5)==="data:",p=k.substring(0,k.lastIndexOf("/")+1);return n[0]!=="/"&&!d&&!/^https?:\/\/|^\/\//i.test(n)&&(n=p+n),this._getSourceMapConsumer(n,p).then(function(U){return C(D,U,y).then(o).catch(function(){o(D)})})}.bind(this),m).catch(m)}.bind(this))}}})});var Ew=og((gs,ow)=>{(function(g,A){"use strict";typeof define=="function"&&define.amd?define("stacktrace",["error-stack-parser","stack-generator","stacktrace-gps"],A):typeof gs=="object"?ow.exports=A(Ym(),jm(),nw()):g.StackTrace=A(g.ErrorStackParser,g.StackGenerator,g.StackTraceGPS)})(gs,function(A,_,t){var a={filter:function(C){return(C.functionName||"").indexOf("StackTrace$$")===-1&&(C.functionName||"").indexOf("ErrorStackParser$$")===-1&&(C.functionName||"").indexOf("StackTraceGPS$$")===-1&&(C.functionName||"").indexOf("StackGenerator$$")===-1},sourceCache:{}},I=function(){try{throw new Error}catch(c){return c}};function Q(C,c){var l={};return[C,c].forEach(function(u){for(var D in u)Object.prototype.hasOwnProperty.call(u,D)&&(l[D]=u[D]);return l}),l}function B(C){return C.stack||C["opera#sourceloc"]}function i(C,c){return typeof c=="function"?C.filter(c):C}return{get:function(c){var l=I();return B(l)?this.fromError(l,c):this.generateArtificially(c)},getSync:function(c){c=Q(a,c);var l=I(),u=B(l)?A.parse(l):_.backtrace(c);return i(u,c.filter)},fromError:function(c,l){l=Q(a,l);var u=new t(l);return new Promise(function(D){var o=i(A.parse(c),l.filter);D(Promise.all(o.map(function(m){return new Promise(function(y){function k(){y(m)}u.pinpoint(m).then(y,k).catch(k)})})))}.bind(this))},generateArtificially:function(c){c=Q(a,c);var l=_.backtrace(c);return typeof c.filter=="function"&&(l=l.filter(c.filter)),Promise.resolve(l)},instrument:function(c,l,u,D){if(typeof c!="function")throw new Error("Cannot instrument non-function object");if(typeof c.__stacktraceOriginalFn=="function")return c;var o=function(){try{return this.get().then(l,u).catch(u),c.apply(D||this,arguments)}catch(y){throw B(y)&&this.fromError(y).then(l,u).catch(u),y}}.bind(this);return o.__stacktraceOriginalFn=c,o},deinstrument:function(c){if(typeof c!="function")throw new Error("Cannot de-instrument non-function object");return typeof c.__stacktraceOriginalFn=="function"?c.__stacktraceOriginalFn:c},report:function(c,l,u,D){return new Promise(function(o,m){var y=new XMLHttpRequest;if(y.onerror=m,y.onreadystatechange=function(){y.readyState===4&&(y.status>=200&&y.status<400?o(y.responseText):m(new Error("POST to "+l+" failed with status: "+y.status)))},y.open("post",l),y.setRequestHeader("Content-Type","application/json"),D&&typeof D.headers=="object"){var k=D.headers;for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&y.setRequestHeader(F,k[F])}var n={stack:c};u!=null&&(n.message=u),y.send(JSON.stringify(n))})}}})});var Y2=["o1js_node.bc.cjs","/builtin/","CatchAndPrettifyStacktrace"];function Wt(g){if(g=H2(g),!(g instanceof Error)||!g.stack)return g;let _=g.stack.split(`
`),t=[];for(let a=0;a<_.length;a++){if(Y2.some(B=>_[a].includes(B)))continue;let Q=j2(_[a]);t.push(Q)}return g.stack=t.join(`
`),g}async function Na(g){try{return await g}catch(A){throw Wt(A)}}function H2(g){return g instanceof Error?g:Array.isArray(g)&&g[2]instanceof Error?g[2]:g}function j2(g){return g.includes("o1js")?P2(g):g.includes("opam")?z2(g):g.includes("workspace_root")?V2(g):g}function P2(g){let A=tc(g);if(!A)return g;let _=A.indexOf("o1js");if(_===-1)return g;let t=g.slice(0,g.indexOf("(")+1),a=A.slice(_);return`${t}${a})`}function z2(g){let A=tc(g);if(!A)return g;let _=A.indexOf("opam");if(_===-1)return g;let t=A.slice(_).split("/"),a=t.lastIndexOf("lib");if(a===-1)return g;let I=g.slice(0,g.indexOf("(")+1),Q=t.slice(a+1);return Q.unshift("ocaml"),`${I}${Q.join("/")})`}function V2(g){let A=tc(g);if(!A)return g;let _=A.indexOf("workspace_root");if(_===-1)return g;let t=A.slice(_).split("/"),a=g.slice(0,g.indexOf("(")+1),I=t.slice(_);return`${a}${I.join("/")})`}function tc(g){let A=/\(([^)]+)\)/,_=g.match(A);if(_)return _[1]}function T2(g){return Error(`${g}
This shouldn't have happened and indicates an internal bug.`)}function lA(g,A="Failed assertion."){if(!g)throw T2(A)}var xa={map(g,A){return g.map(A)}},b_={map(g,A){return g.map(A)},fromArray(g,A){return lA(A.length===g,`Expected array of length ${g}, got ${A.length}`),A},hasLength(g,A){return A.length===g}};var kA={event:"MinaZkappEvent******",events:"MinaZkappEvents*****",sequenceEvents:"MinaZkappSeqEvents**",zkappBodyMainnet:"MainnetZkappBody****",zkappBodyTestnet:"TestnetZkappBody****",accountUpdateCons:"MinaAcctUpdateCons**",accountUpdateNode:"MinaAcctUpdateNode**",zkappMemo:"MinaZkappMemo*******",signatureMainnet:"MinaSignatureMainnet",signatureTestnet:"CodaSignature*******",zkappUri:"MinaZkappUri********",deriveTokenId:"MinaDeriveTokenId***",sideLoadedVK:"MinaSideLoadedVk****"},os={"CodaReceiptUC*******":["29302923594948293002713688606335806348158191518870781605