@wormhole-foundation/wormhole-connect 1.1.3-beta.2-development → 1.1.3-beta.3-development
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/assets/{ccip-CuVLQT8d.js → ccip-DIYM0gy6.js} +1 -1
- package/dist/assets/{evm-Dc3QdSOA.js → evm-Y-JIomWz.js} +4 -4
- package/dist/assets/{index-EVjhBEXw.js → index--B3_-qch.js} +2 -2
- package/dist/assets/{index-BJGeA_ds.js → index-C1YrzzPV.js} +1 -1
- package/dist/assets/{index-BIssGeVa.js → index-sR4FP7OJ.js} +1 -1
- package/dist/assets/{index.es-BObgTr8H.js → index.es-CRUh0v3x.js} +2 -2
- package/dist/main.js +4 -4
- package/lib/{algorand-CLoiUadv.mjs → algorand-D_QRI-bg.mjs} +3 -3
- package/lib/{algorand-BAFj4ZGa.js → algorand-wRfrbOd6.js} +1 -1
- package/lib/{aptos-C45UOjMk.mjs → aptos-39dGPUrb.mjs} +3 -3
- package/lib/{aptos-CHkHb9Wn.js → aptos-BYA8pulJ.js} +1 -1
- package/lib/{aptos-B0EUzhLn.mjs → aptos-D8si2udZ.mjs} +1 -1
- package/lib/{aptos-DLBpR9Uw.js → aptos-j2PEnEen.js} +2 -2
- package/lib/{ccip-D6nl66Of.mjs → ccip-CAsSiarY.mjs} +1 -1
- package/lib/{ccip-DwcFzOh0.js → ccip-D2DyQ2dl.js} +1 -1
- package/lib/{cosmos-BEyKk7pN.js → cosmos--SblITfP.js} +11 -11
- package/lib/{cosmos-Bc34YeqV.mjs → cosmos-5QBTeSdf.mjs} +5 -5
- package/lib/{cosmwasm-BBIEjp_6.mjs → cosmwasm-BvDytCXd.mjs} +3545 -3545
- package/lib/{cosmwasm-DPmjLuio.js → cosmwasm-qpOclFcW.js} +3 -3
- package/lib/{events-D9h1HjEa.mjs → events-Cq1VEeNf.mjs} +1 -1
- package/lib/{events-B2ZyXE4l.js → events-DSOd4gvB.js} +1 -1
- package/lib/{evm--fmrvZiP.js → evm-C-UXATlx.js} +4 -4
- package/lib/{evm-sG77B7Ln.mjs → evm-CEwMJ8_A.mjs} +6 -6
- package/lib/{evm-D6zAQuRU.js → evm-DG7I4Frq.js} +1 -1
- package/lib/{evm-DsRkB-Yc.mjs → evm-DMvzqxcS.mjs} +7 -7
- package/lib/{index-DinZIMWa.mjs → index-74c6g32z.mjs} +225 -225
- package/lib/{index-DWJ5r15M.mjs → index-7zA9RXv7.mjs} +19853 -19856
- package/lib/{index-Cpjj11xV.mjs → index-B8T2NaoX.mjs} +45 -45
- package/lib/{index-DPtc-UxP.mjs → index-B8ULFzIF.mjs} +6 -6
- package/lib/{index-B7Optu6I.js → index-B9Hz7aqe.js} +1 -1
- package/lib/{index-jydTi-hN.mjs → index-BHWO1nl8.mjs} +2 -2
- package/lib/{index-ByOoS9NO.js → index-BLp_eTrc.js} +1 -1
- package/lib/{index-CvdPwRnL.js → index-BQtbCwXd.js} +1 -1
- package/lib/{index-CEovIwuS.js → index-BU_DiszY.js} +92 -92
- package/lib/{index-XMIcJZyr.js → index-BbxY_HAX.js} +16 -16
- package/lib/{index-CY9fp7fB.mjs → index-Beu3v0JF.mjs} +15 -15
- package/lib/{index-D4u8CUKC.mjs → index-BhXfWaSE.mjs} +3 -3
- package/lib/{index-B9gBvn5a.mjs → index-BjeY05EL.mjs} +801 -802
- package/lib/{index-BT10pzLw.mjs → index-BoUKkFOJ.mjs} +1 -1
- package/lib/{index-CVaT6qZW.js → index-C6PC2n3L.js} +1 -1
- package/lib/{index-BYnoX4S7.mjs → index-CAqvcaXu.mjs} +15 -15
- package/lib/{index-DGq7mQyb.mjs → index-CDHEzcRs.mjs} +10 -10
- package/lib/{index-U1A3Ir4_.js → index-CFV9DDDi.js} +1 -1
- package/lib/{index-CQY-qyc8.mjs → index-CHNFj7US.mjs} +2 -2
- package/lib/{index-DrDopLyp.mjs → index-CIbRMQ53.mjs} +2 -2
- package/lib/{index-BFWViYNu.mjs → index-COFRyIUZ.mjs} +7 -7
- package/lib/{index-BJ9DGQK7.js → index-CREWpYSc.js} +1 -1
- package/lib/{index-CL7evJIB.js → index-CV_U2daN.js} +1 -1
- package/lib/{index-CNe0Pean.js → index-CxgmuQ6m.js} +1 -1
- package/lib/{index-DugvE6YD.mjs → index-D-p3qNTZ.mjs} +30 -30
- package/lib/{index-Cb5M1Ban.mjs → index-D9X9k3PB.mjs} +1 -1
- package/lib/{index-IC9ubiMJ.mjs → index-DJghGbqc.mjs} +3 -3
- package/lib/{index-Bx7B-3Uk.js → index-DP78DD_7.js} +1 -1
- package/lib/{index-OldEBluq.js → index-D_iRGURG.js} +1 -1
- package/lib/{index-PcZU5a1K.js → index-DcOE-jqI.js} +1 -1
- package/lib/{index-BO1rJrRP.mjs → index-DefP3AL4.mjs} +9 -9
- package/lib/{index-C96ibHXm.js → index-DgKzux63.js} +1 -1
- package/lib/{index-D_3BlFSH.js → index-DhjRrhjF.js} +1 -1
- package/lib/{index-CyPbCf5y.js → index-DhvcbRay.js} +1 -1
- package/lib/{index-C010ECjb.js → index-DjAPVIrd.js} +1 -1
- package/lib/{index-CaQpF1dj.js → index-Dpwwqt_Y.js} +1 -1
- package/lib/{index-Bl8-vKcf.js → index-DqRdsXVl.js} +1 -1
- package/lib/{index-jgZQQCfy.mjs → index-DuVadmtW.mjs} +18 -18
- package/lib/{index--8OR2IWG.mjs → index-SSdHQ2f1.mjs} +2 -2
- package/lib/{index-B_vsKDJm.js → index-X48SyxVx.js} +1 -1
- package/lib/{index-DdhKN5Tn.mjs → index-evqr6zVJ.mjs} +2 -2
- package/lib/{index-BxxpLnjr.mjs → index-hY0mf_OS.mjs} +26 -26
- package/lib/{index-mE3wnazE.js → index-oE-cAvjh.js} +1 -1
- package/lib/{index-Ci0O-yiU.js → index-oRg2LZn2.js} +1 -1
- package/lib/{index-D0RnzOoN.js → index-pIxA5tC9.js} +1 -1
- package/lib/{index-CnElB0dt.mjs → index-vZrnrwrk.mjs} +2 -2
- package/lib/{index.es-DbGYkQrs.js → index.es-CwS3KgtR.js} +2 -2
- package/lib/{index.es-DV6jIgX3.mjs → index.es-De3BB9Gs.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{keccak-BvCC2Kx2.js → keccak-B1lZAzij.js} +1 -1
- package/lib/{keccak-C0uJwxei.mjs → keccak-BIkgLtG3.mjs} +1 -1
- package/lib/{libsodium-wrappers-BS68glUg.mjs → libsodium-wrappers-BVHsOzCM.mjs} +1 -1
- package/lib/{libsodium-wrappers-yq_uVk2-.js → libsodium-wrappers-G-nqImEg.js} +1 -1
- package/lib/{pako.esm-DZDXjYQj.js → pako.esm-Bp8XA5UR.js} +1 -1
- package/lib/{pako.esm-CWQc3qGc.mjs → pako.esm-CuMQ9lDX.mjs} +2 -2
- package/lib/{pbkdf2-DbRuCUvp.js → pbkdf2-DvmY7GlQ.js} +1 -1
- package/lib/{pbkdf2-B3V9L7S5.mjs → pbkdf2-QaxjQpDb.mjs} +1 -1
- package/lib/{sei-D3Eq9BDV.js → sei-B9drTJKa.js} +1 -1
- package/lib/{sei-Bty4vIw4.mjs → sei-DgoF7Bn_.mjs} +3 -3
- package/lib/{signer-Dw6nmaHE.js → signer-BEIw02y1.js} +1 -1
- package/lib/{signer-zHoIaQqc.mjs → signer-DNX7OGg4.mjs} +1 -1
- package/lib/solana-BRb7NfyR.js +1 -0
- package/lib/{solana-C-e817Or.mjs → solana-CoAz_ENY.mjs} +4 -4
- package/lib/solana-D2xBFYbL.mjs +16 -0
- package/lib/{solana-9m57XHRZ.js → solana-iqc7Fvik.js} +1 -1
- package/lib/{solanaEmbed.esm-ByzcN6RA.mjs → solanaEmbed.esm-D-2IZyVE.mjs} +3 -3
- package/lib/{solanaEmbed.esm-DBOgwSJE.js → solanaEmbed.esm-DjEXAVdT.js} +1 -1
- package/lib/{sui-B3dbw4a7.js → sui-CLKF35u2.js} +2 -2
- package/lib/{sui-CKgX0Mjn.mjs → sui-C_RZoPbB.mjs} +4 -4
- package/lib/{sui-rey0HjGu.mjs → sui-CrvrUATE.mjs} +1 -1
- package/lib/{sui-lQcSerf0.js → sui-qNwHoAbu.js} +1 -1
- package/lib/{unsignedTransaction-DcJyFS5R.js → unsignedTransaction-CJyRAIyq.js} +1 -1
- package/lib/{unsignedTransaction-sTI31PuJ.mjs → unsignedTransaction-XgGjCBSt.mjs} +2 -2
- package/package.json +1 -1
- package/lib/solana-CV7qftfl.mjs +0 -16
- package/lib/solana-GdBZhG_3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ye=require("./index-CEovIwuS.js");var Et={},Me={},x={},bt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(f,c){var d=f>>>16&65535,E=f&65535,y=c>>>16&65535,v=c&65535;return E*v+(d*v+E*y<<16>>>0)|0}e.mul=Math.imul||r;function n(f,c){return f+c|0}e.add=n;function a(f,c){return f-c|0}e.sub=a;function D(f,c){return f<<c|f>>>32-c}e.rotl=D;function l(f,c){return f<<32-c|f>>>c}e.rotr=l;function w(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}e.isInteger=Number.isInteger||w,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(f){return e.isInteger(f)&&f>=-e.MAX_SAFE_INTEGER&&f<=e.MAX_SAFE_INTEGER}})(bt);Object.defineProperty(x,"__esModule",{value:!0});var vt=bt;function It(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}x.readInt16BE=It;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}x.readUint16BE=Rt;function Pt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}x.readInt16LE=Pt;function Ht(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}x.readUint16LE=Ht;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}x.writeUint16BE=wt;x.writeInt16BE=wt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}x.writeUint16LE=yt;x.writeInt16LE=yt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}x.readInt32BE=qe;function $e(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}x.readUint32BE=$e;function Ge(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}x.readInt32LE=Ge;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}x.readUint32LE=Ve;function Ne(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}x.writeUint32BE=Ne;x.writeInt32BE=Ne;function Te(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}x.writeUint32LE=Te;x.writeInt32LE=Te;function Kt(e,r){r===void 0&&(r=0);var n=qe(e,r),a=qe(e,r+4);return n*4294967296+a-(a>>31)*4294967296}x.readInt64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=$e(e,r),a=$e(e,r+4);return n*4294967296+a}x.readUint64BE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ge(e,r),a=Ge(e,r+4);return a*4294967296+n-(n>>31)*4294967296}x.readInt64LE=Yt;function qt(e,r){r===void 0&&(r=0);var n=Ve(e,r),a=Ve(e,r+4);return a*4294967296+n}x.readUint64LE=qt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Ne(e/4294967296>>>0,r,n),Ne(e>>>0,r,n+4),r}x.writeUint64BE=gt;x.writeInt64BE=gt;function St(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Te(e>>>0,r,n),Te(e/4294967296>>>0,r,n+4),r}x.writeUint64LE=St;x.writeInt64LE=St;function $t(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var a=0,D=1,l=e/8+n-1;l>=n;l--)a+=r[l]*D,D*=256;return a}x.readUintBE=$t;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var a=0,D=1,l=n;l<n+e/8;l++)a+=r[l]*D,D*=256;return a}x.readUintLE=Gt;function Vt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var D=1,l=e/8+a-1;l>=a;l--)n[l]=r/D&255,D*=256;return n}x.writeUintBE=Vt;function Wt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var D=1,l=a;l<a+e/8;l++)n[l]=r/D&255,D*=256;return n}x.writeUintLE=Wt;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}x.readFloat32BE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}x.readFloat32LE=Jt;function Qt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}x.readFloat64BE=Qt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}x.readFloat64LE=Zt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e),r}x.writeFloat32BE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e,!0),r}x.writeFloat32LE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e),r}x.writeFloat64BE=tr;function rr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e,!0),r}x.writeFloat64LE=rr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function nr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=nr;Object.defineProperty(Me,"__esModule",{value:!0});var _e=x,We=de,ir=20;function ar(e,r,n){for(var a=1634760805,D=857760878,l=2036477234,w=1797285236,f=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],d=n[11]<<24|n[10]<<16|n[9]<<8|n[8],E=n[15]<<24|n[14]<<16|n[13]<<8|n[12],y=n[19]<<24|n[18]<<16|n[17]<<8|n[16],v=n[23]<<24|n[22]<<16|n[21]<<8|n[20],b=n[27]<<24|n[26]<<16|n[25]<<8|n[24],g=n[31]<<24|n[30]<<16|n[29]<<8|n[28],A=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],o=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=a,u=D,s=l,h=w,t=f,i=c,S=d,C=E,F=y,L=v,j=b,B=g,T=A,M=p,m=O,N=o,G=0;G<ir;G+=2)_=_+t|0,T^=_,T=T>>>16|T<<16,F=F+T|0,t^=F,t=t>>>20|t<<12,u=u+i|0,M^=u,M=M>>>16|M<<16,L=L+M|0,i^=L,i=i>>>20|i<<12,s=s+S|0,m^=s,m=m>>>16|m<<16,j=j+m|0,S^=j,S=S>>>20|S<<12,h=h+C|0,N^=h,N=N>>>16|N<<16,B=B+N|0,C^=B,C=C>>>20|C<<12,s=s+S|0,m^=s,m=m>>>24|m<<8,j=j+m|0,S^=j,S=S>>>25|S<<7,h=h+C|0,N^=h,N=N>>>24|N<<8,B=B+N|0,C^=B,C=C>>>25|C<<7,u=u+i|0,M^=u,M=M>>>24|M<<8,L=L+M|0,i^=L,i=i>>>25|i<<7,_=_+t|0,T^=_,T=T>>>24|T<<8,F=F+T|0,t^=F,t=t>>>25|t<<7,_=_+i|0,N^=_,N=N>>>16|N<<16,j=j+N|0,i^=j,i=i>>>20|i<<12,u=u+S|0,T^=u,T=T>>>16|T<<16,B=B+T|0,S^=B,S=S>>>20|S<<12,s=s+C|0,M^=s,M=M>>>16|M<<16,F=F+M|0,C^=F,C=C>>>20|C<<12,h=h+t|0,m^=h,m=m>>>16|m<<16,L=L+m|0,t^=L,t=t>>>20|t<<12,s=s+C|0,M^=s,M=M>>>24|M<<8,F=F+M|0,C^=F,C=C>>>25|C<<7,h=h+t|0,m^=h,m=m>>>24|m<<8,L=L+m|0,t^=L,t=t>>>25|t<<7,u=u+S|0,T^=u,T=T>>>24|T<<8,B=B+T|0,S^=B,S=S>>>25|S<<7,_=_+i|0,N^=_,N=N>>>24|N<<8,j=j+N|0,i^=j,i=i>>>25|i<<7;_e.writeUint32LE(_+a|0,e,0),_e.writeUint32LE(u+D|0,e,4),_e.writeUint32LE(s+l|0,e,8),_e.writeUint32LE(h+w|0,e,12),_e.writeUint32LE(t+f|0,e,16),_e.writeUint32LE(i+c|0,e,20),_e.writeUint32LE(S+d|0,e,24),_e.writeUint32LE(C+E|0,e,28),_e.writeUint32LE(F+y|0,e,32),_e.writeUint32LE(L+v|0,e,36),_e.writeUint32LE(j+b|0,e,40),_e.writeUint32LE(B+g|0,e,44),_e.writeUint32LE(T+A|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(m+O|0,e,56),_e.writeUint32LE(N+o|0,e,60)}function mt(e,r,n,a,D){if(D===void 0&&(D=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(a.length<n.length)throw new Error("ChaCha: destination is shorter than source");var l,w;if(D===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");l=new Uint8Array(16),w=l.length-r.length,l.set(r,w)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");l=r,w=D}for(var f=new Uint8Array(64),c=0;c<n.length;c+=64){ar(f,l,e);for(var d=c;d<c+64&&d<n.length;d++)a[d]=n[d]^f[d-c];fr(l,0,w)}return We.wipe(f),D===0&&We.wipe(l),a}Me.streamXOR=mt;function ur(e,r,n,a){return a===void 0&&(a=0),We.wipe(n),mt(e,r,n,n,a)}Me.stream=ur;function fr(e,r,n){for(var a=1;n--;)a=a+(e[r]&255)|0,e[r]=a&255,a>>>=8,r++;if(a>0)throw new Error("ChaCha: counter overflow")}var Ct={},be={};Object.defineProperty(be,"__esModule",{value:!0});function hr(e,r,n){return~(e-1)&r|e-1&n}be.select=hr;function sr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=sr;function pt(e,r){if(e.length!==r.length)return 0;for(var n=0,a=0;a<e.length;a++)n|=e[a]^r[a];return 1&n-1>>>8}be.compare=pt;function or(e,r){return e.length===0||r.length===0?!1:pt(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var a=function(){function w(f){this.digestLength=e.DIGEST_LENGTH,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,this._finished=!1;var c=f[0]|f[1]<<8;this._r[0]=c&8191;var d=f[2]|f[3]<<8;this._r[1]=(c>>>13|d<<3)&8191;var E=f[4]|f[5]<<8;this._r[2]=(d>>>10|E<<6)&7939;var y=f[6]|f[7]<<8;this._r[3]=(E>>>7|y<<9)&8191;var v=f[8]|f[9]<<8;this._r[4]=(y>>>4|v<<12)&255,this._r[5]=v>>>1&8190;var b=f[10]|f[11]<<8;this._r[6]=(v>>>14|b<<2)&8191;var g=f[12]|f[13]<<8;this._r[7]=(b>>>11|g<<5)&8065;var A=f[14]|f[15]<<8;this._r[8]=(g>>>8|A<<8)&8191,this._r[9]=A>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return w.prototype._blocks=function(f,c,d){for(var E=this._fin?0:2048,y=this._h[0],v=this._h[1],b=this._h[2],g=this._h[3],A=this._h[4],p=this._h[5],O=this._h[6],o=this._h[7],_=this._h[8],u=this._h[9],s=this._r[0],h=this._r[1],t=this._r[2],i=this._r[3],S=this._r[4],C=this._r[5],F=this._r[6],L=this._r[7],j=this._r[8],B=this._r[9];d>=16;){var T=f[c+0]|f[c+1]<<8;y+=T&8191;var M=f[c+2]|f[c+3]<<8;v+=(T>>>13|M<<3)&8191;var m=f[c+4]|f[c+5]<<8;b+=(M>>>10|m<<6)&8191;var N=f[c+6]|f[c+7]<<8;g+=(m>>>7|N<<9)&8191;var G=f[c+8]|f[c+9]<<8;A+=(N>>>4|G<<12)&8191,p+=G>>>1&8191;var J=f[c+10]|f[c+11]<<8;O+=(G>>>14|J<<2)&8191;var X=f[c+12]|f[c+13]<<8;o+=(J>>>11|X<<5)&8191;var W=f[c+14]|f[c+15]<<8;_+=(X>>>8|W<<8)&8191,u+=W>>>5|E;var U=0,I=U;I+=y*s,I+=v*(5*B),I+=b*(5*j),I+=g*(5*L),I+=A*(5*F),U=I>>>13,I&=8191,I+=p*(5*C),I+=O*(5*S),I+=o*(5*i),I+=_*(5*t),I+=u*(5*h),U+=I>>>13,I&=8191;var R=U;R+=y*h,R+=v*s,R+=b*(5*B),R+=g*(5*j),R+=A*(5*L),U=R>>>13,R&=8191,R+=p*(5*F),R+=O*(5*C),R+=o*(5*S),R+=_*(5*i),R+=u*(5*t),U+=R>>>13,R&=8191;var P=U;P+=y*t,P+=v*h,P+=b*s,P+=g*(5*B),P+=A*(5*j),U=P>>>13,P&=8191,P+=p*(5*L),P+=O*(5*F),P+=o*(5*C),P+=_*(5*S),P+=u*(5*i),U+=P>>>13,P&=8191;var H=U;H+=y*i,H+=v*t,H+=b*h,H+=g*s,H+=A*(5*B),U=H>>>13,H&=8191,H+=p*(5*j),H+=O*(5*L),H+=o*(5*F),H+=_*(5*C),H+=u*(5*S),U+=H>>>13,H&=8191;var K=U;K+=y*S,K+=v*i,K+=b*t,K+=g*h,K+=A*s,U=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*j),K+=o*(5*L),K+=_*(5*F),K+=u*(5*C),U+=K>>>13,K&=8191;var z=U;z+=y*C,z+=v*S,z+=b*i,z+=g*t,z+=A*h,U=z>>>13,z&=8191,z+=p*s,z+=O*(5*B),z+=o*(5*j),z+=_*(5*L),z+=u*(5*F),U+=z>>>13,z&=8191;var Y=U;Y+=y*F,Y+=v*C,Y+=b*S,Y+=g*i,Y+=A*t,U=Y>>>13,Y&=8191,Y+=p*h,Y+=O*s,Y+=o*(5*B),Y+=_*(5*j),Y+=u*(5*L),U+=Y>>>13,Y&=8191;var q=U;q+=y*L,q+=v*F,q+=b*C,q+=g*S,q+=A*i,U=q>>>13,q&=8191,q+=p*t,q+=O*h,q+=o*s,q+=_*(5*B),q+=u*(5*j),U+=q>>>13,q&=8191;var $=U;$+=y*j,$+=v*L,$+=b*F,$+=g*C,$+=A*S,U=$>>>13,$&=8191,$+=p*i,$+=O*t,$+=o*h,$+=_*s,$+=u*(5*B),U+=$>>>13,$&=8191;var V=U;V+=y*B,V+=v*j,V+=b*L,V+=g*F,V+=A*C,U=V>>>13,V&=8191,V+=p*S,V+=O*i,V+=o*t,V+=_*h,V+=u*s,U+=V>>>13,V&=8191,U=(U<<2)+U|0,U=U+I|0,I=U&8191,U=U>>>13,R+=U,y=I,v=R,b=P,g=H,A=K,p=z,O=Y,o=q,_=$,u=V,c+=16,d-=16}this._h[0]=y,this._h[1]=v,this._h[2]=b,this._h[3]=g,this._h[4]=A,this._h[5]=p,this._h[6]=O,this._h[7]=o,this._h[8]=_,this._h[9]=u},w.prototype.finish=function(f,c){c===void 0&&(c=0);var d=new Uint16Array(10),E,y,v,b;if(this._leftover){for(b=this._leftover,this._buffer[b++]=1;b<16;b++)this._buffer[b]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(E=this._h[1]>>>13,this._h[1]&=8191,b=2;b<10;b++)this._h[b]+=E,E=this._h[b]>>>13,this._h[b]&=8191;for(this._h[0]+=E*5,E=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=E,E=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=E,d[0]=this._h[0]+5,E=d[0]>>>13,d[0]&=8191,b=1;b<10;b++)d[b]=this._h[b]+E,E=d[b]>>>13,d[b]&=8191;for(d[9]-=8192,y=(E^1)-1,b=0;b<10;b++)d[b]&=y;for(y=~y,b=0;b<10;b++)this._h[b]=this._h[b]&y|d[b];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,v=this._h[0]+this._pad[0],this._h[0]=v&65535,b=1;b<8;b++)v=(this._h[b]+this._pad[b]|0)+(v>>>16)|0,this._h[b]=v&65535;return f[c+0]=this._h[0]>>>0,f[c+1]=this._h[0]>>>8,f[c+2]=this._h[1]>>>0,f[c+3]=this._h[1]>>>8,f[c+4]=this._h[2]>>>0,f[c+5]=this._h[2]>>>8,f[c+6]=this._h[3]>>>0,f[c+7]=this._h[3]>>>8,f[c+8]=this._h[4]>>>0,f[c+9]=this._h[4]>>>8,f[c+10]=this._h[5]>>>0,f[c+11]=this._h[5]>>>8,f[c+12]=this._h[6]>>>0,f[c+13]=this._h[6]>>>8,f[c+14]=this._h[7]>>>0,f[c+15]=this._h[7]>>>8,this._finished=!0,this},w.prototype.update=function(f){var c=0,d=f.length,E;if(this._leftover){E=16-this._leftover,E>d&&(E=d);for(var y=0;y<E;y++)this._buffer[this._leftover+y]=f[c+y];if(d-=E,c+=E,this._leftover+=E,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(E=d-d%16,this._blocks(f,c,E),c+=E,d-=E),d){for(var y=0;y<d;y++)this._buffer[this._leftover+y]=f[c+y];this._leftover+=d}return this},w.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},w.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},w}();e.Poly1305=a;function D(w,f){var c=new a(w);c.update(f);var d=c.digest();return c.clean(),d}e.oneTimeAuth=D;function l(w,f){return w.length!==e.DIGEST_LENGTH||f.length!==e.DIGEST_LENGTH?!1:r.equal(w,f)}e.equal=l})(Ct);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Me,n=Ct,a=de,D=x,l=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var w=new Uint8Array(16),f=function(){function c(d){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,d.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return c.prototype.seal=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=E.length+this.tagLength,p;if(v){if(v.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");p=v}else p=new Uint8Array(A);return r.streamXOR(this._key,b,E,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),y),a.wipe(b),p},c.prototype.open=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(E.length<this.tagLength)return null;var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,g,E.subarray(0,E.length-this.tagLength),y),!l.equal(A,E.subarray(E.length-this.tagLength,E.length)))return null;var p=E.length-this.tagLength,O;if(v){if(v.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=v}else O=new Uint8Array(p);return r.streamXOR(this._key,b,E.subarray(0,E.length-this.tagLength),O,4),a.wipe(b),O},c.prototype.clean=function(){return a.wipe(this._key),this},c.prototype._authenticate=function(d,E,y,v){var b=new n.Poly1305(E);v&&(b.update(v),v.length%16>0&&b.update(w.subarray(v.length%16))),b.update(y),y.length%16>0&&b.update(w.subarray(y.length%16));var g=new Uint8Array(8);v&&D.writeUint64LE(v.length,g),b.update(g),D.writeUint64LE(y.length,g),b.update(g);for(var A=b.digest(),p=0;p<A.length;p++)d[p]=A[p];b.clean(),a.wipe(A),a.wipe(g)},c}();e.ChaCha20Poly1305=f})(Et);var At={},Ue={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function cr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=cr;Object.defineProperty(Ue,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var a=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(a).clean():a.set(n);for(var D=0;D<a.length;D++)a[D]^=54;this._inner.update(a);for(var D=0;D<a.length;D++)a[D]^=106;this._outer.update(a),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(a)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Ue.HMAC=Ut;function _r(e,r,n){var a=new Ut(e,r);a.update(n);var D=a.digest();return a.clean(),D}Ue.hmac=_r;Ue.equal=lr.equal;Object.defineProperty(At,"__esModule",{value:!0});var rt=Ue,nt=de,dr=function(){function e(r,n,a,D){a===void 0&&(a=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=D;var l=rt.hmac(this._hash,a,n);this._hmac=new rt.HMAC(r,l),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(r){for(var n=new Uint8Array(r),a=0;a<n.length;a++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[a]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),Er=At.HKDF=dr,et={},xe={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.BrowserRandomSource=void 0;const it=65536;class br{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let a=0;a<n.length;a+=it)this._crypto.getRandomValues(n.subarray(a,a+Math.min(n.length-a,it)));return n}}Le.BrowserRandomSource=br;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.NodeRandomSource=void 0;const vr=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ye.commonjsRequire<"u"){const r=Ye.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const a=new Uint8Array(r);for(let D=0;D<a.length;D++)a[D]=n[D];return(0,vr.wipe)(n),a}}Be.NodeRandomSource=wr;Object.defineProperty(xe,"__esModule",{value:!0});xe.SystemRandomSource=void 0;const yr=Le,gr=Be;class Sr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new yr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new gr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}xe.SystemRandomSource=Sr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=xe,n=x,a=de;e.defaultRandomSource=new r.SystemRandomSource;function D(d,E=e.defaultRandomSource){return E.randomBytes(d)}e.randomBytes=D;function l(d=e.defaultRandomSource){const E=D(4,d),y=(0,n.readUint32LE)(E);return(0,a.wipe)(E),y}e.randomUint32=l;const w="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(d,E=w,y=e.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let v="";const b=E.length,g=256-256%b;for(;d>0;){const A=D(Math.ceil(d*256/g),y);for(let p=0;p<A.length&&d>0;p++){const O=A[p];O<g&&(v+=E.charAt(O%b),d--)}(0,a.wipe)(A)}return v}e.randomString=f;function c(d,E=w,y=e.defaultRandomSource){const v=Math.ceil(d/(Math.log(E.length)/Math.LN2));return f(v,E,y)}e.randomStringForEntropy=c})(et);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=x,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var a=function(){function f(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},f.prototype.update=function(c,d){if(d===void 0&&(d=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var E=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=c[E++],d--;this._bufferLength===this.blockSize&&(l(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(E=l(this._temp,this._state,c,E,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=c[E++],d--;return this},f.prototype.finish=function(c){if(!this._finished){var d=this._bytesHashed,E=this._bufferLength,y=d/536870912|0,v=d<<3,b=d%64<56?64:128;this._buffer[E]=128;for(var g=E+1;g<b-8;g++)this._buffer[g]=0;r.writeUint32BE(y,this._buffer,b-8),r.writeUint32BE(v,this._buffer,b-4),l(this._temp,this._state,this._buffer,0,b),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)r.writeUint32BE(this._state[g],c,g*4);return this},f.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(c){n.wipe(c.state),c.buffer&&n.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},f}();e.SHA256=a;var D=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function l(f,c,d,E,y){for(;y>=64;){for(var v=c[0],b=c[1],g=c[2],A=c[3],p=c[4],O=c[5],o=c[6],_=c[7],u=0;u<16;u++){var s=E+u*4;f[u]=r.readUint32BE(d,s)}for(var u=16;u<64;u++){var h=f[u-2],t=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=f[u-15];var i=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;f[u]=(t+f[u-7]|0)+(i+f[u-16]|0)}for(var u=0;u<64;u++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&o)|0)+(_+(D[u]+f[u]|0)|0)|0,i=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&g^b&g)|0;_=o,o=O,O=p,p=A+t|0,A=g,g=b,b=v,v=t+i|0}c[0]+=v,c[1]+=b,c[2]+=g,c[3]+=A,c[4]+=p,c[5]+=O,c[6]+=o,c[7]+=_,E+=64,y-=64}return E}function w(f){var c=new a;c.update(f);var d=c.digest();return c.clean(),d}e.hash=w})(Ot);var Ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function a(u){const s=new Float64Array(16);if(u)for(let h=0;h<u.length;h++)s[h]=u[h];return s}const D=new Uint8Array(32);D[0]=9;const l=a([56129,1]);function w(u){let s=1;for(let h=0;h<16;h++){let t=u[h]+s+65535;s=Math.floor(t/65536),u[h]=t-s*65536}u[0]+=s-1+37*(s-1)}function f(u,s,h){const t=~(h-1);for(let i=0;i<16;i++){const S=t&(u[i]^s[i]);u[i]^=S,s[i]^=S}}function c(u,s){const h=a(),t=a();for(let i=0;i<16;i++)t[i]=s[i];w(t),w(t),w(t);for(let i=0;i<2;i++){h[0]=t[0]-65517;for(let C=1;C<15;C++)h[C]=t[C]-65535-(h[C-1]>>16&1),h[C-1]&=65535;h[15]=t[15]-32767-(h[14]>>16&1);const S=h[15]>>16&1;h[14]&=65535,f(t,h,1-S)}for(let i=0;i<16;i++)u[2*i]=t[i]&255,u[2*i+1]=t[i]>>8}function d(u,s){for(let h=0;h<16;h++)u[h]=s[2*h]+(s[2*h+1]<<8);u[15]&=32767}function E(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]+h[t]}function y(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]-h[t]}function v(u,s,h){let t,i,S=0,C=0,F=0,L=0,j=0,B=0,T=0,M=0,m=0,N=0,G=0,J=0,X=0,W=0,U=0,I=0,R=0,P=0,H=0,K=0,z=0,Y=0,q=0,$=0,V=0,ve=0,ge=0,me=0,Fe=0,Re=0,tt=0,Z=h[0],k=h[1],ee=h[2],te=h[3],re=h[4],ne=h[5],ie=h[6],ae=h[7],ue=h[8],fe=h[9],he=h[10],se=h[11],oe=h[12],ce=h[13],le=h[14],De=h[15];t=s[0],S+=t*Z,C+=t*k,F+=t*ee,L+=t*te,j+=t*re,B+=t*ne,T+=t*ie,M+=t*ae,m+=t*ue,N+=t*fe,G+=t*he,J+=t*se,X+=t*oe,W+=t*ce,U+=t*le,I+=t*De,t=s[1],C+=t*Z,F+=t*k,L+=t*ee,j+=t*te,B+=t*re,T+=t*ne,M+=t*ie,m+=t*ae,N+=t*ue,G+=t*fe,J+=t*he,X+=t*se,W+=t*oe,U+=t*ce,I+=t*le,R+=t*De,t=s[2],F+=t*Z,L+=t*k,j+=t*ee,B+=t*te,T+=t*re,M+=t*ne,m+=t*ie,N+=t*ae,G+=t*ue,J+=t*fe,X+=t*he,W+=t*se,U+=t*oe,I+=t*ce,R+=t*le,P+=t*De,t=s[3],L+=t*Z,j+=t*k,B+=t*ee,T+=t*te,M+=t*re,m+=t*ne,N+=t*ie,G+=t*ae,J+=t*ue,X+=t*fe,W+=t*he,U+=t*se,I+=t*oe,R+=t*ce,P+=t*le,H+=t*De,t=s[4],j+=t*Z,B+=t*k,T+=t*ee,M+=t*te,m+=t*re,N+=t*ne,G+=t*ie,J+=t*ae,X+=t*ue,W+=t*fe,U+=t*he,I+=t*se,R+=t*oe,P+=t*ce,H+=t*le,K+=t*De,t=s[5],B+=t*Z,T+=t*k,M+=t*ee,m+=t*te,N+=t*re,G+=t*ne,J+=t*ie,X+=t*ae,W+=t*ue,U+=t*fe,I+=t*he,R+=t*se,P+=t*oe,H+=t*ce,K+=t*le,z+=t*De,t=s[6],T+=t*Z,M+=t*k,m+=t*ee,N+=t*te,G+=t*re,J+=t*ne,X+=t*ie,W+=t*ae,U+=t*ue,I+=t*fe,R+=t*he,P+=t*se,H+=t*oe,K+=t*ce,z+=t*le,Y+=t*De,t=s[7],M+=t*Z,m+=t*k,N+=t*ee,G+=t*te,J+=t*re,X+=t*ne,W+=t*ie,U+=t*ae,I+=t*ue,R+=t*fe,P+=t*he,H+=t*se,K+=t*oe,z+=t*ce,Y+=t*le,q+=t*De,t=s[8],m+=t*Z,N+=t*k,G+=t*ee,J+=t*te,X+=t*re,W+=t*ne,U+=t*ie,I+=t*ae,R+=t*ue,P+=t*fe,H+=t*he,K+=t*se,z+=t*oe,Y+=t*ce,q+=t*le,$+=t*De,t=s[9],N+=t*Z,G+=t*k,J+=t*ee,X+=t*te,W+=t*re,U+=t*ne,I+=t*ie,R+=t*ae,P+=t*ue,H+=t*fe,K+=t*he,z+=t*se,Y+=t*oe,q+=t*ce,$+=t*le,V+=t*De,t=s[10],G+=t*Z,J+=t*k,X+=t*ee,W+=t*te,U+=t*re,I+=t*ne,R+=t*ie,P+=t*ae,H+=t*ue,K+=t*fe,z+=t*he,Y+=t*se,q+=t*oe,$+=t*ce,V+=t*le,ve+=t*De,t=s[11],J+=t*Z,X+=t*k,W+=t*ee,U+=t*te,I+=t*re,R+=t*ne,P+=t*ie,H+=t*ae,K+=t*ue,z+=t*fe,Y+=t*he,q+=t*se,$+=t*oe,V+=t*ce,ve+=t*le,ge+=t*De,t=s[12],X+=t*Z,W+=t*k,U+=t*ee,I+=t*te,R+=t*re,P+=t*ne,H+=t*ie,K+=t*ae,z+=t*ue,Y+=t*fe,q+=t*he,$+=t*se,V+=t*oe,ve+=t*ce,ge+=t*le,me+=t*De,t=s[13],W+=t*Z,U+=t*k,I+=t*ee,R+=t*te,P+=t*re,H+=t*ne,K+=t*ie,z+=t*ae,Y+=t*ue,q+=t*fe,$+=t*he,V+=t*se,ve+=t*oe,ge+=t*ce,me+=t*le,Fe+=t*De,t=s[14],U+=t*Z,I+=t*k,R+=t*ee,P+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ae,q+=t*ue,$+=t*fe,V+=t*he,ve+=t*se,ge+=t*oe,me+=t*ce,Fe+=t*le,Re+=t*De,t=s[15],I+=t*Z,R+=t*k,P+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ae,$+=t*ue,V+=t*fe,ve+=t*he,ge+=t*se,me+=t*oe,Fe+=t*ce,Re+=t*le,tt+=t*De,S+=38*R,C+=38*P,F+=38*H,L+=38*K,j+=38*z,B+=38*Y,T+=38*q,M+=38*$,m+=38*V,N+=38*ve,G+=38*ge,J+=38*me,X+=38*Fe,W+=38*Re,U+=38*tt,i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),u[0]=S,u[1]=C,u[2]=F,u[3]=L,u[4]=j,u[5]=B,u[6]=T,u[7]=M,u[8]=m,u[9]=N,u[10]=G,u[11]=J,u[12]=X,u[13]=W,u[14]=U,u[15]=I}function b(u,s){v(u,s,s)}function g(u,s){const h=a();for(let t=0;t<16;t++)h[t]=s[t];for(let t=253;t>=0;t--)b(h,h),t!==2&&t!==4&&v(h,h,s);for(let t=0;t<16;t++)u[t]=h[t]}function A(u,s){const h=new Uint8Array(32),t=new Float64Array(80),i=a(),S=a(),C=a(),F=a(),L=a(),j=a();for(let m=0;m<31;m++)h[m]=u[m];h[31]=u[31]&127|64,h[0]&=248,d(t,s);for(let m=0;m<16;m++)S[m]=t[m];i[0]=F[0]=1;for(let m=254;m>=0;--m){const N=h[m>>>3]>>>(m&7)&1;f(i,S,N),f(C,F,N),E(L,i,C),y(i,i,C),E(C,S,F),y(S,S,F),b(F,L),b(j,i),v(i,C,i),v(C,S,L),E(L,i,C),y(i,i,C),b(S,i),y(C,F,j),v(i,C,l),E(i,i,F),v(C,C,i),v(i,F,j),v(F,S,t),b(S,L),f(i,S,N),f(C,F,N)}for(let m=0;m<16;m++)t[m+16]=i[m],t[m+32]=C[m],t[m+48]=S[m],t[m+64]=F[m];const B=t.subarray(32),T=t.subarray(16);g(B,B),v(T,T,B);const M=new Uint8Array(32);return c(M,T),M}e.scalarMult=A;function p(u){return A(u,D)}e.scalarMultBase=p;function O(u){if(u.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const s=new Uint8Array(u);return{publicKey:p(s),secretKey:s}}e.generateKeyPairFromSeed=O;function o(u){const s=(0,r.randomBytes)(32,u),h=O(s);return(0,n.wipe)(s),h}e.generateKeyPair=o;function _(u,s,h=!1){if(u.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(s.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=A(u,s);if(h){let i=0;for(let S=0;S<t.length;S++)i|=t[S];if(i===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=_})(Ft);function mr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),a=0;a<n.length;a++)n[a]=255;for(var D=0;D<e.length;D++){var l=e.charAt(D),w=l.charCodeAt(0);if(n[w]!==255)throw new TypeError(l+" is ambiguous");n[w]=D}var f=e.length,c=e.charAt(0),d=Math.log(f)/Math.log(256),E=Math.log(256)/Math.log(f);function y(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var A=0,p=0,O=0,o=g.length;O!==o&&g[O]===0;)O++,A++;for(var _=(o-O)*E+1>>>0,u=new Uint8Array(_);O!==o;){for(var s=g[O],h=0,t=_-1;(s!==0||h<p)&&t!==-1;t--,h++)s+=256*u[t]>>>0,u[t]=s%f>>>0,s=s/f>>>0;if(s!==0)throw new Error("Non-zero carry");p=h,O++}for(var i=_-p;i!==_&&u[i]===0;)i++;for(var S=c.repeat(A);i<_;++i)S+=e.charAt(u[i]);return S}function v(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var A=0;if(g[A]!==" "){for(var p=0,O=0;g[A]===c;)p++,A++;for(var o=(g.length-A)*d+1>>>0,_=new Uint8Array(o);g[A];){var u=n[g.charCodeAt(A)];if(u===255)return;for(var s=0,h=o-1;(u!==0||s<O)&&h!==-1;h--,s++)u+=f*_[h]>>>0,_[h]=u%256>>>0,u=u/256>>>0;if(u!==0)throw new Error("Non-zero carry");O=s,A++}if(g[A]!==" "){for(var t=o-O;t!==o&&_[t]===0;)t++;for(var i=new Uint8Array(p+(o-t)),S=p;t!==o;)i[S++]=_[t++];return i}}}function b(g){var A=v(g);if(A)return A;throw new Error(`Non-${r} character`)}return{encode:y,decodeUnsafe:v,decode:b}}var Cr=mr,pr=Cr;const Ar=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Or=e=>new TextDecoder().decode(e);class Fr{constructor(r,n,a){this.name=r,this.prefix=n,this.baseEncode=a}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Nr{constructor(r,n,a){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=a}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Nt(this,r)}}class Tr{constructor(r){this.decoders=r}or(r){return Nt(this,r)}decode(r){const n=r[0],a=this.decoders[n];if(a)return a.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Nt=(e,r)=>new Tr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,a,D){this.name=r,this.prefix=n,this.baseEncode=a,this.baseDecode=D,this.encoder=new Fr(r,n,a),this.decoder=new Nr(r,n,D)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const je=({name:e,prefix:r,encode:n,decode:a})=>new Mr(e,r,n,a),Oe=({prefix:e,name:r,alphabet:n})=>{const{encode:a,decode:D}=pr(n,r);return je({prefix:e,name:r,encode:a,decode:l=>Ar(D(l))})},xr=(e,r,n,a)=>{const D={};for(let E=0;E<r.length;++E)D[r[E]]=E;let l=e.length;for(;e[l-1]==="=";)--l;const w=new Uint8Array(l*n/8|0);let f=0,c=0,d=0;for(let E=0;E<l;++E){const y=D[e[E]];if(y===void 0)throw new SyntaxError(`Non-${a} character`);c=c<<n|y,f+=n,f>=8&&(f-=8,w[d++]=255&c>>f)}if(f>=n||255&c<<8-f)throw new SyntaxError("Unexpected end of data");return w},Lr=(e,r,n)=>{const a=r[r.length-1]==="=",D=(1<<n)-1;let l="",w=0,f=0;for(let c=0;c<e.length;++c)for(f=f<<8|e[c],w+=8;w>n;)w-=n,l+=r[D&f>>w];if(w&&(l+=r[D&f<<n-w]),a)for(;l.length*n&7;)l+="=";return l},Q=({name:e,prefix:r,bitsPerChar:n,alphabet:a})=>je({prefix:r,name:e,encode(D){return Lr(D,a,n)},decode(D){return xr(D,a,n,e)}}),Br=je({prefix:"\0",name:"identity",encode:e=>Or(e),decode:e=>Ur(e)}),jr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Ir=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Ir},Symbol.toStringTag,{value:"Module"})),Pr=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Hr=Object.freeze(Object.defineProperty({__proto__:null,base8:Pr},Symbol.toStringTag,{value:"Module"})),Kr=Oe({prefix:"9",name:"base10",alphabet:"0123456789"}),zr=Object.freeze(Object.defineProperty({__proto__:null,base10:Kr},Symbol.toStringTag,{value:"Module"})),Yr=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qr=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$r=Object.freeze(Object.defineProperty({__proto__:null,base16:Yr,base16upper:qr},Symbol.toStringTag,{value:"Module"})),Gr=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vr=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wr=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Xr=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jr=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qr=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kr=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),tn=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Jr,base32hexpad:Zr,base32hexpadupper:kr,base32hexupper:Qr,base32pad:Wr,base32padupper:Xr,base32upper:Vr,base32z:en},Symbol.toStringTag,{value:"Module"})),rn=Oe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nn=Oe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),an=Object.freeze(Object.defineProperty({__proto__:null,base36:rn,base36upper:nn},Symbol.toStringTag,{value:"Module"})),un=Oe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fn=Oe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),hn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:fn},Symbol.toStringTag,{value:"Module"})),sn=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cn=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:sn,base64pad:on,base64url:cn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Tt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),_n=Tt.reduce((e,r,n)=>(e[n]=r,e),[]),dn=Tt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function En(e){return e.reduce((r,n)=>(r+=_n[n],r),"")}function bn(e){const r=[];for(const n of e){const a=dn[n.codePointAt(0)];if(a===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(a)}return new Uint8Array(r)}const vn=je({prefix:"🚀",name:"base256emoji",encode:En,decode:bn}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:vn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const Ye=require("./index-BU_DiszY.js");var Et={},Me={},x={},bt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(f,c){var d=f>>>16&65535,E=f&65535,y=c>>>16&65535,v=c&65535;return E*v+(d*v+E*y<<16>>>0)|0}e.mul=Math.imul||r;function n(f,c){return f+c|0}e.add=n;function a(f,c){return f-c|0}e.sub=a;function D(f,c){return f<<c|f>>>32-c}e.rotl=D;function l(f,c){return f<<32-c|f>>>c}e.rotr=l;function w(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}e.isInteger=Number.isInteger||w,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(f){return e.isInteger(f)&&f>=-e.MAX_SAFE_INTEGER&&f<=e.MAX_SAFE_INTEGER}})(bt);Object.defineProperty(x,"__esModule",{value:!0});var vt=bt;function It(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}x.readInt16BE=It;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}x.readUint16BE=Rt;function Pt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}x.readInt16LE=Pt;function Ht(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}x.readUint16LE=Ht;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}x.writeUint16BE=wt;x.writeInt16BE=wt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}x.writeUint16LE=yt;x.writeInt16LE=yt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}x.readInt32BE=qe;function $e(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}x.readUint32BE=$e;function Ge(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}x.readInt32LE=Ge;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}x.readUint32LE=Ve;function Ne(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}x.writeUint32BE=Ne;x.writeInt32BE=Ne;function Te(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}x.writeUint32LE=Te;x.writeInt32LE=Te;function Kt(e,r){r===void 0&&(r=0);var n=qe(e,r),a=qe(e,r+4);return n*4294967296+a-(a>>31)*4294967296}x.readInt64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=$e(e,r),a=$e(e,r+4);return n*4294967296+a}x.readUint64BE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ge(e,r),a=Ge(e,r+4);return a*4294967296+n-(n>>31)*4294967296}x.readInt64LE=Yt;function qt(e,r){r===void 0&&(r=0);var n=Ve(e,r),a=Ve(e,r+4);return a*4294967296+n}x.readUint64LE=qt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Ne(e/4294967296>>>0,r,n),Ne(e>>>0,r,n+4),r}x.writeUint64BE=gt;x.writeInt64BE=gt;function St(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Te(e>>>0,r,n),Te(e/4294967296>>>0,r,n+4),r}x.writeUint64LE=St;x.writeInt64LE=St;function $t(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var a=0,D=1,l=e/8+n-1;l>=n;l--)a+=r[l]*D,D*=256;return a}x.readUintBE=$t;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var a=0,D=1,l=n;l<n+e/8;l++)a+=r[l]*D,D*=256;return a}x.readUintLE=Gt;function Vt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var D=1,l=e/8+a-1;l>=a;l--)n[l]=r/D&255,D*=256;return n}x.writeUintBE=Vt;function Wt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var D=1,l=a;l<a+e/8;l++)n[l]=r/D&255,D*=256;return n}x.writeUintLE=Wt;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}x.readFloat32BE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}x.readFloat32LE=Jt;function Qt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}x.readFloat64BE=Qt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}x.readFloat64LE=Zt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e),r}x.writeFloat32BE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e,!0),r}x.writeFloat32LE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e),r}x.writeFloat64BE=tr;function rr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e,!0),r}x.writeFloat64LE=rr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function nr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=nr;Object.defineProperty(Me,"__esModule",{value:!0});var _e=x,We=de,ir=20;function ar(e,r,n){for(var a=1634760805,D=857760878,l=2036477234,w=1797285236,f=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],d=n[11]<<24|n[10]<<16|n[9]<<8|n[8],E=n[15]<<24|n[14]<<16|n[13]<<8|n[12],y=n[19]<<24|n[18]<<16|n[17]<<8|n[16],v=n[23]<<24|n[22]<<16|n[21]<<8|n[20],b=n[27]<<24|n[26]<<16|n[25]<<8|n[24],g=n[31]<<24|n[30]<<16|n[29]<<8|n[28],A=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],o=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=a,u=D,s=l,h=w,t=f,i=c,S=d,C=E,F=y,L=v,j=b,B=g,T=A,M=p,m=O,N=o,G=0;G<ir;G+=2)_=_+t|0,T^=_,T=T>>>16|T<<16,F=F+T|0,t^=F,t=t>>>20|t<<12,u=u+i|0,M^=u,M=M>>>16|M<<16,L=L+M|0,i^=L,i=i>>>20|i<<12,s=s+S|0,m^=s,m=m>>>16|m<<16,j=j+m|0,S^=j,S=S>>>20|S<<12,h=h+C|0,N^=h,N=N>>>16|N<<16,B=B+N|0,C^=B,C=C>>>20|C<<12,s=s+S|0,m^=s,m=m>>>24|m<<8,j=j+m|0,S^=j,S=S>>>25|S<<7,h=h+C|0,N^=h,N=N>>>24|N<<8,B=B+N|0,C^=B,C=C>>>25|C<<7,u=u+i|0,M^=u,M=M>>>24|M<<8,L=L+M|0,i^=L,i=i>>>25|i<<7,_=_+t|0,T^=_,T=T>>>24|T<<8,F=F+T|0,t^=F,t=t>>>25|t<<7,_=_+i|0,N^=_,N=N>>>16|N<<16,j=j+N|0,i^=j,i=i>>>20|i<<12,u=u+S|0,T^=u,T=T>>>16|T<<16,B=B+T|0,S^=B,S=S>>>20|S<<12,s=s+C|0,M^=s,M=M>>>16|M<<16,F=F+M|0,C^=F,C=C>>>20|C<<12,h=h+t|0,m^=h,m=m>>>16|m<<16,L=L+m|0,t^=L,t=t>>>20|t<<12,s=s+C|0,M^=s,M=M>>>24|M<<8,F=F+M|0,C^=F,C=C>>>25|C<<7,h=h+t|0,m^=h,m=m>>>24|m<<8,L=L+m|0,t^=L,t=t>>>25|t<<7,u=u+S|0,T^=u,T=T>>>24|T<<8,B=B+T|0,S^=B,S=S>>>25|S<<7,_=_+i|0,N^=_,N=N>>>24|N<<8,j=j+N|0,i^=j,i=i>>>25|i<<7;_e.writeUint32LE(_+a|0,e,0),_e.writeUint32LE(u+D|0,e,4),_e.writeUint32LE(s+l|0,e,8),_e.writeUint32LE(h+w|0,e,12),_e.writeUint32LE(t+f|0,e,16),_e.writeUint32LE(i+c|0,e,20),_e.writeUint32LE(S+d|0,e,24),_e.writeUint32LE(C+E|0,e,28),_e.writeUint32LE(F+y|0,e,32),_e.writeUint32LE(L+v|0,e,36),_e.writeUint32LE(j+b|0,e,40),_e.writeUint32LE(B+g|0,e,44),_e.writeUint32LE(T+A|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(m+O|0,e,56),_e.writeUint32LE(N+o|0,e,60)}function mt(e,r,n,a,D){if(D===void 0&&(D=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(a.length<n.length)throw new Error("ChaCha: destination is shorter than source");var l,w;if(D===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");l=new Uint8Array(16),w=l.length-r.length,l.set(r,w)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");l=r,w=D}for(var f=new Uint8Array(64),c=0;c<n.length;c+=64){ar(f,l,e);for(var d=c;d<c+64&&d<n.length;d++)a[d]=n[d]^f[d-c];fr(l,0,w)}return We.wipe(f),D===0&&We.wipe(l),a}Me.streamXOR=mt;function ur(e,r,n,a){return a===void 0&&(a=0),We.wipe(n),mt(e,r,n,n,a)}Me.stream=ur;function fr(e,r,n){for(var a=1;n--;)a=a+(e[r]&255)|0,e[r]=a&255,a>>>=8,r++;if(a>0)throw new Error("ChaCha: counter overflow")}var Ct={},be={};Object.defineProperty(be,"__esModule",{value:!0});function hr(e,r,n){return~(e-1)&r|e-1&n}be.select=hr;function sr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=sr;function pt(e,r){if(e.length!==r.length)return 0;for(var n=0,a=0;a<e.length;a++)n|=e[a]^r[a];return 1&n-1>>>8}be.compare=pt;function or(e,r){return e.length===0||r.length===0?!1:pt(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var a=function(){function w(f){this.digestLength=e.DIGEST_LENGTH,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,this._finished=!1;var c=f[0]|f[1]<<8;this._r[0]=c&8191;var d=f[2]|f[3]<<8;this._r[1]=(c>>>13|d<<3)&8191;var E=f[4]|f[5]<<8;this._r[2]=(d>>>10|E<<6)&7939;var y=f[6]|f[7]<<8;this._r[3]=(E>>>7|y<<9)&8191;var v=f[8]|f[9]<<8;this._r[4]=(y>>>4|v<<12)&255,this._r[5]=v>>>1&8190;var b=f[10]|f[11]<<8;this._r[6]=(v>>>14|b<<2)&8191;var g=f[12]|f[13]<<8;this._r[7]=(b>>>11|g<<5)&8065;var A=f[14]|f[15]<<8;this._r[8]=(g>>>8|A<<8)&8191,this._r[9]=A>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return w.prototype._blocks=function(f,c,d){for(var E=this._fin?0:2048,y=this._h[0],v=this._h[1],b=this._h[2],g=this._h[3],A=this._h[4],p=this._h[5],O=this._h[6],o=this._h[7],_=this._h[8],u=this._h[9],s=this._r[0],h=this._r[1],t=this._r[2],i=this._r[3],S=this._r[4],C=this._r[5],F=this._r[6],L=this._r[7],j=this._r[8],B=this._r[9];d>=16;){var T=f[c+0]|f[c+1]<<8;y+=T&8191;var M=f[c+2]|f[c+3]<<8;v+=(T>>>13|M<<3)&8191;var m=f[c+4]|f[c+5]<<8;b+=(M>>>10|m<<6)&8191;var N=f[c+6]|f[c+7]<<8;g+=(m>>>7|N<<9)&8191;var G=f[c+8]|f[c+9]<<8;A+=(N>>>4|G<<12)&8191,p+=G>>>1&8191;var J=f[c+10]|f[c+11]<<8;O+=(G>>>14|J<<2)&8191;var X=f[c+12]|f[c+13]<<8;o+=(J>>>11|X<<5)&8191;var W=f[c+14]|f[c+15]<<8;_+=(X>>>8|W<<8)&8191,u+=W>>>5|E;var U=0,I=U;I+=y*s,I+=v*(5*B),I+=b*(5*j),I+=g*(5*L),I+=A*(5*F),U=I>>>13,I&=8191,I+=p*(5*C),I+=O*(5*S),I+=o*(5*i),I+=_*(5*t),I+=u*(5*h),U+=I>>>13,I&=8191;var R=U;R+=y*h,R+=v*s,R+=b*(5*B),R+=g*(5*j),R+=A*(5*L),U=R>>>13,R&=8191,R+=p*(5*F),R+=O*(5*C),R+=o*(5*S),R+=_*(5*i),R+=u*(5*t),U+=R>>>13,R&=8191;var P=U;P+=y*t,P+=v*h,P+=b*s,P+=g*(5*B),P+=A*(5*j),U=P>>>13,P&=8191,P+=p*(5*L),P+=O*(5*F),P+=o*(5*C),P+=_*(5*S),P+=u*(5*i),U+=P>>>13,P&=8191;var H=U;H+=y*i,H+=v*t,H+=b*h,H+=g*s,H+=A*(5*B),U=H>>>13,H&=8191,H+=p*(5*j),H+=O*(5*L),H+=o*(5*F),H+=_*(5*C),H+=u*(5*S),U+=H>>>13,H&=8191;var K=U;K+=y*S,K+=v*i,K+=b*t,K+=g*h,K+=A*s,U=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*j),K+=o*(5*L),K+=_*(5*F),K+=u*(5*C),U+=K>>>13,K&=8191;var z=U;z+=y*C,z+=v*S,z+=b*i,z+=g*t,z+=A*h,U=z>>>13,z&=8191,z+=p*s,z+=O*(5*B),z+=o*(5*j),z+=_*(5*L),z+=u*(5*F),U+=z>>>13,z&=8191;var Y=U;Y+=y*F,Y+=v*C,Y+=b*S,Y+=g*i,Y+=A*t,U=Y>>>13,Y&=8191,Y+=p*h,Y+=O*s,Y+=o*(5*B),Y+=_*(5*j),Y+=u*(5*L),U+=Y>>>13,Y&=8191;var q=U;q+=y*L,q+=v*F,q+=b*C,q+=g*S,q+=A*i,U=q>>>13,q&=8191,q+=p*t,q+=O*h,q+=o*s,q+=_*(5*B),q+=u*(5*j),U+=q>>>13,q&=8191;var $=U;$+=y*j,$+=v*L,$+=b*F,$+=g*C,$+=A*S,U=$>>>13,$&=8191,$+=p*i,$+=O*t,$+=o*h,$+=_*s,$+=u*(5*B),U+=$>>>13,$&=8191;var V=U;V+=y*B,V+=v*j,V+=b*L,V+=g*F,V+=A*C,U=V>>>13,V&=8191,V+=p*S,V+=O*i,V+=o*t,V+=_*h,V+=u*s,U+=V>>>13,V&=8191,U=(U<<2)+U|0,U=U+I|0,I=U&8191,U=U>>>13,R+=U,y=I,v=R,b=P,g=H,A=K,p=z,O=Y,o=q,_=$,u=V,c+=16,d-=16}this._h[0]=y,this._h[1]=v,this._h[2]=b,this._h[3]=g,this._h[4]=A,this._h[5]=p,this._h[6]=O,this._h[7]=o,this._h[8]=_,this._h[9]=u},w.prototype.finish=function(f,c){c===void 0&&(c=0);var d=new Uint16Array(10),E,y,v,b;if(this._leftover){for(b=this._leftover,this._buffer[b++]=1;b<16;b++)this._buffer[b]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(E=this._h[1]>>>13,this._h[1]&=8191,b=2;b<10;b++)this._h[b]+=E,E=this._h[b]>>>13,this._h[b]&=8191;for(this._h[0]+=E*5,E=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=E,E=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=E,d[0]=this._h[0]+5,E=d[0]>>>13,d[0]&=8191,b=1;b<10;b++)d[b]=this._h[b]+E,E=d[b]>>>13,d[b]&=8191;for(d[9]-=8192,y=(E^1)-1,b=0;b<10;b++)d[b]&=y;for(y=~y,b=0;b<10;b++)this._h[b]=this._h[b]&y|d[b];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,v=this._h[0]+this._pad[0],this._h[0]=v&65535,b=1;b<8;b++)v=(this._h[b]+this._pad[b]|0)+(v>>>16)|0,this._h[b]=v&65535;return f[c+0]=this._h[0]>>>0,f[c+1]=this._h[0]>>>8,f[c+2]=this._h[1]>>>0,f[c+3]=this._h[1]>>>8,f[c+4]=this._h[2]>>>0,f[c+5]=this._h[2]>>>8,f[c+6]=this._h[3]>>>0,f[c+7]=this._h[3]>>>8,f[c+8]=this._h[4]>>>0,f[c+9]=this._h[4]>>>8,f[c+10]=this._h[5]>>>0,f[c+11]=this._h[5]>>>8,f[c+12]=this._h[6]>>>0,f[c+13]=this._h[6]>>>8,f[c+14]=this._h[7]>>>0,f[c+15]=this._h[7]>>>8,this._finished=!0,this},w.prototype.update=function(f){var c=0,d=f.length,E;if(this._leftover){E=16-this._leftover,E>d&&(E=d);for(var y=0;y<E;y++)this._buffer[this._leftover+y]=f[c+y];if(d-=E,c+=E,this._leftover+=E,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(E=d-d%16,this._blocks(f,c,E),c+=E,d-=E),d){for(var y=0;y<d;y++)this._buffer[this._leftover+y]=f[c+y];this._leftover+=d}return this},w.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},w.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},w}();e.Poly1305=a;function D(w,f){var c=new a(w);c.update(f);var d=c.digest();return c.clean(),d}e.oneTimeAuth=D;function l(w,f){return w.length!==e.DIGEST_LENGTH||f.length!==e.DIGEST_LENGTH?!1:r.equal(w,f)}e.equal=l})(Ct);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Me,n=Ct,a=de,D=x,l=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var w=new Uint8Array(16),f=function(){function c(d){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,d.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return c.prototype.seal=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=E.length+this.tagLength,p;if(v){if(v.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");p=v}else p=new Uint8Array(A);return r.streamXOR(this._key,b,E,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),y),a.wipe(b),p},c.prototype.open=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(E.length<this.tagLength)return null;var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,g,E.subarray(0,E.length-this.tagLength),y),!l.equal(A,E.subarray(E.length-this.tagLength,E.length)))return null;var p=E.length-this.tagLength,O;if(v){if(v.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=v}else O=new Uint8Array(p);return r.streamXOR(this._key,b,E.subarray(0,E.length-this.tagLength),O,4),a.wipe(b),O},c.prototype.clean=function(){return a.wipe(this._key),this},c.prototype._authenticate=function(d,E,y,v){var b=new n.Poly1305(E);v&&(b.update(v),v.length%16>0&&b.update(w.subarray(v.length%16))),b.update(y),y.length%16>0&&b.update(w.subarray(y.length%16));var g=new Uint8Array(8);v&&D.writeUint64LE(v.length,g),b.update(g),D.writeUint64LE(y.length,g),b.update(g);for(var A=b.digest(),p=0;p<A.length;p++)d[p]=A[p];b.clean(),a.wipe(A),a.wipe(g)},c}();e.ChaCha20Poly1305=f})(Et);var At={},Ue={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function cr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=cr;Object.defineProperty(Ue,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var a=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(a).clean():a.set(n);for(var D=0;D<a.length;D++)a[D]^=54;this._inner.update(a);for(var D=0;D<a.length;D++)a[D]^=106;this._outer.update(a),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(a)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Ue.HMAC=Ut;function _r(e,r,n){var a=new Ut(e,r);a.update(n);var D=a.digest();return a.clean(),D}Ue.hmac=_r;Ue.equal=lr.equal;Object.defineProperty(At,"__esModule",{value:!0});var rt=Ue,nt=de,dr=function(){function e(r,n,a,D){a===void 0&&(a=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=D;var l=rt.hmac(this._hash,a,n);this._hmac=new rt.HMAC(r,l),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(r){for(var n=new Uint8Array(r),a=0;a<n.length;a++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[a]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),Er=At.HKDF=dr,et={},xe={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.BrowserRandomSource=void 0;const it=65536;class br{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let a=0;a<n.length;a+=it)this._crypto.getRandomValues(n.subarray(a,a+Math.min(n.length-a,it)));return n}}Le.BrowserRandomSource=br;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.NodeRandomSource=void 0;const vr=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ye.commonjsRequire<"u"){const r=Ye.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const a=new Uint8Array(r);for(let D=0;D<a.length;D++)a[D]=n[D];return(0,vr.wipe)(n),a}}Be.NodeRandomSource=wr;Object.defineProperty(xe,"__esModule",{value:!0});xe.SystemRandomSource=void 0;const yr=Le,gr=Be;class Sr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new yr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new gr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}xe.SystemRandomSource=Sr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=xe,n=x,a=de;e.defaultRandomSource=new r.SystemRandomSource;function D(d,E=e.defaultRandomSource){return E.randomBytes(d)}e.randomBytes=D;function l(d=e.defaultRandomSource){const E=D(4,d),y=(0,n.readUint32LE)(E);return(0,a.wipe)(E),y}e.randomUint32=l;const w="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(d,E=w,y=e.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let v="";const b=E.length,g=256-256%b;for(;d>0;){const A=D(Math.ceil(d*256/g),y);for(let p=0;p<A.length&&d>0;p++){const O=A[p];O<g&&(v+=E.charAt(O%b),d--)}(0,a.wipe)(A)}return v}e.randomString=f;function c(d,E=w,y=e.defaultRandomSource){const v=Math.ceil(d/(Math.log(E.length)/Math.LN2));return f(v,E,y)}e.randomStringForEntropy=c})(et);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=x,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var a=function(){function f(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},f.prototype.update=function(c,d){if(d===void 0&&(d=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var E=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=c[E++],d--;this._bufferLength===this.blockSize&&(l(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(E=l(this._temp,this._state,c,E,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=c[E++],d--;return this},f.prototype.finish=function(c){if(!this._finished){var d=this._bytesHashed,E=this._bufferLength,y=d/536870912|0,v=d<<3,b=d%64<56?64:128;this._buffer[E]=128;for(var g=E+1;g<b-8;g++)this._buffer[g]=0;r.writeUint32BE(y,this._buffer,b-8),r.writeUint32BE(v,this._buffer,b-4),l(this._temp,this._state,this._buffer,0,b),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)r.writeUint32BE(this._state[g],c,g*4);return this},f.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(c){n.wipe(c.state),c.buffer&&n.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},f}();e.SHA256=a;var D=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function l(f,c,d,E,y){for(;y>=64;){for(var v=c[0],b=c[1],g=c[2],A=c[3],p=c[4],O=c[5],o=c[6],_=c[7],u=0;u<16;u++){var s=E+u*4;f[u]=r.readUint32BE(d,s)}for(var u=16;u<64;u++){var h=f[u-2],t=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=f[u-15];var i=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;f[u]=(t+f[u-7]|0)+(i+f[u-16]|0)}for(var u=0;u<64;u++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&o)|0)+(_+(D[u]+f[u]|0)|0)|0,i=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&g^b&g)|0;_=o,o=O,O=p,p=A+t|0,A=g,g=b,b=v,v=t+i|0}c[0]+=v,c[1]+=b,c[2]+=g,c[3]+=A,c[4]+=p,c[5]+=O,c[6]+=o,c[7]+=_,E+=64,y-=64}return E}function w(f){var c=new a;c.update(f);var d=c.digest();return c.clean(),d}e.hash=w})(Ot);var Ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function a(u){const s=new Float64Array(16);if(u)for(let h=0;h<u.length;h++)s[h]=u[h];return s}const D=new Uint8Array(32);D[0]=9;const l=a([56129,1]);function w(u){let s=1;for(let h=0;h<16;h++){let t=u[h]+s+65535;s=Math.floor(t/65536),u[h]=t-s*65536}u[0]+=s-1+37*(s-1)}function f(u,s,h){const t=~(h-1);for(let i=0;i<16;i++){const S=t&(u[i]^s[i]);u[i]^=S,s[i]^=S}}function c(u,s){const h=a(),t=a();for(let i=0;i<16;i++)t[i]=s[i];w(t),w(t),w(t);for(let i=0;i<2;i++){h[0]=t[0]-65517;for(let C=1;C<15;C++)h[C]=t[C]-65535-(h[C-1]>>16&1),h[C-1]&=65535;h[15]=t[15]-32767-(h[14]>>16&1);const S=h[15]>>16&1;h[14]&=65535,f(t,h,1-S)}for(let i=0;i<16;i++)u[2*i]=t[i]&255,u[2*i+1]=t[i]>>8}function d(u,s){for(let h=0;h<16;h++)u[h]=s[2*h]+(s[2*h+1]<<8);u[15]&=32767}function E(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]+h[t]}function y(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]-h[t]}function v(u,s,h){let t,i,S=0,C=0,F=0,L=0,j=0,B=0,T=0,M=0,m=0,N=0,G=0,J=0,X=0,W=0,U=0,I=0,R=0,P=0,H=0,K=0,z=0,Y=0,q=0,$=0,V=0,ve=0,ge=0,me=0,Fe=0,Re=0,tt=0,Z=h[0],k=h[1],ee=h[2],te=h[3],re=h[4],ne=h[5],ie=h[6],ae=h[7],ue=h[8],fe=h[9],he=h[10],se=h[11],oe=h[12],ce=h[13],le=h[14],De=h[15];t=s[0],S+=t*Z,C+=t*k,F+=t*ee,L+=t*te,j+=t*re,B+=t*ne,T+=t*ie,M+=t*ae,m+=t*ue,N+=t*fe,G+=t*he,J+=t*se,X+=t*oe,W+=t*ce,U+=t*le,I+=t*De,t=s[1],C+=t*Z,F+=t*k,L+=t*ee,j+=t*te,B+=t*re,T+=t*ne,M+=t*ie,m+=t*ae,N+=t*ue,G+=t*fe,J+=t*he,X+=t*se,W+=t*oe,U+=t*ce,I+=t*le,R+=t*De,t=s[2],F+=t*Z,L+=t*k,j+=t*ee,B+=t*te,T+=t*re,M+=t*ne,m+=t*ie,N+=t*ae,G+=t*ue,J+=t*fe,X+=t*he,W+=t*se,U+=t*oe,I+=t*ce,R+=t*le,P+=t*De,t=s[3],L+=t*Z,j+=t*k,B+=t*ee,T+=t*te,M+=t*re,m+=t*ne,N+=t*ie,G+=t*ae,J+=t*ue,X+=t*fe,W+=t*he,U+=t*se,I+=t*oe,R+=t*ce,P+=t*le,H+=t*De,t=s[4],j+=t*Z,B+=t*k,T+=t*ee,M+=t*te,m+=t*re,N+=t*ne,G+=t*ie,J+=t*ae,X+=t*ue,W+=t*fe,U+=t*he,I+=t*se,R+=t*oe,P+=t*ce,H+=t*le,K+=t*De,t=s[5],B+=t*Z,T+=t*k,M+=t*ee,m+=t*te,N+=t*re,G+=t*ne,J+=t*ie,X+=t*ae,W+=t*ue,U+=t*fe,I+=t*he,R+=t*se,P+=t*oe,H+=t*ce,K+=t*le,z+=t*De,t=s[6],T+=t*Z,M+=t*k,m+=t*ee,N+=t*te,G+=t*re,J+=t*ne,X+=t*ie,W+=t*ae,U+=t*ue,I+=t*fe,R+=t*he,P+=t*se,H+=t*oe,K+=t*ce,z+=t*le,Y+=t*De,t=s[7],M+=t*Z,m+=t*k,N+=t*ee,G+=t*te,J+=t*re,X+=t*ne,W+=t*ie,U+=t*ae,I+=t*ue,R+=t*fe,P+=t*he,H+=t*se,K+=t*oe,z+=t*ce,Y+=t*le,q+=t*De,t=s[8],m+=t*Z,N+=t*k,G+=t*ee,J+=t*te,X+=t*re,W+=t*ne,U+=t*ie,I+=t*ae,R+=t*ue,P+=t*fe,H+=t*he,K+=t*se,z+=t*oe,Y+=t*ce,q+=t*le,$+=t*De,t=s[9],N+=t*Z,G+=t*k,J+=t*ee,X+=t*te,W+=t*re,U+=t*ne,I+=t*ie,R+=t*ae,P+=t*ue,H+=t*fe,K+=t*he,z+=t*se,Y+=t*oe,q+=t*ce,$+=t*le,V+=t*De,t=s[10],G+=t*Z,J+=t*k,X+=t*ee,W+=t*te,U+=t*re,I+=t*ne,R+=t*ie,P+=t*ae,H+=t*ue,K+=t*fe,z+=t*he,Y+=t*se,q+=t*oe,$+=t*ce,V+=t*le,ve+=t*De,t=s[11],J+=t*Z,X+=t*k,W+=t*ee,U+=t*te,I+=t*re,R+=t*ne,P+=t*ie,H+=t*ae,K+=t*ue,z+=t*fe,Y+=t*he,q+=t*se,$+=t*oe,V+=t*ce,ve+=t*le,ge+=t*De,t=s[12],X+=t*Z,W+=t*k,U+=t*ee,I+=t*te,R+=t*re,P+=t*ne,H+=t*ie,K+=t*ae,z+=t*ue,Y+=t*fe,q+=t*he,$+=t*se,V+=t*oe,ve+=t*ce,ge+=t*le,me+=t*De,t=s[13],W+=t*Z,U+=t*k,I+=t*ee,R+=t*te,P+=t*re,H+=t*ne,K+=t*ie,z+=t*ae,Y+=t*ue,q+=t*fe,$+=t*he,V+=t*se,ve+=t*oe,ge+=t*ce,me+=t*le,Fe+=t*De,t=s[14],U+=t*Z,I+=t*k,R+=t*ee,P+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ae,q+=t*ue,$+=t*fe,V+=t*he,ve+=t*se,ge+=t*oe,me+=t*ce,Fe+=t*le,Re+=t*De,t=s[15],I+=t*Z,R+=t*k,P+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ae,$+=t*ue,V+=t*fe,ve+=t*he,ge+=t*se,me+=t*oe,Fe+=t*ce,Re+=t*le,tt+=t*De,S+=38*R,C+=38*P,F+=38*H,L+=38*K,j+=38*z,B+=38*Y,T+=38*q,M+=38*$,m+=38*V,N+=38*ve,G+=38*ge,J+=38*me,X+=38*Fe,W+=38*Re,U+=38*tt,i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),u[0]=S,u[1]=C,u[2]=F,u[3]=L,u[4]=j,u[5]=B,u[6]=T,u[7]=M,u[8]=m,u[9]=N,u[10]=G,u[11]=J,u[12]=X,u[13]=W,u[14]=U,u[15]=I}function b(u,s){v(u,s,s)}function g(u,s){const h=a();for(let t=0;t<16;t++)h[t]=s[t];for(let t=253;t>=0;t--)b(h,h),t!==2&&t!==4&&v(h,h,s);for(let t=0;t<16;t++)u[t]=h[t]}function A(u,s){const h=new Uint8Array(32),t=new Float64Array(80),i=a(),S=a(),C=a(),F=a(),L=a(),j=a();for(let m=0;m<31;m++)h[m]=u[m];h[31]=u[31]&127|64,h[0]&=248,d(t,s);for(let m=0;m<16;m++)S[m]=t[m];i[0]=F[0]=1;for(let m=254;m>=0;--m){const N=h[m>>>3]>>>(m&7)&1;f(i,S,N),f(C,F,N),E(L,i,C),y(i,i,C),E(C,S,F),y(S,S,F),b(F,L),b(j,i),v(i,C,i),v(C,S,L),E(L,i,C),y(i,i,C),b(S,i),y(C,F,j),v(i,C,l),E(i,i,F),v(C,C,i),v(i,F,j),v(F,S,t),b(S,L),f(i,S,N),f(C,F,N)}for(let m=0;m<16;m++)t[m+16]=i[m],t[m+32]=C[m],t[m+48]=S[m],t[m+64]=F[m];const B=t.subarray(32),T=t.subarray(16);g(B,B),v(T,T,B);const M=new Uint8Array(32);return c(M,T),M}e.scalarMult=A;function p(u){return A(u,D)}e.scalarMultBase=p;function O(u){if(u.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const s=new Uint8Array(u);return{publicKey:p(s),secretKey:s}}e.generateKeyPairFromSeed=O;function o(u){const s=(0,r.randomBytes)(32,u),h=O(s);return(0,n.wipe)(s),h}e.generateKeyPair=o;function _(u,s,h=!1){if(u.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(s.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=A(u,s);if(h){let i=0;for(let S=0;S<t.length;S++)i|=t[S];if(i===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=_})(Ft);function mr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),a=0;a<n.length;a++)n[a]=255;for(var D=0;D<e.length;D++){var l=e.charAt(D),w=l.charCodeAt(0);if(n[w]!==255)throw new TypeError(l+" is ambiguous");n[w]=D}var f=e.length,c=e.charAt(0),d=Math.log(f)/Math.log(256),E=Math.log(256)/Math.log(f);function y(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var A=0,p=0,O=0,o=g.length;O!==o&&g[O]===0;)O++,A++;for(var _=(o-O)*E+1>>>0,u=new Uint8Array(_);O!==o;){for(var s=g[O],h=0,t=_-1;(s!==0||h<p)&&t!==-1;t--,h++)s+=256*u[t]>>>0,u[t]=s%f>>>0,s=s/f>>>0;if(s!==0)throw new Error("Non-zero carry");p=h,O++}for(var i=_-p;i!==_&&u[i]===0;)i++;for(var S=c.repeat(A);i<_;++i)S+=e.charAt(u[i]);return S}function v(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var A=0;if(g[A]!==" "){for(var p=0,O=0;g[A]===c;)p++,A++;for(var o=(g.length-A)*d+1>>>0,_=new Uint8Array(o);g[A];){var u=n[g.charCodeAt(A)];if(u===255)return;for(var s=0,h=o-1;(u!==0||s<O)&&h!==-1;h--,s++)u+=f*_[h]>>>0,_[h]=u%256>>>0,u=u/256>>>0;if(u!==0)throw new Error("Non-zero carry");O=s,A++}if(g[A]!==" "){for(var t=o-O;t!==o&&_[t]===0;)t++;for(var i=new Uint8Array(p+(o-t)),S=p;t!==o;)i[S++]=_[t++];return i}}}function b(g){var A=v(g);if(A)return A;throw new Error(`Non-${r} character`)}return{encode:y,decodeUnsafe:v,decode:b}}var Cr=mr,pr=Cr;const Ar=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Or=e=>new TextDecoder().decode(e);class Fr{constructor(r,n,a){this.name=r,this.prefix=n,this.baseEncode=a}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Nr{constructor(r,n,a){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=a}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Nt(this,r)}}class Tr{constructor(r){this.decoders=r}or(r){return Nt(this,r)}decode(r){const n=r[0],a=this.decoders[n];if(a)return a.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Nt=(e,r)=>new Tr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,a,D){this.name=r,this.prefix=n,this.baseEncode=a,this.baseDecode=D,this.encoder=new Fr(r,n,a),this.decoder=new Nr(r,n,D)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const je=({name:e,prefix:r,encode:n,decode:a})=>new Mr(e,r,n,a),Oe=({prefix:e,name:r,alphabet:n})=>{const{encode:a,decode:D}=pr(n,r);return je({prefix:e,name:r,encode:a,decode:l=>Ar(D(l))})},xr=(e,r,n,a)=>{const D={};for(let E=0;E<r.length;++E)D[r[E]]=E;let l=e.length;for(;e[l-1]==="=";)--l;const w=new Uint8Array(l*n/8|0);let f=0,c=0,d=0;for(let E=0;E<l;++E){const y=D[e[E]];if(y===void 0)throw new SyntaxError(`Non-${a} character`);c=c<<n|y,f+=n,f>=8&&(f-=8,w[d++]=255&c>>f)}if(f>=n||255&c<<8-f)throw new SyntaxError("Unexpected end of data");return w},Lr=(e,r,n)=>{const a=r[r.length-1]==="=",D=(1<<n)-1;let l="",w=0,f=0;for(let c=0;c<e.length;++c)for(f=f<<8|e[c],w+=8;w>n;)w-=n,l+=r[D&f>>w];if(w&&(l+=r[D&f<<n-w]),a)for(;l.length*n&7;)l+="=";return l},Q=({name:e,prefix:r,bitsPerChar:n,alphabet:a})=>je({prefix:r,name:e,encode(D){return Lr(D,a,n)},decode(D){return xr(D,a,n,e)}}),Br=je({prefix:"\0",name:"identity",encode:e=>Or(e),decode:e=>Ur(e)}),jr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Ir=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Ir},Symbol.toStringTag,{value:"Module"})),Pr=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Hr=Object.freeze(Object.defineProperty({__proto__:null,base8:Pr},Symbol.toStringTag,{value:"Module"})),Kr=Oe({prefix:"9",name:"base10",alphabet:"0123456789"}),zr=Object.freeze(Object.defineProperty({__proto__:null,base10:Kr},Symbol.toStringTag,{value:"Module"})),Yr=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qr=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$r=Object.freeze(Object.defineProperty({__proto__:null,base16:Yr,base16upper:qr},Symbol.toStringTag,{value:"Module"})),Gr=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vr=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wr=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Xr=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jr=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qr=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kr=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),tn=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Jr,base32hexpad:Zr,base32hexpadupper:kr,base32hexupper:Qr,base32pad:Wr,base32padupper:Xr,base32upper:Vr,base32z:en},Symbol.toStringTag,{value:"Module"})),rn=Oe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nn=Oe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),an=Object.freeze(Object.defineProperty({__proto__:null,base36:rn,base36upper:nn},Symbol.toStringTag,{value:"Module"})),un=Oe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fn=Oe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),hn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:fn},Symbol.toStringTag,{value:"Module"})),sn=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cn=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:sn,base64pad:on,base64url:cn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Tt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),_n=Tt.reduce((e,r,n)=>(e[n]=r,e),[]),dn=Tt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function En(e){return e.reduce((r,n)=>(r+=_n[n],r),"")}function bn(e){const r=[];for(const n of e){const a=dn[n.codePointAt(0)];if(a===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(a)}return new Uint8Array(r)}const vn=je({prefix:"🚀",name:"base256emoji",encode:En,decode:bn}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:vn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (n, f, e) =>
|
|
4
|
-
import { ar as y,
|
|
5
|
-
import "./index-
|
|
1
|
+
var K = Object.defineProperty;
|
|
2
|
+
var Q = (n, f, e) => f in n ? K(n, f, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[f] = e;
|
|
3
|
+
var d = (n, f, e) => Q(n, typeof f != "symbol" ? f + "" : f, e);
|
|
4
|
+
import { ar as y, bU as f0, bV as z, bW as p, bX as e0, bY as a0, bZ as t0, b_ as _, b$ as b0, c0 as n0, c1 as d0, aj as L, c2 as O, E as v, a as C, c3 as D, u as U, bM as u, c4 as H, bP as c0, c5 as N, bR as q, bS as j, a8 as s0, c6 as i0, c7 as I, bH as S, aA as $, bT as V, _ as X } from "./index-7zA9RXv7.mjs";
|
|
5
|
+
import "./index-CDHEzcRs.mjs";
|
|
6
6
|
const r0 = new RegExp("^bytes([0-9]+)$"), p0 = new RegExp("^(u?int)([0-9]*)$"), y0 = new RegExp("^(.*)\\[([0-9]*)\\]$");
|
|
7
|
-
function
|
|
7
|
+
function Y(n, f, e) {
|
|
8
8
|
switch (n) {
|
|
9
9
|
case "address":
|
|
10
10
|
return e ? p(_(f, 32)) : p(a0(f));
|
|
@@ -29,7 +29,7 @@ function X(n, f, e) {
|
|
|
29
29
|
y(b === f.length, `invalid array length for ${n}`, "value", f);
|
|
30
30
|
const c = [];
|
|
31
31
|
return f.forEach(function(s) {
|
|
32
|
-
c.push(
|
|
32
|
+
c.push(Y(t, s, !0));
|
|
33
33
|
}), p(z(c));
|
|
34
34
|
}
|
|
35
35
|
y(!1, "invalid type", "type", n);
|
|
@@ -38,7 +38,7 @@ function o0(n, f) {
|
|
|
38
38
|
y(n.length === f.length, "wrong number of values; expected ${ types.length }", "values", f);
|
|
39
39
|
const e = [];
|
|
40
40
|
return n.forEach(function(a, t) {
|
|
41
|
-
e.push(
|
|
41
|
+
e.push(Y(a, f[t]));
|
|
42
42
|
}), f0(z(e));
|
|
43
43
|
}
|
|
44
44
|
class E {
|
|
@@ -101,20 +101,20 @@ class E {
|
|
|
101
101
|
if (!e)
|
|
102
102
|
throw new Error(`No receipt for ${f} on ${this.chain}`);
|
|
103
103
|
const a = e.logs.filter((o) => o.topics[0] === this.messageSentEventHash).map((o) => {
|
|
104
|
-
const { topics:
|
|
104
|
+
const { topics: G, data: J } = o;
|
|
105
105
|
return this.msgTransmitter.interface.parseLog({
|
|
106
|
-
topics:
|
|
107
|
-
data:
|
|
106
|
+
topics: G.slice(),
|
|
107
|
+
data: J
|
|
108
108
|
});
|
|
109
109
|
}).filter((o) => !!o);
|
|
110
110
|
if (a.length === 0)
|
|
111
111
|
throw new Error(`No log message for message transmitter found in ${f}`);
|
|
112
112
|
a.length > 1 && console.error(`Expected 1 event to be found for transaction, got>${a.length}}`);
|
|
113
|
-
const [t] = a, { message: b } = t.args, [c, s] = D.deserialize(U.decode(b)), { payload: i } = c, r = i.messageSender, T = i.mintRecipient, g = N(this.network, c.sourceDomain), A = N(this.network, c.destinationDomain),
|
|
113
|
+
const [t] = a, { message: b } = t.args, [c, s] = D.deserialize(U.decode(b)), { payload: i } = c, r = i.messageSender, T = i.mintRecipient, g = N(this.network, c.sourceDomain), A = N(this.network, c.destinationDomain), Z = { chain: g, address: i.burnToken };
|
|
114
114
|
return {
|
|
115
115
|
from: { chain: g, address: r },
|
|
116
116
|
to: { chain: A, address: T },
|
|
117
|
-
token:
|
|
117
|
+
token: Z,
|
|
118
118
|
amount: i.amount,
|
|
119
119
|
message: c,
|
|
120
120
|
id: { hash: s }
|
|
@@ -2323,8 +2323,8 @@ const T0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2323
2323
|
TokenMessenger: g0,
|
|
2324
2324
|
TokenMessenger__factory: R
|
|
2325
2325
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2326
|
-
V(
|
|
2327
|
-
V(
|
|
2326
|
+
V(X, "CircleBridge", E);
|
|
2327
|
+
V(X, "AutomaticCircleBridge", B);
|
|
2328
2328
|
export {
|
|
2329
2329
|
B as EvmAutomaticCircleBridge,
|
|
2330
2330
|
E as EvmCircleBridge,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var $ = Object.defineProperty;
|
|
2
2
|
var V = (i, e, b) => e in i ? $(i, e, { enumerable: !0, configurable: !0, writable: !0, value: b }) : i[e] = b;
|
|
3
3
|
var d = (i, e, b) => V(i, typeof e != "symbol" ? e + "" : e, b);
|
|
4
|
-
import { aj as E, E as o,
|
|
4
|
+
import { aj as E, E as o, c8 as x, a8 as l, bN as z, c9 as j, a as c, p as k, ca as L, cb as Z, bO as g, cc as W, cd as T, bM as s, ce as _, bR as P, bS as N, c7 as F, bH as q, aA as H, bT as D, _ as O } from "./index-7zA9RXv7.mjs";
|
|
5
5
|
class B {
|
|
6
6
|
constructor(e, b, a, t) {
|
|
7
7
|
d(this, "network");
|
|
@@ -79,12 +79,12 @@ class B {
|
|
|
79
79
|
const I = await u.approve.populateTransaction(this.tokenBridge.target, t);
|
|
80
80
|
yield this.createUnsignedTx(s(I, f), "TokenBridge.Approve");
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const v = [
|
|
83
83
|
y,
|
|
84
84
|
t,
|
|
85
85
|
p,
|
|
86
86
|
r
|
|
87
|
-
], R = await (n === void 0 ? this.tokenBridge.transferTokens.populateTransaction(...
|
|
87
|
+
], R = await (n === void 0 ? this.tokenBridge.transferTokens.populateTransaction(...v, W, T) : this.tokenBridge.transferTokensWithPayload.populateTransaction(...v, T, n));
|
|
88
88
|
yield this.createUnsignedTx(s(R, f), "TokenBridge.transferTokens" + (n === void 0 ? "" : "WithPayload"));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -159,9 +159,9 @@ class C {
|
|
|
159
159
|
);
|
|
160
160
|
yield this.createUnsignedTx(s(u, f), "TokenBridgeRelayer.wrapAndTransferETHWithRelay");
|
|
161
161
|
} else {
|
|
162
|
-
const u = new c(a).toString(),
|
|
163
|
-
if (await
|
|
164
|
-
const I = await
|
|
162
|
+
const u = new c(a).toString(), M = o.getTokenImplementation(this.provider, u);
|
|
163
|
+
if (await M.allowance(f, this.tokenBridgeRelayer.target) < t) {
|
|
164
|
+
const I = await M.approve.populateTransaction(this.tokenBridgeRelayer.target, t);
|
|
165
165
|
yield this.createUnsignedTx(s(I, f), "AutomaticTokenBridge.Approve");
|
|
166
166
|
}
|
|
167
167
|
const R = await this.tokenBridgeRelayer.transferTokensWithRelay.populateTransaction(u, t, y, p, r, 0);
|
|
@@ -1424,7 +1424,7 @@ class m extends F {
|
|
|
1424
1424
|
return new q(h);
|
|
1425
1425
|
}
|
|
1426
1426
|
static connect(e, b) {
|
|
1427
|
-
return new
|
|
1427
|
+
return new H(e, h, b);
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
1430
|
d(m, "bytecode", S), d(m, "abi", h);
|
|
@@ -2486,7 +2486,7 @@ class A extends F {
|
|
|
2486
2486
|
return new q(w);
|
|
2487
2487
|
}
|
|
2488
2488
|
static connect(e, b) {
|
|
2489
|
-
return new
|
|
2489
|
+
return new H(e, w, b);
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
2492
|
d(A, "bytecode", U), d(A, "abi", w);
|
|
@@ -2495,8 +2495,8 @@ const X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2495
2495
|
Bridge__factory: m,
|
|
2496
2496
|
TokenBridgeRelayer__factory: A
|
|
2497
2497
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2498
|
-
|
|
2499
|
-
|
|
2498
|
+
D(O, "TokenBridge", B);
|
|
2499
|
+
D(O, "AutomaticTokenBridge", C);
|
|
2500
2500
|
export {
|
|
2501
2501
|
C as EvmAutomaticTokenBridge,
|
|
2502
2502
|
B as EvmTokenBridge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var q=(o,e,n)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var p=(o,e,n)=>q(o,typeof e!="symbol"?e+"":e,n);const t=require("./index-CEovIwuS.js"),H=require("./algorand-BAFj4ZGa.js");class j{constructor(e,n,r,s,i=!1){p(this,"transaction");p(this,"network");p(this,"chain");p(this,"description");p(this,"parallelizable");this.transaction=e,this.network=n,this.chain=r,this.description=s,this.parallelizable=i}}const K=1002e3,O=15,U=127,L=8,R=U*L,V=U*O,N=L*V,m={_limit:127,encodingLength:o=>{let e=0;for(;o>=128;e++)o>>=7;return e+1},encode:(o,e,n)=>{if(typeof o=="bigint"&&(o=t.safeBigIntToNumber(o)),o<0)throw new RangeError("value must be unsigned");const r=m.encodingLength(o);if(e=e||new ArrayBuffer(r),n=n||0,e.byteLength<n+r)throw new RangeError("the buffer is too small to encode the number at the offset");const s=new Uint8Array(e,n);let i=0;for(;m._limit<o;)s[i++]=o&m._limit|128,o>>=7;return s[i]=Number(o),s},decode:(o,e=0)=>{let n=0,r=0,s;do{if(s=o[e+r],s===void 0)throw new RangeError("offset out of range");n+=(s&m._limit)<<r*7,r++}while(128<=s);return n}},u={forMessageId:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey,r=e.emitter.toUniversalAddress().toUint8Array(),s=t.bignum.toBytes(BigInt(t.toChainId(e.chain)),2),i=t.bytes.concat(s,r);return u.fromData({appId:o,appAddress:n,idx:e.sequence/BigInt(N),address:i})},forWrappedAsset:(o,e)=>{if(t.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(t.toChainId(e.chain)),address:e.address.toUniversalAddress().toUint8Array()})},forNativeAsset:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:e,address:t.bytes.encode("native")})},forGuardianSet:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(e),address:t.bytes.encode("guardian")})},forEmitter:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:0n,address:e})},_encode:o=>typeof o=="bigint"?[t.hex.encode(m.encode(o))]:[t.hex.encode(m.encode(o.length)),t.hex.encode(o)],fromData:o=>{const e=["0620010181",...u._encode(o.idx),"4880",...u._encode(o.address),"483110810612443119221244311881",...u._encode(o.appId),"1244312080",...u._encode(o.appAddress),"124431018100124431093203124431153203124422"],n=t.hex.decode(e.join(""));return new t.LogicSigAccount(n)},decodeLocalState:async(o,e,n)=>{let r;try{const a=await o.accountApplicationInformation(n,t.safeBigIntToNumber(e)).do();r=t.AccountApplicationResponse.from_obj_for_encoding(a).appLocalState}catch{return new Uint8Array}const s=t.b64.encode("meta");let i=new Map;for(const a of r.keyValue){if(a.key===s)continue;const g=t.b64.decode(a.key)[0],l=t.b64.decode(a.value.bytes);i.set(g,l)}const d=[];for(let a=0;a<O;a++)i.has(a)&&d.push(i.get(a));return t.bytes.concat(...d)},checkBitsSet:async(o,e,n,r)=>{let s=!1,i;const d=await o.accountInformation(n).do(),g=t.Account.from_obj_for_encoding(d).appsLocalState;if(g&&g.forEach(h=>{BigInt(h.id)===e&&(i=h.keyValue)}),(i==null?void 0:i.length)===0)return s;const l=BigInt(N),f=BigInt(8),y=r/l*l,b=t.safeBigIntToNumber(r-y),T=Math.floor(b/R),x=Math.floor((b-T*R)/8),B=t.b64.encode(t.bignum.toBytes(T,1));return i==null||i.forEach(h=>{if(h.key===B){const _=t.dist.Buffer.from(h.value.bytes,"base64"),w=1<<t.safeBigIntToNumber(r%f);s=(_[x]&w)!=0;return}}),s},storageAccountExists:async(o,e,n)=>{try{const r=await o.accountApplicationInformation(e,t.safeBigIntToNumber(n)).do();return Object.keys(r).length>0}catch{}return!1}},c=class c{constructor(e,n,r,s){p(this,"network");p(this,"chain");p(this,"connection");p(this,"contracts");p(this,"chainId");p(this,"coreAppId");p(this,"coreAppAddress");p(this,"tokenBridgeAppId");p(this,"tokenBridgeAppAddress");if(this.network=e,this.chain=n,this.connection=r,this.contracts=s,this.chainId=t.toChainId(n),!s.coreBridge)throw new Error(`Core contract address for chain ${n} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=t.getApplicationAddress(i),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${n} not found`);const d=BigInt(s.tokenBridge);this.tokenBridgeAppId=d,this.tokenBridgeAppAddress=t.getApplicationAddress(d)}getGuardianSet(e){throw new Error("Method not implemented.")}async*verifyMessage(e,n,r){const s=new t.AlgorandAddress(e).toString(),i=await c.submitVAAHeader(this.connection,this.coreAppId,r??this.coreAppId,n,s);for(const d of i.txs)yield this.createUnsignedTx(d,"Core.verifyMessage")}static async fromRpc(e,n){const[r,s]=await H.AlgorandPlatform.chainFromRpc(e),i=n[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} !== ${r}`);return new c(r,s,e,i.contracts)}async*publishMessage(e,n){const r=new t.AlgorandAddress(e),s=r.toString(),i=await this.connection.getTransactionParams().do(),d=u.forEmitter(this.coreAppId,r.toUint8Array()),{accounts:a,txs:g}=await c.maybeCreateStorageTx(this.connection,s,this.coreAppId,d,i);for(const f of g)yield this.createUnsignedTx(f,"Core.publishMessage",!0);const l=t.makeApplicationCallTxnFromObject({from:s,appIndex:t.safeBigIntToNumber(this.coreAppId),appArgs:[c.publishMessage,n,t.bignum.toBytes(0n,8)],accounts:a,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:i});yield this.createUnsignedTx({tx:l},"Core.publishMessage",!0)}async getMessageFee(){var s;const e=await this.connection.getApplicationByID(t.safeBigIntToNumber(this.coreAppId)).do(),r=(s=t.Application.from_obj_for_encoding(e).params.globalState)==null?void 0:s.find(i=>i.key===c.feeKey);return r?BigInt(r.value.uint):0n}async getGuardianSetIndex(){throw new Error("Not implemented")}async parseTransaction(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r).map(s=>({chain:s.emitterChain,emitter:s.emitterAddress,sequence:s.sequence}))}async parseMessages(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r)}parseTx(e){const n=[];if(e.innerTxns&&e.innerTxns.length>0&&n.push(...e.innerTxns.flatMap(g=>this.parseTx(g))),BigInt(e.txn.txn.apid??0)!==this.coreAppId||!e.logs||e.logs.length===0)return n;const r=e.txn.txn.apaa??[];if(r.length!==3||!t.bytes.equals(new Uint8Array(r[0]),c.publishMessage))return n;const s=t.bignum.decode(e.logs[0]),i=new t.AlgorandAddress(e.txn.txn.snd).toUniversalAddress(),d=new Uint8Array(r[1]),a=t.bignum.decode(r[2]);return n.push(t.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:i,sequence:s,guardianSet:0,timestamp:0,consistencyLevel:0,nonce:Number(a),payload:d,signatures:[]})),n}static async maybeCreateStorageTx(e,n,r,s,i){const d=t.getApplicationAddress(r),a=s.address(),g=[];if(await u.storageAccountExists(e,a,r))return{accounts:[a],txs:g};i=i??await e.getTransactionParams().do();const l=t.makePaymentTxnWithSuggestedParamsFromObject({from:n,to:a,amount:K,suggestedParams:i});l.fee=l.fee*2,g.push({tx:l});const f=t.makeApplicationOptInTxnFromObject({from:a,appIndex:t.safeBigIntToNumber(r),rekeyTo:d,suggestedParams:i});return f.fee=0,g.push({tx:f,signer:{address:s.address(),signTxn:y=>Promise.resolve(t.signLogicSigTransaction(y,s).blob)}}),{accounts:[a],txs:g}}static async submitVAAHeader(e,n,r,s,i,d){d=d??await e.getTransactionParams().do();let a=[];const g=u.forMessageId(r,{chain:s.emitterChain,sequence:s.sequence,emitter:s.emitterAddress}),{accounts:l,txs:f}=await c.maybeCreateStorageTx(e,i,r,g,d);a.push(...f);const y=u.forGuardianSet(n,s.guardianSet),{accounts:[b],txs:T}=await c.maybeCreateStorageTx(e,i,n,y,d);a.push(...T);let x=[...l,b];const B=await u.decodeLocalState(e,n,b),h=t.keccak_256(s.hash),_=s.signatures.length,w=Math.ceil(_/c.MAX_SIGS_PER_TXN),k=20,C=new t.LogicSigAccount(c.ALGO_VERIFY);for(let M=0;M<w;M++){const v=M*c.MAX_SIGS_PER_TXN,S=s.signatures.slice(v,v+c.MAX_SIGS_PER_TXN),F=S.length*k,G=new Uint8Array(F);for(let A=0;A<S.length;A++){const P=S[A],Y=B.slice(P.guardianIndex*k+1,(P.guardianIndex+1)*k+1);G.set(Y,A*20)}const X=t.makeApplicationCallTxnFromObject({appArgs:[c.verifySigs,t.bytes.concat(...S.map(A=>t.bytes.concat(new Uint8Array([A.guardianIndex]),A.signature.encode()))),G,h],accounts:x,appIndex:t.safeBigIntToNumber(n),from:c.ALGO_VERIFY_HASH,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});X.fee=0,a.push({tx:X,signer:{address:C.address(),signTxn:A=>Promise.resolve(t.signLogicSigTransaction(A,C).blob)}})}const E=t.makeApplicationCallTxnFromObject({appArgs:[c.verifyVaa,t.serialize(s)],accounts:x,appIndex:t.safeBigIntToNumber(n),from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});return E.fee=E.fee*(2+w),a.push({tx:E}),{accounts:x,txs:a}}createUnsignedTx(e,n,r=!0){return new j(e,this.network,this.chain,n,r)}};p(c,"MAX_SIGS_PER_TXN",6),p(c,"ALGO_VERIFY_HASH","EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"),p(c,"ALGO_VERIFY",new Uint8Array([6,32,4,1,0,32,20,38,1,0,49,32,50,3,18,68,49,1,35,18,68,49,16,129,6,18,68,54,26,1,54,26,3,54,26,2,136,0,3,68,34,67,53,2,53,1,53,0,40,53,240,40,53,241,52,0,21,53,5,35,53,3,35,53,4,52,3,52,5,12,65,0,68,52,1,52,0,52,3,129,65,8,34,88,23,52,0,52,3,34,8,36,88,52,0,52,3,129,33,8,36,88,7,0,53,241,53,240,52,2,52,4,37,88,52,240,52,241,80,2,87,12,20,18,68,52,3,129,66,8,53,3,52,4,37,8,53,4,66,255,180,34,137])),p(c,"feeKey",t.b64.encode("MessageFee")),p(c,"verifyVaa",t.bytes.encode("verifyVAA")),p(c,"verifySigs",t.bytes.encode("verifySigs")),p(c,"publishMessage",t.bytes.encode("publishMessage"));let I=c;t.registerProtocol("Algorand","WormholeCore",I);const z=Object.freeze(Object.defineProperty({__proto__:null,AlgorandWormholeCore:I,BITS_PER_BYTE:L,BITS_PER_KEY:R,MAX_BITS:N,MAX_BYTES:V,MAX_BYTES_PER_KEY:U,MAX_KEYS:O,SEED_AMT:K,StorageLogicSig:u,varint:m},Symbol.toStringTag,{value:"Module"}));exports.AlgorandUnsignedTransaction=j;exports.AlgorandWormholeCore=I;exports.StorageLogicSig=u;exports.index=z;
|
|
1
|
+
"use strict";var D=Object.defineProperty;var q=(o,e,n)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var p=(o,e,n)=>q(o,typeof e!="symbol"?e+"":e,n);const t=require("./index-BU_DiszY.js"),H=require("./algorand-wRfrbOd6.js");class j{constructor(e,n,r,s,i=!1){p(this,"transaction");p(this,"network");p(this,"chain");p(this,"description");p(this,"parallelizable");this.transaction=e,this.network=n,this.chain=r,this.description=s,this.parallelizable=i}}const K=1002e3,O=15,U=127,L=8,R=U*L,V=U*O,N=L*V,m={_limit:127,encodingLength:o=>{let e=0;for(;o>=128;e++)o>>=7;return e+1},encode:(o,e,n)=>{if(typeof o=="bigint"&&(o=t.safeBigIntToNumber(o)),o<0)throw new RangeError("value must be unsigned");const r=m.encodingLength(o);if(e=e||new ArrayBuffer(r),n=n||0,e.byteLength<n+r)throw new RangeError("the buffer is too small to encode the number at the offset");const s=new Uint8Array(e,n);let i=0;for(;m._limit<o;)s[i++]=o&m._limit|128,o>>=7;return s[i]=Number(o),s},decode:(o,e=0)=>{let n=0,r=0,s;do{if(s=o[e+r],s===void 0)throw new RangeError("offset out of range");n+=(s&m._limit)<<r*7,r++}while(128<=s);return n}},u={forMessageId:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey,r=e.emitter.toUniversalAddress().toUint8Array(),s=t.bignum.toBytes(BigInt(t.toChainId(e.chain)),2),i=t.bytes.concat(s,r);return u.fromData({appId:o,appAddress:n,idx:e.sequence/BigInt(N),address:i})},forWrappedAsset:(o,e)=>{if(t.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(t.toChainId(e.chain)),address:e.address.toUniversalAddress().toUint8Array()})},forNativeAsset:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:e,address:t.bytes.encode("native")})},forGuardianSet:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(e),address:t.bytes.encode("guardian")})},forEmitter:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:0n,address:e})},_encode:o=>typeof o=="bigint"?[t.hex.encode(m.encode(o))]:[t.hex.encode(m.encode(o.length)),t.hex.encode(o)],fromData:o=>{const e=["0620010181",...u._encode(o.idx),"4880",...u._encode(o.address),"483110810612443119221244311881",...u._encode(o.appId),"1244312080",...u._encode(o.appAddress),"124431018100124431093203124431153203124422"],n=t.hex.decode(e.join(""));return new t.LogicSigAccount(n)},decodeLocalState:async(o,e,n)=>{let r;try{const a=await o.accountApplicationInformation(n,t.safeBigIntToNumber(e)).do();r=t.AccountApplicationResponse.from_obj_for_encoding(a).appLocalState}catch{return new Uint8Array}const s=t.b64.encode("meta");let i=new Map;for(const a of r.keyValue){if(a.key===s)continue;const g=t.b64.decode(a.key)[0],l=t.b64.decode(a.value.bytes);i.set(g,l)}const d=[];for(let a=0;a<O;a++)i.has(a)&&d.push(i.get(a));return t.bytes.concat(...d)},checkBitsSet:async(o,e,n,r)=>{let s=!1,i;const d=await o.accountInformation(n).do(),g=t.Account.from_obj_for_encoding(d).appsLocalState;if(g&&g.forEach(h=>{BigInt(h.id)===e&&(i=h.keyValue)}),(i==null?void 0:i.length)===0)return s;const l=BigInt(N),f=BigInt(8),y=r/l*l,b=t.safeBigIntToNumber(r-y),T=Math.floor(b/R),x=Math.floor((b-T*R)/8),B=t.b64.encode(t.bignum.toBytes(T,1));return i==null||i.forEach(h=>{if(h.key===B){const _=t.dist.Buffer.from(h.value.bytes,"base64"),w=1<<t.safeBigIntToNumber(r%f);s=(_[x]&w)!=0;return}}),s},storageAccountExists:async(o,e,n)=>{try{const r=await o.accountApplicationInformation(e,t.safeBigIntToNumber(n)).do();return Object.keys(r).length>0}catch{}return!1}},c=class c{constructor(e,n,r,s){p(this,"network");p(this,"chain");p(this,"connection");p(this,"contracts");p(this,"chainId");p(this,"coreAppId");p(this,"coreAppAddress");p(this,"tokenBridgeAppId");p(this,"tokenBridgeAppAddress");if(this.network=e,this.chain=n,this.connection=r,this.contracts=s,this.chainId=t.toChainId(n),!s.coreBridge)throw new Error(`Core contract address for chain ${n} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=t.getApplicationAddress(i),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${n} not found`);const d=BigInt(s.tokenBridge);this.tokenBridgeAppId=d,this.tokenBridgeAppAddress=t.getApplicationAddress(d)}getGuardianSet(e){throw new Error("Method not implemented.")}async*verifyMessage(e,n,r){const s=new t.AlgorandAddress(e).toString(),i=await c.submitVAAHeader(this.connection,this.coreAppId,r??this.coreAppId,n,s);for(const d of i.txs)yield this.createUnsignedTx(d,"Core.verifyMessage")}static async fromRpc(e,n){const[r,s]=await H.AlgorandPlatform.chainFromRpc(e),i=n[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} !== ${r}`);return new c(r,s,e,i.contracts)}async*publishMessage(e,n){const r=new t.AlgorandAddress(e),s=r.toString(),i=await this.connection.getTransactionParams().do(),d=u.forEmitter(this.coreAppId,r.toUint8Array()),{accounts:a,txs:g}=await c.maybeCreateStorageTx(this.connection,s,this.coreAppId,d,i);for(const f of g)yield this.createUnsignedTx(f,"Core.publishMessage",!0);const l=t.makeApplicationCallTxnFromObject({from:s,appIndex:t.safeBigIntToNumber(this.coreAppId),appArgs:[c.publishMessage,n,t.bignum.toBytes(0n,8)],accounts:a,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:i});yield this.createUnsignedTx({tx:l},"Core.publishMessage",!0)}async getMessageFee(){var s;const e=await this.connection.getApplicationByID(t.safeBigIntToNumber(this.coreAppId)).do(),r=(s=t.Application.from_obj_for_encoding(e).params.globalState)==null?void 0:s.find(i=>i.key===c.feeKey);return r?BigInt(r.value.uint):0n}async getGuardianSetIndex(){throw new Error("Not implemented")}async parseTransaction(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r).map(s=>({chain:s.emitterChain,emitter:s.emitterAddress,sequence:s.sequence}))}async parseMessages(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r)}parseTx(e){const n=[];if(e.innerTxns&&e.innerTxns.length>0&&n.push(...e.innerTxns.flatMap(g=>this.parseTx(g))),BigInt(e.txn.txn.apid??0)!==this.coreAppId||!e.logs||e.logs.length===0)return n;const r=e.txn.txn.apaa??[];if(r.length!==3||!t.bytes.equals(new Uint8Array(r[0]),c.publishMessage))return n;const s=t.bignum.decode(e.logs[0]),i=new t.AlgorandAddress(e.txn.txn.snd).toUniversalAddress(),d=new Uint8Array(r[1]),a=t.bignum.decode(r[2]);return n.push(t.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:i,sequence:s,guardianSet:0,timestamp:0,consistencyLevel:0,nonce:Number(a),payload:d,signatures:[]})),n}static async maybeCreateStorageTx(e,n,r,s,i){const d=t.getApplicationAddress(r),a=s.address(),g=[];if(await u.storageAccountExists(e,a,r))return{accounts:[a],txs:g};i=i??await e.getTransactionParams().do();const l=t.makePaymentTxnWithSuggestedParamsFromObject({from:n,to:a,amount:K,suggestedParams:i});l.fee=l.fee*2,g.push({tx:l});const f=t.makeApplicationOptInTxnFromObject({from:a,appIndex:t.safeBigIntToNumber(r),rekeyTo:d,suggestedParams:i});return f.fee=0,g.push({tx:f,signer:{address:s.address(),signTxn:y=>Promise.resolve(t.signLogicSigTransaction(y,s).blob)}}),{accounts:[a],txs:g}}static async submitVAAHeader(e,n,r,s,i,d){d=d??await e.getTransactionParams().do();let a=[];const g=u.forMessageId(r,{chain:s.emitterChain,sequence:s.sequence,emitter:s.emitterAddress}),{accounts:l,txs:f}=await c.maybeCreateStorageTx(e,i,r,g,d);a.push(...f);const y=u.forGuardianSet(n,s.guardianSet),{accounts:[b],txs:T}=await c.maybeCreateStorageTx(e,i,n,y,d);a.push(...T);let x=[...l,b];const B=await u.decodeLocalState(e,n,b),h=t.keccak_256(s.hash),_=s.signatures.length,w=Math.ceil(_/c.MAX_SIGS_PER_TXN),k=20,C=new t.LogicSigAccount(c.ALGO_VERIFY);for(let M=0;M<w;M++){const v=M*c.MAX_SIGS_PER_TXN,S=s.signatures.slice(v,v+c.MAX_SIGS_PER_TXN),F=S.length*k,G=new Uint8Array(F);for(let A=0;A<S.length;A++){const P=S[A],Y=B.slice(P.guardianIndex*k+1,(P.guardianIndex+1)*k+1);G.set(Y,A*20)}const X=t.makeApplicationCallTxnFromObject({appArgs:[c.verifySigs,t.bytes.concat(...S.map(A=>t.bytes.concat(new Uint8Array([A.guardianIndex]),A.signature.encode()))),G,h],accounts:x,appIndex:t.safeBigIntToNumber(n),from:c.ALGO_VERIFY_HASH,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});X.fee=0,a.push({tx:X,signer:{address:C.address(),signTxn:A=>Promise.resolve(t.signLogicSigTransaction(A,C).blob)}})}const E=t.makeApplicationCallTxnFromObject({appArgs:[c.verifyVaa,t.serialize(s)],accounts:x,appIndex:t.safeBigIntToNumber(n),from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});return E.fee=E.fee*(2+w),a.push({tx:E}),{accounts:x,txs:a}}createUnsignedTx(e,n,r=!0){return new j(e,this.network,this.chain,n,r)}};p(c,"MAX_SIGS_PER_TXN",6),p(c,"ALGO_VERIFY_HASH","EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"),p(c,"ALGO_VERIFY",new Uint8Array([6,32,4,1,0,32,20,38,1,0,49,32,50,3,18,68,49,1,35,18,68,49,16,129,6,18,68,54,26,1,54,26,3,54,26,2,136,0,3,68,34,67,53,2,53,1,53,0,40,53,240,40,53,241,52,0,21,53,5,35,53,3,35,53,4,52,3,52,5,12,65,0,68,52,1,52,0,52,3,129,65,8,34,88,23,52,0,52,3,34,8,36,88,52,0,52,3,129,33,8,36,88,7,0,53,241,53,240,52,2,52,4,37,88,52,240,52,241,80,2,87,12,20,18,68,52,3,129,66,8,53,3,52,4,37,8,53,4,66,255,180,34,137])),p(c,"feeKey",t.b64.encode("MessageFee")),p(c,"verifyVaa",t.bytes.encode("verifyVAA")),p(c,"verifySigs",t.bytes.encode("verifySigs")),p(c,"publishMessage",t.bytes.encode("publishMessage"));let I=c;t.registerProtocol("Algorand","WormholeCore",I);const z=Object.freeze(Object.defineProperty({__proto__:null,AlgorandWormholeCore:I,BITS_PER_BYTE:L,BITS_PER_KEY:R,MAX_BITS:N,MAX_BYTES:V,MAX_BYTES_PER_KEY:U,MAX_KEYS:O,SEED_AMT:K,StorageLogicSig:u,varint:m},Symbol.toStringTag,{value:"Module"}));exports.AlgorandUnsignedTransaction=j;exports.AlgorandWormholeCore=I;exports.StorageLogicSig=u;exports.index=z;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as _t, s as ce, T as N, o as ot, R as Do, a as C, t as H, p as K, y as gt } from "./index-
|
|
1
|
+
import { n as _t, s as ce, T as N, o as ot, R as Do, a as C, t as H, p as K, y as gt } from "./index-evqr6zVJ.mjs";
|
|
2
2
|
import { d as Uo } from "./dijkstra-BZM-8g-B.mjs";
|
|
3
|
-
import { h as Wo } from "./index-
|
|
3
|
+
import { h as Wo } from "./index-7zA9RXv7.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2019 Google LLC
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var h = (i, e, r) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[e] = r;
|
|
3
3
|
var o = (i, e, r) => h(i, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { a8 as m,
|
|
5
|
-
import { S as u } from "./sui-
|
|
4
|
+
import { a8 as m, cL as w, Q as g, bT as p } from "./index-7zA9RXv7.mjs";
|
|
5
|
+
import { S as u } from "./sui-C_RZoPbB.mjs";
|
|
6
6
|
class c {
|
|
7
7
|
constructor(e, r, t, n) {
|
|
8
8
|
o(this, "network");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (p, e, t) =>
|
|
4
|
-
import {
|
|
5
|
-
import { EvmTokenBridge as nt } from "./index-
|
|
2
|
+
var H = (p, e, t) => e in p ? _(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t;
|
|
3
|
+
var u = (p, e, t) => H(p, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { bH as D, p as C, u as T, a8 as S, V as I, l as s, bI as M, aj as j, E as B, a as F, bJ as f, bK as h, bL as z, bM as g, bN as G, aA as y, bO as J, bP as K, bQ as Y, bR as X, bS as Z, bT as tt, _ as et } from "./index-7zA9RXv7.mjs";
|
|
5
|
+
import { EvmTokenBridge as nt } from "./index-CDHEzcRs.mjs";
|
|
6
6
|
const v = new D([
|
|
7
7
|
"function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)",
|
|
8
8
|
"function receiveMessageAndSwap(bytes)"
|
|
@@ -68,7 +68,7 @@ class b {
|
|
|
68
68
|
u(this, "tokenBridge");
|
|
69
69
|
if (this.network = e, this.chain = t, this.provider = o, this.contracts = n, !n.portico)
|
|
70
70
|
throw new Error("Unsupported chain, no contract addresses for: " + t);
|
|
71
|
-
this.core = new
|
|
71
|
+
this.core = new M(e, t, o, n), this.tokenBridge = new nt(e, t, o, n), this.chainId = j.get(e, t);
|
|
72
72
|
}
|
|
73
73
|
static async fromRpc(e, t) {
|
|
74
74
|
const [o, n] = await B.chainFromRpc(e), r = t[n];
|
|
@@ -82,7 +82,7 @@ class b {
|
|
|
82
82
|
throw new Error("Invalid min swap amount");
|
|
83
83
|
if (c === 0n)
|
|
84
84
|
throw new Error("Invalid min swap amount");
|
|
85
|
-
const l = new F(e).toString(), [k, E] = f(this.network, this.chain, o), [U, P] = f(this.network, t.chain, r), w = h(E), q = h(await this.getTransferrableToken(w)), R = h(t), N = h(P), O = (/* @__PURE__ */ new Date()).valueOf() % 2 ** 4, Q =
|
|
85
|
+
const l = new F(e).toString(), [k, E] = f(this.network, this.chain, o), [U, P] = f(this.network, t.chain, r), w = h(E), q = h(await this.getTransferrableToken(w)), R = h(t), N = h(P), O = (/* @__PURE__ */ new Date()).valueOf() % 2 ** 4, Q = z.serializeFlagSet({
|
|
86
86
|
flags: {
|
|
87
87
|
shouldWrapNative: k,
|
|
88
88
|
shouldUnwrapNative: U
|
|
@@ -115,7 +115,7 @@ class b {
|
|
|
115
115
|
yield this.createUnsignedTransaction(g(V, l), "PorticoBridge.Transfer");
|
|
116
116
|
}
|
|
117
117
|
async *redeem(e, t) {
|
|
118
|
-
const o =
|
|
118
|
+
const o = G(t.payload.payload.flagSet.recipientChain), n = t.payload.payload.finalTokenAddress.toNative(o).toString(), r = this.getTokenGroup(n), d = this.getPorticoAddress(r), i = await new y(d, v.fragments, this.provider).getFunction("receiveMessageAndSwap").populateTransaction(J(t)), c = new F(e).toString();
|
|
119
119
|
yield this.createUnsignedTransaction(g(i, c), "PorticoBridge.Redeem");
|
|
120
120
|
}
|
|
121
121
|
async isTransferCompleted(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const me=Symbol(),se=Object.getPrototypeOf,G=new WeakMap,he=e=>e&&(G.has(e)?G.get(e):se(e)===Object.prototype||se(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,ne=(e,t=!0)=>{G.set(e,t)},H={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,REACT_APP_CONNECT_GIT_HASH:"d599ec127187ce8dbd822f8f5df24f6786e03e25",REACT_APP_CONNECT_VERSION:"1.1.3-beta.2-development",SSR:!1},F=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,g)=>new Proxy(n,g),s=n=>F(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,g,I=r)=>{const v=l.get(n);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return ne(w,!0),l.set(n,[g,w]),Reflect.ownKeys(n).forEach(_=>{if(Object.getOwnPropertyDescriptor(w,_))return;const L=Reflect.get(n,_),M={value:L,enumerable:!0,configurable:!0};if(x.has(L))ne(L,!1);else if(L instanceof Promise)delete M.value,M.get=()=>I(L);else if(A.has(L)){const[b,q]=A.get(L);M.value=c(b,q(),I)}Object.defineProperty(w,_,M)}),Object.preventExtensions(w)},m=new WeakMap,f=[1,1],W=n=>{if(!F(n))throw new Error("object required");const g=m.get(n);if(g)return g;let I=f[0];const v=new Set,w=(a,i=++f[0])=>{I!==i&&(I=i,v.forEach(o=>o(a,i)))};let _=f[1];const L=(a=++f[1])=>(_!==a&&!v.size&&(_=a,b.forEach(([i])=>{const o=i[1](a);o>I&&(I=o)})),I),M=a=>(i,o)=>{const h=[...i];h[1]=[a,...h[1]],w(h,o)},b=new Map,q=(a,i)=>{if((H?"production":void 0)!=="production"&&b.has(a))throw new Error("prop listener already exists");if(v.size){const o=i[3](M(a));b.set(a,[i,o])}else b.set(a,[i])},te=a=>{var i;const o=b.get(a);o&&(b.delete(a),(i=o[1])==null||i.call(o))},pe=a=>(v.add(a),v.size===1&&b.forEach(([o,h],k)=>{if((H?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const T=o[3](M(k));b.set(k,[o,T])}),()=>{v.delete(a),v.size===0&&b.forEach(([o,h],k)=>{h&&(h(),b.set(k,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(a,i){const o=Reflect.get(a,i);te(i);const h=Reflect.deleteProperty(a,i);return h&&w(["delete",[i],o]),h},set(a,i,o,h){const k=Reflect.has(a,i),T=Reflect.get(a,i,h);if(k&&(e(T,o)||m.has(o)&&e(T,m.get(o))))return!0;te(i),F(o)&&(o=ge(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,w(["resolve",[i],C])}).catch(C=>{o.status="rejected",o.reason=C,w(["reject",[i],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&q(i,C)}return Reflect.set(a,i,V,h),w(["set",[i],o,T]),!0}});m.set(n,$);const fe=[J,L,c,pe];return A.set($,fe),Reflect.ownKeys(n).forEach(a=>{const i=Object.getOwnPropertyDescriptor(n,a);"value"in i&&($[a]=n[a],delete i.value,delete i.writable),Object.defineProperty(J,a,i)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function D(e,t,s){const r=A.get(e);(H?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(H?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ee={state:d,subscribe(e){return D(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},u={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return u.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return u.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(u.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(u.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(u.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ee.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),ue={state:p,subscribe(e){return D(p.events,()=>e(ve(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},E=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),y={state:E,subscribe(e){return D(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),U={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;ue.initialize(),y.setChains(e.chains),y.setIsAuth(!!e.enableAuthMode),y.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),y.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Oe.call(t,s)&&re(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=Le({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",U.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const P={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${U.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${U.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var We=Object.defineProperty,ie=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&ae(e,s,t[s]);if(ie)for(var s of ie(t))Ae.call(t,s)&&ae(e,s,t[s]);return e};const le=u.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Me={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=U.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await P.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=y.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=le?await P.getMobileListings(m):await P.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=je({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=U.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),y.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=le?await P.getMobileListings(t):await P.getDesktopListings(t),n=Object.values(f),g=m?"search":"wallets";return O[g]={listings:[...O[g].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return P.getWalletImageUrl(e)},getAssetImageUrl(e){return P.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},N=j({open:!1}),z={state:N,subscribe(e){return D(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=y.state;if(u.removeWalletConnectDeepLink(),y.setWalletConnectUri(e==null?void 0:e.uri),y.setChains(e==null?void 0:e.chains),ee.reset("ConnectWallet"),s&&r)N.open=!0,t();else{const l=setInterval(()=>{const c=y.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),N.open=!0,t())},200)}})},close(){N.open=!1}};var Pe=Object.defineProperty,ce=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,de=(e,t,s)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&de(e,s,t[s]);if(ce)for(var s of ce(t))Ue.call(t,s)&&de(e,s,t[s]);return e};function _e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=j({themeMode:_e()?"dark":"light"}),Z={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=De({},s))}},S=j({open:!1,message:"",variant:"success"}),ke={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Z.setThemeConfig,Z.setThemeConfig(t),U.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-CaQpF1dj.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),y.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=ue;exports.T=ee;exports.a=u;exports.index=Te;exports.ne=Z;exports.oe=ke;exports.p=y;exports.se=z;exports.te=Me;exports.y=U;
|
|
1
|
+
"use strict";const me=Symbol(),se=Object.getPrototypeOf,G=new WeakMap,he=e=>e&&(G.has(e)?G.get(e):se(e)===Object.prototype||se(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,ne=(e,t=!0)=>{G.set(e,t)},H={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,REACT_APP_CONNECT_GIT_HASH:"888bac313b62721a678b07de68b5ed5dae7dd0a1",REACT_APP_CONNECT_VERSION:"1.1.3-beta.3-development",SSR:!1},F=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,g)=>new Proxy(n,g),s=n=>F(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,g,I=r)=>{const v=l.get(n);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return ne(w,!0),l.set(n,[g,w]),Reflect.ownKeys(n).forEach(_=>{if(Object.getOwnPropertyDescriptor(w,_))return;const L=Reflect.get(n,_),M={value:L,enumerable:!0,configurable:!0};if(x.has(L))ne(L,!1);else if(L instanceof Promise)delete M.value,M.get=()=>I(L);else if(A.has(L)){const[b,q]=A.get(L);M.value=c(b,q(),I)}Object.defineProperty(w,_,M)}),Object.preventExtensions(w)},m=new WeakMap,f=[1,1],W=n=>{if(!F(n))throw new Error("object required");const g=m.get(n);if(g)return g;let I=f[0];const v=new Set,w=(a,i=++f[0])=>{I!==i&&(I=i,v.forEach(o=>o(a,i)))};let _=f[1];const L=(a=++f[1])=>(_!==a&&!v.size&&(_=a,b.forEach(([i])=>{const o=i[1](a);o>I&&(I=o)})),I),M=a=>(i,o)=>{const h=[...i];h[1]=[a,...h[1]],w(h,o)},b=new Map,q=(a,i)=>{if((H?"production":void 0)!=="production"&&b.has(a))throw new Error("prop listener already exists");if(v.size){const o=i[3](M(a));b.set(a,[i,o])}else b.set(a,[i])},te=a=>{var i;const o=b.get(a);o&&(b.delete(a),(i=o[1])==null||i.call(o))},pe=a=>(v.add(a),v.size===1&&b.forEach(([o,h],k)=>{if((H?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const T=o[3](M(k));b.set(k,[o,T])}),()=>{v.delete(a),v.size===0&&b.forEach(([o,h],k)=>{h&&(h(),b.set(k,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(a,i){const o=Reflect.get(a,i);te(i);const h=Reflect.deleteProperty(a,i);return h&&w(["delete",[i],o]),h},set(a,i,o,h){const k=Reflect.has(a,i),T=Reflect.get(a,i,h);if(k&&(e(T,o)||m.has(o)&&e(T,m.get(o))))return!0;te(i),F(o)&&(o=ge(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,w(["resolve",[i],C])}).catch(C=>{o.status="rejected",o.reason=C,w(["reject",[i],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&q(i,C)}return Reflect.set(a,i,V,h),w(["set",[i],o,T]),!0}});m.set(n,$);const fe=[J,L,c,pe];return A.set($,fe),Reflect.ownKeys(n).forEach(a=>{const i=Object.getOwnPropertyDescriptor(n,a);"value"in i&&($[a]=n[a],delete i.value,delete i.writable),Object.defineProperty(J,a,i)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function D(e,t,s){const r=A.get(e);(H?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(H?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ee={state:d,subscribe(e){return D(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},u={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return u.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return u.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(u.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(u.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(u.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ee.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),ue={state:p,subscribe(e){return D(p.events,()=>e(ve(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},E=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),y={state:E,subscribe(e){return D(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),U={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;ue.initialize(),y.setChains(e.chains),y.setIsAuth(!!e.enableAuthMode),y.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),y.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Oe.call(t,s)&&re(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=Le({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",U.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const P={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${U.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${U.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var We=Object.defineProperty,ie=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&ae(e,s,t[s]);if(ie)for(var s of ie(t))Ae.call(t,s)&&ae(e,s,t[s]);return e};const le=u.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Me={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=U.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await P.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=y.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=le?await P.getMobileListings(m):await P.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=je({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=U.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),y.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=le?await P.getMobileListings(t):await P.getDesktopListings(t),n=Object.values(f),g=m?"search":"wallets";return O[g]={listings:[...O[g].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return P.getWalletImageUrl(e)},getAssetImageUrl(e){return P.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},N=j({open:!1}),z={state:N,subscribe(e){return D(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=y.state;if(u.removeWalletConnectDeepLink(),y.setWalletConnectUri(e==null?void 0:e.uri),y.setChains(e==null?void 0:e.chains),ee.reset("ConnectWallet"),s&&r)N.open=!0,t();else{const l=setInterval(()=>{const c=y.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),N.open=!0,t())},200)}})},close(){N.open=!1}};var Pe=Object.defineProperty,ce=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,de=(e,t,s)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&de(e,s,t[s]);if(ce)for(var s of ce(t))Ue.call(t,s)&&de(e,s,t[s]);return e};function _e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=j({themeMode:_e()?"dark":"light"}),Z={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=De({},s))}},S=j({open:!1,message:"",variant:"success"}),ke={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Z.setThemeConfig,Z.setThemeConfig(t),U.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-Dpwwqt_Y.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),y.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=ue;exports.T=ee;exports.a=u;exports.index=Te;exports.ne=Z;exports.oe=ke;exports.p=y;exports.se=z;exports.te=Me;exports.y=U;
|