PageSourceSearch

https://frontend-seven-phi-52.vercel.app/_next/static/chunks/7834.7f4bbae95c41ee6a.js

js frontend-seven-phi-52.vercel.app collected 2026-10-03 07:01:31 UTC 566,017 bytes, 62 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7834],{1356:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(34550);function n(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function s(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function o(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e/4294967296>>>0,t,r),h(e>>>0,t,r+4),t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e>>>0,t,r),l(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=n,t.writeInt16BE=n,t.writeUint16LE=s,t.writeInt16LE=s,t.readInt32BE=o,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=u,t.writeUint32BE=h,t.writeInt32BE=h,t.writeUint32LE=l,t.writeInt32LE=l,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=o(e,t),i=o(e,t+4);return 4294967296*r+i-(i>>31)*4294967296},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-(r>>31)*4294967296},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=f,t.writeInt64BE=f,t.writeUint64LE=d,t.writeInt64LE=d,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintBE: array is too short for the given b
1itLength");for(var i=0,n=1,s=e/8+r-1;s>=r;s--)i+=t[s]*n,n*=256;return i},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+e/8;s++)i+=t[s]*n,n*=256;return i},t.writeUintBE=function(e,t,r,n){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===n&&(n=0),e%8!=0)throw Error("writeUintBE supports only bitLengths divisible by 8");if(!i.isSafeInteger(t))throw Error("writeUintBE value must be an integer");for(var s=1,o=e/8+n-1;o>=n;o--)r[o]=t/s&255,s*=256;return r},t.writeUintLE=function(e,t,r,n){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===n&&(n=0),e%8!=0)throw Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(t))throw Error("writeUintLE value must be an integer");for(var s=1,o=n;o<n+e/8;o++)r[o]=t/s&255,s*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},35600:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1356),n=r(87427);function s(e,t,r,s,o){if(void 0===o&&(o=0),32!==e.length)throw Error("ChaCha: key size must be 32 bytes");if(s.length<r.length)throw Error("ChaCha: destination is shorter than source");if(0===o){if(8!==t.length&&12!==t.length)throw Error("ChaCha nonce must be 8 or 12 bytes");c=(a=new Uint8Array(16)).length-t.length,a.set(t,c)}else{if(16!==t.length)throw Error("ChaCha nonce with counter must be 16 bytes");a=t,c=o}for(var a,c,u=new Uint8Array(64),h=0;h<r.length;h+=64){!function(e,t,r){for(var n=r[3]<<24|r[2]<<16|r[1]<<8|r[0],s=r[7]<<24|r[6]<<16|r[5]<<8|r[4],o=r[11]<<24|r[10]<<16|r[9]<<8|r[8],a=r[15]<<24|r[14]<<16|r[13]<<8|r[12],c=r[19]<<24|r[18]<<16|r[17]<<8|r[16],u=r[23]<<24|r[22]<<16|r[21]<<8|r[20],h=r[27]<<24|r[26]<<16|r[25]<<8|r[24],l=r[31]<<24|r[30]<<16|r[29]<<8|r[28],f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],g=t[15]<<24|t[14]<<16|t[13]<<8|t[12],b=1634760805,y=857760878,m=2036477234,v=1797285236,w=n,D=s,_=o,E=a,S=c,I=u,C=h,A=l,M=f,x=d,P=p,O=g,T=0;T<20;T+=2)M^=b=b+w|0,w^=S=S+(M=M>>>16|M<<16)|0,w=w>>>20|w<<12,x^=y=y+D|0,D^=I=I+(x=x>>>16|x<<16)|0,D=D>>>20|D<<12,P^=m=m+_|0,_^=C=C+(P=P>>>16|P<<16)|0,_=_>>>20|_<<12,O^=v=v+E|0,E^=A=A+(O=O>>>16|O<<16)|0,E=E>>>20|E<<12,P^=m=m+_|0,_^=C=C+(P=P>>>24|P<<8)|0,_=_>>>25|_<<7,O^=v=v+E|0,E^=A=A+(O=O>>>24|O<<8)|0,E=E>>>25|E<<7,x^=y=y+D|0,D^=I=I+(x=x>>>24|x<<8)|0,D=D>>>25|D<<7,M^=b=b+w|0,w^=S=S+(M=M>>>24|M<<8)|0,w=w>>>25|w<<7,O^=b=b+D|0,D^=C=C+(O=O>>>16|O<<16)|0,D=D>>>20|D<<12,M^=y=y+_|0,_^=A=A+(M=M>>>16|M<<16)|0,_=_>>>20|_<<12,x^=m=m+E|0,E^=S=S+(x=x>>>16|x<<16)|0,E=E>>>20|E<<12,P^=v=v+w|0,w^=I=I+(P=P>>>16|P<<16)|0,w=w>>>20|w<<12,x^=m=m+E|0,E^=S=S+(x=x>>>24|x<<8)|0,E=E>>>25|E<<7,P^=v=v+w|0,w^=I=I+(P=P>>>24|P<<8)|0,w=w>>>25|w<<7,M^=y=y+_|0,_^=A=A+(M=M>>>24|M<<8)|0,_=_>>>25|_<<7,O^=b=b+D|0,D^=C=C+(O=O>>>24|O<<8)|0,D=D>>>25|D<<7;i.writeUint32LE(b+1634760805|0,e,0),i.writeUint32LE(y+857760878|0,e,4),i.writeUint32LE(m+2036477234|0,e,8),i.writeUint32LE(v+1797285236|0,e,12),i.writeUint32LE(w+n|0,e,16),i.writeUint32LE(D+s|0,e,20),i.writeUint32LE(_+o|0,e,24),i.writeUint32LE(E+a|0,e,28),i.writeUint32LE(S+c|0,e,32),i.writeUint32LE(I+u|0,e,36),i.writeUint32LE(C+h|0,e,40),i.writeUint32LE(A+l|0,e,44),i.writeUint32LE(M+f|0,e,48),i.writeUint32LE(x+d|0,e,52),i.writeUint32LE(P+p|0,e,56),i.writeUint32LE(O+g|0,e,60)}(u,a,e);for(var l=h;l<h+64&&l<r.length;l++)s[l]=r[l]^u[l-h];!function(e,t,r){for(var i=1;r--;)i=i+(255&e[t])|0,e[t]=255&i,i>>>=8,t++;if(i>0)throw Error("ChaCha: counter overflow")}(a,0,c)}return n.wipe(u),0===o&&n.wipe(a),s}t.streamXOR=s,t.stream=function(e,t,r,i){return void 0===i&&(i=0),n.wipe(r),s(e,t,r,r,i)}},50972:function(e,t,r){"use strict";var i=r(35600),n=r(50081),s=r(87427),o=r(1356),a=r(35905);t.Cv=32,t.WH=12,t.pg=16;var c=new Uint8Array(16),u=function(){function e(e){if(this.nonceLength=t.WH,this.tagLength=t.pg,e.length!==t.Cv)throw Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,n){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");var o,a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);i.stream(this._key,a,c,4);var u=t.length+this.tagLength;if(n){if(n.length!==u)throw Error("ChaCha20Poly1305: incorrect destination length");o=n}else o=new Uint8Array(u);return i.streamXOR(this._key,a,t,o,4),this._authenticate(o.subarray(o.length-this.tagLength,o.length),c,o.subarray(0,o.length-this.tagLength),r),s.wipe(a),o},e.prototype.open=function(e,t,r,n){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var o,c=new Uint8Array(16);c.set(e,c.length-e.length);var u=new Uint8Array(32);i.stream(this._key,c,u,4);var h=new Uint8Array(this.tagLength);if(this._authenticate(h,u,t.subarray(0,t.length-this.tagLength),r),!a.equal(h,t.subarray(t.length-this.tagLength,t.length)))return null;var l=t.length-this.tagLength;if(n){if(n.length!==l)throw Error("ChaCha20Poly1305: incorrect destination length");o=n}else o=new Uint8Array(l);return i.streamXOR(this._key,c,t.subarray(0,t.length-this.tagLength),o,4),s.wipe(c),o},e.prototype.clean=function(){return s.wipe(this._key),this},e.prototype._authenticate=function(e,t,r,i){var a=new n.Poly1305(t);i&&(a.update(i),i.length%16>0&&a.update(c.subarray(i.length%16))),a.update(r),r.length%16>0&&a.update(c.subarray(r.length%16));var u=new Uint8Array(8);i&&o.writeUint64LE(i.length,u),a.update(u),o.writeUint64LE(r.length,u),a.update(u);for(var h=a.digest(),l=0;l<h.length;l++)e[l]=h[l];a.clean(),s.wipe(h),s.wipe(u)},e}();t.OK=u},35905:function(e,t){"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 1&r-1>>>8}
1Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},48280:function(e,t,r){"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0,r(78539);let i=r(16214);function n(e){let t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}r(87427),t.jQ=64,t.KS=64,t.aP=32,new Uint8Array(32)[0]=9;let s=n(),o=n([1]),a=(n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222])),c=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]);function h(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function l(e){let t=1;for(let r=0;r<16;r++){let i=e[r]+t+65535;t=Math.floor(i/65536),e[r]=i-65536*t}e[0]+=t-1+37*(t-1)}function f(e,t,r){let i=~(r-1);for(let r=0;r<16;r++){let n=i&(e[r]^t[r]);e[r]^=n,t[r]^=n}}function d(e,t){let r=n(),i=n();for(let e=0;e<16;e++)i[e]=t[e];l(i),l(i),l(i);for(let e=0;e<2;e++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,f(i,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]+r[i]}function g(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]-r[i]}function b(e,t,r){let i,n,s=0,o=0,a=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,b=0,y=0,m=0,v=0,w=0,D=0,_=0,E=0,S=0,I=0,C=0,A=0,M=0,x=0,P=0,O=0,T=0,R=0,k=0,N=0,L=r[0],j=r[1],q=r[2],z=r[3],U=r[4],F=r[5],B=r[6],$=r[7],H=r[8],V=r[9],K=r[10],W=r[11],J=r[12],G=r[13],Y=r[14],Q=r[15];s+=(i=t[0])*L,o+=i*j,a+=i*q,c+=i*z,u+=i*U,h+=i*F,l+=i*B,f+=i*$,d+=i*H,p+=i*V,g+=i*K,b+=i*W,y+=i*J,m+=i*G,v+=i*Y,w+=i*Q,o+=(i=t[1])*L,a+=i*j,c+=i*q,u+=i*z,h+=i*U,l+=i*F,f+=i*B,d+=i*$,p+=i*H,g+=i*V,b+=i*K,y+=i*W,m+=i*J,v+=i*G,w+=i*Y,D+=i*Q,a+=(i=t[2])*L,c+=i*j,u+=i*q,h+=i*z,l+=i*U,f+=i*F,d+=i*B,p+=i*$,g+=i*H,b+=i*V,y+=i*K,m+=i*W,v+=i*J,w+=i*G,D+=i*Y,_+=i*Q,c+=(i=t[3])*L,u+=i*j,h+=i*q,l+=i*z,f+=i*U,d+=i*F,p+=i*B,g+=i*$,b+=i*H,y+=i*V,m+=i*K,v+=i*W,w+=i*J,D+=i*G,_+=i*Y,E+=i*Q,u+=(i=t[4])*L,h+=i*j,l+=i*q,f+=i*z,d+=i*U,p+=i*F,g+=i*B,b+=i*$,y+=i*H,m+=i*V,v+=i*K,w+=i*W,D+=i*J,_+=i*G,E+=i*Y,S+=i*Q,h+=(i=t[5])*L,l+=i*j,f+=i*q,d+=i*z,p+=i*U,g+=i*F,b+=i*B,y+=i*$,m+=i*H,v+=i*V,w+=i*K,D+=i*W,_+=i*J,E+=i*G,S+=i*Y,I+=i*Q,l+=(i=t[6])*L,f+=i*j,d+=i*q,p+=i*z,g+=i*U,b+=i*F,y+=i*B,m+=i*$,v+=i*H,w+=i*V,D+=i*K,_+=i*W,E+=i*J,S+=i*G,I+=i*Y,C+=i*Q,f+=(i=t[7])*L,d+=i*j,p+=i*q,g+=i*z,b+=i*U,y+=i*F,m+=i*B,v+=i*$,w+=i*H,D+=i*V,_+=i*K,E+=i*W,S+=i*J,I+=i*G,C+=i*Y,A+=i*Q,d+=(i=t[8])*L,p+=i*j,g+=i*q,b+=i*z,y+=i*U,m+=i*F,v+=i*B,w+=i*$,D+=i*H,_+=i*V,E+=i*K,S+=i*W,I+=i*J,C+=i*G,A+=i*Y,M+=i*Q,p+=(i=t[9])*L,g+=i*j,b+=i*q,y+=i*z,m+=i*U,v+=i*F,w+=i*B,D+=i*$,_+=i*H,E+=i*V,S+=i*K,I+=i*W,C+=i*J,A+=i*G,M+=i*Y,x+=i*Q,g+=(i=t[10])*L,b+=i*j,y+=i*q,m+=i*z,v+=i*U,w+=i*F,D+=i*B,_+=i*$,E+=i*H,S+=i*V,I+=i*K,C+=i*W,A+=i*J,M+=i*G,x+=i*Y,P+=i*Q,b+=(i=t[11])*L,y+=i*j,m+=i*q,v+=i*z,w+=i*U,D+=i*F,_+=i*B,E+=i*$,S+=i*H,I+=i*V,C+=i*K,A+=i*W,M+=i*J,x+=i*G,P+=i*Y,O+=i*Q,y+=(i=t[12])*L,m+=i*j,v+=i*q,w+=i*z,D+=i*U,_+=i*F,E+=i*B,S+=i*$,I+=i*H,C+=i*V,A+=i*K,M+=i*W,x+=i*J,P+=i*G,O+=i*Y,T+=i*Q,m+=(i=t[13])*L,v+=i*j,w+=i*q,D+=i*z,_+=i*U,E+=i*F,S+=i*B,I+=i*$,C+=i*H,A+=i*V,M+=i*K,x+=i*W,P+=i*J,O+=i*G,T+=i*Y,R+=i*Q,v+=(i=t[14])*L,w+=i*j,D+=i*q,_+=i*z,E+=i*U,S+=i*F,I+=i*B,C+=i*$,A+=i*H,M+=i*V,x+=i*K,P+=i*W,O+=i*J,T+=i*G,R+=i*Y,k+=i*Q,w+=(i=t[15])*L,D+=i*j,_+=i*q,E+=i*z,S+=i*U,I+=i*F,C+=i*B,A+=i*$,M+=i*H,x+=i*V,P+=i*K,O+=i*W,T+=i*J,R+=i*G,k+=i*Y,N+=i*Q,s+=38*D,o+=38*_,a+=38*E,c+=38*S,u+=38*I,h+=38*C,l+=38*A,f+=38*M,d+=38*x,p+=38*P,g+=38*O,b+=38*T,y+=38*R,m+=38*k,v+=38*N,n=Math.floor((i=s+(n=1)+65535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=b
1+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),n=Math.floor((i=s+(n=1)+65535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=b+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),e[0]=s,e[1]=o,e[2]=a,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=b,e[12]=y,e[13]=m,e[14]=v,e[15]=w}function y(e,t){let r=n(),i=n(),s=n(),o=n(),c=n(),u=n(),h=n(),l=n(),f=n();g(r,e[1],e[0]),g(f,t[1],t[0]),b(r,r,f),p(i,e[0],e[1]),p(f,t[0],t[1]),b(i,i,f),b(s,e[3],t[3]),b(s,s,a),b(o,e[2],t[2]),p(o,o,o),g(c,i,r),g(u,o,s),p(h,o,s),p(l,i,r),b(e[0],c,u),b(e[1],l,h),b(e[2],h,u),b(e[3],c,l)}function m(e,t,r){for(let i=0;i<4;i++)f(e[i],t[i],r)}function v(e,t){let r=n(),i=n(),s=n();(function(e,t){let r;let i=n();for(r=0;r<16;r++)i[r]=t[r];for(r=253;r>=0;r--)b(i,i,i),2!==r&&4!==r&&b(i,i,t);for(r=0;r<16;r++)e[r]=i[r]})(s,t[2]),b(r,t[0],s),b(i,t[1],s),d(e,i),e[31]^=function(e){let t=new Uint8Array(32);return d(t,e),1&t[0]}(r)<<7}function w(e,t){let r=[n(),n(),n(),n()];h(r[0],c),h(r[1],u),h(r[2],o),b(r[3],c,u),function(e,t,r){h(e[0],s),h(e[1],o),h(e[2],o),h(e[3],s);for(let i=255;i>=0;--i){let n=r[i/8|0]>>(7&i)&1;m(e,t,n),y(t,e),y(e,e),m(e,t,n)}}(e,r,t)}t._w=function(e){if(e.length!==t.aP)throw Error(`ed25519: seed must be ${t.aP} bytes`);let r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;let s=new Uint8Array(32),o=[n(),n(),n(),n()];w(o,r),v(s,o);let a=new Uint8Array(64);return a.set(e),a.set(s,32),{publicKey:s,secretKey:a}};let D=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function _(e,t){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n<s;++n)t[n]+=r-16*t[i]*D[n-(i-32)],r=Math.floor((t[n]+128)/256),t[n]-=256*r;t[n]+=r,t[i]=0}for(n=0,r=0;n<32;n++)t[n]+=r-(t[31]>>4)*D[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*D[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function E(e){let t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;_(e,t)}t.Xx=function(e,t){let r=new Float64Array(64),s=[n(),n(),n(),n()],o=(0,i.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;let a=new Uint8Array(64);a.set(o.subarray(32),32);let c=new i.SHA512;c.update(a.subarray(32)),c.update(t);let u=c.digest();c.clean(),E(u),w(s,u),v(a,s),c.reset(),c.update(a.subarray(0,32)),c.update(e.subarray(32)),c.update(t);let h=c.digest();E(h);for(let e=0;e<32;e++)r[e]=u[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=h[e]*o[t];return _(a.subarray(32),r),a}},50601:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},9014:function(e,t,r){"use strict";var i=r(76568),n=r(87427),s=function(){function e(e,t,r,n){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var s=i.hmac(this._hash,r,t);this._hmac=new i.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw Error("hkdf: cannot expand more");this._hmac.reset(),e>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(e){for(var t=new Uint8Array(e),r=0;r<t.length;r++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[r]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),n.wipe(this._buffer),n.wipe(this._counter),this._bufpos=0},e}();t.t=s},76568:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var i=r(50601),n=r(35905),s=r(87427),o=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var n=0;n<r.length;n++)r[n]^=54;this._inner.update(r);for(var n=0;n<r.length;n++)r[n]^=106;this._outer.update(r),i.isSerializableHash(this._inner)&&i.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),s.wipe(r)}return e.prototype.reset=function(){if(!i.isSerializableHash(this._inner)||!i.isSerializableHash(this._outer))throw 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(){i.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),i.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.prototype.finish=function(e){return this._finished?this._outer.finish(e):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!i.isSerializableHash(this._inner))throw Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!i.isSerializableHash(this._inner)||!i.isSerializableHash(this._outer))throw Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(e){if(!i.isSerializableHash(this._inner))throw Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();t.HMAC=o,t.hmac=function(e,t,r){var i=new o(e,t);i.update(r);var n=i.digest();return i.clean(),n},t.equal=n.equal},34550:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,i=65535&t;return r*i+((e>>>16&65535)*i+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},50081:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(35905),n=r(87427);t.DIGEST_LENGTH=16;var s=function(){function e(e){this.digestLength=t.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 r=e[0]|e[1]<<8;this._r[0]=8191&r;var i=e[2]|e[3]<<8;this._r[1]=(r>>>13|i<<3)&8191;var n=e[4]|e[5]<<8;this._r[2]=(i>>>10|n<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(n>>>7|s<<9)&8191;var o=e[8]|e[9]<<8;this._r[4]=(s>>>4|o<<12)&255,this._r[5]=o>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=(o>>>14|a<<2)&8191;var c=e[12]|e[13]<<8;this._r[7]=(a>>>11|c<<5)&8065;var u=e[14]|e[15]<<8;this._r[8]=(c>>>8|u<<8)&8191,this._r[9]=u>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var i=this._fin?0:2048,n=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],c=this._h[4],u=this._h[5],h=this._h[6],l=this._h[7],f=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],b=this._r[2],y=this._r[3],m=this._r[4],v=this._r[5],w=this._r[6],D=this._r[7],_=this._r[8],E=this._r[9];r>=16;
1){var S,I=e[t+0]|e[t+1]<<8;n+=8191&I;var C=e[t+2]|e[t+3]<<8;s+=(I>>>13|C<<3)&8191;var A=e[t+4]|e[t+5]<<8;o+=(C>>>10|A<<6)&8191;var M=e[t+6]|e[t+7]<<8;a+=(A>>>7|M<<9)&8191;var x=e[t+8]|e[t+9]<<8;c+=(M>>>4|x<<12)&8191,u+=x>>>1&8191;var P=e[t+10]|e[t+11]<<8;h+=(x>>>14|P<<2)&8191;var O=e[t+12]|e[t+13]<<8;l+=(P>>>11|O<<5)&8191;var T=e[t+14]|e[t+15]<<8;f+=(O>>>8|T<<8)&8191,d+=T>>>5|i;var R=0;R=(S=0+n*p+5*E*s+5*_*o+5*D*a+5*w*c)>>>13,S&=8191,S+=5*v*u+5*m*h+5*y*l+5*b*f+5*g*d,R+=S>>>13,S&=8191;var k=R;k+=n*g+s*p+5*E*o+5*_*a+5*D*c,R=k>>>13,k&=8191,k+=5*w*u+5*v*h+5*m*l+5*y*f+5*b*d,R+=k>>>13,k&=8191;var N=R;N+=n*b+s*g+o*p+5*E*a+5*_*c,R=N>>>13,N&=8191,N+=5*D*u+5*w*h+5*v*l+5*m*f+5*y*d,R+=N>>>13,N&=8191;var L=R;L+=n*y+s*b+o*g+a*p+5*E*c,R=L>>>13,L&=8191,L+=5*_*u+5*D*h+5*w*l+5*v*f+5*m*d,R+=L>>>13,L&=8191;var j=R;j+=n*m+s*y+o*b+a*g+c*p,R=j>>>13,j&=8191,j+=5*E*u+5*_*h+5*D*l+5*w*f+5*v*d,R+=j>>>13,j&=8191;var q=R;q+=n*v+s*m+o*y+a*b+c*g,R=q>>>13,q&=8191,q+=u*p+5*E*h+5*_*l+5*D*f+5*w*d,R+=q>>>13,q&=8191;var z=R;z+=n*w+s*v+o*m+a*y+c*b,R=z>>>13,z&=8191,z+=u*g+h*p+5*E*l+5*_*f+5*D*d,R+=z>>>13,z&=8191;var U=R;U+=n*D+s*w+o*v+a*m+c*y,R=U>>>13,U&=8191,U+=u*b+h*g+l*p+5*E*f+5*_*d,R+=U>>>13,U&=8191;var F=R;F+=n*_+s*D+o*w+a*v+c*m,R=F>>>13,F&=8191,F+=u*y+h*b+l*g+f*p+5*E*d,R+=F>>>13,F&=8191;var B=R;B+=n*E+s*_+o*D+a*w+c*v,R=B>>>13,B&=8191,B+=u*m+h*y+l*b+f*g+d*p,R+=B>>>13,B&=8191,S=8191&(R=(R=(R<<2)+R|0)+S|0),R>>>=13,k+=R,n=S,s=k,o=N,a=L,c=j,u=q,h=z,l=U,f=F,d=B,t+=16,r-=16}this._h[0]=n,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=c,this._h[5]=u,this._h[6]=h,this._h[7]=l,this._h[8]=f,this._h[9]=d},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,i,n,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^r)-1,s=0;s<10;s++)o[s]&=i;for(s=0,i=~i;s<10;s++)this._h[s]=this._h[s]&i|o[s];for(s=1,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,n=this._h[0]+this._pad[0],this._h[0]=65535&n;s<8;s++)n=(this._h[s]+this._pad[s]|0)+(n>>>16)|0,this._h[s]=65535&n;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,i=e.length;if(this._leftover){(t=16-this._leftover)>i&&(t=i);for(var n=0;n<t;n++)this._buffer[this._leftover+n]=e[r+n];if(i-=t,r+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(i>=16&&(t=i-i%16,this._blocks(e,r,t),r+=t,i-=t),i){for(var n=0;n<i;n++)this._buffer[this._leftover+n]=e[r+n];this._leftover+=i}return this},e.prototype.digest=function(){if(this._finished)throw Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},e.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},e}();t.Poly1305=s,t.oneTimeAuth=function(e,t){var r=new s(e);r.update(t);var i=r.digest();return r.clean(),i},t.equal=function(e,r){return e.length===t.DIGEST_LENGTH&&r.length===t.DIGEST_LENGTH&&i.equal(e,r)}},78539:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;let i=r(25649),n=r(1356),s=r(87427);function o(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new i.SystemRandomSource,t.randomBytes=o,t.randomUint32=function(e=t.defaultRandomSource){let r=o(4,e),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};let a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,i=t.defaultRandomSource){if(r.length<2)throw Error("randomString charset is too short");if(r.length>256)throw Error("randomString charset is too long");let n="",c=r.length,u=256-256%c;for(;e>0;){let t=o(Math.ceil(256*e/u),i);for(let i=0;i<t.length&&e>0;i++){let s=t[i];s<u&&(n+=r.charAt(s%c),e--)}(0,s.wipe)(t)}return n}t.randomString=c,t.randomStringForEntropy=function(e,r=a,i=t.defaultRandomSource){return c(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,i)}},24550:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;class r{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}t.BrowserRandomSource=r},79849:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;let i=r(87427);class n{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{let e=r(35883);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw Error("NodeRandomSource: got fewer bytes than requested");let r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,i.wipe)(t),r}}t.NodeRandomSource=n},25649:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;let i=r(24550),n=r(79849);class s{constructor(){if(this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new n.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw Error("System random byte generator is not available.");return this._source.randomBytes(e)}}t.SystemRandomSource=s},43094:function(e,t,r){"use strict";var i=r(1356),n=r(87427);t.k=32,t.cn=64;var s=function(){function e(){this.digestLength=t.k,this.blockSize=t.cn,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 e.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},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,n=t%64
1<56?64:128;this._buffer[r]=128;for(var s=r+1;s<n-8;s++)this._buffer[s]=0;i.writeUint32BE(t/536870912|0,this._buffer,n-8),i.writeUint32BE(t<<3,this._buffer,n-4),a(this._temp,this._state,this._buffer,0,n),this._finished=!0}for(var s=0;s<this.digestLength/4;s++)i.writeUint32BE(this._state[s],e,4*s);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw 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}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.mE=s;var o=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 a(e,t,r,n,s){for(;s>=64;){for(var a=t[0],c=t[1],u=t[2],h=t[3],l=t[4],f=t[5],d=t[6],p=t[7],g=0;g<16;g++){var b=n+4*g;e[g]=i.readUint32BE(r,b)}for(var g=16;g<64;g++){var y=e[g-2],m=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10,v=((y=e[g-15])>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;e[g]=(m+e[g-7]|0)+(v+e[g-16]|0)}for(var g=0;g<64;g++){var m=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&d)|0)+(p+(o[g]+e[g]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&u^c&u)|0;p=d,d=f,f=l,l=h+m|0,h=u,u=c,c=a,a=m+v|0}t[0]+=a,t[1]+=c,t[2]+=u,t[3]+=h,t[4]+=l,t[5]+=f,t[6]+=d,t[7]+=p,n+=64,s-=64}return n}t.vp=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},16214:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1356),n=r(87427);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var s=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[i++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(i=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[i++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,n=t%128<112?128:256;this._buffer[r]=128;for(var s=r+1;s<n-8;s++)this._buffer[s]=0;i.writeUint32BE(t/536870912|0,this._buffer,n-8),i.writeUint32BE(t<<3,this._buffer,n-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,n),this._finished=!0}for(var s=0;s<this.digestLength/8;s++)i.writeUint32BE(this._stateHi[s],e,8*s),i.writeUint32BE(this._stateLo[s],e,8*s+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.stateHi),n.wipe(e.stateLo),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
11322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,n,s,a,c){for(var u,h,l,f,d,p,g,b,y=r[0],m=r[1],v=r[2],w=r[3],D=r[4],_=r[5],E=r[6],S=r[7],I=n[0],C=n[1],A=n[2],M=n[3],x=n[4],P=n[5],O=n[6],T=n[7];c>=128;){for(var R=0;R<16;R++){var k=8*R+a;e[R]=i.readUint32BE(s,k),t[R]=i.readUint32BE(s,k+4)}for(var R=0;R<80;R++){var N=y,L=m,j=v,q=w,z=D,U=_,F=E,B=S,$=I,H=C,V=A,K=M,W=x,J=P,G=O,Y=T;if(u=S,d=65535&(h=T),p=h>>>16,g=65535&u,b=u>>>16,u=(D>>>14|x<<18)^(D>>>18|x<<14)^(x>>>9|D<<23),d+=65535&(h=(x>>>14|D<<18)^(x>>>18|D<<14)^(D>>>9|x<<23)),p+=h>>>16,g+=65535&u,b+=u>>>16,u=D&_^~D&E,d+=65535&(h=x&P^~x&O),p+=h>>>16,g+=65535&u,b+=u>>>16,u=o[2*R],d+=65535&(h=o[2*R+1]),p+=h>>>16,g+=65535&u,b+=u>>>16,u=e[R%16],d+=65535&(h=t[R%16]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,l=65535&g|b<<16,f=65535&d|p<<16,u=l,d=65535&(h=f),p=h>>>16,g=65535&u,b=u>>>16,u=(y>>>28|I<<4)^(I>>>2|y<<30)^(I>>>7|y<<25),d+=65535&(h=(I>>>28|y<<4)^(y>>>2|I<<30)^(y>>>7|I<<25)),p+=h>>>16,g+=65535&u,b+=u>>>16,u=y&m^y&v^m&v,d+=65535&(h=I&C^I&A^C&A),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,B=65535&g|b<<16,Y=65535&d|p<<16,u=q,d=65535&(h=K),p=h>>>16,g=65535&u,b=u>>>16,u=l,d+=65535&(h=f),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,q=65535&g|b<<16,K=65535&d|p<<16,m=N,v=L,w=j,D=q,_=z,E=U,S=F,y=B,C=$,A=H,M=V,x=K,P=W,O=J,T=G,I=Y,R%16==15)for(var k=0;k<16;k++)u=e[k],d=65535&(h=t[k]),p=h>>>16,g=65535&u,b=u>>>16,u=e[(k+9)%16],d+=65535&(h=t[(k+9)%16]),p+=h>>>16,g+=65535&u,b+=u>>>16,u=((l=e[(k+1)%16])>>>1|(f=t[(k+1)%16])<<31)^(l>>>8|f<<24)^l>>>7,d+=65535&(h=(f>>>1|l<<31)^(f>>>8|l<<24)^(f>>>7|l<<25)),p+=h>>>16,g+=65535&u,b+=u>>>16,u=((l=e[(k+14)%16])>>>19|(f=t[(k+14)%16])<<13)^(f>>>29|l<<3)^l>>>6,d+=65535&(h=(f>>>19|l<<13)^(l>>>29|f<<3)^(f>>>6|l<<26)),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,e[k]=65535&g|b<<16,t[k]=65535&d|p<<16}u=y,d=65535&(h=I),p=h>>>16,g=65535&u,b=u>>>16,u=r[0],d+=65535&(h=n[0]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[0]=y=65535&g|b<<16,n[0]=I=65535&d|p<<16,u=m,d=65535&(h=C),p=h>>>16,g=65535&u,b=u>>>16,u=r[1],d+=65535&(h=n[1]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[1]=m=65535&g|b<<16,n[1]=C=65535&d|p<<16,u=v,d=65535&(h=A),p=h>>>16,g=65535&u,b=u>>>16,u=r[2],d+=65535&(h=n[2]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[2]=v=65535&g|b<<16,n[2]=A=65535&d|p<<16,u=w,d=65535&(h=M),p=h>>>16,g=65535&u,b=u>>>16,u=r[3],d+=65535&(h=n[3]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[3]=w=65535&g|b<<16,n[3]=M=65535&d|p<<16,u=D,d=65535&(h=x),p=h>>>16,g=65535&u,b=u>>>16,u=r[4],d+=65535&(h=n[4]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[4]=D=65535&g|b<<16,n[4]=x=65535&d|p<<16,u=_,d=65535&(h=P),p=h>>>16,g=65535&u,b=u>>>16,u=r[5],d+=65535&(h=n[5]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[5]=_=65535&g|b<<16,n[5]=P=65535&d|p<<16,u=E,d=65535&(h=O),p=h>>>16,g=65535&u,b=u>>>16,u=r[6],d+=65535&(h=n[6]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[6]=E=65535&g|b<<16,n[6]=O=65535&d|p<<16,u=S,d=65535&(h=T),p=h>>>16,g=65535&u,b=u>>>16,u=r[7],d+=65535&(h=n[7]),p+=h>>>16,g+=65535&u,b+=u>>>16,p+=d>>>16,g+=p>>>16,b+=g>>>16,r[7]=S=65535&g|b<<16,n[7]=T=65535&d|p<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},87427:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},11153:function(e,t,r){"use strict";t.gi=t.Au=t.KS=t.kz=void 0;let i=r(78539),n=r(87427);function s(e){let t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.kz=32,t.KS=32;let o=new Uint8Array(32);o[0]=9;let a=s([56129,1]);function c(e){let t=1;for(let r=0;r<16;r++){let i=e[r]+t+65535;t=Math.floor(i/65536),e[r]=i-65536*t}e[0]+=t-1+37*(t-1)}function u(e,t,r){let i=~(r-1);for(let r=0;r<16;r++){let n=i&(e[r]^t[r]);e[r]^=n,t[r]^=n}}function h(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]+r[i]}function l(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]-r[i]}function f(e,t,r){let i,n,s=0,o=0,a=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,b=0,y=0,m=0,v=0,w=0,D=0,_=0,E=0,S=0,I=0,C=0,A=0,M=0,x=0,P=0,O=0,T=0,R=0,k=0,N=0,L=r[0],j=r[1],q=r[2],z=r[3],U=r[4],F=r[5],B=r[6],$=r[7],H=r[8],V=r[9],K=r[10],W=r[11],J=r[12],G=r[13],Y=r[14],Q=r[15];s+=(i=t[0])*L,o+=i*j,a+=i*q,c+=i*z,u+=i*U,h+=i*F,l+=i*B,f+=i*$,d+=i*H,p+=i*V,g+=i*K,b+=i*W,y+=i*J,m+=i*G,v+=i*Y,w+=i*Q,o+=(i=t[1])*L,a+=i*j,c+=i*q,u+=i*z,h+=i*U,l+=i*F,f+=i*B,d+=i*$,p+=i*H,g+=i*V,b+=i*K,y+=i*W,m+=i*J,v+=i*G,w+=i*Y,D+=i*Q,a+=(i=t[2])*L,c+=i*j,u+=i*q,h+=i*z,l+=i*U,f+=i*F,d+=i*B,p+=i*$,g+=i*H,b+=i*V,y+=i*K,m+=i*W,v+=i*J,w+=i*G,D+=i*Y,_+=i*Q,c+=(i=t[3])*L,u+=i*j,h+=i*q,l+=i*z,f+=i*U,d+=i*F,p+=i*B,g+=i*$,b+=i*H,y+=i*V,m+=i*K,v+=i*W,w+=i*J,D+=i*G,_+=i*Y,E+=i*Q,u+=(i=t[4])*L,h+=i*j,l+=i*q,f+=i*z,d+=i*U,p+=i*F,g+=i*B,b+=i*$,y+=i*H,m+=i*V,v+=i*K,w+=i*W,D+=i*J,_+=i*G,E+=i*Y,S+=i*Q,h+=(i=t[5])*L,l+=i*j,f+=i*q,d+=i*z,p+=i*U,g+=i*F,b+=i*B,y+=i*$,m+=i*H,v+=i*V,w+=i*K,D+=i*W,_+=i*J,E+=i*G,S+=i*Y,I+=i*Q,l+=(i=t[6])*L,f+=i*j,d+=i*q,p+=i*z,g+=i*U,b+=i*F,y+=i*B,m+=i*$,v+=i*H,w+=i*V,D+=i*K,_+=i*W,E+=i*J,S+=i*G,I+=i*Y,C+=i*Q,f+=(i=t[7])*L,d+=i*j,p+=i*q,g+=i*z,b+=i*U,y+=i*F,m+=i*B,v+=i*$,w+=i*H,D+=i*V,_+=i*K,E+=i*W,S+=i*J,I+=i*G,C+=i*Y,A+=i*Q,d+=(i=t[8])*L,p+=i*j,g+=i*q,b+=i*z,y+=i*U,m+=i*F,v+=i*B,w+=i*$,D+=i*H,_+=i*V,E+=i*K,S+=i*W,I+=i*J,C+=i*G,A+=i*Y,M+=i*Q,p+=(i=t[9])*L,g+=i*j,b+=i*q,y+=i*z,m+=i*U,v+=i*F,w+=i*B,D+=i*$,_+=i*H,E+=i*V,S+=i*K,I+=i*W,C+=i*J,A+=i*G,M+=i*Y,x+=i*Q,g+=(i=t[10])*L,b+=i*j,y+=i*q,m+=i*z,v+=i*U,w+=i*F,D+=i*B,_+=i*$,E+=i*H,S+=i*V,I+=i*K,C+=i*W,A+=i*J,M+=i*G,x+=i*Y,P+=i*Q,b+=(i=t[11])*L,y+=i*j,m+=i*q,v+=i*z,w+=i*U,D+=i*F,_+=i*B,E+=i*$,S+=i*H,I+=i*V,C+=i*K,A+=i*W,M+=i*J,x+=i*G,P+=i*Y,O+=i*Q,y+=(i=t[12])*L,m+=i*j,v+=i*q,w+=i*z,D+=i*U,_+=i*F,E+=i*B,S+=i*$,I+=i*H,C+=i*V,A+=i*K,M+=i*W,x+=i*J,P+=i*G,O+=i*Y,T+=i*Q,m+=(i=t[13])*L,v+=i*j,w+=i*q,D+=i*z,_+=i*U,E+=i*F,S+=i*B,I+=i*$,C+=i*H,A+=i*V,M+=i*K,x+=i*W,P+=i*J,O+=i*G,T+=i*Y,R+=i*Q,v+=(i=t[14])*L,w+=i*j,D+=i*q,_+=i*z,E+=i*U,S+=i*F,I+=i*B,C+=i*$,A+=i*H,M+=i*V,x+=i*K,P+=i*W,O+=i*J,T+=i*G,R+=i*Y,k+=i*Q,w+=(i=t[15])*L,D+=i*j,_+=i*q,E+=i*z,S+=i*U,I+=i*F,C+=i*B,A+=i*$,M+=i*H,x+=i*V,P+=i*K,O+=i*W,T+=i*J,R+=i*G,k+=i*Y,N+=i*Q,s+=38*D,o+=38*_,a+=38*E,c+=38*S,u+=38*I,h+=38*C,l+=38*A,f+=38*M,d+=38*x,p+=38*P,g+=38*O,b+=38*T,y+=38*R,m+=38*k,v+=38*N,n=Math.floor((i=s+(n=1)+6
15535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=b+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),n=Math.floor((i=s+(n=1)+65535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=b+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),e[0]=s,e[1]=o,e[2]=a,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=b,e[12]=y,e[13]=m,e[14]=v,e[15]=w}function d(e,t){let r=new Uint8Array(32),i=new Float64Array(80),n=s(),o=s(),d=s(),p=s(),g=s(),b=s();for(let t=0;t<31;t++)r[t]=e[t];r[31]=127&e[31]|64,r[0]&=248,function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(i,t);for(let e=0;e<16;e++)o[e]=i[e];n[0]=p[0]=1;for(let e=254;e>=0;--e){let t=r[e>>>3]>>>(7&e)&1;u(n,o,t),u(d,p,t),h(g,n,d),l(n,n,d),h(d,o,p),l(o,o,p),f(p,g,g),f(b,n,n),f(n,d,n),f(d,o,g),h(g,n,d),l(n,n,d),f(o,n,n),l(d,p,b),f(n,d,a),h(n,n,p),f(d,d,n),f(n,p,b),f(p,o,i),f(o,g,g),u(n,o,t),u(d,p,t)}for(let e=0;e<16;e++)i[e+16]=n[e],i[e+32]=d[e],i[e+48]=o[e],i[e+64]=p[e];let y=i.subarray(32),m=i.subarray(16);!function(e,t){let r=s();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)f(r,r,r),2!==e&&4!==e&&f(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(y,y),f(m,m,y);let v=new Uint8Array(32);return!function(e,t){let r=s(),i=s();for(let e=0;e<16;e++)i[e]=t[e];c(i),c(i),c(i);for(let e=0;e<2;e++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,u(i,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}(v,m),v}t.Au=function(e){let r=(0,i.randomBytes)(32,e),s=function(e){if(e.length!==t.KS)throw Error(`x25519: seed must be ${t.KS} bytes`);let r=new Uint8Array(e);return{publicKey:d(r,o),secretKey:r}}(r);return(0,n.wipe)(r),s},t.gi=function(e,r,i=!1){if(e.length!==t.kz)throw Error("X25519: incorrect secret key length");if(r.length!==t.kz)throw Error("X25519: incorrect public key length");let n=d(e,r);if(i){let e=0;for(let t=0;t<n.length;t++)e|=n[t];if(0===e)throw Error("X25519: invalid shared key")}return n}},12238:function(e,t,r){"use strict";function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){let e=i();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=i,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},33531:function(e,t,r){"use strict";var i=r(40257);function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==i&&void 0!==i.versions&&void 0!==i.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=s,t.isBrowser=function(){return!n()&&!s()}},13303:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});let i=r(45161);i.__exportStar(r(12238),t),i.__exportStar(r(33531),t)},45161:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return s},__asyncDelegator:function(){return w},__asyncGenerator:function(){return v},__asyncValues:function(){return D},__await:function(){return m},__awaiter:function(){return h},__classPrivateFieldGet:function(){return I},__classPrivateFieldSet:function(){return C},__createBinding:function(){return f},__decorate:function(){return a},__exportStar:function(){return d},__extends:function(){return n},__generator:function(){return l},__importDefault:function(){return S},__importStar:function(){return E},__makeTemplateObject:function(){return _},__metadata:function(){return u},__param:function(){return c},__read:function(){return g},__rest:function(){return o},__spread:function(){return b},__spreadArrays:function(){return y},__values:function(){return p}});var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}function a(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function c(e,t){return function(r,i){t(r,i,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}c((i=i.apply(e,t||[])).next())})}function l(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function f(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}function d(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var i=Array(e),n=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(e){n[e]&&(i[e]=function(t){return new Promise(function(r,i){s.push([e,t,r,i])>1||a(e,t)})})}function a(e,t){try{var r;(r=n[e](t)).value instanceof m?Promise.resolve(r.value.v).then(c,u):h(s[0][2],r)}catch(e){h(s[0][3],e)}}function c(e){a("next",e)}function u(e){a("throw",e)}function h(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},i("next"),i("throw",function(e){throw e}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:m(e[i](t)),done:"return"===i}:n?n(t):t}:n}}function D(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){!function(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r})},t)}(i,n,(t=e[r](t)).done,t.value)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
1function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},30451:function(e,t,r){"use strict";let i;r.d(t,{EthereumProvider:function(){return og}});var n={};r.r(n),r.d(n,{identity:function(){return eX}});var s={};r.r(s),r.d(s,{base2:function(){return eZ}});var o={};r.r(o),r.d(o,{base8:function(){return e0}});var a={};r.r(a),r.d(a,{base10:function(){return e1}});var c={};r.r(c),r.d(c,{base16:function(){return e3},base16upper:function(){return e2}});var u={};r.r(u),r.d(u,{base32:function(){return e8},base32hex:function(){return e9},base32hexpad:function(){return te},base32hexpadupper:function(){return tt},base32hexupper:function(){return e7},base32pad:function(){return e5},base32padupper:function(){return e4},base32upper:function(){return e6},base32z:function(){return tr}});var h={};r.r(h),r.d(h,{base36:function(){return ti},base36upper:function(){return tn}});var l={};r.r(l),r.d(l,{base58btc:function(){return ts},base58flickr:function(){return to}});var f={};r.r(f),r.d(f,{base64:function(){return ta},base64pad:function(){return tc},base64url:function(){return tu},base64urlpad:function(){return th}});var d={};r.r(d),r.d(d,{base256emoji:function(){return tp}});var p={};r.r(p),r.d(p,{sha256:function(){return tA},sha512:function(){return tM}});var g={};r.r(g),r.d(g,{identity:function(){return tx}});var b={};r.r(b),r.d(b,{code:function(){return tO},decode:function(){return tR},encode:function(){return tT},name:function(){return tP}});var y={};r.r(y),r.d(y,{code:function(){return tj},decode:function(){return tz},encode:function(){return tq},name:function(){return tL}});var m=r(55445),v=r.n(m),w=r(22764),D=r(40537);class _{}class E extends _{constructor(e){super()}}let S=D.FIVE_SECONDS,I="heartbeat_pulse";class C extends E{constructor(e){super(e),this.events=new m.EventEmitter,this.interval=S,this.interval=e?.interval||S}static async init(e){let t=new C(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,D.toMiliseconds)(this.interval))}pulse(){this.events.emit(I)}}let A=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,M=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,x=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function P(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);return}return t}function O(e,t={}){if("string"!=typeof e)return e;let r=e.trim();if('"'===e[0]&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){let e=r.toLowerCase();if("true"===e)return!0;if("false"===e)return!1;if("undefined"===e)return;if("null"===e)return null;if("nan"===e)return Number.NaN;if("infinity"===e)return Number.POSITIVE_INFINITY;if("-infinity"===e)return Number.NEGATIVE_INFINITY}if(!x.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(A.test(e)||M.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,P)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}var T=r(82957).Buffer;function R(e,...t){try{var r;return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}function k(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return k(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}function N(){if(void 0===T)throw TypeError("[unstorage] Buffer is not supported!")}let L="base64:";function j(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function q(e){return(e=j(e))?e+":":""}let z=()=>{let e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function U(e,t,r){return e.watch?e.watch((e,i)=>t(e,r+i)):()=>{}}async function F(e){"function"==typeof e.dispose&&await R(e.dispose)}function B(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function $(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let i=B(r);return(e,r)=>i.then(i=>r(i.transaction(t,e).objectStore(t)))}
1function H(){return i||(i=$("keyval-store","keyval")),i}function V(e,t=H()){return t("readonly",t=>B(t.get(e)))}var K=r(80577),W=(e={})=>{let t;let r=e.base&&e.base.length>0?`${e.base}:`:"",i=e=>r+e;return e.dbName&&e.storeName&&(t=$(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await V(i(e),t)>"u"),getItem:async e=>await V(i(e),t)??null,setItem:(e,r)=>(function(e,t,r=H()){return r("readwrite",r=>(r.put(t,e),B(r.transaction)))})(i(e),r,t),removeItem:e=>(function(e,t=H()){return t("readwrite",t=>(t.delete(e),B(t.transaction)))})(i(e),t),getKeys:()=>(function(e=H()){return e("readonly",e=>{var t;if(e.getAllKeys)return B(e.getAllKeys());let r=[];return(t=e=>r.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},B(e.transaction)).then(()=>r)})})(t),clear:()=>(function(e=H()){return e("readwrite",e=>(e.clear(),B(e.transaction)))})(t)}};class J{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||z()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},i=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),n=(e,r)=>{if(t.watching)for(let i of(r=j(r),t.watchListeners))i(e,r)},s=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await U(t.mounts[e],n,e)},o=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},a=(e,t,i)=>{let n=new Map,s=e=>{let t=n.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},n.set(e.base,t)),t};for(let i of e){let e="string"==typeof i,n=j(e?i:i.key),o=e?void 0:i.value,a=e||!i.options?t:{...t,...i.options},c=r(n);s(c).items.push({key:n,value:o,relativeKey:c.relativeKey,options:a})}return Promise.all([...n.values()].map(e=>i(e))).then(e=>e.flat())},c={hasItem(e,t={}){let{relativeKey:i,driver:n}=r(e=j(e));return R(n.hasItem,i,t)},getItem(e,t={}){let{relativeKey:i,driver:n}=r(e=j(e));return R(n.getItem,i,t).then(e=>O(e))},getItems:(e,t)=>a(e,t,e=>e.driver.getItems?R(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return j(e.join(":"))}(e.base,t.key),value:O(t.value)}))):Promise.all(e.items.map(t=>R(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:O(e)}))))),getItemRaw(e,t={}){let{relativeKey:i,driver:n}=r(e=j(e));return n.getItemRaw?R(n.getItemRaw,i,t):R(n.getItem,i,t).then(e=>"string"==typeof e&&e.startsWith(L)?(N(),T.from(e.slice(L.length),"base64")):e)},async setItem(e,t,i={}){if(void 0===t)return c.removeItem(e);let{relativeKey:s,driver:o}=r(e=j(e));o.setItem&&(await R(o.setItem,s,k(t),i),o.watch||n("update",e))},async setItems(e,t){await a(e,t,async e=>{if(e.driver.setItems)return R(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:k(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>R(e.driver.setItem,t.relativeKey,k(t.value),t.options)))})},async setItemRaw(e,t,i={}){if(void 0===t)return c.removeItem(e,i);let{relativeKey:s,driver:o}=r(e=j(e));if(o.setItemRaw)await R(o.setItemRaw,s,t,i);else{if(!o.setItem)return;await R(o.setItem,s,"string"==typeof t?t:(N(),L+T.from(t).toString("base64")),i)}o.watch||n("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:i,driver:s}=r(e=j(e));s.removeItem&&(await R(s.removeItem,i,t),(t.removeMeta||t.removeMata)&&await R(s.removeItem,i+"$",t),s.watch||n("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:i,driver:n}=r(e=j(e)),s=Object.create(null);if(n.getMeta&&Object.assign(s,await R(n.getMeta,i,t)),!t.nativeOnly){let e=await R(n.getItem,i+"$",t).then(e=>O(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=i(e=q(e),!0),n=[],s=[];for(let e of r){for(let r of(await R(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+j(r);n.some(e=>
1t.startsWith(e))||s.push(t)}n=[e.mountpoint,...n.filter(t=>!t.startsWith(e.mountpoint))]}return e?s.filter(t=>t.startsWith(e)&&"$"!==t[t.length-1]):s.filter(e=>"$"!==e[e.length-1])},async clear(e,t={}){e=q(e),await Promise.all(i(e,!1).map(async e=>e.driver.clear?R(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>F(e)))},watch:async e=>(await s(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await o()}),async unwatch(){t.watchListeners=[],await o()},mount(e,r){if((e=q(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(U(r,n,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),c},async unmount(e,r=!0){(e=q(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e](),delete t.unwatch[e]),r&&await F(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=j(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>i(e=j(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>c.getKeys(e,t),get:(e,t={})=>c.getItem(e,t),set:(e,t,r={})=>c.setItem(e,t,r),has:(e,t={})=>c.hasItem(e,t),del:(e,t={})=>c.removeItem(e,t),remove:(e,t={})=>c.removeItem(e,t)};return c}({driver:W({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,(0,K.u)(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var G="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},Y={exports:{}};function Q(e){var t;return[e[0],(0,K.D)(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof G&&G.localStorage?Y.exports=G.localStorage:"u">typeof window&&window.localStorage?Y.exports=window.localStorage:Y.exports=new e}();class X{constructor(){this.localStorage=Y.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Q)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return(0,K.D)(t)}async setItem(e,t){this.localStorage.setItem(e,(0,K.u)(t))}async removeItem(e){this.localStorage.removeItem(e)}}let Z=async(e,t,r)=>{let i="wc_storage_version",n=await t.getItem(i);if(n&&n>=1){r(t);return}let s=await e.getKeys();if(!s.length){r(t);return}let o=[];for(;s.length;){let r=s.shift();if(!r)continue;let i=r.toLowerCase();if(i.includes("wc@")||i.includes("walletconnect")||i.includes("wc_")||i.includes("wallet_connect")){let i=await e.getItem(r);await t.setItem(r,i),o.push(r)}}await t.setItem(i,1),r(t),ee(e,o)},ee=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class et{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new X;this.storage=e;try{let t=new J;Z(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var er=r(97435),ei=r.n(er);let en={level:"info"},es="custom_context";class eo{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class ea{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new eo(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}class ec{constructor(e,t=1024e3){this.level=e??"error",this.levelValue=er.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new ea(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===er.levels.values.error?console.error(e):t===er.levels.values.warn?console.warn(e):t===er.levels.values.debug?console.debug(e):t===er.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append((0,K.u)({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new ea(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push((0,K.u)({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class eu{constructor(e,t=1024e3){this.baseChunkLogger=new ec(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class eh{constructor(e,t=1024e3){this.baseChunkLogger=new ec(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var el=Object.defineProperty,ef=Object.defineProperties,ed=Object.getOwnPropertyDescriptors,ep=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,eb=Object.prototype.propertyIsEnumerable,ey=(e,t,r)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,em=(e,t)=>
1{for(var r in t||(t={}))eg.call(t,r)&&ey(e,r,t[r]);if(ep)for(var r of ep(t))eb.call(t,r)&&ey(e,r,t[r]);return e},ev=(e,t)=>ef(e,ed(t));function ew(e){return ev(em({},e),{level:e?.level||en.level})}function eD(e,t=es){return typeof e.bindings>"u"?function(e,t=es){return e[t]||""}(e,t):e.bindings().context||""}function e_(e,t,r=es){let i=function(e,t,r=es){let i=eD(e,r);return i.trim()?`${i}/${t}`:t}(e,t,r);return function(e,t,r=es){return e[r]=t,e}(e.child({context:i}),i,r)}class eE extends _{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class eS extends _{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class eI{constructor(e,t){this.logger=e,this.core=t}}class eC extends _{constructor(e,t){super(),this.relayer=e,this.logger=t}}class eA extends _{constructor(e){super()}}class eM{constructor(e,t,r,i){this.core=e,this.logger=t,this.name=r}}class ex extends _{constructor(e,t){super(),this.relayer=e,this.logger=t}}class eP extends _{constructor(e,t){super(),this.core=e,this.logger=t}}class eO{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class eT{constructor(e,t){this.projectId=e,this.logger=t}}class eR{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}class ek{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class eN{constructor(e){this.client=e}}var eL=r(77674),ej=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=n}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===c;)i++,t++;for(var s=(e.length-t)*u+1>>>0,o=new Uint8Array(s);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var l=0,f=s-1;(0!==h||l<n)&&-1!==f;f--,l++)h+=a*o[f]>>>0,o[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");n=l,t++}if(" "!==e[t]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*h+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=t[n],f=0,d=o-1;(0!==l||f<i)&&-1!==d;d--,f++)l+=256*u[d]>>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=c.repeat(r);p<o;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:l,decode:function(e){var r=l(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let eq=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},ez=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},eU=e=>new TextEncoder().encode(e),eF=e=>new TextDecoder().decode(e);class eB{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class e${constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return eV(this,e)}}class eH{constructor(e){this.decoders=e}or(e){return eV(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}
1, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let eV=(e,t)=>new eH({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class eK{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new eB(e,t,r),this.decoder=new e$(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let eW=({name:e,prefix:t,encode:r,decode:i})=>new eK(e,t,r,i),eJ=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=ej(r,t);return eW({prefix:e,name:t,encode:i,decode:e=>ez(n(e))})},eG=(e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,c=0,u=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${i} character`);c=c<<r|s,(a+=r)>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return o},eY=(e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,s="",o=0,a=0;for(let i=0;i<e.length;++i)for(a=a<<8|e[i],o+=8;o>r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s},eQ=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>eW({prefix:t,name:e,encode:e=>eY(e,i,r),decode:t=>eG(t,i,r,e)}),eX=eW({prefix:"\0",name:"identity",encode:e=>eF(e),decode:e=>eU(e)}),eZ=eQ({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),e0=eQ({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),e1=eJ({prefix:"9",name:"base10",alphabet:"0123456789"}),e3=eQ({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),e2=eQ({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),e8=eQ({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),e6=eQ({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),e5=eQ({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),e4=eQ({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),e9=eQ({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),e7=eQ({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),te=eQ({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),tt=eQ({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),tr=eQ({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ti=eJ({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),tn=eJ({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ts=eJ({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),to=eJ({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ta=eQ({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tc=eQ({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),tu=eQ({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),th=eQ({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),tl=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),tf=tl.reduce((e,t,r)=>(e[r]=t,e),[]),td=tl.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),tp=eW({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
1e+=tf[t],"")},decode:function(e){let t=[];for(let r of e){let e=td[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var tg=function e(t,r,i){r=r||[];for(var n=i=i||0;t>=2147483648;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},tb=function e(t,r){var i,n=0,r=r||0,s=0,o=r,a=t.length;do{if(o>=a)throw e.bytes=0,RangeError("Could not decode varint");i=t[o++],n+=s<28?(127&i)<<s:(127&i)*Math.pow(2,s),s+=7}while(i>=128);return e.bytes=o-r,n};let ty=(e,t=0)=>[tb(e,t),tb.bytes],tm=(e,t,r=0)=>(tg(e,t,r),t),tv=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,tw=(e,t)=>{let r=t.byteLength,i=tv(e),n=i+tv(r),s=new Uint8Array(n+r);return tm(e,s,0),tm(r,s,i),s.set(t,n),new tE(e,r,t,s)},tD=e=>{let t=ez(e),[r,i]=ty(t),[n,s]=ty(t.subarray(i)),o=t.subarray(i+s);if(o.byteLength!==n)throw Error("Incorrect length");return new tE(r,n,o,t)},t_=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&eq(e.bytes,t.bytes);
1class tE{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let tS=({name:e,code:t,encode:r})=>new tI(e,t,r);class tI{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tw(this.code,t):t.then(e=>tw(this.code,e))}throw Error("Unknown type, must be binary type")}}let tC=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),tA=tS({name:"sha2-256",code:18,encode:tC("SHA-256")}),tM=tS({name:"sha2-512",code:19,encode:tC("SHA-512")}),tx={code:0,name:"identity",encode:ez,digest:e=>tw(0,ez(e))},tP="raw",tO=85,tT=e=>ez(e),tR=e=>ez(e),tk=new TextEncoder,tN=new TextDecoder,tL="json",tj=512,tq=e=>tk.encode(JSON.stringify(e)),tz=e=>JSON.parse(tN.decode(e));class tU{constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:tG,byteLength:tG,code:tJ,version:tJ,multihash:tJ,bytes:tJ,_baseCache:tG,asCID:tG})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==tH)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==tV)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return tU.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=tw(e,t);return tU.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&t_(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:i}=this;return 0===r?tB(t,i,e||ts.encoder):t$(t,i,e||e8.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return tY(/^0\.0/,tQ),!!(e&&(e[tW]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof tU)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:i,bytes:n}=e;return new tU(t,r,i,n||tK(t,r,i.bytes))}if(null==e||!0!==e[tW])return null;{let{version:t,multihash:r,code:i}=e,n=tD(r);return tU.create(t,i,n)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===tH)return new tU(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${tH}) block encoding`);case 1:{let i=tK(e,t,r.bytes);return new tU(e,t,r,i)}default:throw Error("Invalid version")}}static createV0(e){return tU.create(0,tH,e)}static createV1(e,t){return tU.create(1,e,t)}static decode(e){let[t,r]=tU.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=tU.inspectBytes(e),r=t.size-t.multihashSize,i=ez(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw Error("Incorrect length");let n=i.subarray(t.multihashSize-t.digestSize),s=new tE(t.multihashCode,t.digestSize,n,i);return[0===t.version?tU.createV0(s):tU.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,i]=ty(e.subarray(t));return t+=i,r},i=r(),n=tH;if(18===i?(i=0,t=0):1===i&&(n=r()),0!==i&&1!==i)throw RangeError(`Invalid CID version ${i}`);let s=t,o=r(),a=r(),c=t+a;return{version:i,codec:n,multihashCode:o,digestSize:a,multihashSize:c-s,size:c}}static parse(e,t){let[r,i]=tF(e,t),n=tU.decode(i);return n._baseCache.set(r,e),n}}let tF=(e,t)=>{switch(e[0]){case"Q":return[ts.prefix,(t||ts).decode(`${ts.prefix}${e}`)];case ts.prefix:return[ts.prefix,(t||ts).decode(e)];case e8.prefix:return[e8.prefix,(t||e8).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},tB=(e,t,r)=>{let{prefix:i}=r;if(i!==ts.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=t.get(i);if(null!=n)return n;{let n=r.encode(e).slice(1);return t.set(i,n),n}},t$=(e,t,r)=>{let{prefix:i}=r,n=t.get(i);if(null!=n)return n;{let n=r.encode(e);return t.set(i,n),n}},tH=112,tV=18,tK=(e,t,r)=>{let i=tv(e),n=i+tv(t),s=new Uint8Array(n+r.byteLength);return tm(e,s,0),tm(t,s,i),s.set(r,n),s}
1,tW=Symbol.for("@ipld/js-cid/CID"),tJ={writable:!1,configurable:!1,enumerable:!0},tG={writable:!1,enumerable:!1,configurable:!1},tY=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},tQ=`CID.isCID(v) is deprecated and will be removed in the next major release.
2Following code pattern:
3
4if (CID.isCID(value)) {
5  doSomethingWithCID(value)
6}
7
8Is replaced with:
9
10const cid = CID.asCID(value)
11if (cid) {
12  // Make sure to use cid instead of value
13  doSomethingWithCID(cid)
14}
15`,tX={...n,...s,...o,...a,...c,...u,...h,...l,...f,...d};function tZ(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...p,...g});let t0=tZ("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),t1=tZ("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),t3={utf8:t0,"utf-8":t0,hex:tX.base16,latin1:t1,ascii:t1,binary:t1,...tX},t2="INTERNAL_ERROR",t8="SERVER_ERROR",t6=[-32700,-32600,-32601,-32602,-32603],t5={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[t2]:{code:-32603,message:"Internal error"},[t8]:{code:-32e3,message:"Server error"}};function t4(e){return Object.keys(t5).includes(e)?t5[e]:t5[t8]}function t9(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${t}`):e}var t7=r(13303);
15function re(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function rt(e=6){return BigInt(re(e))}function rr(e,t,r){return{id:r||re(),jsonrpc:"2.0",method:e,params:t}}function ri(e,t){return{id:e,jsonrpc:"2.0",result:t}}function rn(e,t,r){var i,n,s;return{id:e,jsonrpc:"2.0",error:void 0===(i=t)?t4(t2):("string"==typeof i&&(i=Object.assign(Object.assign({},t4(t8)),{message:i})),void 0!==r&&(i.data=r),n=i.code,t6.includes(n)&&(s=i.code,i=Object.values(t5).find(e=>e.code===s)||t5[t8]),i)}}class rs{}class ro extends rs{constructor(){super()}}class ra extends ro{constructor(e){super()}}function rc(e,t){let r=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function ru(e){return rc(e,"^https?:")}function rh(e){return rc(e,"^wss?:")}function rl(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function rf(e){return rl(e)&&"method"in e}function rd(e){return rl(e)&&(rp(e)||rg(e))}function rp(e){return"result"in e}function rg(e){return"error"in e}class rb extends ra{constructor(e){super(e),this.events=new m.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(rr(e.method,e.params||[],e.id||rt().toString()),t)}async requestStrict(e,t){return new Promise(async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(e){i(e)}this.events.on(`${e.id}`,e=>{rg(e)?i(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){i(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),rd(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let ry=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,rm=e=>e.split("?")[0],rv="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(16854);class rw{constructor(e){if(this.url=e,this.events=new m.EventEmitter,this.registering=!1,!rh(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send((0,K.u)(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!rh(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
15{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let i=new URLSearchParams(e).get("origin"),n=(0,t7.isReactNative)()?{headers:{origin:i}}:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},s=new rv(e,[],n);ry()?s.onerror=e=>{r(this.emitError(e.error))}:s.on("error",e=>{r(this.emitError(e))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,K.D)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),i=rn(e,r.message||r.toString());this.events.emit("payload",i)}parseError(e,t=this.url){return t9(e,rm(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${rm(this.url)}`));return this.events.emit("register_error",t),t}}var rD=r(15586),r_=r.n(rD);let rE="core",rS=`wc@2:${rE}:`,rI={logger:"error"},rC={database:":memory:"},rA="client_ed25519_seed",rM=D.ONE_DAY,rx=D.SIX_HOURS,rP="wss://relay.walletconnect.org",rO={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},rT={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},rR="2.17.0",rk={link_mode:"link_mode",relay:"relay"},rN="WALLETCONNECT_LINK_MODE_APPS",rL={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},rj=1e3*D.FIVE_SECONDS,rq={wc_pairingDelete:{req:{ttl:D.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:D.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:D.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:D.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:D.ONE_DAY,prompt:!1,tag:0},res:{ttl:D.ONE_DAY,prompt:!1,tag:0}}},rz={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},rU={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},rF={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},rB="https://verify.walletconnect.org",r$=`${rB}/v3`,rH=["https://verify.walletconnect.com",rB],rV={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal"},rK={no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_listener_not_found:"proposal_listener_not_found"},rW={session_approve_started:"session_approve_started",session_namespaces_validation_success:"session_namespaces_validation_success",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},rJ={no_internet_connection:"no_internet_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},rG={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"}
15,rY={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"};var rQ=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=n}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===c;)i++,t++;for(var s=(e.length-t)*u+1>>>0,o=new Uint8Array(s);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var l=0,f=s-1;(0!==h||l<n)&&-1!==f;f--,l++)h+=a*o[f]>>>0,o[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");n=l,t++}if(" "!==e[t]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*h+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=t[n],f=0,d=o-1;(0!==l||f<i)&&-1!==d;d--,f++)l+=256*u[d]>>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=c.repeat(r);p<o;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:l,decode:function(e){var r=l(e);if(r)return r;throw Error(`Non-${t} character`)}}};let rX=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},rZ=e=>new TextEncoder().encode(e),r0=e=>new TextDecoder().decode(e);class r1{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class r3{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return r8(this,e)}}class r2{constructor(e){this.decoders=e}or(e){return r8(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let r8=(e,t)=>new r2({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});
15class r6{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new r1(e,t,r),this.decoder=new r3(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let r5=({name:e,prefix:t,encode:r,decode:i})=>new r6(e,t,r,i),r4=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=rQ(r,t);return r5({prefix:e,name:t,encode:i,decode:e=>rX(n(e))})},r9=(e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,c=0,u=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${i} character`);c=c<<r|s,(a+=r)>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return o},r7=(e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,s="",o=0,a=0;for(let i=0;i<e.length;++i)for(a=a<<8|e[i],o+=8;o>r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s},ie=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>r5({prefix:t,name:e,encode:e=>r7(e,i,r),decode:t=>r9(t,i,r,e)});var it=Object.freeze({__proto__:null,identity:r5({prefix:"\0",name:"identity",encode:e=>r0(e),decode:e=>rZ(e)})}),ir=Object.freeze({__proto__:null,base2:ie({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),ii=Object.freeze({__proto__:null,base8:ie({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),is=Object.freeze({__proto__:null,base10:r4({prefix:"9",name:"base10",alphabet:"0123456789"})}),io=Object.freeze({__proto__:null,base16:ie({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:ie({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let ia=ie({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ic=ie({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),iu=ie({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ih=ie({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),il=ie({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),id=ie({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var ip=Object.freeze({__proto__:null,base32:ia,base32upper:ic,base32pad:iu,base32padupper:ih,base32hex:il,base32hexupper:id,base32hexpad:ie({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:ie({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:ie({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),ig=Object.freeze({__proto__:null,base36:r4({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:r4({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),ib=Object.freeze({__proto__:null,base58btc:r4({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:r4({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let iy=ie({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});var im=Object.freeze({__proto__:null,base64:iy,base64pad:ie({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:ie({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:ie({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let iv=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),iw=iv.reduce((e,t,r)=>(e[r]=t,e),[]),iD=iv.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var i_=Object.freeze({__proto__:null,base256emoji:r5({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
15e+=iw[t],"")},decode:function(e){let t=[];for(let r of e){let e=iD[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function iE(e,t){var r,i=0,t=t||0,n=0,s=t,o=e.length;do{if(s>=o)throw iE.bytes=0,RangeError("Could not decode varint");r=e[s++],i+=n<28?(127&r)<<n:(127&r)*Math.pow(2,n),n+=7}while(r>=128);return iE.bytes=s-t,i}var iS=function e(t,r,i){r=r||[],i=i||0;for(var n=i;t>=2147483648;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r};let iI=(e,t,r=0)=>(iS(e,t,r),t),iC=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,iA=(e,t)=>{let r=t.byteLength,i=iC(e),n=i+iC(r),s=new Uint8Array(n+r);return iI(e,s,0),iI(r,s,i),s.set(t,n),new iM(e,r,t,s)};class iM{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let ix=({name:e,code:t,encode:r})=>new iP(e,t,r);class iP{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?iA(this.code,t):t.then(e=>iA(this.code,e))}throw Error("Unknown type, must be binary type")}}let iO=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var iT=Object.freeze({__proto__:null,sha256:ix({name:"sha2-256",code:18,encode:iO("SHA-256")}),sha512:ix({name:"sha2-512",code:19,encode:iO("SHA-512")})}),iR=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:rX,digest:e=>iA(0,rX(e))}});new TextEncoder,new TextDecoder;let ik={...it,...ir,...ii,...is,...io,...ip,...ig,...ib,...im,...i_};function iN(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...iT,...iR});let iL=iN("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ij=iN("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),iq={utf8:iL,"utf-8":iL,hex:ik.base16,latin1:ij,ascii:ij,binary:ij,...ik};class iz{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name="keychain",this.version="0.3",this.initialized=!1,this.storagePrefix=rS,this.init=async()=>{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=e_(t,this.name)}get context(){return eD(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,(0,w.KCv)(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?(0,w.IPd)(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class iU{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.randomSessionIdentifier=(0,w.jdp)(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>{this.isInitialized();let e=await this.getClientSeed(),t=eL.generateKeyPair(e);return eL.encodeIss(t.publicKey)},this.generateKeyPair=()=>{this.isInitialized();let e=(0,w.Au2)();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=await this.getClientSeed(),r=eL.generateKeyPair(t),i=this.randomSessionIdentifier;return await eL.signJWT(i,e,rM,r)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();let i=this.getPrivateKey(e),n=(0,w.m$A)(i,t);return this.setSymKey(n,r)},this.setSymKey=async(e,t)=>{this.isInitialized();let r=t||(0,w.YmJ)(e);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();let i=(0,w.ENt)(r),n=(0,K.u)(t);if((0,w.Hs$)(i))return(0,w.Spz)(n,r?.encoding);
15if((0,w.Q8x)(i)){let t=i.senderPublicKey,r=i.receiverPublicKey;e=await this.generateSharedKey(t,r)}let s=this.getSymKey(e),{type:o,senderPublicKey:a}=i;return(0,w.HIp)({type:o,symKey:s,message:n,senderPublicKey:a,encoding:r?.encoding})},this.decode=async(e,t,r)=>{this.isInitialized();let i=(0,w.Llj)(t,r);if((0,w.Hs$)(i)){let e=(0,w.xQU)(t,r?.encoding);return(0,K.D)(e)}if((0,w.Q8x)(i)){let t=i.receiverPublicKey,r=i.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let i=this.getSymKey(e),n=(0,w.peR)({symKey:i,encoded:t,encoding:r?.encoding});return(0,K.D)(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=w.$dT)=>{let r=(0,w.vBi)({encoded:e,encoding:t});return(0,w.WGe)(r.type)},this.getPayloadSenderPublicKey=(e,t=w.$dT)=>{let r=(0,w.vBi)({encoded:e,encoding:t});return r.senderPublicKey?function(e,t="utf8"){let r=t3[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}(r.senderPublicKey,w.AWt):void 0},this.core=e,this.logger=e_(t,this.name),this.keychain=r||new iz(this.core,this.logger)}get context(){return eD(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(rA)}catch{e=(0,w.jdp)(),await this.keychain.set(rA,e)}return function(e,t="utf8"){let r=iq[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class iF extends eI{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=rS,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();let r=(0,w.rjm)(t),i=this.messages.get(e);return typeof i>"u"&&(i={}),"u">typeof i[r]||(i[r]=t,this.messages.set(e,i),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[(0,w.rjm)(t)]),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=e_(e,this.name),this.core=t}get context(){return eD(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,(0,w.KCv)(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?(0,w.IPd)(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class iB extends eC{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new m.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,D.toMiliseconds)(D.ONE_MINUTE),this.failedPublishTimeout=(0,D.toMiliseconds)(D.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});let n=r?.ttl||rx,s=(0,w._HE)(r),o=r?.prompt||!1,a=r?.tag||0,c=r?.id||rt().toString(),u={topic:e,message:t,opts:{ttl:n,relay:s,prompt:o,tag:a,id:c,attestation:r?.attestation}},h=`Failed to publish payload, please try again. id:${c} tag:${a}`,l=Date.now(),f,d=1;try{for(;void 0===f;){if(Date.now()-l>this.publishTimeout)throw Error(h);this.logger.trace({id:c,attempts:d},`publisher.publish - attempt ${d}`),f=await await (0,w.hFY)(this.rpcPublish(e,t,n,s,o,a,c,r?.attestation).catch(e=>this.logger.warn(e)),this.publishTimeout,h),d++,f||await new Promise(e=>setTimeout(e,this.failedPublishTimeout))}this.relayer.events.emit(rO.publish,u),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:c,topic:e,message:t,opts:r}})}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(i=r?.internal)&&i.throwOnFailedPublish)throw e;this.queue.set(c,u)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=e_(t,this.name),this.registerEventListeners()}get context(){return eD(this.logger)}rpcPublish(e,t,r,i,n,s,o,a){var c,u,h,l;let f={method:(0,w.cOS)(i.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:n,tag:s,attestation:a},id:o};return(0,w.o8e)(null==(c=f.params)?void 0:c.prompt)&&(null==(u=f.params)||delete u.prompt),(0,w.o8e)(null==(h=f.params)?void 0:h.tag)&&(null==(l=f.params)||delete l.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:f}),this.relayer.request(f)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{let{topic:t,message:r,opts:i}=e;await this.publish(t,r,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(I,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(rO.connection_stalled);return}this.checkQueue()}),this.relayer.on(rO.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class i${constructor(){this.map=new Map,this.set=(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>
15{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let i=r.filter(e=>e!==t);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var iH=Object.defineProperty,iV=Object.defineProperties,iK=Object.getOwnPropertyDescriptors,iW=Object.getOwnPropertySymbols,iJ=Object.prototype.hasOwnProperty,iG=Object.prototype.propertyIsEnumerable,iY=(e,t,r)=>t in e?iH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iQ=(e,t)=>{for(var r in t||(t={}))iJ.call(t,r)&&iY(e,r,t[r]);if(iW)for(var r of iW(t))iG.call(t,r)&&iY(e,r,t[r]);return e},iX=(e,t)=>iV(e,iK(t));class iZ extends ex{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new i$,this.events=new m.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=rS,this.subscribeTimeout=(0,D.toMiliseconds)(D.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let r=(0,w._HE)(t),i={topic:e,relay:r,transportType:t?.transportType};this.pending.set(e,i);let n=await this.rpcSubscribe(e,r,t?.transportType);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),n}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>{if(this.topics.includes(e))return!0;let t=`${this.pendingSubscriptionWatchLabel}_${e}`;return await new Promise((r,i)=>{let n=new D.Watch;n.start(t);let s=setInterval(()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(s),n.stop(t),r(!0)),n.elapsed(t)>=rj&&(clearInterval(s),n.stop(t),i(Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=e_(t,this.name),this.clientId=""}get context(){return eD(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let i=(0,w._HE)(r);await this.rpcUnsubscribe(e,t,i);let n=(0,w.D6H)("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r=rk.relay){r===rk.relay&&await this.restartToComplete();let i={method:(0,w.cOS)(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{let t=(0,w.rjm)(e+this.clientId);return r===rk.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(e=>this.logger.warn(e))},(0,D.toMiliseconds)(D.ONE_SECOND)),t):await await (0,w.hFY)(this.relayer.request(i).catch(e=>this.logger.warn(e)),this.subscribeTimeout)?t:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(rO.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t=e[0].relay,r={method:(0,w.cOS)(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});
15try{return await await (0,w.hFY)(this.relayer.request(r).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(rO.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let r=e[0].relay,i={method:(0,w.cOS)(r.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{t=await await (0,w.hFY)(this.relayer.request(i).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(rO.connection_stalled)}return t}rpcUnsubscribe(e,t,r){let i={method:(0,w.cOS)(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,iX(iQ({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,iQ({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,iQ({},t)),this.topicMap.set(t.topic,e),this.events.emit(rL.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(rL.deleted,iX(iQ({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(rL.sync)}async reset(){if(this.cached.length){let e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){let e=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(e),await this.batchSubscribe(e)}}this.events.emit(rL.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){let{message:e}=(0,w.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;let t=await this.rpcBatchSubscribe(e);(0,w.qt8)(t)&&this.onBatchSubscribe(t.map((t,r)=>iX(iQ({},e[r]),{id:t})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(I,async()=>{await this.checkPending()}),this.events.on(rL.created,async e=>{let t=rL.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(rL.deleted,async e=>{let t=rL.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(){this.relayer.connected||this.relayer.connecting||await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var i0=Object.defineProperty,i1=Object.getOwnPropertySymbols,i3=Object.prototype.hasOwnProperty,i2=Object.prototype.propertyIsEnumerable,i8=(e,t,r)=>t in e?i0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i6=(e,t)=>{for(var r in t||(t={}))i3.call(t,r)&&i8(e,r,t[r]);if(i1)for(var r of i1(t))i2.call(t,r)&&i8(e,r,t[r]);return e};class i5 extends eA{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new m.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["s
15ocket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,D.toMiliseconds)(D.THIRTY_SECONDS+D.ONE_SECOND),this.request=async e=>{var t,r;this.logger.debug("Publishing Request Payload");let i=e.id||rt().toString();await this.toEstablishConnection();try{let n=this.provider.request(e);this.requestsInFlight.set(i,{promise:n,request:e}),this.logger.trace({id:i,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - attempt to publish...");let s=await new Promise(async(e,t)=>{let r=()=>{t(Error(`relayer.request - publish interrupted, id: ${i}`))};this.provider.on(rT.disconnect,r);let s=await n;this.provider.off(rT.disconnect,r),e(s)});return this.logger.trace({id:i,method:e.method,topic:null==(r=e.params)?void 0:r.topic},"relayer.request - published"),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${i}`),e}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if((0,w.UGU)())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r;null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)||r.terminate()},this.heartBeatTimeout)}catch(e){this.logger.warn(e)}},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(rO.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.error(e),this.events.emit(rO.error,e),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(rT.payload,this.onPayloadHandler),this.provider.on(rT.connect,this.onConnectHandler),this.provider.on(rT.disconnect,this.onDisconnectHandler),this.provider.on(rT.error,this.onProviderErrorHandler)},this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?e_(e.logger,this.name):ei()(ew({level:e.logger||"error"})),this.messages=new iF(this.logger,e.core),this.subscriber=new iZ(this,this.logger),this.publisher=new iB(this,this.logger),this.relayUrl=e?.relayUrl||rP,this.projectId=e.projectId,this.bundleId=(0,w.X_B)(),this.provider={}}
15async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return eD(this.logger)}get connected(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===1}get connecting(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===0}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:rk.relay})}async subscribe(e,t){var r;this.isInitialized(),t?.transportType==="relay"&&await this.toEstablishConnection();let i=(null==(r=this.subscriber.topicMap.get(e))?void 0:r[0])||"",n,s=t=>{t.topic===e&&(this.subscriber.off(rL.created,s),n())};return await Promise.all([new Promise(e=>{n=e,this.subscriber.on(rL.created,s)}),new Promise(async r=>{i=await this.subscriber.subscribe(e,t)||i,r()})]),i}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await (0,w.hFY)(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(e,t)=>{let r=()=>{this.provider.off(rT.disconnect,r),t(Error("Connection interrupted while trying to subscribe"))};this.provider.on(rT.disconnect,r),await (0,w.hFY)(this.provider.connect(),(0,D.toMiliseconds)(D.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(e=>{this.logger.error(e),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){if(this.logger.error(e),this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(e.message))throw e}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await (0,w.Ggh)())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.trace(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:r}=e;if(!t.sessionExists){let e=(0,w.gn4)(D.FIVE_MINUTES);await this.core.pairing.pairings.set(r,{topic:r,expiry:e,relay:{protocol:"irn"},active:!1})}this.events.emit(rO.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,r,i,n;if((0,w.UGU)())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new rb(new rw((0,w.$0m)({sdkVersion:rR,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){let{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;let i=this.messages.has(t,r);return i&&this.logger.debug(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),rf(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:r,message:i,publishedAt:n,attestation:s}=t.data,o={topic:r,message:i,publishedAt:n,transportType:rk.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(i6({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else rd(e)&&this.events.emit(rO.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(rO.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){let t=ri(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(rT.payload,this.onPayloadHandler),this.provider.off(rT.connect,this.onConnectHandler),this.provider.off(rT.disconnect,this.onDisconnectHandler),this.provider.off(rT.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await (0,w.Ggh)();(0,w.uwg)(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(e=>this.logger.error(e)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(rO.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},(0,D.toMiliseconds)(.1))))}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),this.connected||(this.connectionAttemptInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var i4=Object.defineProperty,i9=Object.getOwnPropertySymbols,i7=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,nt=(e,t,r)=>t in e?i4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nr=(e,t)=>
15{for(var r in t||(t={}))i7.call(t,r)&&nt(e,r,t[r]);if(i9)for(var r of i9(t))ne.call(t,r)&&nt(e,r,t[r]);return e};class ni extends eM{constructor(e,t,r,i=rS,n){super(e,t,r,i),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=rS,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!(0,w.o8e)(e)?this.map.set(this.getKey(e),e):(0,w.xWS)(e)?this.map.set(e.id,e):(0,w.h1R)(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>r_()(t[r],e[r]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=nr(nr({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=e_(t,this.name),this.storagePrefix=i,this.getKey=n}get context(){return eD(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=(0,w.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class nn{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(v()),this.initialized=!1,this.storagePrefix=rS,this.ignoredPayloadTypes=[w.rVF],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=(0,w.jdp)(),r=await this.core.crypto.setSymKey(t),i=(0,w.gn4)(D.FIVE_MINUTES),n={protocol:"irn"},s={topic:r,expiry:i,relay:n,active:!1,methods:e?.methods},o=(0,w.Bvr)({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:n,expiryTimestamp:i,methods:e?.methods});return this.events.emit(rz.create,s),this.core.expirer.set(r,i),await this.pairings.set(r,s),await this.core.relayer.subscribe(r,{transportType:e?.transportType}),{topic:r,uri:o}},this.pair=async e=>{let t;this.isInitialized();let r=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[rV.pairing_started]}});this.isValidPair(e,r);let{topic:i,symKey:n,relay:s,expiryTimestamp:o,methods:a}
15=(0,w.heJ)(e.uri);if(r.props.properties.topic=i,r.addTrace(rV.pairing_uri_validation_success),r.addTrace(rV.pairing_uri_not_expired),this.pairings.keys.includes(i)){if(t=this.pairings.get(i),r.addTrace(rV.existing_pairing),t.active)throw r.setError(rK.active_pairing_already_exists),Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);r.addTrace(rV.pairing_not_expired)}let c=o||(0,w.gn4)(D.FIVE_MINUTES),u={topic:i,relay:s,expiry:c,active:!1,methods:a};this.core.expirer.set(i,c),await this.pairings.set(i,u),r.addTrace(rV.store_new_pairing),e.activatePairing&&await this.activate({topic:i}),this.events.emit(rz.create,u),r.addTrace(rV.emit_inactive_pairing),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(n,i),r.addTrace(rV.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{r.setError(rK.no_internet_connection)}try{await this.core.relayer.subscribe(i,{relay:s})}catch(e){throw r.setError(rK.subscribe_pairing_topic_failure),e}return r.addTrace(rV.subscribe_pairing_topic_success),u},this.activate=async({topic:e})=>{this.isInitialized();let t=(0,w.gn4)(D.THIRTY_DAYS);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=(0,w.H1S)();this.events.once((0,w.E0T)("pairing_ping",e),({error:e})=>{e?n(e):i()}),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",(0,w.D6H)("USER_DISCONNECTED")),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:r,expiry:i,methods:n}=e,s=this.core.crypto.keychain.get(t);return(0,w.Bvr)({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:r,expiryTimestamp:i,methods:n})},this.sendRequest=async(e,t,r)=>{let i=rr(t,r),n=await this.core.crypto.encode(e,i),s=rq[t].req;return this.core.history.set(e,i),this.core.relayer.publish(e,n,s),i.id},this.sendResult=async(e,t,r)=>{let i=ri(e,r),n=await this.core.crypto.encode(t,i),s=rq[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,n,s),await this.core.history.resolve(i)},this.sendError=async(e,t,r)=>{let i=rn(e,r),n=await this.core.crypto.encode(t,i),s=await this.core.history.get(t,e),o=rq[s.request.method]?rq[s.request.method].res:rq.unregistered_method.res;await this.core.relayer.publish(t,n,o),await this.core.history.resolve(i)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,(0,w.D6H)("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>(0,w.BwD)(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r}=e,i=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===i?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(rz.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:r}=t;setTimeout(()=>{rp(t)?this.events.emit((0,w.E0T)("pairing_ping",r),{}):rg(t)&&this.events.emit((0,w.E0T)("pairing_ping",r),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(rz.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:r,method:i}=t;try{if(this.registeredMethods.includes(i))return;let t=(0,w.D6H)("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error((0,w.D6H)("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=(e,t)=>
15{var r;if(!(0,w.EJd)(e)){let{message:r}=(0,w.kCb)("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(rK.malformed_pairing_uri),Error(r)}if(!(0,w.jvJ)(e.uri)){let{message:r}=(0,w.kCb)("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(rK.malformed_pairing_uri),Error(r)}let i=(0,w.heJ)(e?.uri);if(!(null!=(r=i?.relay)&&r.protocol)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(rK.malformed_pairing_uri),Error(e)}if(!(null!=i&&i.symKey)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(rK.malformed_pairing_uri),Error(e)}if(null!=i&&i.expiryTimestamp&&(0,D.toMiliseconds)(i?.expiryTimestamp)<Date.now()){t.setError(rK.pairing_expired);let{message:e}=(0,w.kCb)("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}},this.isValidPing=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!(0,w.M_r)(e,!1)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if((0,w.BwD)(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=(0,w.kCb)("EXPIRED",`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=e_(t,this.name),this.pairings=new ni(this.core,this.logger,this.name,this.storagePrefix)}get context(){return eD(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(rO.message,async e=>{let{topic:t,message:r,transportType:i}=e;if(!this.pairings.keys.includes(t)||i===rk.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;let n=await this.core.crypto.decode(t,r);try{rf(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):rd(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(rF.expired,async e=>{let{topic:t}=(0,w.iPz)(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(rz.expire,{topic:t}))})}}class ns extends eS{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new m.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=rS,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let i={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:(0,w.gn4)(D.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(rU.created,i)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=rg(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(rU.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}
15),this.values.forEach(r=>{r.topic!==e||"u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(rU.deleted,r))}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=e_(t,this.name)}get context(){return eD(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:rr(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(rU.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=(0,w.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(rU.created,e=>{let t=rU.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(rU.updated,e=>{let t=rU.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(rU.deleted,e=>{let t=rU.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(I,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,D.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(rU.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class no extends eP{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new m.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=rS,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let r=this.formatTarget(e),i={target:r,expiry:t};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit(rF.created,{target:r,expiration:i})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(rF.deleted,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=e_(t,this.name)}get context(){return eD(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return(0,w.Z42)(e);if("number"==typeof e)return(0,w.GqV)(e);let{message:t}=(0,w.kCb)("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(rF.sync)}
15async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=(0,w.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,D.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(rF.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(I,()=>this.checkExpirations()),this.events.on(rF.created,e=>{let t=rF.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(rF.expired,e=>{let t=rF.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(rF.deleted,e=>{let t=rF.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}var na={};function nc(e){let t;return"u">typeof window&&"u">typeof window[e]&&(t=window[e]),t}function nu(e){let t=nc(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(na,"__esModule",{value:!0}),na.getLocalStorage=na.getLocalStorageOrThrow=na.getCrypto=na.getCryptoOrThrow=na.getLocation=na.getLocationOrThrow=na.getNavigator=na.getNavigatorOrThrow=nh=na.getDocument=na.getDocumentOrThrow=na.getFromWindowOrThrow=na.getFromWindow=void 0,na.getFromWindow=nc,na.getFromWindowOrThrow=nu,na.getDocumentOrThrow=function(){return nu("document")};var nh=na.getDocument=function(){return nc("document")};na.getNavigatorOrThrow=function(){return nu("navigator")},na.getNavigator=function(){return nc("navigator")},na.getLocationOrThrow=function(){return nu("location")},na.getLocation=function(){return nc("location")},na.getCryptoOrThrow=function(){return nu("crypto")},na.getCrypto=function(){return nc("crypto")},na.getLocalStorageOrThrow=function(){return nu("localStorage")},na.getLocalStorage=function(){return nc("localStorage")};class nl extends eO{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,this.name="verify-api",this.verifyUrlV3=r$,this.storagePrefix=rS,this.version=2,this.init=async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,D.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async e=>{if(!(0,w.jUY)()||this.isDevEnv)return;let t=window.location.origin,{id:r,decryptedId:i}=e,n=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${i}`;try{let e=nh(),t=this.startAbortTimer(5*D.ONE_SECOND),i=await new Promise((i,s)=>{let o=()=>{window.removeEventListener("message",c),e.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",o);let a=e.createElement("iframe");a.src=n,a.style.display="none",a.addEventListener("error",o,{signal:this.abortController.signal});let c=n=>{if(n.data&&"string"==typeof n.data)try{let s=JSON.parse(n.data);if("verify_attestation"===s.type){if((0,eL.decodeJWT)(s.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",c),i(null===s.attestation?"":s.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",i),i}catch(e){this.logger.warn(e)}return""},this.resolve=async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:r,encryptedId:i}=e;if(""===t){this.logger.debug("resolve: attestationId is empty, skipping");return}if(t){if((0,eL.decodeJWT)(t).payload.id!==i)return;let e=await this.isValidJwtAttestation(t);
15if(e){if(!e.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return e}}if(!r)return;let n=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,n)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(5*D.ONE_SECOND),i=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.getVerifyUrl=e=>{let t=e||rB;return rH.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${rB}`),t=rB),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(D.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let r=(0,w.NbI)(e,t.publicKey),i={hasExpired:(0,D.toMiliseconds)(r.exp)<Date.now(),payload:r};if(i.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),Error("JWT attestation expired");return{origin:i.payload.origin,isScam:i.payload.isScam,isVerified:i.payload.isVerified}},this.logger=e_(t,this.name),this.abortController=new AbortController,this.isDevEnv=(0,w.h9F)(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return eD(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,D.toMiliseconds)(e))}}class nf extends eT{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context="echo",this.registerDeviceToken=async e=>{let{clientId:t,token:r,notificationType:i,enableEncrypted:n=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:i,token:r,always_raw:n})})},this.logger=e_(t,this.context)}}var nd=Object.defineProperty,np=Object.getOwnPropertySymbols,ng=Object.prototype.hasOwnProperty,nb=Object.prototype.propertyIsEnumerable,ny=(e,t,r)=>t in e?nd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nm=(e,t)=>{for(var r in t||(t={}))ng.call(t,r)&&ny(e,r,t[r]);if(np)for(var r of np(t))nb.call(t,r)&&ny(e,r,t[r]);return e};class nv extends eR{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,this.context="event-client",this.storagePrefix=rS,this.storageVersion=.1,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!(0,w.h9F)())try{let e={eventId:(0,w.k$y)(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:(0,w.oIp)(this.core.relayer.protocol,this.core.relayer.version,rR)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t="ERROR",type:r="",properties:{topic:i,trace:n}}=e,s=(0,w.k$y)(),o=this.core.projectId||"",a=nm({eventId:s,timestamp:Date.now(),props:{event:t,type:r,properties:{topic:i,trace:n}},bundleId:o,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,a),this.shouldPersist=!0),a},this.getEvent=e=>{let{eventId:t,topic:r}=e;if(t)return this.events.get(t);let i=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);if(i)return nm(nm({},i),this.setMethods(i.eventId))},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(I,async()=>
15{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,D.fromMiliseconds)(Date.now())-(0,D.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)},this.setError=(e,t)=>{let r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,nm(nm({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${rR}${t}`,{method:"POST",body:JSON.stringify(e)})},this.getAppDomain=()=>(0,w.DaH)().url,this.logger=e_(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var nw=Object.defineProperty,nD=Object.getOwnPropertySymbols,n_=Object.prototype.hasOwnProperty,nE=Object.prototype.propertyIsEnumerable,nS=(e,t,r)=>t in e?nw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nI=(e,t)=>{for(var r in t||(t={}))n_.call(t,r)&&nS(e,r,t[r]);if(nD)for(var r of nD(t))nE.call(t,r)&&nS(e,r,t[r]);return e};class nC extends eE{constructor(e){var t,r;super(e),this.protocol="wc",this.version=2,this.name=rE,this.events=new m.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;let i={topic:e,message:t,publishedAt:Date.now(),transportType:rk.link_mode};this.relayer.onLinkMessageEvent(i,{sessionExists:r})},this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||rP,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let{logger:i,chunkLoggerController:n}="u">typeof(r={opts:ew({level:"string"==typeof e?.logger&&e.logger?e.logger:rI.logger}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger}).loggerOverride&&"string"!=typeof r.loggerOverride?{logger:r.loggerOverride,chunkLoggerController:null}:"u">typeof window?function(e){var t,r;let i=new eu(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:ei()(ev(em({},e.opts),{level:"trace",browser:ev(em({},null==(r=e.opts)?void 0:r.browser),{write:e=>i.write(e)})})),chunkLoggerController:i}}(r):function(e){var t;let r=new eh(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:ei()(ev(em({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(r);this.logChunkController=n,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=e_(i,this.name),this.heartbeat=new C,this.crypto=new iU(this,this.logger,e?.keychain),this.history=new ns(this,this.logger),this.expirer=new no(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new et(nI(nI({},rC),e?.storageOptions)),this.relayer=new i5({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new nn(this,this.logger),this.verify=new nl(this,this.logger,this.storage),this.echoClient=new nf(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new nv(this,this.logger,e?.telemetryEnabled)}static async init(e){let t=new nC(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return eD(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(rN,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
15),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(rN)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}let nA="client",nM=`wc@2:${nA}:`,nx={name:nA,logger:"error"},nP="WALLETCONNECT_DEEPLINK_CHOICE",nO="Proposal expired",nT=D.SEVEN_DAYS,nR={wc_sessionPropose:{req:{ttl:D.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:D.ONE_DAY,prompt:!1,tag:1104},res:{ttl:D.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:D.ONE_DAY,prompt:!1,tag:1106},res:{ttl:D.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:D.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:D.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:D.ONE_DAY,prompt:!1,tag:1112},res:{ttl:D.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:D.ONE_DAY,prompt:!1,tag:1114},res:{ttl:D.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:D.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:D.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:D.FIVE_MINUTES,prompt:!1,tag:1119}}},nk={min:D.FIVE_MINUTES,max:D.SEVEN_DAYS},nN={idle:"IDLE",active:"ACTIVE"},nL=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],nj="[email protected]:auth:",nq=`${nj}:PUB_KEY`;var nz=Object.defineProperty,nU=Object.defineProperties,nF=Object.getOwnPropertyDescriptors,nB=Object.getOwnPropertySymbols,n$=Object.prototype.hasOwnProperty,nH=Object.prototype.propertyIsEnumerable,nV=(e,t,r)=>t in e?nz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nK=(e,t)=>{for(var r in t||(t={}))n$.call(t,r)&&nV(e,r,t[r]);if(nB)for(var r of nB(t))nH.call(t,r)&&nV(e,r,t[r]);return e},nW=(e,t)=>nU(e,nF(t));class nJ extends eN{constructor(e){super(e),this.name="engine",this.events=new(v()),this.initialized=!1,this.requestQueue={state:nN.idle,queue:[]},this.sessionRequestQueue={state:nN.idle,queue:[]},this.requestQueueDelay=D.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(nR)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,D.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t=nW(nK({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);let{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=t,a=r,c,u=!1;try{a&&(u=this.client.core.pairing.pairings.get(a).active)}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${a}) failed`),e}if(!a||!u){let{topic:e,uri:t}=await this.client.core.pairing.create();a=e,c=t}if(!a){let{message:e}=(0,w.kCb)("NO_MATCHING_KEY",`connect() pairing topic: ${a}`);throw Error(e)}let h=await this.client.core.crypto.generateKeyPair(),l=nR.wc_sessionPropose.req.ttl||D.FIVE_MINUTES,f=(0,w.gn4)(l),d=nK({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:f,pairingTopic:a},s&&{sessionProperties:s}),{reject:p,resolve:g,done:b}=(0,w.H1S)(l,nO);this.events.once((0,w.E0T)("session_connect"),async({error:e,session:t})=>{if(e)p(e);else if(t){t.self.publicKey=h;let e=nW(nK({},t),{pairingTopic:d.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,transportType:rk.relay});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:t.peer.metadata}
15),this.cleanupDuplicatePairings(e),g(e)}});let y=await this.sendRequest({topic:a,method:"wc_sessionPropose",params:d,throwOnFailedPublish:!0});return await this.setProposal(y,nK({id:y},d)),{uri:c,approval:b}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}},this.approve=async e=>{var t,r,i;let n=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[rW.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw n.setError(rJ.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),n.setError(rJ.proposal_not_found),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError(rJ.session_approve_namespace_validation_failure),e}let{id:s,relayProtocol:o,namespaces:a,sessionProperties:c,sessionConfig:u}=e,h=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:n.eventId});let{pairingTopic:l,proposer:f,requiredNamespaces:d,optionalNamespaces:p}=h,g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:l});g||(g=null==(i=this.client.core.eventClient)?void 0:i.createEvent({type:rW.session_approve_started,properties:{topic:l,trace:[rW.session_approve_started,rW.session_namespaces_validation_success]}}));let b=await this.client.core.crypto.generateKeyPair(),y=f.publicKey,m=await this.client.core.crypto.generateSharedKey(b,y),v=nK(nK({relay:{protocol:o??"irn"},namespaces:a,controller:{publicKey:b,metadata:this.client.metadata},expiry:(0,w.gn4)(nT)},c&&{sessionProperties:c}),u&&{sessionConfig:u}),D=rk.relay;g.addTrace(rW.subscribing_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:D})}catch(e){throw g.setError(rJ.subscribe_session_topic_failure),e}g.addTrace(rW.subscribe_session_topic_success);let _=nW(nK({},v),{topic:m,requiredNamespaces:d,optionalNamespaces:p,pairingTopic:l,acknowledged:!1,self:v.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:b,transportType:rk.relay});await this.client.session.set(m,_),g.addTrace(rW.store_session);try{g.addTrace(rW.publishing_session_settle),await this.sendRequest({topic:m,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(rJ.session_settle_publish_failure),e}),g.addTrace(rW.session_settle_publish_success),g.addTrace(rW.publishing_session_approve),await this.sendResult({id:s,topic:l,result:{relay:{protocol:o??"irn"},responderPublicKey:b},throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(rJ.session_approve_publish_failure),e}),g.addTrace(rW.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(m,(0,w.D6H)("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(m),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:l,metadata:f.metadata}),await this.client.proposal.delete(s,(0,w.D6H)("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:l}),await this.setExpiry(m,(0,w.gn4)(nT)),{topic:m,acknowledged:()=>Promise.resolve(this.client.session.get(m))}},this.reject=async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:r,reason:i}=e;try{t=this.client.proposal.get(r).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),e}t&&(await this.sendError({id:r,topic:t,error:i,rpcOpts:nR.wc_sessionPropose.reject}),await this.client.proposal.delete(r,(0,w.D6H)("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:r}=e,{done:i,resolve:n,reject:s}=(0,w.H1S)(),o=re(),a=rt().toString(),c=this.client.session.get(t).namespaces;return this.events.once((0,w.E0T)("session_update",o),({error:e})=>{e?s(e):n()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),s(e)}),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,r=re(),{done:i,resolve:n,reject:s}=(0,w.H1S)();return this.events.once((0,w.E0T)("session_extend",r),({error:e})=>{e?s(e):n()}),await this.setExpiry(t,(0,w.gn4)(nT)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{s(e)}),{acknowledged:i}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:r,topic:i,expiry:n=nR.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(i);s?.transportType===rk.relay&&await this.confirmOnlineStateOrThrow();let o=re(),a=rt().toString(),{done:c,resolve:u,reject:h}=(0,w.H1S)(n,"Request expired. Please try again.");this.events.once((0,w.E0T)("session_request",o),({error:e,result:t})=>{e?h(e):u(t)});let l=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);return l?(await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:nW(nK({},r),{expiryTimestamp:(0,w.gn4)(n)}),chainId:t},expiry:n,throwOnFailedPublish:!0,appLink:l}).catch(e=>h(e)),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:t,id:o}),await c()):await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:nW(nK({},r),{expiryTimestamp:(0,w.gn4)(n)}),chainId:t},expiry:n,throwOnFailedPublish:!0}).catch(e=>h(e)),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:t,id:o}),e()}),new Promise(async e=>{var t;if(!(null!=(t=s.sessionConfig)&&t.disableDeepLink)){let e=await (0,w.bW6)(this.client.core.storage,nP);await (0,w.HhN)({id:o,topic:i,wcDeepLink:e})}e()}),c()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:r}=e,{id:i}=r,n=this.client.session.get(t);n.transportType===rk.relay&&await this.confirmOnlineStateOrThrow();let s=this.getAppLinkIfEnabled(n.peer.metadata,n.transportType);rp(r)?await this.sendResult({id:i,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:s}
15):rg(r)&&await this.sendError({id:i,topic:t,error:r.error,appLink:s}),this.cleanupAfterResponse(e)},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=re(),r=rt().toString(),{done:i,resolve:n,reject:s}=(0,w.H1S)();this.events.once((0,w.E0T)("session_ping",e),({error:e})=>{e?s(e):n()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:r,chainId:i}=e,n=rt().toString();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:(0,w.D6H)("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=(0,w.kCb)("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(0,w.Ih8)(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{var r;let i;this.isInitialized(),this.isValidAuthenticate(e);let n=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),s=n?rk.link_mode:rk.relay;s===rk.relay&&await this.confirmOnlineStateOrThrow();let{chains:o,statement:a="",uri:c,domain:u,nonce:h,type:l,exp:f,nbf:d,methods:p=[],expiry:g}=e,b=[...e.resources||[]],{topic:y,uri:m}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:y,uri:m}});let v=await this.client.core.crypto.generateKeyPair(),D=(0,w.YmJ)(v);if(await Promise.all([this.client.auth.authKeys.set(nq,{responseTopic:D,publicKey:v}),this.client.auth.pairingTopics.set(D,{topic:D,pairingTopic:y})]),await this.client.core.relayer.subscribe(D,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${y}`),p.length>0){let{namespace:e}=(0,w.DQe)(o[0]),t=(0,w.IkP)(e,"request",p);(0,w.hA9)(b)&&(t=(0,w.qJM)(t,b.pop())),b.push(t)}let _=g&&g>nR.wc_sessionAuthenticate.req.ttl?g:nR.wc_sessionAuthenticate.req.ttl,E={authPayload:{type:l??"caip122",chains:o,statement:a,aud:c,domain:u,version:"1",nonce:h,iat:new Date().toISOString(),exp:f,nbf:d,resources:b},requester:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:(0,w.gn4)(_)},S={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:o,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:y,proposer:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:(0,w.gn4)(nR.wc_sessionPropose.req.ttl)},{done:I,resolve:C,reject:A}=(0,w.H1S)(_,"Request expired"),M=async({error:e,session:t})=>{if(this.events.off((0,w.E0T)("session_request",P),x),e)A(e);else if(t){t.self.publicKey=v,await this.client.session.set(t.topic,t),await this.setExpiry(t.topic,t.expiry),y&&await this.client.core.pairing.updateMetadata({topic:y,metadata:t.peer.metadata});let e=this.client.session.get(t.topic);await this.deleteProposal(O),C({session:e})}},x=async e=>{var r,i,n;let o;if(await this.deletePendingAuthRequest(P,{message:"fulfilled",code:0}),e.error){let t=(0,w.D6H)("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off((0,w.E0T)("session_connect"),M),A(e.error.message))}await this.deleteProposal(O),this.events.off((0,w.E0T)("session_connect"),M);let{cacaos:a,responder:c}=e.result,u=[],h=[];for(let e of a){await (0,w.c4l)({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),A((0,w.D6H)("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,r=(0,w.hA9)(t.resources),i=[(0,w.DJo)(t.iss)],n=(0,w.NmC)(t.iss);if(r){let e=(0,w.Y31)(r),t=(0,w.ouN)(r);u.push(...e),i.push(...t)}for(let e of i)h.push(`${e}:${n}`)}let l=await this.client.core.crypto.generateSharedKey(v,c.publicKey);u.length>0&&(o={topic:l,acknowledged:!0,self:{publicKey:v,metadata:this.client.metadata},peer:c,controller:c.publicKey,expiry:(0,w.gn4)(nT),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:y,namespaces:(0,w.E12)([...new Set(u)],[...new Set(h)]),transportType:s},await this.client.core.relayer.subscribe(l,{transportType:s}),await this.client.session.set(l,o),y&&await this.client.core.pairing.updateMetadata({topic:y,metadata:c.metadata}),o=this.client.session.get(l)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(i=c.metadata.redirect)&&i.linkMode&&null!=(n=c.metadata.redirect)&&n.universal&&t&&(this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.session.update(l,{transportType:rk.link_mode})),C({auths:a,session:o})},P=re(),O=re();this.events.once((0,w.E0T)("session_connect"),M),this.events.once((0,w.E0T)("session_request",P),x);try{if(n){let e=rr("wc_sessionAuthenticate",E,P);this.client.core.history.set(y,e);let r=await this.client.core.crypto.encode("",e,{type:w.FpL,encoding:w.zl_});i=(0,w.L9d)(t,y,r)}else await Promise.all([this.sendRequest({topic:y,method:"wc_sessionAuthenticate",params:E,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:P}),this.sendRequest({topic:y,method:"wc_sessionPropose",params:S,expiry:nR.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:O})])}catch(e){throw this.events.off((0,w.E0T)("session_connect"),M),this.events.off((0,w.E0T)("session_request",P),x),e}return await this.setProposal(O,nK({id:O},S)),await this.setAuthRequest(P,{request:nW(nK({},E),{verifyContext:{}}),pairingTopic:y,transportType:s}),{uri:i??m,response:I}},this.approveSessionAuthenticate=async e=>{let t;let{id:r,auths:i}=e,n=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[rG.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw n.setError(rY.no_internet_connection),e}let s=this.getPendingAuthRequest(r);if(!s)throw n.setError(rY.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${r}`);let o=s.transportType||rk.relay;o===rk.relay&&await this.confirmOnlineStateOrThrow();let a=s.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=(0,w.YmJ)(a),h={type:w.rVF,receiverPublicKey:a,senderPublicKey:c},l=[],f=[];for(let e of i){if(!await (0,w.c4l)({cacao:e,projectId:this.client.core.projectId}
15)){n.setError(rY.invalid_cacao);let e=(0,w.D6H)("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:u,error:e,encodeOpts:h}),Error(e.message)}n.addTrace(rG.cacaos_verified);let{p:t}=e,i=(0,w.hA9)(t.resources),s=[(0,w.DJo)(t.iss)],o=(0,w.NmC)(t.iss);if(i){let e=(0,w.Y31)(i),t=(0,w.ouN)(i);l.push(...e),s.push(...t)}for(let e of s)f.push(`${e}:${o}`)}let d=await this.client.core.crypto.generateSharedKey(c,a);if(n.addTrace(rG.create_authenticated_session_topic),l?.length>0){t={topic:d,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:a,metadata:s.requester.metadata},controller:a,expiry:(0,w.gn4)(nT),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:(0,w.E12)([...new Set(l)],[...new Set(f)]),transportType:o},n.addTrace(rG.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(d,{transportType:o})}catch(e){throw n.setError(rY.subscribe_authenticated_session_topic_failure),e}n.addTrace(rG.subscribe_authenticated_session_topic_success),await this.client.session.set(d,t),n.addTrace(rG.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}n.addTrace(rG.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:r,result:{cacaos:i,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,o)})}catch(e){throw n.setError(rY.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:t}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:r}=e,i=this.getPendingAuthRequest(t);if(!i)throw Error(`Could not find pending auth request with id ${t}`);i.transportType===rk.relay&&await this.confirmOnlineStateOrThrow();let n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=(0,w.YmJ)(n),a={type:w.rVF,receiverPublicKey:n,senderPublicKey:s};await this.sendError({id:t,topic:o,error:r,encodeOpts:a,rpcOpts:nR.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(i.requester.metadata,i.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.client.proposal.delete(t,(0,w.D6H)("USER_DISCONNECTED"))},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:r}=e;return(0,w.wvx)(t,r)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{var t;let{topic:r,expirerHasDeleted:i=!1,emitEvent:n=!0,id:s=0}=e,{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,(0,w.D6H)("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),i||this.client.core.expirer.del(r),this.client.core.storage.removeItem(nP).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEac
15h(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,(0,w.D6H)("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=nN.idle),n&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(rJ.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,(0,w.D6H)("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")},this.deletePendingSessionRequest=async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=nN.idle,this.client.events.emit("session_request_expire",{id:e}))},this.deletePendingAuthRequest=async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,(0,w.gn4)(nR.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:r,pairingTopic:i,transportType:n=rk.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:i,verifyContext:r.verifyContext,transportType:n})},this.setPendingSessionRequest=async e=>{let{id:t,topic:r,params:i,verifyContext:n}=e,s=i.request.expiryTimestamp||(0,w.gn4)(nR.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:r,params:i,verifyContext:n})},this.sendRequest=async e=>{let t,i;let{topic:n,method:s,params:o,expiry:a,relayRpcId:c,clientRpcId:u,throwOnFailedPublish:h,appLink:l}=e,f=rr(s,o,u),d=!!l;try{let e=d?w.zl_:w.$dT;t=await this.client.core.crypto.encode(n,f,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),e}if(nL.includes(s)){let e=(0,w.rjm)(JSON.stringify(f)),r=(0,w.rjm)(t);i=await this.client.core.verify.register({id:r,decryptedId:e})}let p=nR[s].req;if(p.attestation=i,a&&(p.ttl=a),c&&(p.id=c),this.client.core.history.set(n,f),d){let e=(0,w.L9d)(l,n,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=nR[s].req;a&&(e.ttl=a),c&&(e.id=c),h?(e.internal=nW(nK({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,t,e)):this.client.core.relayer.publish(n,t,e).catch(e=>this.client.logger.error(e))}return f.id},this.sendResult=async e=>{let t,i;let{id:n,topic:s,result:o,throwOnFailedPublish:a,encodeOpts:c,appLink:u}=e,h=ri(n,o),l=u&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=l?w.zl_:w.$dT;t=await this.client.core.crypto.encode(s,h,nW(nK({},c||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),e}try{i=await this.client.core.history.get(s,n)}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${n}) failed`),e}if(l){let e=(0,w.L9d)(u,s,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=nR[i.request.method].res;a?(e.internal=nW(nK({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,t,e)):this.client.core.relayer.publish(s,t,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(h)},this.sendError=async e=>{let t,i;let{id:n,topic:s,error:o,encodeOpts:a,rpcOpts:c,appLink:u}=e,h=rn(n,o),l=u&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=l?w.zl_:w.$dT;t=await this.client.core.crypto.encode(s,h,nW(nK({},a||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${s} failed`),e}try{i=await this.client.core.history.get(s,n)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${s}, ${n}) failed`),e}if(l){let e=(0,w.L9d)(u,s,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=c||nR[i.request.method].res;this.client.core.relayer.publish(s,t,e)}await this.client.core.history.resolve(h)},this.cleanup=async()=>{let e=[],t=[];
15this.client.session.getAll().forEach(t=>{let r=!1;(0,w.BwD)(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{(0,w.BwD)(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===nN.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=nN.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=nN.idle},this.processRequest=async e=>{let{topic:t,payload:r,attestation:i,transportType:n,encryptedId:s}=e,o=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest
15({topic:t,payload:r,attestation:i,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:i,encryptedId:s,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:i,encryptedId:s,transportType:n});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r,transportType:i}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,i);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:r}=(0,w.kCb)("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:r}=e,i=this.expectedPairingMethodMap.get(t);return!(!i||i.includes(r))&&!!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:r,attestation:i,encryptedId:n}=e,{params:s,id:o}=r;try{let e=this.client.core.eventClient.getEvent({topic:t});this.isValidConnect(nK({},r.params));let a=s.expiryTimestamp||(0,w.gn4)(nR.wc_sessionPropose.req.ttl),c=nK({id:o,pairingTopic:t,expiryTimestamp:a},s);await this.setProposal(o,c);let u=await this.getVerifyContext({attestationId:i,hash:(0,w.rjm)(JSON.stringify(r)),encryptedId:n,metadata:c.proposer.metadata});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(rK.proposal_listener_not_found)),e?.addTrace(rV.emit_session_proposal),this.client.events.emit("session_proposal",{id:o,params:c,verifyContext:u})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:nR.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,r)=>{let{id:i}=t;if(rp(t)){let{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});let s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});let o=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});let a=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});let c=await this.client.core.crypto.generateSharedKey(o,a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:c});let u=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:e})}else if(rg(t)){await this.client.proposal.delete(i,(0,w.D6H)("USER_DISCONNECTED"));let e=(0,w.E0T)("session_connect");if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit((0,w.E0T)("session_connect"),{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:r,params:i}=t;try{this.isValidSessionSettleRequest(i);let{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,sessionConfig:c}=t.params,u=nW(nK(nK({topic:e,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),c&&{sessionConfig:c}
15),{transportType:rk.relay}),h=(0,w.E0T)("session_connect");if(0===this.events.listenerCount(h))throw Error(`emitting ${h} without any listeners 997`);this.events.emit((0,w.E0T)("session_connect"),{session:u}),await this.sendResult({id:t.id,topic:e,result:!0,throwOnFailedPublish:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:r}=t;rp(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit((0,w.E0T)("session_approve",r),{})):rg(t)&&(await this.client.session.delete(e,(0,w.D6H)("USER_DISCONNECTED")),this.events.emit((0,w.E0T)("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:r,id:i}=t;try{let t=`${e}_session_update`,n=w.O6B.get(t);if(n&&this.isRequestOutOfSync(n,i)){this.client.logger.info(`Discarding out of sync request - ${i}`),this.sendError({id:i,topic:e,error:(0,w.D6H)("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(nK({topic:e},r));try{w.O6B.set(t,i),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0})}catch(e){throw w.O6B.delete(t),e}this.client.events.emit("session_update",{id:i,topic:e,params:r})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>parseInt(t.toString().slice(0,-3))<=parseInt(e.toString().slice(0,-3)),this.onSessionUpdateResponse=(e,t)=>{let{id:r}=t,i=(0,w.E0T)("session_update",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);rp(t)?this.events.emit((0,w.E0T)("session_update",r),{}):rg(t)&&this.events.emit((0,w.E0T)("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,(0,w.gn4)(nT)),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:r}=t,i=(0,w.E0T)("session_extend",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);rp(t)?this.events.emit((0,w.E0T)("session_extend",r),{}):rg(t)&&this.events.emit((0,w.E0T)("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:r}=t,i=(0,w.E0T)("session_ping",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);setTimeout(()=>{rp(t)?this.events.emit((0,w.E0T)("session_ping",r),{}):rg(t)&&this.events.emit((0,w.E0T)("session_ping",r),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),Promise.all([new Promise(t=>{this.client.core.relayer.once(rO.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:(0,w.D6H)("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{var t,r,i;let{topic:n,payload:s,attestation:o,encryptedId:a,transportType:c}=e,{id:u,params:h}=s;try{await this.isValidRequest(nK({topic:n},h));let e=this.client.session.get(n),s=await this.getVerifyContext({attestationId:o,hash:(0,w.rjm)(JSON.stringify(rr("wc_sessionRequest",h,u))),encryptedId:a,metadata:e.peer.metadata,transportType:c}),l={id:u,topic:n,params:h,verifyContext:s};await this.setPendingSessionRequest(l),c===rk.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(i=this.client.signConfig)&&i.disableRequestQueue?this.emitSessionRequest(l):(this.addSessionRequestToSessionRequestQueue(l),this.processSessionRequestQueue())}
15catch(e){await this.sendError({id:u,topic:n,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:r}=t,i=(0,w.E0T)("session_request",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);rp(t)?this.events.emit((0,w.E0T)("session_request",r),{result:t.result}):rg(t)&&this.events.emit((0,w.E0T)("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:r,params:i}=t;try{let t=`${e}_session_event_${i.event.name}`,n=w.O6B.get(t);if(n&&this.isRequestOutOfSync(n,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(nK({topic:e},i)),this.client.events.emit("session_event",{id:r,topic:e,params:i}),w.O6B.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),rp(t)?this.events.emit((0,w.E0T)("session_request",r),{result:t.result}):rg(t)&&this.events.emit((0,w.E0T)("session_request",r),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{var t;let{topic:r,payload:i,attestation:n,encryptedId:s,transportType:o}=e;try{let{requester:e,authPayload:a,expiryTimestamp:c}=i.params,u=await this.getVerifyContext({attestationId:n,hash:(0,w.rjm)(JSON.stringify(i)),encryptedId:s,metadata:e.metadata,transportType:o}),h={requester:e,pairingTopic:r,id:i.id,authPayload:a,verifyContext:u,expiryTimestamp:c};await this.setAuthRequest(i.id,{request:h,pairingTopic:r,transportType:o}),o===rk.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:i.params,id:i.id,verifyContext:u})}catch(a){this.client.logger.error(a);let e=i.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),n=this.getAppLinkIfEnabled(i.params.requester.metadata,o),s={type:w.rVF,receiverPublicKey:e,senderPublicKey:t};await this.sendError({id:i.id,topic:r,error:a,encodeOpts:s,rpcOpts:nR.wc_sessionAuthenticate.autoReject,appLink:n})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=nN.idle,this.processSessionRequestQueue()},(0,D.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let r=e.request.id,i=(0,w.E0T)("session_request",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);this.events.emit((0,w.E0T)("session_request",e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===nN.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=nN.active,this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{this.client.events.emit("session_request",e)},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
15t&&this.onSessionProposeRequest({topic:e.topic,payload:rr("wc_sessionPropose",{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties},t.id)})},this.isValidConnect=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=e;if((0,w.o8e)(t)||await this.isValidPairingTopic(t),!(0,w.PMr)(s,!0)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`connect() relays: ${s}`);throw Error(e)}(0,w.o8e)(r)||0===(0,w.L5o)(r)||this.validateNamespaces(r,"requiredNamespaces"),(0,w.o8e)(i)||0===(0,w.L5o)(i)||this.validateNamespaces(i,"optionalNamespaces"),(0,w.o8e)(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(e,t)=>{let r=(0,w.naP)(e,"connect()",t);if(r)throw Error(r.message)},this.isValidApprove=async e=>{if(!(0,w.EJd)(e))throw Error((0,w.kCb)("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:i,sessionProperties:n}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let s=this.client.proposal.get(t),o=(0,w.ing)(r,"approve()");if(o)throw Error(o.message);let a=(0,w.rFo)(s.requiredNamespaces,r,"approve()");if(a)throw Error(a.message);if(!(0,w.M_r)(i,!0)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw Error(e)}(0,w.o8e)(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!(0,w.H4H)(r)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}
15let{relay:t,controller:r,namespaces:i,expiry:n}=e;if(!(0,w.Z26)(t)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let s=(0,w.DdM)(r,"onSessionSettleRequest()");if(s)throw Error(s.message);let o=(0,w.ing)(i,"onSessionSettleRequest()");if(o)throw Error(o.message);if((0,w.BwD)(n)){let{message:e}=(0,w.kCb)("EXPIRED","onSessionSettleRequest()");throw Error(e)}},this.isValidUpdate=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let i=this.client.session.get(t),n=(0,w.ing)(r,"update()");if(n)throw Error(n.message);let s=(0,w.rFo)(i.requiredNamespaces,r,"update()");if(s)throw Error(s.message)},this.isValidExtend=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:t,request:r,chainId:i,expiry:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:s}=this.client.session.get(t);if(!(0,w.p8o)(s,i)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`request() chainId: ${i}`);throw Error(e)}if(!(0,w.hHR)(r)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw Error(e)}if(!(0,w.alS)(s,i,r.method)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`request() method: ${r.method}`);throw Error(e)}if(n&&!(0,w.ONw)(n,nk)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${nk.min} and ${nk.max}`);throw Error(e)}},this.isValidRespond=async e=>{var t;if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:i}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!(0,w.JTI)(i)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw Error(e)}},this.isValidPing=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:t,event:r,chainId:i}=e;await this.isValidSessionTopic(t);let{namespaces:n}=this.client.session.get(t);if(!(0,w.p8o)(n,i)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw Error(e)}if(!(0,w.nfW)(r)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}if(!(0,w.B95)(n,i,r.name)){let{message:e}=(0,w.kCb)("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!(0,w.EJd)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:r,domain:i,nonce:n}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!(0,w.M_r)(r,!1))throw Error("uri is required parameter");if(!(0,w.M_r)(i,!1))throw Error("domain is required parameter");if(!(0,w.M_r)(n,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>(0,w.DQe)(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:s}=(0,w.DQe)(t[0]);if("eip155"!==s)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async e=>{let{attestationId:t,hash:r,encryptedId:i,metadata:n,transportType:s}=e,o={verified:{verifyUrl:n.verifyUrl||rB,validation:"UNKNOWN",origin:n.url||""}};try{if(s===rk.link_mode){let e=this.getAppLinkIfEnabled(n,s);return o.verified.validation=e&&new URL(e).origin===new URL(n.url).origin?"VALID":"INVALID",o}let e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:i,verifyUrl:n.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>
15{Object.values(e).forEach(e=>{if(!(0,w.M_r)(e,!1)){let{message:r}=(0,w.kCb)("MISSING_OR_INVALID",`${t} must be in Record<string, string> format. Received: ${JSON.stringify(e)}`);throw Error(r)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:r}=(0,w.kCb)("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(r)}},this.isLinkModeEnabled=(e,t)=>{var i,n,s,o,a,c,u,h,l;return!!e&&t===rk.link_mode&&(null==(n=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:n.linkMode)===!0&&(null==(o=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:o.universal)!==void 0&&(null==(c=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:c.universal)!==""&&(null==(u=e?.redirect)?void 0:u.universal)!==void 0&&(null==(h=e?.redirect)?void 0:h.universal)!==""&&(null==(l=e?.redirect)?void 0:l.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==r.g?void 0:r.g.Linking)},this.getAppLinkIfEnabled=(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0},this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=(0,w.waw)(e,"topic")||"",r=decodeURIComponent((0,w.waw)(e,"wc_ev")||""),i=this.client.session.keys.includes(t);i&&this.client.session.update(t,{transportType:rk.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:i})},this.registerLinkModeListeners=async()=>{var e;if((0,w.h9F)()||(0,w.b$m)()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==r.g?void 0:r.g.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}}isInitialized(){if(!this.initialized){let{message:e}=(0,w.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(rO.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){let{topic:t,message:r,attestation:i,transportType:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(nq)?this.client.auth.authKeys.get(nq):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(t,r,{receiverPublicKey:s,encoding:n===rk.link_mode?w.zl_:w.$dT});try{rf(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o,attestation:i,transportType:n,encryptedId:(0,w.rjm)(r)})):rd(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o,transportType:n}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o,transportType:n})}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(rF.expired,async e=>{let{topic:t,id:r}=(0,w.iPz)(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,(0,w.kCb)("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,(0,w.kCb)("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(rz.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(rz.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!(0,w.M_r)(e,!1)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if((0,w.BwD)(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=(0,w.kCb)("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!(0,w.M_r)(e,!1)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if((0,w.BwD)(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=(0,w.kCb)("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if((0,w.M_r)(e,!1)){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!(0,w.Q01)(e)){let{message:t}=(0,w.kCb)("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=(0,w.kCb)("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if((0,w.BwD)(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=(0,w.kCb)("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class nG extends ni{constructor(e,t){super(e,t,"proposal",nM),this.core=e,this.logger=t}}class nY extends ni{constructor(e,t){super(e,t,"session",nM),this.core=e,this.logger=t}}class nQ extends ni{constructor(e,t){super(e,t,"request",nM,e=>e.id),this.core=e,this.logger=t}}class nX extends ni{constructor(e,t){super(e,t,"authKeys",nj,()=>nq),this.core=e,this.logger=t}}class nZ extends ni{constructor(e,t){super(e,t,"pairingTopics",nj),this.core=e,this.logger=t}}class n0 extends ni{constructor(e,t){super(e,t,"requests",nj,e=>e.id),this.core=e,this.logger=t}}class n1{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new nX(this.core,this.logger),this.pairingTopics=new nZ(this.core,this.logger),this.requests=new n0(this.core,this.logger)}
15async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class n3 extends ek{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=nx.name,this.events=new m.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||nx.name,this.metadata=e?.metadata||(0,w.DaH)(),this.signConfig=e?.signConfig;let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:ei()(ew({level:e?.logger||nx.logger}));this.core=e?.core||new nC(e),this.logger=e_(t,this.name),this.session=new nY(this.core,this.logger),this.proposal=new nG(this.core,this.logger),this.pendingRequest=new nQ(this.core,this.logger),this.engine=new nJ(this),this.auth=new n1(this.core,this.logger)}static async init(e){let t=new n3(e);return await t.initialize(),t}get context(){return eD(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var n2=r(5108),n8=r.n(n2),n6=Object.defineProperty,n5=Object.defineProperties,n4=Object.getOwnPropertyDescriptors,n9=Object.getOwnPropertySymbols,n7=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,st=(e,t,r)=>t in e?n6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sr=(e,t)=>{for(var r in t||(t={}))n7.call(t,r)&&st(e,r,t[r]);if(n9)for(var r of n9(t))se.call(t,r)&&st(e,r,t[r]);return e},si=(e,t)=>n5(e,n4(t));let sn={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class ss{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new m.EventEmitter,this.isAvailable=!1,this.registering=!1,!ru(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}
15get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=(0,K.u)(e),r=await (await n8()(this.url,si(sr({},sn),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!ru(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=(0,K.u)({id:1,jsonrpc:"2.0",method:"test",params:[]});await n8()(e,si(sr({},sn),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,K.D)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),i=rn(e,r.message||r.toString());this.events.emit("payload",i)}parseError(e,t=this.url){return t9(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}let so="error",sa="wc@2:universal_provider:",sc="https://rpc.walletconnect.org/v1/",su="generic",sh=`${sc}bundler`,sl="default_chain_changed";var sf="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},sd={exports:{}};!function(e,t){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",s="__lodash_placeholder__",o=1/0,a=0/0,c=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",h="[object Array]",l="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",g="[object GeneratorFunction]",b="[object Map]",y="[object Number]",m="[object Object]",v="[object Promise]",w="[object RegExp]",D="[object Set]",_="[object String]",E="[object Symbol]",S="[object WeakMap]",I="[object ArrayBuffer]",C="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",x="[object Int8Array]",P="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",k="[object Uint16Array]",N="[object Uint32Array]",L=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,F=RegExp(z.source),B=RegExp(U.source),$=/<%-([\s\S]+?)%>/g,H=/<%([\s\S]+?)%>/g,V=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(G.source),Q=/^\s+/,X=/\s/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ee=/\{\n\/\* \[wrapped with (.+)\] \*/,et=/,? & /,er=
15/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ei=/[()=,{}\[\]\/\s]/,en=/\\(\\)?/g,es=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eo=/\w*$/,ea=/^[-+]0x[0-9a-f]+$/i,ec=/^0b[01]+$/i,eu=/^\[object .+?Constructor\]$/,eh=/^0o[0-7]+$/i,el=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ed=/($^)/,ep=/['\n\r\u2028\u2029\\]/g,eg="\ud800-\udfff",eb="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ey="\\u2700-\\u27bf",em="a-z\\xdf-\\xf6\\xf8-\\xff",ev="A-Z\\xc0-\\xd6\\xd8-\\xde",ew="\\ufe0e\\ufe0f",eD="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",e_="['’]",eE="["+eD+"]",eS="["+eb+"]",eI="["+em+"]",eC="[^"+eg+eD+"\\d+"+ey+em+ev+"]",eA="\ud83c[\udffb-\udfff]",eM="[^"+eg+"]",ex="(?:\ud83c[\udde6-\uddff]){2}",eP="[\ud800-\udbff][\udc00-\udfff]",eO="["+ev+"]",eT="\\u200d",eR="(?:"+eI+"|"+eC+")",ek="(?:"+e_+"(?:d|ll|m|re|s|t|ve))?",eN="(?:"+e_+"(?:D|LL|M|RE|S|T|VE))?",eL="(?:"+eS+"|"+eA+")?",ej="["+ew+"]?",eq="(?:"+eT+"(?:"+[eM,ex,eP].join("|")+")"+ej+eL+")*",ez=ej+eL+eq,eU="(?:"+["["+ey+"]",ex,eP].join("|")+")"+ez,eF="(?:"+[eM+eS+"?",eS,ex,eP,"["+eg+"]"].join("|")+")",eB=RegExp(e_,"g"),e$=RegExp(eS,"g"),eH=RegExp(eA+"(?="+eA+")|"+eF+ez,"g"),eV=RegExp([eO+"?"+eI+"+"+ek+"(?="+[eE,eO,"$"].join("|")+")","(?:"+eO+"|"+eC+")+"+eN+"(?="+[eE,eO+eR,"$"].join("|")+")",eO+"?"+eR+"+"+ek,eO+"+"+eN,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",eU].join("|"),"g"),eK=RegExp("["+eT+eg+eb+ew+"]"),eW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eJ=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eG=-1,eY={};eY[A]=eY[M]=eY[x]=eY[P]=eY[O]=eY[T]=eY[R]=eY[k]=eY[N]=!0,eY[u]=eY[h]=eY[I]=eY[l]=eY[C]=eY[f]=eY[d]=eY[p]=eY[b]=eY[y]=eY[m]=eY[w]=eY[D]=eY[_]=eY[S]=!1;var eQ={};eQ[u]=eQ[h]=eQ[I]=eQ[C]=eQ[l]=eQ[f]=eQ[A]=eQ[M]=eQ[x]=eQ[P]=eQ[O]=eQ[b]=eQ[y]=eQ[m]=eQ[w]=eQ[D]=eQ[_]=eQ[E]=eQ[T]=eQ[R]=eQ[k]=eQ[N]=!0,eQ[d]=eQ[p]=eQ[S]=!1;var eX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eZ=parseFloat,e0=parseInt,e1="object"==typeof sf&&sf&&sf.Object===Object&&sf,e3="object"==typeof self&&self&&self.Object===Object&&self,e2=e1||e3||Function("return this")(),e8=t&&!t.nodeType&&t,e6=e8&&e&&!e.nodeType&&e,e5=e6&&e6.exports===e8,e4=e5&&e1.process,e9=function(){try{return e6&&e6.require&&e6.require("util").types||e4&&e4.binding&&e4.binding("util")}catch{}}(),e7=e9&&e9.isArrayBuffer,te=e9&&e9.isDate,tt=e9&&e9.isMap,tr=e9&&e9.isRegExp,ti=e9&&e9.isSet,tn=e9&&e9.isTypedArray;function ts(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function to(e,t,r,i){for(var n=-1,s=null==e?0:e.length;++n<s;){var o=e[n];t(i,o,r(o),e)}return i}function ta(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}function tc(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}function tu(e,t){for(var r=-1,i=null==e?0:e.length,n=0,s=[];++r<i;){var o=e[r];t(o,r,e)&&(s[n++]=o)}return s}function th(e,t){return!!(null==e?0:e.length)&&tw(e,t,0)>-1}function tl(e,t,r){for(var i=-1,n=null==e?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}function tf(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function td(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function tp(e,t,r,i){var n=-1,s=null==e?0:e.length;for(i&&s&&(r=e[++n]);++n<s;)r=t(r,e[n],n,e);return r}function tg(e,t,r,i){var n=null==e?0:e.length;for(i&&n&&(r=e[--n]);n--;)r=t(r,e[n],n,e);return r}function tb(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var ty=tS("length");function tm(e,t,r){var i;return r(e,function(e,r,n){if(t(e,r,n))return i=r,!1}),i}
vendor: 6,319 bytes, line 15
15function tv(e,t,r,i){for(var n=e.length,s=r+(i?1:-1);i?s--:++s<n;)if(t(e[s],s,e))return s;return -1}function tw(e,t,r){return t==t?function(e,t,r){for(var i=r-1,n=e.length;++i<n;)if(e[i]===t)return i;return -1}(e,t,r):tv(e,t_,r)}function tD(e,t,r,i){for(var n=r-1,s=e.length;++n<s;)if(i(e[n],t))return n;return -1}function t_(e){return e!=e}function tE(e,t){var r=null==e?0:e.length;return r?tA(e,t)/r:a}function tS(e){return function(t){return null==t?r:t[e]}}function tI(e){return function(t){return null==e?r:e[t]}}function tC(e,t,r,i,n){return n(e,function(e,n,s){r=i?(i=!1,e):t(r,e,n,s)}),r}function tA(e,t){for(var i,n=-1,s=e.length;++n<s;){var o=t(e[n]);o!==r&&(i=i===r?o:i+o)}return i}function tM(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function tx(e){return e&&e.slice(0,tV(e)+1).replace(Q,"")}function tP(e){return function(t){return e(t)}}function tO(e,t){return tf(t,function(t){return e[t]})}function tT(e,t){return e.has(t)}function tR(e,t){for(var r=-1,i=e.length;++r<i&&tw(t,e[r],0)>-1;);return r}function tk(e,t){for(var r=e.length;r--&&tw(t,e[r],0)>-1;);return r}var tN=tI({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tL=tI({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tj(e){return"\\"+eX[e]}function tq(e){return eK.test(e)}function tz(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function tU(e,t){return function(r){return e(t(r))}}function tF(e,t){for(var r=-1,i=e.length,n=0,o=[];++r<i;){var a=e[r];(a===t||a===s)&&(e[r]=s,o[n++]=r)}return o}function tB(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function t$(e){return tq(e)?function(e){for(var t=eH.lastIndex=0;eH.test(e);)++t;return t}(e):ty(e)}function tH(e){return tq(e)?e.match(eH)||[]:e.split("")}function tV(e){for(var t=e.length;t--&&X.test(e.charAt(t)););return t}var tK=tI({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tW=function e(t){var X,eg,eb,ey,em=(t=null==t?e2:tW.defaults(e2.Object(),t,tW.pick(e2,eJ))).Array,ev=t.Date,ew=t.Error,eD=t.Function,e_=t.Math,eE=t.Object,eS=t.RegExp,eI=t.String,eC=t.TypeError,eA=em.prototype,eM=eD.prototype,ex=eE.prototype,eP=t["__core-js_shared__"],eO=eM.toString,eT=ex.hasOwnProperty,eR=0,ek=(X=/[^.]+$/.exec(eP&&eP.keys&&eP.keys.IE_PROTO||""))?"Symbol(src)_1."+X:"",eN=ex.toString,eL=eO.call(eE),ej=e2._,eq=eS("^"+eO.call(eT).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ez=e5?t.Buffer:r,eU=t.Symbol,eF=t.Uint8Array,eH=ez?ez.allocUnsafe:r,eK=tU(eE.getPrototypeOf,eE),eX=eE.create,e1=ex.propertyIsEnumerable,e3=eA.splice,e8=eU?eU.isConcatSpreadable:r,e6=eU?eU.iterator:r,e4=eU?eU.toStringTag:r,e9=function(){try{var e=np(eE,"defineProperty");return e({},"",{}),e}catch{}}(),ty=t.clearTimeout!==e2.clearTimeout&&t.clearTimeout,tI=ev&&ev.now!==e2.Date.now&&ev.now,tJ=t.setTimeout!==e2.setTimeout&&t.setTimeout,tG=e_.ceil,tY=e_.floor,tQ=eE.getOwnPropertySymbols,tX=ez?ez.isBuffer:r,tZ=t.isFinite,t0=eA.join,t1=tU(eE.keys,eE),t3=e_.max,t2=e_.min,t8=ev.now,t6=t.parseInt,t5=e_.random,t4=eA.reverse,t9=np(t,"DataView"),t7=np(t,"Map"),re=np(t,"Promise"),rt=np(t,"Set"),rr=np(t,"WeakMap"),ri=np(eE,"create"),rn=rr&&new rr,rs={},ro=nz(t9),ra=nz(t7),rc=nz(re),ru=nz(rt),rh=nz(rr),rl=eU?eU.prototype:r,rf=rl?rl.valueOf:r,rd=rl?rl.toString:r;function rp(e){if(sK(e)&&!sN(e)&&!(e instanceof rm)){if(e instanceof ry)return e;if(eT.call(e,"__wrapped__"))return nU(e)}return new ry(e)}var rg=function(){function e(){}return function(t){if(!sV(t))return{};if(eX)return eX(t);e.prototype=t;var i=new e;return e.prototype=r,i}}();function rb(){}function ry(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function rm(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function rv(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function rw(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function rD(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function r_(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new rD;++t<r;)this.add(e[t])}function rE(e){var t=this.__data__=new rw(e);this.size=t.size}function rS(e,t){var r=sN(e),i=!r&&sk(e),n=!r&&!i&&sz(e),s=!r&&!i&&!n&&s0(e),o=r||i||n||s,a=o?tM(e.length,eI):[],c=a.length;for(var u in e)(t||eT.call(e,u))&&!(o&&("length"==u||n&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||nD(u,c)))&&a.push(u);return a}function rI(e){var t=e.length;return t?e[ih(0,t-1)]:r}function rC(e,t,i){(i===r||sO(e[t],i))&&(i!==r||t in e)||rO(e,t,i)}function rA(e,t,i){var n=e[t];eT.call(e,t)&&sO(n,i)&&(i!==r||t in e)||rO(e,t,i)}function rM(e,t){for(var r=e.length;r--;)if(sO(e[r][0],t))return r;return -1}function rx(e,t,r,i){return rq(e,function(e,n,s){t(i,e,r(e),s)}),i}function rP(e,t){return e&&i$(t,of(t),e)}
15function rO(e,t,r){"__proto__"==t&&e9?e9(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function rT(e,t){for(var i=-1,n=t.length,s=em(n),o=null==e;++i<n;)s[i]=o?r:oa(e,t[i]);return s}function rR(e,t,i){return e==e&&(i!==r&&(e=e<=i?e:i),t!==r&&(e=e>=t?e:t)),e}function rk(e,t,i,n,s,o){var a,c=1&t,h=2&t,d=4&t;if(i&&(a=s?i(e,n,s,o):i(e)),a!==r)return a;if(!sV(e))return e;var v=sN(e);if(v){if(S=e.length,L=new e.constructor(S),S&&"string"==typeof e[0]&&eT.call(e,"index")&&(L.index=e.index,L.input=e.input),a=L,!c)return iB(e,a)}else{var S,L,j,q,z,U=ny(e),F=U==p||U==g;if(sz(e))return iL(e,c);if(U==m||U==u||F&&!s){if(a=h||F?{}:nv(e),!c)return h?(j=(z=a)&&i$(e,od(e),z),i$(e,nb(e),j)):(q=rP(a,e),i$(e,ng(e),q))}else{if(!eQ[U])return s?e:{};a=function(e,t,r){var i,n,s=e.constructor;switch(t){case I:return ij(e);case l:case f:return new s(+e);case C:return i=r?ij(e.buffer):e.buffer,new e.constructor(i,e.byteOffset,e.byteLength);case A:case M:case x:case P:case O:case T:case R:case k:case N:return iq(e,r);case b:return new s;case y:case _:return new s(e);case w:return(n=new e.constructor(e.source,eo.exec(e))).lastIndex=e.lastIndex,n;case D:return new s;case E:return rf?eE(rf.call(e)):{}}}(e,U,c)}}o||(o=new rE);var B=o.get(e);if(B)return B;o.set(e,a),sQ(e)?e.forEach(function(r){a.add(rk(r,t,i,r,e,o))}):sW(e)&&e.forEach(function(r,n){a.set(n,rk(r,t,i,n,e,o))});var $=d?h?na:no:h?od:of,H=v?r:$(e);return ta(H||e,function(r,n){H&&(r=e[n=r]),rA(a,n,rk(r,t,i,n,e,o))}),a}function rN(e,t,i){var n=i.length;if(null==e)return!n;for(e=eE(e);n--;){var s=i[n],o=t[s],a=e[s];if(a===r&&!(s in e)||!o(a))return!1}return!0}function rL(e,t,n){if("function"!=typeof e)throw new eC(i);return nT(function(){e.apply(r,n)},t)}function rj(e,t,r,i){var n=-1,s=th,o=!0,a=e.length,c=[],u=t.length;if(!a)return c;r&&(t=tf(t,tP(r))),i?(s=tl,o=!1):t.length>=200&&(s=tT,o=!1,t=new r_(t));e:for(;++n<a;){var h=e[n],l=null==r?h:r(h);if(h=i||0!==h?h:0,o&&l==l){for(var f=u;f--;)if(t[f]===l)continue e;c.push(h)}else s(t,l,i)||c.push(h)}return c}rp.templateSettings={escape:$,evaluate:H,interpolate:V,variable:"",imports:{_:rp}},rp.prototype=rb.prototype,rp.prototype.constructor=rp,ry.prototype=rg(rb.prototype),ry.prototype.constructor=ry,rm.prototype=rg(rb.prototype),rm.prototype.constructor=rm,rv.prototype.clear=function(){this.__data__=ri?ri(null):{},this.size=0},rv.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rv.prototype.get=function(e){var t=this.__data__;if(ri){var i=t[e];return i===n?r:i}return eT.call(t,e)?t[e]:r},rv.prototype.has=function(e){var t=this.__data__;return ri?t[e]!==r:eT.call(t,e)},rv.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=ri&&t===r?n:t,this},rw.prototype.clear=function(){this.__data__=[],this.size=0},rw.prototype.delete=function(e){var t=this.__data__,r=rM(t,e);return!(r<0)&&(r==t.length-1?t.pop():e3.call(t,r,1),--this.size,!0)},rw.prototype.get=function(e){var t=this.__data__,i=rM(t,e);return i<0?r:t[i][1]},rw.prototype.has=function(e){return rM(this.__data__,e)>-1},rw.prototype.set=function(e,t){var r=this.__data__,i=rM(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},rD.prototype.clear=function(){this.size=0,this.__data__={hash:new rv,map:new(t7||rw),string:new rv}},rD.prototype.delete=function(e){var t=nf(this,e).delete(e);return this.size-=t?1:0,t},rD.prototype.get=function(e){return nf(this,e).get(e)},rD.prototype.has=function(e){return nf(this,e).has(e)},rD.prototype.set=function(e,t){var r=nf(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},r_.prototype.add=r_.prototype.push=function(e){return this.__data__.set(e,n),this},r_.prototype.has=function(e){return this.__data__.has(e)},rE.prototype.clear=function(){this.__data__=new rw,this.size=0},rE.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},rE.prototype.get=function(e){return this.__data__.get(e)},rE.prototype.has=function(e){return this.__data__.has(e)},rE.prototype.set=function(e,t){var r=this.__data__;if(r instanceof rw){var i=r.__data__;if(!t7||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new rD(i)}return r.set(e,t),this.size=r.size,this};var rq=iK(rK),rz=iK(rW,!0);function rU(e,t){var r=!0;return rq(e,function(e,i,n){return r=!!t(e,i,n)}),r}function rF(e,t,i){for(var n=-1,s=e.length;++n<s;){var o=e[n],a=t(o);if(null!=a&&(c===r?a==a&&!sZ(a):i(a,c)))var c=a,u=o}return u}function rB(e,t){var r=[];return rq(e,function(e,i,n){t(e,i,n)&&r.push(e)}),r}function r$(e,t,r,i,n){var s=-1,o=e.length;for(r||(r=nw),n||(n=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?r$(a,t-1,r,i,n):td(n,a):i||(n[n.length]=a)}return n}var rH=iW(),rV=iW(!0);function rK(e,t){return e&&rH(e,t,of)}function rW(e,t){return e&&rV(e,t,of)}function rJ(e,t){return tu(t,function(t){return sB(e[t])})}function rG(e,t){t=iR(t,e);for(var i=0,n=t.length;null!=e&&i<n;)e=e[nq(t[i++])];return i&&i==n?e:r}function rY(e,t,r){var i=t(e);return sN(e)?i:td(i,r(e))}
15function rQ(e){return null==e?e===r?"[object Undefined]":"[object Null]":e4&&e4 in eE(e)?function(e){var t=eT.call(e,e4),i=e[e4];try{e[e4]=r;var n=!0}catch{}var s=eN.call(e);return n&&(t?e[e4]=i:delete e[e4]),s}(e):eN.call(e)}function rX(e,t){return e>t}function rZ(e,t){return null!=e&&eT.call(e,t)}function r0(e,t){return null!=e&&t in eE(e)}function r1(e,t,i){for(var n=i?tl:th,s=e[0].length,o=e.length,a=o,c=em(o),u=1/0,h=[];a--;){var l=e[a];a&&t&&(l=tf(l,tP(t))),u=t2(l.length,u),c[a]=!i&&(t||s>=120&&l.length>=120)?new r_(a&&l):r}l=e[0];var f=-1,d=c[0];e:for(;++f<s&&h.length<u;){var p=l[f],g=t?t(p):p;if(p=i||0!==p?p:0,!(d?tT(d,g):n(h,g,i))){for(a=o;--a;){var b=c[a];if(!(b?tT(b,g):n(e[a],g,i)))continue e}d&&d.push(g),h.push(p)}}return h}function r3(e,t,i){t=iR(t,e);var n=null==(e=nx(e,t))?e:e[nq(nQ(t))];return null==n?r:ts(n,e,i)}function r2(e){return sK(e)&&rQ(e)==u}function r8(e,t,i,n,s){return e===t||(null!=e&&null!=t&&(sK(e)||sK(t))?function(e,t,i,n,s,o){var a=sN(e),c=sN(t),p=a?h:ny(e),g=c?h:ny(t);p=p==u?m:p,g=g==u?m:g;var v=p==m,S=g==m,A=p==g;if(A&&sz(e)){if(!sz(t))return!1;a=!0,v=!1}if(A&&!v)return o||(o=new rE),a||s0(e)?nn(e,t,i,n,s,o):function(e,t,r,i,n,s,o){switch(r){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case I:return!(e.byteLength!=t.byteLength||!s(new eF(e),new eF(t)));case l:case f:case y:return sO(+e,+t);case d:return e.name==t.name&&e.message==t.message;case w:case _:return e==t+"";case b:var a=tz;case D:var c=1&i;if(a||(a=tB),e.size!=t.size&&!c)break;var u=o.get(e);if(u)return u==t;i|=2,o.set(e,t);var h=nn(a(e),a(t),i,n,s,o);return o.delete(e),h;case E:if(rf)return rf.call(e)==rf.call(t)}return!1}(e,t,p,i,n,s,o);if(!(1&i)){var M=v&&eT.call(e,"__wrapped__"),x=S&&eT.call(t,"__wrapped__");
vendor: 5,438 bytes, line 15
15if(M||x){var P=M?e.value():e,O=x?t.value():t;return o||(o=new rE),s(P,O,i,n,o)}}return!!A&&(o||(o=new rE),function(e,t,i,n,s,o){var a=1&i,c=no(e),u=c.length;if(u!=no(t).length&&!a)return!1;for(var h=u;h--;){var l=c[h];if(!(a?l in t:eT.call(t,l)))return!1}var f=o.get(e),d=o.get(t);if(f&&d)return f==t&&d==e;var p=!0;o.set(e,t),o.set(t,e);for(var g=a;++h<u;){var b=e[l=c[h]],y=t[l];if(n)var m=a?n(y,b,l,t,e,o):n(b,y,l,e,t,o);if(!(m===r?b===y||s(b,y,i,n,o):m)){p=!1;break}g||(g="constructor"==l)}if(p&&!g){var v=e.constructor,w=t.constructor;v!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof w&&w instanceof w)&&(p=!1)}return o.delete(e),o.delete(t),p}(e,t,i,n,s,o))}(e,t,i,n,r8,s):e!=e&&t!=t)}function r6(e,t,i,n){var s=i.length,o=s,a=!n;if(null==e)return!o;for(e=eE(e);s--;){var c=i[s];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s<o;){var u=(c=i[s])[0],h=e[u],l=c[1];if(a&&c[2]){if(h===r&&!(u in e))return!1}else{var f=new rE;if(n)var d=n(h,l,u,e,t,f);if(!(d===r?r8(l,h,3,n,f):d))return!1}}return!0}function r5(e){return!(!sV(e)||ek&&ek in e)&&(sB(e)?eq:eu).test(nz(e))}function r4(e){return"function"==typeof e?e:null==e?oq:"object"==typeof e?sN(e)?ir(e[0],e[1]):it(e):oW(e)}function r9(e){if(!nC(e))return t1(e);var t=[];for(var r in eE(e))eT.call(e,r)&&"constructor"!=r&&t.push(r);return t}function r7(e,t){return e<t}function ie(e,t){var r=-1,i=sj(e)?em(e.length):[];return rq(e,function(e,n,s){i[++r]=t(e,n,s)}),i}function it(e){var t=nd(e);return 1==t.length&&t[0][2]?nA(t[0][0],t[0][1]):function(r){return r===e||r6(r,e,t)}}function ir(e,t){var i;return nE(e)&&(i=t)==i&&!sV(i)?nA(nq(e),t):function(i){var n=oa(i,e);return n===r&&n===t?oc(i,e):r8(t,n,3)}}function ii(e,t,i,n,s){e!==t&&rH(t,function(o,a){if(s||(s=new rE),sV(o))!function(e,t,i,n,s,o,a){var c=nP(e,i),u=nP(t,i),h=a.get(u);if(h){rC(e,i,h);return}var l=o?o(c,u,i+"",e,t,a):r,f=l===r;if(f){var d=sN(u),p=!d&&sz(u),g=!d&&!p&&s0(u);l=u,d||p||g?sN(c)?l=c:sq(c)?l=iB(c):p?(f=!1,l=iL(u,!0)):g?(f=!1,l=iq(u,!0)):l=[]:sG(u)||sk(u)?(l=c,sk(c)?l=s9(c):(!sV(c)||sB(c))&&(l=nv(u))):f=!1}f&&(a.set(u,l),s(l,u,n,o,a),a.delete(u)),rC(e,i,l)}(e,t,a,i,ii,n,s);else{var c=n?n(nP(e,a),o,a+"",e,t,s):r;c===r&&(c=o),rC(e,a,c)}},od)}function is(e,t){var i=e.length;if(i)return nD(t+=t<0?i:0,i)?e[t]:r}function io(e,t,r){t=t.length?tf(t,function(e){return sN(e)?function(t){return rG(t,1===e.length?e[0]:e)}:e}):[oq];var i=-1;return t=tf(t,tP(nl())),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(ie(e,function(e,r,n){return{criteria:tf(t,function(t){return t(e)}),index:++i,value:e}}),function(e,t){return function(e,t,r){for(var i=-1,n=e.criteria,s=t.criteria,o=n.length,a=r.length;++i<o;){var c=iz(n[i],s[i]);if(c){if(i>=a)return c;return c*("desc"==r[i]?-1:1)}}return e.index-t.index}(e,t,r)})}function ia(e,t,r){for(var i=-1,n=t.length,s={};++i<n;){var o=t[i],a=rG(e,o);r(a,o)&&ip(s,iR(o,e),a)}return s}function ic(e,t,r,i){var n=i?tD:tw,s=-1,o=t.length,a=e;for(e===t&&(t=iB(t)),r&&(a=tf(e,tP(r)));++s<o;)for(var c=0,u=t[s],h=r?r(u):u;(c=n(a,h,c,i))>-1;)a!==e&&e3.call(a,c,1),e3.call(e,c,1);return e}function iu(e,t){for(var r=e?t.length:0,i=r-1;r--;){var n=t[r];if(r==i||n!==s){var s=n;nD(n)?e3.call(e,n,1):iI(e,n)}}return e}function ih(e,t){return e+tY(t5()*(t-e+1))}function il(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do t%2&&(r+=e),(t=tY(t/2))&&(e+=e);while(t);return r}function id(e,t){return nR(nM(e,t,oq),e+"")}function ip(e,t,i,n){if(!sV(e))return e;t=iR(t,e);for(var s=-1,o=t.length,a=o-1,c=e;null!=c&&++s<o;){var u=nq(t[s]),h=i;if("__proto__"===u||"constructor"===u||"prototype"===u)break;if(s!=a){var l=c[u];(h=n?n(l,u,c):r)===r&&(h=sV(l)?l:nD(t[s+1])?[]:{})}rA(c,u,h),c=c[u]}return e}var ig=rn?function(e,t){return rn.set(e,t),e}:oq,ib=e9?function(e,t){return e9(e,"toString",{configurable:!0,enumerable:!1,value:oN(t),writable:!0})}:oq;function iy(e,t,r){var i=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(r=r>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var s=em(n);++i<n;)s[i]=e[i+t];return s}function im(e,t){var r;return rq(e,function(e,i,n){return!(r=t(e,i,n))}),!!r}function iv(e,t,r){var i=0,n=null==e?i:e.length;if("number"==typeof t&&t==t&&n<=2147483647){for(;i<n;){var s=i+n>>>1,o=e[s];null!==o&&!sZ(o)&&(r?o<=t:o<t)?i=s+1:n=s}return n}return iw(e,t,oq,r)}function iw(e,t,i,n){var s=0,o=null==e?0:e.length;if(0===o)return 0;t=i(t);for(var a=t!=t,c=null===t,u=sZ(t),h=t===r;s<o;){var l=tY((s+o)/2),f=i(e[l]),d=f!==r,p=null===f,g=f==f,b=sZ(f);if(a)var y=n||g;else y=h?g&&(n||d):c?g&&d&&(n||!p):u?g&&d&&!p&&(n||!b):!p&&!b&&(n?f<=t:f<t);y?s=l+1:o=l}return t2(o,4294967294)}function iD(e,t){for(var r=-1,i=e.length,n=0,s=[];++r<i;){var o=e[r],a=t?t(o):o;if(!r||!sO(a,c)){var c=a;s[n++]=0===o?0:o}}return s}function i_(e){return"number"==typeof e?e:sZ(e)?a:+e}function iE(e){if("string"==typeof e)return e;if(sN(e))return tf(e,iE)+"";if(sZ(e))return rd?rd.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}function iS(e,t,r){var i=-1,n=th,s=e.length,o=!0,a=[],c=a;if(r)o=!1,n=tl;else if(s>=200){var u=t?null:i9(e);if(u)return tB(u);o=!1,n=tT,c=new r_}else c=t?[]:a;e:for(;++i<s;){var h=e[i],l=t?t(h):h;if(h=r||0!==h?h:0,o&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue e;t&&c.push(l),a.push(h)}else n(c,l,r)||(c!==a&&c.push(l),a.push(h))}return a}function iI(e,t){return t=iR(t,e),null==(e=nx(e,t))||delete e[nq(nQ(t))]}function iC(e,t,r,i){return ip(e,t,r(rG(e,t)),i)}
vendor: 4,147 bytes, line 15
15function iA(e,t,r,i){for(var n=e.length,s=i?n:-1;(i?s--:++s<n)&&t(e[s],s,e););return r?iy(e,i?0:s,i?s+1:n):iy(e,i?s+1:0,i?n:s)}function iM(e,t){var r=e;return r instanceof rm&&(r=r.value()),tp(t,function(e,t){return t.func.apply(t.thisArg,td([e],t.args))},r)}function ix(e,t,r){var i=e.length;if(i<2)return i?iS(e[0]):[];for(var n=-1,s=em(i);++n<i;)for(var o=e[n],a=-1;++a<i;)a!=n&&(s[n]=rj(s[n]||o,e[a],t,r));return iS(r$(s,1),t,r)}function iP(e,t,i){for(var n=-1,s=e.length,o=t.length,a={};++n<s;){var c=n<o?t[n]:r;i(a,e[n],c)}return a}function iO(e){return sq(e)?e:[]}function iT(e){return"function"==typeof e?e:oq}function iR(e,t){return sN(e)?e:nE(e,t)?[e]:nj(s7(e))}function ik(e,t,i){var n=e.length;return i=i===r?n:i,!t&&i>=n?e:iy(e,t,i)}var iN=ty||function(e){return e2.clearTimeout(e)};function iL(e,t){if(t)return e.slice();var r=e.length,i=eH?eH(r):new e.constructor(r);return e.copy(i),i}function ij(e){var t=new e.constructor(e.byteLength);return new eF(t).set(new eF(e)),t}function iq(e,t){var r=t?ij(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function iz(e,t){if(e!==t){var i=e!==r,n=null===e,s=e==e,o=sZ(e),a=t!==r,c=null===t,u=t==t,h=sZ(t);if(!c&&!h&&!o&&e>t||o&&a&&u&&!c&&!h||n&&a&&u||!i&&u||!s)return 1;if(!n&&!o&&!h&&e<t||h&&i&&s&&!n&&!o||c&&i&&s||!a&&s||!u)return -1}return 0}function iU(e,t,r,i){for(var n=-1,s=e.length,o=r.length,a=-1,c=t.length,u=t3(s-o,0),h=em(c+u),l=!i;++a<c;)h[a]=t[a];for(;++n<o;)(l||n<s)&&(h[r[n]]=e[n]);for(;u--;)h[a++]=e[n++];return h}function iF(e,t,r,i){for(var n=-1,s=e.length,o=-1,a=r.length,c=-1,u=t.length,h=t3(s-a,0),l=em(h+u),f=!i;++n<h;)l[n]=e[n];for(var d=n;++c<u;)l[d+c]=t[c];for(;++o<a;)(f||n<s)&&(l[d+r[o]]=e[n++]);return l}function iB(e,t){var r=-1,i=e.length;for(t||(t=em(i));++r<i;)t[r]=e[r];return t}function i$(e,t,i,n){var s=!i;i||(i={});for(var o=-1,a=t.length;++o<a;){var c=t[o],u=n?n(i[c],e[c],c,i,e):r;u===r&&(u=e[c]),s?rO(i,c,u):rA(i,c,u)}return i}function iH(e,t){return function(r,i){var n=sN(r)?to:rx,s=t?t():{};return n(r,e,nl(i,2),s)}}function iV(e){return id(function(t,i){var n=-1,s=i.length,o=s>1?i[s-1]:r,a=s>2?i[2]:r;for(o=e.length>3&&"function"==typeof o?(s--,o):r,a&&n_(i[0],i[1],a)&&(o=s<3?r:o,s=1),t=eE(t);++n<s;){var c=i[n];c&&e(t,c,n,o)}return t})}function iK(e,t){return function(r,i){if(null==r)return r;if(!sj(r))return e(r,i);for(var n=r.length,s=t?n:-1,o=eE(r);(t?s--:++s<n)&&!1!==i(o[s],s,o););return r}}function iW(e){return function(t,r,i){for(var n=-1,s=eE(t),o=i(t),a=o.length;a--;){var c=o[e?a:++n];if(!1===r(s[c],c,s))break}return t}}function iJ(e){return function(t){var i=tq(t=s7(t))?tH(t):r,n=i?i[0]:t.charAt(0),s=i?ik(i,1).join(""):t.slice(1);return n[e]()+s}}function iG(e){return function(t){return tp(oT(oS(t).replace(eB,"")),e,"")}}function iY(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=rg(e.prototype),i=e.apply(r,t);return sV(i)?i:r}}function iQ(e){return function(t,i,n){var s=eE(t);if(!sj(t)){var o=nl(i,3);t=of(t),i=function(e){return o(s[e],e,s)}}var a=e(t,i,n);return a>-1?s[o?t[a]:a]:r}}function iX(e){return ns(function(t){var n=t.length,s=n,o=ry.prototype.thru;for(e&&t.reverse();s--;){var a=t[s];if("function"!=typeof a)throw new eC(i);if(o&&!c&&"wrapper"==nu(a))var c=new ry([],!0)}for(s=c?s:n;++s<n;){var u=nu(a=t[s]),h="wrapper"==u?nc(a):r;c=h&&nS(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?c[nu(h[0])].apply(c,h[3]):1==a.length&&nS(a)?c[u]():c.thru(a)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&sN(r))return c.plant(r).value();for(var i=0,s=n?t[i].apply(this,e):r;++i<n;)s=t[i].call(this,s);return s}})}function iZ(e,t,i,n,s,o,a,c,u,h){var l=128&t,f=1&t,d=2&t,p=24&t,g=512&t,b=d?r:iY(e);return function y(){for(var m=arguments.length,v=em(m),w=m;w--;)v[w]=arguments[w];if(p)var D=nh(y),_=function(e,t){for(var r=e.length,i=0;r--;)e[r]===t&&++i;return i}(v,D);
15if(n&&(v=iU(v,n,s,p)),o&&(v=iF(v,o,a,p)),m-=_,p&&m<h){var E=tF(v,D);return i5(e,t,iZ,y.placeholder,i,v,E,c,u,h-m)}var S=f?i:this,I=d?S[e]:e;return m=v.length,c?v=function(e,t){for(var i=e.length,n=t2(t.length,i),s=iB(e);n--;){var o=t[n];e[n]=nD(o,i)?s[o]:r}return e}(v,c):g&&m>1&&v.reverse(),l&&u<m&&(v.length=u),this&&this!==e2&&this instanceof y&&(I=b||iY(I)),I.apply(S,v)}}function i0(e,t){return function(r,i){var n,s;return n=t(i),s={},rK(r,function(t,r,i){e(s,n(t),r,i)}),s}}function i1(e,t){return function(i,n){var s;if(i===r&&n===r)return t;if(i!==r&&(s=i),n!==r){if(s===r)return n;"string"==typeof i||"string"==typeof n?(i=iE(i),n=iE(n)):(i=i_(i),n=i_(n)),s=e(i,n)}return s}}function i3(e){return ns(function(t){return t=tf(t,tP(nl())),id(function(r){var i=this;return e(t,function(e){return ts(e,i,r)})})})}function i2(e,t){var i=(t=t===r?" ":iE(t)).length;if(i<2)return i?il(t,e):t;var n=il(t,tG(e/t$(t)));return tq(t)?ik(tH(n),0,e).join(""):n.slice(0,e)}function i8(e){return function(t,i,n){return n&&"number"!=typeof n&&n_(t,i,n)&&(i=n=r),t=s8(t),i===r?(i=t,t=0):i=s8(i),n=n===r?t<i?1:-1:s8(n),function(e,t,r,i){for(var n=-1,s=t3(tG((t-e)/(r||1)),0),o=em(s);s--;)o[i?s:++n]=e,e+=r;return o}(t,i,n,e)}}function i6(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=s4(t),r=s4(r)),e(t,r)}}function i5(e,t,i,n,s,o,a,c,u,h){var l=8&t,f=l?a:r,d=l?r:a,p=l?o:r,g=l?r:o;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var b=[e,t,s,p,f,g,d,c,u,h],y=i.apply(r,b);return nS(e)&&nO(y,b),y.placeholder=n,nk(y,e,t)}function i4(e){var t=e_[e];return function(e,r){if(e=s4(e),(r=null==r?0:t2(s6(r),292))&&tZ(e)){var i=(s7(e)+"e").split("e");return+((i=(s7(t(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return t(e)}}
15var i9=rt&&1/tB(new rt([,-0]))[1]==o?function(e){return new rt(e)}:o$;function i7(e){return function(t){var r,i,n=ny(t);return n==b?tz(t):n==D?(r=-1,i=Array(t.size),t.forEach(function(e){i[++r]=[e,e]}),i):tf(e(t),function(e){return[e,t[e]]})}}function ne(e,t,n,o,a,c,u,h){var l=2&t;if(!l&&"function"!=typeof e)throw new eC(i);var f=o?o.length:0;if(f||(t&=-97,o=a=r),u=u===r?u:t3(s6(u),0),h=h===r?h:s6(h),f-=a?a.length:0,64&t){var d=o,p=a;o=a=r}var g=l?r:nc(e),b=[e,t,n,o,a,d,p,c,u,h];if(g&&function(e,t){var r=e[1],i=t[1],n=r|i,o=n<131,a=128==i&&8==r||128==i&&256==r&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==r;if(o||a){1&i&&(e[2]=t[2],n|=1&r?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?iU(u,c,t[4]):c,e[4]=u?tF(e[3],s):t[4]}(c=t[5])&&(u=e[5],e[5]=u?iF(u,c,t[6]):c,e[6]=u?tF(e[5],s):t[6]),(c=t[7])&&(e[7]=c),128&i&&(e[8]=null==e[8]?t[8]:t2(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=n}}(b,g),e=b[0],t=b[1],n=b[2],o=b[3],a=b[4],(h=b[9]=b[9]===r?l?0:e.length:t3(b[9]-f,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?(y=e,m=t,v=h,w=iY(y),T=function e(){for(var t=arguments.length,i=em(t),n=t,s=nh(e);n--;)i[n]=arguments[n];var o=t<3&&i[0]!==s&&i[t-1]!==s?[]:tF(i,s);return(t-=o.length)<v?i5(y,m,iZ,e.placeholder,r,i,o,r,r,v-t):ts(this&&this!==e2&&this instanceof e?w:y,this,i)}):32!=t&&33!=t||a.length?T=iZ.apply(r,b):(D=e,_=t,E=n,S=o,I=1&_,C=iY(D),T=function e(){for(var t=-1,r=arguments.length,i=-1,n=S.length,s=em(n+r),o=this&&this!==e2&&this instanceof e?C:D;++i<n;)s[i]=S[i];for(;r--;)s[i++]=arguments[++t];return ts(o,I?E:this,s)});else var y,m,v,w,D,_,E,S,I,C,A,M,x,P,O,T=(A=e,M=t,x=n,P=1&M,O=iY(A),function e(){return(this&&this!==e2&&this instanceof e?O:A).apply(P?x:this,arguments)});return nk((g?ig:nO)(T,b),e,t)}function nt(e,t,i,n){return e===r||sO(e,ex[i])&&!eT.call(n,i)?t:e}function nr(e,t,i,n,s,o){return sV(e)&&sV(t)&&(o.set(t,e),ii(e,t,r,nr,o),o.delete(t)),e}function ni(e){return sG(e)?r:e}function nn(e,t,i,n,s,o){var a=1&i,c=e.length,u=t.length;if(c!=u&&!(a&&u>c))return!1;var h=o.get(e),l=o.get(t);if(h&&l)return h==t&&l==e;var f=-1,d=!0,p=2&i?new r_:r;for(o.set(e,t),o.set(t,e);++f<c;){var g=e[f],b=t[f];if(n)var y=a?n(b,g,f,t,e,o):n(g,b,f,e,t,o);if(y!==r){if(y)continue;d=!1;break}if(p){if(!tb(t,function(e,t){if(!tT(p,t)&&(g===e||s(g,e,i,n,o)))return p.push(t)})){d=!1;break}}else if(!(g===b||s(g,b,i,n,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function ns(e){return nR(nM(e,r,nK),e+"")}function no(e){return rY(e,of,ng)}function na(e){return rY(e,od,nb)}var nc=rn?function(e){return rn.get(e)}:o$;function nu(e){for(var t=e.name+"",r=rs[t],i=eT.call(rs,t)?r.length:0;i--;){var n=r[i],s=n.func;if(null==s||s==e)return n.name}return t}function nh(e){return(eT.call(rp,"placeholder")?rp:e).placeholder}function nl(){var e=rp.iteratee||oz;return e=e===oz?r4:e,arguments.length?e(arguments[0],arguments[1]):e}function nf(e,t){var r,i=e.__data__;return("string"==(r=typeof t)||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?i["string"==typeof t?"string":"hash"]:i.map}function nd(e){for(var t=of(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,n==n&&!sV(n)]}return t}function np(e,t){var i=null==e?r:e[t];return r5(i)?i:r}var ng=tQ?function(e){return null==e?[]:tu(tQ(e=eE(e)),function(t){return e1.call(e,t)})}:oY,nb=tQ?function(e){for(var t=[];e;)td(t,ng(e)),e=eK(e);return t}:oY,ny=rQ;function nm(e,t,r){t=iR(t,e);for(var i=-1,n=t.length,s=!1;++i<n;){var o=nq(t[i]);if(!(s=null!=e&&r(e,o)))break;e=e[o]}return s||++i!=n?s:!!(n=null==e?0:e.length)&&sH(n)&&nD(o,n)&&(sN(e)||sk(e))}function nv(e){return"function"!=typeof e.constructor||nC(e)?{}:rg(eK(e))}function nw(e){return sN(e)||sk(e)||!!(e8&&e&&e[e8])}function nD(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&el.test(e))&&e>-1&&e%1==0&&e<t}function n_(e,t,r){if(!sV(r))return!1;var i=typeof t;return("number"==i?!!(sj(r)&&nD(t,r.length)):"string"==i&&t in r)&&sO(r[t],e)}function nE(e,t){if(sN(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||sZ(e))||W.test(e)||!K.test(e)||null!=t&&e in eE(t)}function nS(e){var t=nu(e),r=rp[t];if("function"!=typeof r||!(t in rm.prototype))return!1;if(e===r)return!0;var i=nc(r);return!!i&&e===i[0]}(t9&&ny(new t9(new ArrayBuffer(1)))!=C||t7&&ny(new t7)!=b||re&&ny(re.resolve())!=v||rt&&ny(new rt)!=D||rr&&ny(new rr)!=S)&&(ny=function(e){var t=rQ(e),i=t==m?e.constructor:r,n=i?nz(i):"";if(n)switch(n){case ro:return C;case ra:return b;case rc:return v;case ru:return D;case rh:return S}return t});var nI=eP?sB:oQ;function nC(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ex)}function nA(e,t){return function(i){return null!=i&&i[e]===t&&(t!==r||e in eE(i))}}function nM(e,t,i){return t=t3(t===r?e.length-1:t,0),function(){for(var r=arguments,n=-1,s=t3(r.length-t,0),o=em(s);++n<s;)o[n]=r[t+n];n=-1;for(var a=em(t+1);++n<t;)a[n]=r[n];return a[t]=i(o),ts(e,this,a)}}function nx(e,t){return t.length<2?e:rG(e,iy(t,0,-1))}function nP(e,t){if(!("constructor"===t&&"function"==typeof e[t])&&"__proto__"!=t)return e[t]}var nO=nN(ig),nT=tJ||function(e,t){return e2.setTimeout(e,t)},nR=nN(ib);function nk(e,t,r){var i,n,s=t+"";return nR(e,function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(Z,`{
16/* [wrapped with `+t+`] */
17`)}(s,(i=(n=s.match(ee))?n[1].split(et):[],ta(c,function(e){var t="_."+e[0];r&e[1]&&!th(i,t)&&i.push(t)}),i.sort())))}function nN(e){var t=0,i=0;return function(){var n=t8(),s=16-(n-i);if(i=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function nL(e,t){var i=-1,n=e.length,s=n-1;for(t=t===r?n:t;++i<t;){var o=ih(i,s),a=e[o];e[o]=e[i],e[i]=a}return e.length=t,e}var nj=(eb=(eg=sI(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(J,function(e,r,i,n){t.push(i?n.replace(en,"$1"):r||e)}),t},function(e){return 500===eb.size&&eb.clear(),e})).cache,eg);function nq(e){if("string"==typeof e||sZ(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}function nz(e){if(null!=e){try{return eO.call(e)}catch{}try{return e+""}catch{}}return""}function nU(e){if(e instanceof rm)return e.clone();var t=new ry(e.__wrapped__,e.__chain__);return t.__actions__=iB(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var nF=id(function(e,t){return sq(e)?rj(e,r$(t,1,sq,!0)):[]}),nB=id(function(e,t){var i=nQ(t);return sq(i)&&(i=r),sq(e)?rj(e,r$(t,1,sq,!0),nl(i,2)):[]}),n$=id(function(e,t){var i=nQ(t);return sq(i)&&(i=r),sq(e)?rj(e,r$(t,1,sq,!0),r,i):[]});function nH(e,t,r){var i=null==e?0:e.length;if(!i)return -1;var n=null==r?0:s6(r);return n<0&&(n=t3(i+n,0)),tv(e,nl(t,3),n)}function nV(e,t,i){var n=null==e?0:e.length;if(!n)return -1;var s=n-1;return i!==r&&(s=s6(i),s=i<0?t3(n+s,0):t2(s,n-1)),tv(e,nl(t,3),s,!0)}function nK(e){return(null==e?0:e.length)?r$(e,1):[]}function nW(e){return e&&e.length?e[0]:r}var nJ=id(function(e){var t=tf(e,iO);return t.length&&t[0]===e[0]?r1(t):[]}),nG=id(function(e){var t=nQ(e),i=tf(e,iO);return t===nQ(i)?t=r:i.pop(),i.length&&i[0]===e[0]?r1(i,nl(t,2)):[]}),nY=id(function(e){var t=nQ(e),i=tf(e,iO);return(t="function"==typeof t?t:r)&&i.pop(),i.length&&i[0]===e[0]?r1(i,r,t):[]});function nQ(e){var t=null==e?0:e.length;return t?e[t-1]:r}var nX=id(nZ);
vendor: 6,442 bytes, line 17
17function nZ(e,t){return e&&e.length&&t&&t.length?ic(e,t):e}var n0=ns(function(e,t){var r=null==e?0:e.length,i=rT(e,t);return iu(e,tf(t,function(e){return nD(e,r)?+e:e}).sort(iz)),i});function n1(e){return null==e?e:t4.call(e)}var n3=id(function(e){return iS(r$(e,1,sq,!0))}),n2=id(function(e){var t=nQ(e);return sq(t)&&(t=r),iS(r$(e,1,sq,!0),nl(t,2))}),n8=id(function(e){var t=nQ(e);return t="function"==typeof t?t:r,iS(r$(e,1,sq,!0),r,t)});function n6(e){if(!(e&&e.length))return[];var t=0;return e=tu(e,function(e){if(sq(e))return t=t3(e.length,t),!0}),tM(t,function(t){return tf(e,tS(t))})}function n5(e,t){if(!(e&&e.length))return[];var i=n6(e);return null==t?i:tf(i,function(e){return ts(t,r,e)})}var n4=id(function(e,t){return sq(e)?rj(e,t):[]}),n9=id(function(e){return ix(tu(e,sq))}),n7=id(function(e){var t=nQ(e);return sq(t)&&(t=r),ix(tu(e,sq),nl(t,2))}),se=id(function(e){var t=nQ(e);return t="function"==typeof t?t:r,ix(tu(e,sq),r,t)}),st=id(n6),sr=id(function(e){var t=e.length,i=t>1?e[t-1]:r;return i="function"==typeof i?(e.pop(),i):r,n5(e,i)});function si(e){var t=rp(e);return t.__chain__=!0,t}function sn(e,t){return t(e)}var ss=ns(function(e){var t=e.length,i=t?e[0]:0,n=this.__wrapped__,s=function(t){return rT(t,e)};return!(t>1)&&!this.__actions__.length&&n instanceof rm&&nD(i)?((n=n.slice(i,+i+(t?1:0))).__actions__.push({func:sn,args:[s],thisArg:r}),new ry(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(s)}),so=iH(function(e,t,r){eT.call(e,r)?++e[r]:rO(e,r,1)}),sa=iQ(nH),sc=iQ(nV);function su(e,t){return(sN(e)?ta:rq)(e,nl(t,3))}function sh(e,t){return(sN(e)?function(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}:rz)(e,nl(t,3))}var sl=iH(function(e,t,r){eT.call(e,r)?e[r].push(t):rO(e,r,[t])}),sf=id(function(e,t,r){var i=-1,n="function"==typeof t,s=sj(e)?em(e.length):[];return rq(e,function(e){s[++i]=n?ts(t,e,r):r3(e,t,r)}),s}),sd=iH(function(e,t,r){rO(e,r,t)});function sp(e,t){return(sN(e)?tf:ie)(e,nl(t,3))}var sg=iH(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),sb=id(function(e,t){if(null==e)return[];var r=t.length;return r>1&&n_(e,t[0],t[1])?t=[]:r>2&&n_(t[0],t[1],t[2])&&(t=[t[0]]),io(e,r$(t,1),[])}),sy=tI||function(){return e2.Date.now()};function sm(e,t,i){return t=i?r:t,t=e&&null==t?e.length:t,ne(e,128,r,r,r,r,t)}function sv(e,t){var n;if("function"!=typeof t)throw new eC(i);return e=s6(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var sw=id(function(e,t,r){var i=1;if(r.length){var n=tF(r,nh(sw));i|=32}return ne(e,i,t,r,n)}),sD=id(function(e,t,r){var i=3;if(r.length){var n=tF(r,nh(sD));i|=32}return ne(t,i,e,r,n)});function s_(e,t,n){var s,o,a,c,u,h,l=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new eC(i);function g(t){var i=s,n=o;return s=o=r,l=t,c=e.apply(n,i)}function b(e){var i=e-h,n=e-l;return h===r||i>=t||i<0||d&&n>=a}function y(){var e,r,i,n=sy();if(b(n))return m(n);u=nT(y,(e=n-h,r=n-l,i=t-e,d?t2(i,a-r):i))}function m(e){return u=r,p&&s?g(e):(s=o=r,c)}function v(){var e,i=sy(),n=b(i);if(s=arguments,o=this,h=i,n){if(u===r)return l=e=h,u=nT(y,t),f?g(e):c;if(d)return iN(u),u=nT(y,t),g(h)}return u===r&&(u=nT(y,t)),c}return t=s4(t)||0,sV(n)&&(f=!!n.leading,a=(d="maxWait"in n)?t3(s4(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){u!==r&&iN(u),l=0,s=h=o=u=r},v.flush=function(){return u===r?c:m(sy())},v}var sE=id(function(e,t){return rL(e,1,t)}),sS=id(function(e,t,r){return rL(e,s4(t)||0,r)});function sI(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new eC(i);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var o=e.apply(this,i);return r.cache=s.set(n,o)||s,o};return r.cache=new(sI.Cache||rD),r}function sC(e){if("function"!=typeof e)throw new eC(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}sI.Cache=rD;var sA=id(function(e,t){var r=(t=1==t.length&&sN(t[0])?tf(t[0],tP(nl())):tf(r$(t,1),tP(nl()))).length;return id(function(i){for(var n=-1,s=t2(i.length,r);++n<s;)i[n]=t[n].call(this,i[n]);return ts(e,this,i)})}),sM=id(function(e,t){var i=tF(t,nh(sM));return ne(e,32,r,t,i)}),sx=id(function(e,t){var i=tF(t,nh(sx));return ne(e,64,r,t,i)}),sP=ns(function(e,t){return ne(e,256,r,r,r,t)});function sO(e,t){return e===t||e!=e&&t!=t}var sT=i6(rX),sR=i6(function(e,t){return e>=t}),sk=r2(function(){return arguments}())?r2:function(e){return sK(e)&&eT.call(e,"callee")&&!e1.call(e,"callee")},sN=em.isArray,sL=e7?tP(e7):function(e){return sK(e)&&rQ(e)==I};function sj(e){return null!=e&&sH(e.length)&&!sB(e)}function sq(e){return sK(e)&&sj(e)}var sz=tX||oQ,sU=te?tP(te):function(e){return sK(e)&&rQ(e)==f};function sF(e){if(!sK(e))return!1;var t=rQ(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sG(e)}function sB(e){if(!sV(e))return!1;var t=rQ(e);return t==p||t==g||"[object AsyncFunction]"==t||"[object Proxy]"==t}function s$(e){return"number"==typeof e&&e==s6(e)}function sH(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function sV(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function sK(e){return null!=e&&"object"==typeof e}var sW=tt?tP(tt):function(e){return sK(e)&&ny(e)==b};function sJ(e){return"number"==typeof e||sK(e)&&rQ(e)==y}function sG(e){if(!sK(e)||rQ(e)!=m)return!1;var t=eK(e);if(null===t)return!0;var r=eT.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&eO.call(r)==eL}var sY=tr?tP(tr):function(e){return sK(e)&&rQ(e)==w},sQ=ti?tP(ti):function(e){return sK(e)&&ny(e)==D};function sX(e){return"string"==typeof e||!sN(e)&&sK(e)&&rQ(e)==_}function sZ(e){return"symbol"==typeof e||sK(e)&&rQ(e)==E}var s0=tn?tP(tn):function(e){return sK(e)&&sH(e.length)&&!!eY[rQ(e)]},s1=i6(r7),s3=i6(function(e,t){return e<=t});function s2(e){if(!e)return[];if(sj(e))return sX(e)?tH(e):iB(e);if(e6&&e[e6])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[e6]());var t=ny(e);return(t==b?tz:t==D?tB:oD)(e)}function s8(e){return e?(e=s4(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function s6(e){var t=s8(e),r=t%1;return t==t?r?t-r:t:0}function s5(e){return e?rR(s6(e),0,4294967295):0}function s4(e){if("number"==typeof e)return e;if(sZ(e))return a;
17if(sV(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=sV(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tx(e);var r=ec.test(e);return r||eh.test(e)?e0(e.slice(2),r?2:8):ea.test(e)?a:+e}function s9(e){return i$(e,od(e))}function s7(e){return null==e?"":iE(e)}var oe=iV(function(e,t){if(nC(t)||sj(t)){i$(t,of(t),e);return}for(var r in t)eT.call(t,r)&&rA(e,r,t[r])}),ot=iV(function(e,t){i$(t,od(t),e)}),or=iV(function(e,t,r,i){i$(t,od(t),e,i)}),oi=iV(function(e,t,r,i){i$(t,of(t),e,i)}),on=ns(rT),os=id(function(e,t){e=eE(e);var i=-1,n=t.length,s=n>2?t[2]:r;for(s&&n_(t[0],t[1],s)&&(n=1);++i<n;)for(var o=t[i],a=od(o),c=-1,u=a.length;++c<u;){var h=a[c],l=e[h];(l===r||sO(l,ex[h])&&!eT.call(e,h))&&(e[h]=o[h])}return e}),oo=id(function(e){return e.push(r,nr),ts(og,r,e)});function oa(e,t,i){var n=null==e?r:rG(e,t);return n===r?i:n}function oc(e,t){return null!=e&&nm(e,t,r0)}var ou=i0(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=eN.call(t)),e[t]=r},oN(oq)),oh=i0(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=eN.call(t)),eT.call(e,t)?e[t].push(r):e[t]=[r]},nl),ol=id(r3);function of(e){return sj(e)?rS(e):r9(e)}function od(e){return sj(e)?rS(e,!0):function(e){if(!sV(e))return function(e){var t=[];if(null!=e)for(var r in eE(e))t.push(r);return t}(e);var t=nC(e),r=[];for(var i in e)"constructor"==i&&(t||!eT.call(e,i))||r.push(i);return r}(e)}var op=iV(function(e,t,r){ii(e,t,r)}),og=iV(function(e,t,r,i){ii(e,t,r,i)}),ob=ns(function(e,t){var r={};if(null==e)return r;var i=!1;t=tf(t,function(t){return t=iR(t,e),i||(i=t.length>1),t}),i$(e,na(e),r),i&&(r=rk(r,7,ni));for(var n=t.length;n--;)iI(r,t[n]);return r}),oy=ns(function(e,t){return null==e?{}:ia(e,t,function(t,r){return oc(e,r)})});function om(e,t){if(null==e)return{};var r=tf(na(e),function(e){return[e]});return t=nl(t),ia(e,r,function(e,r){return t(e,r[0])})}var ov=i7(of),ow=i7(od);function oD(e){return null==e?[]:tO(e,of(e))}var o_=iG(function(e,t,r){return t=t.toLowerCase(),e+(r?oE(t):t)});function oE(e){return oO(s7(e).toLowerCase())}function oS(e){return(e=s7(e))&&e.replace(ef,tN).replace(e$,"")}var oI=iG(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),oC=iG(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),oA=iJ("toLowerCase"),oM=iG(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),ox=iG(function(e,t,r){return e+(r?" ":"")+oO(t)}),oP=iG(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),oO=iJ("toUpperCase");function oT(e,t,i){var n;return e=s7(e),(t=i?r:t)===r?(n=e,eW.test(n))?e.match(eV)||[]:e.match(er)||[]:e.match(t)||[]}var oR=id(function(e,t){try{return ts(e,r,t)}catch(e){return sF(e)?e:new ew(e)}}),ok=ns(function(e,t){return ta(t,function(t){rO(e,t=nq(t),sw(e[t],e))}),e});function oN(e){return function(){return e}}var oL=iX(),oj=iX(!0);function oq(e){return e}function oz(e){return r4("function"==typeof e?e:rk(e,1))}var oU=id(function(e,t){return function(r){return r3(r,e,t)}}),oF=id(function(e,t){return function(r){return r3(e,r,t)}});function oB(e,t,r){var i=of(t),n=rJ(t,i);null!=r||sV(t)&&(n.length||!i.length)||(r=t,t=e,e=this,n=rJ(t,of(t)));var s=!(sV(r)&&"chain"in r)||!!r.chain,o=sB(e);return ta(n,function(r){var i=t[r];e[r]=i,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=iB(this.__actions__)).push({func:i,args:arguments,thisArg:e}),r.__chain__=t,r}return i.apply(e,td([this.value()],arguments))})}),e}function o$(){}var oH=i3(tf),oV=i3(tc),oK=i3(tb);function oW(e){return nE(e)?tS(nq(e)):function(t){return rG(t,e)}}var oJ=i8(),oG=i8(!0);function oY(){return[]}function oQ(){return!1}var oX=i1(function(e,t){return e+t},0),oZ=i4("ceil"),o0=i1(function(e,t){return e/t},1),o1=i4("floor"),o3=i1(function(e,t){return e*t},1),o2=i4("round"),o8=i1(function(e,t){return e-t},0);return rp.after=function(e,t){if("function"!=typeof t)throw new eC(i);return e=s6(e),function(){if(--e<1)return t.apply(this,arguments)}},rp.ary=sm,rp.assign=oe,rp.assignIn=ot,rp.assignInWith=or,rp.assignWith=oi,rp.at=on,rp.before=sv,rp.bind=sw,rp.bindAll=ok,rp.bindKey=sD,rp.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return sN(e)?e:[e]},rp.chain=si,rp.chunk=function(e,t,i){t=(i?n_(e,t,i):t===r)?1:t3(s6(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var s=0,o=0,a=em(tG(n/t));s<n;)a[o++]=iy(e,s,s+=t);return a},rp.compact=function(e){for(var t=-1,r=null==e?0:e.length,i=0,n=[];++t<r;){var s=e[t];s&&(n[i++]=s)}return n},rp.concat=function(){var e=arguments.length;if(!e)return[];
17for(var t=em(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return td(sN(r)?iB(r):[r],r$(t,1))},rp.cond=function(e){var t=null==e?0:e.length,r=nl();return e=t?tf(e,function(e){if("function"!=typeof e[1])throw new eC(i);return[r(e[0]),e[1]]}):[],id(function(r){for(var i=-1;++i<t;){var n=e[i];if(ts(n[0],this,r))return ts(n[1],this,r)}})},rp.conforms=function(e){var t,r;return r=of(t=rk(e,1)),function(e){return rN(e,t,r)}},rp.constant=oN,rp.countBy=so,rp.create=function(e,t){var r=rg(e);return null==t?r:rP(r,t)},rp.curry=function e(t,i,n){i=n?r:i;var s=ne(t,8,r,r,r,r,r,i);return s.placeholder=e.placeholder,s},rp.curryRight=function e(t,i,n){i=n?r:i;var s=ne(t,16,r,r,r,r,r,i);return s.placeholder=e.placeholder,s},rp.debounce=s_,rp.defaults=os,rp.defaultsDeep=oo,rp.defer=sE,rp.delay=sS,rp.difference=nF,rp.differenceBy=nB,rp.differenceWith=n$,rp.drop=function(e,t,i){var n=null==e?0:e.length;return n?iy(e,(t=i||t===r?1:s6(t))<0?0:t,n):[]},rp.dropRight=function(e,t,i){var n=null==e?0:e.length;return n?iy(e,0,(t=n-(t=i||t===r?1:s6(t)))<0?0:t):[]},rp.dropRightWhile=function(e,t){return e&&e.length?iA(e,nl(t,3),!0,!0):[]},rp.dropWhile=function(e,t){return e&&e.length?iA(e,nl(t,3),!0):[]},rp.fill=function(e,t,i,n){var s=null==e?0:e.length;return s?(i&&"number"!=typeof i&&n_(e,t,i)&&(i=0,n=s),function(e,t,i,n){var s=e.length;for((i=s6(i))<0&&(i=-i>s?0:s+i),(n=n===r||n>s?s:s6(n))<0&&(n+=s),n=i>n?0:s5(n);i<n;)e[i++]=t;return e}(e,t,i,n)):[]},rp.filter=function(e,t){return(sN(e)?tu:rB)(e,nl(t,3))},rp.flatMap=function(e,t){return r$(sp(e,t),1)},rp.flatMapDeep=function(e,t){return r$(sp(e,t),o)},rp.flatMapDepth=function(e,t,i){return i=i===r?1:s6(i),r$(sp(e,t),i)},rp.flatten=nK,rp.flattenDeep=function(e){return(null==e?0:e.length)?r$(e,o):[]},rp.flattenDepth=function(e,t){return(null==e?0:e.length)?r$(e,t=t===r?1:s6(t)):[]},rp.flip=function(e){return ne(e,512)},rp.flow=oL,rp.flowRight=oj,rp.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,i={};++t<r;){var n=e[t];i[n[0]]=n[1]}return i},rp.functions=function(e){return null==e?[]:rJ(e,of(e))},rp.functionsIn=function(e){return null==e?[]:rJ(e,od(e))},rp.groupBy=sl,rp.initial=function(e){return(null==e?0:e.length)?iy(e,0,-1):[]},rp.intersection=nJ,rp.intersectionBy=nG,rp.intersectionWith=nY,rp.invert=ou,rp.invertBy=oh,rp.invokeMap=sf,rp.iteratee=oz,rp.keyBy=sd,rp.keys=of,rp.keysIn=od,rp.map=sp,rp.mapKeys=function(e,t){var r={};return t=nl(t,3),rK(e,function(e,i,n){rO(r,t(e,i,n),e)}),r},rp.mapValues=function(e,t){var r={};return t=nl(t,3),rK(e,function(e,i,n){rO(r,i,t(e,i,n))}),r},rp.matches=function(e){return it(rk(e,1))},rp.matchesProperty=function(e,t){return ir(e,rk(t,1))},rp.memoize=sI,rp.merge=op,rp.mergeWith=og,rp.method=oU,rp.methodOf=oF,rp.mixin=oB,rp.negate=sC,rp.nthArg=function(e){return e=s6(e),id(function(t){return is(t,e)})},rp.omit=ob,rp.omitBy=function(e,t){return om(e,sC(nl(t)))},rp.once=function(e){return sv(2,e)},rp.orderBy=function(e,t,i,n){return null==e?[]:(sN(t)||(t=null==t?[]:[t]),sN(i=n?r:i)||(i=null==i?[]:[i]),io(e,t,i))},rp.over=oH,rp.overArgs=sA,rp.overEvery=oV,rp.overSome=oK,rp.partial=sM,rp.partialRight=sx,rp.partition=sg,rp.pick=oy,rp.pickBy=om,rp.property=oW,rp.propertyOf=function(e){return function(t){return null==e?r:rG(e,t)}},rp.pull=nX,rp.pullAll=nZ,rp.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?ic(e,t,nl(r,2)):e},rp.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?ic(e,t,r,i):e},rp.pullAt=n0,rp.range=oJ,rp.rangeRight=oG,rp.rearg=sP,rp.reject=function(e,t){return(sN(e)?tu:rB)(e,sC(nl(t,3)))},rp.remove=function(e,t){var r=[];if(!(e&&e.length))return r;var i=-1,n=[],s=e.length;for(t=nl(t,3);++i<s;){var o=e[i];t(o,i,e)&&(r.push(o),n.push(i))}return iu(e,n),r},rp.rest=function(e,t){if("function"!=typeof e)throw new eC(i);return id(e,t=t===r?t:s6(t))},rp.reverse=n1,rp.sampleSize=function(e,t,i){return t=(i?n_(e,t,i):t===r)?1:s6(t),(sN(e)?function(e,t){return nL(iB(e),rR(t,0,e.length))}:function(e,t){var r=oD(e);return nL(r,rR(t,0,r.length))})(e,t)},rp.set=function(e,t,r){return null==e?e:ip(e,t,r)},rp.setWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:ip(e,t,i,n)},rp.shuffle=function(e){return(sN(e)?function(e){return nL(iB(e))}:function(e){return nL(oD(e))})(e)}
vendor: 4,679 bytes, line 17
17,rp.slice=function(e,t,i){var n=null==e?0:e.length;return n?(i&&"number"!=typeof i&&n_(e,t,i)?(t=0,i=n):(t=null==t?0:s6(t),i=i===r?n:s6(i)),iy(e,t,i)):[]},rp.sortBy=sb,rp.sortedUniq=function(e){return e&&e.length?iD(e):[]},rp.sortedUniqBy=function(e,t){return e&&e.length?iD(e,nl(t,2)):[]},rp.split=function(e,t,i){return i&&"number"!=typeof i&&n_(e,t,i)&&(t=i=r),(i=i===r?4294967295:i>>>0)?(e=s7(e))&&("string"==typeof t||null!=t&&!sY(t))&&!(t=iE(t))&&tq(e)?ik(tH(e),0,i):e.split(t,i):[]},rp.spread=function(e,t){if("function"!=typeof e)throw new eC(i);return t=null==t?0:t3(s6(t),0),id(function(r){var i=r[t],n=ik(r,0,t);return i&&td(n,i),ts(e,this,n)})},rp.tail=function(e){var t=null==e?0:e.length;return t?iy(e,1,t):[]},rp.take=function(e,t,i){return e&&e.length?iy(e,0,(t=i||t===r?1:s6(t))<0?0:t):[]},rp.takeRight=function(e,t,i){var n=null==e?0:e.length;return n?iy(e,(t=n-(t=i||t===r?1:s6(t)))<0?0:t,n):[]},rp.takeRightWhile=function(e,t){return e&&e.length?iA(e,nl(t,3),!1,!0):[]},rp.takeWhile=function(e,t){return e&&e.length?iA(e,nl(t,3)):[]},rp.tap=function(e,t){return t(e),e},rp.throttle=function(e,t,r){var n=!0,s=!0;if("function"!=typeof e)throw new eC(i);return sV(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),s_(e,t,{leading:n,maxWait:t,trailing:s})},rp.thru=sn,rp.toArray=s2,rp.toPairs=ov,rp.toPairsIn=ow,rp.toPath=function(e){return sN(e)?tf(e,nq):sZ(e)?[e]:iB(nj(s7(e)))},rp.toPlainObject=s9,rp.transform=function(e,t,r){var i=sN(e),n=i||sz(e)||s0(e);if(t=nl(t,4),null==r){var s=e&&e.constructor;r=n?i?new s:[]:sV(e)&&sB(s)?rg(eK(e)):{}}return(n?ta:rK)(e,function(e,i,n){return t(r,e,i,n)}),r},rp.unary=function(e){return sm(e,1)},rp.union=n3,rp.unionBy=n2,rp.unionWith=n8,rp.uniq=function(e){return e&&e.length?iS(e):[]},rp.uniqBy=function(e,t){return e&&e.length?iS(e,nl(t,2)):[]},rp.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?iS(e,r,t):[]},rp.unset=function(e,t){return null==e||iI(e,t)},rp.unzip=n6,rp.unzipWith=n5,rp.update=function(e,t,r){return null==e?e:iC(e,t,iT(r))},rp.updateWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:iC(e,t,iT(i),n)},rp.values=oD,rp.valuesIn=function(e){return null==e?[]:tO(e,od(e))},rp.without=n4,rp.words=oT,rp.wrap=function(e,t){return sM(iT(t),e)},rp.xor=n9,rp.xorBy=n7,rp.xorWith=se,rp.zip=st,rp.zipObject=function(e,t){return iP(e||[],t||[],rA)},rp.zipObjectDeep=function(e,t){return iP(e||[],t||[],ip)},rp.zipWith=sr,rp.entries=ov,rp.entriesIn=ow,rp.extend=ot,rp.extendWith=or,oB(rp,rp),rp.add=oX,rp.attempt=oR,rp.camelCase=o_,rp.capitalize=oE,rp.ceil=oZ,rp.clamp=function(e,t,i){return i===r&&(i=t,t=r),i!==r&&(i=(i=s4(i))==i?i:0),t!==r&&(t=(t=s4(t))==t?t:0),rR(s4(e),t,i)},rp.clone=function(e){return rk(e,4)},rp.cloneDeep=function(e){return rk(e,5)},rp.cloneDeepWith=function(e,t){return rk(e,5,t="function"==typeof t?t:r)},rp.cloneWith=function(e,t){return rk(e,4,t="function"==typeof t?t:r)},rp.conformsTo=function(e,t){return null==t||rN(e,t,of(t))},rp.deburr=oS,rp.defaultTo=function(e,t){return null==e||e!=e?t:e},rp.divide=o0,rp.endsWith=function(e,t,i){e=s7(e),t=iE(t);var n=e.length,s=i=i===r?n:rR(s6(i),0,n);return(i-=t.length)>=0&&e.slice(i,s)==t},rp.eq=sO,rp.escape=function(e){return(e=s7(e))&&B.test(e)?e.replace(U,tL):e},rp.escapeRegExp=function(e){return(e=s7(e))&&Y.test(e)?e.replace(G,"\\$&"):e},rp.every=function(e,t,i){var n=sN(e)?tc:rU;return i&&n_(e,t,i)&&(t=r),n(e,nl(t,3))},rp.find=sa,rp.findIndex=nH,rp.findKey=function(e,t){return tm(e,nl(t,3),rK)},rp.findLast=sc,rp.findLastIndex=nV,rp.findLastKey=function(e,t){return tm(e,nl(t,3),rW)},rp.floor=o1,rp.forEach=su,rp.forEachRight=sh,rp.forIn=function(e,t){return null==e?e:rH(e,nl(t,3),od)},rp.forInRight=function(e,t){return null==e?e:rV(e,nl(t,3),od)},rp.forOwn=function(e,t){return e&&rK(e,nl(t,3))},rp.forOwnRight=function(e,t){return e&&rW(e,nl(t,3))},rp.get=oa,rp.gt=sT,rp.gte=sR,rp.has=function(e,t){return null!=e&&nm(e,t,rZ)},rp.hasIn=oc,rp.head=nW,rp.identity=oq,rp.includes=function(e,t,r,i){e=sj(e)?e:oD(e),r=r&&!i?s6(r):0;var n=e.length;return r<0&&(r=t3(n+r,0)),sX(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&tw(e,t,r)>-1},rp.indexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return -1;var n=null==r?0:s6(r);return n<0&&(n=t3(i+n,0)),tw(e,t,n)},rp.inRange=function(e,t,i){var n,s,o;return t=s8(t),i===r?(i=t,t=0):i=s8(i),(n=e=s4(e))>=t2(s=t,o=i)&&n<t3(s,o)},rp.invoke=ol,rp.isArguments=sk,rp.isArray=sN,rp.isArrayBuffer=sL,rp.isArrayLike=sj,rp.isArrayLikeObject=sq,rp.isBoolean=function(e){return!0===e||!1===e||sK(e)&&rQ(e)==l},rp.isBuffer=sz,rp.isDate=sU,rp.isElement=function(e){return sK(e)&&1===e.nodeType&&!sG(e)},rp.isEmpty=function(e){if(null==e)return!0;
vendor: 4,874 bytes, lines 17-18
17if(sj(e)&&(sN(e)||"string"==typeof e||"function"==typeof e.splice||sz(e)||s0(e)||sk(e)))return!e.length;var t=ny(e);if(t==b||t==D)return!e.size;if(nC(e))return!r9(e).length;for(var r in e)if(eT.call(e,r))return!1;return!0},rp.isEqual=function(e,t){return r8(e,t)},rp.isEqualWith=function(e,t,i){var n=(i="function"==typeof i?i:r)?i(e,t):r;return n===r?r8(e,t,r,i):!!n},rp.isError=sF,rp.isFinite=function(e){return"number"==typeof e&&tZ(e)},rp.isFunction=sB,rp.isInteger=s$,rp.isLength=sH,rp.isMap=sW,rp.isMatch=function(e,t){return e===t||r6(e,t,nd(t))},rp.isMatchWith=function(e,t,i){return i="function"==typeof i?i:r,r6(e,t,nd(t),i)},rp.isNaN=function(e){return sJ(e)&&e!=+e},rp.isNative=function(e){if(nI(e))throw new ew("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return r5(e)},rp.isNil=function(e){return null==e},rp.isNull=function(e){return null===e},rp.isNumber=sJ,rp.isObject=sV,rp.isObjectLike=sK,rp.isPlainObject=sG,rp.isRegExp=sY,rp.isSafeInteger=function(e){return s$(e)&&e>=-9007199254740991&&e<=9007199254740991},rp.isSet=sQ,rp.isString=sX,rp.isSymbol=sZ,rp.isTypedArray=s0,rp.isUndefined=function(e){return e===r},rp.isWeakMap=function(e){return sK(e)&&ny(e)==S},rp.isWeakSet=function(e){return sK(e)&&"[object WeakSet]"==rQ(e)},rp.join=function(e,t){return null==e?"":t0.call(e,t)},rp.kebabCase=oI,rp.last=nQ,rp.lastIndexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return -1;var s=n;return i!==r&&(s=(s=s6(i))<0?t3(n+s,0):t2(s,n-1)),t==t?function(e,t,r){for(var i=r+1;i--&&e[i]!==t;);return i}(e,t,s):tv(e,t_,s,!0)},rp.lowerCase=oC,rp.lowerFirst=oA,rp.lt=s1,rp.lte=s3,rp.max=function(e){return e&&e.length?rF(e,oq,rX):r},rp.maxBy=function(e,t){return e&&e.length?rF(e,nl(t,2),rX):r},rp.mean=function(e){return tE(e,oq)},rp.meanBy=function(e,t){return tE(e,nl(t,2))},rp.min=function(e){return e&&e.length?rF(e,oq,r7):r},rp.minBy=function(e,t){return e&&e.length?rF(e,nl(t,2),r7):r},rp.stubArray=oY,rp.stubFalse=oQ,rp.stubObject=function(){return{}},rp.stubString=function(){return""},rp.stubTrue=function(){return!0},rp.multiply=o3,rp.nth=function(e,t){return e&&e.length?is(e,s6(t)):r},rp.noConflict=function(){return e2._===this&&(e2._=ej),this},rp.noop=o$,rp.now=sy,rp.pad=function(e,t,r){e=s7(e);var i=(t=s6(t))?t$(e):0;if(!t||i>=t)return e;var n=(t-i)/2;return i2(tY(n),r)+e+i2(tG(n),r)},rp.padEnd=function(e,t,r){e=s7(e);var i=(t=s6(t))?t$(e):0;return t&&i<t?e+i2(t-i,r):e},rp.padStart=function(e,t,r){e=s7(e);var i=(t=s6(t))?t$(e):0;return t&&i<t?i2(t-i,r)+e:e},rp.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),t6(s7(e).replace(Q,""),t||0)},rp.random=function(e,t,i){if(i&&"boolean"!=typeof i&&n_(e,t,i)&&(t=i=r),i===r&&("boolean"==typeof t?(i=t,t=r):"boolean"==typeof e&&(i=e,e=r)),e===r&&t===r?(e=0,t=1):(e=s8(e),t===r?(t=e,e=0):t=s8(t)),e>t){var n=e;e=t,t=n}if(i||e%1||t%1){var s=t5();return t2(e+s*(t-e+eZ("1e-"+((s+"").length-1))),t)}return ih(e,t)},rp.reduce=function(e,t,r){var i=sN(e)?tp:tC,n=arguments.length<3;return i(e,nl(t,4),r,n,rq)},rp.reduceRight=function(e,t,r){var i=sN(e)?tg:tC,n=arguments.length<3;return i(e,nl(t,4),r,n,rz)},rp.repeat=function(e,t,i){return t=(i?n_(e,t,i):t===r)?1:s6(t),il(s7(e),t)},rp.replace=function(){var e=arguments,t=s7(e[0]);return e.length<3?t:t.replace(e[1],e[2])},rp.result=function(e,t,i){t=iR(t,e);var n=-1,s=t.length;for(s||(s=1,e=r);++n<s;){var o=null==e?r:e[nq(t[n])];o===r&&(n=s,o=i),e=sB(o)?o.call(e):o}return e},rp.round=o2,rp.runInContext=e,rp.sample=function(e){return(sN(e)?rI:function(e){return rI(oD(e))})(e)},rp.size=function(e){if(null==e)return 0;if(sj(e))return sX(e)?t$(e):e.length;var t=ny(e);return t==b||t==D?e.size:r9(e).length},rp.snakeCase=oM,rp.some=function(e,t,i){var n=sN(e)?tb:im;return i&&n_(e,t,i)&&(t=r),n(e,nl(t,3))},rp.sortedIndex=function(e,t){return iv(e,t)},rp.sortedIndexBy=function(e,t,r){return iw(e,t,nl(r,2))},rp.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var i=iv(e,t);if(i<r&&sO(e[i],t))return i}return -1},rp.sortedLastIndex=function(e,t){return iv(e,t,!0)},rp.sortedLastIndexBy=function(e,t,r){return iw(e,t,nl(r,2),!0)},rp.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=iv(e,t,!0)-1;if(sO(e[r],t))return r}return -1},rp.startCase=ox,rp.startsWith=function(e,t,r){return e=s7(e),r=null==r?0:rR(s6(r),0,e.length),t=iE(t),e.slice(r,r+t.length)==t},rp.subtract=o8,rp.sum=function(e){return e&&e.length?tA(e,oq):0},rp.sumBy=function(e,t){return e&&e.length?tA(e,nl(t,2)):0},rp.template=function(e,t,i){var n=rp.templateSettings;i&&n_(e,t,i)&&(t=r),e=s7(e),t=or({},t,n,nt);var s,o,a=or({},t.imports,n.imports,nt),c=of(a),u=tO(a,c),h=0,l=t.interpolate||ed,f="__p += '",d=eS((t.escape||ed).source+"|"+l.source+"|"+(l===V?es:ed).source+"|"+(t.evaluate||ed).source+"|$","g"),p="//# sourceURL="+(eT.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eG+"]")+`
18`;
vendor: 6,263 bytes, lines 18-34
18e.replace(d,function(t,r,i,n,a,c){return i||(i=n),f+=e.slice(h,c).replace(ep,tj),r&&(s=!0,f+=`' +
19__e(`+r+`) +
20'`),a&&(o=!0,f+=`';
21`+a+`;
22__p += '`),i&&(f+=`' +
23((__t = (`+i+`)) == null ? '' : __t) +
24'`),h=c+t.length,t}),f+=`';
25`;var g=eT.call(t,"variable")&&t.variable;if(g){if(ei.test(g))throw new ew("Invalid `variable` option passed into `_.template`")}else f=`with (obj) {
26`+f+`
27}
28`;f=(o?f.replace(L,""):f).replace(j,"$1").replace(q,"$1;"),f="function("+(g||"obj")+`) {
29`+(g?"":`obj || (obj = {});
30`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?`, __j = Array.prototype.join;
31function print() { __p += __j.call(arguments, '') }
32`:`;
33`)+f+`return __p
34}`;var b=oR(function(){return eD(c,p+"return "+f).apply(r,u)});if(b.source=f,sF(b))throw b;return b},rp.times=function(e,t){if((e=s6(e))<1||e>9007199254740991)return[];var r=4294967295,i=t2(e,4294967295);t=nl(t),e-=4294967295;for(var n=tM(i,t);++r<e;)t(r);return n},rp.toFinite=s8,rp.toInteger=s6,rp.toLength=s5,rp.toLower=function(e){return s7(e).toLowerCase()},rp.toNumber=s4,rp.toSafeInteger=function(e){return e?rR(s6(e),-9007199254740991,9007199254740991):0===e?e:0},rp.toString=s7,rp.toUpper=function(e){return s7(e).toUpperCase()},rp.trim=function(e,t,i){if((e=s7(e))&&(i||t===r))return tx(e);if(!e||!(t=iE(t)))return e;var n=tH(e),s=tH(t),o=tR(n,s),a=tk(n,s)+1;return ik(n,o,a).join("")},rp.trimEnd=function(e,t,i){if((e=s7(e))&&(i||t===r))return e.slice(0,tV(e)+1);if(!e||!(t=iE(t)))return e;var n=tH(e),s=tk(n,tH(t))+1;return ik(n,0,s).join("")},rp.trimStart=function(e,t,i){if((e=s7(e))&&(i||t===r))return e.replace(Q,"");if(!e||!(t=iE(t)))return e;var n=tH(e),s=tR(n,tH(t));return ik(n,s).join("")},rp.truncate=function(e,t){var i=30,n="...";if(sV(t)){var s="separator"in t?t.separator:s;i="length"in t?s6(t.length):i,n="omission"in t?iE(t.omission):n}var o=(e=s7(e)).length;if(tq(e)){var a=tH(e);o=a.length}if(i>=o)return e;var c=i-t$(n);if(c<1)return n;var u=a?ik(a,0,c).join(""):e.slice(0,c);if(s===r)return u+n;if(a&&(c+=u.length-c),sY(s)){if(e.slice(c).search(s)){var h,l=u;for(s.global||(s=eS(s.source,s7(eo.exec(s))+"g")),s.lastIndex=0;h=s.exec(l);)var f=h.index;u=u.slice(0,f===r?c:f)}}else if(e.indexOf(iE(s),c)!=c){var d=u.lastIndexOf(s);d>-1&&(u=u.slice(0,d))}return u+n},rp.unescape=function(e){return(e=s7(e))&&F.test(e)?e.replace(z,tK):e},rp.uniqueId=function(e){var t=++eR;return s7(e)+t},rp.upperCase=oP,rp.upperFirst=oO,rp.each=su,rp.eachRight=sh,rp.first=nW,oB(rp,(ey={},rK(rp,function(e,t){eT.call(rp.prototype,t)||(ey[t]=e)}),ey),{chain:!1}),rp.VERSION="4.17.21",ta(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){rp[e].placeholder=rp}),ta(["drop","take"],function(e,t){rm.prototype[e]=function(i){i=i===r?1:t3(s6(i),0);var n=this.__filtered__&&!t?new rm(this):this.clone();return n.__filtered__?n.__takeCount__=t2(i,n.__takeCount__):n.__views__.push({size:t2(i,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},rm.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),ta(["filter","map","takeWhile"],function(e,t){var r=t+1,i=1==r||3==r;rm.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:nl(e,3),type:r}),t.__filtered__=t.__filtered__||i,t}}),ta(["head","last"],function(e,t){var r="take"+(t?"Right":"");rm.prototype[e]=function(){return this[r](1).value()[0]}}),ta(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");rm.prototype[e]=function(){return this.__filtered__?new rm(this):this[r](1)}}),rm.prototype.compact=function(){return this.filter(oq)},rm.prototype.find=function(e){return this.filter(e).head()},rm.prototype.findLast=function(e){return this.reverse().find(e)},rm.prototype.invokeMap=id(function(e,t){return"function"==typeof e?new rm(this):this.map(function(r){return r3(r,e,t)})}),rm.prototype.reject=function(e){return this.filter(sC(nl(e)))},rm.prototype.slice=function(e,t){e=s6(e);var i=this;return i.__filtered__&&(e>0||t<0)?new rm(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(i=(t=s6(t))<0?i.dropRight(-t):i.take(t-e)),i)},rm.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},rm.prototype.toArray=function(){return this.take(4294967295)},rK(rm.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),s=rp[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);s&&(rp.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,c=t instanceof rm,u=a[0],h=c||sN(t),l=function(e){var t=s.apply(rp,td([e],a));return n&&f?t[0]:t};h&&i&&"function"==typeof u&&1!=u.length&&(c=h=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,g=c&&!d;if(!o&&h){t=g?t:new rm(this);var b=e.apply(t,a);return b.__actions__.push({func:sn,args:[l],thisArg:r}),new ry(b,f)}return p&&g?e.apply(this,a):(b=this.thru(l),p?n?b.value()[0]:b.value():b)})}),ta(["pop","push","shift","sort","splice","unshift"],function(e){var t=eA[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);rp.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var n=this.value();return t.apply(sN(n)?n:[],e)}return this[r](function(r){return t.apply(sN(r)?r:[],e)})}}),rK(rm.prototype,function(e,t){var r=rp[t];if(r){var i=r.name+"";eT.call(rs,i)||(rs[i]=[]),rs[i].push({name:t,func:r})}}),rs[iZ(r,2).name]=[{name:"wrapper",func:r}],rm.prototype.clone=function(){var e=new rm(this.__wrapped__);return e.__actions__=iB(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=iB(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=iB(this.__views__),e},rm.prototype.reverse=function(){if(this.__filtered__){var e=new rm(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},rm.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=sN(e),i=t<0,n=r?e.length:0,s=function(e,t,r){for(var i=-1,n=r.length;++i<n;){var s=r[i],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=t2(t,e+o);break;case"takeRight":e=t3(e,t-o)}}return{start:e,end:t}}(0,n,this.__views__),o=s.start,a=s.end,c=a-o,u=i?a:o-1,h=this.__iteratees__,l=h.length,f=0,d=t2(c,this.__takeCount__);if(!r||!i&&n==c&&d==c)return iM(e,this.__actions__);var p=[];e:for(;c--&&f<d;){u+=t;
34for(var g=-1,b=e[u];++g<l;){var y=h[g],m=y.iteratee,v=y.type,w=m(b);if(2==v)b=w;else if(!w){if(1==v)continue e;break e}}p[f++]=b}return p},rp.prototype.at=ss,rp.prototype.chain=function(){return si(this)},rp.prototype.commit=function(){return new ry(this.value(),this.__chain__)},rp.prototype.next=function(){this.__values__===r&&(this.__values__=s2(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}},rp.prototype.plant=function(e){for(var t,i=this;i instanceof rb;){var n=nU(i);n.__index__=0,n.__values__=r,t?s.__wrapped__=n:t=n;var s=n;i=i.__wrapped__}return s.__wrapped__=e,t},rp.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof rm){var t=e;return this.__actions__.length&&(t=new rm(this)),(t=t.reverse()).__actions__.push({func:sn,args:[n1],thisArg:r}),new ry(t,this.__chain__)}return this.thru(n1)},rp.prototype.toJSON=rp.prototype.valueOf=rp.prototype.value=function(){return iM(this.__wrapped__,this.__actions__)},rp.prototype.first=rp.prototype.head,e6&&(rp.prototype[e6]=function(){return this}),rp}();e6?((e6.exports=tW)._=tW,e8._=tW):e2._=tW}).call(sf)}(sd,sd.exports);var sp=Object.defineProperty,sg=Object.defineProperties,sb=Object.getOwnPropertyDescriptors,sy=Object.getOwnPropertySymbols,sm=Object.prototype.hasOwnProperty,sv=Object.prototype.propertyIsEnumerable,sw=(e,t,r)=>t in e?sp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sD=(e,t)=>{for(var r in t||(t={}))sm.call(t,r)&&sw(e,r,t[r]);if(sy)for(var r of sy(t))sv.call(t,r)&&sw(e,r,t[r]);return e},s_=(e,t)=>sg(e,sb(t));function sE(e,t,r){var i;let n=(0,w.DQe)(e);return(null==(i=t.rpcMap)?void 0:i[n.reference])||`${sc}?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function sS(e){return e.includes(":")?e.split(":")[1]:e}function sI(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function sC(e={},t={}){let r=sA(e),i=sA(t);return sd.exports.merge(r,i)}function sA(e){var t,r,i,n;let s={};if(!(0,w.L5o)(e))return s;for(let[o,a]of Object.entries(e)){let e=(0,w.gpE)(o)?[o]:a.chains,c=a.methods||[],u=a.events||[],h=a.rpcMap||{},l=(0,w.Maj)(o);s[l]=s_(sD(sD({},s[l]),a),{chains:(0,w.eGA)(e,null==(t=s[l])?void 0:t.chains),methods:(0,w.eGA)(c,null==(r=s[l])?void 0:r.methods),events:(0,w.eGA)(u,null==(i=s[l])?void 0:i.events),rpcMap:sD(sD({},h),null==(n=s[l])?void 0:n.rpcMap)})}return s}function sM(e){return e.includes(":")?e.split(":")[2]:e}function sx(e){let t={};for(let[r,i]of Object.entries(e)){let e=i.methods||[],n=i.events||[],s=i.accounts||[],o=(0,w.gpE)(r)?[r]:i.chains?i.chains:sI(i.accounts);t[r]={chains:o,methods:e,events:n,accounts:s}}return t}function sP(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let sO={},sT=e=>sO[e],sR=(e,t)=>{sO[e]=t};class sk{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${e}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let i=sS(t);e[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}var sN=Object.defineProperty,sL=Object.defineProperties,sj=Object.getOwnPropertyDescriptors,sq=Object.getOwnPropertySymbols,sz=Object.prototype.hasOwnProperty,sU=Object.prototype.propertyIsEnumerable,sF=(e,t,r)=>t in e?sN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sB=(e,t)=>{for(var r in t||(t={}))sz.call(t,r)&&sF(e,r,t[r]);if(sq)for(var r of sq(t))sU.call(t,r)&&sF(e,r,t[r]);return e},s$=(e,t)=>
34sL(e,sj(t));class sH{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(sl,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let r=t||sE(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let i=parseInt(sS(t));e[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){let e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,r;let i=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",n=parseInt(i=i.startsWith("0x")?i:`0x${i}`,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${n}`);else throw Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,r,i;let n=null==(r=null==(t=e.request)?void 0:t.params)?void 0:r[0];if(!n)throw Error("Missing address parameter in `wallet_getCapabilities` request");let s=this.client.session.get(e.topic),o=(null==(i=s?.sessionProperties)?void 0:i.capabilities)||{};if(null!=o&&o[n])return o?.[n];let a=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:s$(sB({},s.sessionProperties||{}),{capabilities:s$(sB({},o||{}),{[n]:a})})})}catch(e){console.warn("Failed to update session with capabilities",e)}return a}
34async getCallStatus(e){var t,r;let i=this.client.session.get(e.topic),n=null==(t=i.sessionProperties)?void 0:t.bundler_name;if(n){let t=this.getBundlerUrl(e.chainId,n);try{return await this.getUserOperationReceipt(t,e)}catch(e){console.warn("Failed to fetch call status from bundler",e,t)}}let s=null==(r=i.sessionProperties)?void 0:r.bundler_url;if(s)try{return await this.getUserOperationReceipt(s,e)}catch(e){console.warn("Failed to fetch call status from custom bundler",e,s)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var r;let i=new URL(e),n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(rr("eth_getUserOperationReceipt",[null==(r=t.request.params)?void 0:r[0]]))});if(!n.ok)throw Error(`Failed to fetch user operation receipt - ${n.status}`);return await n.json()}getBundlerUrl(e,t){return`${sh}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class sV{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let i=sS(t);e[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}class sK{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let i=sS(t);e[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}class sW{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){let r=t||sE(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(sl,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new rb(new ss(r,sT("disableProviderPing")))}}class sJ{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let r=this.getCardanoRPCUrl(t),i=sS(t);e[i]=this.createHttpProvider(i,r)}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){let t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||this.getCardanoRPCUrl(e);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}class sG{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let i=sS(t);e[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}class sY{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let i=sS(t);e[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}class sQ{constructor(e){this.name="near",this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){let r=t||sE(`${this.name}:${e}`,this.namespace);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(sl,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace);return typeof r>"u"?void 0:new rb(new ss(r,sT("disableProviderPing")))}}class sX{constructor(e){this.name=su,this.namespace=e.namespace,this.events=sT("events"),this.client=sT("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(sl,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;let r={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e
34=>{let t=(0,w.DQe)(e);r[`${t.namespace}:${t.reference}`]=this.createHttpProvider(e)}),r}getHttpProvider(e){let t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||sE(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new rb(new ss(r,sT("disableProviderPing")))}}var sZ=Object.defineProperty,s0=Object.defineProperties,s1=Object.getOwnPropertyDescriptors,s3=Object.getOwnPropertySymbols,s2=Object.prototype.hasOwnProperty,s8=Object.prototype.propertyIsEnumerable,s6=(e,t,r)=>t in e?sZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,s5=(e,t)=>{for(var r in t||(t={}))s2.call(t,r)&&s6(e,r,t[r]);if(s3)for(var r of s3(t))s8.call(t,r)&&s6(e,r,t[r]);return e},s4=(e,t)=>s0(e,s1(t));class s9{constructor(e){this.events=new(v()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:ei()(ew({level:e?.logger||so})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new s9(e);return await t.initialize(),t}async request(e,t,r){let[i,n]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(i).request({request:s5({},e),chainId:`${i}:${n}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,i){let n=new Date().getTime();this.request(e,r,i).then(e=>t(null,ri(n,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:(0,w.D6H)("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();let{uri:r,response:i}=await this.client.authenticate(e,t);r&&(this.uri=r,this.events.emit("display_uri",r));let n=await i();if(this.session=n.session,this.session){let e=sx(this.session.namespaces);this.namespaces=sC(this.namespaces,e),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw Error("Max auto pairing attempts reached");let{uri:r,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await i().then(e=>{this.session=e;let t=sx(e.namespaces);this.namespaces=sC(this.namespaces,t),this.persist("namespaces",this.namespaces)}).catch(e=>{if(e.message!==nO)throw e;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[r,i]=this.validateChain(e),n=this.getProvider(r);n.name===su?n.setDefaultChain(`${r}:${i}`,t):n.setDefaultChain(i,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if((0,w.qt8)(t)){for(let r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){let e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await n3.init({core:this.providerOpts.core,logger:this.providerOpts.logger||so,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>(0,w.Maj)(e)))];sR("client",this.client),sR("events",this.events),sR("disableProviderPing",this.disableProviderPing),e.forEach(e
34=>{if(!this.session)return;let t=function(e,t){let r=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!r.length)return[];let i=[];return r.forEach(e=>{let r=t.namespaces[e].accounts;i.push(...r)}),i}(e,this.session),r=sI(t),i=s4(s5({},sC(this.namespaces,this.optionalNamespaces)[e]),{accounts:t,chains:r});switch(e){case"eip155":this.rpcProviders[e]=new sH({namespace:i});break;case"algorand":this.rpcProviders[e]=new sW({namespace:i});break;case"solana":this.rpcProviders[e]=new sV({namespace:i});break;case"cosmos":this.rpcProviders[e]=new sK({namespace:i});break;case"polkadot":this.rpcProviders[e]=new sk({namespace:i});break;case"cip34":this.rpcProviders[e]=new sJ({namespace:i});break;case"elrond":this.rpcProviders[e]=new sG({namespace:i});break;case"multiversx":this.rpcProviders[e]=new sY({namespace:i});break;case"near":this.rpcProviders[e]=new sQ({namespace:i});break;default:this.rpcProviders[su]?this.rpcProviders[su].updateNamespace(i):this.rpcProviders[su]=new sX({namespace:i})}})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{let{params:t}=e,{event:r}=t;if("accountsChanged"===r.name){let e=r.data;e&&(0,w.qt8)(e)&&this.events.emit("accountsChanged",e.map(sM))}else if("chainChanged"===r.name){let e=t.chainId,r=t.event.data,i=(0,w.Maj)(e),n=sP(e)!==sP(r)?`${i}:${sP(r)}`:e;this.onChainChanged(n)}else this.events.emit(r.name,r.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var r;let{namespaces:i}=t,n=null==(r=this.client)?void 0:r.session.get(e);this.session=s4(s5({},n),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",s4(s5({},(0,w.D6H)("USER_DISCONNECTED")),{data:e.topic}))}),this.on(sl,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[su]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t,optionalNamespaces:r,sessionProperties:i}=e;t&&Object.keys(t).length&&(this.namespaces=t),r&&Object.keys(r).length&&(this.optionalNamespaces=r),this.sessionProperties=i,this.persist("namespaces",t),this.persist("optionalNamespaces",r)}validateChain(e){let[t,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map(e=>(0,w.Maj)(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];let i=(0,w.Maj)(Object.keys(this.namespaces)[0]),n=this.rpcProviders[i].getDefaultChain();return[i,n]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;let[r,i]=this.validateChain(e);i&&(t||this.getProvider(r).setDefaultChain(i),this.namespaces[r]?this.namespaces[r].defaultChain=i:this.namespaces[`${r}:${i}`]?this.namespaces[`${r}:${i}`].defaultChain=i:this.namespaces[`${r}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${sa}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${sa}/${e}`)}}let s7=["eth_sendTransaction","personal_sign"],oe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],ot=["chainChanged","accountsChanged"],or=["chainChanged","accountsChanged","message","disconnect","connect"];var oi=Object.defineProperty,on=Object.defineProperties,os=Object.getOwnPropertyDescriptors,oo=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,oc=Object.prototype.propertyIsEnumerable,ou=(e,t,r)=>t in e?oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oh=(e,t)=>{for(var r in t||(t={}))oa.call(t,r)&&ou(e,r,t[r]);if(oo)for(var r of oo(t))oc.call(t,r)&&ou(e,r,t[r]);return e},ol=(e,t)=>on(e,os(t));function of(e){return Number(e[0].split(":")[1])}function od(e){return`0x${e.toString(16)}`}class op{constructor(){this.events=new m.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){let t=new op;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,r){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),r)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);let{required:t,optional:r}=function(e){let{chains:t,optionalChains:r,methods:i,optionalMethods:n,events:s,optionalEvents:o,rpcMap:a}=e;if(!(0,w.qt8)(t))throw Error("Invalid chains");let c={chains:t,methods:i||s7,events:s||ot,rpcMap:oh({},t.length?{[of(t)]:a[of(t)]}:{})},u=s?.filter(e=>!ot.includes(e)),h=i?.filter(e=>!s7.includes(e));if(!r&&!o&&!n&&!(null!=u&&u.length)&&!(null!=h&&h.length))return{required:t.length?c:void 0};let l={chains:[...new Set(u?.length&&h?.length||!r?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(null!=n&&n.length?n:oe))],events:[...new Set(c.events.concat(null!=o&&o.length?o:or))],rpcMap:a};return{required:t.length?c:void 0,optional:r.length?l:void 0}}(this.rpc);try{let i=await new Promise(async(i,n)=>{var s;this.rpc.showQrModal&&(null==(s=this.modal)||s.subscribeModal(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),n(Error("Connection request reset. Please try again.")))})),await this.signer.connect(ol(oh({namespaces:oh({},t&&{[this.namespace]:t})},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:e?.pairingTopic})).then(e=>{i(e)}).catch(e=>{n(Error(e.message))})});if(!i)return;let n=(0,w.guN)(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:od(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{let r=await new Promise(async(r,i)=>{var n;this.rpc.showQrModal&&(null==(n=this.modal)||n.subscribeModal(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),i(Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(ol(oh({},e),{chains:this.rpc.chains}),t).then(e=>{r(e)}).catch(e=>{i(Error(e.message))})}),i=r.session;if(i){let e=(0,w.guN)(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:e),this.setAccounts(e),this.events.emit("connect",{chainId:od(this.chainId)})}return r}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{let{params:t}=e,{event:r}=t;
34"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{let t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",od(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",ol(oh({},(0,w.D6H)("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,r;this.rpc.showQrModal&&(null==(t=this.modal)||t.closeModal(),null==(r=this.modal)||r.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){let t=e.filter(e=>this.isCompatibleChainId(e)).map(e=>this.parseChainId(e));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",od(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){let t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){let[t,r,i]=e.split(":");return{chainId:`${t}:${r}`,address:i}}setAccounts(e){this.accounts=e.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,r;let i=null!=(t=e?.chains)?t:[],n=null!=(r=e?.optionalChains)?r:[],s=i.concat(n);if(!s.length)throw Error("No chains specified in either `chains` or `optionalChains`");let o=i.length?e?.methods||s7:[],a=i.length?e?.events||ot:[],c=e?.optionalMethods||[],u=e?.optionalEvents||[],h=e?.rpcMap||this.buildRpcMap(s,e.projectId),l=e?.qrModalOptions||void 0;return{chains:i?.map(e=>this.formatChainId(e)),optionalChains:n.map(e=>this.formatChainId(e)),methods:o,events:a,optionalMethods:c,optionalEvents:u,rpcMap:h,showQrModal:!!(null!=e&&e.showQrModal),qrModalOptions:l,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){let r={};return e.forEach(e=>{r[e]=this.getRpcUrl(e,t)}),r}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?of(this.rpc.chains):of(this.rpc.optionalChains),this.signer=await s9.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{let{WalletConnectModal:t}=await r.e(4978).then(r.bind(r,44978));e=t}catch{throw Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(oh({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(e){throw this.signer.logger.error(e),Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;let{chains:t,optionalChains:r,rpcMap:i}=e;t&&(0,w.qt8)(t)&&(this.rpc.chains=t.map(e=>this.formatChainId(e)),t.forEach(e=>{this.rpc.rpcMap[e]=i?.[e]||this.getRpcUrl(e)})),r&&(0,w.qt8)(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map(e=>this.formatChainId(e)),r.forEach(e=>{this.rpc.rpcMap[e]=i?.[e]||this.getRpcUrl(e)}))}getRpcUrl(e,t){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[e])||`https://rpc.walletconnect.org/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{let e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map(e=>this.parseAccount(e))}}let og=op},5108:function(e,t){var r="undefined"!=typeof self?self:this,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
34]"],n=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function u(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function l(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var e,t,r,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=s(e),t=o(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[s(e)]},c.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},c.prototype.set=function(e,t){this.map[s(e)]=o(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,i,n=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new c(t.headers)),this.method=(i=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}}),t}function y(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];y.redirect=function(e,t){if(-1===m.indexOf(t))throw RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},e.DOMException=i.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(r,i){return new Promise(function(n,s){var o=new g(r,i);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEac
34h(function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();t.append(i,n)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),n(new y("response"in a?a.response:a.responseText,r))},a.onerror=function(){s(TypeError("Network request failed"))},a.ontimeout=function(){s(TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}v.polyfill=!0,i.fetch||(i.fetch=v,i.Headers=c,i.Request=g,i.Response=y),e.Headers=c,e.Request=g,e.Response=y,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill,(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},16854:function(e){"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},21086:function(e,t,r){"use strict";r.d(t,{iO:function(){return i}});let i={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}}},77674:function(e,t,r){"use strict";r.d(t,{decodeJWT:function(){return e9},encodeIss:function(){return e4},generateKeyPair:function(){return e7},signJWT:function(){return te}});var i={};r.r(i),r.d(i,{identity:function(){return F}});var n={};r.r(n),r.d(n,{base2:function(){return B}});var s={};r.r(s),r.d(s,{base8:function(){return $}});var o={};r.r(o),r.d(o,{base10:function(){return H}});var a={};r.r(a),r.d(a,{base16:function(){return V},base16upper:function(){return K}});var c={};r.r(c),r.d(c,{base32:function(){return W},base32hex:function(){return Q},base32hexpad:function(){return Z},base32hexpadupper:function(){return ee},base32hexupper:function(){return X},base32pad:function(){return G},base32padupper:function(){return Y},base32upper:function(){return J},base32z:function(){return et}});var u={};r.r(u),r.d(u,{base36:function(){return er},base36upper:function(){return ei}});var h={};r.r(h),r.d(h,{base58btc:function(){return en},base58flickr:function(){return es}});var l={};r.r(l),r.d(l,{base64:function(){return eo},base64pad:function(){return ea},base64url:function(){return ec},base64urlpad:function(){return eu}});var f={};r.r(f),r.d(f,{base256emoji:function(){return ed}});var d={};r.r(d),r.d(d,{sha256:function(){return eC},sha512:function(){return eA}});var p={};r.r(p),r.d(p,{identity:function(){return eM}});var g={};r.r(g),r.d(g,{code:function(){return eP},decode:function(){return eT},encode:function(){return eO},name:function(){return ex}});var b={};r.r(b),r.d(b,{code:function(){return eL},decode:function(){return eq},encode:function(){return ej},name:function(){return eN}});var y=r(48280),m=r(78539),v=r(40537);let w="base64url",D="utf8",_="utf8",E="base58btc";function S(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function I(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?S(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}var C=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");
34for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=n}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===c;)i++,t++;for(var s=(e.length-t)*u+1>>>0,o=new Uint8Array(s);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var l=0,f=s-1;(0!==h||l<n)&&-1!==f;f--,l++)h+=a*o[f]>>>0,o[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");n=l,t++}if(" "!==e[t]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*h+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=t[n],f=0,d=o-1;(0!==l||f<i)&&-1!==d;d--,f++)l+=256*u[d]>>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=c.repeat(r);p<o;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:l,decode:function(e){var r=l(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let A=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},M=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},x=e=>new TextEncoder().encode(e),P=e=>new TextDecoder().decode(e);class O{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class T{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return k(this,e)}}class R{constructor(e){this.decoders=e}or(e){return k(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let k=(e,t)=>new R({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});
34class N{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new O(e,t,r),this.decoder=new T(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let L=({name:e,prefix:t,encode:r,decode:i})=>new N(e,t,r,i),j=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=C(r,t);return L({prefix:e,name:t,encode:i,decode:e=>M(n(e))})},q=(e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,c=0,u=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${i} character`);c=c<<r|s,(a+=r)>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return o},z=(e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,s="",o=0,a=0;for(let i=0;i<e.length;++i)for(a=a<<8|e[i],o+=8;o>r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s},U=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>L({prefix:t,name:e,encode:e=>z(e,i,r),decode:t=>q(t,i,r,e)}),F=L({prefix:"\0",name:"identity",encode:e=>P(e),decode:e=>x(e)}),B=U({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),$=U({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),H=j({prefix:"9",name:"base10",alphabet:"0123456789"}),V=U({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),K=U({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),W=U({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),J=U({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),G=U({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Y=U({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Q=U({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),X=U({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Z=U({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ee=U({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),et=U({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),er=j({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ei=j({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),en=j({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),es=j({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),eo=U({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ea=U({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ec=U({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),eu=U({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),eh=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),el=eh.reduce((e,t,r)=>(e[r]=t,e),[]),ef=eh.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),ed=L({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
34e+=el[t],"")},decode:function(e){let t=[];for(let r of e){let e=ef[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var ep=function e(t,r,i){r=r||[];for(var n=i=i||0;t>=2147483648;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},eg=function e(t,r){var i,n=0,r=r||0,s=0,o=r,a=t.length;do{if(o>=a)throw e.bytes=0,RangeError("Could not decode varint");i=t[o++],n+=s<28?(127&i)<<s:(127&i)*Math.pow(2,s),s+=7}while(i>=128);return e.bytes=o-r,n};let eb=(e,t=0)=>[eg(e,t),eg.bytes],ey=(e,t,r=0)=>(ep(e,t,r),t),em=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,ev=(e,t)=>{let r=t.byteLength,i=em(e),n=i+em(r),s=new Uint8Array(n+r);return ey(e,s,0),ey(r,s,i),s.set(t,n),new e_(e,r,t,s)},ew=e=>{let t=M(e),[r,i]=eb(t),[n,s]=eb(t.subarray(i)),o=t.subarray(i+s);if(o.byteLength!==n)throw Error("Incorrect length");return new e_(r,n,o,t)},eD=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&A(e.bytes,t.bytes);
34class e_{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let eE=({name:e,code:t,encode:r})=>new eS(e,t,r);class eS{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ev(this.code,t):t.then(e=>ev(this.code,e))}throw Error("Unknown type, must be binary type")}}let eI=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),eC=eE({name:"sha2-256",code:18,encode:eI("SHA-256")}),eA=eE({name:"sha2-512",code:19,encode:eI("SHA-512")}),eM={code:0,name:"identity",encode:M,digest:e=>ev(0,M(e))},ex="raw",eP=85,eO=e=>M(e),eT=e=>M(e),eR=new TextEncoder,ek=new TextDecoder,eN="json",eL=512,ej=e=>eR.encode(JSON.stringify(e)),eq=e=>JSON.parse(ek.decode(e));class ez{constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:eJ,byteLength:eJ,code:eW,version:eW,multihash:eW,bytes:eW,_baseCache:eJ,asCID:eJ})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==e$)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==eH)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return ez.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=ev(e,t);return ez.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&eD(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:i}=this;return 0===r?eF(t,i,e||en.encoder):eB(t,i,e||W.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return eG(/^0\.0/,eY),!!(e&&(e[eK]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof ez)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:i,bytes:n}=e;return new ez(t,r,i,n||eV(t,r,i.bytes))}if(null==e||!0!==e[eK])return null;{let{version:t,multihash:r,code:i}=e,n=ew(r);return ez.create(t,i,n)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===e$)return new ez(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${e$}) block encoding`);case 1:{let i=eV(e,t,r.bytes);return new ez(e,t,r,i)}default:throw Error("Invalid version")}}static createV0(e){return ez.create(0,e$,e)}static createV1(e,t){return ez.create(1,e,t)}static decode(e){let[t,r]=ez.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=ez.inspectBytes(e),r=t.size-t.multihashSize,i=M(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw Error("Incorrect length");let n=i.subarray(t.multihashSize-t.digestSize),s=new e_(t.multihashCode,t.digestSize,n,i);return[0===t.version?ez.createV0(s):ez.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,i]=eb(e.subarray(t));return t+=i,r},i=r(),n=e$;if(18===i?(i=0,t=0):1===i&&(n=r()),0!==i&&1!==i)throw RangeError(`Invalid CID version ${i}`);let s=t,o=r(),a=r(),c=t+a;return{version:i,codec:n,multihashCode:o,digestSize:a,multihashSize:c-s,size:c}}static parse(e,t){let[r,i]=eU(e,t),n=ez.decode(i);return n._baseCache.set(r,e),n}}let eU=(e,t)=>{switch(e[0]){case"Q":return[en.prefix,(t||en).decode(`${en.prefix}${e}`)];case en.prefix:return[en.prefix,(t||en).decode(e)];case W.prefix:return[W.prefix,(t||W).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},eF=(e,t,r)=>{let{prefix:i}=r;if(i!==en.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=t.get(i);if(null!=n)return n;{let n=r.encode(e).slice(1);return t.set(i,n),n}},eB=(e,t,r)=>{let{prefix:i}=r,n=t.get(i);if(null!=n)return n;{let n=r.encode(e);return t.set(i,n),n}},e$=112,eH=18,eV=(e,t,r)=>{let i=em(e),n=i+em(t),s=new Uint8Array(n+r.byteLength);return ey(e,s,0),ey(t,s,i),s.set(r,n),s}
34,eK=Symbol.for("@ipld/js-cid/CID"),eW={writable:!1,configurable:!1,enumerable:!0},eJ={writable:!1,enumerable:!1,configurable:!1},eG=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},eY=`CID.isCID(v) is deprecated and will be removed in the next major release.
35Following code pattern:
36
37if (CID.isCID(value)) {
38  doSomethingWithCID(value)
39}
40
41Is replaced with:
42
43const cid = CID.asCID(value)
44if (cid) {
45  // Make sure to use cid instead of value
46  doSomethingWithCID(cid)
47}
48`,eQ={...i,...n,...s,...o,...a,...c,...u,...h,...l,...f};function eX(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...d,...p});let eZ=eX("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),e0=eX("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=I((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),e1={utf8:eZ,"utf-8":eZ,hex:eQ.base16,latin1:e0,ascii:e0,binary:e0,...eQ};function e3(e,t="utf8"){let r=e1[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function e2(e,t="utf8"){let r=e1[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?S(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}var e8=r(80577);function e6(e){return(0,e8.D)(e3(e2(e,w),D))}function e5(e){return e3(e2((0,e8.u)(e),D),w)}function e4(e){return["did","key","z"+e3(function(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=I(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return S(r)}([e2("K36",E),e]),E)].join(":")}function e9(e){let t=e.split("."),r=e6(t[0]);return{header:r,payload:e6(t[1]),signature:e2(t[2],w),data:e2(t.slice(0,2).join("."),_)}}function e7(e=(0,m.randomBytes)(32)){return y._w(e)}async function te(e,t,r,i,n=(0,v.fromMiliseconds)(Date.now())){var s,o;let a={alg:"EdDSA",typ:"JWT"},c={iss:e4(i.publicKey),sub:e,aud:t,iat:n,exp:n+r},u=e2([e5((s={header:a,payload:c}).header),e5(s.payload)].join("."),_);return[e5((o={header:a,payload:c,signature:y.Xx(i.secretKey,u)}).header),e5(o.payload),e3(o.signature,w)].join(".")}r(48544)},48544:function(){},80577:function(e,t,r){"use strict";r.d(t,{D:function(){return s},u:function(){return o}});let i=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),n=e=>JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t);function s(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return n(e)}catch(t){return e}}function o(e){return"string"==typeof e?e:i(e)||""}},70213:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(62494);i.__exportStar(r(12658),t),i.__exportStar(r(75127),t)},12658:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},75127:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_W
48EEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},40537:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(62494);i.__exportStar(r(78627),t),i.__exportStar(r(59854),t),i.__exportStar(r(3205),t),i.__exportStar(r(70213),t)},3205:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(62494).__exportStar(r(71146),t)},71146:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},68353:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let i=r(70213);t.toMiliseconds=function(e){return e*i.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/i.ONE_THOUSAND)}},86029:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},78627:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(62494);i.__exportStar(r(86029),t),i.__exportStar(r(68353),t)},59854:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},62494:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return s},__asyncDelegator:function(){return w},__asyncGenerator:function(){return v},__asyncValues:function(){return D},__await:function(){return m},__awaiter:function(){return h},__classPrivateFieldGet:function(){return I},__classPrivateFieldSet:function(){return C},__createBinding:function(){return f},__decorate:function(){return a},__exportStar:function(){return d},__extends:function(){return n},__generator:function(){return l},__importDefault:function(){return S},__importStar:function(){return E}
vendor: 5,306 bytes, line 48
48,__makeTemplateObject:function(){return _},__metadata:function(){return u},__param:function(){return c},__read:function(){return g},__rest:function(){return o},__spread:function(){return b},__spreadArrays:function(){return y},__values:function(){return p}});var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}function a(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function c(e,t){return function(r,i){t(r,i,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}c((i=i.apply(e,t||[])).next())})}function l(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function f(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}function d(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var i=Array(e),n=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(e){n[e]&&(i[e]=function(t){return new Promise(function(r,i){s.push([e,t,r,i])>1||a(e,t)})})}function a(e,t){try{var r;(r=n[e](t)).value instanceof m?Promise.resolve(r.value.v).then(c,u):h(s[0][2],r)}catch(e){h(s[0][3],e)}}function c(e){a("next",e)}function u(e){a("throw",e)}function h(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},i("next"),i("throw",function(e){throw e}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:m(e[i](t)),done:"return"===i}:n?n(t):t}:n}}function D(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){!function(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r})},t)}(i,n,(t=e[r](t)).done,t.value)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
48function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},76454:function(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){let t=r(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},3897:function(e,t,r){"use strict";t.D=void 0;let i=r(76454);t.D=function(){let e,t,r;try{e=i.getDocumentOrThrow(),t=i.getLocationOrThrow()}catch(e){return null}function n(...t){let r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){let i=r[e],n=["itemprop","property","name"].map(e=>i.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(n.length&&n){let e=i.getAttribute("content");if(e)return e}}return""}let s=((r=n("name","og:site_name","og:title","twitter:title"))||(r=e.title),r),o=n("description","og:description","twitter:description","keywords");return{description:o,url:t.origin,icons:function(){let r=e.getElementsByTagName("link"),i=[];for(let e=0;e<r.length;e++){let n=r[e],s=n.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){let e=n.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let i=t.pathname.split("/");i.pop(),r+=i.join("/")+"/"+e}i.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;i.push(r)}else i.push(e)}}}return i}(),name:s}}},44373:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}
vendor: 4,182 bytes, line 48
48"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{u="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46601).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o<s;o++){var a=e.charCodeAt(o)-48;n*=i,a>=49?n+=a-49+10:a>=17?n+=a-17+10:n+=a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return 0>e.cmp(t)?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},s.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},s.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=e.length-1,n=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[n]|=s<<a&67108863,this.words[n+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(o=0,n=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[n]|=s<<a&67108863,this.words[n+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var s=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,u=0,h=r;h<a;h+=i)u=c(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var l=1;for(u=c(e,h,e.length,t),h=0;h<o;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u,h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,143489
vendor: 6,079 bytes, line 48
4807,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,c=o/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var h=c>>>26,l=67108863&c,f=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=f;d++){var p=u-d|0;h+=(o=(n=0|e.words[p])*(s=0|t.words[d])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}s.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],c=((a<<n|s)&16777215).toString(16);r=0!=(s=a>>>24-n&16777215)||o!==this.length-1?h[6-c.length]+c+r:c+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?g+r:h[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==u),this.toArrayLike(u,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n,s,o=this.byteLength(),a=r||Math.max(1,o);i(o<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var c=new e(a),u=this.clone();if("le"===t){for(s=0;!u.isZero();s++)n=u.andln(255),u.iushrn(8),c[s]=n;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-o;s++)c[s]=0;for(s=0;!u.isZero();s++)n=u.andln(255),u.iushrn(8),c[a-s-1]=n}return c},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},s.prototype.ior=function(e){return i((this.negative|e.negative)==0),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},s.prototype.iand=function(e){return i((this.negative|e.negative)==0),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},s.prototype.ixor=function(e){return i((this.negative|e.negative)==0),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<<n:this.words[r]=this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(e){if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,s=0;s<i.length;s++)t=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&t,n=t>>>26;for(;0!==n&&s<r.length;s++)t=(0|r.words[s])+n,this.words[s]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;
vendor: 11,120 bytes, line 48
48var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var s=0,o=0;o<r.length;o++)s=(i=(0|t.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&i;for(;0!==s&&o<t.length;o++)s=(i=(0|t.words[o])+s)>>26,this.words[o]=67108863&i;if(0===s&&o<t.length&&t!==this)for(;o<t.length;o++)this.words[o]=t.words[o];return this.length=Math.max(this.length,o),t!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var i,n,s,o=e.words,a=t.words,c=r.words,u=0,h=0|o[0],l=8191&h,f=h>>>13,d=0|o[1],p=8191&d,g=d>>>13,b=0|o[2],y=8191&b,m=b>>>13,v=0|o[3],w=8191&v,D=v>>>13,_=0|o[4],E=8191&_,S=_>>>13,I=0|o[5],C=8191&I,A=I>>>13,M=0|o[6],x=8191&M,P=M>>>13,O=0|o[7],T=8191&O,R=O>>>13,k=0|o[8],N=8191&k,L=k>>>13,j=0|o[9],q=8191&j,z=j>>>13,U=0|a[0],F=8191&U,B=U>>>13,$=0|a[1],H=8191&$,V=$>>>13,K=0|a[2],W=8191&K,J=K>>>13,G=0|a[3],Y=8191&G,Q=G>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,et=0|a[5],er=8191&et,ei=et>>>13,en=0|a[6],es=8191&en,eo=en>>>13,ea=0|a[7],ec=8191&ea,eu=ea>>>13,eh=0|a[8],el=8191&eh,ef=eh>>>13,ed=0|a[9],ep=8191&ed,eg=ed>>>13;r.negative=e.negative^t.negative,r.length=19;var eb=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,B))+Math.imul(f,F)|0))<<13)|0;u=((s=Math.imul(f,B))+(n>>>13)|0)+(eb>>>26)|0,eb&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,B))+Math.imul(g,F)|0,s=Math.imul(g,B);var ey=(u+(i=i+Math.imul(l,H)|0)|0)+((8191&(n=(n=n+Math.imul(l,V)|0)+Math.imul(f,H)|0))<<13)|0;u=((s=s+Math.imul(f,V)|0)+(n>>>13)|0)+(ey>>>26)|0,ey&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,B))+Math.imul(m,F)|0,s=Math.imul(m,B),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,V)|0;var em=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(f,W)|0))<<13)|0;u=((s=s+Math.imul(f,J)|0)+(n>>>13)|0)+(em>>>26)|0,em&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,B))+Math.imul(D,F)|0,s=Math.imul(D,B),i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,V)|0)+Math.imul(m,H)|0,s=s+Math.imul(m,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,J)|0;var ev=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,Q)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,Q)|0)+(n>>>13)|0)+(ev>>>26)|0,ev&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,B))+Math.imul(S,F)|0,s=Math.imul(S,B),i=i+Math.imul(w,H)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(D,H)|0,s=s+Math.imul(D,V)|0,i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,J)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Q)|0;var ew=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(f,Z)|0))<<13)|0;u=((s=s+Math.imul(f,ee)|0)+(n>>>13)|0)+(ew>>>26)|0,ew&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,B))+Math.imul(A,F)|0,s=Math.imul(A,B),i=i+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,J)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Q)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,ee)|0;var eD=(u+(i=i+Math.imul(l,er)|0)|0)+((8191&(n=(n=n+Math.imul(l,ei)|0)+Math.imul(f,er)|0))<<13)|0;u=((s=s+Math.imul(f,ei)|0)+(n>>>13)|0)+(eD>>>26)|0,eD&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,B))+Math.imul(P,F)|0,s=Math.imul(P,B),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,W)|0,s=s+Math.imul(S,J)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(D,Y)|0,s=s+Math.imul(D,Q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(m,Z)|0,s=s+Math.imul(m,ee)|0,i=i+Math.imul(p,er)|0,n=(n=n+Math.imul(p,ei)|0)+Math.imul(g,er)|0,s=s+Math.imul(g,ei)|0;var e_=(u+(i=i+Math.imul(l,es)|0)|0)+((8191&(n=(n=n+Math.imul(l,eo)|0)+Math.imul(f,es)|0))<<13)|0;u=((s=s+Math.imul(f,eo)|0)+(n>>>13)|0)+(e_>>>26)|0,e_&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,B))+Math.imul(R,F)|0,s=Math.imul(R,B),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(P,H)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,J)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Q)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,Q)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(D,Z)|0,s=s+Math.imul(D,ee)|0,i=i+Math.imul(y,er)|0,n=(n=n+Math.imul(y,ei)|0)+Math.imul(m,er)|0,s=s+Math.imul(m,ei)|0,i=i+Math.imul(p,es)|0,n=(n=n+Math.imul(p,eo)|0)+Math.imul(g,es)|0,s=s+Math.imul(g,eo)|0;var eE=(u+(i=i+Math.imul(l,ec)|0)|0)+((8191&(n=(n=n+Math.imul(l,eu)|0)+Math.imul(f,ec)|0))<<13)|0;u=((s=s+Math.imul(f,eu)|0)+(n>>>13)|0)+(eE>>>26)|0,eE&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,B))+Math.imul(L,F)|0,s=Math.imul(L,B),i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(R,H)|0,s=s+Math.imul(R,V)|0,i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,J)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,er)|0,n=(n=n+Math.imul(w,ei)|0)+Math.imul(D,er)|0,s=s+Math.imul(D,ei)|0,i=i+Math.imul(y,es)|0,n=(n=n+Math.imul(y,eo)|0)+Math.imul(m,es)|0,s=s+Math.imul(m,eo)|0,i=i+Math.imul(p,ec)|0,n=(n=n+Math.imul(p,eu)|0)+Math.imul(g,ec)|0,s=s+Math.imul(g,eu)|0;var eS=(u+(i=i+Math.imul(l,el)|0)|0)+((8191&(n=(n=n+Math.imul(l,ef)|0)+Math.imul(f,el)|0))<<13)|0;u=((s=s+Math.imul(f,ef)|0)+(n>>>13)|0)+(eS>>>26)|0,eS&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,B))+Math.imul(z,F)|0,s=Math.imul(z,B),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(L,H)|0,s=s+Math.imul(L,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,J)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,Q)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Q)|0,i=i+Math.imul(C,Z)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(A,Z)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(E,er)|0,n=(n=n+Math.imul(E,ei)|0)+Math.imul(S,er)|0,s=s+Math.imul(S,ei)|0,i=i+Math.imul(w,es)|0,n=(n=n+Math.imul(w,eo)|0)+Math.imul(D,es)|0,s=s+Math.imul(D,eo)|0,i=i+Math.imul(y,ec)|0,n=(n=n+Math.imul(y,eu)|0)+Math.imul(m,ec)|0,s=s+Math.imul(m,eu)|0,i=i+Math.imul(p,el)|0,n=(n=n+Math.imul(p,ef)|0)+Math.imul(g,el)|0,s=s+Math.imul(g,ef)|0;var eI=(u+(i=i+Math.imul(l,ep)|0)|0)+((8191&(n=(n=n+Math.imul(l,eg)|0)+Math.imul(f,ep)|0))<<13)|0;u=((s=s+Math.imul(f,eg)|0)+(n>>>13)|0)+(eI>>>26)|0,eI&=67108863,i=Math.imul(q,H),n=(n=Math.imul(q,V))+Math.imul(z,H)|0,s=Math.imul(z,V),i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(L,W)|0,s=s+Math.imul(L,J)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,Q)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Q)|0,i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(C,er)|0,n=(n=n+Math.imul(C,ei)|0)+Math.imul(A,er)|0,s=s+Math.imul(A,ei)|0,i=i+Math.imul(E,es)|0,n=(n=n+Math.imul(E,eo)|0)+Math.imul(S,es)|0,s=s+Math.imul(S,eo)|0,i=i+Math.imul(w,ec)|0,n=(n=n+Math.imul(w,eu)|0)+Math.imul(D,ec)|0,s=s+Math.imul(D,eu)|0,i=i+Math.imul(y,el)|0,n=(n=n+Math.imul(y,ef)|0)+Math.imul(m,el)|0,s=s+Math.imul(m,ef)|0;var eC=(u+(i=i+Math.imul(p,ep)|0)|0)+((8191&(n=(n=n+Math.imul(p,eg)|0)+Math.imul(g,ep)|0))<<13)|0;u=((s=s+Math.imul(g,eg)|0)+(n>>>13)|0)+(eC>>>26)|0,eC&=67108863,i=Math.imul(q,W),n=(n=Math.imul(q,J))+Math.imul(z,W)|0,s=Math.imul(z,J),i=i+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(L,Y)|0,s=s+Math.imul(L,Q)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(R,Z)|0,s=s+Math.imul(R,ee)|0,i=i+Math.imul(x,er)|0,n=(n=n+Math.imul(x,ei)|0)+Math.imul(P,er)|0,s=s+Math.imul(P,ei)|0,i=i+Math.imul(C,es)|0,n=(n=n+Math.imul(C,eo)|0)+Math.imul(A,es)|0,s=s+Math.imul(A,eo)|0,i=i+Math.imul(E,ec)|0,n=(n=n+Math.imul(E,eu)|0)+Math.imul(S,ec)|0,s=s+Math.imul(S,eu)|0,i=i+Math.imul(w,el)|0,n=(n=n+Math.imul(w,ef)|0)+Math.imul(D,el)|0,s=s+Math.imul(D,ef)|0;var eA=(u+(i=i+Math.imul(y,ep)|0)|0)+((8191&(n=(n=n+Math.imul(y,eg)|0)+Math.imul(m,ep)|0))<<13)|0;u=((s=s+Math.imul(m,eg)|0)+(n>>>13)|0)+(eA>>>26)|0,eA&=67108863,i=Math.imul(q,Y),n=(n=Math.imul(q,Q))+Math.imul(z,Y)|0,s=Math.imul(z,Q),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(L,Z)|0,s=s+Math.imul(L,ee)|0,i=i+Math.imul(T,er)|0,n=(n=n+Math.imul(T,ei)|0)+Math.imul(R,er)|0,s=s+Math.imul(R,ei)|0,i=i+Math.imul(x,es)|0,n=(n=n+Math.imul(x,eo)|0)+Math.imul(P,es)|0,s=s+Math.imul(P,eo)|0,i=i+Math.imul(C,ec)|0,n=(n=n+Math.imul(C,eu)|0)+Math.imul(A,ec)|0,s=s+Math.imul(A,eu)|0,i=i+Math.imul(E,el)|0,n=(n=n+Math.imul(E,ef)|0)+Math.imul(S,el)|0,s=s+Math.imul(S,ef)|0;var eM=(u+(i=i+Math.imul(w,ep)|0)|0)+((8191&(n=(n=n+Math.imul(w,eg)|0)+Math.imul(D,ep)|0))<<13)|0;u=((s=s+Math.imul(D,eg)|0)+(n>>>13)|0)+(eM>>>26)|0,eM&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,ee))+Math.imul(z,Z)|0,s=Math.imul(z,ee),i=i+Math.imul(N,er)|0,n=(n=n+Math.imul(N,ei)|0)+Math.imul(L,er)|0,s=s+Math.imul(L,ei)|0,i=i+Math.imul(T,es)|0,n=(n=n+Math.imul(T,eo)|0)+Math.imul(R,es)|0,s=s+Math.imul(R,eo)|0,i=i+Math.imul(x,ec)|0,n=(n=n+Math.imul(x,eu)|0)+Math.imul(P,ec)|0,s=s+Math.imul(P,eu)|0,i=i+Math.imul(C,el)|0,n=(n=n+Math.imul(C,ef)|0)+Math.imul(A,el)|0,s=s+Math.imul(A,ef)|0;var ex=(u+(i=i+Math.imul(E,ep)|0)|0)+((8191&(n=(n=n+Math.imul(E,eg)|0)+Math.imul(S,ep)|0))<<13)|0;u=((s=s+Math.imul(S,eg)|0)+(n>>>13)|0)+(ex>>>26)|0,ex&=67108863,i=Math.imul(q,er),n=(n=Math.imul(q,ei))+Math.imul(z,er)|0,s=Math.imul(z,ei),i=i+Math.imul(N,es)|0,n=(n=n+Math.imul(N,eo)|0)+Math.imul(L,es)|0,s=s+Math.imul(L,eo)|0,i=i+Math.imul(T,ec)|0,n=(n=n+Math.imul(T,eu)|0)+Math.imul(R,ec)|0,s=s+Math.imul(R,eu)|0,i=i+Math.imul(x,el)|0,n=(n=n+Math.imul(x,ef)|0)+Math.imul(P,el)|0,s=s+Math.imul(P,ef)|0;var eP=(u+(i=i+Math.imul(C,ep)|0)|0)+((8191&(n=(n=n+Math.imul(C,eg)|0)+Math.imul(A,ep)|0))<<13)|0;u=((s=s+Math.imul(A,eg)|0)+(n>>>13)|0)+(eP>>>26)|0,eP&=67108863,i=Math.imul(q,es),n=(n=Math.imul(q,eo))+Math.imul(z,es)|0,s=Math.imul(z,eo),i=i+Math.imul(N,ec)|0,n=(n=n+Math.imul(N,eu)|0)+Math.imul(L,ec)|0,s=s+Math.imul(L,eu)|0,i=i+Math.imul(T,el)|0,n=(n=n+Math.imul(T,ef)|0)+Math.imul(R,el)|0,s=s+Math.imul(R,ef)|0;var eO=(u+(i=i+Math.imul(x,ep)|0)|0)+((8191&(n=(n=n+Math.imul(x,eg)|0)+Math.imul(P,ep)|0))<<13)|0;u=((s=s+Math.imul(P,eg)|0)+(n>>>13)|0)+(eO>>>26)|0,eO&=67108863,i=Math.imul(q,ec),n=(n=Math.imul(q,eu))+Math.imul(z,ec)|0,s=Math.imul(z,eu),i=i+Math.imul(N,el)|0,n=(n=n+Math.imul(N,ef)|0)+Math.imul(L,el)|0,s=s+Math.imul(L,ef)|0;var eT=(u+(i=i+Math.imul(T,ep)|0)|0)+((8191&(n=(n=n+Math.imul(T,eg)|0)+Math.imul(R,ep)|0))<<13)|0;u=((s=s+Math.imul(R,eg)|0)+(n>>>13)|0)+(eT>>>26)|0,eT&=67108863,i=Math.imul(q,el),n=(n=Math.imul(q,ef))+Math.imul(z,el)|0,s=Math.imul(z,ef);var eR=(u+(i=i+Math.imul(N,ep)|0)|0)+((8191&(n=(n=n+Math.imul(N,eg)|0)+Math.imul(L,ep)|0))<<13)|0;u=((s=s+Math.imul(L,eg)|0)+(n>>>13)|0)+(eR>>>26)|0,eR&=67108863;var ek=(u+(i=Math.imul(q,ep))|0)+((8191&(n=(n=Math.imul(q,eg))+Math.imul(z,ep)|0))<<13)|0;return u=((s=Math.imul(z,eg))+(n>>>13)|0)+(ek>>>
vendor: 21,329 bytes, line 48
4826)|0,ek&=67108863,c[0]=eb,c[1]=ey,c[2]=em,c[3]=ev,c[4]=ew,c[5]=eD,c[6]=e_,c[7]=eE,c[8]=eS,c[9]=eI,c[10]=eC,c[11]=eA,c[12]=eM,c[13]=ex,c[14]=eP,c[15]=eO,c[16]=eT,c[17]=eR,c[18]=ek,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){return new b().mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=d),s.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,c=Math.min(s,t.length-1),u=Math.max(0,s-e.length+1);u<=c;u++){var h=s-u,l=(0|e.words[h])*(0|t.words[u]),f=67108863&l;o=o+(l/67108864|0)|0,a=67108863&(f=f+a|0),n+=(o=o+(f>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):g(this,e,t)},b.prototype.makeRBT=function(e){for(var t=Array(e),r=s.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},b.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o<s;o++)i[o]=t[e[o]],n[o]=r[e[o]]},b.prototype.transform=function(e,t,r,i,n,s){this.permute(s,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),h=0;h<n;h+=a)for(var l=c,f=u,d=0;d<o;d++){var p=r[h+d],g=i[h+d],b=r[h+d+o],y=i[h+d+o],m=l*b-f*y;y=l*y+f*b,b=m,r[h+d]=p+b,i[h+d]=g+y,r[h+d+o]=p-b,i[h+d+o]=g-y,d!==a&&(m=c*l-u*f,f=c*f+u*l,l=m)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},b.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var s=0,o=0;o<t;o++)s+=0|e[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===s),i((-8192&s)==0)},b.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),s=this.stub(i),o=Array(i),a=Array(i),c=Array(i),u=Array(i),h=Array(i),l=Array(i),f=r.words;f.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,u,i),this.transform(o,s,a,c,i,n),this.transform(u,s,h,l,i,n);for(var d=0;d<i;d++){var p=a[d]*h[d]-c[d]*l[d];c[d]=a[d]*l[d]+c[d]*h[d],a[d]=p}return this.conjugate(a,c,i),this.transform(a,c,f,s,i,n),this.conjugate(f,s,i),this.normalize13b(f,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},s.prototype.mul=function(e){var t=new s(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=Array(this.length+e.length),g(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,s=(67108863&n)+(67108863&t);t>>=26,t+=(n/67108864|0)+(s>>>26),this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&s,c=(0|this.words[t])-a<<r;this.words[t]=c|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},s.prototype.iushrn=function(e,t,r){i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var n,s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<<s;if(n-=o,n=Math.max(0,n),r){for(var c=0;c<o;c++)r.words[c]=this.words[c];r.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=n);c--){var h=0|this.words[c];this.words[c]=u<<26-s|h>>>s,u=h&a}return r&&0!==u&&(r.words[r.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<<t)},s.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=67108863^67108863>>>t<<t),this.strip())},s.prototype.maskn=function(e){return this.clone().imaskn(e)},s.prototype.iaddn=function(e){return(i("number"==typeof e),i(e<67108864),e<0)?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},s.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},s.prototype.addn=function(e){return this.clone().iaddn(e)},s.prototype.subn=function(e){return this.clone().isubn(e)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(e,t,r){var n,s,o=e.length+r;this._expand(o);var a=0;for(n=0;n<e.length;n++){s=(0|this.words[n+r])+a;var c=(0|e.words[n])*t;s-=67108863&c,a=(s>>26)-(c/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r,i=this.length-e.length,n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var c=n.length-o.length;if("mod"!==t){(r=new s(null)).length=c+1,r.words=Array(r.length);for(var u=0;u<r.length;u++)r.words[u]=0}var h=n.clone()._ishlnsubmul(o,1,c);0===h.negative&&(n=h,r&&(r.words[c]=1));for(var l=c-1;l>=0;l--){var f=(0|n.words[o.length+l])*67108864+(0|n.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(o,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);r&&(r.words[l]=f)}return r&&r.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:r||null,mod:n}},s.prototype.divmod=function(e,t,r){var n,o,a;return(i(!e.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t)},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=67108864%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),c=new s(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;(t.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(h),o.isub(l)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(h),c.isub(l)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(c)):(r.isub(t),a.isub(n),c.isub(o))}return{a:a,b:c,gcd:r.iushln(u)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t,r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new s(1),a=new s(0),c=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,h=1;(r.words[0]&h)==0&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var l=0,f=1;(n.words[0]&f)==0&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);r.cmp(n)>=0?(r.isub(n),o.isub(a)):(n.isub(r),a.isub(o))}return 0>(t=0===r.cmpn(1)?o:a).cmpn(0)&&t.iadd(e),t},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},s.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return -1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},s.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return -1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return -1===this.cmpn(e)},s.prototype.lt=function(e){return -1===this.cmp(e)},s.prototype.lten=function(e){return 0>=this.cmpn(e)},s.prototype.lte=function(e){return 0>=this.cmp(e)},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new E(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function D(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new s(null);return e.words=Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},n(v,m),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var n=e.words[9];for(i=10,t.words[t.length++]=4194303&n;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(4194303&s)<<4|n>>>22,n=s}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(w,m),n(D,m),n(_,m),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=(0|e.words[r])*19+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new D;else if("p25519"===e)t=new _;else throw Error("Unknown prime "+e);return y[e]=t,t},E.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){i((e.negative|t.negative)==0,"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var l=this.pow(h,n),f=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(a);){for(var g=d,b=0;0!==g.cmp(a);b++)g=g.redSqr();i(b<p);var y=this.pow(l,new s(1).iushln(p-b-1));f=f.redMul(y),l=y.redSqr(),d=d.redMul(l),p=b}return f},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new s(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],h=c-1;h>=0;h--){var l=u>>h&1;if(n!==r[0]&&(n=this.sqr(n)),0===l&&0===o){a=0;continue}o<<=1,o|=l,(4==++a||0===i&&0===h)&&(n=this.mul(n,r[o]),a=0,o=0)}c=26}return n},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},47223:function(e,t,r){var i;function n(e){this.rand=e}
48if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw Error("Not implemented yet")});else try{var s=r(89214);if("function"!=typeof s.randomBytes)throw Error("Not supported");n.prototype._rand=function(e){return s.randomBytes(e)}}catch(e){}},89445:function(e){"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),i=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var s=function(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(r)||[],i=1;i<t.length;i++)t=(e=(function e(t,r){try{return[decodeURIComponent(t.join(""))]}catch(e){}if(1===t.length)return t;r=r||1;var i=t.slice(0,r),n=t.slice(r);return Array.prototype.concat.call([],e(i),e(n))})(t,i).join("")).match(r)||[];return e}}(n[0]);s!==n[0]&&(t[n[0]]=s)}n=i.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),a=0;a<o.length;a++){var c=o[a];e=e.replace(RegExp(c,"g"),t[c])}return e}(e)}}},65383:function(e,t,r){"use strict";r.d(t,{qY:function(){return d}});var i=r(40257),n=function(e,t,r){if(r||2==arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},s=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=i.platform},a=function(e,t,r,i){this.name=e,this.version=t,this.os=r,this.bot=i,this.type="bot-device"},c=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},h=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yaho
48o!|yandex/]],f=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function d(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==i&&i.version?new o(i.version.slice(1)):null}function p(e){var t=""!==e&&l.reduce(function(t,r){var i=r[0],n=r[1];if(t)return t;var s=n.exec(e);return!!s&&[i,s]},!1);if(!t)return null;var r=t[0],i=t[1];if("searchbot"===r)return new c;var o=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);o?o.length<3&&(o=n(n([],o,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-o.length),!0)):o=[];var u=o.join("."),d=function(e){for(var t=0,r=f.length;t<r;t++){var i=f[t],n=i[0];if(i[1].exec(e))return n}return null}(e),p=h.exec(e);return p&&p[1]?new a(r,u,d,p[1]):new s(r,u,d)}},61984:function(e,t,r){"use strict";t.version=r(58274).i8,t.utils=r(36321),t.rand=r(47223),t.curve=r(64358),t.curves=r(83475),t.ec=r(90063),t.eddsa=r(37115)},21398:function(e,t,r){"use strict";var i=r(44373),n=r(36321),s=n.getNAF,o=n.getJSF,a=n.assert;function c(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw Error("Not implemented")},c.prototype.validate=function(){throw Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r,i,n=e._getDoubles(),o=s(t,1,this._bitLength),c=(1<<n.step+1)-(n.step%2==0?2:1);c/=3;var u=[];for(r=0;r<o.length;r+=n.step){i=0;for(var h=r+n.step-1;h>=r;h--)i=(i<<1)+o[h];u.push(i)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=c;d>0;d--){for(r=0;r<u.length;r++)(i=u[r])===d?f=f.mixedAdd(n.points[r]):i===-d&&(f=f.mixedAdd(n.points[r].neg()));l=l.add(f)}return l.toP()},c.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=s(t,r,this._bitLength),c=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(var h=0;u>=0&&0===o[u];u--)h++;if(u>=0&&h++,c=c.dblp(h),u<0)break;var l=o[u];a(0!==l),c="affine"===e.type?l>0?c.mixedAdd(n[l-1>>1]):c.mixedAdd(n[-l-1>>1].neg()):l>0?c.add(n[l-1>>1]):c.add(n[-l-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,i,n){var a,c,u,h=this._wnafT1,l=this._wnafT2,f=this._wnafT3,d=0;for(a=0;a<i;a++){var p=(u=t[a])._getNAFPoints(e);h[a]=p.wnd,l[a]=p.points}for(a=i-1;a>=1;a-=2){var g=a-1,b=a;if(1!==h[g]||1!==h[b]){f[g]=s(r[g],h[g],this._bitLength),f[b]=s(r[b],h[b],this._bitLength),d=Math.max(f[g].length,d),d=Math.max(f[b].length,d);continue}var y=[t[g],null,null,t[b]];0===t[g].y.cmp(t[b].y)?(y[1]=t[g].add(t[b]),y[2]=t[g].toJ().mixedAdd(t[b].neg())):0===t[g].y.cmp(t[b].y.redNeg())?(y[1]=t[g].toJ().mixedAdd(t[b]),y[2]=t[g].add(t[b].neg())):(y[1]=t[g].toJ().mixedAdd(t[b]),y[2]=t[g].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[g],r[b]);for(c=0,d=Math.max(v[0].length,d),f[g]=Array(d),f[b]=Array(d);c<d;c++){var w=0|v[0][c],D=0|v[1][c];f[g][c]=m[(w+1)*3+(D+1)],f[b][c]=0,l[g]=y}}var _=this.jpoint(null,null,null),E=this._wnafT4;for(a=d;a>=0;a--){for(var S=0;a>=0;){var I=!0;for(c=0;c<i;c++)E[c]=0|f[c][a],0!==E[c]&&(I=!1);if(!I)break;S++,a--}if(a>=0&&S++,_=_.dblp(S),a<0)break;for(c=0;c<i;c++){var C=E[c];0!==C&&(C>0?u=l[c][C-1>>1]:C<0&&(u=l[c][-C-1>>1].neg()),_="affine"===u.type?_.mixedAdd(u):_.add(u))}}for(a=0;a<i;a++)l[a]=null;return n?_:_.toP()},c.BasePoint=u,u.prototype.eq=function(){throw Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return n.encode(this._encode(t),e)}
vendor: 10,153 bytes, line 48
48,u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var s=0;s<e;s++)i=i.dbl();r.push(i)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},98343:function(e,t,r){"use strict";var i=r(36321),n=r(44373),s=r(56853),o=r(21398),a=i.assert;function c(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=(0|e.c)==1}function u(e,t,r,i,s){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,!this.curve.extended||this.t||(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(c,o),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(!t)return this.point(this.zero,e);throw Error("invalid point")}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},s(u,o.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,i){return new u(this,e,t,r,i)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=i.redAdd(t),o=s.redSub(r),a=i.redSub(t),c=n.redMul(o),u=s.redMul(a),h=n.redMul(a),l=o.redMul(s);return this.curve.point(c,u,l,h)},u.prototype._projDbl=function(){var e,t,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(a)).redAdd(c);this.zOne?(e=o.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(i.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),s=u.redSub(n).redISub(n),e=o.redSub(a).redISub(c).redMul(s),t=u.redMul(i.redSub(c)),r=u.redMul(s))}else i=a.redAdd(c),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(i)).redMul(s),t=this.curve._mulC(i).redMul(a.redISub(c)),r=i.redMul(s);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),s=r.redSub(t),o=n.redSub(i),a=n.redAdd(i),c=r.redAdd(t),u=s.redMul(o),h=a.redMul(c),l=s.redMul(c),f=o.redMul(a);return this.curve.point(u,h,f,l)},u.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(o),c=n.redSub(a),u=n.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),l=i.redMul(c).redMul(h);return this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(c).redMul(u)),this.curve.point(l,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},64358:function(e,t,r){"use strict";t.base=r(21398),t.short=r(13770),t.mont=r(75656),t.edwards=r(98343)},75656:function(e,t,r){"use strict";var i=r(44373),n=r(56853),s=r(21398),o=r(36321);function a(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},n(c,s.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(r),o=n.redMul(i),a=t.z.redMul(s.redAdd(o).redSqr()),c=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},13770:function(e,t,r){"use strict";var i=r(36321),n=r(44373),s=r(56853),o=r(21398),a=i.assert;function c(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}
vendor: 4,475 bytes, line 48
48function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(c,o),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var t,r,i,s=this._getEndoRoots(this.p);t=(t=0>s[0].cmp(s[1])?s[0]:s[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return i=e.basis?e.basis.map(function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:i}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),s=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,s,o,a,c,u,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),p=new n(1),g=new n(0),b=new n(0),y=new n(1),m=0;0!==f.cmpn(0);){var v=d.div(f);u=d.sub(v.mul(f)),h=b.sub(v.mul(p));var w=y.sub(v.mul(g));if(!i&&0>u.cmp(l))t=c.neg(),r=p,i=u.neg(),s=h;else if(i&&2==++m)break;c=u,d=f,f=u,b=p,p=h,y=g,g=w}o=u.neg(),a=h;var D=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(D)>=0&&(o=t,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),c=n.mul(r.b),u=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<e.length;s++){var o=this._endoSplit(t[s]),a=e[s],c=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),i[2*s]=a,i[2*s+1]=c,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,i,n,2*s,r),h=0;h<2*s;h++)i[h]=null,n[h]=null;return u},s(u,o.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var s=t[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>
48":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return(e=new n(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(h,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),l=i.redMul(u),f=c.redSqr().redIAdd(h).redISub(l).redISub(l),d=c.redMul(l.redISub(f)).redISub(s.redMul(h)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),h=r.redMul(c),l=a.redSqr().redIAdd(u).redISub(h).redISub(h),f=a.redMul(h.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(l,f,d)},h.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,c=a.redSqr().redSqr(),u=o.redAdd(o);for(t=0;t<e;t++){var h=s.redSqr(),l=u.redSqr(),f=l.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),p=s.redMul(l),g=d.redSqr().redISub(p.redAdd(p)),b=p.redISub(g),y=d.redMul(b);y=y.redIAdd(y).redISub(f);var m=u.redMul(a);t+1<e&&(c=c.redMul(f)),s=g,a=m,u=y}return this.curve.jpoint(s,u.redMul(n),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){if(this.zOne){var e,t,r,i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i),c=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),l=this.y.redSqr(),f=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(h).redISub(f);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),g=p.redSqr(),b=f.redIAdd(f);b=(b=b.redIAdd(b)).redIAdd(b),e=g.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){if(this.zOne){var e,t,r,i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=a.redSqr().redISub(o).redISub(o);e=c;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),l=this.y.redSqr(),f=this.x.redMul(l),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),g=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(h);var b=l.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),t=d.redMul(p.redISub(e)).redISub(b)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=t.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(n)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(o),h=a.redSqr().redISub(u.redAdd(u)),l=u.redISub(h),f=o.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(l).redISub(f),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
vendor: 6,372 bytes, line 48
48var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),s=n.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),h=t.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var l=this.x.redMul(a).redISub(h);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(o.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,f,d)},h.prototype.mul=function(e,t){return e=new n(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},83475:function(e,t,r){"use strict";var i,n=r(28714),s=r(64358),o=r(36321).assert;function a(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var i=new a(r);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i}),i}})}t.PresetCurve=a,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(36113)}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
48,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},90063:function(e,t,r){"use strict";var i=r(44373),n=r(28072),s=r(36321),o=r(83475),a=r(47223),c=s.assert,u=r(61258),h=r(90362);function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new u(this,e)},l.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},l.prototype._truncateToN=function(e,t,r){if(i.isBN(e)||"number"==typeof e)n=(e=new i(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new i(e,16);else{var n,s=e.toString();n=s.length+1>>>1,e=new i(s,16)}"number"!=typeof r&&(r=8*n);var o=r-this.n.bitLength();return(o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},l.prototype.sign=function(e,t,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,s.msgBitLength);for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),c=e.toArray("be",o),u=new n({hash:this.hash,entropy:a,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new i(1)),f=0;;f++){var d=s.k?s.k(f):new i(u.generate(this.n.byteLength()));if(!(0>=(d=this._truncateToN(d,!0)).cmpn(1)||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),b=g.umod(this.n);if(0!==b.cmpn(0)){var y=d.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==g.cmp(b)?2:0);return s.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),m^=1),new h({r:b,s:y,recoveryParam:m})}}}}}},l.prototype.verify=function(e,t,r,i,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var s,o=(t=new h(t,"hex")).r,a=t.s;if(0>o.cmpn(1)||o.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,n){c((3&r)===r,"The recovery param is more than two bits"),t=new h(t,n);var s=this.n,o=new i(e),a=t.r,u=t.s,l=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=t.r.invm(s),p=s.sub(o).mul(d).umod(s),g=u.mul(d).umod(s);return this.g.mulAdd(p,a,g)},l.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new h(t,i)).recoveryParam)return t.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(e,t,s)}catch(e){continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")}},61258:function(e,t,r){"use strict";var i=r(44373),n=r(36321).assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=s,s.fromPublic=function(e,t,r){return t instanceof s?t:new s(e,{pub:t,pubEnc:r})},s.fromPrivate=function(e,t,r){return t instanceof s?t:new s(e,{priv:t,privEnc:r})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(e,t){return("string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t)?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&n(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},s.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},90362:function(e,t,r){"use strict";var i=r(44373),n=r(36321),s=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4||0===e[t.place])return!1;for(var n=0,s=0,o=t.place;s<i;s++,o++)n<<=8,n|=e[o],n>>>=0;return!(n<=127)&&(t.place=o,n)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}e.exports=o,o.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new a;
48if(48!==e[r.place++])return!1;var s=c(e,r);if(!1===s||s+r.place!==e.length||2!==e[r.place++])return!1;var o=c(e,r);if(!1===o||(128&e[r.place])!=0)return!1;var u=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var h=c(e,r);if(!1===h||e.length!==h+r.place||(128&e[r.place])!=0)return!1;var l=e.slice(r.place,h+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new i(u),this.s=new i(l),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];h(i,t.length),(i=i.concat(t)).push(2),h(i,r.length);var s=i.concat(r),o=[48];return h(o,s.length),o=o.concat(s),n.encode(o,e)}},37115:function(e,t,r){"use strict";var i=r(28714),n=r(83475),s=r(36321),o=s.assert,a=s.parseBytes,c=r(76244),u=r(55967);function h(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:s})},h.prototype.verify=function(e,t,r){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(s)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return s.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=s.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=(128&e[t])!=0,n=s.intFromLE(r);return this.curve.pointFromY(n,i)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return s.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},76244:function(e,t,r){"use strict";var i=r(36321),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(e,t){this.eddsa=e,this._secret=s(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=s(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(a,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),o(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},e.exports=a},55967:function(e,t,r){"use strict";var i=r(44373),n=r(36321),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(s(t.length===2*e.encodingLength,"Signature has invali
48d size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),s(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},36113:function(e
vendor: 26,140 bytes, line 48
48){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},
4836321:function(e,t,r){"use strict";var i=r(44373),n=r(73045),s=r(83742);t.assert=n,t.toArray=s.toArray,t.zero2=s.zero2,t.toHex=s.toHex,t.encode=s.encode,t.getNAF=function(e,t,r){var i=Array(Math.max(e.bitLength(),r)+1);for(o=0;o<i.length;o+=1)i[o]=0;var n=1<<t+1,s=e.clone();for(o=0;o<i.length;o++){var o,a,c=s.andln(n-1);s.isOdd()?(a=c>(n>>1)-1?(n>>1)-c:c,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;e.cmpn(-i)>0||t.cmpn(-n)>0;){var s,o,a,c=e.andln(3)+i&3,u=t.andln(3)+n&3;3===c&&(c=-1),3===u&&(u=-1),o=(1&c)==0?0:(3==(s=e.andln(7)+i&7)||5===s)&&2===u?-c:c,r[0].push(o),a=(1&u)==0?0:(3==(s=t.andln(7)+n&7)||5===s)&&2===c?-u:u,r[1].push(a),2*i===o+1&&(i=1-i),2*n===a+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new i(e,"hex","le")}},55445:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,i){var n;function s(r){e.removeListener(t,o),i(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&(n={once:!0},"function"==typeof e.on&&g(e,"error",s,n))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}
48function u(e,t,r,i){if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=c(e))>0&&o.length>n&&!o.warned){o.warned=!0;var n,s,o,u=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,console&&console.warn&&console.warn(u)}return e}function h(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function f(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):p(n,n.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=Array(t),i=0;i<t;++i)r[i]=e[i];return r}function g(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function n(s){i.once&&e.removeEventListener(t,n),r(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else for(var u=c.length,h=p(c,u),r=0;r<u;++r)i(h[r],this,t);return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,i,n,s,o;if(a(t),void 0===(i=this._events)||void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},90883:function(e){"use strict";e.exports=function(e,t){for(var r={},i=Object.keys(e),n=Array.isArray(t),s=0;s<i.length;s++){var o=i[s],a=e[o];(n?-1!==t.indexOf(o):t(o,a,e))&&(r[o]=a)}return r}},28714:function(e,t,r){t.utils=r(20015),t.common=r(49351),t.sha=r(87647),t.ripemd=r(47826),t.hmac=r(53765),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160},49351:function(e,t,r){"use strict";var i=r(20015),n=r(73045);function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}
48t.BlockHash=s,s.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},s.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},s.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(s=8,i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0;s<this.padLength;s++)i[n++]=0;return i}},53765:function(e,t,r){"use strict";var i=r(20015),n=r(73045);function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(t=0,this.inner=new this.Hash().update(e);t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},s.prototype.update=function(e,t){return this.inner.update(e,t),this},s.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},47826:function(e,t,r){"use strict";var i=r(20015),n=r(49351),s=i.rotl32,o=i.sum32,a=i.sum32_3,c=i.sum32_4,u=n.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~
48i:t^(r|~i)}i.inherits(h,u),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],h=this.h[4],b=r,y=i,m=n,v=u,w=h,D=0;D<80;D++){var _,E,S=o(s(c(r,l(D,i,n,u),e[f[D]+t],(_=D)<=15?0:_<=31?1518500249:_<=47?1859775393:_<=63?2400959708:2840853838),p[D]),h);r=h,h=u,u=s(n,10),n=i,i=S,S=o(s(c(b,l(79-D,y,m,v),e[d[D]+t],(E=D)<=15?1352829926:E<=31?1548603684:E<=47?1836072691:E<=63?2053994217:0),g[D]),w),b=w,w=v,v=s(m,10),m=y,y=S}S=a(this.h[1],n,v),this.h[1]=a(this.h[2],u,w),this.h[2]=a(this.h[3],h,b),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],i,m),this.h[0]=S},h.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],d=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},87647:function(e,t,r){"use strict";t.sha1=r(4684),t.sha224=r(45261),t.sha256=r(17795),t.sha384=r(84182),t.sha512=r(54358)},4684:function(e,t,r){"use strict";var i=r(20015),n=r(49351),s=r(31964),o=i.rotl32,a=i.sum32,c=i.sum32_5,u=s.ft_1,h=n.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}i.inherits(f,h),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=o(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],h=this.h[2],f=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),g=c(o(n,5),u(p,s,h,f),d,r[i],l[p]);d=f,f=h,h=o(s,30),s=n,n=g}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],d)},f.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},45261:function(e,t,r){"use strict";var i=r(20015),n=r(17795);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},17795:function(e,t,r){"use strict";var i=r(20015),n=r(49351),s=r(31964),o=r(73045),a=i.sum32,c=i.sum32_4,u=i.sum32_5,h=s.ch32,l=s.maj32,f=s.s0_256,d=s.s1_256,p=s.g0_256,g=s.g1_256,b=n.BlockHash,y=[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 m(){if(!(this instanceof m))return new m;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=Array(64)}i.inherits(m,b),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;
vendor: 2,974 bytes, line 48
48i++)r[i]=c(g(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],b=this.h[2],y=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],D=this.h[7];for(o(this.k.length===r.length),i=0;i<r.length;i++){var _=u(D,d(m),h(m,v,w),this.k[i],r[i]),E=a(f(n),l(n,s,b));D=w,w=v,v=m,m=a(y,_),y=b,b=s,s=n,n=a(_,E)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],b),this.h[3]=a(this.h[3],y),this.h[4]=a(this.h[4],m),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],D)},m.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},84182:function(e,t,r){"use strict";var i=r(20015),n=r(54358);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},54358:function(e,t,r){"use strict";var i=r(20015),n=r(49351),s=r(73045),o=i.rotr64_hi,a=i.rotr64_lo,c=i.shr64_hi,u=i.shr64_lo,h=i.sum64,l=i.sum64_hi,f=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,b=i.sum64_5_lo,y=n.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
481126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=Array(160)}i.inherits(v,y),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=function(e,t){var r=o(e,t,19)^o(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}(r[i-4],r[i-3]),s=function(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}(r[i-4],r[i-3]),h=r[i-14],l=r[i-13],f=function(e,t){var r=o(e,t,1)^o(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}(r[i-30],r[i-29]),g=function(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}(r[i-30],r[i-29]),b=r[i-32],y=r[i-31];r[i]=d(n,s,h,l,f,g,b,y),r[i+1]=p(n,s,h,l,f,g,b,y)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],c=this.h[2],u=this.h[3],d=this.h[4],p=this.h[5],y=this.h[6],m=this.h[7],v=this.h[8],w=this.h[9],D=this.h[10],_=this.h[11],E=this.h[12],S=this.h[13],I=this.h[14],C=this.h[15];s(this.k.length===r.length);for(var A=0;A<r.length;A+=2){var M=I,x=C,P=function(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}(v,w),O=function(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}(v,w),T=function(e,t,r,i,n){var s=e&r^~e&n;return s<0&&(s+=4294967296),s}(v,0,D,0,E,S),R=function(e,t,r,i,n,s){var o=t&i^~t&s;return o<0&&(o+=4294967296),o}(0,w,0,_,0,S),k=this.k[A],N=this.k[A+1],L=r[A],j=r[A+1],q=g(M,x,P,O,T,R,k,N,L,j),z=b(M,x,P,O,T,R,k,N,L,j);M=function(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}(i,n);var U=l(M,x=function(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}(i,n),P=function(e,t,r,i,n){var s=e&r^e&n^r&n;return s<0&&(s+=4294967296),s}(i,0,c,0,d,p),O=function(e,t,r,i,n,s){var o=t&i^t&s^i&s;return o<0&&(o+=4294967296),o}(0,n,0,u,0,p)),F=f(M,x,P,O);I=E,C=S,E=D,S=_,D=v,_=w,v=l(y,m,q,z),w=f(m,m,q,z),y=d,m=p,d=c,p=u,c=i,u=n,i=l(q,z,U,F),n=f(q,z,U,F)}h(this.h,0,i,n),h(this.h,2,c,u),h(this.h,4,d,p),h(this.h,6,y,m),h(this.h,8,v,w),h(this.h,10,D,_),h(this.h,12,E,S),h(this.h,14,I,C)},v.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},31964:function(e,t,r){"use strict";var i=r(20015).rotr32;function n(e,t,r){return e&t^e&r^t&r}t.ft_1=function(e,t,r,i){return 0===e?t&r^~t&i:1===e||3===e?t^r^i:2===e?n(t,r,i):void 0},t.ch32=function(e,t,r){return e&t^~e&r},t.maj32=n,t.p32=function(e,t,r){return e^t^r},t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},20015:function(e,t,r){"use strict";var i=r(73045),n=r(56853);function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function a(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var s,o,a=e.charCodeAt(n);a<128?r[i++]=a:(a<2048?r[i++]=a>>6|192:((s=e,o=n,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length?1:(64512&s.charCodeAt(o+1))!=56320)?r[i++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128),r[i++]=a>>6&63|128),r[i++]=63&a|128)}}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=s(n)),r+=a(n.toString(16))}return r},t.zero2=o,t.zero8=a,t.join32=function(e,t,r,n){var s,o=r-t;i(o%4==0);for(var a=Array(o/4),c=0,u=t;c<a.length;c++,u+=4)s="big"===n?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[c]=s>>>0;return a},t.split32=function(e,t){for(var r=Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var s=e[i];"big"===t?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],s=i+e[t+1]>>>0;e[t]=(s<i?1:0)+r+n>>>
480,e[t+1]=s},t.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,s,o,a){var c,u=t;return e+r+n+o+(0+((u=u+i>>>0)<t?1:0)+((u=u+s>>>0)<s?1:0)+((u=u+a>>>0)<a?1:0))>>>0},t.sum64_4_lo=function(e,t,r,i,n,s,o,a){return t+i+s+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,s,o,a,c,u){var h,l=t;return e+r+n+o+c+(0+((l=l+i>>>0)<t?1:0)+((l=l+s>>>0)<s?1:0)+((l=l+a>>>0)<a?1:0)+((l=l+u>>>0)<u?1:0))>>>0},t.sum64_5_lo=function(e,t,r,i,n,s,o,a,c,u){return t+i+s+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},28072:function(e,t,r){"use strict";var i=r(28714),n=r(83742),s=r(73045);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),i=n.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}e.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=n.toArray(e,t),r=n.toArray(r,i),s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(r),this._reseed++,n.encode(o,t)}},56853:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},15586:function(e,t,r){e=r.nmd(e);var i,n,s,o="__lodash_hash_undefined__",a="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",l="[object Error]",f="[object Function]",d="[object Map]",p="[object Number]",g="[object Object]",b="[object Promise]",y="[object RegExp]",m="[object Set]",v="[object String]",w="[object WeakMap]",D="[object ArrayBuffer]",_="[object DataView]",E=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[a]=I[c]=I[D]=I[u]=I[_]=I[h]=I[l]=I[f]=I[d]=I[p]=I[g]=I[y]=I[m]=I[v]=I[w]=!1;var C="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,A="object"==typeof self&&self&&self.Object===Object&&self,M=C||A||Function("return this")(),x=t&&!t.nodeType&&t,P=x&&e&&!e.nodeType&&e,O=P&&P.exports===x,T=O&&C.process,R=function(){try{return T&&T.binding&&T.binding("util")}catch(e){}}(),k=R&&R.isTypedArray;function N(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function L(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var j=Array.prototype,q=Function.prototype,z=Object.prototype,U=M["__core-js_shared__"],F=q.toString,B=z.hasOwnProperty,$=(i=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(sr
48c)_1."+i:"",H=z.toString,V=RegExp("^"+F.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K=O?M.Buffer:void 0,W=M.Symbol,J=M.Uint8Array,G=z.propertyIsEnumerable,Y=j.splice,Q=W?W.toStringTag:void 0,X=Object.getOwnPropertySymbols,Z=K?K.isBuffer:void 0,ee=(n=Object.keys,s=Object,function(e){return n(s(e))}),et=eI(M,"DataView"),er=eI(M,"Map"),ei=eI(M,"Promise"),en=eI(M,"Set"),es=eI(M,"WeakMap"),eo=eI(Object,"create"),ea=eM(et),ec=eM(er),eu=eM(ei),eh=eM(en),el=eM(es),ef=W?W.prototype:void 0,ed=ef?ef.valueOf:void 0;function ep(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function eg(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function eb(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function ey(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new eb;++t<r;)this.add(e[t])}function em(e){var t=this.__data__=new eg(e);this.size=t.size}function ev(e,t){for(var r=e.length;r--;)if(ex(e[r][0],t))return r;return -1}function ew(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Q&&Q in Object(e)?function(e){var t=B.call(e,Q),r=e[Q];try{e[Q]=void 0;var i=!0}catch(e){}var n=H.call(e);return i&&(t?e[Q]=r:delete e[Q]),n}(e):H.call(e)}function eD(e){return eL(e)&&ew(e)==a}function e_(e,t,r,i,n,s){var o=1&r,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var h=-1,l=!0,f=2&r?new ey:void 0;for(s.set(e,t),s.set(t,e);++h<a;){var d=e[h],p=t[h];if(i)var g=o?i(p,d,h,t,e,s):i(d,p,h,e,t,s);if(void 0!==g){if(g)continue;l=!1;break}if(f){if(!function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!f.has(t)&&(d===e||n(d,e,r,i,s)))return f.push(t)})){l=!1;break}}else if(!(d===p||n(d,p,r,i,s))){l=!1;break}}return s.delete(e),s.delete(t),l}function eE(e){var t;return t=function(e){return null!=e&&ek(e.length)&&!eR(e)?function(e,t){var r,i=eO(e),n=!i&&eP(e),s=!i&&!n&&eT(e),o=!i&&!n&&!s&&ej(e),a=i||n||s||o,c=a?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],u=c.length;for(var h in e)B.call(e,h)&&!(a&&("length"==h||s&&("offset"==h||"parent"==h)||o&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||(r=null==(r=u)?9007199254740991:r)&&("number"==typeof h||S.test(h))&&h>-1&&h%1==0&&h<r))&&c.push(h);return c}(e):function(e){if(t=e&&e.constructor,e!==("function"==typeof t&&t.prototype||z))return ee(e);var t,r=[];for(var i in Object(e))B.call(e,i)&&"constructor"!=i&&r.push(i);return r}(e)}(e),eO(e)?t:function(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}(t,eC(e))}function eS(e,t){var r,i=e.__data__;return("string"==(r=typeof t)||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?i["string"==typeof t?"string":"hash"]:i.map}function eI(e,t){var r=null==e?void 0:e[t];return!(!eN(r)||$&&$ in r)&&(eR(r)?V:E).test(eM(r))?r:void 0}ep.prototype.clear=function(){this.__data__=eo?eo(null):{},this.size=0},ep.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ep.prototype.get=function(e){var t=this.__data__;if(eo){var r=t[e];return r===o?void 0:r}return B.call(t,e)?t[e]:void 0},ep.prototype.has=function(e){var t=this.__data__;return eo?void 0!==t[e]:B.call(t,e)},ep.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=eo&&void 0===t?o:t,this},eg.prototype.clear=function(){this.__data__=[],this.size=0},eg.prototype.delete=function(e){var t=this.__data__,r=ev(t,e);return!(r<0)&&(r==t.length-1?t.pop():Y.call(t,r,1),--this.size,!0)},eg.prototype.get=function(e){var t=this.__data__,r=ev(t,e);return r<0?void 0:t[r][1]},eg.prototype.has=function(e){return ev(this.__data__,e)>-1},eg.prototype.set=function(e,t){var r=this.__data__,i=ev(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},eb.prototype.clear=function(){this.size=0,this.__data__={hash:new ep,map:new(er||eg),string:new ep}},eb.prototype.delete=function(e){var t=eS(this,e).delete(e);return this.size-=t?1:0,t},eb.prototype.get=function(e){return eS(this,e).get(e)},eb.prototype.has=function(e){return eS(this,e).has(e)},eb.prototype.set=function(e,t){var r=eS(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},ey.prototype.add=ey.prototype.push=function(e){return this.__data__.set(e,o),this},ey.prototype.has=function(e){return this.__data__.has(e)},em.prototype.clear=function(){this.__data__=new eg,this.size=0},em.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},em.prototype.get=function(e){return this.__data__.get(e)},em.prototype.has=function(e){return this.__data__.has(e)},em.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eg){var i=r.__data__;if(!er||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new eb(i)}return r.set(e,t),this.size=r.size,this};var eC=X?function(e){return null==e?[]:function(e,t){for(var r=-1,i=null==e?0:e.length,n=0,s=[];++r<i;){var o=e[r];t(o,r,e)&&(s[n++]=o)}return s}(X(e=Object(e)),function(t){return G.call(e,t)})}:function(){return[]},eA=ew;function eM(e){if(null!=e){try{return F.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ex(e,t){return e===t||e!=e&&t!=t}(et&&eA(new et(new ArrayBuffer(1)))!=_||er&&eA(new er)!=d||ei&&eA(ei.resolve())!=b||en&&eA(new en)!=m||es&&eA(new es)!=w)&&(eA=function(e){var t=ew(e),r=t==g?e.constructor:void 0,i=r?eM(r):"";if(i)switch(i){case ea:return _;case ec:return d;case eu:return b;case eh:return m;case el:return w}return t});var eP=eD(function(){return arguments}())?eD:function(e){return eL(e)&&B.call(e,"callee")&&!G.call(e,"callee")},eO=Array.isArray,eT=Z||function(){return!1};function eR(e){if(!eN(e))return!1;var t=ew(e);return t==f||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ek(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function eN(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eL(e){return null!=e&&"object"==typeof e}var ej=k?function(e){return k(e)}:function(e){return eL(e)&&ek(e.length)&&!!I[ew(e)]};e.exports=function(e,t){return function e(t,r,i,n,s){return t===r||(null!=t&&null!=r&&(eL(t)||eL(r))?function(e,t,r,i,n,s){var o=eO(e),f=eO(t),b=o?c:eA(e),w=f?c:eA(t);b=b==a?g:b,w=w==a?g:w;var E=b==g,S=w==g,I=b==w;if(I&&eT(e)){if(!eT(t))return!1;o=!0,E=!1}if(I&&!E)return s||(s=new em),o||ej(e)?e_(e,t,r,i,n,s):function(e,t,r,i,n,s,o){switch(r){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case D:if(e.byteLength!=t.byteLength||!s(new J(e),new J(t)))break;return!0;case u:case h:case p:return ex(+e,+t);case l:return e.name==t.name&&e.message==t.message;case y:case v:return e==t+"";case d:var a=N;case m:var c=1&i;if(a||(a=L),e.size!=t.size&&!c)break;var f=o.get(e);if(f)return f==t;i|=2,o.set(e,t);var g=e_(a(e),a(t),i,n,s,o);return o.delete(e),g;case"[object Symbol]":if(ed)return ed.call(e)==ed.call(t)}return!1}(e,t,b,r,i,n,s);if(!(1&r)){var C=E&&B.call(e,"__wrapped__"),A=S&&B.call(t,"__wrapped__");
48if(C||A){var M=C?e.value():e,x=A?t.value():t;return s||(s=new em),n(M,x,r,i,s)}}return!!I&&(s||(s=new em),function(e,t,r,i,n,s){var o=1&r,a=eE(e),c=a.length;if(c!=eE(t).length&&!o)return!1;for(var u=c;u--;){var h=a[u];if(!(o?h in t:B.call(t,h)))return!1}var l=s.get(e);if(l&&s.get(t))return l==t;var f=!0;s.set(e,t),s.set(t,e);for(var d=o;++u<c;){var p=e[h=a[u]],g=t[h];if(i)var b=o?i(g,p,h,t,e,s):i(p,g,h,e,t,s);if(!(void 0===b?p===g||n(p,g,r,i,s):b)){f=!1;break}d||(d="constructor"==h)}if(f&&!d){var y=e.constructor,m=t.constructor;y!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(f=!1)}return s.delete(e),s.delete(t),f}(e,t,r,i,n,s))}(t,r,i,n,e,s):t!=t&&r!=r)}(e,t)}},73045:function(e){function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}},83742:function(e,t){"use strict";function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",i=0;i<e.length;i++)t+=r(e[i].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e);for(var i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},t.zero2=r,t.toHex=i,t.encode=function(e,t){return"hex"===t?i(e):e}},88017:function(e,t,r){"use strict";let i=r(59148),n=r(89445),s=r(93129),o=r(90883),a=e=>null==e,c=Symbol("encodeFragmentIdentifier");function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function h(e,t){return t.encode?t.strict?i(e):encodeURIComponent(e):e}function l(e,t){return t.decode?n(e):e}function f(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=f(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function g(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,i)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){i[e]=r;return}void 0===i[e]&&(i[e]={}),i[e][t[1]]=r};case"bracket":return(e,r,i)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){i[e]=r;return}if(void 0===i[e]){i[e]=[r];return}i[e]=[].concat(i[e],r)};case"colon-list-separator":return(e,r,i)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){i[e]=r;return}if(void 0===i[e]){i[e]=[r];return}i[e]=[].concat(i[e],r)};case"comma":case"separator":return(t,r,i)=>{let n="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!n&&l(r,e).includes(e.arrayFormatSeparator);r=s?l(r,e):r;let o=n||s?r.split(e.arrayFormatSeparator).map(t=>l(t,e)):null===r?r:l(r,e);i[t]=o};case"bracket-separator":return(t,r,i)=>{let n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n){i[t]=r?l(r,e):r;return}let s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>l(t,e));if(void 0===i[t]){i[t]=s;return}i[t]=[].concat(i[t],s)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let n of e.split("&")){if(""===n)continue;let[e,o]=s(t.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:l(o,t),r(l(e,t),o,i)}for(let e of Object.keys(i)){let r=i[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=p(r[e],t);else i[e]=p(r,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce((e,t)=>{let r=i[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>
48Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=d,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],i=function(e){switch(e.arrayFormat){case"index":return t=>(r,i)=>{let n=r.length;return void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[h(t,e),"[",n,"]"].join("")]:[...r,[h(t,e),"[",h(n,e),"]=",h(i,e)].join("")]};case"bracket":return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[h(t,e),"[]"].join("")]:[...r,[h(t,e),"[]=",h(i,e)].join("")];case"colon-list-separator":return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[h(t,e),":list="].join("")]:[...r,[h(t,e),":list=",h(i,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(i,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:(n=null===n?"":n,0===i.length)?[[h(r,e),t,h(n,e)].join("")]:[[i,h(n,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,h(t,e)]:[...r,[h(t,e),"=",h(i,e)].join("")]}}(t),n={};for(let t of Object.keys(e))r(t)||(n[t]=e[t]);let s=Object.keys(n);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{let n=e[r];return void 0===n?"":null===n?h(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?h(r,t)+"[]":n.reduce(i(r),[]).join("&"):h(r,t)+"="+h(n,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>
48{t=Object.assign({decode:!0},t);let[r,i]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(d(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[c]:!0},r);let i=f(e.url).split("?")[0]||"",n=t.extract(e.url),s=Object.assign(t.parse(n,{sort:!1}),e.query),o=t.stringify(s,r);o&&(o=`?${o}`);let a=function(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(a=`#${r[c]?h(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${i}${o}${a}`},t.pick=(e,r,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[c]:!1},i);let{url:n,query:s,fragmentIdentifier:a}=t.parseUrl(e,i);return t.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:a},i)},t.exclude=(e,r,i)=>{let n=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,n,i)}},95172:function(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,i){var n=i&&i.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var o=Array(s);o[0]=n(e);for(var a=1;a<s;a++)o[a]=n(r[a]);return o.join(" ")}if("string"!=typeof e)return e;var c=r.length;if(0===c)return e;for(var u="",h=0,l=-1,f=e&&e.length||0,d=0;d<f;){if(37===e.charCodeAt(d)&&d+1<f){switch(l=l>-1?l:0,e.charCodeAt(d+1)){case 100:case 102:if(h>=c||null==r[h])break;l<d&&(u+=e.slice(l,d)),u+=Number(r[h]),l=d+2,d++;break;case 105:if(h>=c||null==r[h])break;l<d&&(u+=e.slice(l,d)),u+=Math.floor(Number(r[h])),l=d+2,d++;break;case 79:case 111:case 106:if(h>=c||void 0===r[h])break;l<d&&(u+=e.slice(l,d));var p=typeof r[h];if("string"===p){u+="'"+r[h]+"'",l=d+2,d++;break}if("function"===p){u+=r[h].name||"<anonymous>",l=d+2,d++;break}u+=n(r[h]),l=d+2,d++;break;case 115:if(h>=c)break;l<d&&(u+=e.slice(l,d)),u+=String(r[h]),l=d+2,d++;break;case 37:l<d&&(u+=e.slice(l,d)),u+="%",l=d+2,d++,h--}++h}++d}return -1===l?e:(l<f&&(u+=e.slice(l)),u)}},93129:function(e){"use strict";e.exports=(e,t)=>{if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},59148:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},97435:function(e,t,r){"use strict";let i=r(95172);e.exports=s;let n=function(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e){var t,r;(e=e||{}).browser=e.browser||{};let i=e.browser.transmit;if(i&&"function"!=typeof i.send)throw Error("pino: transmit option must have a send function");let h=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);let l=e.serializers||{},g=Array.isArray(t=e.browser.serialize)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(l),b=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(b=!1),"function"==typeof h&&(h.error=h.fatal=h.warn=h.info=h.debug=h.trace=h),!1===e.enabled&&(e.level="silent");let y=e.level||"info",m=Object.create(h);m.log||(m.log=f),Object.defineProperty(m,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(m,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(v,m,"error","log"),o(v,m,"fatal","error"),o(v,m,"warn","error"),o(v,m,"info","log"),o(v,m,"debug","log"),o(v,m,"trace","log")}});let v={transmit:i,serialize:g,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?d:p};return m.levels=s.levels,m.level=y,m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=f,m.serializers=l,m._seri
48alize=g,m._stdErrSerialize=b,m.child=function(t,r){if(!t)throw Error("missing bindings for child Pino");r=r||{},g&&t.serializers&&(r.serializers=t.serializers);let n=r.serializers;if(g&&n){var s=Object.assign({},l,n),o=!0===e.browser.serialize?Object.keys(s):g;delete t.serializers,a([t],o,s,this._stdErrSerialize)}function h(e){this._childLevel=(0|e._childLevel)+1,this.error=c(e,t,"error"),this.fatal=c(e,t,"fatal"),this.warn=c(e,t,"warn"),this.info=c(e,t,"info"),this.debug=c(e,t,"debug"),this.trace=c(e,t,"trace"),s&&(this.serializers=s,this._serialize=o),i&&(this._logEvent=u([].concat(e._logEvent.bindings,t)))}return h.prototype=this,new h(this)},i&&(m._logEvent=u()),m}function o(e,t,r,o){let c=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?f:c[r]?c[r]:n[r]||n[o]||f,function(e,t,r){if(e.transmit||t[r]!==f){var o;t[r]=(o=t[r],function(){let c=e.timestamp(),h=Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var f=0;f<h.length;f++)h[f]=arguments[f];if(e.serialize&&!e.asObject&&a(h,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?o.call(l,function(e,t,r,n){e._serialize&&a(r,e._serialize,e.serializers,e._stdErrSerialize);let o=r.slice(),c=o[0],u={};n&&(u.time=n),u.level=s.levels.values[t];let h=(0|e._childLevel)+1;if(h<1&&(h=1),null!==c&&"object"==typeof c){for(;h--&&"object"==typeof o[0];)Object.assign(u,o.shift());c=o.length?i(o.shift(),o):void 0}else"string"==typeof c&&(c=i(o.shift(),o));return void 0!==c&&(u.msg=c),u}(this,r,h,c)):o.apply(l,h),e.transmit){let i=e.transmit.level||t.level,n=s.levels.values[i],o=s.levels.values[r];if(o<n)return;(function(e,t,r){let i=t.send,n=t.ts,s=t.methodLevel,o=t.methodValue,c=t.val,h=e._logEvent.bindings;a(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=n,e._logEvent.messages=r.filter(function(e){return -1===h.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=o,i(s,e._logEvent,c),e._logEvent=u(h)})(this,{ts:c,methodLevel:r,methodValue:o,transmitLevel:i,transmitValue:s.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},h)}})}}(e,t,r)}function a(e,t,r,i){for(let n in e)if(i&&e[n]instanceof Error)e[n]=s.stdSerializers.err(e[n]);else if("object"==typeof e[n]&&!Array.isArray(e[n]))for(let i in e[n])t&&t.indexOf(i)>-1&&i in r&&(e[n][i]=r[i](e[n][i]))}function c(e,t,r){return function(){let i=Array(1+arguments.length);i[0]=t;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return e[r].apply(this,i)}}function u(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(){return{}}function l(e){return e}function f(){}function d(){return!1}function p(){return Date.now()}s.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},s.stdSerializers={mapHttpRequest:h,mapHttpResponse:h,wrapRequestSerializer:l,wrapResponseSerializer:l,wrapErrorSerializer:l,req:h,res:h,err:function(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}},s.stdTimeFunctions=Object.assign({},{nullTime:d,epochTime:p,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})},61389:function(e,t,r){"use strict";r.d(t,{zo:function(){return m},mL:function(){return eG},BB:function(){return eY}});var i={};r.r(i),r.d(i,{identity:function(){return k}});var n={};r.r(n),r.d(n,{base2:function(){return N}});var s={};r.r(s),r.d(s,{base8:function(){return L}});var o={};r.r(o),r.d(o,{base10:function(){return j}});var a={};r.r(a),r.d(a,{base16:function(){return q},base16upper:function(){return z}});var c={};r.r(c),r.d(c,{base32:function(){return U},base32hex:function(){return H},base32hexpad:function(){return K},base32hexpadupper:function(){return W},base32hexupper:function(){return V},base32pad:function(){return B},base32padupper:function(){return $},base32upper:function(){return F},base32z:function(){return J}});var u={};r.r(u),r.d(u,{base36:function(){return G},base36upper:function(){return Y}});var h={};r.r(h),r.d(h,{base58btc:function(){return Q},base58flickr:function(){return X}});var l={};r.r(l),r.d(l,{base64:function(){return Z},base64pad:function(){return ee},base64url:function(){return et},base64urlpad:function(){return er}});var f={};r.r(f),r.d(f,{base256emoji:function(){return eo}});var d={};r.r(d),r.d(d,{sha256:function(){return ev},sha512:function(){return ew}});var p={};r.r(p),r.d(p,{identity:function(){return eD}});var g={};r.r(g),r.d(g,{code:function(){return eE},decode:function(){return eI},encode:function(){return eS},name:function(){return e_}});var b={};function y(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function m(e,t){t||(t=e.reduce((e,t)=>
48e+t.length,0));let r=y(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}r.r(b),r.d(b,{code:function(){return ex},decode:function(){return eO},encode:function(){return eP},name:function(){return eM}});var v=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=n}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===c;)i++,t++;for(var s=(e.length-t)*u+1>>>0,o=new Uint8Array(s);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var l=0,f=s-1;(0!==h||l<n)&&-1!==f;f--,l++)h+=a*o[f]>>>0,o[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");n=l,t++}if(" "!==e[t]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*h+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=t[n],f=0,d=o-1;(0!==l||f<i)&&-1!==d;d--,f++)l+=256*u[d]>>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=c.repeat(r);p<o;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:l,decode:function(e){var r=l(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let w=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},D=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},_=e=>new TextEncoder().encode(e),E=e=>new TextDecoder().decode(e);class S{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class I{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return A(this,e)}}class C{constructor(e){this.decoders=e}or(e){return A(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let A=(e,t)=>new C({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});
48class M{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new S(e,t,r),this.decoder=new I(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let x=({name:e,prefix:t,encode:r,decode:i})=>new M(e,t,r,i),P=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=v(r,t);return x({prefix:e,name:t,encode:i,decode:e=>D(n(e))})},O=(e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,c=0,u=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${i} character`);c=c<<r|s,(a+=r)>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return o},T=(e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,s="",o=0,a=0;for(let i=0;i<e.length;++i)for(a=a<<8|e[i],o+=8;o>r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s},R=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>x({prefix:t,name:e,encode:e=>T(e,i,r),decode:t=>O(t,i,r,e)}),k=x({prefix:"\0",name:"identity",encode:e=>E(e),decode:e=>_(e)}),N=R({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),L=R({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),j=P({prefix:"9",name:"base10",alphabet:"0123456789"}),q=R({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),z=R({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),U=R({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),F=R({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),B=R({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$=R({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),H=R({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),V=R({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),K=R({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),W=R({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),J=R({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),G=P({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Y=P({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Q=P({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),X=P({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Z=R({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ee=R({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),et=R({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),er=R({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ei=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),en=ei.reduce((e,t,r)=>(e[r]=t,e),[]),es=ei.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),eo=x({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
48e+=en[t],"")},decode:function(e){let t=[];for(let r of e){let e=es[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var ea=function e(t,r,i){r=r||[];for(var n=i=i||0;t>=2147483648;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},ec=function e(t,r){var i,n=0,r=r||0,s=0,o=r,a=t.length;do{if(o>=a)throw e.bytes=0,RangeError("Could not decode varint");i=t[o++],n+=s<28?(127&i)<<s:(127&i)*Math.pow(2,s),s+=7}while(i>=128);return e.bytes=o-r,n};let eu=(e,t=0)=>[ec(e,t),ec.bytes],eh=(e,t,r=0)=>(ea(e,t,r),t),el=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,ef=(e,t)=>{let r=t.byteLength,i=el(e),n=i+el(r),s=new Uint8Array(n+r);return eh(e,s,0),eh(r,s,i),s.set(t,n),new eg(e,r,t,s)},ed=e=>{let t=D(e),[r,i]=eu(t),[n,s]=eu(t.subarray(i)),o=t.subarray(i+s);if(o.byteLength!==n)throw Error("Incorrect length");return new eg(r,n,o,t)},ep=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&w(e.bytes,t.bytes);
48class eg{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let eb=({name:e,code:t,encode:r})=>new ey(e,t,r);class ey{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ef(this.code,t):t.then(e=>ef(this.code,e))}throw Error("Unknown type, must be binary type")}}let em=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ev=eb({name:"sha2-256",code:18,encode:em("SHA-256")}),ew=eb({name:"sha2-512",code:19,encode:em("SHA-512")}),eD={code:0,name:"identity",encode:D,digest:e=>ef(0,D(e))},e_="raw",eE=85,eS=e=>D(e),eI=e=>D(e),eC=new TextEncoder,eA=new TextDecoder,eM="json",ex=512,eP=e=>eC.encode(JSON.stringify(e)),eO=e=>JSON.parse(eA.decode(e));class eT{constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:eF,byteLength:eF,code:eU,version:eU,multihash:eU,bytes:eU,_baseCache:eF,asCID:eF})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==eL)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ej)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return eT.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=ef(e,t);return eT.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&ep(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:i}=this;return 0===r?ek(t,i,e||Q.encoder):eN(t,i,e||U.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return eB(/^0\.0/,e$),!!(e&&(e[ez]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof eT)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:i,bytes:n}=e;return new eT(t,r,i,n||eq(t,r,i.bytes))}if(null==e||!0!==e[ez])return null;{let{version:t,multihash:r,code:i}=e,n=ed(r);return eT.create(t,i,n)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===eL)return new eT(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${eL}) block encoding`);case 1:{let i=eq(e,t,r.bytes);return new eT(e,t,r,i)}default:throw Error("Invalid version")}}static createV0(e){return eT.create(0,eL,e)}static createV1(e,t){return eT.create(1,e,t)}static decode(e){let[t,r]=eT.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=eT.inspectBytes(e),r=t.size-t.multihashSize,i=D(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw Error("Incorrect length");let n=i.subarray(t.multihashSize-t.digestSize),s=new eg(t.multihashCode,t.digestSize,n,i);return[0===t.version?eT.createV0(s):eT.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,i]=eu(e.subarray(t));return t+=i,r},i=r(),n=eL;if(18===i?(i=0,t=0):1===i&&(n=r()),0!==i&&1!==i)throw RangeError(`Invalid CID version ${i}`);let s=t,o=r(),a=r(),c=t+a;return{version:i,codec:n,multihashCode:o,digestSize:a,multihashSize:c-s,size:c}}static parse(e,t){let[r,i]=eR(e,t),n=eT.decode(i);return n._baseCache.set(r,e),n}}let eR=(e,t)=>{switch(e[0]){case"Q":return[Q.prefix,(t||Q).decode(`${Q.prefix}${e}`)];case Q.prefix:return[Q.prefix,(t||Q).decode(e)];case U.prefix:return[U.prefix,(t||U).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},ek=(e,t,r)=>{let{prefix:i}=r;if(i!==Q.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=t.get(i);if(null!=n)return n;{let n=r.encode(e).slice(1);return t.set(i,n),n}},eN=(e,t,r)=>{let{prefix:i}=r,n=t.get(i);if(null!=n)return n;{let n=r.encode(e);return t.set(i,n),n}},eL=112,ej=18,eq=(e,t,r)=>{let i=el(e),n=i+el(t),s=new Uint8Array(n+r.byteLength);return eh(e,s,0),eh(t,s,i),s.set(r,n),s}
48,ez=Symbol.for("@ipld/js-cid/CID"),eU={writable:!1,configurable:!1,enumerable:!0},eF={writable:!1,enumerable:!1,configurable:!1},eB=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},e$=`CID.isCID(v) is deprecated and will be removed in the next major release.
49Following code pattern:
50
51if (CID.isCID(value)) {
52  doSomethingWithCID(value)
53}
54
55Is replaced with:
56
57const cid = CID.asCID(value)
58if (cid) {
59  // Make sure to use cid instead of value
60  doSomethingWithCID(cid)
61}
62`,eH={...i,...n,...s,...o,...a,...c,...u,...h,...l,...f};function eV(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...d,...p});let eK=eV("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),eW=eV("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=y((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),eJ={utf8:eK,"utf-8":eK,hex:eH.base16,latin1:eW,ascii:eW,binary:eW,...eH};function eG(e,t="utf8"){let r=eJ[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function eY(e,t="utf8"){let r=eJ[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}},58274:function(e){"use strict";e.exports={i8:"6.6.0"}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.