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

9 lines
99 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{a as xi}from"./chunk-7EFJGIFL.js";import{a as we,c as bi,e as Zr}from"./chunk-TSXM5GQV.js";import{a as sr}from"./chunk-KQL2BBUZ.js";import{b as Mi}from"./chunk-IAFVNOEB.js";import{d as Gr}from"./chunk-WMCBVXPA.js";import{c as G,o as P,p as y,q as T}from"./chunk-QTLWQ5AJ.js";var Xt=G((Jr,or)=>{P();T();(function(e,n){"use strict";function r(d,t){if(!d)throw new Error(t||"Assertion failed")}function f(d,t){d.super_=t;var a=function(){};a.prototype=t.prototype,d.prototype=new a,d.prototype.constructor=d}function s(d,t,a){if(s.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((t==="le"||t==="be")&&(a=t,t=10),this._init(d||0,t||10,a||"be"))}typeof e=="object"?e.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var p;try{p=Gr().Buffer}catch{}s.isBN=function(t){return t instanceof s?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,a){return t.cmp(a)>0?t:a},s.min=function(t,a){return t.cmp(a)<0?t:a},s.prototype._init=function(t,a,o){if(typeof t=="number")return this._initNumber(t,a,o);if(typeof t=="object")return this._initArray(t,a,o);a==="hex"&&(a=16),r(a===(a|0)&&a>=2&&a<=36),t=t.toString().replace(/\s+/g,"");var u=0;t[0]==="-"&&u++,a===16?this._parseHex(t,u):this._parseBase(t,a,u),t[0]==="-"&&(this.negative=1),this._strip(),o==="le"&&this._initArray(this.toArray(),a,o)},s.prototype._initNumber=function(t,a,o){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):(r(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),o==="le"&&this._initArray(this.toArray(),a,o)},s.prototype._initArray=function(t,a,o){if(r(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 u=0;u<this.length;u++)this.words[u]=0;var l,v,g=0;if(o==="be")for(u=t.length-1,l=0;u>=0;u-=3)v=t[u]|t[u-1]<<8|t[u-2]<<16,this.words[l]|=v<<g&67108863,this.words[l+1]=v>>>26-g&67108863,g+=24,g>=26&&(g-=26,l++);else if(o==="le")for(u=0,l=0;u<t.length;u+=3)v=t[u]|t[u+1]<<8|t[u+2]<<16,this.words[l]|=v<<g&67108863,this.words[l+1]=v>>>26-g&67108863,g+=24,g>=26&&(g-=26,l++);return this._strip()};function m(d,t,a){for(var o=0,u=Math.min(d.length,a),l=0,v=t;v<u;v++){var g=d.charCodeAt(v)-48;o<<=4;var h;g>=49&&g<=54?h=g-49+10:g>=17&&g<=22?h=g-17+10:h=g,o|=h,l|=h}return r(!(l&240),"Invalid character in "+d),o}s.prototype._parseHex=function(t,a){this.length=Math.ceil((t.length-a)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,l,v=0;for(o=t.length-6,u=0;o>=a;o-=6)l=m(t,o,o+6),this.words[u]|=l<<v&67108863,this.words[u+1]|=l>>>26-v&4194303,v+=24,v>=26&&(v-=26,u++);o+6!==a&&(l=m(t,a,o+6),this.words[u]|=l<<v&67108863,this.words[u+1]|=l>>>26-v&4194303),this._strip()};function _(d,t,a,o){for(var u=0,l=0,v=Math.min(d.length,a),g=t;g<v;g++){var h=d.charCodeAt(g)-48;u*=o,h>=49?l=h-49+10:h>=17?l=h-17+10:l=h,r(h>=0&&l<o,"Invalid character"),u+=l}return u}s.prototype._parseBase=function(t,a,o){this.words=[0],this.length=1;for(var u=0,l=1;l<=67108863;l*=a)u++;u--,l=l/a|0;for(var v=t.length-o,g=v%u,h=Math.min(v,v-g)+o,i=0,c=o;c<h;c+=u)i=_(t,c,c+u,a),this.imuln(l),this.words[0]+i<67108864?this.words[0]+=i:this._iaddn(i);if(g!==0){var w=1;for(i=_(t,c,t.length,a),c=0;c<g;c++)w*=a;this.imuln(w),this.words[0]+i<67108864?this.words[0]+=i:this._iaddn(i)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var a=0;a<this.length;a++)t.words[a]=this.words[a];t.length=this.length,t.negative=this.negative,t.red=this.red};function b(d,t){d.words=t.words,d.length=t.length,d.negative=t.negative,d.red=t.red}if(s.prototype._move=function(t){b(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{s.prototype.inspect=E}else s.prototype.inspect=E;function E(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var F=["","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"],U=[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],D=[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];s.prototype.toString=function(t,a){t=t||10,a=a|0||1;var o;if(t===16||t==="hex"){o="";for(var u=0,l=0,v=0;v<this.length;v++){var g=this.words[v],h=((g<<u|l)&16777215).toString(16);l=g>>>24-u&16777215,l!==0||v!==this.length-1?o=F[6-h.length]+h+o:o=h+o,u+=2,u>=26&&(u-=26,v--)}for(l!==0&&(o=l.toString(16)+o);o.length%a!==0;)o="0"+o;return this.negative!==0&&(o="-"+o),o}if(t===(t|0)&&t>=2&&t<=36){var i=U[t],c=D[t];o="";var w=this.clone();for(w.negative=0;!w.isZero();){var M=w.modrn(c).toString(t);w=w.idivn(c),w.isZero()?o=M+o:o=F[i-M.length]+M+o}for(this.isZero()&&(o="0"+o);o.length%a!==0;)o="0"+o;return this.negative!==0&&(o="-"+o),o}r(!1,"Base should be between 2 and 36")},s.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&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},p&&(s.prototype.toBuffer=function(t,a){return this.toArrayLike(p,t,a)}),s.prototype.toArray=function(t,a){return this.toArrayLike(Array,t,a)};var St=function(t,a){return t.allocUnsafe?t.allocUnsafe(a):new t(a)};s.prototype.toArrayLike=function(t,a,o){this._strip();var u=this.byteLength(),l=o||Math.max(1,u);r(u<=l,"byte array longer than desired length"),r(l>0,"Requested array length <= 0");var v=St(t,l),g=a==="le"?"LE":"BE";return this["_toArrayLike"+g](v,u),v},s.prototype._toArrayLikeLE=function(t,a){for(var o=0,u=0,l=0,v=0;l<this.length;l++){var g=this.words[l]<<v|u;t[o++]=g&255,o<t.length&&(t[o++]=g>>8&255),o<t.length&&(t[o++]=g>>16&255),v===6?(o<t.length&&(t[o++]=g>>24&255),u=0,v=0):(u=g>>>24,v+=2)}if(o<t.length)for(t[o++]=u;o<t.length;)t[o++]=0},s.prototype._toArrayLikeBE=function(t,a){for(var o=t.length-1,u=0,l=0,v=0;l<this.length;l++){var g=this.words[l]<<v|u;t[o--]=g&255,o>=0&&(t[o--]=g>>8&255),o>=0&&(t[o--]=g>>16&255),v===6?(o>=0&&(t[o--]=g>>24&255),u=0,v=0):(u=g>>>24,v+=2)}if(o>=0)for(t[o--]=u;o>=0;)t[o--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var a=t,o=0;return a>=4096&&(o+=13,a>>>=13),a>=64&&(o+=7,a>>>=7),a>=8&&(o+=4,a>>>=4),a>=2&&(o+=2,a>>>=2),o+a},s.prototype._zeroBits=function(t){if(t===0)return 26;var a=t,o=0;return(a&8191)===0&&(o+=13,a>>>=13),(a&127)===0&&(o+=7,a>>>=7),(a&15)===0&&(o+=4,a>>>=4),(a&3)===0&&(o+=2,a>>>=2),(a&1)===0&&o++,o},s.prototype.bitLength=function(){var t=this.words[this.length-1],a=this._countBits(t);return(this.length-1)*26+a};function kt(d){for(var t=new Array(d.bitLength()),a=0;a<t.length;a++){var o=a/26|0,u=a%26;t[a]=d.words[o]>>>u&1}return t}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,a=0;a<this.length;a++){var o=this._zeroBits(this.words[a]);if(t+=o,o!==26)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var a=0;a<t.length;a++)this.words[a]=this.words[a]|t.words[a];return this._strip()},s.prototype.ior=function(t){return r((this.negative|t.negative)===0),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var a;this.length>t.length?a=t:a=this;for(var o=0;o<a.length;o++)this.words[o]=this.words[o]&t.words[o];return this.length=a.length,this._strip()},s.prototype.iand=function(t){return r((this.negative|t.negative)===0),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var a,o;this.length>t.length?(a=this,o=t):(a=t,o=this);for(var u=0;u<o.length;u++)this.words[u]=a.words[u]^o.words[u];if(this!==a)for(;u<a.length;u++)this.words[u]=a.words[u];return this.length=a.length,this._strip()},s.prototype.ixor=function(t){return r((this.negative|t.negative)===0),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r(typeof t=="number"&&t>=0);var a=Math.ceil(t/26)|0,o=t%26;this._expand(a),o>0&&a--;for(var u=0;u<a;u++)this.words[u]=~this.words[u]&67108863;return o>0&&(this.words[u]=~this.words[u]&67108863>>26-o),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,a){r(typeof t=="number"&&t>=0);var o=t/26|0,u=t%26;return this._expand(o+1),a?this.words[o]=this.words[o]|1<<u:this.words[o]=this.words[o]&~(1<<u),this._strip()},s.prototype.iadd=function(t){var a;if(this.negative!==0&&t.negative===0)return this.negative=0,a=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,a=this.isub(t),t.negative=1,a._normSign();var o,u;this.length>t.length?(o=this,u=t):(o=t,u=this);for(var l=0,v=0;v<u.length;v++)a=(o.words[v]|0)+(u.words[v]|0)+l,this.words[v]=a&67108863,l=a>>>26;for(;l!==0&&v<o.length;v++)a=(o.words[v]|0)+l,this.words[v]=a&67108863,l=a>>>26;if(this.length=o.length,l!==0)this.words[this.length]=l,this.length++;else if(o!==this)for(;v<o.length;v++)this.words[v]=o.words[v];return this},s.prototype.add=function(t){var a;return t.negative!==0&&this.negative===0?(t.negative=0,a=this.sub(t),t.negative^=1,a):t.negative===0&&this.negative!==0?(this.negative=0,a=t.sub(this),this.negative=1,a):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var a=this.iadd(t);return t.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var o=this.cmp(t);if(o===0)return this.negative=0,this.length=1,this.words[0]=0,this;var u,l;o>0?(u=this,l=t):(u=t,l=this);for(var v=0,g=0;g<l.length;g++)a=(u.words[g]|0)-(l.words[g]|0)+v,v=a>>26,this.words[g]=a&67108863;for(;v!==0&&g<u.length;g++)a=(u.words[g]|0)+v,v=a>>26,this.words[g]=a&67108863;if(v===0&&g<u.length&&u!==this)for(;g<u.length;g++)this.words[g]=u.words[g];return this.length=Math.max(this.length,g),u!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};function ae(d,t,a){a.negative=t.negative^d.negative;var o=d.length+t.length|0;a.length=o,o=o-1|0;var u=d.words[0]|0,l=t.words[0]|0,v=u*l,g=v&67108863,h=v/67108864|0;a.words[0]=g;for(var i=1;i<o;i++){for(var c=h>>>26,w=h&67108863,M=Math.min(i,t.length-1),x=Math.max(0,i-d.length+1);x<=M;x++){var B=i-x|0;u=d.words[B]|0,l=t.words[x]|0,v=u*l+w,c+=v/67108864|0,w=v&67108863}a.words[i]=w|0,h=c|0}return h!==0?a.words[i]=h|0:a.length--,a._strip()}var se=function(t,a,o){var u=t.words,l=a.words,v=o.words,g=0,h,i,c,w=u[0]|0,M=w&8191,x=w>>>13,B=u[1]|0,C=B&8191,H=B>>>13,Yt=u[2]|0,R=Yt&8191,j=Yt>>>13,Er=u[3]|0,Z=Er&8191,J=Er>>>13,Lr=u[4]|0,Y=Lr&8191,X=Lr>>>13,Ir=u[5]|0,W=Ir&8191,$=Ir>>>13,Or=u[6]|0,Q=Or&8191,tt=Or>>>13,Nr=u[7]|0,et=Nr&8191,rt=Nr>>>13,qr=u[8]|0,it=qr&8191,nt=qr>>>13,Fr=u[9]|0,at=Fr&8191,st=Fr>>>13,Cr=l[0]|0,ot=Cr&8191,ft=Cr>>>13,kr=l[1]|0,ut=kr&8191,ht=kr>>>13,Hr=l[2]|0,lt=Hr&8191,ct=Hr>>>13,Rr=l[3]|0,dt=Rr&8191,vt=Rr>>>13,jr=l[4]|0,gt=jr&8191,pt=jr>>>13,Ur=l[5]|0,mt=Ur&8191,yt=Ur>>>13,zr=l[6]|0,_t=zr&8191,wt=zr>>>13,Dr=l[7]|0,Mt=Dr&8191,bt=Dr>>>13,Kr=l[8]|0,xt=Kr&8191,At=Kr>>>13,Vr=l[9]|0,Pt=Vr&8191,Tt=Vr>>>13;o.negative=t.negative^a.negative,o.length=19,h=Math.imul(M,ot),i=Math.imul(M,ft),i=i+Math.imul(x,ot)|0,c=Math.imul(x,ft);var Ue=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,h=Math.imul(C,ot),i=Math.imul(C,ft),i=i+Math.imul(H,ot)|0,c=Math.imul(H,ft),h=h+Math.imul(M,ut)|0,i=i+Math.imul(M,ht)|0,i=i+Math.imul(x,ut)|0,c=c+Math.imul(x,ht)|0;var ze=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863,h=Math.imul(R,ot),i=Math.imul(R,ft),i=i+Math.imul(j,ot)|0,c=Math.imul(j,ft),h=h+Math.imul(C,ut)|0,i=i+Math.imul(C,ht)|0,i=i+Math.imul(H,ut)|0,c=c+Math.imul(H,ht)|0,h=h+Math.imul(M,lt)|0,i=i+Math.imul(M,ct)|0,i=i+Math.imul(x,lt)|0,c=c+Math.imul(x,ct)|0;var De=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(De>>>26)|0,De&=67108863,h=Math.imul(Z,ot),i=Math.imul(Z,ft),i=i+Math.imul(J,ot)|0,c=Math.imul(J,ft),h=h+Math.imul(R,ut)|0,i=i+Math.imul(R,ht)|0,i=i+Math.imul(j,ut)|0,c=c+Math.imul(j,ht)|0,h=h+Math.imul(C,lt)|0,i=i+Math.imul(C,ct)|0,i=i+Math.imul(H,lt)|0,c=c+Math.imul(H,ct)|0,h=h+Math.imul(M,dt)|0,i=i+Math.imul(M,vt)|0,i=i+Math.imul(x,dt)|0,c=c+Math.imul(x,vt)|0;var Ke=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,h=Math.imul(Y,ot),i=Math.imul(Y,ft),i=i+Math.imul(X,ot)|0,c=Math.imul(X,ft),h=h+Math.imul(Z,ut)|0,i=i+Math.imul(Z,ht)|0,i=i+Math.imul(J,ut)|0,c=c+Math.imul(J,ht)|0,h=h+Math.imul(R,lt)|0,i=i+Math.imul(R,ct)|0,i=i+Math.imul(j,lt)|0,c=c+Math.imul(j,ct)|0,h=h+Math.imul(C,dt)|0,i=i+Math.imul(C,vt)|0,i=i+Math.imul(H,dt)|0,c=c+Math.imul(H,vt)|0,h=h+Math.imul(M,gt)|0,i=i+Math.imul(M,pt)|0,i=i+Math.imul(x,gt)|0,c=c+Math.imul(x,pt)|0;var Ve=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,h=Math.imul(W,ot),i=Math.imul(W,ft),i=i+Math.imul($,ot)|0,c=Math.imul($,ft),h=h+Math.imul(Y,ut)|0,i=i+Math.imul(Y,ht)|0,i=i+Math.imul(X,ut)|0,c=c+Math.imul(X,ht)|0,h=h+Math.imul(Z,lt)|0,i=i+Math.imul(Z,ct)|0,i=i+Math.imul(J,lt)|0,c=c+Math.imul(J,ct)|0,h=h+Math.imul(R,dt)|0,i=i+Math.imul(R,vt)|0,i=i+Math.imul(j,dt)|0,c=c+Math.imul(j,vt)|0,h=h+Math.imul(C,gt)|0,i=i+Math.imul(C,pt)|0,i=i+Math.imul(H,gt)|0,c=c+Math.imul(H,pt)|0,h=h+Math.imul(M,mt)|0,i=i+Math.imul(M,yt)|0,i=i+Math.imul(x,mt)|0,c=c+Math.imul(x,yt)|0;var Ge=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,h=Math.imul(Q,ot),i=Math.imul(Q,ft),i=i+Math.imul(tt,ot)|0,c=Math.imul(tt,ft),h=h+Math.imul(W,ut)|0,i=i+Math.imul(W,ht)|0,i=i+Math.imul($,ut)|0,c=c+Math.imul($,ht)|0,h=h+Math.imul(Y,lt)|0,i=i+Math.imul(Y,ct)|0,i=i+Math.imul(X,lt)|0,c=c+Math.imul(X,ct)|0,h=h+Math.imul(Z,dt)|0,i=i+Math.imul(Z,vt)|0,i=i+Math.imul(J,dt)|0,c=c+Math.imul(J,vt)|0,h=h+Math.imul(R,gt)|0,i=i+Math.imul(R,pt)|0,i=i+Math.imul(j,gt)|0,c=c+Math.imul(j,pt)|0,h=h+Math.imul(C,mt)|0,i=i+Math.imul(C,yt)|0,i=i+Math.imul(H,mt)|0,c=c+Math.imul(H,yt)|0,h=h+Math.imul(M,_t)|0,i=i+Math.imul(M,wt)|0,i=i+Math.imul(x,_t)|0,c=c+Math.imul(x,wt)|0;var Ze=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,h=Math.imul(et,ot),i=Math.imul(et,ft),i=i+Math.imul(rt,ot)|0,c=Math.imul(rt,ft),h=h+Math.imul(Q,ut)|0,i=i+Math.imul(Q,ht)|0,i=i+Math.imul(tt,ut)|0,c=c+Math.imul(tt,ht)|0,h=h+Math.imul(W,lt)|0,i=i+Math.imul(W,ct)|0,i=i+Math.imul($,lt)|0,c=c+Math.imul($,ct)|0,h=h+Math.imul(Y,dt)|0,i=i+Math.imul(Y,vt)|0,i=i+Math.imul(X,dt)|0,c=c+Math.imul(X,vt)|0,h=h+Math.imul(Z,gt)|0,i=i+Math.imul(Z,pt)|0,i=i+Math.imul(J,gt)|0,c=c+Math.imul(J,pt)|0,h=h+Math.imul(R,mt)|0,i=i+Math.imul(R,yt)|0,i=i+Math.imul(j,mt)|0,c=c+Math.imul(j,yt)|0,h=h+Math.imul(C,_t)|0,i=i+Math.imul(C,wt)|0,i=i+Math.imul(H,_t)|0,c=c+Math.imul(H,wt)|0,h=h+Math.imul(M,Mt)|0,i=i+Math.imul(M,bt)|0,i=i+Math.imul(x,Mt)|0,c=c+Math.imul(x,bt)|0;var Je=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(it,ot),i=Math.imul(it,ft),i=i+Math.imul(nt,ot)|0,c=Math.imul(nt,ft),h=h+Math.imul(et,ut)|0,i=i+Math.imul(et,ht)|0,i=i+Math.imul(rt,ut)|0,c=c+Math.imul(rt,ht)|0,h=h+Math.imul(Q,lt)|0,i=i+Math.imul(Q,ct)|0,i=i+Math.imul(tt,lt)|0,c=c+Math.imul(tt,ct)|0,h=h+Math.imul(W,dt)|0,i=i+Math.imul(W,vt)|0,i=i+Math.imul($,dt)|0,c=c+Math.imul($,vt)|0,h=h+Math.imul(Y,gt)|0,i=i+Math.imul(Y,pt)|0,i=i+Math.imul(X,gt)|0,c=c+Math.imul(X,pt)|0,h=h+Math.imul(Z,mt)|0,i=i+Math.imul(Z,yt)|0,i=i+Math.imul(J,mt)|0,c=c+Math.imul(J,yt)|0,h=h+Math.imul(R,_t)|0,i=i+Math.imul(R,wt)|0,i=i+Math.imul(j,_t)|0,c=c+Math.imul(j,wt)|0,h=h+Math.imul(C,Mt)|0,i=i+Math.imul(C,bt)|0,i=i+Math.imul(H,Mt)|0,c=c+Math.imul(H,bt)|0,h=h+Math.imul(M,xt)|0,i=i+Math.imul(M,At)|0,i=i+Math.imul(x,xt)|0,c=c+Math.imul(x,At)|0;var Ye=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,h=Math.imul(at,ot),i=Math.imul(at,ft),i=i+Math.imul(st,ot)|0,c=Math.imul(st,ft),h=h+Math.imul(it,ut)|0,i=i+Math.imul(it,ht)|0,i=i+Math.imul(nt,ut)|0,c=c+Math.imul(nt,ht)|0,h=h+Math.imul(et,lt)|0,i=i+Math.imul(et,ct)|0,i=i+Math.imul(rt,lt)|0,c=c+Math.imul(rt,ct)|0,h=h+Math.imul(Q,dt)|0,i=i+Math.imul(Q,vt)|0,i=i+Math.imul(tt,dt)|0,c=c+Math.imul(tt,vt)|0,h=h+Math.imul(W,gt)|0,i=i+Math.imul(W,pt)|0,i=i+Math.imul($,gt)|0,c=c+Math.imul($,pt)|0,h=h+Math.imul(Y,mt)|0,i=i+Math.imul(Y,yt)|0,i=i+Math.imul(X,mt)|0,c=c+Math.imul(X,yt)|0,h=h+Math.imul(Z,_t)|0,i=i+Math.imul(Z,wt)|0,i=i+Math.imul(J,_t)|0,c=c+Math.imul(J,wt)|0,h=h+Math.imul(R,Mt)|0,i=i+Math.imul(R,bt)|0,i=i+Math.imul(j,Mt)|0,c=c+Math.imul(j,bt)|0,h=h+Math.imul(C,xt)|0,i=i+Math.imul(C,At)|0,i=i+Math.imul(H,xt)|0,c=c+Math.imul(H,At)|0,h=h+Math.imul(M,Pt)|0,i=i+Math.imul(M,Tt)|0,i=i+Math.imul(x,Pt)|0,c=c+Math.imul(x,Tt)|0;var Xe=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,h=Math.imul(at,ut),i=Math.imul(at,ht),i=i+Math.imul(st,ut)|0,c=Math.imul(st,ht),h=h+Math.imul(it,lt)|0,i=i+Math.imul(it,ct)|0,i=i+Math.imul(nt,lt)|0,c=c+Math.imul(nt,ct)|0,h=h+Math.imul(et,dt)|0,i=i+Math.imul(et,vt)|0,i=i+Math.imul(rt,dt)|0,c=c+Math.imul(rt,vt)|0,h=h+Math.imul(Q,gt)|0,i=i+Math.imul(Q,pt)|0,i=i+Math.imul(tt,gt)|0,c=c+Math.imul(tt,pt)|0,h=h+Math.imul(W,mt)|0,i=i+Math.imul(W,yt)|0,i=i+Math.imul($,mt)|0,c=c+Math.imul($,yt)|0,h=h+Math.imul(Y,_t)|0,i=i+Math.imul(Y,wt)|0,i=i+Math.imul(X,_t)|0,c=c+Math.imul(X,wt)|0,h=h+Math.imul(Z,Mt)|0,i=i+Math.imul(Z,bt)|0,i=i+Math.imul(J,Mt)|0,c=c+Math.imul(J,bt)|0,h=h+Math.imul(R,xt)|0,i=i+Math.imul(R,At)|0,i=i+Math.imul(j,xt)|0,c=c+Math.imul(j,At)|0,h=h+Math.imul(C,Pt)|0,i=i+Math.imul(C,Tt)|0,i=i+Math.imul(H,Pt)|0,c=c+Math.imul(H,Tt)|0;var We=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(We>>>26)|0,We&=67108863,h=Math.imul(at,lt),i=Math.imul(at,ct),i=i+Math.imul(st,lt)|0,c=Math.imul(st,ct),h=h+Math.imul(it,dt)|0,i=i+Math.imul(it,vt)|0,i=i+Math.imul(nt,dt)|0,c=c+Math.imul(nt,vt)|0,h=h+Math.imul(et,gt)|0,i=i+Math.imul(et,pt)|0,i=i+Math.imul(rt,gt)|0,c=c+Math.imul(rt,pt)|0,h=h+Math.imul(Q,mt)|0,i=i+Math.imul(Q,yt)|0,i=i+Math.imul(tt,mt)|0,c=c+Math.imul(tt,yt)|0,h=h+Math.imul(W,_t)|0,i=i+Math.imul(W,wt)|0,i=i+Math.imul($,_t)|0,c=c+Math.imul($,wt)|0,h=h+Math.imul(Y,Mt)|0,i=i+Math.imul(Y,bt)|0,i=i+Math.imul(X,Mt)|0,c=c+Math.imul(X,bt)|0,h=h+Math.imul(Z,xt)|0,i=i+Math.imul(Z,At)|0,i=i+Math.imul(J,xt)|0,c=c+Math.imul(J,At)|0,h=h+Math.imul(R,Pt)|0,i=i+Math.imul(R,Tt)|0,i=i+Math.imul(j,Pt)|0,c=c+Math.imul(j,Tt)|0;var $e=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+($e>>>26)|0,$e&=67108863,h=Math.imul(at,dt),i=Math.imul(at,vt),i=i+Math.imul(st,dt)|0,c=Math.imul(st,vt),h=h+Math.imul(it,gt)|0,i=i+Math.imul(it,pt)|0,i=i+Math.imul(nt,gt)|0,c=c+Math.imul(nt,pt)|0,h=h+Math.imul(et,mt)|0,i=i+Math.imul(et,yt)|0,i=i+Math.imul(rt,mt)|0,c=c+Math.imul(rt,yt)|0,h=h+Math.imul(Q,_t)|0,i=i+Math.imul(Q,wt)|0,i=i+Math.imul(tt,_t)|0,c=c+Math.imul(tt,wt)|0,h=h+Math.imul(W,Mt)|0,i=i+Math.imul(W,bt)|0,i=i+Math.imul($,Mt)|0,c=c+Math.imul($,bt)|0,h=h+Math.imul(Y,xt)|0,i=i+Math.imul(Y,At)|0,i=i+Math.imul(X,xt)|0,c=c+Math.imul(X,At)|0,h=h+Math.imul(Z,Pt)|0,i=i+Math.imul(Z,Tt)|0,i=i+Math.imul(J,Pt)|0,c=c+Math.imul(J,Tt)|0;var Qe=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(at,gt),i=Math.imul(at,pt),i=i+Math.imul(st,gt)|0,c=Math.imul(st,pt),h=h+Math.imul(it,mt)|0,i=i+Math.imul(it,yt)|0,i=i+Math.imul(nt,mt)|0,c=c+Math.imul(nt,yt)|0,h=h+Math.imul(et,_t)|0,i=i+Math.imul(et,wt)|0,i=i+Math.imul(rt,_t)|0,c=c+Math.imul(rt,wt)|0,h=h+Math.imul(Q,Mt)|0,i=i+Math.imul(Q,bt)|0,i=i+Math.imul(tt,Mt)|0,c=c+Math.imul(tt,bt)|0,h=h+Math.imul(W,xt)|0,i=i+Math.imul(W,At)|0,i=i+Math.imul($,xt)|0,c=c+Math.imul($,At)|0,h=h+Math.imul(Y,Pt)|0,i=i+Math.imul(Y,Tt)|0,i=i+Math.imul(X,Pt)|0,c=c+Math.imul(X,Tt)|0;var tr=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(at,mt),i=Math.imul(at,yt),i=i+Math.imul(st,mt)|0,c=Math.imul(st,yt),h=h+Math.imul(it,_t)|0,i=i+Math.imul(it,wt)|0,i=i+Math.imul(nt,_t)|0,c=c+Math.imul(nt,wt)|0,h=h+Math.imul(et,Mt)|0,i=i+Math.imul(et,bt)|0,i=i+Math.imul(rt,Mt)|0,c=c+Math.imul(rt,bt)|0,h=h+Math.imul(Q,xt)|0,i=i+Math.imul(Q,At)|0,i=i+Math.imul(tt,xt)|0,c=c+Math.imul(tt,At)|0,h=h+Math.imul(W,Pt)|0,i=i+Math.imul(W,Tt)|0,i=i+Math.imul($,Pt)|0,c=c+Math.imul($,Tt)|0;var er=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(er>>>26)|0,er&=67108863,h=Math.imul(at,_t),i=Math.imul(at,wt),i=i+Math.imul(st,_t)|0,c=Math.imul(st,wt),h=h+Math.imul(it,Mt)|0,i=i+Math.imul(it,bt)|0,i=i+Math.imul(nt,Mt)|0,c=c+Math.imul(nt,bt)|0,h=h+Math.imul(et,xt)|0,i=i+Math.imul(et,At)|0,i=i+Math.imul(rt,xt)|0,c=c+Math.imul(rt,At)|0,h=h+Math.imul(Q,Pt)|0,i=i+Math.imul(Q,Tt)|0,i=i+Math.imul(tt,Pt)|0,c=c+Math.imul(tt,Tt)|0;var rr=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(rr>>>26)|0,rr&=67108863,h=Math.imul(at,Mt),i=Math.imul(at,bt),i=i+Math.imul(st,Mt)|0,c=Math.imul(st,bt),h=h+Math.imul(it,xt)|0,i=i+Math.imul(it,At)|0,i=i+Math.imul(nt,xt)|0,c=c+Math.imul(nt,At)|0,h=h+Math.imul(et,Pt)|0,i=i+Math.imul(et,Tt)|0,i=i+Math.imul(rt,Pt)|0,c=c+Math.imul(rt,Tt)|0;var ir=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(ir>>>26)|0,ir&=67108863,h=Math.imul(at,xt),i=Math.imul(at,At),i=i+Math.imul(st,xt)|0,c=Math.imul(st,At),h=h+Math.imul(it,Pt)|0,i=i+Math.imul(it,Tt)|0,i=i+Math.imul(nt,Pt)|0,c=c+Math.imul(nt,Tt)|0;var nr=(g+h|0)+((i&8191)<<13)|0;g=(c+(i>>>13)|0)+(nr>>>26)|0,nr&=67108863,h=Math.imul(at,Pt),i=Math.imul(at,Tt),i=i+Math.imul(st,Pt)|0,c=Math.imul(st,Tt);var ar=(g+h|0)+((i&8191)<<13)|0;return g=(c+(i>>>13)|0)+(ar>>>26)|0,ar&=67108863,v[0]=Ue,v[1]=ze,v[2]=De,v[3]=Ke,v[4]=Ve,v[5]=Ge,v[6]=Ze,v[7]=Je,v[8]=Ye,v[9]=Xe,v[10]=We,v[11]=$e,v[12]=Qe,v[13]=tr,v[14]=er,v[15]=rr,v[16]=ir,v[17]=nr,v[18]=ar,g!==0&&(v[19]=g,o.length++),o};Math.imul||(se=ae);function Pr(d,t,a){a.negative=t.negative^d.negative,a.length=d.length+t.length;for(var o=0,u=0,l=0;l<a.length-1;l++){var v=u;u=0;for(var g=o&67108863,h=Math.min(l,t.length-1),i=Math.max(0,l-d.length+1);i<=h;i++){var c=l-i,w=d.words[c]|0,M=t.words[i]|0,x=w*M,B=x&67108863;v=v+(x/67108864|0)|0,B=B+g|0,g=B&67108863,v=v+(B>>>26)|0,u+=v>>>26,v&=67108863}a.words[l]=g,o=v,v=u}return o!==0?a.words[l]=o:a.length--,a._strip()}function Tr(d,t,a){return Pr(d,t,a)}s.prototype.mulTo=function(t,a){var o,u=this.length+t.length;return this.length===10&&t.length===10?o=se(this,t,a):u<63?o=ae(this,t,a):u<1024?o=Pr(this,t,a):o=Tr(this,t,a),o};function jt(d,t){this.x=d,this.y=t}jt.prototype.makeRBT=function(t){for(var a=new Array(t),o=s.prototype._countBits(t)-1,u=0;u<t;u++)a[u]=this.revBin(u,o,t);return a},jt.prototype.revBin=function(t,a,o){if(t===0||t===o-1)return t;for(var u=0,l=0;l<a;l++)u|=(t&1)<<a-l-1,t>>=1;return u},jt.prototype.permute=function(t,a,o,u,l,v){for(var g=0;g<v;g++)u[g]=a[t[g]],l[g]=o[t[g]]},jt.prototype.transform=function(t,a,o,u,l,v){this.permute(v,t,a,o,u,l);for(var g=1;g<l;g<<=1)for(var h=g<<1,i=Math.cos(2*Math.PI/h),c=Math.sin(2*Math.PI/h),w=0;w<l;w+=h)for(var M=i,x=c,B=0;B<g;B++){var C=o[w+B],H=u[w+B],Yt=o[w+B+g],R=u[w+B+g],j=M*Yt-x*R;R=M*R+x*Yt,Yt=j,o[w+B]=C+Yt,u[w+B]=H+R,o[w+B+g]=C-Yt,u[w+B+g]=H-R,B!==h&&(j=i*M-c*x,x=i*x+c*M,M=j)}},jt.prototype.guessLen13b=function(t,a){var o=Math.max(a,t)|1,u=o&1,l=0;for(o=o/2|0;o;o=o>>>1)l++;return 1<<l+1+u},jt.prototype.conjugate=function(t,a,o){if(!(o<=1))for(var u=0;u<o/2;u++){var l=t[u];t[u]=t[o-u-1],t[o-u-1]=l,l=a[u],a[u]=-a[o-u-1],a[o-u-1]=-l}},jt.prototype.normalize13b=function(t,a){for(var o=0,u=0;u<a/2;u++){var l=Math.round(t[2*u+1]/a)*8192+Math.round(t[2*u]/a)+o;t[u]=l&67108863,l<67108864?o=0:o=l/67108864|0}return t},jt.prototype.convert13b=function(t,a,o,u){for(var l=0,v=0;v<a;v++)l=l+(t[v]|0),o[2*v]=l&8191,l=l>>>13,o[2*v+1]=l&8191,l=l>>>13;for(v=2*a;v<u;++v)o[v]=0;r(l===0),r((l&-8192)===0)},jt.prototype.stub=function(t){for(var a=new Array(t),o=0;o<t;o++)a[o]=0;return a},jt.prototype.mulp=function(t,a,o){var u=2*this.guessLen13b(t.length,a.length),l=this.makeRBT(u),v=this.stub(u),g=new Array(u),h=new Array(u),i=new Array(u),c=new Array(u),w=new Array(u),M=new Array(u),x=o.words;x.length=u,this.convert13b(t.words,t.length,g,u),this.convert13b(a.words,a.length,c,u),this.transform(g,v,h,i,u,l),this.transform(c,v,w,M,u,l);for(var B=0;B<u;B++){var C=h[B]*w[B]-i[B]*M[B];i[B]=h[B]*M[B]+i[B]*w[B],h[B]=C}return this.conjugate(h,i,u),this.transform(h,i,x,v,u,l),this.conjugate(x,v,u),this.normalize13b(x,u),o.negative=t.negative^a.negative,o.length=t.length+a.length,o._strip()},s.prototype.mul=function(t){var a=new s(null);return a.words=new Array(this.length+t.length),this.mulTo(t,a)},s.prototype.mulf=function(t){var a=new s(null);return a.words=new Array(this.length+t.length),Tr(this,t,a)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var a=t<0;a&&(t=-t),r(typeof t=="number"),r(t<67108864);for(var o=0,u=0;u<this.length;u++){var l=(this.words[u]|0)*t,v=(l&67108863)+(o&67108863);o>>=26,o+=l/67108864|0,o+=v>>>26,this.words[u]=v&67108863}return o!==0&&(this.words[u]=o,this.length++),a?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var a=kt(t);if(a.length===0)return new s(1);for(var o=this,u=0;u<a.length&&a[u]===0;u++,o=o.sqr());if(++u<a.length)for(var l=o.sqr();u<a.length;u++,l=l.sqr())a[u]!==0&&(o=o.mul(l));return o},s.prototype.iushln=function(t){r(typeof t=="number"&&t>=0);var a=t%26,o=(t-a)/26,u=67108863>>>26-a<<26-a,l;if(a!==0){var v=0;for(l=0;l<this.length;l++){var g=this.words[l]&u,h=(this.words[l]|0)-g<<a;this.words[l]=h|v,v=g>>>26-a}v&&(this.words[l]=v,this.length++)}if(o!==0){for(l=this.length-1;l>=0;l--)this.words[l+o]=this.words[l];for(l=0;l<o;l++)this.words[l]=0;this.length+=o}return this._strip()},s.prototype.ishln=function(t){return r(this.negative===0),this.iushln(t)},s.prototype.iushrn=function(t,a,o){r(typeof t=="number"&&t>=0);var u;a?u=(a-a%26)/26:u=0;var l=t%26,v=Math.min((t-l)/26,this.length),g=67108863^67108863>>>l<<l,h=o;if(u-=v,u=Math.max(0,u),h){for(var i=0;i<v;i++)h.words[i]=this.words[i];h.length=v}if(v!==0)if(this.length>v)for(this.length-=v,i=0;i<this.length;i++)this.words[i]=this.words[i+v];else this.words[0]=0,this.length=1;var c=0;for(i=this.length-1;i>=0&&(c!==0||i>=u);i--){var w=this.words[i]|0;this.words[i]=c<<26-l|w>>>l,c=w&g}return h&&c!==0&&(h.words[h.length++]=c),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,a,o){return r(this.negative===0),this.iushrn(t,a,o)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r(typeof t=="number"&&t>=0);var a=t%26,o=(t-a)/26,u=1<<a;if(this.length<=o)return!1;var l=this.words[o];return!!(l&u)},s.prototype.imaskn=function(t){r(typeof t=="number"&&t>=0);var a=t%26,o=(t-a)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=o)return this;if(a!==0&&o++,this.length=Math.min(o,this.length),a!==0){var u=67108863^67108863>>>a<<a;this.words[this.length-1]&=u}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r(typeof t=="number"),r(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)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var a=0;a<this.length&&this.words[a]>=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},s.prototype.isubn=function(t){if(r(typeof t=="number"),r(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 a=0;a<this.length&&this.words[a]<0;a++)this.words[a]+=67108864,this.words[a+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,a,o){var u=t.length+o,l;this._expand(u);var v,g=0;for(l=0;l<t.length;l++){v=(this.words[l+o]|0)+g;var h=(t.words[l]|0)*a;v-=h&67108863,g=(v>>26)-(h/67108864|0),this.words[l+o]=v&67108863}for(;l<this.length-o;l++)v=(this.words[l+o]|0)+g,g=v>>26,this.words[l+o]=v&67108863;if(g===0)return this._strip();for(r(g===-1),g=0,l=0;l<this.length;l++)v=-(this.words[l]|0)+g,g=v>>26,this.words[l]=v&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,a){var o=this.length-t.length,u=this.clone(),l=t,v=l.words[l.length-1]|0,g=this._countBits(v);o=26-g,o!==0&&(l=l.ushln(o),u.iushln(o),v=l.words[l.length-1]|0);var h=u.length-l.length,i;if(a!=="mod"){i=new s(null),i.length=h+1,i.words=new Array(i.length);for(var c=0;c<i.length;c++)i.words[c]=0}var w=u.clone()._ishlnsubmul(l,1,h);w.negative===0&&(u=w,i&&(i.words[h]=1));for(var M=h-1;M>=0;M--){var x=(u.words[l.length+M]|0)*67108864+(u.words[l.length+M-1]|0);for(x=Math.min(x/v|0,67108863),u._ishlnsubmul(l,x,M);u.negative!==0;)x--,u.negative=0,u._ishlnsubmul(l,1,M),u.isZero()||(u.negative^=1);i&&(i.words[M]=x)}return i&&i._strip(),u._strip(),a!=="div"&&o!==0&&u.iushrn(o),{div:i||null,mod:u}},s.prototype.divmod=function(t,a,o){if(r(!t.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var u,l,v;return this.negative!==0&&t.negative===0?(v=this.neg().divmod(t,a),a!=="mod"&&(u=v.div.neg()),a!=="div"&&(l=v.mod.neg(),o&&l.negative!==0&&l.iadd(t)),{div:u,mod:l}):this.negative===0&&t.negative!==0?(v=this.divmod(t.neg(),a),a!=="mod"&&(u=v.div.neg()),{div:u,mod:v.mod}):(this.negative&t.negative)!==0?(v=this.neg().divmod(t.neg(),a),a!=="div"&&(l=v.mod.neg(),o&&l.negative!==0&&l.isub(t)),{div:v.div,mod:l}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:t.length===1?a==="div"?{div:this.divn(t.words[0]),mod:null}:a==="mod"?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,a)},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var a=this.divmod(t);if(a.mod.isZero())return a.div;var o=a.div.negative!==0?a.mod.isub(t):a.mod,u=t.ushrn(1),l=t.andln(1),v=o.cmp(u);return v<0||l===1&&v===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},s.prototype.modrn=function(t){var a=t<0;a&&(t=-t),r(t<=67108863);for(var o=(1<<26)%t,u=0,l=this.length-1;l>=0;l--)u=(o*u+(this.words[l]|0))%t;return a?-u:u},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var a=t<0;a&&(t=-t),r(t<=67108863);for(var o=0,u=this.length-1;u>=0;u--){var l=(this.words[u]|0)+o*67108864;this.words[u]=l/t|0,o=l%t}return this._strip(),a?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(t.negative===0),r(!t.isZero());var a=this,o=t.clone();a.negative!==0?a=a.umod(t):a=a.clone();for(var u=new s(1),l=new s(0),v=new s(0),g=new s(1),h=0;a.isEven()&&o.isEven();)a.iushrn(1),o.iushrn(1),++h;for(var i=o.clone(),c=a.clone();!a.isZero();){for(var w=0,M=1;(a.words[0]&M)===0&&w<26;++w,M<<=1);if(w>0)for(a.iushrn(w);w-- >0;)(u.isOdd()||l.isOdd())&&(u.iadd(i),l.isub(c)),u.iushrn(1),l.iushrn(1);for(var x=0,B=1;(o.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(o.iushrn(x);x-- >0;)(v.isOdd()||g.isOdd())&&(v.iadd(i),g.isub(c)),v.iushrn(1),g.iushrn(1);a.cmp(o)>=0?(a.isub(o),u.isub(v),l.isub(g)):(o.isub(a),v.isub(u),g.isub(l))}return{a:v,b:g,gcd:o.iushln(h)}},s.prototype._invmp=function(t){r(t.negative===0),r(!t.isZero());var a=this,o=t.clone();a.negative!==0?a=a.umod(t):a=a.clone();for(var u=new s(1),l=new s(0),v=o.clone();a.cmpn(1)>0&&o.cmpn(1)>0;){for(var g=0,h=1;(a.words[0]&h)===0&&g<26;++g,h<<=1);if(g>0)for(a.iushrn(g);g-- >0;)u.isOdd()&&u.iadd(v),u.iushrn(1);for(var i=0,c=1;(o.words[0]&c)===0&&i<26;++i,c<<=1);if(i>0)for(o.iushrn(i);i-- >0;)l.isOdd()&&l.iadd(v),l.iushrn(1);a.cmp(o)>=0?(a.isub(o),u.isub(l)):(o.isub(a),l.isub(u))}var w;return a.cmpn(1)===0?w=u:w=l,w.cmpn(0)<0&&w.iadd(t),w},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var a=this.clone(),o=t.clone();a.negative=0,o.negative=0;for(var u=0;a.isEven()&&o.isEven();u++)a.iushrn(1),o.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;o.isEven();)o.iushrn(1);var l=a.cmp(o);if(l<0){var v=a;a=o,o=v}else if(l===0||o.cmpn(1)===0)break;a.isub(o)}while(!0);return o.iushln(u)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r(typeof t=="number");var a=t%26,o=(t-a)/26,u=1<<a;if(this.length<=o)return this._expand(o+1),this.words[o]|=u,this;for(var l=u,v=o;l!==0&&v<this.length;v++){var g=this.words[v]|0;g+=l,l=g>>>26,g&=67108863,this.words[v]=g}return l!==0&&(this.words[v]=l,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(t){var a=t<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var o;if(this.length>1)o=1;else{a&&(t=-t),r(t<=67108863,"Number is too big");var u=this.words[0]|0;o=u===t?0:u<t?-1:1}return this.negative!==0?-o|0:o},s.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var a=this.ucmp(t);return this.negative!==0?-a|0:a},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var a=0,o=this.length-1;o>=0;o--){var u=this.words[o]|0,l=t.words[o]|0;if(u!==l){u<l?a=-1:u>l&&(a=1);break}}return a},s.prototype.gtn=function(t){return this.cmpn(t)===1},s.prototype.gt=function(t){return this.cmp(t)===1},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return this.cmpn(t)===-1},s.prototype.lt=function(t){return this.cmp(t)===-1},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return this.cmpn(t)===0},s.prototype.eq=function(t){return this.cmp(t)===0},s.red=function(t){return new V(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var Re={k256:null,p224:null,p192:null,p25519:null};function Nt(d,t){this.name=d,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Nt.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},Nt.prototype.ireduce=function(t){var a=t,o;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),o=a.bitLength();while(o>this.n);var u=o<this.n?-1:a.ucmp(this.p);return u===0?(a.words[0]=0,a.length=1):u>0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},Nt.prototype.split=function(t,a){t.iushrn(this.n,0,a)},Nt.prototype.imulK=function(t){return t.imul(this.k)};function _e(){Nt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(_e,Nt),_e.prototype.split=function(t,a){for(var o=4194303,u=Math.min(t.length,9),l=0;l<u;l++)a.words[l]=t.words[l];if(a.length=u,t.length<=9){t.words[0]=0,t.length=1;return}var v=t.words[9];for(a.words[a.length++]=v&o,l=10;l<t.length;l++){var g=t.words[l]|0;t.words[l-10]=(g&o)<<4|v>>>22,v=g}v>>>=22,t.words[l-10]=v,v===0&&t.length>10?t.length-=10:t.length-=9},_e.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var a=0,o=0;o<t.length;o++){var u=t.words[o]|0;a+=u*977,t.words[o]=a&67108863,a=u*64+(a/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Sr(){Nt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(Sr,Nt);function Br(){Nt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Br,Nt);function je(){Nt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(je,Nt),je.prototype.imulK=function(t){for(var a=0,o=0;o<t.length;o++){var u=(t.words[o]|0)*19+a,l=u&67108863;u>>>=26,t.words[o]=l,a=u}return a!==0&&(t.words[t.length++]=a),t},s._prime=function(t){if(Re[t])return Re[t];var a;if(t==="k256")a=new _e;else if(t==="p224")a=new Sr;else if(t==="p192")a=new Br;else if(t==="p25519")a=new je;else throw new Error("Unknown prime "+t);return Re[t]=a,a};function V(d){if(typeof d=="string"){var t=s._prime(d);this.m=t.p,this.prime=t}else r(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}V.prototype._verify1=function(t){r(t.negative===0,"red works only with positives"),r(t.red,"red works only with red numbers")},V.prototype._verify2=function(t,a){r((t.negative|a.negative)===0,"red works only with positives"),r(t.red&&t.red===a.red,"red works only with red numbers")},V.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(b(t,t.umod(this.m)._forceRed(this)),t)},V.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},V.prototype.add=function(t,a){this._verify2(t,a);var o=t.add(a);return o.cmp(this.m)>=0&&o.isub(this.m),o._forceRed(this)},V.prototype.iadd=function(t,a){this._verify2(t,a);var o=t.iadd(a);return o.cmp(this.m)>=0&&o.isub(this.m),o},V.prototype.sub=function(t,a){this._verify2(t,a);var o=t.sub(a);return o.cmpn(0)<0&&o.iadd(this.m),o._forceRed(this)},V.prototype.isub=function(t,a){this._verify2(t,a);var o=t.isub(a);return o.cmpn(0)<0&&o.iadd(this.m),o},V.prototype.shl=function(t,a){return this._verify1(t),this.imod(t.ushln(a))},V.prototype.imul=function(t,a){return this._verify2(t,a),this.imod(t.imul(a))},V.prototype.mul=function(t,a){return this._verify2(t,a),this.imod(t.mul(a))},V.prototype.isqr=function(t){return this.imul(t,t.clone())},V.prototype.sqr=function(t){return this.mul(t,t)},V.prototype.sqrt=function(t){if(t.isZero())return t.clone();var a=this.m.andln(3);if(r(a%2===1),a===3){var o=this.m.add(new s(1)).iushrn(2);return this.pow(t,o)}for(var u=this.m.subn(1),l=0;!u.isZero()&&u.andln(1)===0;)l++,u.iushrn(1);r(!u.isZero());var v=new s(1).toRed(this),g=v.redNeg(),h=this.m.subn(1).iushrn(1),i=this.m.bitLength();for(i=new s(2*i*i).toRed(this);this.pow(i,h).cmp(g)!==0;)i.redIAdd(g);for(var c=this.pow(i,u),w=this.pow(t,u.addn(1).iushrn(1)),M=this.pow(t,u),x=l;M.cmp(v)!==0;){for(var B=M,C=0;B.cmp(v)!==0;C++)B=B.redSqr();r(C<x);var H=this.pow(c,new s(1).iushln(x-C-1));w=w.redMul(H),c=H.redSqr(),M=M.redMul(c),x=C}return w},V.prototype.invm=function(t){var a=t._invmp(this.m);return a.negative!==0?(a.negative=0,this.imod(a).redNeg()):this.imod(a)},V.prototype.pow=function(t,a){if(a.isZero())return new s(1).toRed(this);if(a.cmpn(1)===0)return t.clone();var o=4,u=new Array(1<<o);u[0]=new s(1).toRed(this),u[1]=t;for(var l=2;l<u.length;l++)u[l]=this.mul(u[l-1],t);var v=u[0],g=0,h=0,i=a.bitLength()%26;for(i===0&&(i=26),l=a.length-1;l>=0;l--){for(var c=a.words[l],w=i-1;w>=0;w--){var M=c>>w&1;if(v!==u[0]&&(v=this.sqr(v)),M===0&&g===0){h=0;continue}g<<=1,g|=M,h++,!(h!==o&&(l!==0||w!==0))&&(v=this.mul(v,u[g]),h=0,g=0)}i=26}return v},V.prototype.convertTo=function(t){var a=t.umod(this.m);return a===t?a.clone():a},V.prototype.convertFrom=function(t){var a=t.clone();return a.red=null,a},s.mont=function(t){return new te(t)};function te(d){V.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(te,V),te.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},te.prototype.convertFrom=function(t){var a=this.imod(t.mul(this.rinv));return a.red=null,a},te.prototype.imul=function(t,a){if(t.isZero()||a.isZero())return t.words[0]=0,t.length=1,t;var o=t.imul(a),u=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=o.isub(u).iushrn(this.shift),v=l;return l.cmp(this.m)>=0?v=l.isub(this.m):l.cmpn(0)<0&&(v=l.iadd(this.m)),v._forceRed(this)},te.prototype.mul=function(t,a){if(t.isZero()||a.isZero())return new s(0)._forceRed(this);var o=t.mul(a),u=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=o.isub(u).iushrn(this.shift),v=l;return l.cmp(this.m)>=0?v=l.isub(this.m):l.cmpn(0)<0&&(v=l.iadd(this.m)),v._forceRed(this)},te.prototype.invm=function(t){var a=this.imod(t._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof or>"u"||or,Jr)});var ur=G(z=>{"use strict";P();T();var Ai=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z,"__esModule",{value:!0});z.KECCAK256_RLP=z.KECCAK256_RLP_S=z.KECCAK256_RLP_ARRAY=z.KECCAK256_RLP_ARRAY_S=z.KECCAK256_NULL=z.KECCAK256_NULL_S=z.TWO_POW256=z.MAX_INTEGER=void 0;var fr=Gr().Buffer,Yr=Ai(Xt());z.MAX_INTEGER=new Yr.default("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16);z.TWO_POW256=new Yr.default("10000000000000000000000000000000000000000000000000000000000000000",16);z.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";z.KECCAK256_NULL=fr.from(z.KECCAK256_NULL_S,"hex");z.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";z.KECCAK256_RLP_ARRAY=fr.from(z.KECCAK256_RLP_ARRAY_S,"hex");z.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";z.KECCAK256_RLP=fr.from(z.KECCAK256_RLP_S,"hex")});var ee=G(K=>{"use strict";P();T();Object.defineProperty(K,"__esModule",{value:!0});K.isHexString=K.getKeys=K.fromAscii=K.fromUtf8=K.toAscii=K.arrayContainsArray=K.getBinarySize=K.padToEven=K.stripHexPrefix=K.isHexPrefixed=void 0;function Xr(e){if(typeof e!="string")throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return e[0]==="0"&&e[1]==="x"}K.isHexPrefixed=Xr;var Pi=function(e){if(typeof e!="string")throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return Xr(e)?e.slice(2):e};K.stripHexPrefix=Pi;function Wr(e){var n=e;if(typeof n!="string")throw new Error("[padToEven] value must be type 'string', received "+typeof n);return n.length%2&&(n="0"+n),n}K.padToEven=Wr;function Ti(e){if(typeof e!="string")throw new Error("[getBinarySize] method requires input type 'string', recieved "+typeof e);return y.Buffer.byteLength(e,"utf8")}K.getBinarySize=Ti;function Si(e,n,r){if(Array.isArray(e)!==!0)throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '"+typeof e+"'");if(Array.isArray(n)!==!0)throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '"+typeof n+"'");return n[r?"some":"every"](function(f){return e.indexOf(f)>=0})}K.arrayContainsArray=Si;function Bi(e){var n="",r=0,f=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<f;r+=2){var s=parseInt(e.substr(r,2),16);n+=String.fromCharCode(s)}return n}K.toAscii=Bi;function Ei(e){var n=y.Buffer.from(e,"utf8");return"0x"+Wr(n.toString("hex")).replace(/^0+|0+$/g,"")}K.fromUtf8=Ei;function Li(e){for(var n="",r=0;r<e.length;r++){var f=e.charCodeAt(r),s=f.toString(16);n+=s.length<2?"0"+s:s}return"0x"+n}K.fromAscii=Li;function Ii(e,n,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if(typeof n!="string")throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);for(var f=[],s=0;s<e.length;s++){var p=e[s][n];if(r&&!p)p="";else if(typeof p!="string")throw new Error("invalid abi - expected type 'string', received "+typeof p);f.push(p)}return f}K.getKeys=Ii;function Oi(e,n){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||n&&e.length!==2+2*n)}K.isHexString=Oi});var ve=G(Ut=>{"use strict";P();T();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.assertIsString=Ut.assertIsArray=Ut.assertIsBuffer=Ut.assertIsHexString=void 0;var Ni=ee(),qi=function(e){if(!(0,Ni.isHexString)(e)){var n="This method only supports 0x-prefixed hex strings but input was: "+e;throw new Error(n)}};Ut.assertIsHexString=qi;var Fi=function(e){if(!y.Buffer.isBuffer(e)){var n="This method only supports Buffer but input was: "+e;throw new Error(n)}};Ut.assertIsBuffer=Fi;var Ci=function(e){if(!Array.isArray(e)){var n="This method only supports number arrays but input was: "+e;throw new Error(n)}};Ut.assertIsArray=Ci;var ki=function(e){if(typeof e!="string"){var n="This method only supports strings but input was: "+e;throw new Error(n)}};Ut.assertIsString=ki});var Wt=G(S=>{"use strict";P();T();var Hi=S&&S.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S,"__esModule",{value:!0});S.baToJSON=S.toUtf8=S.addHexPrefix=S.toUnsigned=S.fromSigned=S.bufferToHex=S.bufferToInt=S.toBuffer=S.unpadHexString=S.unpadArray=S.unpadBuffer=S.setLengthRight=S.setLengthLeft=S.zeros=S.intToBuffer=S.intToHex=void 0;var hr=Hi(Xt()),re=ee(),ge=ve(),Ri=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: "+e);return"0x"+e.toString(16)};S.intToHex=Ri;var ji=function(e){var n=(0,S.intToHex)(e);return y.Buffer.from((0,re.padToEven)(n.slice(2)),"hex")};S.intToBuffer=ji;var Ui=function(e){return y.Buffer.allocUnsafe(e).fill(0)};S.zeros=Ui;var $r=function(e,n,r){var f=(0,S.zeros)(n);return r?e.length<n?(e.copy(f),f):e.slice(0,n):e.length<n?(e.copy(f,n-e.length),f):e.slice(-n)},zi=function(e,n){return(0,ge.assertIsBuffer)(e),$r(e,n,!1)};S.setLengthLeft=zi;var Di=function(e,n){return(0,ge.assertIsBuffer)(e),$r(e,n,!0)};S.setLengthRight=Di;var lr=function(e){for(var n=e[0];e.length>0&&n.toString()==="0";)e=e.slice(1),n=e[0];return e},Ki=function(e){return(0,ge.assertIsBuffer)(e),lr(e)};S.unpadBuffer=Ki;var Vi=function(e){return(0,ge.assertIsArray)(e),lr(e)};S.unpadArray=Vi;var Gi=function(e){return(0,ge.assertIsHexString)(e),e=(0,re.stripHexPrefix)(e),lr(e)};S.unpadHexString=Gi;var Zi=function(e){if(e==null)return y.Buffer.allocUnsafe(0);if(y.Buffer.isBuffer(e))return y.Buffer.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return y.Buffer.from(e);if(typeof e=="string"){if(!(0,re.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);return y.Buffer.from((0,re.padToEven)((0,re.stripHexPrefix)(e)),"hex")}if(typeof e=="number")return(0,S.intToBuffer)(e);if(hr.default.isBN(e))return e.toArrayLike(y.Buffer);if(e.toArray)return y.Buffer.from(e.toArray());if(e.toBuffer)return y.Buffer.from(e.toBuffer());throw new Error("invalid type")};S.toBuffer=Zi;var Ji=function(e){return new hr.default((0,S.toBuffer)(e)).toNumber()};S.bufferToInt=Ji;var Yi=function(e){return e=(0,S.toBuffer)(e),"0x"+e.toString("hex")};S.bufferToHex=Yi;var Xi=function(e){return new hr.default(e).fromTwos(256)};S.fromSigned=Xi;var Wi=function(e){return y.Buffer.from(e.toTwos(256).toArray())};S.toUnsigned=Wi;var $i=function(e){return typeof e!="string"||(0,re.isHexPrefixed)(e)?e:"0x"+e};S.addHexPrefix=$i;var Qi=function(e){var n=/^(00)+|(00)+$/g;if(e=(0,re.stripHexPrefix)(e),e.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");var r=y.Buffer.from(e.replace(n,""),"hex");return r.toString("utf8")};S.toUtf8=Qi;var tn=function(e){if(y.Buffer.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var n=[],r=0;r<e.length;r++)n.push((0,S.baToJSON)(e[r]));return n}};S.baToJSON=tn});var be=G(I=>{"use strict";P();T();var en=I&&I.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),rn=I&&I.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),nn=I&&I.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&en(n,e,r);return rn(n,e),n};Object.defineProperty(I,"__esModule",{value:!0});I.rlphash=I.ripemd160FromArray=I.ripemd160FromString=I.ripemd160=I.sha256FromArray=I.sha256FromString=I.sha256=I.keccakFromArray=I.keccakFromHexString=I.keccakFromString=I.keccak256=I.keccak=void 0;var Me=bi(),Qr=Mi(),an=nn(we()),pe=Wt(),zt=ve(),sn=function(e,n){switch(n===void 0&&(n=256),(0,zt.assertIsBuffer)(e),n){case 224:return(0,Me.keccak224)(e);case 256:return(0,Me.keccak256)(e);case 384:return(0,Me.keccak384)(e);case 512:return(0,Me.keccak512)(e);default:throw new Error("Invald algorithm: keccak"+n)}};I.keccak=sn;var on=function(e){return(0,I.keccak)(e)};I.keccak256=on;var fn=function(e,n){n===void 0&&(n=256),(0,zt.assertIsString)(e);var r=y.Buffer.from(e,"utf8");return(0,I.keccak)(r,n)};I.keccakFromString=fn;var un=function(e,n){return n===void 0&&(n=256),(0,zt.assertIsHexString)(e),(0,I.keccak)((0,pe.toBuffer)(e),n)};I.keccakFromHexString=un;var hn=function(e,n){return n===void 0&&(n=256),(0,zt.assertIsArray)(e),(0,I.keccak)((0,pe.toBuffer)(e),n)};I.keccakFromArray=hn;var cr=function(e){return e=(0,pe.toBuffer)(e),Qr("sha256").update(e).digest()},ln=function(e){return(0,zt.assertIsBuffer)(e),cr(e)};I.sha256=ln;var cn=function(e){return(0,zt.assertIsString)(e),cr(e)};I.sha256FromString=cn;var dn=function(e){return(0,zt.assertIsArray)(e),cr(e)};I.sha256FromArray=dn;var dr=function(e,n){e=(0,pe.toBuffer)(e);var r=Qr("rmd160").update(e).digest();return n===!0?(0,pe.setLengthLeft)(r,32):r},vn=function(e,n){return(0,zt.assertIsBuffer)(e),dr(e,n)};I.ripemd160=vn;var gn=function(e,n){return(0,zt.assertIsString)(e),dr(e,n)};I.ripemd160FromString=gn;var pn=function(e,n){return(0,zt.assertIsArray)(e),dr(e,n)};I.ripemd160FromArray=pn;var mn=function(e){return(0,I.keccak)(an.encode(e))};I.rlphash=mn});var Ae=G(Lt=>{"use strict";P();T();var yn=Lt&&Lt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.toType=Lt.TypeOutput=Lt.bnToRlp=Lt.bnToUnpaddedBuffer=Lt.bnToHex=void 0;var vr=yn(Xt()),_n=ee(),ti=Wt();function wn(e){return"0x"+e.toString(16)}Lt.bnToHex=wn;function ei(e){return(0,ti.unpadBuffer)(e.toArrayLike(y.Buffer))}Lt.bnToUnpaddedBuffer=ei;function Mn(e){return ei(e)}Lt.bnToRlp=Mn;var xe;(function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"})(xe=Lt.TypeOutput||(Lt.TypeOutput={}));function bn(e,n){if(e===null)return null;if(e!==void 0){if(typeof e=="string"&&!(0,_n.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: "+e);if(typeof e=="number"&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,ti.toBuffer)(e);if(n===xe.Buffer)return r;if(n===xe.BN)return new vr.default(r);if(n===xe.Number){var f=new vr.default(r),s=new vr.default(Number.MAX_SAFE_INTEGER.toString());if(f.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return f.toNumber()}else return"0x"+r.toString("hex")}}Lt.toType=bn});var pr=G(A=>{"use strict";P();T();var xn=A&&A.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),An=A&&A.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Pn=A&&A.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&xn(n,e,r);return An(n,e),n},Tn=A&&A.__read||function(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var f=r.call(e),s,p=[],m;try{for(;(n===void 0||n-- >0)&&!(s=f.next()).done;)p.push(s.value)}catch(_){m={error:_}}finally{try{s&&!s.done&&(r=f.return)&&r.call(f)}finally{if(m)throw m.error}}return p},ii=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0});A.isZeroAddress=A.zeroAddress=A.importPublic=A.privateToAddress=A.privateToPublic=A.publicToAddress=A.pubToAddress=A.isValidPublic=A.isValidPrivate=A.generateAddress2=A.generateAddress=A.isValidChecksumAddress=A.toChecksumAddress=A.isValidAddress=A.Account=void 0;var gr=ii(sr()),Kt=ii(Xt()),ri=Pn(we()),fe=Zr(),Sn=ee(),Pe=ur(),oe=Wt(),ue=be(),qt=ve(),Te=Ae(),Bn=function(){function e(n,r,f,s){n===void 0&&(n=new Kt.default(0)),r===void 0&&(r=new Kt.default(0)),f===void 0&&(f=Pe.KECCAK256_RLP),s===void 0&&(s=Pe.KECCAK256_NULL),this.nonce=n,this.balance=r,this.stateRoot=f,this.codeHash=s,this._validate()}return e.fromAccountData=function(n){var r=n.nonce,f=n.balance,s=n.stateRoot,p=n.codeHash;return new e(r?new Kt.default((0,oe.toBuffer)(r)):void 0,f?new Kt.default((0,oe.toBuffer)(f)):void 0,s?(0,oe.toBuffer)(s):void 0,p?(0,oe.toBuffer)(p):void 0)},e.fromRlpSerializedAccount=function(n){var r=ri.decode(n);if(!Array.isArray(r))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(r)},e.fromValuesArray=function(n){var r=Tn(n,4),f=r[0],s=r[1],p=r[2],m=r[3];return new e(new Kt.default(f),new Kt.default(s),p,m)},e.prototype._validate=function(){if(this.nonce.lt(new Kt.default(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new Kt.default(0)))throw new Error("balance must be greater than zero");if(this.stateRoot.length!==32)throw new Error("stateRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,Te.bnToUnpaddedBuffer)(this.nonce),(0,Te.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return ri.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(Pe.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(Pe.KECCAK256_NULL)},e}();A.Account=Bn;var En=function(e){try{(0,qt.assertIsString)(e)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};A.isValidAddress=En;var Ln=function(e,n){(0,qt.assertIsHexString)(e);var r=(0,Sn.stripHexPrefix)(e).toLowerCase(),f="";if(n){var s=(0,Te.toType)(n,Te.TypeOutput.BN);f=s.toString()+"0x"}for(var p=(0,ue.keccakFromString)(f+r).toString("hex"),m="0x",_=0;_<r.length;_++)parseInt(p[_],16)>=8?m+=r[_].toUpperCase():m+=r[_];return m};A.toChecksumAddress=Ln;var In=function(e,n){return(0,A.isValidAddress)(e)&&(0,A.toChecksumAddress)(e,n)===e};A.isValidChecksumAddress=In;var On=function(e,n){(0,qt.assertIsBuffer)(e),(0,qt.assertIsBuffer)(n);var r=new Kt.default(n);return r.isZero()?(0,ue.rlphash)([e,null]).slice(-20):(0,ue.rlphash)([e,y.Buffer.from(r.toArray())]).slice(-20)};A.generateAddress=On;var Nn=function(e,n,r){(0,qt.assertIsBuffer)(e),(0,qt.assertIsBuffer)(n),(0,qt.assertIsBuffer)(r),(0,gr.default)(e.length===20),(0,gr.default)(n.length===32);var f=(0,ue.keccak256)(y.Buffer.concat([y.Buffer.from("ff","hex"),e,n,(0,ue.keccak256)(r)]));return f.slice(-20)};A.generateAddress2=Nn;var qn=function(e){return(0,fe.privateKeyVerify)(e)};A.isValidPrivate=qn;var Fn=function(e,n){return n===void 0&&(n=!1),(0,qt.assertIsBuffer)(e),e.length===64?(0,fe.publicKeyVerify)(y.Buffer.concat([y.Buffer.from([4]),e])):n?(0,fe.publicKeyVerify)(e):!1};A.isValidPublic=Fn;var Cn=function(e,n){return n===void 0&&(n=!1),(0,qt.assertIsBuffer)(e),n&&e.length!==64&&(e=y.Buffer.from((0,fe.publicKeyConvert)(e,!1).slice(1))),(0,gr.default)(e.length===64),(0,ue.keccak)(e).slice(-20)};A.pubToAddress=Cn;A.publicToAddress=A.pubToAddress;var kn=function(e){return(0,qt.assertIsBuffer)(e),y.Buffer.from((0,fe.publicKeyCreate)(e,!1)).slice(1)};A.privateToPublic=kn;var Hn=function(e){return(0,A.publicToAddress)((0,A.privateToPublic)(e))};A.privateToAddress=Hn;var Rn=function(e){return(0,qt.assertIsBuffer)(e),e.length!==64&&(e=y.Buffer.from((0,fe.publicKeyConvert)(e,!1).slice(1))),e};A.importPublic=Rn;var jn=function(){var e=20,n=(0,oe.zeros)(e);return(0,oe.bufferToHex)(n)};A.zeroAddress=jn;var Un=function(e){try{(0,qt.assertIsString)(e)}catch{return!1}var n=(0,A.zeroAddress)();return n===e};A.isZeroAddress=Un});var si=G(he=>{"use strict";P();T();var ai=he&&he.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(he,"__esModule",{value:!0});he.Address=void 0;var ie=ai(sr()),Se=ai(Xt()),ni=Wt(),me=pr(),zn=function(){function e(n){(0,ie.default)(n.length===20,"Invalid address length"),this.buf=n}return e.zero=function(){return new e((0,ni.zeros)(20))},e.fromString=function(n){return(0,ie.default)((0,me.isValidAddress)(n),"Invalid address"),new e((0,ni.toBuffer)(n))},e.fromPublicKey=function(n){(0,ie.default)(y.Buffer.isBuffer(n),"Public key should be Buffer");var r=(0,me.pubToAddress)(n);return new e(r)},e.fromPrivateKey=function(n){(0,ie.default)(y.Buffer.isBuffer(n),"Private key should be Buffer");var r=(0,me.privateToAddress)(n);return new e(r)},e.generate=function(n,r){return(0,ie.default)(Se.default.isBN(r)),new e((0,me.generateAddress)(n.buf,r.toArrayLike(y.Buffer)))},e.generate2=function(n,r,f){return(0,ie.default)(y.Buffer.isBuffer(r)),(0,ie.default)(y.Buffer.isBuffer(f)),new e((0,me.generateAddress2)(n.buf,r,f))},e.prototype.equals=function(n){return this.buf.equals(n.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var n=new Se.default(this.buf),r=new Se.default(0),f=new Se.default("ffff","hex");return n.gte(r)&&n.lte(f)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return y.Buffer.from(this.buf)},e}();he.Address=zn});var oi=G(Bt=>{"use strict";P();T();var Dn=Bt&&Bt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.hashPersonalMessage=Bt.isValidSignature=Bt.fromRpcSig=Bt.toCompactSig=Bt.toRpcSig=Bt.ecrecover=Bt.ecsign=void 0;var mr=Zr(),ye=Dn(Xt()),Ft=Wt(),Kn=be(),Vn=ve(),$t=Ae();function Gn(e,n,r){var f=(0,mr.ecdsaSign)(e,n),s=f.signature,p=f.recid,m=y.Buffer.from(s.slice(0,32)),_=y.Buffer.from(s.slice(32,64));if(!r||typeof r=="number"){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var b=r?p+(r*2+35):p+27;return{r:m,s:_,v:b}}var E=(0,$t.toType)(r,$t.TypeOutput.BN),F=E.muln(2).addn(35).addn(p).toArrayLike(y.Buffer);return{r:m,s:_,v:F}}Bt.ecsign=Gn;function Be(e,n){var r=(0,$t.toType)(e,$t.TypeOutput.BN);if(!n)return r.subn(27);var f=(0,$t.toType)(n,$t.TypeOutput.BN);return r.sub(f.muln(2).addn(35))}function Ee(e){var n=new ye.default(e);return n.eqn(0)||n.eqn(1)}var Zn=function(e,n,r,f,s){var p=y.Buffer.concat([(0,Ft.setLengthLeft)(r,32),(0,Ft.setLengthLeft)(f,32)],64),m=Be(n,s);if(!Ee(m))throw new Error("Invalid signature v value");var _=(0,mr.ecdsaRecover)(p,m.toNumber(),e);return y.Buffer.from((0,mr.publicKeyConvert)(_,!1).slice(1))};Bt.ecrecover=Zn;var Jn=function(e,n,r,f){var s=Be(e,f);if(!Ee(s))throw new Error("Invalid signature v value");return(0,Ft.bufferToHex)(y.Buffer.concat([(0,Ft.setLengthLeft)(n,32),(0,Ft.setLengthLeft)(r,32),(0,Ft.toBuffer)(e)]))};Bt.toRpcSig=Jn;var Yn=function(e,n,r,f){var s=Be(e,f);if(!Ee(s))throw new Error("Invalid signature v value");var p=(0,$t.toType)(e,$t.TypeOutput.Number),m=r;return(p>28&&p%2===1||p===1||p===28)&&(m=y.Buffer.from(r),m[0]|=128),(0,Ft.bufferToHex)(y.Buffer.concat([(0,Ft.setLengthLeft)(n,32),(0,Ft.setLengthLeft)(m,32)]))};Bt.toCompactSig=Yn;var Xn=function(e){var n=(0,Ft.toBuffer)(e),r,f,s;if(n.length>=65)r=n.slice(0,32),f=n.slice(32,64),s=(0,Ft.bufferToInt)(n.slice(64));else if(n.length===64)r=n.slice(0,32),f=n.slice(32,64),s=(0,Ft.bufferToInt)(n.slice(32,33))>>7,f[0]&=127;else throw new Error("Invalid signature length");return s<27&&(s+=27),{v:s,r,s:f}};Bt.fromRpcSig=Xn;var Wn=function(e,n,r,f,s){f===void 0&&(f=!0);var p=new ye.default("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),m=new ye.default("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(n.length!==32||r.length!==32||!Ee(Be(e,s)))return!1;var _=new ye.default(n),b=new ye.default(r);return!(_.isZero()||_.gt(m)||b.isZero()||b.gt(m)||f&&b.cmp(p)===1)};Bt.isValidSignature=Wn;var $n=function(e){(0,Vn.assertIsBuffer)(e);var n=y.Buffer.from(`Ethereum Signed Message:
`+e.length,"utf-8");return(0,Kn.keccak)(y.Buffer.concat([n,e]))};Bt.hashPersonalMessage=$n});var hi=G(Ct=>{"use strict";P();T();var Qn=Ct&&Ct.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),ta=Ct&&Ct.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),ea=Ct&&Ct.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Qn(n,e,r);return ta(n,e),n},ra=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.defineProperties=void 0;var fi=ra(sr()),ia=ee(),ui=ea(we()),Le=Wt(),na=function(e,n,r){if(e.raw=[],e._fields=[],e.toJSON=function(s){if(s===void 0&&(s=!1),s){var p={};return e._fields.forEach(function(m){p[m]="0x"+e[m].toString("hex")}),p}return(0,Le.baToJSON)(e.raw)},e.serialize=function(){return ui.encode(e.raw)},n.forEach(function(s,p){e._fields.push(s.name);function m(){return e.raw[p]}function _(b){b=(0,Le.toBuffer)(b),b.toString("hex")==="00"&&!s.allowZero&&(b=y.Buffer.allocUnsafe(0)),s.allowLess&&s.length?(b=(0,Le.unpadBuffer)(b),(0,fi.default)(s.length>=b.length,"The field "+s.name+" must not have more "+s.length+" bytes")):!(s.allowZero&&b.length===0)&&s.length&&(0,fi.default)(s.length===b.length,"The field "+s.name+" must have byte length of "+s.length),e.raw[p]=b}Object.defineProperty(e,s.name,{enumerable:!0,configurable:!0,get:m,set:_}),s.default&&(e[s.name]=s.default),s.alias&&Object.defineProperty(e,s.alias,{enumerable:!1,configurable:!0,set:_,get:m})}),r)if(typeof r=="string"&&(r=y.Buffer.from((0,ia.stripHexPrefix)(r),"hex")),y.Buffer.isBuffer(r)&&(r=ui.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach(function(s,p){e[e._fields[p]]=(0,Le.toBuffer)(s)})}else if(typeof r=="object"){var f=Object.keys(r);n.forEach(function(s){f.indexOf(s.name)!==-1&&(e[s.name]=r[s.name]),f.indexOf(s.alias)!==-1&&(e[s.alias]=r[s.alias])})}else throw new Error("invalid data")};Ct.defineProperties=na});var li=G(It=>{"use strict";P();T();var aa=It&&It.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),sa=It&&It.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),oa=It&&It.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&aa(n,e,r);return sa(n,e),n},fa=It&&It.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(It,"__esModule",{value:!0});It.rlp=It.BN=void 0;var ua=fa(Xt());It.BN=ua.default;var ha=oa(we());It.rlp=ha});var Qt=G(N=>{"use strict";P();T();var la=N&&N.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),Vt=N&&N.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&la(n,e,r)};Object.defineProperty(N,"__esModule",{value:!0});N.isHexString=N.getKeys=N.fromAscii=N.fromUtf8=N.toAscii=N.arrayContainsArray=N.getBinarySize=N.padToEven=N.stripHexPrefix=N.isHexPrefixed=void 0;Vt(ur(),N);Vt(pr(),N);Vt(si(),N);Vt(be(),N);Vt(oi(),N);Vt(Wt(),N);Vt(hi(),N);Vt(li(),N);Vt(Ae(),N);var Dt=ee();Object.defineProperty(N,"isHexPrefixed",{enumerable:!0,get:function(){return Dt.isHexPrefixed}});Object.defineProperty(N,"stripHexPrefix",{enumerable:!0,get:function(){return Dt.stripHexPrefix}});Object.defineProperty(N,"padToEven",{enumerable:!0,get:function(){return Dt.padToEven}});Object.defineProperty(N,"getBinarySize",{enumerable:!0,get:function(){return Dt.getBinarySize}});Object.defineProperty(N,"arrayContainsArray",{enumerable:!0,get:function(){return Dt.arrayContainsArray}});Object.defineProperty(N,"toAscii",{enumerable:!0,get:function(){return Dt.toAscii}});Object.defineProperty(N,"fromUtf8",{enumerable:!0,get:function(){return Dt.fromUtf8}});Object.defineProperty(N,"fromAscii",{enumerable:!0,get:function(){return Dt.fromAscii}});Object.defineProperty(N,"getKeys",{enumerable:!0,get:function(){return Dt.getKeys}});Object.defineProperty(N,"isHexString",{enumerable:!0,get:function(){return Dt.isHexString}})});var ne=G(Ht=>{"use strict";P();T();Object.defineProperty(Ht,"__esModule",{value:!0});Ht.N_DIV_2=Ht.isAccessList=Ht.isAccessListBuffer=Ht.Capability=void 0;var ca=Qt(),da;(function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"})(da=Ht.Capability||(Ht.Capability={}));function ci(e){if(e.length===0)return!0;var n=e[0];return!!Array.isArray(n)}Ht.isAccessListBuffer=ci;function va(e){return!ci(e)}Ht.isAccessList=va;Ht.N_DIV_2=new ca.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)});var Ie=G(Ot=>{"use strict";P();T();var ga=Ot&&Ot.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),pa=Ot&&Ot.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),ma=Ot&&Ot.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ga(n,e,r);return pa(n,e),n},ya=Ot&&Ot.__values||function(e){var n=typeof Symbol=="function"&&Symbol.iterator,r=n&&e[n],f=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&f>=e.length&&(e=void 0),{value:e&&e[f++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},_a=Ot&&Ot.__read||function(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var f=r.call(e),s,p=[],m;try{for(;(n===void 0||n-- >0)&&!(s=f.next()).done;)p.push(s.value)}catch(_){m={error:_}}finally{try{s&&!s.done&&(r=f.return)&&r.call(f)}finally{if(m)throw m.error}}return p};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.BaseTransaction=void 0;var le=ma(xi()),k=Qt(),yr=ne(),wa=function(){function e(n){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=le.Chain.Mainnet,this.DEFAULT_HARDFORK=le.Hardfork.Istanbul;var r=n.nonce,f=n.gasLimit,s=n.to,p=n.value,m=n.data,_=n.v,b=n.r,E=n.s,F=n.type;this._type=new k.BN((0,k.toBuffer)(F)).toNumber();var U=(0,k.toBuffer)(s===""?"0x":s),D=(0,k.toBuffer)(_===""?"0x":_),St=(0,k.toBuffer)(b===""?"0x":b),kt=(0,k.toBuffer)(E===""?"0x":E);this.nonce=new k.BN((0,k.toBuffer)(r===""?"0x":r)),this.gasLimit=new k.BN((0,k.toBuffer)(f===""?"0x":f)),this.to=U.length>0?new k.Address(U):void 0,this.value=new k.BN((0,k.toBuffer)(p===""?"0x":p)),this.data=(0,k.toBuffer)(m===""?"0x":m),this.v=D.length>0?new k.BN(D):void 0,this.r=St.length>0?new k.BN(St):void 0,this.s=kt.length>0?new k.BN(kt):void 0,this._validateCannotExceedMaxInteger({nonce:this.nonce,gasLimit:this.gasLimit,value:this.value,r:this.r,s:this.s})}return Object.defineProperty(e.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),e.prototype.supports=function(n){return this.activeCapabilities.includes(n)},e.prototype.validate=function(n){n===void 0&&(n=!1);var r=[];return this.getBaseFee().gt(this.gasLimit)&&r.push("gasLimit is too low. given "+this.gasLimit+", need at least "+this.getBaseFee()),this.isSigned()&&!this.verifySignature()&&r.push("Invalid Signature"),n?r:r.length===0},e.prototype.getBaseFee=function(){var n=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&n.iaddn(this.common.param("gasPrices","txCreation")),n},e.prototype.getDataFee=function(){for(var n=this.common.param("gasPrices","txDataZero"),r=this.common.param("gasPrices","txDataNonZero"),f=0,s=0;s<this.data.length;s++)this.data[s]===0?f+=n:f+=r;return new k.BN(f)},e.prototype.toCreationAddress=function(){return this.to===void 0||this.to.buf.length===0},e.prototype.isSigned=function(){var n=this,r=n.v,f=n.r,s=n.s;return this.type===0?!(!r||!f||!s):!(r===void 0||!f||!s)},e.prototype.verifySignature=function(){try{var n=this.getSenderPublicKey();return(0,k.unpadBuffer)(n).length!==0}catch{return!1}},e.prototype.getSenderAddress=function(){return new k.Address((0,k.publicToAddress)(this.getSenderPublicKey()))},e.prototype.sign=function(n){if(n.length!==32){var r=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(r)}var f=!1;this.type===0&&this.common.gteHardfork("spuriousDragon")&&!this.supports(yr.Capability.EIP155ReplayProtection)&&(this.activeCapabilities.push(yr.Capability.EIP155ReplayProtection),f=!0);var s=this.getMessageToSign(!0),p=(0,k.ecsign)(s,n),m=p.v,_=p.r,b=p.s,E=this._processSignature(m,_,b);if(f){var F=this.activeCapabilities.indexOf(yr.Capability.EIP155ReplayProtection);F>-1&&this.activeCapabilities.splice(F,1)}return E},e.prototype._getCommon=function(n,r){var f;if(r){var s=new k.BN((0,k.toBuffer)(r));if(n){if(!n.chainIdBN().eq(s)){var p=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(p)}return n.copy()}else return le.default.isSupportedChainId(s)?new le.default({chain:s,hardfork:this.DEFAULT_HARDFORK}):le.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:s,chainId:s},this.DEFAULT_HARDFORK)}else return(f=n?.copy())!==null&&f!==void 0?f:new le.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(n,r){var f,s;r===void 0&&(r=53);try{for(var p=ya(Object.entries(n)),m=p.next();!m.done;m=p.next()){var _=_a(m.value,2),b=_[0],E=_[1];if(r===53){if(E?.gt(k.MAX_INTEGER)){var F=this._errorMsg(b+" cannot exceed MAX_INTEGER, given "+E);throw new Error(F)}}else if(r===256){if(E?.gte(k.TWO_POW256)){var F=this._errorMsg(b+" must be less than 2^256, given "+E);throw new Error(F)}}else{var F=this._errorMsg("unimplemented bits value");throw new Error(F)}}}catch(U){f={error:U}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(f)throw f.error}}},e.prototype._getSharedErrorPostfix=function(){var n="";try{n=this.isSigned()?(0,k.bufferToHex)(this.hash()):"not available (unsigned)"}catch{n="error"}var r="";try{r=this.isSigned().toString()}catch{n="error"}var f="";try{f=this.common.hardfork()}catch{f="error"}var s="tx type="+this.type+" hash="+n+" nonce="+this.nonce+" value="+this.value+" ";return s+="signed="+r+" hf="+f,s},e}();Ot.BaseTransaction=wa});var di=G(Gt=>{"use strict";P();T();var Ma=Gt&&Gt.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,s){f.__proto__=s}||function(f,s){for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(f[p]=s[p])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function f(){this.constructor=n}n.prototype=r===null?Object.create(r):(f.prototype=r.prototype,new f)}}(),Oe=Gt&&Gt.__assign||function(){return Oe=Object.assign||function(e){for(var n,r=1,f=arguments.length;r<f;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Oe.apply(this,arguments)},ba=Gt&&Gt.__read||function(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var f=r.call(e),s,p=[],m;try{for(;(n===void 0||n-- >0)&&!(s=f.next()).done;)p.push(s.value)}catch(_){m={error:_}}finally{try{s&&!s.done&&(r=f.return)&&r.call(f)}finally{if(m)throw m.error}}return p};Object.defineProperty(Gt,"__esModule",{value:!0});var O=Qt(),ce=ne(),xa=Ie(),Aa=0,Pa=function(e){Ma(n,e);function n(r,f){f===void 0&&(f={});var s,p=e.call(this,Oe(Oe({},r),{type:Aa}))||this;if(p.common=p._validateTxV(p.v,f.common),p.gasPrice=new O.BN((0,O.toBuffer)(r.gasPrice===""?"0x":r.gasPrice)),p._validateCannotExceedMaxInteger({gasPrice:p.gasPrice}),p.common.gteHardfork("spuriousDragon"))if(!p.isSigned())p.activeCapabilities.push(ce.Capability.EIP155ReplayProtection);else{var m=p.v,_=p.common.chainIdBN().muln(2);(m.eq(_.addn(35))||m.eq(_.addn(36)))&&p.activeCapabilities.push(ce.Capability.EIP155ReplayProtection)}var b=(s=f?.freeze)!==null&&s!==void 0?s:!0;return b&&Object.freeze(p),p}return n.fromTxData=function(r,f){return f===void 0&&(f={}),new n(r,f)},n.fromSerializedTx=function(r,f){f===void 0&&(f={});var s=O.rlp.decode(r);if(!Array.isArray(s))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(s,f)},n.fromRlpSerializedTx=function(r,f){return f===void 0&&(f={}),n.fromSerializedTx(r,f)},n.fromValuesArray=function(r,f){if(f===void 0&&(f={}),r.length!==6&&r.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");var s=ba(r,9),p=s[0],m=s[1],_=s[2],b=s[3],E=s[4],F=s[5],U=s[6],D=s[7],St=s[8];return new n({nonce:p,gasPrice:m,gasLimit:_,to:b,value:E,data:F,v:U,r:D,s:St},f)},n.prototype.raw=function(){return[(0,O.bnToUnpaddedBuffer)(this.nonce),(0,O.bnToUnpaddedBuffer)(this.gasPrice),(0,O.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:y.Buffer.from([]),(0,O.bnToUnpaddedBuffer)(this.value),this.data,this.v!==void 0?(0,O.bnToUnpaddedBuffer)(this.v):y.Buffer.from([]),this.r!==void 0?(0,O.bnToUnpaddedBuffer)(this.r):y.Buffer.from([]),this.s!==void 0?(0,O.bnToUnpaddedBuffer)(this.s):y.Buffer.from([])]},n.prototype.serialize=function(){return O.rlp.encode(this.raw())},n.prototype._getMessageToSign=function(){var r=[(0,O.bnToUnpaddedBuffer)(this.nonce),(0,O.bnToUnpaddedBuffer)(this.gasPrice),(0,O.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:y.Buffer.from([]),(0,O.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(ce.Capability.EIP155ReplayProtection)&&(r.push((0,O.toBuffer)(this.common.chainIdBN())),r.push((0,O.unpadBuffer)((0,O.toBuffer)(0))),r.push((0,O.unpadBuffer)((0,O.toBuffer)(0)))),r},n.prototype.getMessageToSign=function(r){r===void 0&&(r=!0);var f=this._getMessageToSign();return r?(0,O.rlphash)(f):f},n.prototype.getDataFee=function(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:e.prototype.getDataFee.call(this),hardfork:this.common.hardfork()}),e.prototype.getDataFee.call(this))},n.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},n.prototype.hash=function(){return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,O.rlphash)(this.raw())),this.cache.hash):(0,O.rlphash)(this.raw())},n.prototype.getMessageToVerifySignature=function(){if(!this.isSigned()){var r=this._errorMsg("This transaction is not signed");throw new Error(r)}var f=this._getMessageToSign();return(0,O.rlphash)(f)},n.prototype.getSenderPublicKey=function(){var r,f=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&((r=this.s)===null||r===void 0?void 0:r.gt(ce.N_DIV_2))){var s=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(s)}var p=this,m=p.v,_=p.r,b=p.s;try{return(0,O.ecrecover)(f,m,(0,O.bnToUnpaddedBuffer)(_),(0,O.bnToUnpaddedBuffer)(b),this.supports(ce.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch{var s=this._errorMsg("Invalid Signature");throw new Error(s)}},n.prototype._processSignature=function(r,f,s){var p=new O.BN(r);this.supports(ce.Capability.EIP155ReplayProtection)&&p.iadd(this.common.chainIdBN().muln(2).addn(8));var m={common:this.common};return n.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:p,r:new O.BN(f),s:new O.BN(s)},m)},n.prototype.toJSON=function(){return{nonce:(0,O.bnToHex)(this.nonce),gasPrice:(0,O.bnToHex)(this.gasPrice),gasLimit:(0,O.bnToHex)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,O.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:this.v!==void 0?(0,O.bnToHex)(this.v):void 0,r:this.r!==void 0?(0,O.bnToHex)(this.r):void 0,s:this.s!==void 0?(0,O.bnToHex)(this.s):void 0}},n.prototype._validateTxV=function(r,f){var s;if(r!==void 0&&!r.eqn(0)&&(!f||f.gteHardfork("spuriousDragon"))&&!r.eqn(27)&&!r.eqn(28))if(f){var p=f.chainIdBN().muln(2),m=r.eq(p.addn(35))||r.eq(p.addn(36));if(!m)throw new Error("Incompatible EIP155-based V "+r+" and chain id "+f.chainIdBN()+". See the Common parameter of the Transaction constructor to set the chain id.")}else{var _=void 0;r.subn(35).isEven()?_=35:_=36,s=r.subn(_).divn(2)}return this._getCommon(f,s)},n.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},n.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned()){var r=this._errorMsg("This transaction is not signed");throw new Error(r)}var f=this.common.gteHardfork("spuriousDragon"),s=this.v,p=this.common.chainIdBN().muln(2),m=s.eq(p.addn(35))||s.eq(p.addn(36));return m&&f},n.prototype.errorStr=function(){var r=this._getSharedErrorPostfix();return r+=" gasPrice="+this.gasPrice,r},n.prototype._errorMsg=function(r){return r+" ("+this.errorStr()+")"},n}(xa.BaseTransaction);Gt.default=Pa});var _r=G(Ne=>{"use strict";P();T();Object.defineProperty(Ne,"__esModule",{value:!0});Ne.AccessLists=void 0;var de=Qt(),Ta=ne(),Sa=function(){function e(){}return e.getAccessListData=function(n){var r,f;if(n&&(0,Ta.isAccessList)(n)){r=n;for(var s=[],p=0;p<n.length;p++){for(var m=n[p],_=(0,de.toBuffer)(m.address),b=[],E=0;E<m.storageKeys.length;E++)b.push((0,de.toBuffer)(m.storageKeys[E]));s.push([_,b])}f=s}else{f=n??[];for(var F=[],p=0;p<f.length;p++){for(var U=f[p],D=(0,de.bufferToHex)(U[0]),St=[],m=0;m<U[1].length;m++)St.push((0,de.bufferToHex)(U[1][m]));var kt={address:D,storageKeys:St};F.push(kt)}r=F}return{AccessListJSON:r,accessList:f}},e.verifyAccessList=function(n){for(var r=0;r<n.length;r++){var f=n[r],s=f[0],p=f[1];if(f[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(s.length!=20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(var m=0;m<p.length;m++)if(p[m].length!=32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},e.getAccessListJSON=function(n){for(var r=[],f=0;f<n.length;f++){for(var s=n[f],p={address:"0x"+(0,de.setLengthLeft)(s[0],20).toString("hex"),storageKeys:[]},m=s[1],_=0;_<m.length;_++){var b=m[_];p.storageKeys.push("0x"+(0,de.setLengthLeft)(b,32).toString("hex"))}r.push(p)}return r},e.getDataFeeEIP2930=function(n,r){for(var f=r.param("gasPrices","accessListStorageKeyCost"),s=r.param("gasPrices","accessListAddressCost"),p=0,m=0;m<n.length;m++){var _=n[m],b=_[1];p+=b.length}var E=n.length;return E*s+p*f},e}();Ne.AccessLists=Sa});var gi=G(Zt=>{"use strict";P();T();var Ba=Zt&&Zt.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,s){f.__proto__=s}||function(f,s){for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(f[p]=s[p])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function f(){this.constructor=n}n.prototype=r===null?Object.create(r):(f.prototype=r.prototype,new f)}}(),Fe=Zt&&Zt.__assign||function(){return Fe=Object.assign||function(e){for(var n,r=1,f=arguments.length;r<f;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fe.apply(this,arguments)},Ea=Zt&&Zt.__read||function(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var f=r.call(e),s,p=[],m;try{for(;(n===void 0||n-- >0)&&!(s=f.next()).done;)p.push(s.value)}catch(_){m={error:_}}finally{try{s&&!s.done&&(r=f.return)&&r.call(f)}finally{if(m)throw m.error}}return p};Object.defineProperty(Zt,"__esModule",{value:!0});var q=Qt(),La=Ie(),vi=ne(),qe=_r(),Mr=1,wr=y.Buffer.from(Mr.toString(16).padStart(2,"0"),"hex"),Ia=function(e){Ba(n,e);function n(r,f){f===void 0&&(f={});var s,p,m=e.call(this,Fe(Fe({},r),{type:Mr}))||this;m.DEFAULT_HARDFORK="berlin";var _=r.chainId,b=r.accessList,E=r.gasPrice;if(m.common=m._getCommon(f.common,_),m.chainId=m.common.chainIdBN(),!m.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");m.activeCapabilities=m.activeCapabilities.concat([2718,2930]);var F=qe.AccessLists.getAccessListData(b??[]);if(m.accessList=F.accessList,m.AccessListJSON=F.AccessListJSON,qe.AccessLists.verifyAccessList(m.accessList),m.gasPrice=new q.BN((0,q.toBuffer)(E===""?"0x":E)),m._validateCannotExceedMaxInteger({gasPrice:m.gasPrice}),m.v&&!m.v.eqn(0)&&!m.v.eqn(1)){var U=m._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(U)}if(m.common.gteHardfork("homestead")&&((s=m.s)===null||s===void 0?void 0:s.gt(vi.N_DIV_2))){var U=m._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(U)}var D=(p=f?.freeze)!==null&&p!==void 0?p:!0;return D&&Object.freeze(m),m}return Object.defineProperty(n.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),n.fromTxData=function(r,f){return f===void 0&&(f={}),new n(r,f)},n.fromSerializedTx=function(r,f){if(f===void 0&&(f={}),!r.slice(0,1).equals(wr))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: "+Mr+", received: "+r.slice(0,1).toString("hex"));var s=q.rlp.decode(r.slice(1));if(!Array.isArray(s))throw new Error("Invalid serialized tx input: must be array");return n.fromValuesArray(s,f)},n.fromRlpSerializedTx=function(r,f){return f===void 0&&(f={}),n.fromSerializedTx(r,f)},n.fromValuesArray=function(r,f){if(f===void 0&&(f={}),r.length!==8&&r.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");var s=Ea(r,11),p=s[0],m=s[1],_=s[2],b=s[3],E=s[4],F=s[5],U=s[6],D=s[7],St=s[8],kt=s[9],ae=s[10],se=[];return new n({chainId:new q.BN(p),nonce:m,gasPrice:_,gasLimit:b,to:E,value:F,data:U,accessList:D??se,v:St!==void 0?new q.BN(St):void 0,r:kt,s:ae},f)},n.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var r=e.prototype.getDataFee.call(this);return r.iaddn(qe.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:r,hardfork:this.common.hardfork()}),r},n.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},n.prototype.raw=function(){return[(0,q.bnToUnpaddedBuffer)(this.chainId),(0,q.bnToUnpaddedBuffer)(this.nonce),(0,q.bnToUnpaddedBuffer)(this.gasPrice),(0,q.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:y.Buffer.from([]),(0,q.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,this.v!==void 0?(0,q.bnToUnpaddedBuffer)(this.v):y.Buffer.from([]),this.r!==void 0?(0,q.bnToUnpaddedBuffer)(this.r):y.Buffer.from([]),this.s!==void 0?(0,q.bnToUnpaddedBuffer)(this.s):y.Buffer.from([])]},n.prototype.serialize=function(){var r=this.raw();return y.Buffer.concat([wr,q.rlp.encode(r)])},n.prototype.getMessageToSign=function(r){r===void 0&&(r=!0);var f=this.raw().slice(0,8),s=y.Buffer.concat([wr,q.rlp.encode(f)]);return r?(0,q.keccak256)(s):s},n.prototype.hash=function(){if(!this.isSigned()){var r=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(r)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,q.keccak256)(this.serialize())),this.cache.hash):(0,q.keccak256)(this.serialize())},n.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},n.prototype.getSenderPublicKey=function(){var r;if(!this.isSigned()){var f=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(f)}var s=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&((r=this.s)===null||r===void 0?void 0:r.gt(vi.N_DIV_2))){var f=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(f)}var p=this,m=p.yParity,_=p.r,b=p.s;try{return(0,q.ecrecover)(s,m.addn(27),(0,q.bnToUnpaddedBuffer)(_),(0,q.bnToUnpaddedBuffer)(b))}catch{var f=this._errorMsg("Invalid Signature");throw new Error(f)}},n.prototype._processSignature=function(r,f,s){var p={common:this.common};return n.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new q.BN(r-27),r:new q.BN(f),s:new q.BN(s)},p)},n.prototype.toJSON=function(){var r=qe.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,q.bnToHex)(this.chainId),nonce:(0,q.bnToHex)(this.nonce),gasPrice:(0,q.bnToHex)(this.gasPrice),gasLimit:(0,q.bnToHex)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,q.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:r,v:this.v!==void 0?(0,q.bnToHex)(this.v):void 0,r:this.r!==void 0?(0,q.bnToHex)(this.r):void 0,s:this.s!==void 0?(0,q.bnToHex)(this.s):void 0}},n.prototype.errorStr=function(){var r,f,s=this._getSharedErrorPostfix();return s+=" gasPrice="+this.gasPrice+" accessListCount="+((f=(r=this.accessList)===null||r===void 0?void 0:r.length)!==null&&f!==void 0?f:0),s},n.prototype._errorMsg=function(r){return r+" ("+this.errorStr()+")"},n}(La.BaseTransaction);Zt.default=Ia});var mi=G(br=>{"use strict";P();T();Object.defineProperty(br,"__esModule",{value:!0});var pi=Qt(),Rt=yi(),Oa=function(){function e(){}return e.fromTxData=function(n,r){if(r===void 0&&(r={}),!("type"in n)||n.type===void 0)return Rt.Transaction.fromTxData(n,r);var f=new pi.BN((0,pi.toBuffer)(n.type)).toNumber();if(f===0)return Rt.Transaction.fromTxData(n,r);if(f===1)return Rt.AccessListEIP2930Transaction.fromTxData(n,r);if(f===2)return Rt.FeeMarketEIP1559Transaction.fromTxData(n,r);throw new Error("Tx instantiation with type "+f+" not supported")},e.fromSerializedData=function(n,r){if(r===void 0&&(r={}),n[0]<=127){var f=void 0;switch(n[0]){case 1:f=2930;break;case 2:f=1559;break;default:throw new Error("TypedTransaction with ID "+n[0]+" unknown")}return f===1559?Rt.FeeMarketEIP1559Transaction.fromSerializedTx(n,r):Rt.AccessListEIP2930Transaction.fromSerializedTx(n,r)}else return Rt.Transaction.fromSerializedTx(n,r)},e.fromBlockBodyData=function(n,r){if(r===void 0&&(r={}),y.Buffer.isBuffer(n))return this.fromSerializedData(n,r);if(Array.isArray(n))return Rt.Transaction.fromValuesArray(n,r);throw new Error("Cannot decode transaction: unknown type input")},e.getTransactionClass=function(n,r){n===void 0&&(n=0);var f=n==0||n>=128&&n<=255;if(f)return Rt.Transaction;switch(n){case 1:return Rt.AccessListEIP2930Transaction;case 2:return Rt.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID "+n+" unknown")}},e}();br.default=Oa});var wi=G(Jt=>{"use strict";P();T();var Na=Jt&&Jt.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,s){f.__proto__=s}||function(f,s){for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(f[p]=s[p])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function f(){this.constructor=n}n.prototype=r===null?Object.create(r):(f.prototype=r.prototype,new f)}}(),ke=Jt&&Jt.__assign||function(){return ke=Object.assign||function(e){for(var n,r=1,f=arguments.length;r<f;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ke.apply(this,arguments)},qa=Jt&&Jt.__read||function(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var f=r.call(e),s,p=[],m;try{for(;(n===void 0||n-- >0)&&!(s=f.next()).done;)p.push(s.value)}catch(_){m={error:_}}finally{try{s&&!s.done&&(r=f.return)&&r.call(f)}finally{if(m)throw m.error}}return p};Object.defineProperty(Jt,"__esModule",{value:!0});var L=Qt(),Fa=Ie(),_i=ne(),Ce=_r(),Ar=2,xr=y.Buffer.from(Ar.toString(16).padStart(2,"0"),"hex"),Ca=function(e){Na(n,e);function n(r,f){f===void 0&&(f={});var s,p,m=e.call(this,ke(ke({},r),{type:Ar}))||this;m.DEFAULT_HARDFORK="london";var _=r.chainId,b=r.accessList,E=r.maxFeePerGas,F=r.maxPriorityFeePerGas;if(m.common=m._getCommon(f.common,_),m.chainId=m.common.chainIdBN(),!m.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");m.activeCapabilities=m.activeCapabilities.concat([1559,2718,2930]);var U=Ce.AccessLists.getAccessListData(b??[]);if(m.accessList=U.accessList,m.AccessListJSON=U.AccessListJSON,Ce.AccessLists.verifyAccessList(m.accessList),m.maxFeePerGas=new L.BN((0,L.toBuffer)(E===""?"0x":E)),m.maxPriorityFeePerGas=new L.BN((0,L.toBuffer)(F===""?"0x":F)),m._validateCannotExceedMaxInteger({maxFeePerGas:m.maxFeePerGas,maxPriorityFeePerGas:m.maxPriorityFeePerGas},256),m.maxFeePerGas.lt(m.maxPriorityFeePerGas)){var D=m._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(D)}if(m.v&&!m.v.eqn(0)&&!m.v.eqn(1)){var D=m._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(D)}if(m.common.gteHardfork("homestead")&&((s=m.s)===null||s===void 0?void 0:s.gt(_i.N_DIV_2))){var D=m._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(D)}var St=(p=f?.freeze)!==null&&p!==void 0?p:!0;return St&&Object.freeze(m),m}return Object.defineProperty(n.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),n.fromTxData=function(r,f){return f===void 0&&(f={}),new n(r,f)},n.fromSerializedTx=function(r,f){if(f===void 0&&(f={}),!r.slice(0,1).equals(xr))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: "+Ar+", received: "+r.slice(0,1).toString("hex"));var s=L.rlp.decode(r.slice(1));if(!Array.isArray(s))throw new Error("Invalid serialized tx input: must be array");return n.fromValuesArray(s,f)},n.fromRlpSerializedTx=function(r,f){return f===void 0&&(f={}),n.fromSerializedTx(r,f)},n.fromValuesArray=function(r,f){if(f===void 0&&(f={}),r.length!==9&&r.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");var s=qa(r,12),p=s[0],m=s[1],_=s[2],b=s[3],E=s[4],F=s[5],U=s[6],D=s[7],St=s[8],kt=s[9],ae=s[10],se=s[11];return new n({chainId:new L.BN(p),nonce:m,maxPriorityFeePerGas:_,maxFeePerGas:b,gasLimit:E,to:F,value:U,data:D,accessList:St??[],v:kt!==void 0?new L.BN(kt):void 0,r:ae,s:se},f)},n.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var r=e.prototype.getDataFee.call(this);return r.iaddn(Ce.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:r,hardfork:this.common.hardfork()}),r},n.prototype.getUpfrontCost=function(r){r===void 0&&(r=new L.BN(0));var f=L.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(r)),s=f.add(r);return this.gasLimit.mul(s).add(this.value)},n.prototype.raw=function(){return[(0,L.bnToUnpaddedBuffer)(this.chainId),(0,L.bnToUnpaddedBuffer)(this.nonce),(0,L.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,L.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,L.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:y.Buffer.from([]),(0,L.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,this.v!==void 0?(0,L.bnToUnpaddedBuffer)(this.v):y.Buffer.from([]),this.r!==void 0?(0,L.bnToUnpaddedBuffer)(this.r):y.Buffer.from([]),this.s!==void 0?(0,L.bnToUnpaddedBuffer)(this.s):y.Buffer.from([])]},n.prototype.serialize=function(){var r=this.raw();return y.Buffer.concat([xr,L.rlp.encode(r)])},n.prototype.getMessageToSign=function(r){r===void 0&&(r=!0);var f=this.raw().slice(0,9),s=y.Buffer.concat([xr,L.rlp.encode(f)]);return r?(0,L.keccak256)(s):s},n.prototype.hash=function(){if(!this.isSigned()){var r=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(r)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,L.keccak256)(this.serialize())),this.cache.hash):(0,L.keccak256)(this.serialize())},n.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},n.prototype.getSenderPublicKey=function(){var r;if(!this.isSigned()){var f=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(f)}var s=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&((r=this.s)===null||r===void 0?void 0:r.gt(_i.N_DIV_2))){var f=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(f)}var p=this,m=p.v,_=p.r,b=p.s;try{return(0,L.ecrecover)(s,m.addn(27),(0,L.bnToUnpaddedBuffer)(_),(0,L.bnToUnpaddedBuffer)(b))}catch{var f=this._errorMsg("Invalid Signature");throw new Error(f)}},n.prototype._processSignature=function(r,f,s){var p={common:this.common};return n.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new L.BN(r-27),r:new L.BN(f),s:new L.BN(s)},p)},n.prototype.toJSON=function(){var r=Ce.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,L.bnToHex)(this.chainId),nonce:(0,L.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,L.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,L.bnToHex)(this.maxFeePerGas),gasLimit:(0,L.bnToHex)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,L.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:r,v:this.v!==void 0?(0,L.bnToHex)(this.v):void 0,r:this.r!==void 0?(0,L.bnToHex)(this.r):void 0,s:this.s!==void 0?(0,L.bnToHex)(this.s):void 0}},n.prototype.errorStr=function(){var r=this._getSharedErrorPostfix();return r+=" maxFeePerGas="+this.maxFeePerGas+" maxPriorityFeePerGas="+this.maxPriorityFeePerGas,r},n.prototype._errorMsg=function(r){return r+" ("+this.errorStr()+")"},n}(Fa.BaseTransaction);Jt.default=Ca});var yi=G(Et=>{P();T();var ka=Et&&Et.__createBinding||(Object.create?function(e,n,r,f){f===void 0&&(f=r),Object.defineProperty(e,f,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,f){f===void 0&&(f=r),e[f]=n[r]}),Ha=Et&&Et.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&ka(n,e,r)},He=Et&&Et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});Et.FeeMarketEIP1559Transaction=Et.TransactionFactory=Et.AccessListEIP2930Transaction=Et.Transaction=void 0;var Ra=di();Object.defineProperty(Et,"Transaction",{enumerable:!0,get:function(){return He(Ra).default}});var ja=gi();Object.defineProperty(Et,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return He(ja).default}});var Ua=mi();Object.defineProperty(Et,"TransactionFactory",{enumerable:!0,get:function(){return He(Ua).default}});var za=wi();Object.defineProperty(Et,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return He(za).default}});Ha(ne(),Et)});export{yi as a};
window.inOKXExtension = true;
window.inMiniApp = false;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=chunk-22SOEWDR.js.map