Files
to_session/text/3.65.22_0/scripts/ui/chunk-QWOR3C5W.js
Administrator a0720d80dc fefdwef
2025-11-12 12:54:37 +08:00

8 lines
57 KiB
JavaScript

import{d as Vr,e as Qr}from"./chunk-WMCBVXPA.js";import{c as Zt,o as At,p as vt,q as Ft}from"./chunk-QTLWQ5AJ.js";var Zr=Zt((Cr,cr)=>{At();Ft();(function(m,v){"use strict";function u(a,t){if(!a)throw new Error(t||"Assertion failed")}function c(a,t){a.super_=t;var i=function(){};i.prototype=t.prototype,a.prototype=new i,a.prototype.constructor=a}function h(a,t,i){if(h.isBN(a))return a;this.negative=0,this.words=null,this.length=0,this.red=null,a!==null&&((t==="le"||t==="be")&&(i=t,t=10),this._init(a||0,t||10,i||"be"))}typeof m=="object"?m.exports=h:v.BN=h,h.BN=h,h.wordSize=26;var p;try{typeof window<"u"&&typeof window.Buffer<"u"?p=window.Buffer:p=Vr().Buffer}catch{}h.isBN=function(t){return t instanceof h?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){return t.cmp(i)>0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,e){if(typeof t=="number")return this._initNumber(t,i,e);if(typeof t=="object")return this._initArray(t,i,e);i==="hex"&&(i=16),u(i===(i|0)&&i>=2&&i<=36),t=t.toString().replace(/\s+/g,"");var n=0;t[0]==="-"&&(n++,this.negative=1),n<t.length&&(i===16?this._parseHex(t,n,e):(this._parseBase(t,i,n),e==="le"&&this._initArray(this.toArray(),i,e)))},h.prototype._initNumber=function(t,i,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(u(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),e==="le"&&this._initArray(this.toArray(),i,e)},h.prototype._initArray=function(t,i,e){if(u(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,l,d=0;if(e==="be")for(n=t.length-1,s=0;n>=0;n-=3)l=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=l<<d&67108863,this.words[s+1]=l>>>26-d&67108863,d+=24,d>=26&&(d-=26,s++);else if(e==="le")for(n=0,s=0;n<t.length;n+=3)l=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=l<<d&67108863,this.words[s+1]=l>>>26-d&67108863,d+=24,d>=26&&(d-=26,s++);return this._strip()};function w(a,t){var i=a.charCodeAt(t);if(i>=48&&i<=57)return i-48;if(i>=65&&i<=70)return i-55;if(i>=97&&i<=102)return i-87;u(!1,"Invalid character in "+a)}function R(a,t,i){var e=w(a,i);return i-1>=t&&(e|=w(a,i-1)<<4),e}h.prototype._parseHex=function(t,i,e){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s=0,l=0,d;if(e==="be")for(n=t.length-1;n>=i;n-=2)d=R(t,i,n)<<s,this.words[l]|=d&67108863,s>=18?(s-=18,l+=1,this.words[l]|=d>>>26):s+=8;else{var f=t.length-i;for(n=f%2===0?i+1:i;n<t.length;n+=2)d=R(t,i,n)<<s,this.words[l]|=d&67108863,s>=18?(s-=18,l+=1,this.words[l]|=d>>>26):s+=8}this._strip()};function A(a,t,i,e){for(var n=0,s=0,l=Math.min(a.length,i),d=t;d<l;d++){var f=a.charCodeAt(d)-48;n*=e,f>=49?s=f-49+10:f>=17?s=f-17+10:s=f,u(f>=0&&s<e,"Invalid character"),n+=s}return n}h.prototype._parseBase=function(t,i,e){this.words=[0],this.length=1;for(var n=0,s=1;s<=67108863;s*=i)n++;n--,s=s/i|0;for(var l=t.length-e,d=l%n,f=Math.min(l,l-d)+e,r=0,o=e;o<f;o+=n)r=A(t,o,o+n,i),this.imuln(s),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r);if(d!==0){var g=1;for(r=A(t,o,t.length,i),o=0;o<d;o++)g*=i;this.imuln(g),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r)}this._strip()},h.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red};function qt(a,t){a.words=t.words,a.length=t.length,a.negative=t.negative,a.red=t.red}if(h.prototype._move=function(t){qt(t,this)},h.prototype.clone=function(){var t=new h(null);return this.copy(t),t},h.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},h.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},h.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{h.prototype[Symbol.for("nodejs.util.inspect.custom")]=It}catch{h.prototype.inspect=It}else h.prototype.inspect=It;function It(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var Ct=["","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"],Jt=[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],E=[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];h.prototype.toString=function(t,i){t=t||10,i=i|0||1;var e;if(t===16||t==="hex"){e="";for(var n=0,s=0,l=0;l<this.length;l++){var d=this.words[l],f=((d<<n|s)&16777215).toString(16);s=d>>>24-n&16777215,n+=2,n>=26&&(n-=26,l--),s!==0||l!==this.length-1?e=Ct[6-f.length]+f+e:e=f+e}for(s!==0&&(e=s.toString(16)+e);e.length%i!==0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}if(t===(t|0)&&t>=2&&t<=36){var r=Jt[t],o=E[t];e="";var g=this.clone();for(g.negative=0;!g.isZero();){var M=g.modrn(o).toString(t);g=g.idivn(o),g.isZero()?e=M+e:e=Ct[r-M.length]+M+e}for(this.isZero()&&(e="0"+e);e.length%i!==0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}u(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},p&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(p,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)};var mt=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)};h.prototype.toArrayLike=function(t,i,e){this._strip();var n=this.byteLength(),s=e||Math.max(1,n);u(n<=s,"byte array longer than desired length"),u(s>0,"Requested array length <= 0");var l=mt(t,s),d=i==="le"?"LE":"BE";return this["_toArrayLike"+d](l,n),l},h.prototype._toArrayLikeLE=function(t,i){for(var e=0,n=0,s=0,l=0;s<this.length;s++){var d=this.words[s]<<l|n;t[e++]=d&255,e<t.length&&(t[e++]=d>>8&255),e<t.length&&(t[e++]=d>>16&255),l===6?(e<t.length&&(t[e++]=d>>24&255),n=0,l=0):(n=d>>>24,l+=2)}if(e<t.length)for(t[e++]=n;e<t.length;)t[e++]=0},h.prototype._toArrayLikeBE=function(t,i){for(var e=t.length-1,n=0,s=0,l=0;s<this.length;s++){var d=this.words[s]<<l|n;t[e--]=d&255,e>=0&&(t[e--]=d>>8&255),e>=0&&(t[e--]=d>>16&255),l===6?(e>=0&&(t[e--]=d>>24&255),n=0,l=0):(n=d>>>24,l+=2)}if(e>=0)for(t[e--]=n;e>=0;)t[e--]=0},Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,e=0;return i>=4096&&(e+=13,i>>>=13),i>=64&&(e+=7,i>>>=7),i>=8&&(e+=4,i>>>=4),i>=2&&(e+=2,i>>>=2),e+i},h.prototype._zeroBits=function(t){if(t===0)return 26;var i=t,e=0;return(i&8191)===0&&(e+=13,i>>>=13),(i&127)===0&&(e+=7,i>>>=7),(i&15)===0&&(e+=4,i>>>=4),(i&3)===0&&(e+=2,i>>>=2),(i&1)===0&&e++,e},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return(this.length-1)*26+i};function bt(a){for(var t=new Array(a.bitLength()),i=0;i<t.length;i++){var e=i/26|0,n=i%26;t[i]=a.words[e]>>>n&1}return t}h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var e=this._zeroBits(this.words[i]);if(t+=e,e!==26)break}return t},h.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},h.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},h.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},h.prototype.isNeg=function(){return this.negative!==0},h.prototype.neg=function(){return this.clone().ineg()},h.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},h.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},h.prototype.ior=function(t){return u((this.negative|t.negative)===0),this.iuor(t)},h.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;this.length>t.length?i=t:i=this;for(var e=0;e<i.length;e++)this.words[e]=this.words[e]&t.words[e];return this.length=i.length,this._strip()},h.prototype.iand=function(t){return u((this.negative|t.negative)===0),this.iuand(t)},h.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,e;this.length>t.length?(i=this,e=t):(i=t,e=this);for(var n=0;n<e.length;n++)this.words[n]=i.words[n]^e.words[n];if(this!==i)for(;n<i.length;n++)this.words[n]=i.words[n];return this.length=i.length,this._strip()},h.prototype.ixor=function(t){return u((this.negative|t.negative)===0),this.iuxor(t)},h.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){u(typeof t=="number"&&t>=0);var i=Math.ceil(t/26)|0,e=t%26;this._expand(i),e>0&&i--;for(var n=0;n<i;n++)this.words[n]=~this.words[n]&67108863;return e>0&&(this.words[n]=~this.words[n]&67108863>>26-e),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){u(typeof t=="number"&&t>=0);var e=t/26|0,n=t%26;return this._expand(e+1),i?this.words[e]=this.words[e]|1<<n:this.words[e]=this.words[e]&~(1<<n),this._strip()},h.prototype.iadd=function(t){var i;if(this.negative!==0&&t.negative===0)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var s=0,l=0;l<n.length;l++)i=(e.words[l]|0)+(n.words[l]|0)+s,this.words[l]=i&67108863,s=i>>>26;for(;s!==0&&l<e.length;l++)i=(e.words[l]|0)+s,this.words[l]=i&67108863,s=i>>>26;if(this.length=e.length,s!==0)this.words[this.length]=s,this.length++;else if(e!==this)for(;l<e.length;l++)this.words[l]=e.words[l];return this},h.prototype.add=function(t){var i;return t.negative!==0&&this.negative===0?(t.negative=0,i=this.sub(t),t.negative^=1,i):t.negative===0&&this.negative!==0?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e=this.cmp(t);if(e===0)return this.negative=0,this.length=1,this.words[0]=0,this;var n,s;e>0?(n=this,s=t):(n=t,s=this);for(var l=0,d=0;d<s.length;d++)i=(n.words[d]|0)-(s.words[d]|0)+l,l=i>>26,this.words[d]=i&67108863;for(;l!==0&&d<n.length;d++)i=(n.words[d]|0)+l,l=i>>26,this.words[d]=i&67108863;if(l===0&&d<n.length&&n!==this)for(;d<n.length;d++)this.words[d]=n.words[d];return this.length=Math.max(this.length,d),n!==this&&(this.negative=1),this._strip()},h.prototype.sub=function(t){return this.clone().isub(t)};function wt(a,t,i){i.negative=t.negative^a.negative;var e=a.length+t.length|0;i.length=e,e=e-1|0;var n=a.words[0]|0,s=t.words[0]|0,l=n*s,d=l&67108863,f=l/67108864|0;i.words[0]=d;for(var r=1;r<e;r++){for(var o=f>>>26,g=f&67108863,M=Math.min(r,t.length-1),y=Math.max(0,r-a.length+1);y<=M;y++){var x=r-y|0;n=a.words[x]|0,s=t.words[y]|0,l=n*s+g,o+=l/67108864|0,g=l&67108863}i.words[r]=g|0,f=o|0}return f!==0?i.words[r]=f|0:i.length--,i._strip()}var yt=function(t,i,e){var n=t.words,s=i.words,l=e.words,d=0,f,r,o,g=n[0]|0,M=g&8191,y=g>>>13,x=n[1]|0,_=x&8191,F=x>>>13,Et=n[2]|0,B=Et&8191,U=Et>>>13,xr=n[3]|0,O=xr&8191,D=xr>>>13,_r=n[4]|0,q=_r&8191,L=_r>>>13,br=n[5]|0,I=br&8191,C=br>>>13,Ar=n[6]|0,Z=Ar&8191,N=Ar>>>13,Fr=n[7]|0,P=Fr&8191,$=Fr>>>13,Br=n[8]|0,T=Br&8191,K=Br>>>13,Sr=n[9]|0,G=Sr&8191,H=Sr>>>13,Ur=s[0]|0,J=Ur&8191,W=Ur>>>13,Er=s[1]|0,V=Er&8191,Q=Er>>>13,Rr=s[2]|0,X=Rr&8191,Y=Rr>>>13,kr=s[3]|0,j=kr&8191,tt=kr>>>13,zr=s[4]|0,rt=zr&8191,it=zr>>>13,Or=s[5]|0,et=Or&8191,nt=Or>>>13,Dr=s[6]|0,ht=Dr&8191,ft=Dr>>>13,qr=s[7]|0,st=qr&8191,ot=qr>>>13,Lr=s[8]|0,at=Lr&8191,lt=Lr>>>13,Ir=s[9]|0,ut=Ir&8191,dt=Ir>>>13;e.negative=t.negative^i.negative,e.length=19,f=Math.imul(M,J),r=Math.imul(M,W),r=r+Math.imul(y,J)|0,o=Math.imul(y,W);var Vt=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,f=Math.imul(_,J),r=Math.imul(_,W),r=r+Math.imul(F,J)|0,o=Math.imul(F,W),f=f+Math.imul(M,V)|0,r=r+Math.imul(M,Q)|0,r=r+Math.imul(y,V)|0,o=o+Math.imul(y,Q)|0;var Qt=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,f=Math.imul(B,J),r=Math.imul(B,W),r=r+Math.imul(U,J)|0,o=Math.imul(U,W),f=f+Math.imul(_,V)|0,r=r+Math.imul(_,Q)|0,r=r+Math.imul(F,V)|0,o=o+Math.imul(F,Q)|0,f=f+Math.imul(M,X)|0,r=r+Math.imul(M,Y)|0,r=r+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0;var Xt=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,f=Math.imul(O,J),r=Math.imul(O,W),r=r+Math.imul(D,J)|0,o=Math.imul(D,W),f=f+Math.imul(B,V)|0,r=r+Math.imul(B,Q)|0,r=r+Math.imul(U,V)|0,o=o+Math.imul(U,Q)|0,f=f+Math.imul(_,X)|0,r=r+Math.imul(_,Y)|0,r=r+Math.imul(F,X)|0,o=o+Math.imul(F,Y)|0,f=f+Math.imul(M,j)|0,r=r+Math.imul(M,tt)|0,r=r+Math.imul(y,j)|0,o=o+Math.imul(y,tt)|0;var Yt=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,f=Math.imul(q,J),r=Math.imul(q,W),r=r+Math.imul(L,J)|0,o=Math.imul(L,W),f=f+Math.imul(O,V)|0,r=r+Math.imul(O,Q)|0,r=r+Math.imul(D,V)|0,o=o+Math.imul(D,Q)|0,f=f+Math.imul(B,X)|0,r=r+Math.imul(B,Y)|0,r=r+Math.imul(U,X)|0,o=o+Math.imul(U,Y)|0,f=f+Math.imul(_,j)|0,r=r+Math.imul(_,tt)|0,r=r+Math.imul(F,j)|0,o=o+Math.imul(F,tt)|0,f=f+Math.imul(M,rt)|0,r=r+Math.imul(M,it)|0,r=r+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0;var jt=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(jt>>>26)|0,jt&=67108863,f=Math.imul(I,J),r=Math.imul(I,W),r=r+Math.imul(C,J)|0,o=Math.imul(C,W),f=f+Math.imul(q,V)|0,r=r+Math.imul(q,Q)|0,r=r+Math.imul(L,V)|0,o=o+Math.imul(L,Q)|0,f=f+Math.imul(O,X)|0,r=r+Math.imul(O,Y)|0,r=r+Math.imul(D,X)|0,o=o+Math.imul(D,Y)|0,f=f+Math.imul(B,j)|0,r=r+Math.imul(B,tt)|0,r=r+Math.imul(U,j)|0,o=o+Math.imul(U,tt)|0,f=f+Math.imul(_,rt)|0,r=r+Math.imul(_,it)|0,r=r+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,f=f+Math.imul(M,et)|0,r=r+Math.imul(M,nt)|0,r=r+Math.imul(y,et)|0,o=o+Math.imul(y,nt)|0;var tr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(tr>>>26)|0,tr&=67108863,f=Math.imul(Z,J),r=Math.imul(Z,W),r=r+Math.imul(N,J)|0,o=Math.imul(N,W),f=f+Math.imul(I,V)|0,r=r+Math.imul(I,Q)|0,r=r+Math.imul(C,V)|0,o=o+Math.imul(C,Q)|0,f=f+Math.imul(q,X)|0,r=r+Math.imul(q,Y)|0,r=r+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,f=f+Math.imul(O,j)|0,r=r+Math.imul(O,tt)|0,r=r+Math.imul(D,j)|0,o=o+Math.imul(D,tt)|0,f=f+Math.imul(B,rt)|0,r=r+Math.imul(B,it)|0,r=r+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,f=f+Math.imul(_,et)|0,r=r+Math.imul(_,nt)|0,r=r+Math.imul(F,et)|0,o=o+Math.imul(F,nt)|0,f=f+Math.imul(M,ht)|0,r=r+Math.imul(M,ft)|0,r=r+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var rr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(rr>>>26)|0,rr&=67108863,f=Math.imul(P,J),r=Math.imul(P,W),r=r+Math.imul($,J)|0,o=Math.imul($,W),f=f+Math.imul(Z,V)|0,r=r+Math.imul(Z,Q)|0,r=r+Math.imul(N,V)|0,o=o+Math.imul(N,Q)|0,f=f+Math.imul(I,X)|0,r=r+Math.imul(I,Y)|0,r=r+Math.imul(C,X)|0,o=o+Math.imul(C,Y)|0,f=f+Math.imul(q,j)|0,r=r+Math.imul(q,tt)|0,r=r+Math.imul(L,j)|0,o=o+Math.imul(L,tt)|0,f=f+Math.imul(O,rt)|0,r=r+Math.imul(O,it)|0,r=r+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,f=f+Math.imul(B,et)|0,r=r+Math.imul(B,nt)|0,r=r+Math.imul(U,et)|0,o=o+Math.imul(U,nt)|0,f=f+Math.imul(_,ht)|0,r=r+Math.imul(_,ft)|0,r=r+Math.imul(F,ht)|0,o=o+Math.imul(F,ft)|0,f=f+Math.imul(M,st)|0,r=r+Math.imul(M,ot)|0,r=r+Math.imul(y,st)|0,o=o+Math.imul(y,ot)|0;var ir=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(ir>>>26)|0,ir&=67108863,f=Math.imul(T,J),r=Math.imul(T,W),r=r+Math.imul(K,J)|0,o=Math.imul(K,W),f=f+Math.imul(P,V)|0,r=r+Math.imul(P,Q)|0,r=r+Math.imul($,V)|0,o=o+Math.imul($,Q)|0,f=f+Math.imul(Z,X)|0,r=r+Math.imul(Z,Y)|0,r=r+Math.imul(N,X)|0,o=o+Math.imul(N,Y)|0,f=f+Math.imul(I,j)|0,r=r+Math.imul(I,tt)|0,r=r+Math.imul(C,j)|0,o=o+Math.imul(C,tt)|0,f=f+Math.imul(q,rt)|0,r=r+Math.imul(q,it)|0,r=r+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,f=f+Math.imul(O,et)|0,r=r+Math.imul(O,nt)|0,r=r+Math.imul(D,et)|0,o=o+Math.imul(D,nt)|0,f=f+Math.imul(B,ht)|0,r=r+Math.imul(B,ft)|0,r=r+Math.imul(U,ht)|0,o=o+Math.imul(U,ft)|0,f=f+Math.imul(_,st)|0,r=r+Math.imul(_,ot)|0,r=r+Math.imul(F,st)|0,o=o+Math.imul(F,ot)|0,f=f+Math.imul(M,at)|0,r=r+Math.imul(M,lt)|0,r=r+Math.imul(y,at)|0,o=o+Math.imul(y,lt)|0;var er=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(er>>>26)|0,er&=67108863,f=Math.imul(G,J),r=Math.imul(G,W),r=r+Math.imul(H,J)|0,o=Math.imul(H,W),f=f+Math.imul(T,V)|0,r=r+Math.imul(T,Q)|0,r=r+Math.imul(K,V)|0,o=o+Math.imul(K,Q)|0,f=f+Math.imul(P,X)|0,r=r+Math.imul(P,Y)|0,r=r+Math.imul($,X)|0,o=o+Math.imul($,Y)|0,f=f+Math.imul(Z,j)|0,r=r+Math.imul(Z,tt)|0,r=r+Math.imul(N,j)|0,o=o+Math.imul(N,tt)|0,f=f+Math.imul(I,rt)|0,r=r+Math.imul(I,it)|0,r=r+Math.imul(C,rt)|0,o=o+Math.imul(C,it)|0,f=f+Math.imul(q,et)|0,r=r+Math.imul(q,nt)|0,r=r+Math.imul(L,et)|0,o=o+Math.imul(L,nt)|0,f=f+Math.imul(O,ht)|0,r=r+Math.imul(O,ft)|0,r=r+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0,f=f+Math.imul(B,st)|0,r=r+Math.imul(B,ot)|0,r=r+Math.imul(U,st)|0,o=o+Math.imul(U,ot)|0,f=f+Math.imul(_,at)|0,r=r+Math.imul(_,lt)|0,r=r+Math.imul(F,at)|0,o=o+Math.imul(F,lt)|0,f=f+Math.imul(M,ut)|0,r=r+Math.imul(M,dt)|0,r=r+Math.imul(y,ut)|0,o=o+Math.imul(y,dt)|0;var nr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(nr>>>26)|0,nr&=67108863,f=Math.imul(G,V),r=Math.imul(G,Q),r=r+Math.imul(H,V)|0,o=Math.imul(H,Q),f=f+Math.imul(T,X)|0,r=r+Math.imul(T,Y)|0,r=r+Math.imul(K,X)|0,o=o+Math.imul(K,Y)|0,f=f+Math.imul(P,j)|0,r=r+Math.imul(P,tt)|0,r=r+Math.imul($,j)|0,o=o+Math.imul($,tt)|0,f=f+Math.imul(Z,rt)|0,r=r+Math.imul(Z,it)|0,r=r+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,f=f+Math.imul(I,et)|0,r=r+Math.imul(I,nt)|0,r=r+Math.imul(C,et)|0,o=o+Math.imul(C,nt)|0,f=f+Math.imul(q,ht)|0,r=r+Math.imul(q,ft)|0,r=r+Math.imul(L,ht)|0,o=o+Math.imul(L,ft)|0,f=f+Math.imul(O,st)|0,r=r+Math.imul(O,ot)|0,r=r+Math.imul(D,st)|0,o=o+Math.imul(D,ot)|0,f=f+Math.imul(B,at)|0,r=r+Math.imul(B,lt)|0,r=r+Math.imul(U,at)|0,o=o+Math.imul(U,lt)|0,f=f+Math.imul(_,ut)|0,r=r+Math.imul(_,dt)|0,r=r+Math.imul(F,ut)|0,o=o+Math.imul(F,dt)|0;var hr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(hr>>>26)|0,hr&=67108863,f=Math.imul(G,X),r=Math.imul(G,Y),r=r+Math.imul(H,X)|0,o=Math.imul(H,Y),f=f+Math.imul(T,j)|0,r=r+Math.imul(T,tt)|0,r=r+Math.imul(K,j)|0,o=o+Math.imul(K,tt)|0,f=f+Math.imul(P,rt)|0,r=r+Math.imul(P,it)|0,r=r+Math.imul($,rt)|0,o=o+Math.imul($,it)|0,f=f+Math.imul(Z,et)|0,r=r+Math.imul(Z,nt)|0,r=r+Math.imul(N,et)|0,o=o+Math.imul(N,nt)|0,f=f+Math.imul(I,ht)|0,r=r+Math.imul(I,ft)|0,r=r+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0,f=f+Math.imul(q,st)|0,r=r+Math.imul(q,ot)|0,r=r+Math.imul(L,st)|0,o=o+Math.imul(L,ot)|0,f=f+Math.imul(O,at)|0,r=r+Math.imul(O,lt)|0,r=r+Math.imul(D,at)|0,o=o+Math.imul(D,lt)|0,f=f+Math.imul(B,ut)|0,r=r+Math.imul(B,dt)|0,r=r+Math.imul(U,ut)|0,o=o+Math.imul(U,dt)|0;var fr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(fr>>>26)|0,fr&=67108863,f=Math.imul(G,j),r=Math.imul(G,tt),r=r+Math.imul(H,j)|0,o=Math.imul(H,tt),f=f+Math.imul(T,rt)|0,r=r+Math.imul(T,it)|0,r=r+Math.imul(K,rt)|0,o=o+Math.imul(K,it)|0,f=f+Math.imul(P,et)|0,r=r+Math.imul(P,nt)|0,r=r+Math.imul($,et)|0,o=o+Math.imul($,nt)|0,f=f+Math.imul(Z,ht)|0,r=r+Math.imul(Z,ft)|0,r=r+Math.imul(N,ht)|0,o=o+Math.imul(N,ft)|0,f=f+Math.imul(I,st)|0,r=r+Math.imul(I,ot)|0,r=r+Math.imul(C,st)|0,o=o+Math.imul(C,ot)|0,f=f+Math.imul(q,at)|0,r=r+Math.imul(q,lt)|0,r=r+Math.imul(L,at)|0,o=o+Math.imul(L,lt)|0,f=f+Math.imul(O,ut)|0,r=r+Math.imul(O,dt)|0,r=r+Math.imul(D,ut)|0,o=o+Math.imul(D,dt)|0;var sr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(sr>>>26)|0,sr&=67108863,f=Math.imul(G,rt),r=Math.imul(G,it),r=r+Math.imul(H,rt)|0,o=Math.imul(H,it),f=f+Math.imul(T,et)|0,r=r+Math.imul(T,nt)|0,r=r+Math.imul(K,et)|0,o=o+Math.imul(K,nt)|0,f=f+Math.imul(P,ht)|0,r=r+Math.imul(P,ft)|0,r=r+Math.imul($,ht)|0,o=o+Math.imul($,ft)|0,f=f+Math.imul(Z,st)|0,r=r+Math.imul(Z,ot)|0,r=r+Math.imul(N,st)|0,o=o+Math.imul(N,ot)|0,f=f+Math.imul(I,at)|0,r=r+Math.imul(I,lt)|0,r=r+Math.imul(C,at)|0,o=o+Math.imul(C,lt)|0,f=f+Math.imul(q,ut)|0,r=r+Math.imul(q,dt)|0,r=r+Math.imul(L,ut)|0,o=o+Math.imul(L,dt)|0;var or=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(or>>>26)|0,or&=67108863,f=Math.imul(G,et),r=Math.imul(G,nt),r=r+Math.imul(H,et)|0,o=Math.imul(H,nt),f=f+Math.imul(T,ht)|0,r=r+Math.imul(T,ft)|0,r=r+Math.imul(K,ht)|0,o=o+Math.imul(K,ft)|0,f=f+Math.imul(P,st)|0,r=r+Math.imul(P,ot)|0,r=r+Math.imul($,st)|0,o=o+Math.imul($,ot)|0,f=f+Math.imul(Z,at)|0,r=r+Math.imul(Z,lt)|0,r=r+Math.imul(N,at)|0,o=o+Math.imul(N,lt)|0,f=f+Math.imul(I,ut)|0,r=r+Math.imul(I,dt)|0,r=r+Math.imul(C,ut)|0,o=o+Math.imul(C,dt)|0;var ar=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(ar>>>26)|0,ar&=67108863,f=Math.imul(G,ht),r=Math.imul(G,ft),r=r+Math.imul(H,ht)|0,o=Math.imul(H,ft),f=f+Math.imul(T,st)|0,r=r+Math.imul(T,ot)|0,r=r+Math.imul(K,st)|0,o=o+Math.imul(K,ot)|0,f=f+Math.imul(P,at)|0,r=r+Math.imul(P,lt)|0,r=r+Math.imul($,at)|0,o=o+Math.imul($,lt)|0,f=f+Math.imul(Z,ut)|0,r=r+Math.imul(Z,dt)|0,r=r+Math.imul(N,ut)|0,o=o+Math.imul(N,dt)|0;var lr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(lr>>>26)|0,lr&=67108863,f=Math.imul(G,st),r=Math.imul(G,ot),r=r+Math.imul(H,st)|0,o=Math.imul(H,ot),f=f+Math.imul(T,at)|0,r=r+Math.imul(T,lt)|0,r=r+Math.imul(K,at)|0,o=o+Math.imul(K,lt)|0,f=f+Math.imul(P,ut)|0,r=r+Math.imul(P,dt)|0,r=r+Math.imul($,ut)|0,o=o+Math.imul($,dt)|0;var ur=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(ur>>>26)|0,ur&=67108863,f=Math.imul(G,at),r=Math.imul(G,lt),r=r+Math.imul(H,at)|0,o=Math.imul(H,lt),f=f+Math.imul(T,ut)|0,r=r+Math.imul(T,dt)|0,r=r+Math.imul(K,ut)|0,o=o+Math.imul(K,dt)|0;var dr=(d+f|0)+((r&8191)<<13)|0;d=(o+(r>>>13)|0)+(dr>>>26)|0,dr&=67108863,f=Math.imul(G,ut),r=Math.imul(G,dt),r=r+Math.imul(H,ut)|0,o=Math.imul(H,dt);var vr=(d+f|0)+((r&8191)<<13)|0;return d=(o+(r>>>13)|0)+(vr>>>26)|0,vr&=67108863,l[0]=Vt,l[1]=Qt,l[2]=Xt,l[3]=Yt,l[4]=jt,l[5]=tr,l[6]=rr,l[7]=ir,l[8]=er,l[9]=nr,l[10]=hr,l[11]=fr,l[12]=sr,l[13]=or,l[14]=ar,l[15]=lr,l[16]=ur,l[17]=dr,l[18]=vr,d!==0&&(l[19]=d,e.length++),e};Math.imul||(yt=wt);function xt(a,t,i){i.negative=t.negative^a.negative,i.length=a.length+t.length;for(var e=0,n=0,s=0;s<i.length-1;s++){var l=n;n=0;for(var d=e&67108863,f=Math.min(s,t.length-1),r=Math.max(0,s-a.length+1);r<=f;r++){var o=s-r,g=a.words[o]|0,M=t.words[r]|0,y=g*M,x=y&67108863;l=l+(y/67108864|0)|0,x=x+d|0,d=x&67108863,l=l+(x>>>26)|0,n+=l>>>26,l&=67108863}i.words[s]=d,e=l,l=n}return e!==0?i.words[s]=e:i.length--,i._strip()}function pt(a,t,i){return xt(a,t,i)}h.prototype.mulTo=function(t,i){var e,n=this.length+t.length;return this.length===10&&t.length===10?e=yt(this,t,i):n<63?e=wt(this,t,i):n<1024?e=xt(this,t,i):e=pt(this,t,i),e};function k(a,t){this.x=a,this.y=t}k.prototype.makeRBT=function(t){for(var i=new Array(t),e=h.prototype._countBits(t)-1,n=0;n<t;n++)i[n]=this.revBin(n,e,t);return i},k.prototype.revBin=function(t,i,e){if(t===0||t===e-1)return t;for(var n=0,s=0;s<i;s++)n|=(t&1)<<i-s-1,t>>=1;return n},k.prototype.permute=function(t,i,e,n,s,l){for(var d=0;d<l;d++)n[d]=i[t[d]],s[d]=e[t[d]]},k.prototype.transform=function(t,i,e,n,s,l){this.permute(l,t,i,e,n,s);for(var d=1;d<s;d<<=1)for(var f=d<<1,r=Math.cos(2*Math.PI/f),o=Math.sin(2*Math.PI/f),g=0;g<s;g+=f)for(var M=r,y=o,x=0;x<d;x++){var _=e[g+x],F=n[g+x],Et=e[g+x+d],B=n[g+x+d],U=M*Et-y*B;B=M*B+y*Et,Et=U,e[g+x]=_+Et,n[g+x]=F+B,e[g+x+d]=_-Et,n[g+x+d]=F-B,x!==f&&(U=r*M-o*y,y=r*y+o*M,M=U)}},k.prototype.guessLen13b=function(t,i){var e=Math.max(i,t)|1,n=e&1,s=0;for(e=e/2|0;e;e=e>>>1)s++;return 1<<s+1+n},k.prototype.conjugate=function(t,i,e){if(!(e<=1))for(var n=0;n<e/2;n++){var s=t[n];t[n]=t[e-n-1],t[e-n-1]=s,s=i[n],i[n]=-i[e-n-1],i[e-n-1]=-s}},k.prototype.normalize13b=function(t,i){for(var e=0,n=0;n<i/2;n++){var s=Math.round(t[2*n+1]/i)*8192+Math.round(t[2*n]/i)+e;t[n]=s&67108863,s<67108864?e=0:e=s/67108864|0}return t},k.prototype.convert13b=function(t,i,e,n){for(var s=0,l=0;l<i;l++)s=s+(t[l]|0),e[2*l]=s&8191,s=s>>>13,e[2*l+1]=s&8191,s=s>>>13;for(l=2*i;l<n;++l)e[l]=0;u(s===0),u((s&-8192)===0)},k.prototype.stub=function(t){for(var i=new Array(t),e=0;e<t;e++)i[e]=0;return i},k.prototype.mulp=function(t,i,e){var n=2*this.guessLen13b(t.length,i.length),s=this.makeRBT(n),l=this.stub(n),d=new Array(n),f=new Array(n),r=new Array(n),o=new Array(n),g=new Array(n),M=new Array(n),y=e.words;y.length=n,this.convert13b(t.words,t.length,d,n),this.convert13b(i.words,i.length,o,n),this.transform(d,l,f,r,n,s),this.transform(o,l,g,M,n,s);for(var x=0;x<n;x++){var _=f[x]*g[x]-r[x]*M[x];r[x]=f[x]*M[x]+r[x]*g[x],f[x]=_}return this.conjugate(f,r,n),this.transform(f,r,y,l,n,s),this.conjugate(y,l,n),this.normalize13b(y,n),e.negative=t.negative^i.negative,e.length=t.length+i.length,e._strip()},h.prototype.mul=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},h.prototype.mulf=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),pt(this,t,i)},h.prototype.imul=function(t){return this.clone().mulTo(t,this)},h.prototype.imuln=function(t){var i=t<0;i&&(t=-t),u(typeof t=="number"),u(t<67108864);for(var e=0,n=0;n<this.length;n++){var s=(this.words[n]|0)*t,l=(s&67108863)+(e&67108863);e>>=26,e+=s/67108864|0,e+=l>>>26,this.words[n]=l&67108863}return e!==0&&(this.words[n]=e,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=bt(t);if(i.length===0)return new h(1);for(var e=this,n=0;n<i.length&&i[n]===0;n++,e=e.sqr());if(++n<i.length)for(var s=e.sqr();n<i.length;n++,s=s.sqr())i[n]!==0&&(e=e.mul(s));return e},h.prototype.iushln=function(t){u(typeof t=="number"&&t>=0);var i=t%26,e=(t-i)/26,n=67108863>>>26-i<<26-i,s;if(i!==0){var l=0;for(s=0;s<this.length;s++){var d=this.words[s]&n,f=(this.words[s]|0)-d<<i;this.words[s]=f|l,l=d>>>26-i}l&&(this.words[s]=l,this.length++)}if(e!==0){for(s=this.length-1;s>=0;s--)this.words[s+e]=this.words[s];for(s=0;s<e;s++)this.words[s]=0;this.length+=e}return this._strip()},h.prototype.ishln=function(t){return u(this.negative===0),this.iushln(t)},h.prototype.iushrn=function(t,i,e){u(typeof t=="number"&&t>=0);var n;i?n=(i-i%26)/26:n=0;var s=t%26,l=Math.min((t-s)/26,this.length),d=67108863^67108863>>>s<<s,f=e;if(n-=l,n=Math.max(0,n),f){for(var r=0;r<l;r++)f.words[r]=this.words[r];f.length=l}if(l!==0)if(this.length>l)for(this.length-=l,r=0;r<this.length;r++)this.words[r]=this.words[r+l];else this.words[0]=0,this.length=1;var o=0;for(r=this.length-1;r>=0&&(o!==0||r>=n);r--){var g=this.words[r]|0;this.words[r]=o<<26-s|g>>>s,o=g&d}return f&&o!==0&&(f.words[f.length++]=o),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,e){return u(this.negative===0),this.iushrn(t,i,e)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){u(typeof t=="number"&&t>=0);var i=t%26,e=(t-i)/26,n=1<<i;if(this.length<=e)return!1;var s=this.words[e];return!!(s&n)},h.prototype.imaskn=function(t){u(typeof t=="number"&&t>=0);var i=t%26,e=(t-i)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=e)return this;if(i!==0&&e++,this.length=Math.min(e,this.length),i!==0){var n=67108863^67108863>>>i<<i;this.words[this.length-1]&=n}return this._strip()},h.prototype.maskn=function(t){return this.clone().imaskn(t)},h.prototype.iaddn=function(t){return u(typeof t=="number"),u(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<=t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},h.prototype._iaddn=function(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[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},h.prototype.isubn=function(t){if(u(typeof t=="number"),u(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this._strip()},h.prototype.addn=function(t){return this.clone().iaddn(t)},h.prototype.subn=function(t){return this.clone().isubn(t)},h.prototype.iabs=function(){return this.negative=0,this},h.prototype.abs=function(){return this.clone().iabs()},h.prototype._ishlnsubmul=function(t,i,e){var n=t.length+e,s;this._expand(n);var l,d=0;for(s=0;s<t.length;s++){l=(this.words[s+e]|0)+d;var f=(t.words[s]|0)*i;l-=f&67108863,d=(l>>26)-(f/67108864|0),this.words[s+e]=l&67108863}for(;s<this.length-e;s++)l=(this.words[s+e]|0)+d,d=l>>26,this.words[s+e]=l&67108863;if(d===0)return this._strip();for(u(d===-1),d=0,s=0;s<this.length;s++)l=-(this.words[s]|0)+d,d=l>>26,this.words[s]=l&67108863;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var e=this.length-t.length,n=this.clone(),s=t,l=s.words[s.length-1]|0,d=this._countBits(l);e=26-d,e!==0&&(s=s.ushln(e),n.iushln(e),l=s.words[s.length-1]|0);var f=n.length-s.length,r;if(i!=="mod"){r=new h(null),r.length=f+1,r.words=new Array(r.length);for(var o=0;o<r.length;o++)r.words[o]=0}var g=n.clone()._ishlnsubmul(s,1,f);g.negative===0&&(n=g,r&&(r.words[f]=1));for(var M=f-1;M>=0;M--){var y=(n.words[s.length+M]|0)*67108864+(n.words[s.length+M-1]|0);for(y=Math.min(y/l|0,67108863),n._ishlnsubmul(s,y,M);n.negative!==0;)y--,n.negative=0,n._ishlnsubmul(s,1,M),n.isZero()||(n.negative^=1);r&&(r.words[M]=y)}return r&&r._strip(),n._strip(),i!=="div"&&e!==0&&n.iushrn(e),{div:r||null,mod:n}},h.prototype.divmod=function(t,i,e){if(u(!t.isZero()),this.isZero())return{div:new h(0),mod:new h(0)};var n,s,l;return this.negative!==0&&t.negative===0?(l=this.neg().divmod(t,i),i!=="mod"&&(n=l.div.neg()),i!=="div"&&(s=l.mod.neg(),e&&s.negative!==0&&s.iadd(t)),{div:n,mod:s}):this.negative===0&&t.negative!==0?(l=this.divmod(t.neg(),i),i!=="mod"&&(n=l.div.neg()),{div:n,mod:l.mod}):(this.negative&t.negative)!==0?(l=this.neg().divmod(t.neg(),i),i!=="div"&&(s=l.mod.neg(),e&&s.negative!==0&&s.isub(t)),{div:l.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:t.length===1?i==="div"?{div:this.divn(t.words[0]),mod:null}:i==="mod"?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i)},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var e=i.div.negative!==0?i.mod.isub(t):i.mod,n=t.ushrn(1),s=t.andln(1),l=e.cmp(n);return l<0||s===1&&l===0?i.div:i.div.negative!==0?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),u(t<=67108863);for(var e=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(e*n+(this.words[s]|0))%t;return i?-n:n},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),u(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var s=(this.words[n]|0)+e*67108864;this.words[n]=s/t|0,e=s%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){u(t.negative===0),u(!t.isZero());var i=this,e=t.clone();i.negative!==0?i=i.umod(t):i=i.clone();for(var n=new h(1),s=new h(0),l=new h(0),d=new h(1),f=0;i.isEven()&&e.isEven();)i.iushrn(1),e.iushrn(1),++f;for(var r=e.clone(),o=i.clone();!i.isZero();){for(var g=0,M=1;(i.words[0]&M)===0&&g<26;++g,M<<=1);if(g>0)for(i.iushrn(g);g-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(r),s.isub(o)),n.iushrn(1),s.iushrn(1);for(var y=0,x=1;(e.words[0]&x)===0&&y<26;++y,x<<=1);if(y>0)for(e.iushrn(y);y-- >0;)(l.isOdd()||d.isOdd())&&(l.iadd(r),d.isub(o)),l.iushrn(1),d.iushrn(1);i.cmp(e)>=0?(i.isub(e),n.isub(l),s.isub(d)):(e.isub(i),l.isub(n),d.isub(s))}return{a:l,b:d,gcd:e.iushln(f)}},h.prototype._invmp=function(t){u(t.negative===0),u(!t.isZero());var i=this,e=t.clone();i.negative!==0?i=i.umod(t):i=i.clone();for(var n=new h(1),s=new h(0),l=e.clone();i.cmpn(1)>0&&e.cmpn(1)>0;){for(var d=0,f=1;(i.words[0]&f)===0&&d<26;++d,f<<=1);if(d>0)for(i.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(l),n.iushrn(1);for(var r=0,o=1;(e.words[0]&o)===0&&r<26;++r,o<<=1);if(r>0)for(e.iushrn(r);r-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);i.cmp(e)>=0?(i.isub(e),n.isub(s)):(e.isub(i),s.isub(n))}var g;return i.cmpn(1)===0?g=n:g=s,g.cmpn(0)<0&&g.iadd(t),g},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),e=t.clone();i.negative=0,e.negative=0;for(var n=0;i.isEven()&&e.isEven();n++)i.iushrn(1),e.iushrn(1);do{for(;i.isEven();)i.iushrn(1);for(;e.isEven();)e.iushrn(1);var s=i.cmp(e);if(s<0){var l=i;i=e,e=l}else if(s===0||e.cmpn(1)===0)break;i.isub(e)}while(!0);return e.iushln(n)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return(this.words[0]&1)===0},h.prototype.isOdd=function(){return(this.words[0]&1)===1},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){u(typeof t=="number");var i=t%26,e=(t-i)/26,n=1<<i;if(this.length<=e)return this._expand(e+1),this.words[e]|=n,this;for(var s=n,l=e;s!==0&&l<this.length;l++){var d=this.words[l]|0;d+=s,s=d>>>26,d&=67108863,this.words[l]=d}return s!==0&&(this.words[l]=s,this.length++),this},h.prototype.isZero=function(){return this.length===1&&this.words[0]===0},h.prototype.cmpn=function(t){var i=t<0;if(this.negative!==0&&!i)return-1;if(this.negative===0&&i)return 1;this._strip();var e;if(this.length>1)e=1;else{i&&(t=-t),u(t<=67108863,"Number is too big");var n=this.words[0]|0;e=n===t?0:n<t?-1:1}return this.negative!==0?-e|0:e},h.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var i=this.ucmp(t);return this.negative!==0?-i|0:i},h.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,e=this.length-1;e>=0;e--){var n=this.words[e]|0,s=t.words[e]|0;if(n!==s){n<s?i=-1:n>s&&(i=1);break}}return i},h.prototype.gtn=function(t){return this.cmpn(t)===1},h.prototype.gt=function(t){return this.cmp(t)===1},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return this.cmpn(t)===-1},h.prototype.lt=function(t){return this.cmp(t)===-1},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return this.cmpn(t)===0},h.prototype.eq=function(t){return this.cmp(t)===0},h.red=function(t){return new z(t)},h.prototype.toRed=function(t){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return u(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return u(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var _t={k256:null,p224:null,p192:null,p25519:null};function S(a,t){this.name=a,this.p=new h(t,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},S.prototype.ireduce=function(t){var i=t,e;do this.split(i,this.tmp),i=this.imulK(i),i=i.iadd(this.tmp),e=i.bitLength();while(e>this.n);var n=e<this.n?-1:i.ucmp(this.p);return n===0?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):i.strip!==void 0?i.strip():i._strip(),i},S.prototype.split=function(t,i){t.iushrn(this.n,0,i)},S.prototype.imulK=function(t){return t.imul(this.k)};function gt(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}c(gt,S),gt.prototype.split=function(t,i){for(var e=4194303,n=Math.min(t.length,9),s=0;s<n;s++)i.words[s]=t.words[s];if(i.length=n,t.length<=9){t.words[0]=0,t.length=1;return}var l=t.words[9];for(i.words[i.length++]=l&e,s=10;s<t.length;s++){var d=t.words[s]|0;t.words[s-10]=(d&e)<<4|l>>>22,l=d}l>>>=22,t.words[s-10]=l,l===0&&t.length>10?t.length-=10:t.length-=9},gt.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,e=0;e<t.length;e++){var n=t.words[e]|0;i+=n*977,t.words[e]=i&67108863,i=n*64+(i/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function kt(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}c(kt,S);function yr(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}c(yr,S);function Wt(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}c(Wt,S),Wt.prototype.imulK=function(t){for(var i=0,e=0;e<t.length;e++){var n=(t.words[e]|0)*19+i,s=n&67108863;n>>>=26,t.words[e]=s,i=n}return i!==0&&(t.words[t.length++]=i),t},h._prime=function(t){if(_t[t])return _t[t];var i;if(t==="k256")i=new gt;else if(t==="p224")i=new kt;else if(t==="p192")i=new yr;else if(t==="p25519")i=new Wt;else throw new Error("Unknown prime "+t);return _t[t]=i,i};function z(a){if(typeof a=="string"){var t=h._prime(a);this.m=t.p,this.prime=t}else u(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}z.prototype._verify1=function(t){u(t.negative===0,"red works only with positives"),u(t.red,"red works only with red numbers")},z.prototype._verify2=function(t,i){u((t.negative|i.negative)===0,"red works only with positives"),u(t.red&&t.red===i.red,"red works only with red numbers")},z.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(qt(t,t.umod(this.m)._forceRed(this)),t)},z.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},z.prototype.add=function(t,i){this._verify2(t,i);var e=t.add(i);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},z.prototype.iadd=function(t,i){this._verify2(t,i);var e=t.iadd(i);return e.cmp(this.m)>=0&&e.isub(this.m),e},z.prototype.sub=function(t,i){this._verify2(t,i);var e=t.sub(i);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},z.prototype.isub=function(t,i){this._verify2(t,i);var e=t.isub(i);return e.cmpn(0)<0&&e.iadd(this.m),e},z.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},z.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},z.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},z.prototype.isqr=function(t){return this.imul(t,t.clone())},z.prototype.sqr=function(t){return this.mul(t,t)},z.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(u(i%2===1),i===3){var e=this.m.add(new h(1)).iushrn(2);return this.pow(t,e)}for(var n=this.m.subn(1),s=0;!n.isZero()&&n.andln(1)===0;)s++,n.iushrn(1);u(!n.isZero());var l=new h(1).toRed(this),d=l.redNeg(),f=this.m.subn(1).iushrn(1),r=this.m.bitLength();for(r=new h(2*r*r).toRed(this);this.pow(r,f).cmp(d)!==0;)r.redIAdd(d);for(var o=this.pow(r,n),g=this.pow(t,n.addn(1).iushrn(1)),M=this.pow(t,n),y=s;M.cmp(l)!==0;){for(var x=M,_=0;x.cmp(l)!==0;_++)x=x.redSqr();u(_<y);var F=this.pow(o,new h(1).iushln(y-_-1));g=g.redMul(F),o=F.redSqr(),M=M.redMul(o),y=_}return g},z.prototype.invm=function(t){var i=t._invmp(this.m);return i.negative!==0?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},z.prototype.pow=function(t,i){if(i.isZero())return new h(1).toRed(this);if(i.cmpn(1)===0)return t.clone();var e=4,n=new Array(1<<e);n[0]=new h(1).toRed(this),n[1]=t;for(var s=2;s<n.length;s++)n[s]=this.mul(n[s-1],t);var l=n[0],d=0,f=0,r=i.bitLength()%26;for(r===0&&(r=26),s=i.length-1;s>=0;s--){for(var o=i.words[s],g=r-1;g>=0;g--){var M=o>>g&1;if(l!==n[0]&&(l=this.sqr(l)),M===0&&d===0){f=0;continue}d<<=1,d|=M,f++,!(f!==e&&(s!==0||g!==0))&&(l=this.mul(l,n[d]),f=0,d=0)}r=26}return l},z.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},z.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new zt(t)};function zt(a){z.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new h(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)}c(zt,z),zt.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},zt.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},zt.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(i),n=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=e.isub(n).iushrn(this.shift),l=s;return s.cmp(this.m)>=0?l=s.isub(this.m):s.cmpn(0)<0&&(l=s.iadd(this.m)),l._forceRed(this)},zt.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var e=t.mul(i),n=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=e.isub(n).iushrn(this.shift),l=s;return s.cmp(this.m)>=0?l=s.isub(this.m):s.cmpn(0)<0&&(l=s.iadd(this.m)),l._forceRed(this)},zt.prototype.invm=function(t){var i=this.imod(t._invmp(this.m).mul(this.r2));return i._forceRed(this)}})(typeof cr>"u"||cr,Cr)});var Pr=Zt((Mi,Nr)=>{"use strict";At();Ft();var Nt=Qr().Buffer;function Xr(m){if(m.length>=255)throw new TypeError("Alphabet too long");for(var v=new Uint8Array(256),u=0;u<v.length;u++)v[u]=255;for(var c=0;c<m.length;c++){var h=m.charAt(c),p=h.charCodeAt(0);if(v[p]!==255)throw new TypeError(h+" is ambiguous");v[p]=c}var w=m.length,R=m.charAt(0),A=Math.log(w)/Math.log(256),qt=Math.log(256)/Math.log(w);function It(E){if((Array.isArray(E)||E instanceof Uint8Array)&&(E=Nt.from(E)),!Nt.isBuffer(E))throw new TypeError("Expected Buffer");if(E.length===0)return"";for(var mt=0,bt=0,wt=0,yt=E.length;wt!==yt&&E[wt]===0;)wt++,mt++;for(var xt=(yt-wt)*qt+1>>>0,pt=new Uint8Array(xt);wt!==yt;){for(var k=E[wt],_t=0,S=xt-1;(k!==0||_t<bt)&&S!==-1;S--,_t++)k+=256*pt[S]>>>0,pt[S]=k%w>>>0,k=k/w>>>0;if(k!==0)throw new Error("Non-zero carry");bt=_t,wt++}for(var gt=xt-bt;gt!==xt&&pt[gt]===0;)gt++;for(var kt=R.repeat(mt);gt<xt;++gt)kt+=m.charAt(pt[gt]);return kt}function Ct(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return Nt.alloc(0);var mt=0;if(E[mt]!==" "){for(var bt=0,wt=0;E[mt]===R;)bt++,mt++;for(var yt=(E.length-mt)*A+1>>>0,xt=new Uint8Array(yt);E[mt];){var pt=v[E.charCodeAt(mt)];if(pt===255)return;for(var k=0,_t=yt-1;(pt!==0||k<wt)&&_t!==-1;_t--,k++)pt+=w*xt[_t]>>>0,xt[_t]=pt%256>>>0,pt=pt/256>>>0;if(pt!==0)throw new Error("Non-zero carry");wt=k,mt++}if(E[mt]!==" "){for(var S=yt-wt;S!==yt&&xt[S]===0;)S++;var gt=Nt.allocUnsafe(bt+(yt-S));gt.fill(0,0,bt);for(var kt=bt;S!==yt;)gt[kt++]=xt[S++];return gt}}}function Jt(E){var mt=Ct(E);if(mt)return mt;throw new Error("Non-base"+w+" character")}return{encode:It,decodeUnsafe:Ct,decode:Jt}}Nr.exports=Xr});var Tr=Zt((xi,$r)=>{At();Ft();var Yr=Pr(),jr="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";$r.exports=Yr(jr)});var Kr=Zt(gr=>{"use strict";At();Ft();function Ut(m,v,u){return v<=m&&m<=u}function Gt(m){if(m===void 0)return{};if(m===Object(m))return m;throw TypeError("Could not convert argument to dictionary")}function ti(m){for(var v=String(m),u=v.length,c=0,h=[];c<u;){var p=v.charCodeAt(c);if(p<55296||p>57343)h.push(p);else if(56320<=p&&p<=57343)h.push(65533);else if(55296<=p&&p<=56319)if(c===u-1)h.push(65533);else{var w=m.charCodeAt(c+1);if(56320<=w&&w<=57343){var R=p&1023,A=w&1023;h.push(65536+(R<<10)+A),c+=1}else h.push(65533)}c+=1}return h}function ri(m){for(var v="",u=0;u<m.length;++u){var c=m[u];c<=65535?v+=String.fromCharCode(c):(c-=65536,v+=String.fromCharCode((c>>10)+55296,(c&1023)+56320))}return v}var Pt=-1;function pr(m){this.tokens=[].slice.call(m)}pr.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Pt},prepend:function(m){if(Array.isArray(m))for(var v=m;v.length;)this.tokens.unshift(v.pop());else this.tokens.unshift(m)},push:function(m){if(Array.isArray(m))for(var v=m;v.length;)this.tokens.push(v.shift());else this.tokens.push(m)}};var Lt=-1;function mr(m,v){if(m)throw TypeError("Decoder error");return v||65533}var $t="utf-8";function Tt(m,v){if(!(this instanceof Tt))return new Tt(m,v);if(m=m!==void 0?String(m).toLowerCase():$t,m!==$t)throw new Error("Encoding not supported. Only utf-8 is supported");v=Gt(v),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(v.fatal),this._ignoreBOM=Boolean(v.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Tt.prototype={decode:function(v,u){var c;typeof v=="object"&&v instanceof ArrayBuffer?c=new Uint8Array(v):typeof v=="object"&&"buffer"in v&&v.buffer instanceof ArrayBuffer?c=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):c=new Uint8Array(0),u=Gt(u),this._streaming||(this._decoder=new ii({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(u.stream);for(var h=new pr(c),p=[],w;!h.endOfStream()&&(w=this._decoder.handler(h,h.read()),w!==Lt);)w!==null&&(Array.isArray(w)?p.push.apply(p,w):p.push(w));if(!this._streaming){do{if(w=this._decoder.handler(h,h.read()),w===Lt)break;w!==null&&(Array.isArray(w)?p.push.apply(p,w):p.push(w))}while(!h.endOfStream());this._decoder=null}return p.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(p[0]===65279?(this._BOMseen=!0,p.shift()):this._BOMseen=!0),ri(p)}};function Kt(m,v){if(!(this instanceof Kt))return new Kt(m,v);if(m=m!==void 0?String(m).toLowerCase():$t,m!==$t)throw new Error("Encoding not supported. Only utf-8 is supported");v=Gt(v),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(v.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}Kt.prototype={encode:function(v,u){v=v?String(v):"",u=Gt(u),this._streaming||(this._encoder=new ei(this._options)),this._streaming=Boolean(u.stream);for(var c=[],h=new pr(ti(v)),p;!h.endOfStream()&&(p=this._encoder.handler(h,h.read()),p!==Lt);)Array.isArray(p)?c.push.apply(c,p):c.push(p);if(!this._streaming){for(;p=this._encoder.handler(h,h.read()),p!==Lt;)Array.isArray(p)?c.push.apply(c,p):c.push(p);this._encoder=null}return new Uint8Array(c)}};function ii(m){var v=m.fatal,u=0,c=0,h=0,p=128,w=191;this.handler=function(R,A){if(A===Pt&&h!==0)return h=0,mr(v);if(A===Pt)return Lt;if(h===0){if(Ut(A,0,127))return A;if(Ut(A,194,223))h=1,u=A-192;else if(Ut(A,224,239))A===224&&(p=160),A===237&&(w=159),h=2,u=A-224;else if(Ut(A,240,244))A===240&&(p=144),A===244&&(w=143),h=3,u=A-240;else return mr(v);return u=u<<6*h,null}if(!Ut(A,p,w))return u=h=c=0,p=128,w=191,R.prepend(A),mr(v);if(p=128,w=191,c+=1,u+=A-128<<6*(h-c),c!==h)return null;var qt=u;return u=h=c=0,qt}}function ei(m){var v=m.fatal;this.handler=function(u,c){if(c===Pt)return Lt;if(Ut(c,0,127))return c;var h,p;Ut(c,128,2047)?(h=1,p=192):Ut(c,2048,65535)?(h=2,p=224):Ut(c,65536,1114111)&&(h=3,p=240);for(var w=[(c>>6*h)+p];h>0;){var R=c>>6*(h-1);w.push(128|R&63),h-=1}return w}}gr.TextEncoder=Kt;gr.TextDecoder=Tt});var mi=Zt(b=>{"use strict";At();Ft();var ni=b&&b.__createBinding||(Object.create?function(m,v,u,c){c===void 0&&(c=u),Object.defineProperty(m,c,{enumerable:!0,get:function(){return v[u]}})}:function(m,v,u,c){c===void 0&&(c=u),m[c]=v[u]}),hi=b&&b.__setModuleDefault||(Object.create?function(m,v){Object.defineProperty(m,"default",{enumerable:!0,value:v})}:function(m,v){m.default=v}),Bt=b&&b.__decorate||function(m,v,u,c){var h=arguments.length,p=h<3?v:c===null?c=Object.getOwnPropertyDescriptor(v,u):c,w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(m,v,u,c);else for(var R=m.length-1;R>=0;R--)(w=m[R])&&(p=(h<3?w(p):h>3?w(v,u,p):w(v,u))||p);return h>3&&p&&Object.defineProperty(v,u,p),p},fi=b&&b.__importStar||function(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var u in m)u!=="default"&&Object.hasOwnProperty.call(m,u)&&ni(v,m,u);return hi(v,m),v},Gr=b&&b.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(b,"__esModule",{value:!0});b.deserializeUnchecked=b.deserialize=b.serialize=b.BinaryReader=b.BinaryWriter=b.BorshError=b.baseDecode=b.baseEncode=void 0;var Rt=Gr(Zr()),Hr=Gr(Tr()),si=fi(Kr()),oi=typeof TextDecoder!="function"?si.TextDecoder:TextDecoder,ai=new oi("utf-8",{fatal:!0});function li(m){return typeof m=="string"&&(m=vt.Buffer.from(m,"utf8")),Hr.default.encode(vt.Buffer.from(m))}b.baseEncode=li;function ui(m){return vt.Buffer.from(Hr.default.decode(m))}b.baseDecode=ui;var Mr=1024,ct=class extends Error{constructor(v){super(v),this.fieldPath=[],this.originalMessage=v}addToFieldPath(v){this.fieldPath.splice(0,0,v),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};b.BorshError=ct;var Ht=class{constructor(){this.buf=vt.Buffer.alloc(Mr),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=vt.Buffer.concat([this.buf,vt.Buffer.alloc(Mr)]))}writeU8(v){this.maybeResize(),this.buf.writeUInt8(v,this.length),this.length+=1}writeU16(v){this.maybeResize(),this.buf.writeUInt16LE(v,this.length),this.length+=2}writeU32(v){this.maybeResize(),this.buf.writeUInt32LE(v,this.length),this.length+=4}writeU64(v){this.maybeResize(),this.writeBuffer(vt.Buffer.from(new Rt.default(v).toArray("le",8)))}writeU128(v){this.maybeResize(),this.writeBuffer(vt.Buffer.from(new Rt.default(v).toArray("le",16)))}writeU256(v){this.maybeResize(),this.writeBuffer(vt.Buffer.from(new Rt.default(v).toArray("le",32)))}writeU512(v){this.maybeResize(),this.writeBuffer(vt.Buffer.from(new Rt.default(v).toArray("le",64)))}writeBuffer(v){this.buf=vt.Buffer.concat([vt.Buffer.from(this.buf.subarray(0,this.length)),v,vt.Buffer.alloc(Mr)]),this.length+=v.length}writeString(v){this.maybeResize();let u=vt.Buffer.from(v,"utf8");this.writeU32(u.length),this.writeBuffer(u)}writeFixedArray(v){this.writeBuffer(vt.Buffer.from(v))}writeArray(v,u){this.maybeResize(),this.writeU32(v.length);for(let c of v)this.maybeResize(),u(c)}toArray(){return this.buf.subarray(0,this.length)}};b.BinaryWriter=Ht;function St(m,v,u){let c=u.value;u.value=function(...h){try{return c.apply(this,h)}catch(p){if(p instanceof RangeError){let w=p.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(w)>=0)throw new ct("Reached the end of buffer when deserializing")}throw p}}}var Mt=class{constructor(v){this.buf=v,this.offset=0}readU8(){let v=this.buf.readUInt8(this.offset);return this.offset+=1,v}readU16(){let v=this.buf.readUInt16LE(this.offset);return this.offset+=2,v}readU32(){let v=this.buf.readUInt32LE(this.offset);return this.offset+=4,v}readU64(){let v=this.readBuffer(8);return new Rt.default(v,"le")}readU128(){let v=this.readBuffer(16);return new Rt.default(v,"le")}readU256(){let v=this.readBuffer(32);return new Rt.default(v,"le")}readU512(){let v=this.readBuffer(64);return new Rt.default(v,"le")}readBuffer(v){if(this.offset+v>this.buf.length)throw new ct(`Expected buffer length ${v} isn't within bounds`);let u=this.buf.slice(this.offset,this.offset+v);return this.offset+=v,u}readString(){let v=this.readU32(),u=this.readBuffer(v);try{return ai.decode(u)}catch(c){throw new ct(`Error decoding UTF-8 string: ${c}`)}}readFixedArray(v){return new Uint8Array(this.readBuffer(v))}readArray(v){let u=this.readU32(),c=Array();for(let h=0;h<u;++h)c.push(v());return c}};Bt([St],Mt.prototype,"readU8",null);Bt([St],Mt.prototype,"readU16",null);Bt([St],Mt.prototype,"readU32",null);Bt([St],Mt.prototype,"readU64",null);Bt([St],Mt.prototype,"readU128",null);Bt([St],Mt.prototype,"readU256",null);Bt([St],Mt.prototype,"readU512",null);Bt([St],Mt.prototype,"readString",null);Bt([St],Mt.prototype,"readFixedArray",null);Bt([St],Mt.prototype,"readArray",null);b.BinaryReader=Mt;function Jr(m){return m.charAt(0).toUpperCase()+m.slice(1)}function Ot(m,v,u,c,h){try{if(typeof c=="string")h[`write${Jr(c)}`](u);else if(c instanceof Array)if(typeof c[0]=="number"){if(u.length!==c[0])throw new ct(`Expecting byte array of length ${c[0]}, but got ${u.length} bytes`);h.writeFixedArray(u)}else if(c.length===2&&typeof c[1]=="number"){if(u.length!==c[1])throw new ct(`Expecting byte array of length ${c[1]}, but got ${u.length} bytes`);for(let p=0;p<c[1];p++)Ot(m,null,u[p],c[0],h)}else h.writeArray(u,p=>{Ot(m,v,p,c[0],h)});else if(c.kind!==void 0)switch(c.kind){case"option":{u==null?h.writeU8(0):(h.writeU8(1),Ot(m,v,u,c.type,h));break}case"map":{h.writeU32(u.size),u.forEach((p,w)=>{Ot(m,v,w,c.key,h),Ot(m,v,p,c.value,h)});break}default:throw new ct(`FieldType ${c} unrecognized`)}else Wr(m,u,h)}catch(p){throw p instanceof ct&&p.addToFieldPath(v),p}}function Wr(m,v,u){if(typeof v.borshSerialize=="function"){v.borshSerialize(u);return}let c=m.get(v.constructor);if(!c)throw new ct(`Class ${v.constructor.name} is missing in schema`);if(c.kind==="struct")c.fields.map(([h,p])=>{Ot(m,h,v[h],p,u)});else if(c.kind==="enum"){let h=v[c.field];for(let p=0;p<c.values.length;++p){let[w,R]=c.values[p];if(w===h){u.writeU8(p),Ot(m,w,v[w],R,u);break}}}else throw new ct(`Unexpected schema kind: ${c.kind} for ${v.constructor.name}`)}function di(m,v,u=Ht){let c=new u;return Wr(m,v,c),c.toArray()}b.serialize=di;function Dt(m,v,u,c){try{if(typeof u=="string")return c[`read${Jr(u)}`]();if(u instanceof Array){if(typeof u[0]=="number")return c.readFixedArray(u[0]);if(typeof u[1]=="number"){let h=[];for(let p=0;p<u[1];p++)h.push(Dt(m,null,u[0],c));return h}else return c.readArray(()=>Dt(m,v,u[0],c))}if(u.kind==="option")return c.readU8()?Dt(m,v,u.type,c):void 0;if(u.kind==="map"){let h=new Map,p=c.readU32();for(let w=0;w<p;w++){let R=Dt(m,v,u.key,c),A=Dt(m,v,u.value,c);h.set(R,A)}return h}return wr(m,u,c)}catch(h){throw h instanceof ct&&h.addToFieldPath(v),h}}function wr(m,v,u){if(typeof v.borshDeserialize=="function")return v.borshDeserialize(u);let c=m.get(v);if(!c)throw new ct(`Class ${v.name} is missing in schema`);if(c.kind==="struct"){let h={};for(let[p,w]of m.get(v).fields)h[p]=Dt(m,p,w,u);return new v(h)}if(c.kind==="enum"){let h=u.readU8();if(h>=c.values.length)throw new ct(`Enum index: ${h} is out of range`);let[p,w]=c.values[h],R=Dt(m,p,w,u);return new v({[p]:R})}throw new ct(`Unexpected schema kind: ${c.kind} for ${v.constructor.name}`)}function vi(m,v,u,c=Mt){let h=new c(u),p=wr(m,v,h);if(h.offset<u.length)throw new ct(`Unexpected ${u.length-h.offset} bytes after deserialized data`);return p}b.deserialize=vi;function ci(m,v,u,c=Mt){let h=new c(u);return wr(m,v,h)}b.deserializeUnchecked=ci});export{mi as a};
window.inOKXExtension = true;
window.inMiniApp = false;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=chunk-QWOR3C5W.js.map