(()=>{var t={23302(){},67164(t,i,r){!function(t,i){"use strict";function e(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,i,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var s;"object"==typeof t?t.exports=o:i.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(23302).Buffer}catch(t){}function h(t,i){var r=t.charCodeAt(i);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void e(!1,"Invalid character in "+t)}function u(t,i,r){var e=h(t,r);return r-1>=i&&(e|=h(t,r-1)<<4),e}function a(t,i,r,n){for(var o=0,s=0,h=Math.min(t.length,r),u=i;u=49?a-49+10:a>=17?a-17+10:a,e(a>=0&&s0?t:i},o.min=function(t,i){return t.cmp(i)<0?t:i},o.prototype._init=function(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),e(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);return this._strip()},o.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var e=0;e=i;e-=2)n=u(t,i,e)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(e=(t.length-i)%2==0?i+1:i;e=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var o=t.length-r,s=o%e,h=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var m=["","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"],d=[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],c=[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,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],o=0|i.words[0],s=n*o,h=67108863&s,u=s/67108864|0;r.words[0]=h;for(var a=1;a>>26,f=67108863&u,m=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=m;d++){var c=a-d|0;l+=(s=(n=0|t.words[c])*(o=0|i.words[d])+f)/67108864|0,f=67108863&s}r.words[a]=0|f,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),r=0!==o||s!==this.length-1?m[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%i!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var a=d[t],l=c[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?p+r:m[a-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%i!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,i){return this.toArrayLike(s,t,i)}),o.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},o.prototype.toArrayLike=function(t,i,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);e(n<=o,"byte array longer than desired length"),e(o>0,"Requested array length <= 0");var s=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,o);return this["_toArrayLike"+("le"===i?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(t,i){for(var r=0,e=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),e=0,o=0):(e=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),e=0,o=0):(e=s>>>24,o+=2)}if(r>=0)for(t[r--]=e;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},o.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 8191&i||(r+=13,i>>>=13),127&i||(r+=7,i>>>=7),15&i||(r+=4,i>>>=4),3&i||(r+=2,i>>>=2),1&i||r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;it.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;et.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){e("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,i){e("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<t.length?(r=this,e=t):(r=t,e=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var o=0,s=0;s>26,this.words[s]=67108863&i;for(;0!==o&&s>26,this.words[s]=67108863&i;if(0===o&&s>>13,d=0|s[1],c=8191&d,p=d>>>13,v=0|s[2],g=8191&v,M=v>>>13,w=0|s[3],y=8191&w,b=w>>>13,_=0|s[4],A=8191&_,x=_>>>13,k=0|s[5],S=8191&k,B=k>>>13,L=0|s[6],N=8191&L,R=L>>>13,q=0|s[7],E=8191&q,C=q>>>13,Z=0|s[8],$=8191&Z,j=Z>>>13,P=0|s[9],U=8191&P,I=P>>>13,O=0|h[0],T=8191&O,z=O>>>13,D=0|h[1],W=8191&D,F=D>>>13,K=0|h[2],H=8191&K,G=K>>>13,J=0|h[3],X=8191&J,Y=J>>>13,Q=0|h[4],V=8191&Q,tt=Q>>>13,it=0|h[5],rt=8191&it,et=it>>>13,nt=0|h[6],ot=8191&nt,st=nt>>>13,ht=0|h[7],ut=8191&ht,at=ht>>>13,lt=0|h[8],ft=8191<,mt=lt>>>13,dt=0|h[9],ct=8191&dt,pt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(e=Math.imul(f,T))|0)+((8191&(n=(n=Math.imul(f,z))+Math.imul(m,T)|0))<<13)|0;a=((o=Math.imul(m,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(c,T),n=(n=Math.imul(c,z))+Math.imul(p,T)|0,o=Math.imul(p,z);var gt=(a+(e=e+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,F)|0)+Math.imul(m,W)|0))<<13)|0;a=((o=o+Math.imul(m,F)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,e=Math.imul(g,T),n=(n=Math.imul(g,z))+Math.imul(M,T)|0,o=Math.imul(M,z),e=e+Math.imul(c,W)|0,n=(n=n+Math.imul(c,F)|0)+Math.imul(p,W)|0,o=o+Math.imul(p,F)|0;var Mt=(a+(e=e+Math.imul(f,H)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(m,H)|0))<<13)|0;a=((o=o+Math.imul(m,G)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,e=Math.imul(y,T),n=(n=Math.imul(y,z))+Math.imul(b,T)|0,o=Math.imul(b,z),e=e+Math.imul(g,W)|0,n=(n=n+Math.imul(g,F)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,F)|0,e=e+Math.imul(c,H)|0,n=(n=n+Math.imul(c,G)|0)+Math.imul(p,H)|0,o=o+Math.imul(p,G)|0;var wt=(a+(e=e+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,X)|0))<<13)|0;a=((o=o+Math.imul(m,Y)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(A,T),n=(n=Math.imul(A,z))+Math.imul(x,T)|0,o=Math.imul(x,z),e=e+Math.imul(y,W)|0,n=(n=n+Math.imul(y,F)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,F)|0,e=e+Math.imul(g,H)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,G)|0,e=e+Math.imul(c,X)|0,n=(n=n+Math.imul(c,Y)|0)+Math.imul(p,X)|0,o=o+Math.imul(p,Y)|0;var yt=(a+(e=e+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,V)|0))<<13)|0;a=((o=o+Math.imul(m,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(S,T),n=(n=Math.imul(S,z))+Math.imul(B,T)|0,o=Math.imul(B,z),e=e+Math.imul(A,W)|0,n=(n=n+Math.imul(A,F)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,F)|0,e=e+Math.imul(y,H)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,G)|0,e=e+Math.imul(g,X)|0,n=(n=n+Math.imul(g,Y)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Y)|0,e=e+Math.imul(c,V)|0,n=(n=n+Math.imul(c,tt)|0)+Math.imul(p,V)|0,o=o+Math.imul(p,tt)|0;var bt=(a+(e=e+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,et)|0)+Math.imul(m,rt)|0))<<13)|0;a=((o=o+Math.imul(m,et)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(N,T),n=(n=Math.imul(N,z))+Math.imul(R,T)|0,o=Math.imul(R,z),e=e+Math.imul(S,W)|0,n=(n=n+Math.imul(S,F)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,F)|0,e=e+Math.imul(A,H)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,G)|0,e=e+Math.imul(y,X)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0,e=e+Math.imul(g,V)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,tt)|0,e=e+Math.imul(c,rt)|0,n=(n=n+Math.imul(c,et)|0)+Math.imul(p,rt)|0,o=o+Math.imul(p,et)|0;var _t=(a+(e=e+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0))<<13)|0;a=((o=o+Math.imul(m,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(E,T),n=(n=Math.imul(E,z))+Math.imul(C,T)|0,o=Math.imul(C,z),e=e+Math.imul(N,W)|0,n=(n=n+Math.imul(N,F)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,F)|0,e=e+Math.imul(S,H)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,G)|0,e=e+Math.imul(A,X)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Y)|0,e=e+Math.imul(y,V)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,tt)|0,e=e+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,et)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,et)|0,e=e+Math.imul(c,ot)|0,n=(n=n+Math.imul(c,st)|0)+Math.imul(p,ot)|0,o=o+Math.imul(p,st)|0;var At=(a+(e=e+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ut)|0))<<13)|0;a=((o=o+Math.imul(m,at)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul($,T),n=(n=Math.imul($,z))+Math.imul(j,T)|0,o=Math.imul(j,z),e=e+Math.imul(E,W)|0,n=(n=n+Math.imul(E,F)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,F)|0,e=e+Math.imul(N,H)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,G)|0,e=e+Math.imul(S,X)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,e=e+Math.imul(A,V)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,et)|0,e=e+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,e=e+Math.imul(c,ut)|0,n=(n=n+Math.imul(c,at)|0)+Math.imul(p,ut)|0,o=o+Math.imul(p,at)|0;var xt=(a+(e=e+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;a=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(U,T),n=(n=Math.imul(U,z))+Math.imul(I,T)|0,o=Math.imul(I,z),e=e+Math.imul($,W)|0,n=(n=n+Math.imul($,F)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,F)|0,e=e+Math.imul(E,H)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,G)|0,e=e+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,e=e+Math.imul(S,V)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,tt)|0,e=e+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,et)|0,e=e+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,e=e+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,at)|0,e=e+Math.imul(c,ft)|0,n=(n=n+Math.imul(c,mt)|0)+Math.imul(p,ft)|0,o=o+Math.imul(p,mt)|0;var kt=(a+(e=e+Math.imul(f,ct)|0)|0)+((8191&(n=(n=n+Math.imul(f,pt)|0)+Math.imul(m,ct)|0))<<13)|0;a=((o=o+Math.imul(m,pt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,e=Math.imul(U,W),n=(n=Math.imul(U,F))+Math.imul(I,W)|0,o=Math.imul(I,F),e=e+Math.imul($,H)|0,n=(n=n+Math.imul($,G)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,G)|0,e=e+Math.imul(E,X)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Y)|0,e=e+Math.imul(N,V)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,et)|0,e=e+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,at)|0,e=e+Math.imul(g,ft)|0,n=(n=n+Math.imul(g,mt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,mt)|0;var St=(a+(e=e+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,pt)|0)+Math.imul(p,ct)|0))<<13)|0;a=((o=o+Math.imul(p,pt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(U,H),n=(n=Math.imul(U,G))+Math.imul(I,H)|0,o=Math.imul(I,G),e=e+Math.imul($,X)|0,n=(n=n+Math.imul($,Y)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,Y)|0,e=e+Math.imul(E,V)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,tt)|0,e=e+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,et)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,et)|0,e=e+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,at)|0,e=e+Math.imul(y,ft)|0,n=(n=n+Math.imul(y,mt)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,mt)|0;var Bt=(a+(e=e+Math.imul(g,ct)|0)|0)+((8191&(n=(n=n+Math.imul(g,pt)|0)+Math.imul(M,ct)|0))<<13)|0;a=((o=o+Math.imul(M,pt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,e=Math.imul(U,X),n=(n=Math.imul(U,Y))+Math.imul(I,X)|0,o=Math.imul(I,Y),e=e+Math.imul($,V)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,tt)|0,e=e+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,et)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,et)|0,e=e+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,at)|0,e=e+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,mt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,mt)|0;var Lt=(a+(e=e+Math.imul(y,ct)|0)|0)+((8191&(n=(n=n+Math.imul(y,pt)|0)+Math.imul(b,ct)|0))<<13)|0;a=((o=o+Math.imul(b,pt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,e=Math.imul(U,V),n=(n=Math.imul(U,tt))+Math.imul(I,V)|0,o=Math.imul(I,tt),e=e+Math.imul($,rt)|0,n=(n=n+Math.imul($,et)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,et)|0,e=e+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,e=e+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,at)|0,e=e+Math.imul(S,ft)|0,n=(n=n+Math.imul(S,mt)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,mt)|0;var Nt=(a+(e=e+Math.imul(A,ct)|0)|0)+((8191&(n=(n=n+Math.imul(A,pt)|0)+Math.imul(x,ct)|0))<<13)|0;a=((o=o+Math.imul(x,pt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(U,rt),n=(n=Math.imul(U,et))+Math.imul(I,rt)|0,o=Math.imul(I,et),e=e+Math.imul($,ot)|0,n=(n=n+Math.imul($,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,at)|0,e=e+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,mt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,mt)|0;var Rt=(a+(e=e+Math.imul(S,ct)|0)|0)+((8191&(n=(n=n+Math.imul(S,pt)|0)+Math.imul(B,ct)|0))<<13)|0;a=((o=o+Math.imul(B,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(I,ot)|0,o=Math.imul(I,st),e=e+Math.imul($,ut)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,mt)|0)+Math.imul(C,ft)|0,o=o+Math.imul(C,mt)|0;var qt=(a+(e=e+Math.imul(N,ct)|0)|0)+((8191&(n=(n=n+Math.imul(N,pt)|0)+Math.imul(R,ct)|0))<<13)|0;a=((o=o+Math.imul(R,pt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,e=Math.imul(U,ut),n=(n=Math.imul(U,at))+Math.imul(I,ut)|0,o=Math.imul(I,at),e=e+Math.imul($,ft)|0,n=(n=n+Math.imul($,mt)|0)+Math.imul(j,ft)|0,o=o+Math.imul(j,mt)|0;var Et=(a+(e=e+Math.imul(E,ct)|0)|0)+((8191&(n=(n=n+Math.imul(E,pt)|0)+Math.imul(C,ct)|0))<<13)|0;a=((o=o+Math.imul(C,pt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,e=Math.imul(U,ft),n=(n=Math.imul(U,mt))+Math.imul(I,ft)|0,o=Math.imul(I,mt);var Ct=(a+(e=e+Math.imul($,ct)|0)|0)+((8191&(n=(n=n+Math.imul($,pt)|0)+Math.imul(j,ct)|0))<<13)|0;a=((o=o+Math.imul(j,pt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Zt=(a+(e=Math.imul(U,ct))|0)+((8191&(n=(n=Math.imul(U,pt))+Math.imul(I,ct)|0))<<13)|0;return a=((o=Math.imul(I,pt))+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,u[0]=vt,u[1]=gt,u[2]=Mt,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=At,u[8]=xt,u[9]=kt,u[10]=St,u[11]=Bt,u[12]=Lt,u[13]=Nt,u[14]=Rt,u[15]=qt,u[16]=Et,u[17]=Ct,u[18]=Zt,0!==a&&(u[19]=a,r.length++),r};function g(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=h,e=s,s=n}return 0!==e?r.words[o]=e:r.length--,r._strip()}function M(t,i,r){return g(t,i,r)}function w(t,i){this.x=t,this.y=i}Math.imul||(v=p),o.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,i):r<63?p(this,t,i):r<1024?g(this,t,i):M(this,t,i)},w.prototype.makeRBT=function(t){for(var i=new Array(t),r=o.prototype._countBits(t)-1,e=0;e>=1;return e},w.prototype.permute=function(t,i,r,e,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*i;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this.length=0===t?1:this.length,i?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r>>n&1}return i}(t);if(0===i.length)return new o(1);for(var r=this,e=0;e=0);var i,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(i=0;i>>26-r}s&&(this.words[i]=s,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i=0),n=i?(i-i%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),h=67108863^67108863>>>o<s)for(this.length-=s,a=0;a=0&&(0!==l||a>=n);a--){var f=0|this.words[a];this.words[a]=l<<26-o|f>>>o,l=f&h}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,i,r){return e(0===this.negative),this.iushrn(t,i,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){e("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,n=1<=0);var i=t%26,r=(t-i)/26;if(e(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var n=67108863^67108863>>>i<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},o.prototype.isubn=function(t){if(e("number"==typeof t),e(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===h)return this._strip();for(e(-1===h),h=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,i){var r=(this.length,t.length),e=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),e.iushln(r),s=0|n.words[n.length-1]);var h,u=e.length-n.length;if("mod"!==i){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var a=0;a=0;f--){var m=67108864*(0|e.words[n.length+f])+(0|e.words[n.length+f-1]);for(m=Math.min(m/s|0,67108863),e._ishlnsubmul(n,m,f);0!==e.negative;)m--,e.negative=0,e._ishlnsubmul(n,1,f),e.isZero()||(e.negative^=1);h&&(h.words[f]=m)}return h&&h._strip(),e._strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:h||null,mod:e}},o.prototype.divmod=function(t,i,r){return e(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(n=h.div.neg()),"div"!==i&&(s=h.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(n=h.div.neg()),{div:n,mod:h.mod}):0!==(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(s=h.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:h.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,i);var n,s,h},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),o=r.cmp(e);return o<0||1===n&&0===o?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},o.prototype.modrn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return i?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),i?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new o(1),s=new o(0),h=new o(0),u=new o(1),a=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++a;for(var l=r.clone(),f=i.clone();!i.isZero();){for(var m=0,d=1;0===(i.words[0]&d)&&m<26;++m,d<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var c=0,p=1;0===(r.words[0]&p)&&c<26;++c,p<<=1);if(c>0)for(r.iushrn(c);c-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(l),u.isub(f)),h.iushrn(1),u.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(h),s.isub(u)):(r.isub(i),h.isub(n),u.isub(s))}return{a:h,b:u,gcd:r.iushln(a)}},o.prototype._invmp=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,s=new o(1),h=new o(0),u=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,l=1;0===(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,m=1;0===(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);i.cmp(r)>=0?(i.isub(r),s.isub(h)):(r.isub(i),h.isub(s))}return(n=0===i.cmpn(1)?s:h).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var o=i;i=r,r=o}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){e("number"==typeof t);var i=t%26,r=(t-i)/26,n=1<>>26,h&=67108863,this.words[s]=h}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)i=1;else{r&&(t=-t),e(t<=67108863,"Number is too big");var n=0|this.words[0];i=n===t?0:nt.length)return 1;if(this.length=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){en&&(i=1);break}}return i},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return e(!this.red,"Already a number in reduction context"),e(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return e(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return e(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,i){this.name=t,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var i=o._prime(t);this.m=i.p,this.prime=i}else e(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function B(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,i){t.iushrn(this.n,0,i)},b.prototype.imulK=function(t){return t.imul(this.k)},n(_,b),_.prototype.split=function(t,i){for(var r=4194303,e=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},o._prime=function(t){if(y[t])return y[t];var i;if("k256"===t)i=new _;else if("p224"===t)i=new A;else if("p192"===t)i=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new k}return y[t]=i,i},S.prototype._verify1=function(t){e(0===t.negative,"red works only with positives"),e(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,i){e(0===(t.negative|i.negative),"red works only with positives"),e(t.red&&t.red===i.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},S.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},S.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(e(i%2==1),3===i){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);e(!n.isZero());var h=new o(1).toRed(this),u=h.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,n),m=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),c=s;0!==d.cmp(h);){for(var p=d,v=0;0!==p.cmp(h);v++)p=p.redSqr();e(v=0;e--){for(var a=i.words[e],l=u-1;l>=0;l--){var f=a>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4===++h||0===e&&0===l)&&(n=this.mul(n,r[s]),h=0,s=0)):h=0}u=26}return n},S.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},S.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},o.mont=function(t){return new B(t)},n(B,S),B.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},B.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},B.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},B.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new o(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},B.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},82646(t){"use strict";var i=Object.prototype.hasOwnProperty,r="~";function e(){}function n(t,i,r){this.fn=t,this.context=i,this.once=r||!1}function o(t,i,e,o,s){if("function"!=typeof e)throw new TypeError("The listener must be a function");var h=new n(e,o||t,s),u=r?r+i:i;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],h]:t._events[u].push(h):(t._events[u]=h,t._eventsCount++),t}function s(t,i){0===--t._eventsCount?t._events=new e:delete t._events[i]}function h(){this._events=new e,this._eventsCount=0}Object.create&&(e.prototype=Object.create(null),(new e).__proto__||(r=!1)),h.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},h.prototype.listeners=function(t){var i=r?r+t:t,e=this._events[i];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,o=e.length,s=new Array(o);n(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";const t="Pezkuwi-0x343cabeadae178ba",i=`${t}-page`,e=`${t}-content`;let n,o,s=0;class h{constructor(t){n=t}get(t){return n("pub(accounts.list)",{anyType:t})}subscribe(t){let i=null;return n("pub(accounts.subscribe)",null,t).then(t=>{i=t}).catch(console.error),()=>{i&&n("pub(accounts.unsubscribe)",{id:i}).catch(console.error)}}}class u{constructor(t){o=t}get(){return o("pub(metadata.list)")}provide(t){return o("pub(metadata.provide)",t)}}var a=r(82646);const l="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this");function f(t,i){return void 0===l[t]?i:l[t]}function m(t){return t.toString().padStart(2,"0")}var d=r(67164);function c(){return Number.NaN}const p=f("BigInt",c),v=("function"==typeof p&&p.asIntN,"function"==typeof l.Buffer&&"function"==typeof l.Buffer.isBuffer);function g(t){return"function"==typeof t}function M(t){return v&&!!t&&g(t.readDoubleLE)&&l.Buffer.isBuffer(t)}function w(t){return(t&&t.constructor)===Uint8Array||t instanceof Uint8Array}l.process;const y=new Array(256),b=new Array(65536);for(let t=0;t<256;t++)y[t]=t.toString(16).padStart(2,"0");for(let t=0;t<256;t++){const i=t<<8;for(let r=0;r<256;r++)b[i|r]=y[t]+y[r]}function _(t,i){const r=t.length%2|0,e=t.length-r|0;for(let r=0;r9&&(x[0|A[t].toUpperCase().charCodeAt(0)]=0|t);for(let t=0;t<256;t++){const i=t<<8;for(let r=0;r<256;r++)k[i|r]=x[t]<<4|x[r]}const S=/^0x[\da-fA-F]+$/;class B{encode(t){const i=t.length,r=new Uint8Array(i);for(let e=0;e0){const r=Math.ceil(i/8);if(t.length>r)return`${_(t.subarray(0,r/2),e)}…${_(t.subarray(t.length-r/2),"")}`}return _(t,e)}(function(t,i=!1){if(i&&null==t)throw new Error("u8aToU8a: Expected non-null, non-undefined value");return w(t)?M(t)?new Uint8Array(t):t:function(t,i=-1,r){return"string"==typeof t&&("0x"===t||S.test(t))&&(-1===i?r||t.length%2==0:t.length===2+Math.ceil(i/4))}(t)?function(t,i=-1){if(!t)return new Uint8Array;let r=t.startsWith("0x")?2:0;const e=Math.ceil((t.length-r)/2),n=Math.ceil(-1===i?e:i/8),o=new Uint8Array(n);for(let i=n>e?n-e:0;i{if(n<=0)return t;const i=`${t}`;return i.lengthE("debug",i,t,e):N,error:(...t)=>E("error",i,t),log:(...t)=>E("log",i,t),noop:N,warn:(...t)=>E("warn",i,t)}}("PostMessageProvider");let P,U;class I{#t;#i=!1;#r={};constructor(t){this.#t=new a,P=t}get isClonable(){return!0}clone(){return new I(P)}async connect(){console.error("PostMessageProvider.disconnect() is not implemented.")}async disconnect(){console.error("PostMessageProvider.disconnect() is not implemented.")}get hasSubscriptions(){return!0}get isConnected(){return this.#i}listProviders(){return P("pub(rpc.listProviders)",void 0)}on(t,i){return this.#t.on(t,i),()=>{this.#t.removeListener(t,i)}}async send(t,i,r,e){if(e){const{callback:r,type:n}=e,o=await P("pub(rpc.subscribe)",{method:t,params:i,type:n},t=>{e.callback(null,t)});return this.#r[`${n}::${o}`]=r,o}return P("pub(rpc.send)",{method:t,params:i})}async startProvider(t){this.#i=!1,this.#t.emit("disconnected");const i=await P("pub(rpc.startProvider)",t);return P("pub(rpc.subscribeConnected)",null,t=>(this.#i=t,t?this.#t.emit("connected"):this.#t.emit("disconnected"),!0)),i}subscribe(t,i,r,e){return this.send(i,r,!1,{callback:e,type:t})}async unsubscribe(t,i,r){const e=`${t}::${r}`;return void 0===this.#r[e]?(j.debug(()=>`Unable to find active subscription=${e}`),!1):(delete this.#r[e],this.send(i,[r]))}}let O=0;class T{constructor(t){U=t}async signPayload(t){const i=++O;return{...await U("pub(extrinsic.sign)",t),id:i}}async signRaw(t){const i=++O;return{...await U("pub(bytes.sign)",t),id:i}}}const z=class{accounts;metadata;provider;signer;constructor(t){this.accounts=new h(t),this.metadata=new u(t),this.provider=new I(t),this.signer=new T(t),setInterval(()=>{t("pub(ping)",null).catch(()=>{console.error("Extension unavailable, ping failed")})},5e3+Math.floor(5e3*Math.random()))}},D={};function W(t,r,e){return new Promise((n,o)=>{const h=`Pezkuwi.${Date.now()}.${++s}`;D[h]={reject:o,resolve:n,subscriber:e};const u={id:h,message:t,origin:i,request:r||null};window.postMessage(u,"*")})}window.addEventListener("message",({data:t,source:i})=>{i===window&&t.origin===e&&(t.id?function(t){const i=D[t.id];i?(i.subscriber||delete D[t.id],t.subscription?i.subscriber(t.subscription):t.error?i.reject(new Error(t.error)):i.resolve(t.response)):console.error(`Unknown response: ${JSON.stringify(t)}`)}(t):console.error("Missing id for response."))}),function(t,{name:i,version:r}){const e=window;e.injectedWeb3=e.injectedWeb3||{},e.injectedWeb3[i]={enable:i=>t(i),version:r}}(async function(t){return await W("pub(authorize.tab)",{origin:t}),new z(W)},{name:"pezkuwi",version:"0.62.15"}),async function(){return await W("pub(phishing.redirectIfDenied)")}().catch(t=>console.warn(`Unable to determine if the site is in the phishing list: ${t.message}`))})()})();