@substrate-system/keys 0.2.28 → 0.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_base.min.js +1 -1
- package/dist/_base.min.js.map +3 -3
- package/dist/aes/index.min.js +1 -1
- package/dist/aes/index.min.js.map +3 -3
- package/dist/browser/index.js +18 -14
- package/dist/browser/index.min.js +2 -2
- package/dist/crypto.cjs +10 -6
- package/dist/crypto.cjs.map +2 -2
- package/dist/crypto.d.ts +2 -2
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +10 -6
- package/dist/crypto.js.map +2 -2
- package/dist/crypto.min.cjs +1 -1
- package/dist/crypto.min.cjs.map +3 -3
- package/dist/crypto.min.js +2 -2
- package/dist/crypto.min.js.map +3 -3
- package/dist/ecc/index.min.js +1 -1
- package/dist/ecc/index.min.js.map +3 -3
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +3 -3
- package/dist/meta.json +11 -11
- package/dist/rsa/index.cjs +2 -2
- package/dist/rsa/index.cjs.map +2 -2
- package/dist/rsa/index.d.ts.map +1 -1
- package/dist/rsa/index.js +3 -3
- package/dist/rsa/index.js.map +2 -2
- package/dist/rsa/index.min.cjs +1 -1
- package/dist/rsa/index.min.cjs.map +2 -2
- package/dist/rsa/index.min.js +2 -2
- package/dist/rsa/index.min.js.map +3 -3
- package/dist/util.cjs.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js.map +1 -1
- package/dist/util.min.cjs.map +1 -1
- package/dist/util.min.js.map +1 -1
- package/package.json +1 -1
package/dist/crypto.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Df=Object.create;var oe=Object.defineProperty;var If=Object.getOwnPropertyDescriptor;var Lf=Object.getOwnPropertyNames;var Pf=Object.getPrototypeOf,Rf=Object.prototype.hasOwnProperty;var Kf=(i,n,a)=>n in i?oe(i,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[n]=a;var c=(i,n)=>oe(i,"name",{value:n,configurable:!0}),Ft=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(n,a)=>(typeof require<"u"?require:n)[a]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Gt=(i,n)=>()=>(n||i((n={exports:{}}).exports,n),n.exports),_r=(i,n)=>{for(var a in n)oe(i,a,{get:n[a],enumerable:!0})},zf=(i,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let d of Lf(n))!Rf.call(i,d)&&d!==a&&oe(i,d,{get:()=>n[d],enumerable:!(u=If(n,d))||u.enumerable});return i};var Nf=(i,n,a)=>(a=i!=null?Df(Pf(i)):{},zf(n||!i||!i.__esModule?oe(a,"default",{value:i,enumerable:!0}):a,i));var Q=(i,n,a)=>Kf(i,typeof n!="symbol"?n+"":n,a);var yf=Gt(()=>{"use strict"});var df=Gt((Q0,Be)=>{"use strict";(function(i){"use strict";var n=c(function(e){var f,t=new Float64Array(16);if(e)for(f=0;f<e.length;f++)t[f]=e[f];return t},"gf"),a=c(function(){throw new Error("no PRNG")},"randombytes"),u=new Uint8Array(16),d=new Uint8Array(32);d[0]=9;var v=n(),V=n([1]),er=n([56129,1]),cr=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Rr=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),br=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Dr=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Hr=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function pe(e,f,t,r){e[f]=t>>24&255,e[f+1]=t>>16&255,e[f+2]=t>>8&255,e[f+3]=t&255,e[f+4]=r>>24&255,e[f+5]=r>>16&255,e[f+6]=r>>8&255,e[f+7]=r&255}c(pe,"ts64");function k(e,f,t,r,o){var x,h=0;for(x=0;x<o;x++)h|=e[f+x]^t[r+x];return(1&h-1>>>8)-1}c(k,"vn");function hr(e,f,t,r){return k(e,f,t,r,16)}c(hr,"crypto_verify_16");function Ur(e,f,t,r){return k(e,f,t,r,32)}c(Ur,"crypto_verify_32");function wr(e,f,t,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,_=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,Z=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,L=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,P=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,O=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,N=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,R=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,z=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,K=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=o,D=x,U=h,T=l,C=m,E=M,p=_,y=Z,w=S,b=L,g=P,A=O,I=N,Y=R,H=z,j=K,s,G=0;G<20;G+=2)s=B+I|0,C^=s<<7|s>>>25,s=C+B|0,w^=s<<9|s>>>23,s=w+C|0,I^=s<<13|s>>>19,s=I+w|0,B^=s<<18|s>>>14,s=E+D|0,b^=s<<7|s>>>25,s=b+E|0,Y^=s<<9|s>>>23,s=Y+b|0,D^=s<<13|s>>>19,s=D+Y|0,E^=s<<18|s>>>14,s=g+p|0,H^=s<<7|s>>>25,s=H+g|0,U^=s<<9|s>>>23,s=U+H|0,p^=s<<13|s>>>19,s=p+U|0,g^=s<<18|s>>>14,s=j+A|0,T^=s<<7|s>>>25,s=T+j|0,y^=s<<9|s>>>23,s=y+T|0,A^=s<<13|s>>>19,s=A+y|0,j^=s<<18|s>>>14,s=B+T|0,D^=s<<7|s>>>25,s=D+B|0,U^=s<<9|s>>>23,s=U+D|0,T^=s<<13|s>>>19,s=T+U|0,B^=s<<18|s>>>14,s=E+C|0,p^=s<<7|s>>>25,s=p+E|0,y^=s<<9|s>>>23,s=y+p|0,C^=s<<13|s>>>19,s=C+y|0,E^=s<<18|s>>>14,s=g+b|0,A^=s<<7|s>>>25,s=A+g|0,w^=s<<9|s>>>23,s=w+A|0,b^=s<<13|s>>>19,s=b+w|0,g^=s<<18|s>>>14,s=j+H|0,I^=s<<7|s>>>25,s=I+j|0,Y^=s<<9|s>>>23,s=Y+I|0,H^=s<<13|s>>>19,s=H+Y|0,j^=s<<18|s>>>14;B=B+o|0,D=D+x|0,U=U+h|0,T=T+l|0,C=C+m|0,E=E+M|0,p=p+_|0,y=y+Z|0,w=w+S|0,b=b+L|0,g=g+P|0,A=A+O|0,I=I+N|0,Y=Y+R|0,H=H+z|0,j=j+K|0,e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=D>>>0&255,e[5]=D>>>8&255,e[6]=D>>>16&255,e[7]=D>>>24&255,e[8]=U>>>0&255,e[9]=U>>>8&255,e[10]=U>>>16&255,e[11]=U>>>24&255,e[12]=T>>>0&255,e[13]=T>>>8&255,e[14]=T>>>16&255,e[15]=T>>>24&255,e[16]=C>>>0&255,e[17]=C>>>8&255,e[18]=C>>>16&255,e[19]=C>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=y>>>0&255,e[29]=y>>>8&255,e[30]=y>>>16&255,e[31]=y>>>24&255,e[32]=w>>>0&255,e[33]=w>>>8&255,e[34]=w>>>16&255,e[35]=w>>>24&255,e[36]=b>>>0&255,e[37]=b>>>8&255,e[38]=b>>>16&255,e[39]=b>>>24&255,e[40]=g>>>0&255,e[41]=g>>>8&255,e[42]=g>>>16&255,e[43]=g>>>24&255,e[44]=A>>>0&255,e[45]=A>>>8&255,e[46]=A>>>16&255,e[47]=A>>>24&255,e[48]=I>>>0&255,e[49]=I>>>8&255,e[50]=I>>>16&255,e[51]=I>>>24&255,e[52]=Y>>>0&255,e[53]=Y>>>8&255,e[54]=Y>>>16&255,e[55]=Y>>>24&255,e[56]=H>>>0&255,e[57]=H>>>8&255,e[58]=H>>>16&255,e[59]=H>>>24&255,e[60]=j>>>0&255,e[61]=j>>>8&255,e[62]=j>>>16&255,e[63]=j>>>24&255}c(wr,"core_salsa20");function mr(e,f,t,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,_=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,Z=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,L=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,P=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,O=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,N=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,R=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,z=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,K=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=o,D=x,U=h,T=l,C=m,E=M,p=_,y=Z,w=S,b=L,g=P,A=O,I=N,Y=R,H=z,j=K,s,G=0;G<20;G+=2)s=B+I|0,C^=s<<7|s>>>25,s=C+B|0,w^=s<<9|s>>>23,s=w+C|0,I^=s<<13|s>>>19,s=I+w|0,B^=s<<18|s>>>14,s=E+D|0,b^=s<<7|s>>>25,s=b+E|0,Y^=s<<9|s>>>23,s=Y+b|0,D^=s<<13|s>>>19,s=D+Y|0,E^=s<<18|s>>>14,s=g+p|0,H^=s<<7|s>>>25,s=H+g|0,U^=s<<9|s>>>23,s=U+H|0,p^=s<<13|s>>>19,s=p+U|0,g^=s<<18|s>>>14,s=j+A|0,T^=s<<7|s>>>25,s=T+j|0,y^=s<<9|s>>>23,s=y+T|0,A^=s<<13|s>>>19,s=A+y|0,j^=s<<18|s>>>14,s=B+T|0,D^=s<<7|s>>>25,s=D+B|0,U^=s<<9|s>>>23,s=U+D|0,T^=s<<13|s>>>19,s=T+U|0,B^=s<<18|s>>>14,s=E+C|0,p^=s<<7|s>>>25,s=p+E|0,y^=s<<9|s>>>23,s=y+p|0,C^=s<<13|s>>>19,s=C+y|0,E^=s<<18|s>>>14,s=g+b|0,A^=s<<7|s>>>25,s=A+g|0,w^=s<<9|s>>>23,s=w+A|0,b^=s<<13|s>>>19,s=b+w|0,g^=s<<18|s>>>14,s=j+H|0,I^=s<<7|s>>>25,s=I+j|0,Y^=s<<9|s>>>23,s=Y+I|0,H^=s<<13|s>>>19,s=H+Y|0,j^=s<<18|s>>>14;e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=j>>>0&255,e[13]=j>>>8&255,e[14]=j>>>16&255,e[15]=j>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=y>>>0&255,e[21]=y>>>8&255,e[22]=y>>>16&255,e[23]=y>>>24&255,e[24]=w>>>0&255,e[25]=w>>>8&255,e[26]=w>>>16&255,e[27]=w>>>24&255,e[28]=b>>>0&255,e[29]=b>>>8&255,e[30]=b>>>16&255,e[31]=b>>>24&255}c(mr,"core_hsalsa20");function lr(e,f,t,r){wr(e,f,t,r)}c(lr,"crypto_core_salsa20");function ur(e,f,t,r){mr(e,f,t,r)}c(ur,"crypto_core_hsalsa20");var sr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Sr(e,f,t,r,o,x,h){var l=new Uint8Array(16),m=new Uint8Array(64),M,_;for(_=0;_<16;_++)l[_]=0;for(_=0;_<8;_++)l[_]=x[_];for(;o>=64;){for(lr(m,l,h,sr),_=0;_<64;_++)e[f+_]=t[r+_]^m[_];for(M=1,_=8;_<16;_++)M=M+(l[_]&255)|0,l[_]=M&255,M>>>=8;o-=64,f+=64,r+=64}if(o>0)for(lr(m,l,h,sr),_=0;_<o;_++)e[f+_]=t[r+_]^m[_];return 0}c(Sr,"crypto_stream_salsa20_xor");function gr(e,f,t,r,o){var x=new Uint8Array(16),h=new Uint8Array(64),l,m;for(m=0;m<16;m++)x[m]=0;for(m=0;m<8;m++)x[m]=r[m];for(;t>=64;){for(lr(h,x,o,sr),m=0;m<64;m++)e[f+m]=h[m];for(l=1,m=8;m<16;m++)l=l+(x[m]&255)|0,x[m]=l&255,l>>>=8;t-=64,f+=64}if(t>0)for(lr(h,x,o,sr),m=0;m<t;m++)e[f+m]=h[m];return 0}c(gr,"crypto_stream_salsa20");function vr(e,f,t,r,o){var x=new Uint8Array(32);ur(x,r,o,sr);for(var h=new Uint8Array(8),l=0;l<8;l++)h[l]=r[l+16];return gr(e,f,t,h,x)}c(vr,"crypto_stream");function Kr(e,f,t,r,o,x,h){var l=new Uint8Array(32);ur(l,x,h,sr);for(var m=new Uint8Array(8),M=0;M<8;M++)m[M]=x[M+16];return Sr(e,f,t,r,o,m,l)}c(Kr,"crypto_stream_xor");var ye=c(function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var f,t,r,o,x,h,l,m;f=e[0]&255|(e[1]&255)<<8,this.r[0]=f&8191,t=e[2]&255|(e[3]&255)<<8,this.r[1]=(f>>>13|t<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(t>>>10|r<<6)&7939,o=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|o<<9)&8191,x=e[8]&255|(e[9]&255)<<8,this.r[4]=(o>>>4|x<<12)&255,this.r[5]=x>>>1&8190,h=e[10]&255|(e[11]&255)<<8,this.r[6]=(x>>>14|h<<2)&8191,l=e[12]&255|(e[13]&255)<<8,this.r[7]=(h>>>11|l<<5)&8065,m=e[14]&255|(e[15]&255)<<8,this.r[8]=(l>>>8|m<<8)&8191,this.r[9]=m>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8},"poly1305");ye.prototype.blocks=function(e,f,t){for(var r=this.fin?0:2048,o,x,h,l,m,M,_,Z,S,L,P,O,N,R,z,K,B,D,U,T=this.h[0],C=this.h[1],E=this.h[2],p=this.h[3],y=this.h[4],w=this.h[5],b=this.h[6],g=this.h[7],A=this.h[8],I=this.h[9],Y=this.r[0],H=this.r[1],j=this.r[2],s=this.r[3],G=this.r[4],W=this.r[5],J=this.r[6],F=this.r[7],$=this.r[8],q=this.r[9];t>=16;)o=e[f+0]&255|(e[f+1]&255)<<8,T+=o&8191,x=e[f+2]&255|(e[f+3]&255)<<8,C+=(o>>>13|x<<3)&8191,h=e[f+4]&255|(e[f+5]&255)<<8,E+=(x>>>10|h<<6)&8191,l=e[f+6]&255|(e[f+7]&255)<<8,p+=(h>>>7|l<<9)&8191,m=e[f+8]&255|(e[f+9]&255)<<8,y+=(l>>>4|m<<12)&8191,w+=m>>>1&8191,M=e[f+10]&255|(e[f+11]&255)<<8,b+=(m>>>14|M<<2)&8191,_=e[f+12]&255|(e[f+13]&255)<<8,g+=(M>>>11|_<<5)&8191,Z=e[f+14]&255|(e[f+15]&255)<<8,A+=(_>>>8|Z<<8)&8191,I+=Z>>>5|r,S=0,L=S,L+=T*Y,L+=C*(5*q),L+=E*(5*$),L+=p*(5*F),L+=y*(5*J),S=L>>>13,L&=8191,L+=w*(5*W),L+=b*(5*G),L+=g*(5*s),L+=A*(5*j),L+=I*(5*H),S+=L>>>13,L&=8191,P=S,P+=T*H,P+=C*Y,P+=E*(5*q),P+=p*(5*$),P+=y*(5*F),S=P>>>13,P&=8191,P+=w*(5*J),P+=b*(5*W),P+=g*(5*G),P+=A*(5*s),P+=I*(5*j),S+=P>>>13,P&=8191,O=S,O+=T*j,O+=C*H,O+=E*Y,O+=p*(5*q),O+=y*(5*$),S=O>>>13,O&=8191,O+=w*(5*F),O+=b*(5*J),O+=g*(5*W),O+=A*(5*G),O+=I*(5*s),S+=O>>>13,O&=8191,N=S,N+=T*s,N+=C*j,N+=E*H,N+=p*Y,N+=y*(5*q),S=N>>>13,N&=8191,N+=w*(5*$),N+=b*(5*F),N+=g*(5*J),N+=A*(5*W),N+=I*(5*G),S+=N>>>13,N&=8191,R=S,R+=T*G,R+=C*s,R+=E*j,R+=p*H,R+=y*Y,S=R>>>13,R&=8191,R+=w*(5*q),R+=b*(5*$),R+=g*(5*F),R+=A*(5*J),R+=I*(5*W),S+=R>>>13,R&=8191,z=S,z+=T*W,z+=C*G,z+=E*s,z+=p*j,z+=y*H,S=z>>>13,z&=8191,z+=w*Y,z+=b*(5*q),z+=g*(5*$),z+=A*(5*F),z+=I*(5*J),S+=z>>>13,z&=8191,K=S,K+=T*J,K+=C*W,K+=E*G,K+=p*s,K+=y*j,S=K>>>13,K&=8191,K+=w*H,K+=b*Y,K+=g*(5*q),K+=A*(5*$),K+=I*(5*F),S+=K>>>13,K&=8191,B=S,B+=T*F,B+=C*J,B+=E*W,B+=p*G,B+=y*s,S=B>>>13,B&=8191,B+=w*j,B+=b*H,B+=g*Y,B+=A*(5*q),B+=I*(5*$),S+=B>>>13,B&=8191,D=S,D+=T*$,D+=C*F,D+=E*J,D+=p*W,D+=y*G,S=D>>>13,D&=8191,D+=w*s,D+=b*j,D+=g*H,D+=A*Y,D+=I*(5*q),S+=D>>>13,D&=8191,U=S,U+=T*q,U+=C*$,U+=E*F,U+=p*J,U+=y*W,S=U>>>13,U&=8191,U+=w*G,U+=b*s,U+=g*j,U+=A*H,U+=I*Y,S+=U>>>13,U&=8191,S=(S<<2)+S|0,S=S+L|0,L=S&8191,S=S>>>13,P+=S,T=L,C=P,E=O,p=N,y=R,w=z,b=K,g=B,A=D,I=U,f+=16,t-=16;this.h[0]=T,this.h[1]=C,this.h[2]=E,this.h[3]=p,this.h[4]=y,this.h[5]=w,this.h[6]=b,this.h[7]=g,this.h[8]=A,this.h[9]=I},ye.prototype.finish=function(e,f){var t=new Uint16Array(10),r,o,x,h;if(this.leftover){for(h=this.leftover,this.buffer[h++]=1;h<16;h++)this.buffer[h]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,h=2;h<10;h++)this.h[h]+=r,r=this.h[h]>>>13,this.h[h]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,t[0]=this.h[0]+5,r=t[0]>>>13,t[0]&=8191,h=1;h<10;h++)t[h]=this.h[h]+r,r=t[h]>>>13,t[h]&=8191;for(t[9]-=8192,o=(r^1)-1,h=0;h<10;h++)t[h]&=o;for(o=~o,h=0;h<10;h++)this.h[h]=this.h[h]&o|t[h];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,h=1;h<8;h++)x=(this.h[h]+this.pad[h]|0)+(x>>>16)|0,this.h[h]=x&65535;e[f+0]=this.h[0]>>>0&255,e[f+1]=this.h[0]>>>8&255,e[f+2]=this.h[1]>>>0&255,e[f+3]=this.h[1]>>>8&255,e[f+4]=this.h[2]>>>0&255,e[f+5]=this.h[2]>>>8&255,e[f+6]=this.h[3]>>>0&255,e[f+7]=this.h[3]>>>8&255,e[f+8]=this.h[4]>>>0&255,e[f+9]=this.h[4]>>>8&255,e[f+10]=this.h[5]>>>0&255,e[f+11]=this.h[5]>>>8&255,e[f+12]=this.h[6]>>>0&255,e[f+13]=this.h[6]>>>8&255,e[f+14]=this.h[7]>>>0&255,e[f+15]=this.h[7]>>>8&255},ye.prototype.update=function(e,f,t){var r,o;if(this.leftover){for(o=16-this.leftover,o>t&&(o=t),r=0;r<o;r++)this.buffer[this.leftover+r]=e[f+r];if(t-=o,f+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(t>=16&&(o=t-t%16,this.blocks(e,f,o),f+=o,t-=o),t){for(r=0;r<t;r++)this.buffer[this.leftover+r]=e[f+r];this.leftover+=t}};function De(e,f,t,r,o,x){var h=new ye(x);return h.update(t,r,o),h.finish(e,f),0}c(De,"crypto_onetimeauth");function Ct(e,f,t,r,o,x){var h=new Uint8Array(16);return De(h,0,t,r,o,x),hr(e,f,h,0)}c(Ct,"crypto_onetimeauth_verify");function Ie(e,f,t,r,o){var x;if(t<32)return-1;for(Kr(e,0,f,0,t,r,o),De(e,16,e,32,t-32,e),x=0;x<16;x++)e[x]=0;return 0}c(Ie,"crypto_secretbox");function Le(e,f,t,r,o){var x,h=new Uint8Array(32);if(t<32||(vr(h,0,32,r,o),Ct(f,16,f,32,t-32,h)!==0))return-1;for(Kr(e,0,f,0,t,r,o),x=0;x<32;x++)e[x]=0;return 0}c(Le,"crypto_secretbox_open");function Ir(e,f){var t;for(t=0;t<16;t++)e[t]=f[t]|0}c(Ir,"set25519");function Pe(e){var f,t,r=1;for(f=0;f<16;f++)t=e[f]+r+65535,r=Math.floor(t/65536),e[f]=t-r*65536;e[0]+=r-1+37*(r-1)}c(Pe,"car25519");function Fr(e,f,t){for(var r,o=~(t-1),x=0;x<16;x++)r=o&(e[x]^f[x]),e[x]^=r,f[x]^=r}c(Fr,"sel25519");function Gr(e,f){var t,r,o,x=n(),h=n();for(t=0;t<16;t++)h[t]=f[t];for(Pe(h),Pe(h),Pe(h),r=0;r<2;r++){for(x[0]=h[0]-65517,t=1;t<15;t++)x[t]=h[t]-65535-(x[t-1]>>16&1),x[t-1]&=65535;x[15]=h[15]-32767-(x[14]>>16&1),o=x[15]>>16&1,x[14]&=65535,Fr(h,x,1-o)}for(t=0;t<16;t++)e[2*t]=h[t]&255,e[2*t+1]=h[t]>>8}c(Gr,"pack25519");function Mt(e,f){var t=new Uint8Array(32),r=new Uint8Array(32);return Gr(t,e),Gr(r,f),Ur(t,0,r,0)}c(Mt,"neq25519");function Dt(e){var f=new Uint8Array(32);return Gr(f,e),f[0]&1}c(Dt,"par25519");function Re(e,f){var t;for(t=0;t<16;t++)e[t]=f[2*t]+(f[2*t+1]<<8);e[15]&=32767}c(Re,"unpack25519");function Br(e,f,t){for(var r=0;r<16;r++)e[r]=f[r]+t[r]}c(Br,"A");function Tr(e,f,t){for(var r=0;r<16;r++)e[r]=f[r]-t[r]}c(Tr,"Z");function X(e,f,t){var r,o,x=0,h=0,l=0,m=0,M=0,_=0,Z=0,S=0,L=0,P=0,O=0,N=0,R=0,z=0,K=0,B=0,D=0,U=0,T=0,C=0,E=0,p=0,y=0,w=0,b=0,g=0,A=0,I=0,Y=0,H=0,j=0,s=t[0],G=t[1],W=t[2],J=t[3],F=t[4],$=t[5],q=t[6],ir=t[7],rr=t[8],tr=t[9],fr=t[10],nr=t[11],ar=t[12],pr=t[13],yr=t[14],dr=t[15];r=f[0],x+=r*s,h+=r*G,l+=r*W,m+=r*J,M+=r*F,_+=r*$,Z+=r*q,S+=r*ir,L+=r*rr,P+=r*tr,O+=r*fr,N+=r*nr,R+=r*ar,z+=r*pr,K+=r*yr,B+=r*dr,r=f[1],h+=r*s,l+=r*G,m+=r*W,M+=r*J,_+=r*F,Z+=r*$,S+=r*q,L+=r*ir,P+=r*rr,O+=r*tr,N+=r*fr,R+=r*nr,z+=r*ar,K+=r*pr,B+=r*yr,D+=r*dr,r=f[2],l+=r*s,m+=r*G,M+=r*W,_+=r*J,Z+=r*F,S+=r*$,L+=r*q,P+=r*ir,O+=r*rr,N+=r*tr,R+=r*fr,z+=r*nr,K+=r*ar,B+=r*pr,D+=r*yr,U+=r*dr,r=f[3],m+=r*s,M+=r*G,_+=r*W,Z+=r*J,S+=r*F,L+=r*$,P+=r*q,O+=r*ir,N+=r*rr,R+=r*tr,z+=r*fr,K+=r*nr,B+=r*ar,D+=r*pr,U+=r*yr,T+=r*dr,r=f[4],M+=r*s,_+=r*G,Z+=r*W,S+=r*J,L+=r*F,P+=r*$,O+=r*q,N+=r*ir,R+=r*rr,z+=r*tr,K+=r*fr,B+=r*nr,D+=r*ar,U+=r*pr,T+=r*yr,C+=r*dr,r=f[5],_+=r*s,Z+=r*G,S+=r*W,L+=r*J,P+=r*F,O+=r*$,N+=r*q,R+=r*ir,z+=r*rr,K+=r*tr,B+=r*fr,D+=r*nr,U+=r*ar,T+=r*pr,C+=r*yr,E+=r*dr,r=f[6],Z+=r*s,S+=r*G,L+=r*W,P+=r*J,O+=r*F,N+=r*$,R+=r*q,z+=r*ir,K+=r*rr,B+=r*tr,D+=r*fr,U+=r*nr,T+=r*ar,C+=r*pr,E+=r*yr,p+=r*dr,r=f[7],S+=r*s,L+=r*G,P+=r*W,O+=r*J,N+=r*F,R+=r*$,z+=r*q,K+=r*ir,B+=r*rr,D+=r*tr,U+=r*fr,T+=r*nr,C+=r*ar,E+=r*pr,p+=r*yr,y+=r*dr,r=f[8],L+=r*s,P+=r*G,O+=r*W,N+=r*J,R+=r*F,z+=r*$,K+=r*q,B+=r*ir,D+=r*rr,U+=r*tr,T+=r*fr,C+=r*nr,E+=r*ar,p+=r*pr,y+=r*yr,w+=r*dr,r=f[9],P+=r*s,O+=r*G,N+=r*W,R+=r*J,z+=r*F,K+=r*$,B+=r*q,D+=r*ir,U+=r*rr,T+=r*tr,C+=r*fr,E+=r*nr,p+=r*ar,y+=r*pr,w+=r*yr,b+=r*dr,r=f[10],O+=r*s,N+=r*G,R+=r*W,z+=r*J,K+=r*F,B+=r*$,D+=r*q,U+=r*ir,T+=r*rr,C+=r*tr,E+=r*fr,p+=r*nr,y+=r*ar,w+=r*pr,b+=r*yr,g+=r*dr,r=f[11],N+=r*s,R+=r*G,z+=r*W,K+=r*J,B+=r*F,D+=r*$,U+=r*q,T+=r*ir,C+=r*rr,E+=r*tr,p+=r*fr,y+=r*nr,w+=r*ar,b+=r*pr,g+=r*yr,A+=r*dr,r=f[12],R+=r*s,z+=r*G,K+=r*W,B+=r*J,D+=r*F,U+=r*$,T+=r*q,C+=r*ir,E+=r*rr,p+=r*tr,y+=r*fr,w+=r*nr,b+=r*ar,g+=r*pr,A+=r*yr,I+=r*dr,r=f[13],z+=r*s,K+=r*G,B+=r*W,D+=r*J,U+=r*F,T+=r*$,C+=r*q,E+=r*ir,p+=r*rr,y+=r*tr,w+=r*fr,b+=r*nr,g+=r*ar,A+=r*pr,I+=r*yr,Y+=r*dr,r=f[14],K+=r*s,B+=r*G,D+=r*W,U+=r*J,T+=r*F,C+=r*$,E+=r*q,p+=r*ir,y+=r*rr,w+=r*tr,b+=r*fr,g+=r*nr,A+=r*ar,I+=r*pr,Y+=r*yr,H+=r*dr,r=f[15],B+=r*s,D+=r*G,U+=r*W,T+=r*J,C+=r*F,E+=r*$,p+=r*q,y+=r*ir,w+=r*rr,b+=r*tr,g+=r*fr,A+=r*nr,I+=r*ar,Y+=r*pr,H+=r*yr,j+=r*dr,x+=38*D,h+=38*U,l+=38*T,m+=38*C,M+=38*E,_+=38*p,Z+=38*y,S+=38*w,L+=38*b,P+=38*g,O+=38*A,N+=38*I,R+=38*Y,z+=38*H,K+=38*j,o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=h+o+65535,o=Math.floor(r/65536),h=r-o*65536,r=l+o+65535,o=Math.floor(r/65536),l=r-o*65536,r=m+o+65535,o=Math.floor(r/65536),m=r-o*65536,r=M+o+65535,o=Math.floor(r/65536),M=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,r=Z+o+65535,o=Math.floor(r/65536),Z=r-o*65536,r=S+o+65535,o=Math.floor(r/65536),S=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=P+o+65535,o=Math.floor(r/65536),P=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=K+o+65535,o=Math.floor(r/65536),K=r-o*65536,r=B+o+65535,o=Math.floor(r/65536),B=r-o*65536,x+=o-1+37*(o-1),o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=h+o+65535,o=Math.floor(r/65536),h=r-o*65536,r=l+o+65535,o=Math.floor(r/65536),l=r-o*65536,r=m+o+65535,o=Math.floor(r/65536),m=r-o*65536,r=M+o+65535,o=Math.floor(r/65536),M=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,r=Z+o+65535,o=Math.floor(r/65536),Z=r-o*65536,r=S+o+65535,o=Math.floor(r/65536),S=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=P+o+65535,o=Math.floor(r/65536),P=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=K+o+65535,o=Math.floor(r/65536),K=r-o*65536,r=B+o+65535,o=Math.floor(r/65536),B=r-o*65536,x+=o-1+37*(o-1),e[0]=x,e[1]=h,e[2]=l,e[3]=m,e[4]=M,e[5]=_,e[6]=Z,e[7]=S,e[8]=L,e[9]=P,e[10]=O,e[11]=N,e[12]=R,e[13]=z,e[14]=K,e[15]=B}c(X,"M");function Er(e,f){X(e,f,f)}c(Er,"S");function It(e,f){var t=n(),r;for(r=0;r<16;r++)t[r]=f[r];for(r=253;r>=0;r--)Er(t,t),r!==2&&r!==4&&X(t,t,f);for(r=0;r<16;r++)e[r]=t[r]}c(It,"inv25519");function Lt(e,f){var t=n(),r;for(r=0;r<16;r++)t[r]=f[r];for(r=250;r>=0;r--)Er(t,t),r!==1&&X(t,t,f);for(r=0;r<16;r++)e[r]=t[r]}c(Lt,"pow2523");function de(e,f,t){var r=new Uint8Array(32),o=new Float64Array(80),x,h,l=n(),m=n(),M=n(),_=n(),Z=n(),S=n();for(h=0;h<31;h++)r[h]=f[h];for(r[31]=f[31]&127|64,r[0]&=248,Re(o,t),h=0;h<16;h++)m[h]=o[h],_[h]=l[h]=M[h]=0;for(l[0]=_[0]=1,h=254;h>=0;--h)x=r[h>>>3]>>>(h&7)&1,Fr(l,m,x),Fr(M,_,x),Br(Z,l,M),Tr(l,l,M),Br(M,m,_),Tr(m,m,_),Er(_,Z),Er(S,l),X(l,M,l),X(M,m,Z),Br(Z,l,M),Tr(l,l,M),Er(m,l),Tr(M,_,S),X(l,M,er),Br(l,l,_),X(M,M,l),X(l,_,S),X(_,m,o),Er(m,Z),Fr(l,m,x),Fr(M,_,x);for(h=0;h<16;h++)o[h+16]=l[h],o[h+32]=M[h],o[h+48]=m[h],o[h+64]=_[h];var L=o.subarray(32),P=o.subarray(16);return It(L,L),X(P,P,L),Gr(e,P),0}c(de,"crypto_scalarmult");function be(e,f){return de(e,f,d)}c(be,"crypto_scalarmult_base");function Pt(e,f){return a(f,32),be(e,f)}c(Pt,"crypto_box_keypair");function le(e,f,t){var r=new Uint8Array(32);return de(r,t,f),ur(e,u,r,sr)}c(le,"crypto_box_beforenm");var Rt=Ie,_f=Le;function Uf(e,f,t,r,o,x){var h=new Uint8Array(32);return le(h,o,x),Rt(e,f,t,r,h)}c(Uf,"crypto_box");function Sf(e,f,t,r,o,x){var h=new Uint8Array(32);return le(h,o,x),_f(e,f,t,r,h)}c(Sf,"crypto_box_open");var Kt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function zt(e,f,t,r){for(var o=new Int32Array(16),x=new Int32Array(16),h,l,m,M,_,Z,S,L,P,O,N,R,z,K,B,D,U,T,C,E,p,y,w,b,g,A,I=e[0],Y=e[1],H=e[2],j=e[3],s=e[4],G=e[5],W=e[6],J=e[7],F=f[0],$=f[1],q=f[2],ir=f[3],rr=f[4],tr=f[5],fr=f[6],nr=f[7],ar=0;r>=128;){for(C=0;C<16;C++)E=8*C+ar,o[C]=t[E+0]<<24|t[E+1]<<16|t[E+2]<<8|t[E+3],x[C]=t[E+4]<<24|t[E+5]<<16|t[E+6]<<8|t[E+7];for(C=0;C<80;C++)if(h=I,l=Y,m=H,M=j,_=s,Z=G,S=W,L=J,P=F,O=$,N=q,R=ir,z=rr,K=tr,B=fr,D=nr,p=J,y=nr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=(s>>>14|rr<<18)^(s>>>18|rr<<14)^(rr>>>9|s<<23),y=(rr>>>14|s<<18)^(rr>>>18|s<<14)^(s>>>9|rr<<23),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=s&G^~s&W,y=rr&tr^~rr&fr,w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=Kt[C*2],y=Kt[C*2+1],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=o[C%16],y=x[C%16],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,U=g&65535|A<<16,T=w&65535|b<<16,p=U,y=T,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=(I>>>28|F<<4)^(F>>>2|I<<30)^(F>>>7|I<<25),y=(F>>>28|I<<4)^(I>>>2|F<<30)^(I>>>7|F<<25),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=I&Y^I&H^Y&H,y=F&$^F&q^$&q,w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,L=g&65535|A<<16,D=w&65535|b<<16,p=M,y=R,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=U,y=T,w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,M=g&65535|A<<16,R=w&65535|b<<16,Y=h,H=l,j=m,s=M,G=_,W=Z,J=S,I=L,$=P,q=O,ir=N,rr=R,tr=z,fr=K,nr=B,F=D,C%16===15)for(E=0;E<16;E++)p=o[E],y=x[E],w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=o[(E+9)%16],y=x[(E+9)%16],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,U=o[(E+1)%16],T=x[(E+1)%16],p=(U>>>1|T<<31)^(U>>>8|T<<24)^U>>>7,y=(T>>>1|U<<31)^(T>>>8|U<<24)^(T>>>7|U<<25),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,U=o[(E+14)%16],T=x[(E+14)%16],p=(U>>>19|T<<13)^(T>>>29|U<<3)^U>>>6,y=(T>>>19|U<<13)^(U>>>29|T<<3)^(T>>>6|U<<26),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,o[E]=g&65535|A<<16,x[E]=w&65535|b<<16;p=I,y=F,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[0],y=f[0],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[0]=I=g&65535|A<<16,f[0]=F=w&65535|b<<16,p=Y,y=$,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[1],y=f[1],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[1]=Y=g&65535|A<<16,f[1]=$=w&65535|b<<16,p=H,y=q,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[2],y=f[2],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[2]=H=g&65535|A<<16,f[2]=q=w&65535|b<<16,p=j,y=ir,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[3],y=f[3],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[3]=j=g&65535|A<<16,f[3]=ir=w&65535|b<<16,p=s,y=rr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[4],y=f[4],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[4]=s=g&65535|A<<16,f[4]=rr=w&65535|b<<16,p=G,y=tr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[5],y=f[5],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[5]=G=g&65535|A<<16,f[5]=tr=w&65535|b<<16,p=W,y=fr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[6],y=f[6],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[6]=W=g&65535|A<<16,f[6]=fr=w&65535|b<<16,p=J,y=nr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[7],y=f[7],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[7]=J=g&65535|A<<16,f[7]=nr=w&65535|b<<16,ar+=128,r-=128}return r}c(zt,"crypto_hashblocks_hl");function Or(e,f,t){var r=new Int32Array(8),o=new Int32Array(8),x=new Uint8Array(256),h,l=t;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,zt(r,o,f,t),t%=128,h=0;h<t;h++)x[h]=f[l-t+h];for(x[t]=128,t=256-128*(t<112?1:0),x[t-9]=0,pe(x,t-8,l/536870912|0,l<<3),zt(r,o,x,t),h=0;h<8;h++)pe(e,8*h,r[h],o[h]);return 0}c(Or,"crypto_hash");function ge(e,f){var t=n(),r=n(),o=n(),x=n(),h=n(),l=n(),m=n(),M=n(),_=n();Tr(t,e[1],e[0]),Tr(_,f[1],f[0]),X(t,t,_),Br(r,e[0],e[1]),Br(_,f[0],f[1]),X(r,r,_),X(o,e[3],f[3]),X(o,o,Rr),X(x,e[2],f[2]),Br(x,x,x),Tr(h,r,t),Tr(l,x,o),Br(m,x,o),Br(M,r,t),X(e[0],h,l),X(e[1],M,m),X(e[2],m,l),X(e[3],h,M)}c(ge,"add");function Nt(e,f,t){var r;for(r=0;r<4;r++)Fr(e[r],f[r],t)}c(Nt,"cswap");function Ke(e,f){var t=n(),r=n(),o=n();It(o,f[2]),X(t,f[0],o),X(r,f[1],o),Gr(e,r),e[31]^=Dt(t)<<7}c(Ke,"pack");function ze(e,f,t){var r,o;for(Ir(e[0],v),Ir(e[1],V),Ir(e[2],V),Ir(e[3],v),o=255;o>=0;--o)r=t[o/8|0]>>(o&7)&1,Nt(e,f,r),ge(f,e),ge(e,e),Nt(e,f,r)}c(ze,"scalarmult");function we(e,f){var t=[n(),n(),n(),n()];Ir(t[0],br),Ir(t[1],Dr),Ir(t[2],V),X(t[3],br,Dr),ze(e,t,f)}c(we,"scalarbase");function Ne(e,f,t){var r=new Uint8Array(64),o=[n(),n(),n(),n()],x;for(t||a(f,32),Or(r,f,32),r[0]&=248,r[31]&=127,r[31]|=64,we(o,r),Ke(e,o),x=0;x<32;x++)f[x+32]=e[x];return 0}c(Ne,"crypto_sign_keypair");var Ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Oe(e,f){var t,r,o,x;for(r=63;r>=32;--r){for(t=0,o=r-32,x=r-12;o<x;++o)f[o]+=t-16*f[r]*Ae[o-(r-32)],t=Math.floor((f[o]+128)/256),f[o]-=t*256;f[o]+=t,f[r]=0}for(t=0,o=0;o<32;o++)f[o]+=t-(f[31]>>4)*Ae[o],t=f[o]>>8,f[o]&=255;for(o=0;o<32;o++)f[o]-=t*Ae[o];for(r=0;r<32;r++)f[r+1]+=f[r]>>8,e[r]=f[r]&255}c(Oe,"modL");function Ye(e){var f=new Float64Array(64),t;for(t=0;t<64;t++)f[t]=e[t];for(t=0;t<64;t++)e[t]=0;Oe(e,f)}c(Ye,"reduce");function Ot(e,f,t,r){var o=new Uint8Array(64),x=new Uint8Array(64),h=new Uint8Array(64),l,m,M=new Float64Array(64),_=[n(),n(),n(),n()];Or(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64;var Z=t+64;for(l=0;l<t;l++)e[64+l]=f[l];for(l=0;l<32;l++)e[32+l]=o[32+l];for(Or(h,e.subarray(32),t+32),Ye(h),we(_,h),Ke(e,_),l=32;l<64;l++)e[l]=r[l];for(Or(x,e,t+64),Ye(x),l=0;l<64;l++)M[l]=0;for(l=0;l<32;l++)M[l]=h[l];for(l=0;l<32;l++)for(m=0;m<32;m++)M[l+m]+=x[l]*o[m];return Oe(e.subarray(32),M),Z}c(Ot,"crypto_sign");function Bf(e,f){var t=n(),r=n(),o=n(),x=n(),h=n(),l=n(),m=n();return Ir(e[2],V),Re(e[1],f),Er(o,e[1]),X(x,o,cr),Tr(o,o,e[2]),Br(x,e[2],x),Er(h,x),Er(l,h),X(m,l,h),X(t,m,o),X(t,t,x),Lt(t,t),X(t,t,o),X(t,t,x),X(t,t,x),X(e[0],t,x),Er(r,e[0]),X(r,r,x),Mt(r,o)&&X(e[0],e[0],Hr),Er(r,e[0]),X(r,r,x),Mt(r,o)?-1:(Dt(e[0])===f[31]>>7&&Tr(e[0],v,e[0]),X(e[3],e[0],e[1]),0)}c(Bf,"unpackneg");function je(e,f,t,r){var o,x=new Uint8Array(32),h=new Uint8Array(64),l=[n(),n(),n(),n()],m=[n(),n(),n(),n()];if(t<64||Bf(m,r))return-1;for(o=0;o<t;o++)e[o]=f[o];for(o=0;o<32;o++)e[o+32]=r[o];if(Or(h,e,t),Ye(h),ze(l,m,h),we(m,f.subarray(32)),ge(l,m),Ke(x,l),t-=64,Ur(f,0,x,0)){for(o=0;o<t;o++)e[o]=0;return-1}for(o=0;o<t;o++)e[o]=f[o+64];return t}c(je,"crypto_sign_open");var He=32,me=24,ee=32,Vr=16,te=32,ve=32,fe=32,ne=32,Fe=32,Yt=me,Tf=ee,Cf=Vr,Lr=64,Yr=32,Xr=64,Ge=32,Ve=64;i.lowlevel={crypto_core_hsalsa20:ur,crypto_stream_xor:Kr,crypto_stream:vr,crypto_stream_salsa20_xor:Sr,crypto_stream_salsa20:gr,crypto_onetimeauth:De,crypto_onetimeauth_verify:Ct,crypto_verify_16:hr,crypto_verify_32:Ur,crypto_secretbox:Ie,crypto_secretbox_open:Le,crypto_scalarmult:de,crypto_scalarmult_base:be,crypto_box_beforenm:le,crypto_box_afternm:Rt,crypto_box:Uf,crypto_box_open:Sf,crypto_box_keypair:Pt,crypto_hash:Or,crypto_sign:Ot,crypto_sign_keypair:Ne,crypto_sign_open:je,crypto_secretbox_KEYBYTES:He,crypto_secretbox_NONCEBYTES:me,crypto_secretbox_ZEROBYTES:ee,crypto_secretbox_BOXZEROBYTES:Vr,crypto_scalarmult_BYTES:te,crypto_scalarmult_SCALARBYTES:ve,crypto_box_PUBLICKEYBYTES:fe,crypto_box_SECRETKEYBYTES:ne,crypto_box_BEFORENMBYTES:Fe,crypto_box_NONCEBYTES:Yt,crypto_box_ZEROBYTES:Tf,crypto_box_BOXZEROBYTES:Cf,crypto_sign_BYTES:Lr,crypto_sign_PUBLICKEYBYTES:Yr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:Ge,crypto_hash_BYTES:Ve,gf:n,D:cr,L:Ae,pack25519:Gr,unpack25519:Re,M:X,A:Br,S:Er,Z:Tr,pow2523:Lt,add:ge,set25519:Ir,modL:Oe,scalarmult:ze,scalarbase:we};function jt(e,f){if(e.length!==He)throw new Error("bad key size");if(f.length!==me)throw new Error("bad nonce size")}c(jt,"checkLengths");function Mf(e,f){if(e.length!==fe)throw new Error("bad public key size");if(f.length!==ne)throw new Error("bad secret key size")}c(Mf,"checkBoxLengths");function Ar(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}c(Ar,"checkArrayTypes");function Ht(e){for(var f=0;f<e.length;f++)e[f]=0}c(Ht,"cleanup"),i.randomBytes=function(e){var f=new Uint8Array(e);return a(f,e),f},i.secretbox=function(e,f,t){Ar(e,f,t),jt(t,f);for(var r=new Uint8Array(ee+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+ee]=e[x];return Ie(o,r,r.length,f,t),o.subarray(Vr)},i.secretbox.open=function(e,f,t){Ar(e,f,t),jt(t,f);for(var r=new Uint8Array(Vr+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+Vr]=e[x];return r.length<32||Le(o,r,r.length,f,t)!==0?null:o.subarray(ee)},i.secretbox.keyLength=He,i.secretbox.nonceLength=me,i.secretbox.overheadLength=Vr,i.scalarMult=function(e,f){if(Ar(e,f),e.length!==ve)throw new Error("bad n size");if(f.length!==te)throw new Error("bad p size");var t=new Uint8Array(te);return de(t,e,f),t},i.scalarMult.base=function(e){if(Ar(e),e.length!==ve)throw new Error("bad n size");var f=new Uint8Array(te);return be(f,e),f},i.scalarMult.scalarLength=ve,i.scalarMult.groupElementLength=te,i.box=function(e,f,t,r){var o=i.box.before(t,r);return i.secretbox(e,f,o)},i.box.before=function(e,f){Ar(e,f),Mf(e,f);var t=new Uint8Array(Fe);return le(t,e,f),t},i.box.after=i.secretbox,i.box.open=function(e,f,t,r){var o=i.box.before(t,r);return i.secretbox.open(e,f,o)},i.box.open.after=i.secretbox.open,i.box.keyPair=function(){var e=new Uint8Array(fe),f=new Uint8Array(ne);return Pt(e,f),{publicKey:e,secretKey:f}},i.box.keyPair.fromSecretKey=function(e){if(Ar(e),e.length!==ne)throw new Error("bad secret key size");var f=new Uint8Array(fe);return be(f,e),{publicKey:f,secretKey:new Uint8Array(e)}},i.box.publicKeyLength=fe,i.box.secretKeyLength=ne,i.box.sharedKeyLength=Fe,i.box.nonceLength=Yt,i.box.overheadLength=i.secretbox.overheadLength,i.sign=function(e,f){if(Ar(e,f),f.length!==Xr)throw new Error("bad secret key size");var t=new Uint8Array(Lr+e.length);return Ot(t,e,e.length,f),t},i.sign.open=function(e,f){if(Ar(e,f),f.length!==Yr)throw new Error("bad public key size");var t=new Uint8Array(e.length),r=je(t,e,e.length,f);if(r<0)return null;for(var o=new Uint8Array(r),x=0;x<o.length;x++)o[x]=t[x];return o},i.sign.detached=function(e,f){for(var t=i.sign(e,f),r=new Uint8Array(Lr),o=0;o<r.length;o++)r[o]=t[o];return r},i.sign.detached.verify=function(e,f,t){if(Ar(e,f,t),f.length!==Lr)throw new Error("bad signature size");if(t.length!==Yr)throw new Error("bad public key size");var r=new Uint8Array(Lr+e.length),o=new Uint8Array(Lr+e.length),x;for(x=0;x<Lr;x++)r[x]=f[x];for(x=0;x<e.length;x++)r[x+Lr]=e[x];return je(o,r,r.length,t)>=0},i.sign.keyPair=function(){var e=new Uint8Array(Yr),f=new Uint8Array(Xr);return Ne(e,f),{publicKey:e,secretKey:f}},i.sign.keyPair.fromSecretKey=function(e){if(Ar(e),e.length!==Xr)throw new Error("bad secret key size");for(var f=new Uint8Array(Yr),t=0;t<f.length;t++)f[t]=e[32+t];return{publicKey:f,secretKey:new Uint8Array(e)}},i.sign.keyPair.fromSeed=function(e){if(Ar(e),e.length!==Ge)throw new Error("bad seed size");for(var f=new Uint8Array(Yr),t=new Uint8Array(Xr),r=0;r<32;r++)t[r]=e[r];return Ne(f,t,!0),{publicKey:f,secretKey:t}},i.sign.publicKeyLength=Yr,i.sign.secretKeyLength=Xr,i.sign.seedLength=Ge,i.sign.signatureLength=Lr,i.hash=function(e){Ar(e);var f=new Uint8Array(Ve);return Or(f,e,e.length),f},i.hash.hashLength=Ve,i.verify=function(e,f){return Ar(e,f),e.length===0||f.length===0||e.length!==f.length?!1:k(e,0,f,0,e.length)===0},i.setPRNG=function(e){a=e},function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var f=65536;i.setPRNG(function(t,r){var o,x=new Uint8Array(r);for(o=0;o<r;o+=f)e.getRandomValues(x.subarray(o,o+Math.min(r-o,f)));for(o=0;o<r;o++)t[o]=x[o];Ht(x)})}else typeof Ft<"u"&&(e=yf(),e&&e.randomBytes&&i.setPRNG(function(t,r){var o,x=e.randomBytes(r);for(o=0;o<r;o++)t[o]=x[o];Ht(x)}))}()})(typeof Be<"u"&&Be.exports?Be.exports:self.nacl=self.nacl||{})});var Of=globalThis||window||self,Cr=Of.crypto;function ie(i=0){return new Uint8Array(i)}c(ie,"allocUnsafe");function Xe(i,n){n==null&&(n=i.reduce((d,v)=>d+v.length,0));let a=ie(n),u=0;for(let d of i)a.set(d,u),u+=d.length;return a}c(Xe,"concat");var et={};_r(et,{base10:()=>Xf});var Co=new Uint8Array(0);function Vt(i,n){if(i===n)return!0;if(i.byteLength!==n.byteLength)return!1;for(let a=0;a<i.byteLength;a++)if(i[a]!==n[a])return!1;return!0}c(Vt,"equals");function Pr(i){if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")}c(Pr,"coerce");function Xt(i){return new TextEncoder().encode(i)}c(Xt,"fromString");function $t(i){return new TextDecoder().decode(i)}c($t,"toString");function jf(i,n){if(i.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),u=0;u<a.length;u++)a[u]=255;for(var d=0;d<i.length;d++){var v=i.charAt(d),V=v.charCodeAt(0);if(a[V]!==255)throw new TypeError(v+" is ambiguous");a[V]=d}var er=i.length,cr=i.charAt(0),Rr=Math.log(er)/Math.log(256),br=Math.log(256)/Math.log(er);function Dr(k){if(k instanceof Uint8Array||(ArrayBuffer.isView(k)?k=new Uint8Array(k.buffer,k.byteOffset,k.byteLength):Array.isArray(k)&&(k=Uint8Array.from(k))),!(k instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(k.length===0)return"";for(var hr=0,Ur=0,wr=0,mr=k.length;wr!==mr&&k[wr]===0;)wr++,hr++;for(var lr=(mr-wr)*br+1>>>0,ur=new Uint8Array(lr);wr!==mr;){for(var sr=k[wr],Sr=0,gr=lr-1;(sr!==0||Sr<Ur)&&gr!==-1;gr--,Sr++)sr+=256*ur[gr]>>>0,ur[gr]=sr%er>>>0,sr=sr/er>>>0;if(sr!==0)throw new Error("Non-zero carry");Ur=Sr,wr++}for(var vr=lr-Ur;vr!==lr&&ur[vr]===0;)vr++;for(var Kr=cr.repeat(hr);vr<lr;++vr)Kr+=i.charAt(ur[vr]);return Kr}c(Dr,"encode");function Hr(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return new Uint8Array;var hr=0;if(k[hr]!==" "){for(var Ur=0,wr=0;k[hr]===cr;)Ur++,hr++;for(var mr=(k.length-hr)*Rr+1>>>0,lr=new Uint8Array(mr);k[hr];){var ur=a[k.charCodeAt(hr)];if(ur===255)return;for(var sr=0,Sr=mr-1;(ur!==0||sr<wr)&&Sr!==-1;Sr--,sr++)ur+=er*lr[Sr]>>>0,lr[Sr]=ur%256>>>0,ur=ur/256>>>0;if(ur!==0)throw new Error("Non-zero carry");wr=sr,hr++}if(k[hr]!==" "){for(var gr=mr-wr;gr!==mr&&lr[gr]===0;)gr++;for(var vr=new Uint8Array(Ur+(mr-gr)),Kr=Ur;gr!==mr;)vr[Kr++]=lr[gr++];return vr}}}c(Hr,"decodeUnsafe");function pe(k){var hr=Hr(k);if(hr)return hr;throw new Error(`Non-${n} character`)}return c(pe,"decode"),{encode:Dr,decodeUnsafe:Hr,decode:pe}}c(jf,"base");var Hf=jf,Ff=Hf,Zt=Ff;var Je=class Je{constructor(n,a,u){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");this.name=n,this.prefix=a,this.baseEncode=u}encode(n){if(n instanceof Uint8Array)return`${this.prefix}${this.baseEncode(n)}`;throw Error("Unknown type, must be binary type")}};c(Je,"Encoder");var $e=Je,Qe=class Qe{constructor(n,a,u){Q(this,"name");Q(this,"prefix");Q(this,"baseDecode");Q(this,"prefixCodePoint");this.name=n,this.prefix=a;let d=a.codePointAt(0);if(d===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=d,this.baseDecode=u}decode(n){if(typeof n=="string"){if(n.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(n)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(n.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(n){return Wt(this,n)}};c(Qe,"Decoder");var qe=Qe,ke=class ke{constructor(n){Q(this,"decoders");this.decoders=n}or(n){return Wt(this,n)}decode(n){let a=n[0],u=this.decoders[a];if(u!=null)return u.decode(n);throw RangeError(`Unable to decode multibase string ${JSON.stringify(n)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};c(ke,"ComposedDecoder");var Ze=ke;function Wt(i,n){return new Ze({...i.decoders??{[i.prefix]:i},...n.decoders??{[n.prefix]:n}})}c(Wt,"or");var rt=class rt{constructor(n,a,u,d){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");Q(this,"baseDecode");Q(this,"encoder");Q(this,"decoder");this.name=n,this.prefix=a,this.baseEncode=u,this.baseDecode=d,this.encoder=new $e(n,a,u),this.decoder=new qe(n,a,d)}encode(n){return this.encoder.encode(n)}decode(n){return this.decoder.decode(n)}};c(rt,"Codec");var We=rt;function $r({name:i,prefix:n,encode:a,decode:u}){return new We(i,n,a,u)}c($r,"from");function zr({name:i,prefix:n,alphabet:a}){let{encode:u,decode:d}=Zt(a,i);return $r({prefix:n,name:i,encode:u,decode:c(v=>Pr(d(v)),"decode")})}c(zr,"baseX");function Gf(i,n,a,u){let d={};for(let br=0;br<n.length;++br)d[n[br]]=br;let v=i.length;for(;i[v-1]==="=";)--v;let V=new Uint8Array(v*a/8|0),er=0,cr=0,Rr=0;for(let br=0;br<v;++br){let Dr=d[i[br]];if(Dr===void 0)throw new SyntaxError(`Non-${u} character`);cr=cr<<a|Dr,er+=a,er>=8&&(er-=8,V[Rr++]=255&cr>>er)}if(er>=a||(255&cr<<8-er)!==0)throw new SyntaxError("Unexpected end of data");return V}c(Gf,"decode");function Vf(i,n,a){let u=n[n.length-1]==="=",d=(1<<a)-1,v="",V=0,er=0;for(let cr=0;cr<i.length;++cr)for(er=er<<8|i[cr],V+=8;V>a;)V-=a,v+=n[d&er>>V];if(V!==0&&(v+=n[d&er<<a-V]),u)for(;(v.length*a&7)!==0;)v+="=";return v}c(Vf,"encode");function or({name:i,prefix:n,bitsPerChar:a,alphabet:u}){return $r({prefix:n,name:i,encode(d){return Vf(d,u,a)},decode(d){return Gf(d,u,a,i)}})}c(or,"rfc4648");var Xf=zr({prefix:"9",name:"base10",alphabet:"0123456789"});var tt={};_r(tt,{base16:()=>$f,base16upper:()=>qf});var $f=or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qf=or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ft={};_r(ft,{base2:()=>Zf});var Zf=or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var nt={};_r(nt,{base256emoji:()=>rn});var Jt=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Wf=Jt.reduce((i,n,a)=>(i[a]=n,i),[]),Jf=Jt.reduce((i,n,a)=>{let u=n.codePointAt(0);if(u==null)throw new Error(`Invalid character: ${n}`);return i[u]=a,i},[]);function Qf(i){return i.reduce((n,a)=>(n+=Wf[a],n),"")}c(Qf,"encode");function kf(i){let n=[];for(let a of i){let u=a.codePointAt(0);if(u==null)throw new Error(`Invalid character: ${a}`);let d=Jf[u];if(d==null)throw new Error(`Non-base256emoji character: ${a}`);n.push(d)}return new Uint8Array(n)}c(kf,"decode");var rn=$r({prefix:"\u{1F680}",name:"base256emoji",encode:Qf,decode:kf});var ot={};_r(ot,{base32:()=>qr,base32hex:()=>nn,base32hexpad:()=>an,base32hexpadupper:()=>sn,base32hexupper:()=>on,base32pad:()=>tn,base32padupper:()=>fn,base32upper:()=>en,base32z:()=>xn});var qr=or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),en=or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),tn=or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),fn=or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),nn=or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),on=or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),an=or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sn=or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),xn=or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var it={};_r(it,{base36:()=>ae,base36upper:()=>cn});var ae=zr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),cn=zr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var at={};_r(at,{base58btc:()=>Mr,base58flickr:()=>hn});var Mr=zr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hn=zr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var st={};_r(st,{base64:()=>un,base64pad:()=>pn,base64url:()=>yn,base64urlpad:()=>dn});var un=or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pn=or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),yn=or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),dn=or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xt={};_r(xt,{base8:()=>bn});var bn=or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ct={};_r(ct,{identity:()=>ln});var ln=$r({prefix:"\0",name:"identity",encode:c(i=>$t(i),"encode"),decode:c(i=>Xt(i),"decode")});var Wo=new TextEncoder,Jo=new TextDecoder;var pt={};_r(pt,{identity:()=>Yn});var An=rf,Qt=128,mn=127,vn=~mn,En=Math.pow(2,31);function rf(i,n,a){n=n||[],a=a||0;for(var u=a;i>=En;)n[a++]=i&255|Qt,i/=128;for(;i&vn;)n[a++]=i&255|Qt,i>>>=7;return n[a]=i|0,rf.bytes=a-u+1,n}c(rf,"encode");var _n=ht,Un=128,kt=127;function ht(i,u){var a=0,u=u||0,d=0,v=u,V,er=i.length;do{if(v>=er)throw ht.bytes=0,new RangeError("Could not decode varint");V=i[v++],a+=d<28?(V&kt)<<d:(V&kt)*Math.pow(2,d),d+=7}while(V>=Un);return ht.bytes=v-u,a}c(ht,"read");var Sn=Math.pow(2,7),Bn=Math.pow(2,14),Tn=Math.pow(2,21),Cn=Math.pow(2,28),Mn=Math.pow(2,35),Dn=Math.pow(2,42),In=Math.pow(2,49),Ln=Math.pow(2,56),Pn=Math.pow(2,63),Rn=c(function(i){return i<Sn?1:i<Bn?2:i<Tn?3:i<Cn?4:i<Mn?5:i<Dn?6:i<In?7:i<Ln?8:i<Pn?9:10},"length"),Kn={encode:An,decode:_n,encodingLength:Rn},zn=Kn,se=zn;function xe(i,n=0){return[se.decode(i,n),se.decode.bytes]}c(xe,"decode");function Zr(i,n,a=0){return se.encode(i,n,a),n}c(Zr,"encodeTo");function Wr(i){return se.encodingLength(i)}c(Wr,"encodingLength");function jr(i,n){let a=n.byteLength,u=Wr(i),d=u+Wr(a),v=new Uint8Array(d+a);return Zr(i,v,0),Zr(a,v,u),v.set(n,d),new Jr(i,a,n,v)}c(jr,"create");function ef(i){let n=Pr(i),[a,u]=xe(n),[d,v]=xe(n.subarray(u)),V=n.subarray(u+v);if(V.byteLength!==d)throw new Error("Incorrect length");return new Jr(a,d,V,n)}c(ef,"decode");function tf(i,n){if(i===n)return!0;{let a=n;return i.code===a.code&&i.size===a.size&&a.bytes instanceof Uint8Array&&Vt(i.bytes,a.bytes)}}c(tf,"equals");var ut=class ut{constructor(n,a,u,d){Q(this,"code");Q(this,"size");Q(this,"digest");Q(this,"bytes");this.code=n,this.size=a,this.digest=u,this.bytes=d}};c(ut,"Digest");var Jr=ut;var ff=0,Nn="identity",nf=Pr;function On(i){return jr(ff,nf(i))}c(On,"digest");var Yn={code:ff,name:Nn,encode:nf,digest:On};var lt={};_r(lt,{sha256:()=>jn,sha512:()=>Hn});function dt({name:i,code:n,encode:a}){return new yt(i,n,a)}c(dt,"from");var bt=class bt{constructor(n,a,u){Q(this,"name");Q(this,"code");Q(this,"encode");this.name=n,this.code=a,this.encode=u}digest(n){if(n instanceof Uint8Array){let a=this.encode(n);return a instanceof Uint8Array?jr(this.code,a):a.then(u=>jr(this.code,u))}else throw Error("Unknown type, must be binary type")}};c(bt,"Hasher");var yt=bt;function af(i){return async n=>new Uint8Array(await crypto.subtle.digest(i,n))}c(af,"sha");var jn=dt({name:"sha2-256",code:18,encode:af("SHA-256")}),Hn=dt({name:"sha2-512",code:19,encode:af("SHA-512")});function sf(i,n){let{bytes:a,version:u}=i;switch(u){case 0:return Gn(a,gt(i),n??Mr.encoder);default:return Vn(a,gt(i),n??qr.encoder)}}c(sf,"format");var xf=new WeakMap;function gt(i){let n=xf.get(i);if(n==null){let a=new Map;return xf.set(i,a),a}return n}c(gt,"baseCache");var hf,xr=class xr{constructor(n,a,u,d){Q(this,"code");Q(this,"version");Q(this,"multihash");Q(this,"bytes");Q(this,"/");Q(this,hf,"CID");this.code=a,this.version=n,this.multihash=u,this.bytes=d,this["/"]=d}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:n,multihash:a}=this;if(n!==he)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(a.code!==Xn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return xr.createV0(a)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:n,digest:a}=this.multihash,u=jr(n,a);return xr.createV1(this.code,u)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(n){return xr.equals(this,n)}static equals(n,a){let u=a;return u!=null&&n.code===u.code&&n.version===u.version&&tf(n.multihash,u.multihash)}toString(n){return sf(this,n)}toJSON(){return{"/":sf(this)}}link(){return this}[(hf=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(n){if(n==null)return null;let a=n;if(a instanceof xr)return a;if(a["/"]!=null&&a["/"]===a.bytes||a.asCID===a){let{version:u,code:d,multihash:v,bytes:V}=a;return new xr(u,d,v,V??cf(u,d,v.bytes))}else if(a[$n]===!0){let{version:u,multihash:d,code:v}=a,V=ef(d);return xr.create(u,v,V)}else return null}static create(n,a,u){if(typeof a!="number")throw new Error("String codecs are no longer supported");if(!(u.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(n){case 0:{if(a!==he)throw new Error(`Version 0 CID must use dag-pb (code: ${he}) block encoding`);return new xr(n,a,u,u.bytes)}case 1:{let d=cf(n,a,u.bytes);return new xr(n,a,u,d)}default:throw new Error("Invalid version")}}static createV0(n){return xr.create(0,he,n)}static createV1(n,a){return xr.create(1,n,a)}static decode(n){let[a,u]=xr.decodeFirst(n);if(u.length!==0)throw new Error("Incorrect length");return a}static decodeFirst(n){let a=xr.inspectBytes(n),u=a.size-a.multihashSize,d=Pr(n.subarray(u,u+a.multihashSize));if(d.byteLength!==a.multihashSize)throw new Error("Incorrect length");let v=d.subarray(a.multihashSize-a.digestSize),V=new Jr(a.multihashCode,a.digestSize,v,d);return[a.version===0?xr.createV0(V):xr.createV1(a.codec,V),n.subarray(a.size)]}static inspectBytes(n){let a=0,u=c(()=>{let[Dr,Hr]=xe(n.subarray(a));return a+=Hr,Dr},"next"),d=u(),v=he;if(d===18?(d=0,a=0):v=u(),d!==0&&d!==1)throw new RangeError(`Invalid CID version ${d}`);let V=a,er=u(),cr=u(),Rr=a+cr,br=Rr-V;return{version:d,codec:v,multihashCode:er,digestSize:cr,multihashSize:br,size:Rr}}static parse(n,a){let[u,d]=Fn(n,a),v=xr.decode(d);if(v.version===0&&n[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return gt(v).set(u,n),v}};c(xr,"CID");var _e=xr;function Fn(i,n){switch(i[0]){case"Q":{let a=n??Mr;return[Mr.prefix,a.decode(`${Mr.prefix}${i}`)]}case Mr.prefix:{let a=n??Mr;return[Mr.prefix,a.decode(i)]}case qr.prefix:{let a=n??qr;return[qr.prefix,a.decode(i)]}case ae.prefix:{let a=n??ae;return[ae.prefix,a.decode(i)]}default:{if(n==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[i[0],n.decode(i)]}}}c(Fn,"parseCIDtoBytes");function Gn(i,n,a){let{prefix:u}=a;if(u!==Mr.prefix)throw Error(`Cannot string encode V0 in ${a.name} encoding`);let d=n.get(u);if(d==null){let v=a.encode(i).slice(1);return n.set(u,v),v}else return d}c(Gn,"toStringV0");function Vn(i,n,a){let{prefix:u}=a,d=n.get(u);if(d==null){let v=a.encode(i);return n.set(u,v),v}else return d}c(Vn,"toStringV1");var he=112,Xn=18;function cf(i,n,a){let u=Wr(i),d=u+Wr(n),v=new Uint8Array(d+a.byteLength);return Zr(i,v,0),Zr(n,v,u),v.set(a,d),v}c(cf,"encodeCID");var $n=Symbol.for("@ipld/js-cid/CID");var wt={...ct,...ft,...xt,...et,...tt,...ot,...it,...at,...st,...nt},T0={...lt,...pt};function pf(i,n,a,u){return{name:i,prefix:n,encoder:{name:i,prefix:n,encode:a},decoder:{decode:u}}}c(pf,"createCodec");var uf=pf("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),At=pf("ascii","a",i=>{let n="a";for(let a=0;a<i.length;a++)n+=String.fromCharCode(i[a]);return n},i=>{i=i.substring(1);let n=ie(i.length);for(let a=0;a<i.length;a++)n[a]=i.charCodeAt(a);return n}),qn={utf8:uf,"utf-8":uf,hex:wt.base16,latin1:At,ascii:At,binary:At,...wt},Ue=qn;function Nr(i,n="utf8"){let a=Ue[n];if(a==null)throw new Error(`Unsupported encoding "${n}"`);return a.decoder.decode(`${a.prefix}${i}`)}c(Nr,"fromString");function Se(i,n="utf8"){let a=Ue[n];if(a==null)throw new Error(`Unsupported encoding "${n}"`);return a.encoder.encode(i).substring(1)}c(Se,"toString");var Af=Nf(df(),1);var ue="did:key:z";var oi="X25519";var ii="X25519";var Qr="RSA-OAEP",kr="RSASSA-PKCS1-v1_5",mt="SHA-256",Wn=new Uint8Array([0,245,2]),ai=2048,vt="SHA-256",Te=8;var Jn=new Uint8Array([234,1]),Qn=new Uint8Array([237,1]);var Et=16;var bf=new Error("Invalid key use. Please use 'encryption' or 'signing"),li=new Error("Max must be less than 256 and greater than 0");function re(i){return new Uint8Array(i).buffer}c(re,"toArrayBuffer");function _t(i){let n=Nr(i,"base64pad");return re(n)}c(_t,"base64ToArrBuf");var Ut=c((i,n)=>{if(typeof i=="string")return n(i);if(typeof i=="object"&&i.byteLength!==void 0)return new Uint8Array(i).buffer;throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")},"normalizeToBuf");function lf(i){return Ut(i,_t)}c(lf,"normalizeBase64ToBuf");var ro=c(i=>Ut(i,n=>gf(n,8)),"normalizeUtf8ToBuf");function gf(i,n){let a=n===8?new Uint8Array(i.length):new Uint16Array(i.length);for(let u=0,d=i.length;u<d;u++)a[u]=i.charCodeAt(u);return a.buffer}c(gf,"strToArrBuf");var eo=c(i=>Ut(i,n=>gf(n,16)),"normalizeUtf16ToBuf");function Ce(i,n){switch(n){case 8:return ro(i);default:return eo(i)}}c(Ce,"normalizeUnicodeToBuf");var to={equal:c((i,n)=>{let a=new Uint8Array(i),u=new Uint8Array(n);if(a.length!==u.length)return!1;for(let d=0;d<a.length;d++)if(a[d]!==u[d])return!1;return!0},"equal")};function wf(i,n){return to.equal(n,i.slice(0,n.byteLength))}c(wf,"hasPrefix");var Tt={keyTypes:{"bls12-381":{magicBytes:new Uint8Array([234,1]),verify:c(()=>{throw new Error("Not implemented")},"verify")},rsa:{magicBytes:new Uint8Array([0,245,2]),verify:vf},ed25519:{magicBytes:new Uint8Array([237,1]),verify:mf}}};async function Ui({message:i,did:n,signature:a}){let u=fo(n),d=Me(n).publicKey;if(u==="ed25519")return mf({message:i,publicKey:d,signature:a});if(u==="rsa")return vf({message:i,publicKey:d,signature:a});throw new Error("Unknown key format")}c(Ui,"verify");function fo(i){try{let{type:n}=Me(i);return n}catch{return"unknown"}}c(fo,"getAlgorithm");async function mf({message:i,publicKey:n,signature:a}){let u=i;typeof i=="string"&&(u=Nr(i,"utf8"));let d=a;typeof a=="string"&&(d=Nr(a,"base64pad"));let v=n;if(typeof n=="string"&&(v=Me(n).publicKey),v.length!==32)throw new Error(`Invalid Ed25519 public key size: ${v.length} bytes, expected 32`);if(d.length!==64)throw new Error(`Invalid Ed25519 signature size: ${d.length} bytes, expected 64`);return Af.default.sign.detached.verify(u,d,v)}c(mf,"ed25519Verify");async function vf({message:i,publicKey:n,signature:a}){let u=n;return typeof n=="string"&&(u=Me(n).publicKey),no.verify(i,a,await Cr.subtle.importKey("spki",re(u),{name:kr,hash:mt},!1,["verify"]),8)}c(vf,"rsaVerify");var no={verify:c(async function(n,a,u,d=Te,v=vt){return Cr.subtle.verify({name:kr,saltLength:Et},typeof u=="string"?await St(u,v,"signing"):u,lf(a),Ce(n,d))},"rsaVerify"),sign:c(async function(n,a,u=Te){return Cr.subtle.sign({name:kr,saltLength:Et},a,Ce(n,u))},"sign"),encrypt:c(async function(n,a,u=Te,d=vt){let v;return typeof a=="string"?v=await St(a,d,"exchange"):v=a instanceof Uint8Array?await St(re(a),d,"exchange"):a,Cr.subtle.encrypt({name:Qr},v,Ce(n,u))},"rsaEncrypt"),decrypt:c(async function(n,a){let u=so(a)?a:await xo(a,["decrypt"]),d;typeof n=="string"?d=Nr(n,"base64pad"):d=n;let v=await Cr.subtle.decrypt({name:Qr},u,d instanceof Uint8Array?re(d):d);return new Uint8Array(v)},"rsaDecrypt")};async function St(i,n,a){oo(a);let u=a==="exchange"?Qr:kr,d=a==="exchange"?["encrypt"]:["verify"],v=typeof i=="string"?_t(ao(i)):i;return Cr.subtle.importKey("spki",v,{name:u,hash:{name:n}},!0,d)}c(St,"importPublicKey");function oo(i){io(i,["signing","exchange"],bf)}c(oo,"checkValidKeyUse");function io(i,n,a){if(!n.some(d=>d===i))throw a}c(io,"checkValid");function ao(i){return i.replace(`-----BEGIN PUBLIC KEY-----
|
|
1
|
+
var Df=Object.create;var oe=Object.defineProperty;var If=Object.getOwnPropertyDescriptor;var Lf=Object.getOwnPropertyNames;var Pf=Object.getPrototypeOf,Rf=Object.prototype.hasOwnProperty;var Kf=(i,n,a)=>n in i?oe(i,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[n]=a;var c=(i,n)=>oe(i,"name",{value:n,configurable:!0}),Ft=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(n,a)=>(typeof require<"u"?require:n)[a]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Gt=(i,n)=>()=>(n||i((n={exports:{}}).exports,n),n.exports),_r=(i,n)=>{for(var a in n)oe(i,a,{get:n[a],enumerable:!0})},zf=(i,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let d of Lf(n))!Rf.call(i,d)&&d!==a&&oe(i,d,{get:()=>n[d],enumerable:!(u=If(n,d))||u.enumerable});return i};var Nf=(i,n,a)=>(a=i!=null?Df(Pf(i)):{},zf(n||!i||!i.__esModule?oe(a,"default",{value:i,enumerable:!0}):a,i));var Q=(i,n,a)=>Kf(i,typeof n!="symbol"?n+"":n,a);var yf=Gt(()=>{"use strict"});var df=Gt((Q0,Be)=>{"use strict";(function(i){"use strict";var n=c(function(e){var f,t=new Float64Array(16);if(e)for(f=0;f<e.length;f++)t[f]=e[f];return t},"gf"),a=c(function(){throw new Error("no PRNG")},"randombytes"),u=new Uint8Array(16),d=new Uint8Array(32);d[0]=9;var v=n(),V=n([1]),er=n([56129,1]),cr=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Rr=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),br=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Dr=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Hr=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function pe(e,f,t,r){e[f]=t>>24&255,e[f+1]=t>>16&255,e[f+2]=t>>8&255,e[f+3]=t&255,e[f+4]=r>>24&255,e[f+5]=r>>16&255,e[f+6]=r>>8&255,e[f+7]=r&255}c(pe,"ts64");function k(e,f,t,r,o){var x,h=0;for(x=0;x<o;x++)h|=e[f+x]^t[r+x];return(1&h-1>>>8)-1}c(k,"vn");function hr(e,f,t,r){return k(e,f,t,r,16)}c(hr,"crypto_verify_16");function Ur(e,f,t,r){return k(e,f,t,r,32)}c(Ur,"crypto_verify_32");function wr(e,f,t,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,_=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,Z=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,L=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,P=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,O=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,N=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,R=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,z=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,K=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=o,D=x,U=h,T=l,C=m,E=M,p=_,y=Z,w=S,b=L,g=P,A=O,I=N,Y=R,H=z,j=K,s,G=0;G<20;G+=2)s=B+I|0,C^=s<<7|s>>>25,s=C+B|0,w^=s<<9|s>>>23,s=w+C|0,I^=s<<13|s>>>19,s=I+w|0,B^=s<<18|s>>>14,s=E+D|0,b^=s<<7|s>>>25,s=b+E|0,Y^=s<<9|s>>>23,s=Y+b|0,D^=s<<13|s>>>19,s=D+Y|0,E^=s<<18|s>>>14,s=g+p|0,H^=s<<7|s>>>25,s=H+g|0,U^=s<<9|s>>>23,s=U+H|0,p^=s<<13|s>>>19,s=p+U|0,g^=s<<18|s>>>14,s=j+A|0,T^=s<<7|s>>>25,s=T+j|0,y^=s<<9|s>>>23,s=y+T|0,A^=s<<13|s>>>19,s=A+y|0,j^=s<<18|s>>>14,s=B+T|0,D^=s<<7|s>>>25,s=D+B|0,U^=s<<9|s>>>23,s=U+D|0,T^=s<<13|s>>>19,s=T+U|0,B^=s<<18|s>>>14,s=E+C|0,p^=s<<7|s>>>25,s=p+E|0,y^=s<<9|s>>>23,s=y+p|0,C^=s<<13|s>>>19,s=C+y|0,E^=s<<18|s>>>14,s=g+b|0,A^=s<<7|s>>>25,s=A+g|0,w^=s<<9|s>>>23,s=w+A|0,b^=s<<13|s>>>19,s=b+w|0,g^=s<<18|s>>>14,s=j+H|0,I^=s<<7|s>>>25,s=I+j|0,Y^=s<<9|s>>>23,s=Y+I|0,H^=s<<13|s>>>19,s=H+Y|0,j^=s<<18|s>>>14;B=B+o|0,D=D+x|0,U=U+h|0,T=T+l|0,C=C+m|0,E=E+M|0,p=p+_|0,y=y+Z|0,w=w+S|0,b=b+L|0,g=g+P|0,A=A+O|0,I=I+N|0,Y=Y+R|0,H=H+z|0,j=j+K|0,e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=D>>>0&255,e[5]=D>>>8&255,e[6]=D>>>16&255,e[7]=D>>>24&255,e[8]=U>>>0&255,e[9]=U>>>8&255,e[10]=U>>>16&255,e[11]=U>>>24&255,e[12]=T>>>0&255,e[13]=T>>>8&255,e[14]=T>>>16&255,e[15]=T>>>24&255,e[16]=C>>>0&255,e[17]=C>>>8&255,e[18]=C>>>16&255,e[19]=C>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=y>>>0&255,e[29]=y>>>8&255,e[30]=y>>>16&255,e[31]=y>>>24&255,e[32]=w>>>0&255,e[33]=w>>>8&255,e[34]=w>>>16&255,e[35]=w>>>24&255,e[36]=b>>>0&255,e[37]=b>>>8&255,e[38]=b>>>16&255,e[39]=b>>>24&255,e[40]=g>>>0&255,e[41]=g>>>8&255,e[42]=g>>>16&255,e[43]=g>>>24&255,e[44]=A>>>0&255,e[45]=A>>>8&255,e[46]=A>>>16&255,e[47]=A>>>24&255,e[48]=I>>>0&255,e[49]=I>>>8&255,e[50]=I>>>16&255,e[51]=I>>>24&255,e[52]=Y>>>0&255,e[53]=Y>>>8&255,e[54]=Y>>>16&255,e[55]=Y>>>24&255,e[56]=H>>>0&255,e[57]=H>>>8&255,e[58]=H>>>16&255,e[59]=H>>>24&255,e[60]=j>>>0&255,e[61]=j>>>8&255,e[62]=j>>>16&255,e[63]=j>>>24&255}c(wr,"core_salsa20");function mr(e,f,t,r){for(var o=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,x=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,l=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,M=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,_=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,Z=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,L=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,P=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,O=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,N=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,R=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,z=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,K=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,B=o,D=x,U=h,T=l,C=m,E=M,p=_,y=Z,w=S,b=L,g=P,A=O,I=N,Y=R,H=z,j=K,s,G=0;G<20;G+=2)s=B+I|0,C^=s<<7|s>>>25,s=C+B|0,w^=s<<9|s>>>23,s=w+C|0,I^=s<<13|s>>>19,s=I+w|0,B^=s<<18|s>>>14,s=E+D|0,b^=s<<7|s>>>25,s=b+E|0,Y^=s<<9|s>>>23,s=Y+b|0,D^=s<<13|s>>>19,s=D+Y|0,E^=s<<18|s>>>14,s=g+p|0,H^=s<<7|s>>>25,s=H+g|0,U^=s<<9|s>>>23,s=U+H|0,p^=s<<13|s>>>19,s=p+U|0,g^=s<<18|s>>>14,s=j+A|0,T^=s<<7|s>>>25,s=T+j|0,y^=s<<9|s>>>23,s=y+T|0,A^=s<<13|s>>>19,s=A+y|0,j^=s<<18|s>>>14,s=B+T|0,D^=s<<7|s>>>25,s=D+B|0,U^=s<<9|s>>>23,s=U+D|0,T^=s<<13|s>>>19,s=T+U|0,B^=s<<18|s>>>14,s=E+C|0,p^=s<<7|s>>>25,s=p+E|0,y^=s<<9|s>>>23,s=y+p|0,C^=s<<13|s>>>19,s=C+y|0,E^=s<<18|s>>>14,s=g+b|0,A^=s<<7|s>>>25,s=A+g|0,w^=s<<9|s>>>23,s=w+A|0,b^=s<<13|s>>>19,s=b+w|0,g^=s<<18|s>>>14,s=j+H|0,I^=s<<7|s>>>25,s=I+j|0,Y^=s<<9|s>>>23,s=Y+I|0,H^=s<<13|s>>>19,s=H+Y|0,j^=s<<18|s>>>14;e[0]=B>>>0&255,e[1]=B>>>8&255,e[2]=B>>>16&255,e[3]=B>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=j>>>0&255,e[13]=j>>>8&255,e[14]=j>>>16&255,e[15]=j>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=y>>>0&255,e[21]=y>>>8&255,e[22]=y>>>16&255,e[23]=y>>>24&255,e[24]=w>>>0&255,e[25]=w>>>8&255,e[26]=w>>>16&255,e[27]=w>>>24&255,e[28]=b>>>0&255,e[29]=b>>>8&255,e[30]=b>>>16&255,e[31]=b>>>24&255}c(mr,"core_hsalsa20");function lr(e,f,t,r){wr(e,f,t,r)}c(lr,"crypto_core_salsa20");function ur(e,f,t,r){mr(e,f,t,r)}c(ur,"crypto_core_hsalsa20");var sr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Sr(e,f,t,r,o,x,h){var l=new Uint8Array(16),m=new Uint8Array(64),M,_;for(_=0;_<16;_++)l[_]=0;for(_=0;_<8;_++)l[_]=x[_];for(;o>=64;){for(lr(m,l,h,sr),_=0;_<64;_++)e[f+_]=t[r+_]^m[_];for(M=1,_=8;_<16;_++)M=M+(l[_]&255)|0,l[_]=M&255,M>>>=8;o-=64,f+=64,r+=64}if(o>0)for(lr(m,l,h,sr),_=0;_<o;_++)e[f+_]=t[r+_]^m[_];return 0}c(Sr,"crypto_stream_salsa20_xor");function gr(e,f,t,r,o){var x=new Uint8Array(16),h=new Uint8Array(64),l,m;for(m=0;m<16;m++)x[m]=0;for(m=0;m<8;m++)x[m]=r[m];for(;t>=64;){for(lr(h,x,o,sr),m=0;m<64;m++)e[f+m]=h[m];for(l=1,m=8;m<16;m++)l=l+(x[m]&255)|0,x[m]=l&255,l>>>=8;t-=64,f+=64}if(t>0)for(lr(h,x,o,sr),m=0;m<t;m++)e[f+m]=h[m];return 0}c(gr,"crypto_stream_salsa20");function vr(e,f,t,r,o){var x=new Uint8Array(32);ur(x,r,o,sr);for(var h=new Uint8Array(8),l=0;l<8;l++)h[l]=r[l+16];return gr(e,f,t,h,x)}c(vr,"crypto_stream");function Kr(e,f,t,r,o,x,h){var l=new Uint8Array(32);ur(l,x,h,sr);for(var m=new Uint8Array(8),M=0;M<8;M++)m[M]=x[M+16];return Sr(e,f,t,r,o,m,l)}c(Kr,"crypto_stream_xor");var ye=c(function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var f,t,r,o,x,h,l,m;f=e[0]&255|(e[1]&255)<<8,this.r[0]=f&8191,t=e[2]&255|(e[3]&255)<<8,this.r[1]=(f>>>13|t<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(t>>>10|r<<6)&7939,o=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|o<<9)&8191,x=e[8]&255|(e[9]&255)<<8,this.r[4]=(o>>>4|x<<12)&255,this.r[5]=x>>>1&8190,h=e[10]&255|(e[11]&255)<<8,this.r[6]=(x>>>14|h<<2)&8191,l=e[12]&255|(e[13]&255)<<8,this.r[7]=(h>>>11|l<<5)&8065,m=e[14]&255|(e[15]&255)<<8,this.r[8]=(l>>>8|m<<8)&8191,this.r[9]=m>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8},"poly1305");ye.prototype.blocks=function(e,f,t){for(var r=this.fin?0:2048,o,x,h,l,m,M,_,Z,S,L,P,O,N,R,z,K,B,D,U,T=this.h[0],C=this.h[1],E=this.h[2],p=this.h[3],y=this.h[4],w=this.h[5],b=this.h[6],g=this.h[7],A=this.h[8],I=this.h[9],Y=this.r[0],H=this.r[1],j=this.r[2],s=this.r[3],G=this.r[4],W=this.r[5],J=this.r[6],F=this.r[7],$=this.r[8],q=this.r[9];t>=16;)o=e[f+0]&255|(e[f+1]&255)<<8,T+=o&8191,x=e[f+2]&255|(e[f+3]&255)<<8,C+=(o>>>13|x<<3)&8191,h=e[f+4]&255|(e[f+5]&255)<<8,E+=(x>>>10|h<<6)&8191,l=e[f+6]&255|(e[f+7]&255)<<8,p+=(h>>>7|l<<9)&8191,m=e[f+8]&255|(e[f+9]&255)<<8,y+=(l>>>4|m<<12)&8191,w+=m>>>1&8191,M=e[f+10]&255|(e[f+11]&255)<<8,b+=(m>>>14|M<<2)&8191,_=e[f+12]&255|(e[f+13]&255)<<8,g+=(M>>>11|_<<5)&8191,Z=e[f+14]&255|(e[f+15]&255)<<8,A+=(_>>>8|Z<<8)&8191,I+=Z>>>5|r,S=0,L=S,L+=T*Y,L+=C*(5*q),L+=E*(5*$),L+=p*(5*F),L+=y*(5*J),S=L>>>13,L&=8191,L+=w*(5*W),L+=b*(5*G),L+=g*(5*s),L+=A*(5*j),L+=I*(5*H),S+=L>>>13,L&=8191,P=S,P+=T*H,P+=C*Y,P+=E*(5*q),P+=p*(5*$),P+=y*(5*F),S=P>>>13,P&=8191,P+=w*(5*J),P+=b*(5*W),P+=g*(5*G),P+=A*(5*s),P+=I*(5*j),S+=P>>>13,P&=8191,O=S,O+=T*j,O+=C*H,O+=E*Y,O+=p*(5*q),O+=y*(5*$),S=O>>>13,O&=8191,O+=w*(5*F),O+=b*(5*J),O+=g*(5*W),O+=A*(5*G),O+=I*(5*s),S+=O>>>13,O&=8191,N=S,N+=T*s,N+=C*j,N+=E*H,N+=p*Y,N+=y*(5*q),S=N>>>13,N&=8191,N+=w*(5*$),N+=b*(5*F),N+=g*(5*J),N+=A*(5*W),N+=I*(5*G),S+=N>>>13,N&=8191,R=S,R+=T*G,R+=C*s,R+=E*j,R+=p*H,R+=y*Y,S=R>>>13,R&=8191,R+=w*(5*q),R+=b*(5*$),R+=g*(5*F),R+=A*(5*J),R+=I*(5*W),S+=R>>>13,R&=8191,z=S,z+=T*W,z+=C*G,z+=E*s,z+=p*j,z+=y*H,S=z>>>13,z&=8191,z+=w*Y,z+=b*(5*q),z+=g*(5*$),z+=A*(5*F),z+=I*(5*J),S+=z>>>13,z&=8191,K=S,K+=T*J,K+=C*W,K+=E*G,K+=p*s,K+=y*j,S=K>>>13,K&=8191,K+=w*H,K+=b*Y,K+=g*(5*q),K+=A*(5*$),K+=I*(5*F),S+=K>>>13,K&=8191,B=S,B+=T*F,B+=C*J,B+=E*W,B+=p*G,B+=y*s,S=B>>>13,B&=8191,B+=w*j,B+=b*H,B+=g*Y,B+=A*(5*q),B+=I*(5*$),S+=B>>>13,B&=8191,D=S,D+=T*$,D+=C*F,D+=E*J,D+=p*W,D+=y*G,S=D>>>13,D&=8191,D+=w*s,D+=b*j,D+=g*H,D+=A*Y,D+=I*(5*q),S+=D>>>13,D&=8191,U=S,U+=T*q,U+=C*$,U+=E*F,U+=p*J,U+=y*W,S=U>>>13,U&=8191,U+=w*G,U+=b*s,U+=g*j,U+=A*H,U+=I*Y,S+=U>>>13,U&=8191,S=(S<<2)+S|0,S=S+L|0,L=S&8191,S=S>>>13,P+=S,T=L,C=P,E=O,p=N,y=R,w=z,b=K,g=B,A=D,I=U,f+=16,t-=16;this.h[0]=T,this.h[1]=C,this.h[2]=E,this.h[3]=p,this.h[4]=y,this.h[5]=w,this.h[6]=b,this.h[7]=g,this.h[8]=A,this.h[9]=I},ye.prototype.finish=function(e,f){var t=new Uint16Array(10),r,o,x,h;if(this.leftover){for(h=this.leftover,this.buffer[h++]=1;h<16;h++)this.buffer[h]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,h=2;h<10;h++)this.h[h]+=r,r=this.h[h]>>>13,this.h[h]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,t[0]=this.h[0]+5,r=t[0]>>>13,t[0]&=8191,h=1;h<10;h++)t[h]=this.h[h]+r,r=t[h]>>>13,t[h]&=8191;for(t[9]-=8192,o=(r^1)-1,h=0;h<10;h++)t[h]&=o;for(o=~o,h=0;h<10;h++)this.h[h]=this.h[h]&o|t[h];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,h=1;h<8;h++)x=(this.h[h]+this.pad[h]|0)+(x>>>16)|0,this.h[h]=x&65535;e[f+0]=this.h[0]>>>0&255,e[f+1]=this.h[0]>>>8&255,e[f+2]=this.h[1]>>>0&255,e[f+3]=this.h[1]>>>8&255,e[f+4]=this.h[2]>>>0&255,e[f+5]=this.h[2]>>>8&255,e[f+6]=this.h[3]>>>0&255,e[f+7]=this.h[3]>>>8&255,e[f+8]=this.h[4]>>>0&255,e[f+9]=this.h[4]>>>8&255,e[f+10]=this.h[5]>>>0&255,e[f+11]=this.h[5]>>>8&255,e[f+12]=this.h[6]>>>0&255,e[f+13]=this.h[6]>>>8&255,e[f+14]=this.h[7]>>>0&255,e[f+15]=this.h[7]>>>8&255},ye.prototype.update=function(e,f,t){var r,o;if(this.leftover){for(o=16-this.leftover,o>t&&(o=t),r=0;r<o;r++)this.buffer[this.leftover+r]=e[f+r];if(t-=o,f+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(t>=16&&(o=t-t%16,this.blocks(e,f,o),f+=o,t-=o),t){for(r=0;r<t;r++)this.buffer[this.leftover+r]=e[f+r];this.leftover+=t}};function De(e,f,t,r,o,x){var h=new ye(x);return h.update(t,r,o),h.finish(e,f),0}c(De,"crypto_onetimeauth");function Ct(e,f,t,r,o,x){var h=new Uint8Array(16);return De(h,0,t,r,o,x),hr(e,f,h,0)}c(Ct,"crypto_onetimeauth_verify");function Ie(e,f,t,r,o){var x;if(t<32)return-1;for(Kr(e,0,f,0,t,r,o),De(e,16,e,32,t-32,e),x=0;x<16;x++)e[x]=0;return 0}c(Ie,"crypto_secretbox");function Le(e,f,t,r,o){var x,h=new Uint8Array(32);if(t<32||(vr(h,0,32,r,o),Ct(f,16,f,32,t-32,h)!==0))return-1;for(Kr(e,0,f,0,t,r,o),x=0;x<32;x++)e[x]=0;return 0}c(Le,"crypto_secretbox_open");function Ir(e,f){var t;for(t=0;t<16;t++)e[t]=f[t]|0}c(Ir,"set25519");function Pe(e){var f,t,r=1;for(f=0;f<16;f++)t=e[f]+r+65535,r=Math.floor(t/65536),e[f]=t-r*65536;e[0]+=r-1+37*(r-1)}c(Pe,"car25519");function Fr(e,f,t){for(var r,o=~(t-1),x=0;x<16;x++)r=o&(e[x]^f[x]),e[x]^=r,f[x]^=r}c(Fr,"sel25519");function Gr(e,f){var t,r,o,x=n(),h=n();for(t=0;t<16;t++)h[t]=f[t];for(Pe(h),Pe(h),Pe(h),r=0;r<2;r++){for(x[0]=h[0]-65517,t=1;t<15;t++)x[t]=h[t]-65535-(x[t-1]>>16&1),x[t-1]&=65535;x[15]=h[15]-32767-(x[14]>>16&1),o=x[15]>>16&1,x[14]&=65535,Fr(h,x,1-o)}for(t=0;t<16;t++)e[2*t]=h[t]&255,e[2*t+1]=h[t]>>8}c(Gr,"pack25519");function Mt(e,f){var t=new Uint8Array(32),r=new Uint8Array(32);return Gr(t,e),Gr(r,f),Ur(t,0,r,0)}c(Mt,"neq25519");function Dt(e){var f=new Uint8Array(32);return Gr(f,e),f[0]&1}c(Dt,"par25519");function Re(e,f){var t;for(t=0;t<16;t++)e[t]=f[2*t]+(f[2*t+1]<<8);e[15]&=32767}c(Re,"unpack25519");function Br(e,f,t){for(var r=0;r<16;r++)e[r]=f[r]+t[r]}c(Br,"A");function Tr(e,f,t){for(var r=0;r<16;r++)e[r]=f[r]-t[r]}c(Tr,"Z");function X(e,f,t){var r,o,x=0,h=0,l=0,m=0,M=0,_=0,Z=0,S=0,L=0,P=0,O=0,N=0,R=0,z=0,K=0,B=0,D=0,U=0,T=0,C=0,E=0,p=0,y=0,w=0,b=0,g=0,A=0,I=0,Y=0,H=0,j=0,s=t[0],G=t[1],W=t[2],J=t[3],F=t[4],$=t[5],q=t[6],ir=t[7],rr=t[8],tr=t[9],fr=t[10],nr=t[11],ar=t[12],pr=t[13],yr=t[14],dr=t[15];r=f[0],x+=r*s,h+=r*G,l+=r*W,m+=r*J,M+=r*F,_+=r*$,Z+=r*q,S+=r*ir,L+=r*rr,P+=r*tr,O+=r*fr,N+=r*nr,R+=r*ar,z+=r*pr,K+=r*yr,B+=r*dr,r=f[1],h+=r*s,l+=r*G,m+=r*W,M+=r*J,_+=r*F,Z+=r*$,S+=r*q,L+=r*ir,P+=r*rr,O+=r*tr,N+=r*fr,R+=r*nr,z+=r*ar,K+=r*pr,B+=r*yr,D+=r*dr,r=f[2],l+=r*s,m+=r*G,M+=r*W,_+=r*J,Z+=r*F,S+=r*$,L+=r*q,P+=r*ir,O+=r*rr,N+=r*tr,R+=r*fr,z+=r*nr,K+=r*ar,B+=r*pr,D+=r*yr,U+=r*dr,r=f[3],m+=r*s,M+=r*G,_+=r*W,Z+=r*J,S+=r*F,L+=r*$,P+=r*q,O+=r*ir,N+=r*rr,R+=r*tr,z+=r*fr,K+=r*nr,B+=r*ar,D+=r*pr,U+=r*yr,T+=r*dr,r=f[4],M+=r*s,_+=r*G,Z+=r*W,S+=r*J,L+=r*F,P+=r*$,O+=r*q,N+=r*ir,R+=r*rr,z+=r*tr,K+=r*fr,B+=r*nr,D+=r*ar,U+=r*pr,T+=r*yr,C+=r*dr,r=f[5],_+=r*s,Z+=r*G,S+=r*W,L+=r*J,P+=r*F,O+=r*$,N+=r*q,R+=r*ir,z+=r*rr,K+=r*tr,B+=r*fr,D+=r*nr,U+=r*ar,T+=r*pr,C+=r*yr,E+=r*dr,r=f[6],Z+=r*s,S+=r*G,L+=r*W,P+=r*J,O+=r*F,N+=r*$,R+=r*q,z+=r*ir,K+=r*rr,B+=r*tr,D+=r*fr,U+=r*nr,T+=r*ar,C+=r*pr,E+=r*yr,p+=r*dr,r=f[7],S+=r*s,L+=r*G,P+=r*W,O+=r*J,N+=r*F,R+=r*$,z+=r*q,K+=r*ir,B+=r*rr,D+=r*tr,U+=r*fr,T+=r*nr,C+=r*ar,E+=r*pr,p+=r*yr,y+=r*dr,r=f[8],L+=r*s,P+=r*G,O+=r*W,N+=r*J,R+=r*F,z+=r*$,K+=r*q,B+=r*ir,D+=r*rr,U+=r*tr,T+=r*fr,C+=r*nr,E+=r*ar,p+=r*pr,y+=r*yr,w+=r*dr,r=f[9],P+=r*s,O+=r*G,N+=r*W,R+=r*J,z+=r*F,K+=r*$,B+=r*q,D+=r*ir,U+=r*rr,T+=r*tr,C+=r*fr,E+=r*nr,p+=r*ar,y+=r*pr,w+=r*yr,b+=r*dr,r=f[10],O+=r*s,N+=r*G,R+=r*W,z+=r*J,K+=r*F,B+=r*$,D+=r*q,U+=r*ir,T+=r*rr,C+=r*tr,E+=r*fr,p+=r*nr,y+=r*ar,w+=r*pr,b+=r*yr,g+=r*dr,r=f[11],N+=r*s,R+=r*G,z+=r*W,K+=r*J,B+=r*F,D+=r*$,U+=r*q,T+=r*ir,C+=r*rr,E+=r*tr,p+=r*fr,y+=r*nr,w+=r*ar,b+=r*pr,g+=r*yr,A+=r*dr,r=f[12],R+=r*s,z+=r*G,K+=r*W,B+=r*J,D+=r*F,U+=r*$,T+=r*q,C+=r*ir,E+=r*rr,p+=r*tr,y+=r*fr,w+=r*nr,b+=r*ar,g+=r*pr,A+=r*yr,I+=r*dr,r=f[13],z+=r*s,K+=r*G,B+=r*W,D+=r*J,U+=r*F,T+=r*$,C+=r*q,E+=r*ir,p+=r*rr,y+=r*tr,w+=r*fr,b+=r*nr,g+=r*ar,A+=r*pr,I+=r*yr,Y+=r*dr,r=f[14],K+=r*s,B+=r*G,D+=r*W,U+=r*J,T+=r*F,C+=r*$,E+=r*q,p+=r*ir,y+=r*rr,w+=r*tr,b+=r*fr,g+=r*nr,A+=r*ar,I+=r*pr,Y+=r*yr,H+=r*dr,r=f[15],B+=r*s,D+=r*G,U+=r*W,T+=r*J,C+=r*F,E+=r*$,p+=r*q,y+=r*ir,w+=r*rr,b+=r*tr,g+=r*fr,A+=r*nr,I+=r*ar,Y+=r*pr,H+=r*yr,j+=r*dr,x+=38*D,h+=38*U,l+=38*T,m+=38*C,M+=38*E,_+=38*p,Z+=38*y,S+=38*w,L+=38*b,P+=38*g,O+=38*A,N+=38*I,R+=38*Y,z+=38*H,K+=38*j,o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=h+o+65535,o=Math.floor(r/65536),h=r-o*65536,r=l+o+65535,o=Math.floor(r/65536),l=r-o*65536,r=m+o+65535,o=Math.floor(r/65536),m=r-o*65536,r=M+o+65535,o=Math.floor(r/65536),M=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,r=Z+o+65535,o=Math.floor(r/65536),Z=r-o*65536,r=S+o+65535,o=Math.floor(r/65536),S=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=P+o+65535,o=Math.floor(r/65536),P=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=K+o+65535,o=Math.floor(r/65536),K=r-o*65536,r=B+o+65535,o=Math.floor(r/65536),B=r-o*65536,x+=o-1+37*(o-1),o=1,r=x+o+65535,o=Math.floor(r/65536),x=r-o*65536,r=h+o+65535,o=Math.floor(r/65536),h=r-o*65536,r=l+o+65535,o=Math.floor(r/65536),l=r-o*65536,r=m+o+65535,o=Math.floor(r/65536),m=r-o*65536,r=M+o+65535,o=Math.floor(r/65536),M=r-o*65536,r=_+o+65535,o=Math.floor(r/65536),_=r-o*65536,r=Z+o+65535,o=Math.floor(r/65536),Z=r-o*65536,r=S+o+65535,o=Math.floor(r/65536),S=r-o*65536,r=L+o+65535,o=Math.floor(r/65536),L=r-o*65536,r=P+o+65535,o=Math.floor(r/65536),P=r-o*65536,r=O+o+65535,o=Math.floor(r/65536),O=r-o*65536,r=N+o+65535,o=Math.floor(r/65536),N=r-o*65536,r=R+o+65535,o=Math.floor(r/65536),R=r-o*65536,r=z+o+65535,o=Math.floor(r/65536),z=r-o*65536,r=K+o+65535,o=Math.floor(r/65536),K=r-o*65536,r=B+o+65535,o=Math.floor(r/65536),B=r-o*65536,x+=o-1+37*(o-1),e[0]=x,e[1]=h,e[2]=l,e[3]=m,e[4]=M,e[5]=_,e[6]=Z,e[7]=S,e[8]=L,e[9]=P,e[10]=O,e[11]=N,e[12]=R,e[13]=z,e[14]=K,e[15]=B}c(X,"M");function Er(e,f){X(e,f,f)}c(Er,"S");function It(e,f){var t=n(),r;for(r=0;r<16;r++)t[r]=f[r];for(r=253;r>=0;r--)Er(t,t),r!==2&&r!==4&&X(t,t,f);for(r=0;r<16;r++)e[r]=t[r]}c(It,"inv25519");function Lt(e,f){var t=n(),r;for(r=0;r<16;r++)t[r]=f[r];for(r=250;r>=0;r--)Er(t,t),r!==1&&X(t,t,f);for(r=0;r<16;r++)e[r]=t[r]}c(Lt,"pow2523");function de(e,f,t){var r=new Uint8Array(32),o=new Float64Array(80),x,h,l=n(),m=n(),M=n(),_=n(),Z=n(),S=n();for(h=0;h<31;h++)r[h]=f[h];for(r[31]=f[31]&127|64,r[0]&=248,Re(o,t),h=0;h<16;h++)m[h]=o[h],_[h]=l[h]=M[h]=0;for(l[0]=_[0]=1,h=254;h>=0;--h)x=r[h>>>3]>>>(h&7)&1,Fr(l,m,x),Fr(M,_,x),Br(Z,l,M),Tr(l,l,M),Br(M,m,_),Tr(m,m,_),Er(_,Z),Er(S,l),X(l,M,l),X(M,m,Z),Br(Z,l,M),Tr(l,l,M),Er(m,l),Tr(M,_,S),X(l,M,er),Br(l,l,_),X(M,M,l),X(l,_,S),X(_,m,o),Er(m,Z),Fr(l,m,x),Fr(M,_,x);for(h=0;h<16;h++)o[h+16]=l[h],o[h+32]=M[h],o[h+48]=m[h],o[h+64]=_[h];var L=o.subarray(32),P=o.subarray(16);return It(L,L),X(P,P,L),Gr(e,P),0}c(de,"crypto_scalarmult");function be(e,f){return de(e,f,d)}c(be,"crypto_scalarmult_base");function Pt(e,f){return a(f,32),be(e,f)}c(Pt,"crypto_box_keypair");function le(e,f,t){var r=new Uint8Array(32);return de(r,t,f),ur(e,u,r,sr)}c(le,"crypto_box_beforenm");var Rt=Ie,_f=Le;function Uf(e,f,t,r,o,x){var h=new Uint8Array(32);return le(h,o,x),Rt(e,f,t,r,h)}c(Uf,"crypto_box");function Sf(e,f,t,r,o,x){var h=new Uint8Array(32);return le(h,o,x),_f(e,f,t,r,h)}c(Sf,"crypto_box_open");var Kt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function zt(e,f,t,r){for(var o=new Int32Array(16),x=new Int32Array(16),h,l,m,M,_,Z,S,L,P,O,N,R,z,K,B,D,U,T,C,E,p,y,w,b,g,A,I=e[0],Y=e[1],H=e[2],j=e[3],s=e[4],G=e[5],W=e[6],J=e[7],F=f[0],$=f[1],q=f[2],ir=f[3],rr=f[4],tr=f[5],fr=f[6],nr=f[7],ar=0;r>=128;){for(C=0;C<16;C++)E=8*C+ar,o[C]=t[E+0]<<24|t[E+1]<<16|t[E+2]<<8|t[E+3],x[C]=t[E+4]<<24|t[E+5]<<16|t[E+6]<<8|t[E+7];for(C=0;C<80;C++)if(h=I,l=Y,m=H,M=j,_=s,Z=G,S=W,L=J,P=F,O=$,N=q,R=ir,z=rr,K=tr,B=fr,D=nr,p=J,y=nr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=(s>>>14|rr<<18)^(s>>>18|rr<<14)^(rr>>>9|s<<23),y=(rr>>>14|s<<18)^(rr>>>18|s<<14)^(s>>>9|rr<<23),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=s&G^~s&W,y=rr&tr^~rr&fr,w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=Kt[C*2],y=Kt[C*2+1],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=o[C%16],y=x[C%16],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,U=g&65535|A<<16,T=w&65535|b<<16,p=U,y=T,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=(I>>>28|F<<4)^(F>>>2|I<<30)^(F>>>7|I<<25),y=(F>>>28|I<<4)^(I>>>2|F<<30)^(I>>>7|F<<25),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,p=I&Y^I&H^Y&H,y=F&$^F&q^$&q,w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,L=g&65535|A<<16,D=w&65535|b<<16,p=M,y=R,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=U,y=T,w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,M=g&65535|A<<16,R=w&65535|b<<16,Y=h,H=l,j=m,s=M,G=_,W=Z,J=S,I=L,$=P,q=O,ir=N,rr=R,tr=z,fr=K,nr=B,F=D,C%16===15)for(E=0;E<16;E++)p=o[E],y=x[E],w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=o[(E+9)%16],y=x[(E+9)%16],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,U=o[(E+1)%16],T=x[(E+1)%16],p=(U>>>1|T<<31)^(U>>>8|T<<24)^U>>>7,y=(T>>>1|U<<31)^(T>>>8|U<<24)^(T>>>7|U<<25),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,U=o[(E+14)%16],T=x[(E+14)%16],p=(U>>>19|T<<13)^(T>>>29|U<<3)^U>>>6,y=(T>>>19|U<<13)^(U>>>29|T<<3)^(T>>>6|U<<26),w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,o[E]=g&65535|A<<16,x[E]=w&65535|b<<16;p=I,y=F,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[0],y=f[0],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[0]=I=g&65535|A<<16,f[0]=F=w&65535|b<<16,p=Y,y=$,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[1],y=f[1],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[1]=Y=g&65535|A<<16,f[1]=$=w&65535|b<<16,p=H,y=q,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[2],y=f[2],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[2]=H=g&65535|A<<16,f[2]=q=w&65535|b<<16,p=j,y=ir,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[3],y=f[3],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[3]=j=g&65535|A<<16,f[3]=ir=w&65535|b<<16,p=s,y=rr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[4],y=f[4],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[4]=s=g&65535|A<<16,f[4]=rr=w&65535|b<<16,p=G,y=tr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[5],y=f[5],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[5]=G=g&65535|A<<16,f[5]=tr=w&65535|b<<16,p=W,y=fr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[6],y=f[6],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[6]=W=g&65535|A<<16,f[6]=fr=w&65535|b<<16,p=J,y=nr,w=y&65535,b=y>>>16,g=p&65535,A=p>>>16,p=e[7],y=f[7],w+=y&65535,b+=y>>>16,g+=p&65535,A+=p>>>16,b+=w>>>16,g+=b>>>16,A+=g>>>16,e[7]=J=g&65535|A<<16,f[7]=nr=w&65535|b<<16,ar+=128,r-=128}return r}c(zt,"crypto_hashblocks_hl");function Or(e,f,t){var r=new Int32Array(8),o=new Int32Array(8),x=new Uint8Array(256),h,l=t;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,zt(r,o,f,t),t%=128,h=0;h<t;h++)x[h]=f[l-t+h];for(x[t]=128,t=256-128*(t<112?1:0),x[t-9]=0,pe(x,t-8,l/536870912|0,l<<3),zt(r,o,x,t),h=0;h<8;h++)pe(e,8*h,r[h],o[h]);return 0}c(Or,"crypto_hash");function ge(e,f){var t=n(),r=n(),o=n(),x=n(),h=n(),l=n(),m=n(),M=n(),_=n();Tr(t,e[1],e[0]),Tr(_,f[1],f[0]),X(t,t,_),Br(r,e[0],e[1]),Br(_,f[0],f[1]),X(r,r,_),X(o,e[3],f[3]),X(o,o,Rr),X(x,e[2],f[2]),Br(x,x,x),Tr(h,r,t),Tr(l,x,o),Br(m,x,o),Br(M,r,t),X(e[0],h,l),X(e[1],M,m),X(e[2],m,l),X(e[3],h,M)}c(ge,"add");function Nt(e,f,t){var r;for(r=0;r<4;r++)Fr(e[r],f[r],t)}c(Nt,"cswap");function Ke(e,f){var t=n(),r=n(),o=n();It(o,f[2]),X(t,f[0],o),X(r,f[1],o),Gr(e,r),e[31]^=Dt(t)<<7}c(Ke,"pack");function ze(e,f,t){var r,o;for(Ir(e[0],v),Ir(e[1],V),Ir(e[2],V),Ir(e[3],v),o=255;o>=0;--o)r=t[o/8|0]>>(o&7)&1,Nt(e,f,r),ge(f,e),ge(e,e),Nt(e,f,r)}c(ze,"scalarmult");function we(e,f){var t=[n(),n(),n(),n()];Ir(t[0],br),Ir(t[1],Dr),Ir(t[2],V),X(t[3],br,Dr),ze(e,t,f)}c(we,"scalarbase");function Ne(e,f,t){var r=new Uint8Array(64),o=[n(),n(),n(),n()],x;for(t||a(f,32),Or(r,f,32),r[0]&=248,r[31]&=127,r[31]|=64,we(o,r),Ke(e,o),x=0;x<32;x++)f[x+32]=e[x];return 0}c(Ne,"crypto_sign_keypair");var Ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Oe(e,f){var t,r,o,x;for(r=63;r>=32;--r){for(t=0,o=r-32,x=r-12;o<x;++o)f[o]+=t-16*f[r]*Ae[o-(r-32)],t=Math.floor((f[o]+128)/256),f[o]-=t*256;f[o]+=t,f[r]=0}for(t=0,o=0;o<32;o++)f[o]+=t-(f[31]>>4)*Ae[o],t=f[o]>>8,f[o]&=255;for(o=0;o<32;o++)f[o]-=t*Ae[o];for(r=0;r<32;r++)f[r+1]+=f[r]>>8,e[r]=f[r]&255}c(Oe,"modL");function Ye(e){var f=new Float64Array(64),t;for(t=0;t<64;t++)f[t]=e[t];for(t=0;t<64;t++)e[t]=0;Oe(e,f)}c(Ye,"reduce");function Ot(e,f,t,r){var o=new Uint8Array(64),x=new Uint8Array(64),h=new Uint8Array(64),l,m,M=new Float64Array(64),_=[n(),n(),n(),n()];Or(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64;var Z=t+64;for(l=0;l<t;l++)e[64+l]=f[l];for(l=0;l<32;l++)e[32+l]=o[32+l];for(Or(h,e.subarray(32),t+32),Ye(h),we(_,h),Ke(e,_),l=32;l<64;l++)e[l]=r[l];for(Or(x,e,t+64),Ye(x),l=0;l<64;l++)M[l]=0;for(l=0;l<32;l++)M[l]=h[l];for(l=0;l<32;l++)for(m=0;m<32;m++)M[l+m]+=x[l]*o[m];return Oe(e.subarray(32),M),Z}c(Ot,"crypto_sign");function Bf(e,f){var t=n(),r=n(),o=n(),x=n(),h=n(),l=n(),m=n();return Ir(e[2],V),Re(e[1],f),Er(o,e[1]),X(x,o,cr),Tr(o,o,e[2]),Br(x,e[2],x),Er(h,x),Er(l,h),X(m,l,h),X(t,m,o),X(t,t,x),Lt(t,t),X(t,t,o),X(t,t,x),X(t,t,x),X(e[0],t,x),Er(r,e[0]),X(r,r,x),Mt(r,o)&&X(e[0],e[0],Hr),Er(r,e[0]),X(r,r,x),Mt(r,o)?-1:(Dt(e[0])===f[31]>>7&&Tr(e[0],v,e[0]),X(e[3],e[0],e[1]),0)}c(Bf,"unpackneg");function je(e,f,t,r){var o,x=new Uint8Array(32),h=new Uint8Array(64),l=[n(),n(),n(),n()],m=[n(),n(),n(),n()];if(t<64||Bf(m,r))return-1;for(o=0;o<t;o++)e[o]=f[o];for(o=0;o<32;o++)e[o+32]=r[o];if(Or(h,e,t),Ye(h),ze(l,m,h),we(m,f.subarray(32)),ge(l,m),Ke(x,l),t-=64,Ur(f,0,x,0)){for(o=0;o<t;o++)e[o]=0;return-1}for(o=0;o<t;o++)e[o]=f[o+64];return t}c(je,"crypto_sign_open");var He=32,me=24,ee=32,Vr=16,te=32,ve=32,fe=32,ne=32,Fe=32,Yt=me,Tf=ee,Cf=Vr,Lr=64,Yr=32,Xr=64,Ge=32,Ve=64;i.lowlevel={crypto_core_hsalsa20:ur,crypto_stream_xor:Kr,crypto_stream:vr,crypto_stream_salsa20_xor:Sr,crypto_stream_salsa20:gr,crypto_onetimeauth:De,crypto_onetimeauth_verify:Ct,crypto_verify_16:hr,crypto_verify_32:Ur,crypto_secretbox:Ie,crypto_secretbox_open:Le,crypto_scalarmult:de,crypto_scalarmult_base:be,crypto_box_beforenm:le,crypto_box_afternm:Rt,crypto_box:Uf,crypto_box_open:Sf,crypto_box_keypair:Pt,crypto_hash:Or,crypto_sign:Ot,crypto_sign_keypair:Ne,crypto_sign_open:je,crypto_secretbox_KEYBYTES:He,crypto_secretbox_NONCEBYTES:me,crypto_secretbox_ZEROBYTES:ee,crypto_secretbox_BOXZEROBYTES:Vr,crypto_scalarmult_BYTES:te,crypto_scalarmult_SCALARBYTES:ve,crypto_box_PUBLICKEYBYTES:fe,crypto_box_SECRETKEYBYTES:ne,crypto_box_BEFORENMBYTES:Fe,crypto_box_NONCEBYTES:Yt,crypto_box_ZEROBYTES:Tf,crypto_box_BOXZEROBYTES:Cf,crypto_sign_BYTES:Lr,crypto_sign_PUBLICKEYBYTES:Yr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:Ge,crypto_hash_BYTES:Ve,gf:n,D:cr,L:Ae,pack25519:Gr,unpack25519:Re,M:X,A:Br,S:Er,Z:Tr,pow2523:Lt,add:ge,set25519:Ir,modL:Oe,scalarmult:ze,scalarbase:we};function jt(e,f){if(e.length!==He)throw new Error("bad key size");if(f.length!==me)throw new Error("bad nonce size")}c(jt,"checkLengths");function Mf(e,f){if(e.length!==fe)throw new Error("bad public key size");if(f.length!==ne)throw new Error("bad secret key size")}c(Mf,"checkBoxLengths");function Ar(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}c(Ar,"checkArrayTypes");function Ht(e){for(var f=0;f<e.length;f++)e[f]=0}c(Ht,"cleanup"),i.randomBytes=function(e){var f=new Uint8Array(e);return a(f,e),f},i.secretbox=function(e,f,t){Ar(e,f,t),jt(t,f);for(var r=new Uint8Array(ee+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+ee]=e[x];return Ie(o,r,r.length,f,t),o.subarray(Vr)},i.secretbox.open=function(e,f,t){Ar(e,f,t),jt(t,f);for(var r=new Uint8Array(Vr+e.length),o=new Uint8Array(r.length),x=0;x<e.length;x++)r[x+Vr]=e[x];return r.length<32||Le(o,r,r.length,f,t)!==0?null:o.subarray(ee)},i.secretbox.keyLength=He,i.secretbox.nonceLength=me,i.secretbox.overheadLength=Vr,i.scalarMult=function(e,f){if(Ar(e,f),e.length!==ve)throw new Error("bad n size");if(f.length!==te)throw new Error("bad p size");var t=new Uint8Array(te);return de(t,e,f),t},i.scalarMult.base=function(e){if(Ar(e),e.length!==ve)throw new Error("bad n size");var f=new Uint8Array(te);return be(f,e),f},i.scalarMult.scalarLength=ve,i.scalarMult.groupElementLength=te,i.box=function(e,f,t,r){var o=i.box.before(t,r);return i.secretbox(e,f,o)},i.box.before=function(e,f){Ar(e,f),Mf(e,f);var t=new Uint8Array(Fe);return le(t,e,f),t},i.box.after=i.secretbox,i.box.open=function(e,f,t,r){var o=i.box.before(t,r);return i.secretbox.open(e,f,o)},i.box.open.after=i.secretbox.open,i.box.keyPair=function(){var e=new Uint8Array(fe),f=new Uint8Array(ne);return Pt(e,f),{publicKey:e,secretKey:f}},i.box.keyPair.fromSecretKey=function(e){if(Ar(e),e.length!==ne)throw new Error("bad secret key size");var f=new Uint8Array(fe);return be(f,e),{publicKey:f,secretKey:new Uint8Array(e)}},i.box.publicKeyLength=fe,i.box.secretKeyLength=ne,i.box.sharedKeyLength=Fe,i.box.nonceLength=Yt,i.box.overheadLength=i.secretbox.overheadLength,i.sign=function(e,f){if(Ar(e,f),f.length!==Xr)throw new Error("bad secret key size");var t=new Uint8Array(Lr+e.length);return Ot(t,e,e.length,f),t},i.sign.open=function(e,f){if(Ar(e,f),f.length!==Yr)throw new Error("bad public key size");var t=new Uint8Array(e.length),r=je(t,e,e.length,f);if(r<0)return null;for(var o=new Uint8Array(r),x=0;x<o.length;x++)o[x]=t[x];return o},i.sign.detached=function(e,f){for(var t=i.sign(e,f),r=new Uint8Array(Lr),o=0;o<r.length;o++)r[o]=t[o];return r},i.sign.detached.verify=function(e,f,t){if(Ar(e,f,t),f.length!==Lr)throw new Error("bad signature size");if(t.length!==Yr)throw new Error("bad public key size");var r=new Uint8Array(Lr+e.length),o=new Uint8Array(Lr+e.length),x;for(x=0;x<Lr;x++)r[x]=f[x];for(x=0;x<e.length;x++)r[x+Lr]=e[x];return je(o,r,r.length,t)>=0},i.sign.keyPair=function(){var e=new Uint8Array(Yr),f=new Uint8Array(Xr);return Ne(e,f),{publicKey:e,secretKey:f}},i.sign.keyPair.fromSecretKey=function(e){if(Ar(e),e.length!==Xr)throw new Error("bad secret key size");for(var f=new Uint8Array(Yr),t=0;t<f.length;t++)f[t]=e[32+t];return{publicKey:f,secretKey:new Uint8Array(e)}},i.sign.keyPair.fromSeed=function(e){if(Ar(e),e.length!==Ge)throw new Error("bad seed size");for(var f=new Uint8Array(Yr),t=new Uint8Array(Xr),r=0;r<32;r++)t[r]=e[r];return Ne(f,t,!0),{publicKey:f,secretKey:t}},i.sign.publicKeyLength=Yr,i.sign.secretKeyLength=Xr,i.sign.seedLength=Ge,i.sign.signatureLength=Lr,i.hash=function(e){Ar(e);var f=new Uint8Array(Ve);return Or(f,e,e.length),f},i.hash.hashLength=Ve,i.verify=function(e,f){return Ar(e,f),e.length===0||f.length===0||e.length!==f.length?!1:k(e,0,f,0,e.length)===0},i.setPRNG=function(e){a=e},function(){var e=typeof self<"u"?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){var f=65536;i.setPRNG(function(t,r){var o,x=new Uint8Array(r);for(o=0;o<r;o+=f)e.getRandomValues(x.subarray(o,o+Math.min(r-o,f)));for(o=0;o<r;o++)t[o]=x[o];Ht(x)})}else typeof Ft<"u"&&(e=yf(),e&&e.randomBytes&&i.setPRNG(function(t,r){var o,x=e.randomBytes(r);for(o=0;o<r;o++)t[o]=x[o];Ht(x)}))}()})(typeof Be<"u"&&Be.exports?Be.exports:self.nacl=self.nacl||{})});var Of=globalThis||window||self,Cr=Of.crypto;function ie(i=0){return new Uint8Array(i)}c(ie,"allocUnsafe");function Xe(i,n){n==null&&(n=i.reduce((d,v)=>d+v.length,0));let a=ie(n),u=0;for(let d of i)a.set(d,u),u+=d.length;return a}c(Xe,"concat");var et={};_r(et,{base10:()=>Xf});var Co=new Uint8Array(0);function Vt(i,n){if(i===n)return!0;if(i.byteLength!==n.byteLength)return!1;for(let a=0;a<i.byteLength;a++)if(i[a]!==n[a])return!1;return!0}c(Vt,"equals");function Pr(i){if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")}c(Pr,"coerce");function Xt(i){return new TextEncoder().encode(i)}c(Xt,"fromString");function $t(i){return new TextDecoder().decode(i)}c($t,"toString");function jf(i,n){if(i.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),u=0;u<a.length;u++)a[u]=255;for(var d=0;d<i.length;d++){var v=i.charAt(d),V=v.charCodeAt(0);if(a[V]!==255)throw new TypeError(v+" is ambiguous");a[V]=d}var er=i.length,cr=i.charAt(0),Rr=Math.log(er)/Math.log(256),br=Math.log(256)/Math.log(er);function Dr(k){if(k instanceof Uint8Array||(ArrayBuffer.isView(k)?k=new Uint8Array(k.buffer,k.byteOffset,k.byteLength):Array.isArray(k)&&(k=Uint8Array.from(k))),!(k instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(k.length===0)return"";for(var hr=0,Ur=0,wr=0,mr=k.length;wr!==mr&&k[wr]===0;)wr++,hr++;for(var lr=(mr-wr)*br+1>>>0,ur=new Uint8Array(lr);wr!==mr;){for(var sr=k[wr],Sr=0,gr=lr-1;(sr!==0||Sr<Ur)&&gr!==-1;gr--,Sr++)sr+=256*ur[gr]>>>0,ur[gr]=sr%er>>>0,sr=sr/er>>>0;if(sr!==0)throw new Error("Non-zero carry");Ur=Sr,wr++}for(var vr=lr-Ur;vr!==lr&&ur[vr]===0;)vr++;for(var Kr=cr.repeat(hr);vr<lr;++vr)Kr+=i.charAt(ur[vr]);return Kr}c(Dr,"encode");function Hr(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return new Uint8Array;var hr=0;if(k[hr]!==" "){for(var Ur=0,wr=0;k[hr]===cr;)Ur++,hr++;for(var mr=(k.length-hr)*Rr+1>>>0,lr=new Uint8Array(mr);k[hr];){var ur=a[k.charCodeAt(hr)];if(ur===255)return;for(var sr=0,Sr=mr-1;(ur!==0||sr<wr)&&Sr!==-1;Sr--,sr++)ur+=er*lr[Sr]>>>0,lr[Sr]=ur%256>>>0,ur=ur/256>>>0;if(ur!==0)throw new Error("Non-zero carry");wr=sr,hr++}if(k[hr]!==" "){for(var gr=mr-wr;gr!==mr&&lr[gr]===0;)gr++;for(var vr=new Uint8Array(Ur+(mr-gr)),Kr=Ur;gr!==mr;)vr[Kr++]=lr[gr++];return vr}}}c(Hr,"decodeUnsafe");function pe(k){var hr=Hr(k);if(hr)return hr;throw new Error(`Non-${n} character`)}return c(pe,"decode"),{encode:Dr,decodeUnsafe:Hr,decode:pe}}c(jf,"base");var Hf=jf,Ff=Hf,Zt=Ff;var Je=class Je{constructor(n,a,u){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");this.name=n,this.prefix=a,this.baseEncode=u}encode(n){if(n instanceof Uint8Array)return`${this.prefix}${this.baseEncode(n)}`;throw Error("Unknown type, must be binary type")}};c(Je,"Encoder");var $e=Je,Qe=class Qe{constructor(n,a,u){Q(this,"name");Q(this,"prefix");Q(this,"baseDecode");Q(this,"prefixCodePoint");this.name=n,this.prefix=a;let d=a.codePointAt(0);if(d===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=d,this.baseDecode=u}decode(n){if(typeof n=="string"){if(n.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(n)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(n.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(n){return Wt(this,n)}};c(Qe,"Decoder");var qe=Qe,ke=class ke{constructor(n){Q(this,"decoders");this.decoders=n}or(n){return Wt(this,n)}decode(n){let a=n[0],u=this.decoders[a];if(u!=null)return u.decode(n);throw RangeError(`Unable to decode multibase string ${JSON.stringify(n)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};c(ke,"ComposedDecoder");var Ze=ke;function Wt(i,n){return new Ze({...i.decoders??{[i.prefix]:i},...n.decoders??{[n.prefix]:n}})}c(Wt,"or");var rt=class rt{constructor(n,a,u,d){Q(this,"name");Q(this,"prefix");Q(this,"baseEncode");Q(this,"baseDecode");Q(this,"encoder");Q(this,"decoder");this.name=n,this.prefix=a,this.baseEncode=u,this.baseDecode=d,this.encoder=new $e(n,a,u),this.decoder=new qe(n,a,d)}encode(n){return this.encoder.encode(n)}decode(n){return this.decoder.decode(n)}};c(rt,"Codec");var We=rt;function $r({name:i,prefix:n,encode:a,decode:u}){return new We(i,n,a,u)}c($r,"from");function zr({name:i,prefix:n,alphabet:a}){let{encode:u,decode:d}=Zt(a,i);return $r({prefix:n,name:i,encode:u,decode:c(v=>Pr(d(v)),"decode")})}c(zr,"baseX");function Gf(i,n,a,u){let d={};for(let br=0;br<n.length;++br)d[n[br]]=br;let v=i.length;for(;i[v-1]==="=";)--v;let V=new Uint8Array(v*a/8|0),er=0,cr=0,Rr=0;for(let br=0;br<v;++br){let Dr=d[i[br]];if(Dr===void 0)throw new SyntaxError(`Non-${u} character`);cr=cr<<a|Dr,er+=a,er>=8&&(er-=8,V[Rr++]=255&cr>>er)}if(er>=a||(255&cr<<8-er)!==0)throw new SyntaxError("Unexpected end of data");return V}c(Gf,"decode");function Vf(i,n,a){let u=n[n.length-1]==="=",d=(1<<a)-1,v="",V=0,er=0;for(let cr=0;cr<i.length;++cr)for(er=er<<8|i[cr],V+=8;V>a;)V-=a,v+=n[d&er>>V];if(V!==0&&(v+=n[d&er<<a-V]),u)for(;(v.length*a&7)!==0;)v+="=";return v}c(Vf,"encode");function or({name:i,prefix:n,bitsPerChar:a,alphabet:u}){return $r({prefix:n,name:i,encode(d){return Vf(d,u,a)},decode(d){return Gf(d,u,a,i)}})}c(or,"rfc4648");var Xf=zr({prefix:"9",name:"base10",alphabet:"0123456789"});var tt={};_r(tt,{base16:()=>$f,base16upper:()=>qf});var $f=or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qf=or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ft={};_r(ft,{base2:()=>Zf});var Zf=or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var nt={};_r(nt,{base256emoji:()=>rn});var Jt=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Wf=Jt.reduce((i,n,a)=>(i[a]=n,i),[]),Jf=Jt.reduce((i,n,a)=>{let u=n.codePointAt(0);if(u==null)throw new Error(`Invalid character: ${n}`);return i[u]=a,i},[]);function Qf(i){return i.reduce((n,a)=>(n+=Wf[a],n),"")}c(Qf,"encode");function kf(i){let n=[];for(let a of i){let u=a.codePointAt(0);if(u==null)throw new Error(`Invalid character: ${a}`);let d=Jf[u];if(d==null)throw new Error(`Non-base256emoji character: ${a}`);n.push(d)}return new Uint8Array(n)}c(kf,"decode");var rn=$r({prefix:"\u{1F680}",name:"base256emoji",encode:Qf,decode:kf});var ot={};_r(ot,{base32:()=>qr,base32hex:()=>nn,base32hexpad:()=>an,base32hexpadupper:()=>sn,base32hexupper:()=>on,base32pad:()=>tn,base32padupper:()=>fn,base32upper:()=>en,base32z:()=>xn});var qr=or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),en=or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),tn=or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),fn=or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),nn=or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),on=or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),an=or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sn=or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),xn=or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var it={};_r(it,{base36:()=>ae,base36upper:()=>cn});var ae=zr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),cn=zr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var at={};_r(at,{base58btc:()=>Mr,base58flickr:()=>hn});var Mr=zr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hn=zr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var st={};_r(st,{base64:()=>un,base64pad:()=>pn,base64url:()=>yn,base64urlpad:()=>dn});var un=or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pn=or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),yn=or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),dn=or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xt={};_r(xt,{base8:()=>bn});var bn=or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ct={};_r(ct,{identity:()=>ln});var ln=$r({prefix:"\0",name:"identity",encode:c(i=>$t(i),"encode"),decode:c(i=>Xt(i),"decode")});var Wo=new TextEncoder,Jo=new TextDecoder;var pt={};_r(pt,{identity:()=>Yn});var An=rf,Qt=128,mn=127,vn=~mn,En=Math.pow(2,31);function rf(i,n,a){n=n||[],a=a||0;for(var u=a;i>=En;)n[a++]=i&255|Qt,i/=128;for(;i&vn;)n[a++]=i&255|Qt,i>>>=7;return n[a]=i|0,rf.bytes=a-u+1,n}c(rf,"encode");var _n=ht,Un=128,kt=127;function ht(i,u){var a=0,u=u||0,d=0,v=u,V,er=i.length;do{if(v>=er)throw ht.bytes=0,new RangeError("Could not decode varint");V=i[v++],a+=d<28?(V&kt)<<d:(V&kt)*Math.pow(2,d),d+=7}while(V>=Un);return ht.bytes=v-u,a}c(ht,"read");var Sn=Math.pow(2,7),Bn=Math.pow(2,14),Tn=Math.pow(2,21),Cn=Math.pow(2,28),Mn=Math.pow(2,35),Dn=Math.pow(2,42),In=Math.pow(2,49),Ln=Math.pow(2,56),Pn=Math.pow(2,63),Rn=c(function(i){return i<Sn?1:i<Bn?2:i<Tn?3:i<Cn?4:i<Mn?5:i<Dn?6:i<In?7:i<Ln?8:i<Pn?9:10},"length"),Kn={encode:An,decode:_n,encodingLength:Rn},zn=Kn,se=zn;function xe(i,n=0){return[se.decode(i,n),se.decode.bytes]}c(xe,"decode");function Zr(i,n,a=0){return se.encode(i,n,a),n}c(Zr,"encodeTo");function Wr(i){return se.encodingLength(i)}c(Wr,"encodingLength");function jr(i,n){let a=n.byteLength,u=Wr(i),d=u+Wr(a),v=new Uint8Array(d+a);return Zr(i,v,0),Zr(a,v,u),v.set(n,d),new Jr(i,a,n,v)}c(jr,"create");function ef(i){let n=Pr(i),[a,u]=xe(n),[d,v]=xe(n.subarray(u)),V=n.subarray(u+v);if(V.byteLength!==d)throw new Error("Incorrect length");return new Jr(a,d,V,n)}c(ef,"decode");function tf(i,n){if(i===n)return!0;{let a=n;return i.code===a.code&&i.size===a.size&&a.bytes instanceof Uint8Array&&Vt(i.bytes,a.bytes)}}c(tf,"equals");var ut=class ut{constructor(n,a,u,d){Q(this,"code");Q(this,"size");Q(this,"digest");Q(this,"bytes");this.code=n,this.size=a,this.digest=u,this.bytes=d}};c(ut,"Digest");var Jr=ut;var ff=0,Nn="identity",nf=Pr;function On(i){return jr(ff,nf(i))}c(On,"digest");var Yn={code:ff,name:Nn,encode:nf,digest:On};var lt={};_r(lt,{sha256:()=>jn,sha512:()=>Hn});function dt({name:i,code:n,encode:a}){return new yt(i,n,a)}c(dt,"from");var bt=class bt{constructor(n,a,u){Q(this,"name");Q(this,"code");Q(this,"encode");this.name=n,this.code=a,this.encode=u}digest(n){if(n instanceof Uint8Array){let a=this.encode(n);return a instanceof Uint8Array?jr(this.code,a):a.then(u=>jr(this.code,u))}else throw Error("Unknown type, must be binary type")}};c(bt,"Hasher");var yt=bt;function af(i){return async n=>new Uint8Array(await crypto.subtle.digest(i,n))}c(af,"sha");var jn=dt({name:"sha2-256",code:18,encode:af("SHA-256")}),Hn=dt({name:"sha2-512",code:19,encode:af("SHA-512")});function sf(i,n){let{bytes:a,version:u}=i;switch(u){case 0:return Gn(a,gt(i),n??Mr.encoder);default:return Vn(a,gt(i),n??qr.encoder)}}c(sf,"format");var xf=new WeakMap;function gt(i){let n=xf.get(i);if(n==null){let a=new Map;return xf.set(i,a),a}return n}c(gt,"baseCache");var hf,xr=class xr{constructor(n,a,u,d){Q(this,"code");Q(this,"version");Q(this,"multihash");Q(this,"bytes");Q(this,"/");Q(this,hf,"CID");this.code=a,this.version=n,this.multihash=u,this.bytes=d,this["/"]=d}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:n,multihash:a}=this;if(n!==he)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(a.code!==Xn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return xr.createV0(a)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:n,digest:a}=this.multihash,u=jr(n,a);return xr.createV1(this.code,u)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(n){return xr.equals(this,n)}static equals(n,a){let u=a;return u!=null&&n.code===u.code&&n.version===u.version&&tf(n.multihash,u.multihash)}toString(n){return sf(this,n)}toJSON(){return{"/":sf(this)}}link(){return this}[(hf=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(n){if(n==null)return null;let a=n;if(a instanceof xr)return a;if(a["/"]!=null&&a["/"]===a.bytes||a.asCID===a){let{version:u,code:d,multihash:v,bytes:V}=a;return new xr(u,d,v,V??cf(u,d,v.bytes))}else if(a[$n]===!0){let{version:u,multihash:d,code:v}=a,V=ef(d);return xr.create(u,v,V)}else return null}static create(n,a,u){if(typeof a!="number")throw new Error("String codecs are no longer supported");if(!(u.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(n){case 0:{if(a!==he)throw new Error(`Version 0 CID must use dag-pb (code: ${he}) block encoding`);return new xr(n,a,u,u.bytes)}case 1:{let d=cf(n,a,u.bytes);return new xr(n,a,u,d)}default:throw new Error("Invalid version")}}static createV0(n){return xr.create(0,he,n)}static createV1(n,a){return xr.create(1,n,a)}static decode(n){let[a,u]=xr.decodeFirst(n);if(u.length!==0)throw new Error("Incorrect length");return a}static decodeFirst(n){let a=xr.inspectBytes(n),u=a.size-a.multihashSize,d=Pr(n.subarray(u,u+a.multihashSize));if(d.byteLength!==a.multihashSize)throw new Error("Incorrect length");let v=d.subarray(a.multihashSize-a.digestSize),V=new Jr(a.multihashCode,a.digestSize,v,d);return[a.version===0?xr.createV0(V):xr.createV1(a.codec,V),n.subarray(a.size)]}static inspectBytes(n){let a=0,u=c(()=>{let[Dr,Hr]=xe(n.subarray(a));return a+=Hr,Dr},"next"),d=u(),v=he;if(d===18?(d=0,a=0):v=u(),d!==0&&d!==1)throw new RangeError(`Invalid CID version ${d}`);let V=a,er=u(),cr=u(),Rr=a+cr,br=Rr-V;return{version:d,codec:v,multihashCode:er,digestSize:cr,multihashSize:br,size:Rr}}static parse(n,a){let[u,d]=Fn(n,a),v=xr.decode(d);if(v.version===0&&n[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return gt(v).set(u,n),v}};c(xr,"CID");var _e=xr;function Fn(i,n){switch(i[0]){case"Q":{let a=n??Mr;return[Mr.prefix,a.decode(`${Mr.prefix}${i}`)]}case Mr.prefix:{let a=n??Mr;return[Mr.prefix,a.decode(i)]}case qr.prefix:{let a=n??qr;return[qr.prefix,a.decode(i)]}case ae.prefix:{let a=n??ae;return[ae.prefix,a.decode(i)]}default:{if(n==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[i[0],n.decode(i)]}}}c(Fn,"parseCIDtoBytes");function Gn(i,n,a){let{prefix:u}=a;if(u!==Mr.prefix)throw Error(`Cannot string encode V0 in ${a.name} encoding`);let d=n.get(u);if(d==null){let v=a.encode(i).slice(1);return n.set(u,v),v}else return d}c(Gn,"toStringV0");function Vn(i,n,a){let{prefix:u}=a,d=n.get(u);if(d==null){let v=a.encode(i);return n.set(u,v),v}else return d}c(Vn,"toStringV1");var he=112,Xn=18;function cf(i,n,a){let u=Wr(i),d=u+Wr(n),v=new Uint8Array(d+a.byteLength);return Zr(i,v,0),Zr(n,v,u),v.set(a,d),v}c(cf,"encodeCID");var $n=Symbol.for("@ipld/js-cid/CID");var wt={...ct,...ft,...xt,...et,...tt,...ot,...it,...at,...st,...nt},T0={...lt,...pt};function pf(i,n,a,u){return{name:i,prefix:n,encoder:{name:i,prefix:n,encode:a},decoder:{decode:u}}}c(pf,"createCodec");var uf=pf("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),At=pf("ascii","a",i=>{let n="a";for(let a=0;a<i.length;a++)n+=String.fromCharCode(i[a]);return n},i=>{i=i.substring(1);let n=ie(i.length);for(let a=0;a<i.length;a++)n[a]=i.charCodeAt(a);return n}),qn={utf8:uf,"utf-8":uf,hex:wt.base16,latin1:At,ascii:At,binary:At,...wt},Ue=qn;function Nr(i,n="utf8"){let a=Ue[n];if(a==null)throw new Error(`Unsupported encoding "${n}"`);return a.decoder.decode(`${a.prefix}${i}`)}c(Nr,"fromString");function Se(i,n="utf8"){let a=Ue[n];if(a==null)throw new Error(`Unsupported encoding "${n}"`);return a.encoder.encode(i).substring(1)}c(Se,"toString");var Af=Nf(df(),1);var ue="did:key:z";var oi="X25519";var ii="X25519";var Qr="RSA-OAEP",kr="RSASSA-PKCS1-v1_5",mt="SHA-256",Wn=new Uint8Array([0,245,2]),ai=2048,vt="SHA-256",Te=8;var Jn=new Uint8Array([234,1]),Qn=new Uint8Array([237,1]);var Et=16;var bf=new Error("Invalid key use. Please use 'encryption' or 'signing"),li=new Error("Max must be less than 256 and greater than 0");function re(i){return new Uint8Array(i).buffer}c(re,"toArrayBuffer");function _t(i){let n=Nr(i,"base64pad");return re(n)}c(_t,"base64ToArrBuf");var Ut=c((i,n)=>{if(typeof i=="string")return n(i);if(typeof i=="object"&&i.byteLength!==void 0)return new Uint8Array(i).buffer;throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")},"normalizeToBuf");function lf(i){return Ut(i,_t)}c(lf,"normalizeBase64ToBuf");var ro=c(i=>Ut(i,n=>gf(n,8)),"normalizeUtf8ToBuf");function gf(i,n){let a=n===8?new Uint8Array(i.length):new Uint16Array(i.length);for(let u=0,d=i.length;u<d;u++)a[u]=i.charCodeAt(u);return a.buffer}c(gf,"strToArrBuf");var eo=c(i=>Ut(i,n=>gf(n,16)),"normalizeUtf16ToBuf");function Ce(i,n){switch(n){case 8:return ro(i);default:return eo(i)}}c(Ce,"normalizeUnicodeToBuf");var to={equal:c((i,n)=>{let a=new Uint8Array(i),u=new Uint8Array(n);if(a.length!==u.length)return!1;for(let d=0;d<a.length;d++)if(a[d]!==u[d])return!1;return!0},"equal")};function wf(i,n){return to.equal(n,i.slice(0,n.byteLength))}c(wf,"hasPrefix");var Tt={keyTypes:{"bls12-381":{magicBytes:new Uint8Array([234,1]),verify:c(()=>{throw new Error("Not implemented")},"verify")},rsa:{magicBytes:new Uint8Array([0,245,2]),verify:vf},ed25519:{magicBytes:new Uint8Array([237,1]),verify:mf}}};async function Ui({message:i,did:n,signature:a}){let u=fo(n),d=Me(n).publicKey;if(u==="ed25519")return mf({message:i,publicKey:d,signature:a});if(u==="rsa")return vf({message:i,publicKey:d,signature:a});throw new Error("Unknown key format")}c(Ui,"verify");function fo(i){try{let{type:n}=Me(i);return n}catch{return"unknown"}}c(fo,"getAlgorithm");async function mf({message:i,publicKey:n,signature:a}){let u=i;typeof i=="string"&&(u=Nr(i,"utf8"));let d=a;typeof a=="string"&&(d=Nr(a,"base64pad"));let v=n;if(typeof n=="string"&&(v=Me(n).publicKey),v.length!==32)throw new Error(`Invalid Ed25519 public key size: ${v.length} bytes, expected 32`);if(d.length!==64)throw new Error(`Invalid Ed25519 signature size: ${d.length} bytes, expected 64`);return Af.default.sign.detached.verify(u,d,v)}c(mf,"ed25519Verify");async function vf({message:i,publicKey:n,signature:a}){let u=n;return typeof n=="string"&&(u=Me(n).publicKey),no.verify(i,a,await Cr.subtle.importKey("spki",re(u),{name:kr,hash:mt},!1,["verify"]),8)}c(vf,"rsaVerify");var no={verify:c(async function(n,a,u,d=Te,v=vt){return Cr.subtle.verify({name:kr,saltLength:Et},typeof u=="string"?await St(u,v,"signing"):u,lf(a),Ce(n,d))},"rsaVerify"),sign:c(async function(n,a,u=Te){return Cr.subtle.sign({name:kr,saltLength:Et},a,Ce(n,u))},"sign"),encrypt:c(async function(n,a,u=Te,d=vt){let v;return typeof a=="string"?v=await St(a,d,"exchange"):v=a instanceof Uint8Array?await St(re(a),d,"exchange"):a,Cr.subtle.encrypt({name:Qr},v,Ce(n,u))},"rsaEncrypt"),decrypt:c(async function(n,a){let u=so(a)?a:await xo(a,["decrypt"]),d;typeof n=="string"?d=Nr(n,"base64pad"):d=n;let v=await Cr.subtle.decrypt({name:Qr},u,d instanceof Uint8Array?re(d):d);return new Uint8Array(v)},"rsaDecrypt")};async function St(i,n,a){oo(a);let u=a==="exchange"?Qr:kr,d=a==="exchange"?["encrypt"]:["verify"],v=typeof i=="string"?_t(ao(i)):i;return Cr.subtle.importKey("spki",v,{name:u,hash:{name:n}},!0,d)}c(St,"rsaImportPublicKey");function oo(i){io(i,["signing","exchange"],bf)}c(oo,"checkValidKeyUse");function io(i,n,a){if(!n.some(d=>d===i))throw a}c(io,"checkValid");function ao(i){return i.replace(`-----BEGIN PUBLIC KEY-----
|
|
2
2
|
`,"").replace(`
|
|
3
|
-
-----END PUBLIC KEY-----`,"")}c(ao,"stripKeyHeader");function so(i){return Bt(i,"algorithm")&&Bt(i,"extractable")&&Bt(i,"type")}c(so,"isCryptoKey");function Bt(i,n){return typeof i=="object"&&i!=null&&n in i}c(Bt,"hasProp");function xo(i,n){return Cr.subtle.importKey("spki",i instanceof Uint8Array?re(i):i,{name:Qr,hash:mt},!1,n)}c(xo,"importRsaKey");async function Si(i,n="rsa"){let a=i instanceof CryptoKey?new Uint8Array(await Ef(i)):i,u=Tt.keyTypes[n]?.magicBytes;if(!u)throw new Error(`Key type '${n}' not supported, available types: ${Object.keys(Tt.keyTypes).join(", ")}`);let d=Xe([u,a]);return ue+Se(d,"base58btc")}c(Si,"publicKeyToDid");async function Ef(i){return i instanceof CryptoKey?await Cr.subtle.exportKey("spki",i):await Cr.subtle.exportKey("spki",i.publicKey)}c(Ef,"getPublicKeyAsArrayBuffer");async function Bi(i){let n=await Ef(i);return new Uint8Array(n)}c(Bi,"getPublicKeyAsUint8Array");function Me(i){if(!i.startsWith(ue))throw new Error("Please use a base58-encoded DID formatted `did:key:z...`");let n=i.substr(ue.length),a=Nr(n,"base58btc"),u=Object.entries(Tt.keyTypes).find(([v,V])=>wf(a.buffer,V.magicBytes.buffer));if(!u)throw new Error("Unsupported key algorithm.");let d=a.slice(u[1].magicBytes.length);return u[0]==="ed25519"&&d.length===44?{publicKey:d.slice(-32),type:u[0]}:{publicKey:d,type:u[0]}}c(Me,"didToPublicKey");export{oo as checkValidKeyUse,Tt as did,Me as didToPublicKey,mf as ed25519Verify,fo as getAlgorithm,Ef as getPublicKeyAsArrayBuffer,Bi as getPublicKeyAsUint8Array,
|
|
3
|
+
-----END PUBLIC KEY-----`,"")}c(ao,"stripKeyHeader");function so(i){return Bt(i,"algorithm")&&Bt(i,"extractable")&&Bt(i,"type")}c(so,"isCryptoKey");function Bt(i,n){return typeof i=="object"&&i!=null&&n in i}c(Bt,"hasProp");function xo(i,n){return Cr.subtle.importKey("spki",i instanceof Uint8Array?re(i):i,{name:Qr,hash:mt},!1,n)}c(xo,"importRsaKey");async function Si(i,n="rsa"){let a=i instanceof CryptoKey?new Uint8Array(await Ef(i)):i,u=Tt.keyTypes[n]?.magicBytes;if(!u)throw new Error(`Key type '${n}' not supported, available types: ${Object.keys(Tt.keyTypes).join(", ")}`);let d=Xe([u,a]);return ue+Se(d,"base58btc")}c(Si,"publicKeyToDid");async function Ef(i){return i instanceof CryptoKey?await Cr.subtle.exportKey("spki",i):await Cr.subtle.exportKey("spki",i.publicKey)}c(Ef,"getPublicKeyAsArrayBuffer");async function Bi(i){let n=await Ef(i);return new Uint8Array(n)}c(Bi,"getPublicKeyAsUint8Array");function Me(i){if(!i.startsWith(ue))throw new Error("Please use a base58-encoded DID formatted `did:key:z...`");let n=i.substr(ue.length),a=Nr(n,"base58btc"),u=Object.entries(Tt.keyTypes).find(([v,V])=>wf(a.buffer,V.magicBytes.buffer));if(!u)throw new Error("Unsupported key algorithm.");let d=a.slice(u[1].magicBytes.length);return u[0]==="ed25519"&&d.length===44?{publicKey:d.slice(-32),type:u[0]}:{publicKey:d,type:u[0]}}c(Me,"didToPublicKey");export{oo as checkValidKeyUse,Tt as did,Me as didToPublicKey,mf as ed25519Verify,fo as getAlgorithm,Ef as getPublicKeyAsArrayBuffer,Bi as getPublicKeyAsUint8Array,xo as importRsaKey,so as isCryptoKey,Si as publicKeyToDid,St as rsaImportPublicKey,no as rsaOperations,vf as rsaVerify,Ui as verify};
|
|
4
4
|
//# sourceMappingURL=crypto.min.js.map
|