1import{n as e,s as t,t as n}from"./chunk-Bj-mKKzh.js";import{t as r}from"./__vite-browser-external-IGW2q86x.js";var i=n(((e,t)=>{(function(e,t){function n(e,t){if(!e)throw Error(t||`Assertion failed`)}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,e!==null&&((t===`le`||t===`be`)&&(n=t,t=10),this._init(e||0,t||10,n||`be`))}typeof e==`object`?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var o;try{o=typeof window<`u`&&window.Buffer!==void 0?window.Buffer:r().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:typeof e==`object`&&!!e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if(typeof e==`number`)return this._initNumber(e,t,r);if(typeof e==`object`)return this._initArray(e,t,r);t===`hex`&&(t=16),n(t===(t|0)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,``);var i=0;e[0]===`-`&&(i++,this.negative=1),i<e.length&&(t===16?this._parseHex(e,i,r):(this._parseBase(e,t,i),r===`le`&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),r===`le`&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n(typeof e.length==`number`),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if(r===`be`)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);else if(r===`le`)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);return this._strip()};function s(e,t){var r=e.charCodeAt(t);if(r>=48&&r<=57)return r-48;if(r>=65&&r<=70)return r-55;if(r>=97&&r<=102)return r-87;n(!1,`Invalid character in `+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i=0,a=0,o;if(n===`be`)for(r=e.length-1;r>=t;r-=2)o=c(e,t,r)<<i,this.words[a]|=o&67108863,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=c(e,t,r)<<i,this.words[a]|=o&67108863,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()};function l(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),c=t;c<s;c++){var l=e.charCodeAt(c)-48;a*=i,o=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&o<i,`Invalid character`),a+=o}return a}a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,u=n;u<s;u+=r)c=l(e,u,u+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(o!==0){var d=1;for(c=l(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},a.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red};function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(a.prototype._move=function(e){u(e,this)},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<`u`&&typeof Symbol.for==`function`)try{a.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=d}catch{a.prototype.inspect=d}else a.prototype.inspect=d;function d(){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`.split(`.`),p=[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],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16
vendor: 15,835 bytes, line 1
1777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){e||=10,t=t|0||1;var r;if(e===16||e===`hex`){r=``;for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=((s<<i|a)&16777215).toString(16);a=s>>>24-i&16777215,i+=2,i>=26&&(i-=26,o--),r=a!==0||o!==this.length-1?f[6-c.length]+c+r:c+r}for(a!==0&&(r=a.toString(16)+r);r.length%t!==0;)r=`0`+r;return this.negative!==0&&(r=`-`+r),r}if(e===(e|0)&&e>=2&&e<=36){var l=p[e],u=m[e];r=``;var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modrn(u).toString(e);d=d.idivn(u),r=d.isZero()?h+r:f[l-h.length]+h+r}for(this.isZero()&&(r=`0`+r);r.length%t!==0;)r=`0`+r;return this.negative!==0&&(r=`-`+r),r}n(!1,`Base should be between 2 and 36`)},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var h=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};a.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,`byte array longer than desired length`),n(a>0,`Requested array length <= 0`);var o=h(e,a);return this[`_toArrayLike`+(t===`le`?`LE`:`BE`)](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=o&255,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),a===6?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},a.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=o&255,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),a===6?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return t&8191||(n+=13,t>>>=13),t&127||(n+=7,t>>>=7),t&15||(n+=4,t>>>=4),t&3||(n+=2,t>>>=2),t&1||n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t};function g(e){for(var t=Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,n!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative===0?this.clone():this.abs().inotn(e).iaddn(1)},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},a.prototype.ior=function(e){return n((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},a.prototype.iand=function(e){return n((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},a.prototype.ixor=function(e){return n((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n(typeof e==`number`&&e>=0);var t=Math.ceil(e/26)|0,r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=~this.words[i]&67108863;return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n(typeof e==`number`&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this._strip()},a.prototype.iadd=function(e){var t;if(this.negative!==0&&e.negative===0)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();var n,r;this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(n.words[a]|0)+(r.words[a]|0)+i,this.words[a]=t&67108863,i=t>>>26;for(;i!==0&&a<n.length;a++)t=(n.words[a]|0)+i,this.words[a]=t&67108863,i=t>>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},a.prototype.add=function(e){var t;return e.negative!==0&&this.negative===0?(e.negative=0,t=this.sub(e),e.negative^=1,t):e.negative===0&&this.negative!==0?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(n===0)return this.negative=0,this.length=1,this.words[0]=0,this;var r,i;n>0?(r=this,i=e):(r=e,i=this);for(var a=0,o=0;o<i.length;o++)t=(r.words[o]|0)-(i.words[o]|0)+a,a=t>>26,this.words[o]=t&67108863;for(;a!==0&&o<r.length;o++)t=(r.words[o]|0)+a,a=t>>26,this.words[o]=t&67108863;if(a===0&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function _(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=e.words[0]|0,a=t.words[0]|0,o=i*a,s=o&67108863,c=o/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var u=c>>>26,d=c&67108863,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;i=e.words[m]|0,a=t.words[p]|0,o=i*a+d,u+=o/67108864|0,d=o&67108863}n.words[l]=d|0,c=u|0}return c===0?n.length--:n.words[l]=c|0,n._strip()}var v=function(e,t,n){var r=e.words,i=t.words,a=n.words,o=0,s,c,l,u=r[0]|0,d=u&8191,f=u>>>13,p=r[1]|0,m=p&8191,h=p>>>13,g=r[2]|0,_=g&8191,v=g>>>13,ee=r[3]|0,y=ee&8191,b=ee>>>13,x=r[4]|0,S=x&8191,C=x>>>13,te=r[5]|0,w=te&8191,T=te>>>13,E=r[6]|0,D=E&8191,O=E>>>13,k=r[7]|0,A=k&8191,j=k>>>13,ne=r[8]|0,M=ne&8191,N=ne>>>13,re=r[9]|0,P=re&8191,F=re>>>13,I=i[0]|0,L=I&8191,R=I>>>13,ie=i[1]|0,z=ie&8191,B=ie>>>13,ae=i[2]|0,V=ae&8191,H=ae>>>13,oe=i[3]|0,U=oe&8191,W=oe>>>13,se=i[4]|0,G=se&8191,K=se>>>13,ce=i[5]|0,q=ce&8191,J=ce>>>13,le=i[6]|0,Y=le&8191,X=le>>>13,ue=i[7]|0,Z=ue&8191,Q=ue>>>13,de=i[8]|0,fe=de&8191,pe=de>>>13,me=i[9]|0,he=me&8191,ge=me>>>13;n.negative=e.negative^t.negative,n.length=19,s=Math.imul(d,L),c=Math.imul(d,R),c=c+Math.imul(f,L)|0,l=Math.imul(f,R);var _e=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(_e>>>26)|0,_e&=67108863,s=Math.imul(m,L),c=Math.imul(m,R),c=c+Math.imul(h,L)|0,l=Math.imul(h,R),s=s+Math.imul(d,z)|0,c=c+Math.imul(d,B)|0,c=c+Math.imul(f,z)|0,l=l+Math.imul(f,B)|0;var ve=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ve>>>26)|0,ve&=67108863,s=Math.imul(_,L),c=Math.imul(_,R),c=c+Math.imul(v,L)|0,l=Math.imul(v,R),s=s+Math.imul(m,z)|0,c=c+Math.imul(m,B)|0,c=c+Math.imul(h,z)|0,l=l+Math.imul(h,B)|0,s=s+Math.imul(d,V)|0,c=c+Math.imul(d,H)|0,c=c+Math.imul(f,V)|0,l=l+Math.imul(f,H)|0;var ye=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ye>>>26)|0,ye&=67108863,s=Math.imul(y,L),c=Math.imul(y,R),c=c+Math.imul(b,L)|0,l=Math.imul(b,R),s=s+Math.imul(_,z)|0,c=c+Math.imul(_,B)|0,c=c+Math.imul(v,z)|0,l=l+Math.imul(v,B)|0,s=s+Math.imul(m,V)|0,c=c+Math.imul(m,H)|0,c=c+Math.imul(h,V)|0,l=l+Math.imul(h,H)|0,s=s+Math.imul(d,U)|0,c=c+Math.imul(d,W)|0,c=c+Math.imul(f,U)|0,l=l+Math.imul(f,W)|0;var be=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(be>>>26)|0,be&=67108863,s=Math.imul(S,L),c=Math.imul(S,R),c=c+Math.imul(C,L)|0,l=Math.imul(C,R),s=s+Math.imul(y,z)|0,c=c+Math.imul(y,B)|0,c=c+Math.imul(b,z)|0,l=l+Math.imul(b,B)|0,s=s+Math.imul(_,V)|0,c=c+Math.imul(_,H)|0,c=c+Math.imul(v,V)|0,l=l+Math.imul(v,H)|0,s=s+Math.imul(m,U)|0,c=c+Math.imul(m,W)|0,c=c+Math.imul(h,U)|0,l=l+Math.imul(h,W)|0,s=s+Math.imul(d,G)|0,c=c+Math.imul(d,K)|0,c=c+Math.imul(f,G)|0,l=l+Math.imul(f,K)|0;var xe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(xe>>>26)|0,xe&=67108863,s=Math.imul(w,L),c=Math.imul(w,R),c=c+Math.imul(T,L)|0,l=Math.imul(T,R),s=s+Math.imul(S,z)|0,c=c+Math.imul(S,B)|0,c=c+Math.imul(C,z)|0,l=l+Math.imul(C,B)|0,s=s+Math.imul(y,V)|0,c=c+Math.imul(y,H)|0,c=c+Math.imul(b,V)|0,l=l+Math.imul(b,H)|0,s=s+Math.imul(_,U)|0,c=c+Math.imul(_,W)|0,c=c+Math.imul(v,U)|0,l=l+Math.imul(v,W)|0,s=s+Math.imul(m,G)|0,c=c+Math.imul(m,K)|0,c=c+Math.imul(h,G)|0,l=l+Math.imul(h,K)|0,s=s+Math.imul(d,q)|0,c=c+Math.imul(d,J)|0,c=c+Math.imul(f,q)|0,l=l+Math.imul(f,J)|0;var Se=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Se>>>26)|0,Se&=67108863,s=Math.imul(D,L),c=Math.imul(D,R),c=c+Math.imul(O,L)|0,l=Math.imul(O,R),s=s+Math.imul(w,z)|0,c=c+Math.imul(w,B)|0,c=c+Math.imul(T,z)|0,l=l+Math.imul(T,B)|0,s=s+Math.imul(S,V)|0,c=c+Math.imul(S,H)|0,c=c+Math.imul(C,V)|0,l=l+Math.imul(C,H)|0,s=s+Math.imul(y,U)|0,c=c+Math.imul(y,W)|0,c=c+Math.imul(b,U)|0,l=l+Math.imul(b,W)|0,s=s+Math.imul(_,G)|0,c=c+Math.imul(_,K)|0,c=c+Math.imul(v,G)|0,l=l+Math.imul(v,K)|0,s=s+Math.imul(m,q)|0,c=c+Math.imul(m,J)|0,c=c+Math.imul(h,q)|0,l=l+Math.imul(h,J)|0,s=s+Math.imul(d,Y)|0,c=c+Math.imul(d,X)|0,c=c+Math.imul(f,Y)|0,l=l+Math.imul(f,X)|0;var Ce=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,s=Math.imul(A,L),c=Math.imul(A,R),c=c+Math.imul(j,L)|0,l=Math.imul(j,R),s=s+Math.imul(D,z)|0,c=c+Math.imul(D,B)|0,c=c+Math.imul(O,z)|0,l=l+Math.imul(O,B)|0,s=s+Math.imul(w,V)|0,c=c+Math.imul(w,H)|0,c=c+Math.imul(T,V)|0,l=l+Math.imul(T,H)|0,s=s+Math.imul(S,U)|0,c=c+Math.imul(S,W)|0,c=c+Math.imul(C,U)|0,l=l+Math.imul(C,W)|0,s=s+Math.imul(y,G)|0,c=c+Math.imul(y,K)|0,c=c+Math.imul(b,G)|0,l=l+Math.imul(b,K)|0,s=s+Math.imul(_,q)|0,c=c+Math.imul(_,J)|0,c=c+Math.imul(v,q)|0,l=l+Math.imul(v,J)|0,s=s+Math.imul(m,Y)|0,c=c+Math.imul(m,X)|0,c=c+Math.imul(h,Y)|0,l=l+Math.imul(h,X)|0,s=s+Math.imul(d,Z)|0,c=c+Math.imul(d,Q)|0,c=c+Math.imul(f,Z)|0,l=l+Math.imul(f,Q)|0;var we=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(we>>>26)|0,we&=67108863,s=Math.imul(M,L),c=Math.imul(M,R),c=c+Math.imul(N,L)|0,l=Math.imul(N,R),s=s+Math.imul(A,z)|0,c=c+Math.imul(A,B)|0,c=c+Math.imul(j,z)|0,l=l+Math.imul(j,B)|0,s=s+Math.imul(D,V)|0,c=c+Math.imul(D,H)|0,c=c+Math.imul(O,V)|0,l=l+Math.imul(O,H)|0,s=s+Math.imul(w,U)|0,c=c+Math.imul(w,W)|0,c=c+Math.imul(T,U)|0,l=l+Math.imul(T,W)|0,s=s+Math.imul(S,G)|0,c=c+Math.imul(S,K)|0,c=c+Math.imul(C,G)|0,l=l+Math.imul(C,K)|0,s=s+Math.imul(y,q)|0,c=c+Math.imul(y,J)|0,c=c+Math.imul(b,q)|0,l=l+Math.imul(b,J)|0,s=s+Math.imul(_,Y)|0,c=c+Math.imul(_,X)|0,c=c+Math.imul(v,Y)|0,l=l+Math.imul(v,X)|0,s=s+Math.imul(m,Z)|0,c=c+Math.imul(m,Q)|0,c=c+Math.imul(h,Z)|0,l=l+Math.imul(h,Q)|0,s=s+Math.imul(d,fe)|0,c=c+Math.imul(d,pe)|0,c=c+Math.imul(f,fe)|0,l=l+Math.imul(f,pe)|0;var Te=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Te>>>26)|0,Te&=67108863,s=Math.imul(P,L),c=Math.imul(P,R),c=c+Math.imul(F,L)|0,l=Math.imul(F,R),s=s+Math.imul(M,z)|0,c=c+Math.imul(M,B)|0,c=c+Math.imul(N,z)|0,l=l+Math.imul(N,B)|0,s=s+Math.imul(A,V)|0,c=c+Math.imul(A,H)|0,c=c+Math.imul(j,V)|0,l=l+Math.imul(j,H)|0,s=s+Math.imul(D,U)|0,c=c+Math.imul(D,W)|0,c=c+Math.imul(O,U)|0,l=l+Math.imul(O,W)|0,s=s+Math.imul(w,G)|0,c=c+Math.imul(w,K)|0,c=c+Math.imul(T,G)|0,l=l+Math.imul(T,K)|0,s=s+Math.imul(S,q)|0,c=c+Math.imul(S,J)|0,c=c+Math.imul(C,q)|0,l=l+Math.imul(C,J)|0,s=s+Math.imul(y,Y)|0,c=c+Math.imul(y,X)|0,c=c+Math.imul(b,Y)|0,l=l+Math.imul(b,X)|0,s=s+Math.imul(_,Z)|0,c=c+Math.imul(_,Q)|0,c=c+Math.imul(v,Z)|0,l=l+Math.imul(v,Q)|0,s=s+Math.imul(m,fe)|0,c=c+Math.imul(m,pe)|0,c=c+Math.imul(h,fe)|0,l=l+Math.imul(h,pe)|0,s=s+Math.imul(d,he)|0,c=c+Math.imul(d,ge)|0,c=c+Math.imul(f,he)|0,l=l+Math.imul(f,ge)|0;var Ee=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,s=Math.imul(P,z),c=Math.imul(P,B),c=c+Math.imul(F,z)|0,l=Math.imul(F,B),s=s+Math.imul(M,V)|0,c=c+Math.imul(M,H)|0,c=c+Math.imul(N,V)|0,l=l+Math.imul(N,H)|0,s=s+Math.imul(A,U)|0,c=c+Math.imul(A,W)|0,c=c+Math.imul(j,U)|0,l=l+Math.imul(j,W)|0,s=s+Math.imul(D,G)|0,c=c+Math.imul(D,K)|0,c=c+Math.imul(O,G)|0,l=l+Math.imul(O,K)|0,s=s+Math.imul(w,q)|0,c=c+Math.imul(w,J)|0,c=c+Math.imul(T,q)|0,l=l+Math.imul(T,J)|0,s=s+Math.imul(S,Y)|0,c=c+Math.imul(S,X)|0,c=c+Math.imul(C,Y)|0,l=l+Math.imul(C,X)|0,s=s+Math.imul(y,Z)|0,c=c+Math.imul(y,Q)|0,c=c+Math.imul(b,Z)|0,l=l+Math.imul(b,Q)|0,s=s+Math.imul(_,fe)|0,c=c+Math.imul(_,pe)|0,c=c+Math.imul(v,fe)|0,l=l+Math.imul(v,pe)|0,s=s+Math.imul(m,he)|0,c=c+Math.imul(m,ge)|0,c=c+Math.imul(h,he)|0,l=l+Math.imul(h,ge)|0;var De=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(De>>>26)|0,De&=67108863,s=Math.imul(P,V),c=Math.imul(P,H),c=c+Math.imul(F,V)|0,l=Math.imul(F,H),s=s+Math.imul(M,U)|0,c=c+Math.imul(M,W)|0,c=c+Math.imul(N,U)|0,l=l+Math.imul(N,W)|0,s=s+Math.imul(A,G)|0,c=c+Math.imul(A,K)|0,c=c+Math.imul(j,G)|0,l=l+Math.imul(j,K)|0,s=s+Math.imul(D,q)|0,c=c+Math.imul(D,J)|0,c=c+Math.imul(O,q)|0,l=l+Math.imul(O,J)|0,s=s+Math.imul(w,Y)|0,c=c+Math.imul(w,X)|0,c=c+Math.imul(T,Y)|0,l=l+Math.imul(T,X)|0,s=s+Math.imul(S,Z)|0,c=c+Math.imul(S,Q)|0,c=c+Math.imul(C,Z)|0,l=l+Math.imul(C,Q)|0,s=s+Math.imul(y,fe)|0,c=c+Math.imul(y,pe)|0,c=c+Math.imul(b,fe)|0,l=l+Math.imul(b,pe)|0,s=s+Math.imul(_,he)|0,c=c+Math.imul(_,ge)|0,c=c+Math.imul(v,he)|0,l=l+Math.imul(v,ge)|0;var Oe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,s=Math.imul(P,U),c=Math.imul(P,W),c=c+Math.imul(F,U)|0,l=Math.imul(F,W),s=s+Math.imul(M,G)|0,c=c+Math.imul(M,K)|0,c=c+Math.imul(N,G)|0,l=l+Math.imul(N,K)|0,s=s+Math.imul(A,q)|0,c=c+Math.imul(A,J)|0,c=c+Math.imul(j,q)|0,l=l+Math.imul(j,J)|0,s=s+Math.imul(D,Y)|0,c=c+Math.imul(D,X)|0,c=c+Math.imul(O,Y)|0,l=l+Math.imul(O,X)|0,s=s+Math.imul(w,Z)|0,c=c+Math.imul(w,Q)|0,c=c+Math.imul(T,Z)|0,l=l+Math.imul(T,Q)|0,s=s+Math.imul(S,fe)|0,c=c+Math.imul(S,pe)|0,c=c+Math.imul(C,fe)|0,l=l+Math.imul(C,pe)|0,s=s+Math.imul(y,he)|0,c=c+Math.imul(y,ge)|0,c=c+Math.imul(b,he)|0,l=l+Math.imul(b,ge)|0;var ke=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ke>>>26)|0,ke&=67108863,s=Math.imul(P,G),c=Math.imul(P,K),c=c+Math.imul(F,G)|0,l=Math.imul(F,K),s=s+Math.imul(M,q)|0,c=c+Math.imul(M,J)|0,c=c+Math.imul(N,q)|0,l=l+Math.imul(N,J)|0,s=s+Math.imul(A,Y)|0,c=c+Math.imul(A,X)|0,c=c+Math.imul(j,Y)|0,l=l+Math.imul(j,
1X)|0,s=s+Math.imul(D,Z)|0,c=c+Math.imul(D,Q)|0,c=c+Math.imul(O,Z)|0,l=l+Math.imul(O,Q)|0,s=s+Math.imul(w,fe)|0,c=c+Math.imul(w,pe)|0,c=c+Math.imul(T,fe)|0,l=l+Math.imul(T,pe)|0,s=s+Math.imul(S,he)|0,c=c+Math.imul(S,ge)|0,c=c+Math.imul(C,he)|0,l=l+Math.imul(C,ge)|0;var Ae=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,s=Math.imul(P,q),c=Math.imul(P,J),c=c+Math.imul(F,q)|0,l=Math.imul(F,J),s=s+Math.imul(M,Y)|0,c=c+Math.imul(M,X)|0,c=c+Math.imul(N,Y)|0,l=l+Math.imul(N,X)|0,s=s+Math.imul(A,Z)|0,c=c+Math.imul(A,Q)|0,c=c+Math.imul(j,Z)|0,l=l+Math.imul(j,Q)|0,s=s+Math.imul(D,fe)|0,c=c+Math.imul(D,pe)|0,c=c+Math.imul(O,fe)|0,l=l+Math.imul(O,pe)|0,s=s+Math.imul(w,he)|0,c=c+Math.imul(w,ge)|0,c=c+Math.imul(T,he)|0,l=l+Math.imul(T,ge)|0;var je=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(je>>>26)|0,je&=67108863,s=Math.imul(P,Y),c=Math.imul(P,X),c=c+Math.imul(F,Y)|0,l=Math.imul(F,X),s=s+Math.imul(M,Z)|0,c=c+Math.imul(M,Q)|0,c=c+Math.imul(N,Z)|0,l=l+Math.imul(N,Q)|0,s=s+Math.imul(A,fe)|0,c=c+Math.imul(A,pe)|0,c=c+Math.imul(j,fe)|0,l=l+Math.imul(j,pe)|0,s=s+Math.imul(D,he)|0,c=c+Math.imul(D,ge)|0,c=c+Math.imul(O,he)|0,l=l+Math.imul(O,ge)|0;var Me=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Me>>>26)|0,Me&=67108863,s=Math.imul(P,Z),c=Math.imul(P,Q),c=c+Math.imul(F,Z)|0,l=Math.imul(F,Q),s=s+Math.imul(M,fe)|0,c=c+Math.imul(M,pe)|0,c=c+Math.imul(N,fe)|0,l=l+Math.imul(N,pe)|0,s=s+Math.imul(A,he)|0,c=c+Math.imul(A,ge)|0,c=c+Math.imul(j,he)|0,l=l+Math.imul(j,ge)|0;var Ne=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,s=Math.imul(P,fe),c=Math.imul(P,pe),c=c+Math.imul(F,fe)|0,l=Math.imul(F,pe),s=s+Math.imul(M,he)|0,c=c+Math.imul(M,ge)|0,c=c+Math.imul(N,he)|0,l=l+Math.imul(N,ge)|0;var Pe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,s=Math.imul(P,he),c=Math.imul(P,ge),c=c+Math.imul(F,he)|0,l=Math.imul(F,ge);var Fe=(o+s|0)+((c&8191)<<13)|0;return o=(l+(c>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,a[0]=_e,a[1]=ve,a[2]=ye,a[3]=be,a[4]=xe,a[5]=Se,a[6]=Ce,a[7]=we,a[8]=Te,a[9]=Ee,a[10]=De,a[11]=Oe,a[12]=ke,a[13]=Ae,a[14]=je,a[15]=Me,a[16]=Ne,a[17]=Pe,a[18]=Fe,o!==0&&(a[19]=o,n.length++),n};Math.imul||(v=_);function ee(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=r&67108863,c=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=c;l++){var u=a-l,d=(e.words[u]|0)*(t.words[l]|0),f=d&67108863;o=o+(d/67108864|0)|0,f=f+s|0,s=f&67108863,o=o+(f>>>26)|0,i+=o>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n._strip()}function y(e,t,n){return ee(e,t,n)}a.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=this.length===10&&e.length===10?v(this,e,t):r<63?_(this,e,t):r<1024?ee(this,e,t):y(this,e,t),n};function b(e,t){this.x=e,this.y=t}b.prototype.makeRBT=function(e){for(var t=Array(e),n=a.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},b.prototype.revBin=function(e,t,n){if(e===0||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(e&1)<<t-i-1,e>>=1;return r},b.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o<a;o++)r[o]=t[e[o]],i[o]=n[e[o]]},b.prototype.transform=function(e,t,n,r,i,a){this.permute(a,e,t,n,r,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,c=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var d=c,f=l,p=0;p<o;p++){var m=n[u+p],h=r[u+p],g=n[u+p+o],_=r[u+p+o],v=d*g-f*_;_=d*_+f*g,g=v,n[u+p]=m+g,r[u+p]=h+_,n[u+p+o]=m-g,r[u+p+o]=h-_,p!==s&&(v=c*d-l*f,f=c*f+l*d,d=v)}},b.prototype.guessLen13b=function(e,t){var n=Math.max(t,e)|1,r=n&1,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},b.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},b.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=Math.round(e[2*r+1]/t)*8192+Math.round(e[2*r]/t)+n;e[r]=i&67108863,n=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=e[o]|0,r[2*o]=a&8191,a>>>=13,r[2*o+1]=a&8191,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(a===0),n((a&-8192)==0)},b.prototype.stub=function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=0;return t},b.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),a=this.stub(r),o=Array(r),s=Array(r),c=Array(r),l=Array(r),u=Array(r),d=Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,l,r),this.transform(o,a,s,c,r,i),this.transform(l,a,u,d,r,i);for(var p=0;p<r;p++){var m=s[p]*u[p]-c[p]*d[p];c[p]=s[p]*d[p]+c[p]*u[p],s[p]=m}return this.conjugate(s,c,r),this.transform(s,c,f,a,r,i),this.conjugate(f,a,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n._strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n(typeof e==`number`),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*e,o=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=o&67108863}return r!==0&&(this.words[i]=r,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=g(e);
vendor: 6,973 bytes, line 1
1if(t.length===0)return new a(1);for(var n=this,r=0;r<t.length&&t[r]===0;r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())t[r]!==0&&(n=n.mul(i));return n},a.prototype.iushln=function(e){n(typeof e==`number`&&e>=0);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t,a;if(t!==0){var o=0;for(a=0;a<this.length;a++){var s=this.words[a]&i,c=(this.words[a]|0)-s<<t;this.words[a]=c|o,o=s>>>26-t}o&&(this.words[a]=o,this.length++)}if(r!==0){for(a=this.length-1;a>=0;a--)this.words[a+r]=this.words[a];for(a=0;a<r;a++)this.words[a]=0;this.length+=r}return this._strip()},a.prototype.ishln=function(e){return n(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,t,r){n(typeof e==`number`&&e>=0);var i=t?(t-t%26)/26:0,a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=r;if(i-=o,i=Math.max(0,i),c){for(var l=0;l<o;l++)c.words[l]=this.words[l];c.length=o}if(o!==0)if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(u!==0||l>=i);l--){var d=this.words[l]|0;this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return n(this.negative===0),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n(typeof e==`number`&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return this.length<=r?!1:!!(this.words[r]&i)},a.prototype.imaskn=function(e){n(typeof e==`number`&&e>=0);var t=e%26,r=(e-t)/26;if(n(this.negative===0,`imaskn works only with positive numbers`),this.length<=r)return this;if(t!==0&&r++,this.length=Math.min(r,this.length),t!==0){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n(typeof e==`number`),n(e<67108864),e<0?this.isubn(-e):this.negative===0?this._iaddn(e):this.length===1&&(this.words[0]|0)<=e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n(typeof e==`number`),n(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this._strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i=e.length+r,a;this._expand(i);var o,s=0;for(a=0;a<e.length;a++){o=(this.words[a+r]|0)+s;var c=(e.words[a]|0)*t;o-=c&67108863,s=(o>>26)-(c/67108864|0),this.words[a+r]=o&67108863}for(;a<this.length-r;a++)o=(this.words[a+r]|0)+s,s=o>>26,this.words[a+r]=o&67108863;if(s===0)return this._strip();for(n(s===-1),s=0,a=0;a<this.length;a++)o=-(this.words[a]|0)+s,s=o>>26,this.words[a]=o&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=this.length-e.length,r=this.clone(),i=e,o=i.words[i.length-1]|0;n=26-this._countBits(o),n!==0&&(i=i.ushln(n),r.iushln(n),o=i.words[i.length-1]|0);var s=r.length-i.length,c;if(t!==`mod`){c=new a(null),c.length=s+1,c.words=Array(c.length);for(var l=0;l<c.length;l++)c.words[l]=0}var u=r.clone()._ishlnsubmul(i,1,s);u.negative===0&&(r=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var f=(r.words[i.length+d]|0)*67108864+(r.words[i.length+d-1]|0);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(i,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);c&&(c.words[d]=f)}return c&&c._strip(),r._strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:c||null,mod:r}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(i=s.div.neg()),t!==`div`&&(o=s.mod.neg(),r&&o.negative!==0&&o.iadd(e)),{div:i,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)===0?e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),r&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o})},a.prototype.div=function(e){return this.divmod(e,`div`,!1).div},a.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},a.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(e.negative===0),n(!e.isZero());var t=this,r=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)===0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var m=0,h=1;(r.words[0]&h)===0&&m<26;++m,h<<=1);if(m>0)for(r.iushrn(m);m-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(c)):(r.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(e.negative===0),n(!e.isZero());var t=this,r=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;
vendor: 5,641 bytes, line 1
1(t.words[0]&l)===0&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,d=1;(r.words[0]&d)===0&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var f=t.cmpn(1)===0?i:o;return f.cmpn(0)<0&&f.iadd(e),f},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);do{for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}while(!0);return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)==0},a.prototype.isOdd=function(){return(this.words[0]&1)==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n(typeof e==`number`);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;a!==0&&o<this.length;o++){var s=this.words[o]|0;s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this._strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,`Number is too big`);var i=this.words[0]|0;r=i===e?0:i<e?-1:1}return this.negative===0?r:-r|0},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var t=this.ucmp(e);return this.negative===0?t:-t|0},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=this.words[n]|0,i=e.words[n]|0;if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return n(!this.red,`Already a number in reduction context`),n(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,`Already a number in reduction context`),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var x={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t=e,n;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),n=t.bitLength();while(n>this.n);var r=n<this.n?-1:t.ucmp(this.p);return r===0?(t.words[0]=0,t.length=1):r>0?t.isub(this.p):t.strip===void 0?t._strip():t.strip(),t},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)};function C(){S.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}i(C,S),C.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=e.words[i]|0;
vendor: 5,226 bytes, line 1
1e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,a===0&&e.length>10?e.length-=10:e.length-=9},C.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=e.words[n]|0;t+=r*977,e.words[n]=t&67108863,t=r*64+(t/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function te(){S.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}i(te,S);function w(){S.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}i(w,S);function T(){S.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}i(T,S),T.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=(e.words[n]|0)*19+t,i=r&67108863;r>>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},a._prime=function(e){if(x[e])return x[e];var t;if(e===`k256`)t=new C;else if(e===`p224`)t=new te;else if(e===`p192`)t=new w;else if(e===`p25519`)t=new T;else throw Error(`Unknown prime `+e);return x[e]=t,t};function E(e){if(typeof e==`string`){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}E.prototype._verify1=function(e){n(e.negative===0,`red works only with positives`),n(e.red,`red works only with red numbers`)},E.prototype._verify2=function(e,t){n((e.negative|t.negative)===0,`red works only with positives`),n(e.red&&e.red===t.red,`red works only with red numbers`)},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),t===3){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&i.andln(1)===0;)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();n(g<m);var _=this.pow(d,new a(1).iushln(m-g-1));f=f.redMul(_),d=_.redSqr(),p=p.redMul(d),m=g}return f},E.prototype.invm=function(e){var t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())},E.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(t.cmpn(1)===0)return e.clone();var n=4,r=Array(1<<n);r[0]=new a(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,c=0,l=t.bitLength()%26;for(l===0&&(l=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],d=l-1;d>=0;d--){var f=u>>d&1;if(o!==r[0]&&(o=this.sqr(o)),f===0&&s===0){c=0;continue}s<<=1,s|=f,c++,!(c!==n&&(i!==0||d!==0))&&(o=this.mul(o,r[s]),c=0,s=0)}l=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new D(e)};function D(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}i(D,E),D.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},D.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},D.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},D.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},D.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t,e)})),a,o=e((()=>{a=`logger/5.8.0`}));function s(){try{let e=[];
1if([`NFD`,`NFC`,`NFKD`,`NFKC`].forEach(t=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad normalize`)}catch{e.push(t)}}),e.length)throw Error(`missing `+e.join(`, `));if(`é`.normalize(`NFD`)!==`eÌ`)throw Error(`broken implementation`)}catch(e){return e.message}return null}var c,l,u,d,f,p,m,h,g,_,v=e((()=>{o(),c=!1,l=!1,u={debug:1,default:2,info:2,warning:3,error:4,off:5},d=u.default,f=null,p=s(),(function(e){e.DEBUG=`DEBUG`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.OFF=`OFF`})(m||={}),(function(e){e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e.NOT_IMPLEMENTED=`NOT_IMPLEMENTED`,e.UNSUPPORTED_OPERATION=`UNSUPPORTED_OPERATION`,e.NETWORK_ERROR=`NETWORK_ERROR`,e.SERVER_ERROR=`SERVER_ERROR`,e.TIMEOUT=`TIMEOUT`,e.BUFFER_OVERRUN=`BUFFER_OVERRUN`,e.NUMERIC_FAULT=`NUMERIC_FAULT`,e.MISSING_NEW=`MISSING_NEW`,e.INVALID_ARGUMENT=`INVALID_ARGUMENT`,e.MISSING_ARGUMENT=`MISSING_ARGUMENT`,e.UNEXPECTED_ARGUMENT=`UNEXPECTED_ARGUMENT`,e.CALL_EXCEPTION=`CALL_EXCEPTION`,e.INSUFFICIENT_FUNDS=`INSUFFICIENT_FUNDS`,e.NONCE_EXPIRED=`NONCE_EXPIRED`,e.REPLACEMENT_UNDERPRICED=`REPLACEMENT_UNDERPRICED`,e.UNPREDICTABLE_GAS_LIMIT=`UNPREDICTABLE_GAS_LIMIT`,e.TRANSACTION_REPLACED=`TRANSACTION_REPLACED`,e.ACTION_REJECTED=`ACTION_REJECTED`})(h||={}),g=`0123456789abcdef`,_=class e{constructor(e){Object.defineProperty(this,`version`,{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();u[n]??this.throwArgumentError(`invalid log level name`,`logLevel`,e),!(d>u[n])&&console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(l)return this.makeError(`censored error`,n,{});n||=e.errors.UNKNOWN_ERROR,r||={};let i=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let n=``;for(let e=0;e<t.length;e++)n+=g[t[e]>>4],n+=g[t[e]&15];i.push(e+`=Uint8Array(0x`+n+`)`)}else i.push(e+`=`+JSON.stringify(t))}catch{i.push(e+`=`+JSON.stringify(r[e].toString()))}}),i.push(`code=${n}`),i.push(`version=${this.version}`);let a=t,o=``;switch(n){case h.NUMERIC_FAULT:{o=`NUMERIC_FAULT`;let e=t;switch(e){case`overflow`:case`underflow`:case`division-by-zero`:o+=`-`+e;break;case`negative-power`:case`negative-width`:o+=`-unsupported`;break;case`unbound-bitwise-result`:o+=`-unbound-result`;break}break}case h.CALL_EXCEPTION:case h.INSUFFICIENT_FUNDS:case h.MISSING_NEW:case h.NONCE_EXPIRED:case h.REPLACEMENT_UNDERPRICED:case h.TRANSACTION_REPLACED:case h.UNPREDICTABLE_GAS_LIMIT:o=n;break}o&&(t+=` [ See: https://links.ethers.org/v5-errors-`+o+` ]`),i.length&&(t+=` (`+i.join(`, `)+`)`);let s=Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){t??=`platform missing String.prototype.normalize`,p&&this.throwError(`platform missing String.prototype.normalize`,e.errors.UNSUPPORTED_OPERATION,{operation:`String.prototype.normalize`,form:p})}checkSafeUint53(t,n){typeof t==`number`&&(n??=`value not safe`,(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`out-of-safe-range`,value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`non-integer`,value:t}))}checkArgumentCount(t,n,r){r=r?`: `+r:``,t<n&&this.throwError(`missing argument`+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError(`too many arguments`+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError(`cannot instantiate abstract class `+JSON.stringify(n.name)+` directly; use a sub-class`,e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:`new`}):(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return f||=new e(a),f}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError(`cannot permanently disable censorship`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`}),c){if(!t)return;this.globalLogger().throwError(`error censorship permanent`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`})}l=!!t,c=!!n}static setLogLevel(t){let n=u[t.toLowerCase()];
1if(n==null){e.globalLogger().warn(`invalid log level - `+t);return}d=n}static from(t){return new e(t)}},_.errors=h,_.levels=m})),ee,y=e((()=>{ee=`bytes/5.8.0`}));function b(e){return!!e.toHexString}function x(e){return e.slice||=function(){let t=Array.prototype.slice.call(arguments);return x(new Uint8Array(Array.prototype.slice.apply(e,t)))},e}function S(e){return O(e)&&!(e.length%2)||te(e)}function C(e){return typeof e==`number`&&e==e&&e%1==0}function te(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e==`string`||!C(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let n=e[t];if(!C(n)||n<0||n>=256)return!1}return!0}function w(e,t){if(t||={},typeof e==`number`){I.checkSafeUint53(e,`invalid arrayify value`);let t=[];for(;e;)t.unshift(e&255),e=parseInt(String(e/256));return t.length===0&&t.push(0),x(new Uint8Array(t))}if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),b(e)&&(e=e.toHexString()),O(e)){let n=e.substring(2);n.length%2&&(t.hexPad===`left`?n=`0`+n:t.hexPad===`right`?n+=`0`:I.throwArgumentError(`hex data is odd-length`,`value`,e));let r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return x(new Uint8Array(r))}return te(e)?x(new Uint8Array(e)):I.throwArgumentError(`invalid arrayify value`,`value`,e)}function T(e){let t=e.map(e=>w(e)),n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),x(r)}function E(e){let t=w(e);if(t.length===0)return t;let n=0;for(;n<t.length&&t[n]===0;)n++;return n&&(t=t.slice(n)),t}function D(e,t){e=w(e),e.length>t&&I.throwArgumentError(`value out of range`,`value`,arguments[0]);let n=new Uint8Array(t);return n.set(e,t-e.length),x(n)}function O(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function k(e,t){if(t||={},typeof e==`number`){I.checkSafeUint53(e,`invalid hexlify value`);let t=``;for(;e;)t=L[e&15]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t=`0`+t),`0x`+t):`0x00`}if(typeof e==`bigint`)return e=e.toString(16),e.length%2?`0x0`+e:`0x`+e;if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),b(e))return e.toHexString();if(O(e))return e.length%2&&(t.hexPad===`left`?e=`0x0`+e.substring(2):t.hexPad===`right`?e+=`0`:I.throwArgumentError(`hex data is odd-length`,`value`,e)),e.toLowerCase();if(te(e)){let t=`0x`;for(let n=0;n<e.length;n++){let r=e[n];t+=L[(r&240)>>4]+L[r&15]}return t}return I.throwArgumentError(`invalid hexlify value`,`value`,e)}function A(e){if(typeof e!=`string`)e=k(e);else if(!O(e)||e.length%2)return null;return(e.length-2)/2}function j(e,t,n){return typeof e==`string`?(!O(e)||e.length%2)&&I.throwArgumentError(`invalid hexData`,`value`,e):e=k(e),t=2+2*t,n==null?`0x`+e.substring(t):`0x`+e.substring(t,2+2*n)}function ne(e){let t=`0x`;return e.forEach(e=>{t+=k(e).substring(2)}),t}function M(e){let t=N(k(e,{hexPad:`left`}));return t===`0x`?`0x0`:t}function N(e){typeof e!=`string`&&(e=k(e)),O(e)||I.throwArgumentError(`invalid hex string`,`value`,e),e=e.substring(2);let t=0;for(;t<e.length&&e[t]===`0`;)t++;return`0x`+e.substring(t)}function re(e,t){for(typeof e==`string`?O(e)||I.throwArgumentError(`invalid hex string`,`value`,e):e=k(e),e.length>2*t+2&&I.throwArgumentError(`value out of range`,`value`,arguments[1]);e.length<2*t+2;)e=`0x0`+e.substring(2);return e}function P(e){let t={r:`0x`,s:`0x`,_vs:`0x`,recoveryParam:0,v:0,yParityAndS:`0x`,compact:`0x`};if(S(e)){let n=w(e);n.length===64?(t.v=27+(n[32]>>7),n[32]&=127,t.r=k(n.slice(0,32)),t.s=k(n.slice(32,64))):n.length===65?(t.r=k(n.slice(0,32)),t.s=k(n.slice(32,64)),t.v=n[64]):I.throwArgumentError(`invalid signature string`,`signature`,e),t.v<27&&(t.v===0||t.v===1?t.v+=27:I.throwArgumentError(`signature invalid v byte`,`signature`,e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=k(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){let n=D(w(t._vs),32);t._vs=k(n);let r=n[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=r:t.recoveryParam!==r&&I.throwArgumentError(`signature recoveryParam mismatch _vs`,`signature`,e),n[0]&=127;let i=k(n);t.s==null?t.s=i:t.s!==i&&I.throwArgumentError(`signature v mismatch _vs`,`signature`,e)}
1if(t.recoveryParam==null)t.v==null?I.throwArgumentError(`signature missing v and recoveryParam`,`signature`,e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{let n=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==n&&I.throwArgumentError(`signature recoveryParam mismatch v`,`signature`,e)}t.r==null||!O(t.r)?I.throwArgumentError(`signature missing or invalid r`,`signature`,e):t.r=re(t.r,32),t.s==null||!O(t.s)?I.throwArgumentError(`signature missing or invalid s`,`signature`,e):t.s=re(t.s,32);let n=w(t.s);n[0]>=128&&I.throwArgumentError(`signature s out of range`,`signature`,e),t.recoveryParam&&(n[0]|=128);let r=k(n);t._vs&&=(O(t._vs)||I.throwArgumentError(`signature invalid _vs`,`signature`,e),re(t._vs,32)),t._vs==null?t._vs=r:t._vs!==r&&I.throwArgumentError(`signature _vs mismatch v and s`,`signature`,e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function F(e){return e=P(e),k(T([e.r,e.s,e.recoveryParam?`0x1c`:`0x1b`]))}var I,L,R=e((()=>{v(),y(),I=new _(ee),L=`0123456789abcdef`})),ie,z=e((()=>{ie=`bignumber/5.8.0`}));function B(e){return e!=null&&(J.isBigNumber(e)||typeof e==`number`&&e%1==0||typeof e==`string`&&!!e.match(/^-?[0-9]+$/)||O(e)||typeof e==`bigint`||te(e))}function ae(e){if(typeof e!=`string`)return ae(e.toString(16));if(e[0]===`-`)return e=e.substring(1),e[0]===`-`&&G.throwArgumentError(`invalid hex`,`value`,e),e=ae(e),e===`0x00`?e:`-`+e;if(e.substring(0,2)!==`0x`&&(e=`0x`+e),e===`0x`)return`0x00`;for(e.length%2&&(e=`0x0`+e.substring(2));e.length>4&&e.substring(0,4)===`0x00`;)e=`0x`+e.substring(4);return e}function V(e){return J.from(ae(e))}function H(e){let t=J.from(e).toHexString();return t[0]===`-`?new se(`-`+t.substring(3),16):new se(t.substring(2),16)}function oe(e,t,n){let r={fault:e,operation:t};return n!=null&&(r.value=n),G.throwError(e,_.errors.NUMERIC_FAULT,r)}function U(e){return new se(e,36).toString(16)}var W,se,G,K,ce,q,J,le=e((()=>{W=t(i()),R(),v(),z(),se=W.default.BN,G=new _(ie),K={},ce=9007199254740991,q=!1,J=class e{constructor(e,t){e!==K&&G.throwError(`cannot call constructor directly; use BigNumber.from`,_.errors.UNSUPPORTED_OPERATION,{operation:`new (BigNumber)`}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return V(H(this).fromTwos(e))}toTwos(e){return V(H(this).toTwos(e))}abs(){return this._hex[0]===`-`?e.from(this._hex.substring(1)):this}add(e){return V(H(this).add(H(e)))}sub(e){return V(H(this).sub(H(e)))}div(t){return e.from(t).isZero()&&oe(`division-by-zero`,`div`),V(H(this).div(H(t)))}mul(e){return V(H(this).mul(H(e)))}mod(e){let t=H(e);return t.isNeg()&&oe(`division-by-zero`,`mod`),V(H(this).umod(t))}pow(e){let t=H(e);return t.isNeg()&&oe(`negative-power`,`pow`),V(H(this).pow(t))}and(e){let t=H(e);return(this.isNegative()||t.isNeg())&&oe(`unbound-bitwise-result`,`and`),V(H(this).and(t))}or(e){let t=H(e);return(this.isNegative()||t.isNeg())&&oe(`unbound-bitwise-result`,`or`),V(H(this).or(t))}xor(e){let t=H(e);return(this.isNegative()||t.isNeg())&&oe(`unbound-bitwise-result`,`xor`),V(H(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&oe(`negative-width`,`mask`),V(H(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&oe(`negative-width`,`shl`),V(H(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&oe(`negative-width`,`shr`),V(H(this).shrn(e))}eq(e){return H(this).eq(H(e))}lt(e){return H(this).lt(H(e))}lte(e){return H(this).lte(H(e))}gt(e){return H(this).gt(H(e))}gte(e){return H(this).gte(H(e))}isNegative(){return this._hex[0]===`-`}isZero(){return H(this).isZero()}toNumber(){try{return H(this).toNumber()}catch{oe(`overflow`,`toNumber`,this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return G.throwError(`this platform does not support BigInt`,_.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?q||(q=!0,G.warn(`BigNumber.toString does not accept any parameters; base-10 is assumed`)):arguments[0]===16?G.throwError(`BigNumber.toString does not accept any parameters; use bigNumber.toHexString()`,_.errors.UNEXPECTED_ARGUMENT,{}):G.throwError(`BigNumber.toString does not accept parameters`,_.errors.UNEXPECTED_ARGUMENT,{})),H(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:`BigNumber`,hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if(typeof t==`string`)return t.match(/^-?0x[0-9a-f]+$/i)?new e(K,ae(t)):t.match(/^-?[0-9]+$/)?new e(K,ae(new se(t))):G.throwArgumentError(`invalid BigNumber string`,`value`,t);if(typeof t==`number`)return t%1&&oe(`underflow`,`BigNumber.from`,t),(t>=ce||t<=-ce)&&oe(`overflow`,`BigNumber.from`,t),e.from(String(t));let n=t;if(typeof n==`bigint`)return e.from(n.toString());if(te(n))return e.from(k(n));if(n)if(n.toHexString){let t=n.toHexString();if(typeof t==`string`)return e.from(t)}else{let t=n._hex;if(t==null&&n.type===`BigNumber`&&(t=n.hex),typeof t==`string`&&(O(t)||t[0]===`-`&&O(t.substring(1))))return e.from(t)}return G.throwArgumentError(`invalid BigNumber value`,`value`,t)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}}));function Y(e,t,n,r){let i={fault:t,operation:n};return r!==void 0&&(i.value=r),Q.throwError(e,_.errors.NUMERIC_FAULT,i)}function X(e){if(typeof e!=`number`)try{e=J.from(e).toNumber()}catch{}return typeof e==`number`&&e>=0&&e<=256&&!(e%1)?`1`+me.substring(0,e):Q.throwArgumentError(`invalid decimal size`,`decimals`,e)}function ue(e,t){t??=0;let n=X(t);e=J.from(e);let r=e.lt(fe);r&&(e=e.mul(pe));let i=e.mod(n).toString();for(;i.length<n.length-1;)i=`0`+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];let a=e.div(n).toString();return e=n.length===1?a:a+`.`+i,r&&(e=`-`+e),e}function Z(e,t){t??=0;let n=X(t);(typeof e!=`string`||!e.match(/^-?[0-9.]+$/))&&Q.throwArgumentError(`invalid decimal value`,`value`,e);let r=e.substring(0,1)===`-`;r&&(e=e.substring(1)),e===`.`&&Q.throwArgumentError(`missing value`,`value`,e);let i=e.split(`.`);i.length>2&&Q.throwArgumentError(`too many decimal points`,`value`,e);let a=i[0],o=i[1];for(a||=`0`,o||=`0`;o[o.length-1]===`0`;)o=o.substring(0,o.length-1);for(o.length>n.length-1&&Y(`fractional component exceeds decimals`,`underflow`,`parseFixed`),o===``&&(o=`0`);o.length<n.length-1;)o+=`0`;let s=J.from(a),c=J.from(o),l=s.mul(n).add(c);return r&&(l=l.mul(pe)),l}var Q,de,fe,pe,me,he,ge,_e,ve,ye=e((()=>{for(R(),v(),z(),le(),Q=new _(ie),de={},fe=J.from(0),pe=J.from(-1),me=`0`;me.length<256;)me+=me;he=class e{constructor(e,t,n,r){e!==de&&Q.throwError(`cannot use FixedFormat constructor; use FixedFormat.from`,_.errors.UNSUPPORTED_OPERATION,{operation:`new FixedFormat`}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?``:`u`)+`fixed`+String(n)+`x`+String(r),this._multiplier=X(r),Object.freeze(this)}static from(t){if(t instanceof e)return t;typeof t==`number`&&(t=`fixed128x${t}`);let n=!0,r=128,i=18;if(typeof t==`string`){if(t!==`fixed`)if(t===`ufixed`)n=!1;else{let e=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);e||Q.throwArgumentError(`invalid fixed format`,`format`,t),n=e[1]!==`u`,r=parseInt(e[2]),i=parseInt(e[3])}}else if(t){let e=(e,n,r)=>t[e]==null?r:(typeof t[e]!==n&&Q.throwArgumentError(`invalid fixed format (`+e+` not `+n+`)`,`format.`+e,t[e]),t[e]);n=e(`signed`,`boolean`,n),r=e(`width`,`number`,r),i=e(`decimals`,`number`,i)}return r%8&&Q.throwArgumentError(`invalid fixed format width (not byte aligned)`,`format.width`,r),i>80&&Q.throwArgumentError(`invalid fixed format (decimals too large)`,`format.decimals`,i),new e(de,n,r,i)}},ge=class e{constructor(e,t,n,r){e!==de&&Q.throwError(`cannot use FixedNumber constructor; use FixedNumber.from`,_.errors.UNSUPPORTED_OPERATION,{operation:`new FixedFormat`}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Q.throwArgumentError(`incompatible format; use fixedNumber.toFormat`,`other`,e)}addUnsafe(t){this._checkFormat(t);let n=Z(this._value,this.format.decimals),r=Z(t._value,t.format.decimals);return e.fromValue(n.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let n=Z(this._value,this.format.decimals),r=Z(t._value,t.format.decimals);return e.fromValue(n.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let n=Z(this._value,this.format.decimals),r=Z(t._value,t.format.decimals);return e.fromValue(n.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let n=Z(this._value,this.format.decimals),r=Z(t._value,t.format.decimals);return e.fromValue(n.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(`.`);t.length===1&&t.push(`0`);let n=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(n=n.subUnsafe(_e.toFormat(n.format))),n}ceiling(){let t=this.toString().split(`.`);t.length===1&&t.push(`0`);let n=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(n=n.addUnsafe(_e.toFormat(n.format))),n}round(t){t??=0;let n=this.toString().split(`.`);if(n.length===1&&n.push(`0`),(t<0||t>80||t%1)&&Q.throwArgumentError(`invalid decimal count`,`decimals`,t),n[1].length<=t)return this;let r=e.from(`1`+me.substring(0,t),this.format),i=ve.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return this._value===`0.0`||this._value===`0`}isNegative(){return this._value[0]===`-`}toString(){return this._value}toHexString(e){return e==null?this._hex:(e%8&&Q.throwArgumentError(`invalid byte width`,`width`,e),re(J.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return e.fromString(this._value,t)}static fromValue(t,n,r){return r==null&&n!=null&&!B(n)&&(r=n,n=null),n??=0,r??=`fixed`,e.fromString(ue(t,n),he.from(r))}static fromString(t,n){n??=`fixed`;let r=he.from(n),i=Z(t,r.decimals);!r.signed&&i.lt(fe)&&Y(`unsigned value cannot be negative`,`overflow`,`value`,t);let a=null;r.signed?a=i.toTwos(r.width).toHexString():(a=i.toHexString(),a=re(a,r.width/8));let o=ue(i,r.decimals);return new e(de,a,o,r)}static fromBytes(t,n){n??=`fixed`;let r=he.from(n);if(w(t).length>r.width/8)throw Error(`overflow`);let i=J.from(t);return r.signed&&(i=i.fromTwos(r.width)),new e(de,i.toTwos((r.signed?0:1)+r.width).toHexString(),ue(i,r.decimals),r)}static from(t,n){if(typeof t==`string`)return e.fromString(t,n);if(te(t))return e.fromBytes(t,n);try{return e.fromValue(t,0,n)}catch(e){if(e.code!==_.errors.INVALID_ARGUMENT)throw e}return Q.throwArgumentError(`invalid FixedNumber value`,`value`,t)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}},_e=ge.from(1),ve=ge.from(`0.5`)})),be=e((()=>{le(),ye()})),xe,Se=e((()=>{xe=`properties/5.8.0`}));function Ce(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function we(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||typeof e.prototype!=`object`)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Te(e){return je(this,void 0,void 0,function*(){let t=Object.keys(e).map(t=>{let n=e[t];return Promise.resolve(n).then(e=>({key:t,value:e}))});return(yield Promise.all(t)).reduce((e,t)=>
1(e[t.key]=t.value,e),{})})}function Ee(e,t){(!e||typeof e!=`object`)&&Me.throwArgumentError(`invalid object`,`object`,e),Object.keys(e).forEach(n=>{t[n]||Me.throwArgumentError(`invalid object key - `+n,`transaction:`+n,e)})}function De(e){let t={};for(let n in e)t[n]=e[n];return t}function Oe(e){if(e==null||Ne[typeof e])return!0;if(Array.isArray(e)||typeof e==`object`){if(!Object.isFrozen(e))return!1;let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch{continue}if(!Oe(r))return!1}return!0}return Me.throwArgumentError(`Cannot deepCopy ${typeof e}`,`object`,e)}function ke(e){if(Oe(e))return e;if(Array.isArray(e))return Object.freeze(e.map(e=>Ae(e)));if(typeof e==`object`){let t={};for(let n in e){let r=e[n];r!==void 0&&Ce(t,n,Ae(r))}return t}return Me.throwArgumentError(`Cannot deepCopy ${typeof e}`,`object`,e)}function Ae(e){return ke(e)}var je,Me,Ne,Pe,Fe=e((()=>{v(),Se(),je=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Me=new _(xe),Ne={bigint:!0,boolean:!0,function:!0,number:!0,string:!0},Pe=class{constructor(e){for(let t in e)this[t]=Ae(e[t])}}})),Ie,Le=e((()=>{Ie=`0x0000000000000000000000000000000000000000`})),Re,ze,Be,Ve,He=e((()=>{be(),Re=J.from(-1),ze=J.from(0),Be=J.from(1),Ve=J.from(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`)})),Ue,We=e((()=>{Ue=`0x0000000000000000000000000000000000000000000000000000000000000000`})),Ge=e((()=>{Le(),He(),We()})),Ke=n(((e,t)=>{(function(){var e=`input is invalid type`,n=`finalize already called`,r=typeof window==`object`,i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`;!i.JS_SHA3_NO_NODE_JS&&typeof process==`object`&&process.versions&&process.versions.node?i=global:a&&(i=self);var o=!i.JS_SHA3_NO_COMMON_JS&&typeof t==`object`&&t.exports,s=typeof define==`function`&&define.amd,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,l=`0123456789abcdef`.split(``),u=[31,7936,2031616,520093696],d=[4,1024,262144,67108864],f=[1,256,65536,16777216],p=[6,1536,393216,100663296],m=[0,8,16,24],h=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],_=[128,256],v=[`hex`,`buffer`,`arrayBuffer`,`array`,`digest`],ee={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return Object.prototype.toString.call(e)===`[object Array]`}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,t,n){return function(r){return new M(e,t,e).update(r)[n]()}},b=function(e,t,n){return function(r,i){return new M(e,t,i).update(r)[n]()}},x=function(e,t,n){return function(t,r,i,a){return T[`cshake`+e].update(t,r,i,a)[n]()}},S=function(e,t,n){return function(t,r,i,a){return T[`kmac`+e].update(t,r,i,a)[n]()}},C=function(e,t,n,r){for(var i=0;i<v.length;++i){var a=v[i];e[a]=t(n,r,a)}return e},te=function(e,t){var n=y(e,t,`hex`);return n.create=function(){return new M(e,t,e)},n.update=function(e){return n.create().update(e)},C(n,y,e,t)},w=[{name:`keccak`,padding:f,bits:g,createMethod:te},{name:`sha3`,padding:p,bits:g,createMethod:te},{name:`shake`,padding:u,bits:_,createMethod:function(e,t){var n=b(e,t,`hex`);return n.create=function(n){return new M(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},C(n,b,e,t)}},{name:`cshake`,padding:d,bits:_,createMethod:function(e,t){var n=ee[e],r=x(e,t,`hex`);return r.create=function(r,i,a){return!i&&!a?T[`shake`+e].create(r):new M(e,t,r).bytepad([i,a],n)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},C(r,x,e,t)}},{name:`kmac`,padding:d,bits:_,createMethod:function(e,t){var n=ee[e],r=S(e,t,`hex`);return r.create=function(r,i,a){return new N(e,t,i).bytepad([`KMAC`,a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},C(r,S,e,t)}}],T={},E=[],D=0;D<w.length;++D)for(var O=w[D],k=O.bits,A=0;A<k.length;++A){var j=O.name+`_`+k[A];if(E.push(j),T[j]=O.createMethod(k[A],O.padding),O.name!==`sha3`){var ne=O.name+k[A];E.push(ne),T[ne]=T[j]}}function M(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(n&31)>>3;for(var r=0;r<50;++r)this.s[r]=0}M.prototype.update=function(t){if(this.finalized)throw Error(n);var r,i=typeof t;if(i!==`string`){if(i===`object`){if(t===null)throw Error(e);
1if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!c||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);r=!0}for(var a=this.blocks,o=this.byteCount,s=t.length,l=this.blockCount,u=0,d=this.s,f,p;u<s;){if(this.reset)for(this.reset=!1,a[0]=this.block,f=1;f<l+1;++f)a[f]=0;if(r)for(f=this.start;u<s&&f<o;++u)a[f>>2]|=t[u]<<m[f++&3];else for(f=this.start;u<s&&f<o;++u)p=t.charCodeAt(u),p<128?a[f>>2]|=p<<m[f++&3]:p<2048?(a[f>>2]|=(192|p>>6)<<m[f++&3],a[f>>2]|=(128|p&63)<<m[f++&3]):p<55296||p>=57344?(a[f>>2]|=(224|p>>12)<<m[f++&3],a[f>>2]|=(128|p>>6&63)<<m[f++&3],a[f>>2]|=(128|p&63)<<m[f++&3]):(p=65536+((p&1023)<<10|t.charCodeAt(++u)&1023),a[f>>2]|=(240|p>>18)<<m[f++&3],a[f>>2]|=(128|p>>12&63)<<m[f++&3],a[f>>2]|=(128|p>>6&63)<<m[f++&3],a[f>>2]|=(128|p&63)<<m[f++&3]);if(this.lastByteIndex=f,f>=o){for(this.start=f-o,this.block=a[l],f=0;f<l;++f)d[f]^=a[f];re(d),this.reset=!0}else this.start=f}return this},M.prototype.encode=function(e,t){var n=e&255,r=1,i=[n];for(e>>=8,n=e&255;n>0;)i.unshift(n),e>>=8,n=e&255,++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},M.prototype.encodeString=function(t){var n,r=typeof t;if(r!==`string`){if(r===`object`){if(t===null)throw Error(e);
1if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!c||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);n=!0}var i=0,a=t.length;if(n)i=a;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((s&1023)<<10|t.charCodeAt(++o)&1023),i+=4)}return i+=this.encode(i*8),this.update(t),i},M.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[t&3],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];re(r)}},M.prototype.toString=M.prototype.hex=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=``,s;a<n;){for(i=0;i<e&&a<n;++i,++a)s=t[i],o+=l[s>>4&15]+l[s&15]+l[s>>12&15]+l[s>>8&15]+l[s>>20&15]+l[s>>16&15]+l[s>>28&15]+l[s>>24&15];a%e===0&&(re(t),i=0)}return r&&(s=t[i],o+=l[s>>4&15]+l[s&15],r>1&&(o+=l[s>>12&15]+l[s>>8&15]),r>2&&(o+=l[s>>20&15]+l[s>>16&15])),o},M.prototype.arrayBuffer=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=this.outputBits>>3,s=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(o),c=new Uint32Array(s);a<n;){for(i=0;i<e&&a<n;++i,++a)c[a]=t[i];a%e===0&&re(t)}return r&&(c[i]=t[i],s=s.slice(0,o)),s},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.digest=M.prototype.array=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=[],s,c;a<n;){for(i=0;i<e&&a<n;++i,++a)s=a<<2,c=t[i],o[s]=c&255,o[s+1]=c>>8&255,o[s+2]=c>>16&255,o[s+3]=c>>24&255;a%e===0&&re(t)}return r&&(s=a<<2,c=t[i],o[s]=c&255,r>1&&(o[s+1]=c>>8&255),r>2&&(o[s+2]=c>>16&255)),o};function N(e,t,n){M.call(this,e,t,n)}N.prototype=new M,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var re=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,g,_,v,ee,y,b,x,S,C,te,w,T,E,D,O,k,A,j,ne,M,N,re,P,F,I,L,R,ie,z,B,ae,V,H,oe,U,W,se,G,K,ce,q,J,le,Y,X,ue,Z,Q,de;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(o<<1|s>>>31),n=p^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|l>>>31),n=a^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(u<<1|d>>>31),n=s^(d<<1|u>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=l^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=u^(i<<1|a>>>31),n=d^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],g=e[1],V=e[11]<<4|e[10]>>>28,H=e[10]<<4|e[11]>>>28,D=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,ue=e[31]<<9|e[30]>>>23,Z=e[30]<<9|e[31]>>>23,ie=e[40]<<18|e[41]>>>14,z=e[41]<<18|e[40]>>>14,M=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,_=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,oe=e[22]<<10|e[23]>>>22,U=e[23]<<10|e[22]>>>22,k=e[33]<<13|e[32]>>>19,A=e[32]<<13|e[33]>>>19,Q=e[42]<<2|e[43]>>>30,de=e[43]<<2|e[42]>>>30,ce=e[5]<<30|e[4]>>>2,q=e[4]<<30|e[5]>>>2,re=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,ee=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,se=e[35]<<15|e[34]>>>17,j=e[45]<<29|e[44]>>>3,ne=e[44]<<29|e[45]>>>3,te=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,J=e[17]<<23|e[16]>>>9,le=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,I=e[27]<<25|e[26]>>>7,b=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,G=e[47]<<24|e[46]>>>8,K=e[46]<<24|e[47]>>>8,B=e[8]<<27|e[9]>>>5,ae=e[9]<<27|e[8]>>>5,T=e[18]<<20|e[19]>>>12,E=e[19]<<20|e[18]>>>12,Y=e[29]<<7|e[28]>>>25,X=e[28]<<7|e[29]>>>25,L=e[38]<<8|e[39]>>>24,R=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,C=e[49]<<14|e[48]>>>18,e[0]=m^~_&ee,e[1]=g^~v&y,e[10]=te^~T&D,e[11]=w^~E&O,e[20]=M^~re&F,e[21]=N^~P&I,e[30]=B^~V&oe,e[31]=ae^~H&U,e[40]=ce^~J&Y,e[41]=q^~le&X,e[2]=_^~ee&b,e[3]=v^~y&x,e[12]=T^~D&k,e[13]=E^~O&A,e[22]=re^~F&L,e[23]=P^~I&R,e[32]=V^~oe&W,e[33]=H^~U&se,e[42]=J^~Y&ue,e[43]=le^~X&Z,e[4]=ee^~b&S,e[5]=y^~x&C,e[14]=D^~k&j,e[15]=O^~A&ne,e[24]=F^~L&ie,e[25]=I^~R&z,e[34]=oe^~W&G,e[35]=U^~se&K,e[44]=Y^~ue&Q,e[45]=X^~Z&de,e[6]=b^~S&m,e[7]=x^~C&g,e[16]=k^~j&te,e[17]=A^~ne&w,e[26]=L^~ie&M,e[27]=R^~z&N,e[36]=W^~G&B,e[37]=se^~K&ae,e[46]=ue^~Q&ce,e[47]=Z^~de&q,e[8]=S^~m&_,e[9]=C^~g&v,e[18]=j^~te&T,e[19]=ne^~w&E,e[28]=ie^~M&re,e[29]=z^~N&P,e[38]=G^~B&V,e[39]=K^~ae&H,e[48]=Q^~ce&J,e[49]=de^~q&le,e[0]^=h[r],e[1]^=h[r+1]};if(o)t.exports=T;else{for(D=0;D<E.length;++D)i[E[D]]=T[E[D]];s&&define(function(){return T})}})()}));function qe(e){return`0x`+Je.default.keccak_256(w(e))}var Je,Ye=e((()=>{Je=t(Ke()),R()})),Xe,Ze=e((()=>{Xe=`strings/5.8.0`}));function Qe(e,t,n,r,i){return ot.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,`bytes`,n)}function $e(e,t,n,r,i){if(e===ct.BAD_PREFIX||e===ct.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===ct.OVERRUN?n.length-t-1:0}function et(e,t,n,r,i){return e===ct.OVERLONG?(r.push(i),0):(r.push(65533),$e(e,t,n,r,i))}function tt(e,t){t??=lt.error,e=w(e);let n=[],r=0;for(;r<e.length;){let i=e[r++];if(!(i>>
17)){n.push(i);continue}let a=null,o=null;if((i&224)==192)a=1,o=127;else if((i&240)==224)a=2,o=2047;else if((i&248)==240)a=3,o=65535;else{(i&192)==128?r+=t(ct.UNEXPECTED_CONTINUE,r-1,e,n):r+=t(ct.BAD_PREFIX,r-1,e,n);continue}if(r-1+a>=e.length){r+=t(ct.OVERRUN,r-1,e,n);continue}let s=i&(1<<8-a-1)-1;for(let i=0;i<a;i++){let i=e[r];if((i&192)!=128){r+=t(ct.MISSING_CONTINUE,r,e,n),s=null;break}s=s<<6|i&63,r++}if(s!==null){if(s>1114111){r+=t(ct.OUT_OF_RANGE,r-1-a,e,n,s);continue}if(s>=55296&&s<=57343){r+=t(ct.UTF16_SURROGATE,r-1-a,e,n,s);continue}if(s<=o){r+=t(ct.OVERLONG,r-1-a,e,n,s);continue}n.push(s)}}return n}function nt(e,t=st.current){t!=st.current&&(ot.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(r&63|128);else if((r&64512)==55296){t++;let i=e.charCodeAt(t);if(t>=e.length||(i&64512)!=56320)throw Error(`invalid utf-8 string`);let a=65536+((r&1023)<<10)+(i&1023);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(a&63|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(r&63|128)}return w(n)}function rt(e){return e.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join(``)}function it(e,t){return rt(tt(e,t))}function at(e,t=st.current){return tt(nt(e,t))}var ot,st,ct,lt,ut=e((()=>{R(),v(),Ze(),ot=new _(Xe),(function(e){e.current=``,e.NFC=`NFC`,e.NFD=`NFD`,e.NFKC=`NFKC`,e.NFKD=`NFKD`})(st||={}),(function(e){e.UNEXPECTED_CONTINUE=`unexpected continuation byte`,e.BAD_PREFIX=`bad codepoint prefix`,e.OVERRUN=`string overrun`,e.MISSING_CONTINUE=`missing continuation byte`,e.OUT_OF_RANGE=`out of UTF-8 range`,e.UTF16_SURROGATE=`UTF-16 surrogate`,e.OVERLONG=`overlong representation`})(ct||={}),lt=Object.freeze({error:Qe,ignore:$e,replace:et})}));function dt(e){let t=nt(e);if(t.length>31)throw Error(`bytes32 string must be less than 32 bytes`);return k(T([t,Ue]).slice(0,32))}var ft=e((()=>{Ge(),R(),ut()})),pt=e((()=>{ft(),ut()})),mt,ht=e((()=>{mt=`rlp/5.8.0`}));function gt(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function _t(e,t,n){let r=0;for(let i=0;i<n;i++)r=r*256+e[t+i];return r}function vt(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(vt(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=gt(t.length);return n.unshift(247+n.length),n.concat(t)}S(e)||Ct.throwArgumentError(`RLP object must be BytesLike`,`object`,e);let t=Array.prototype.slice.call(w(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=gt(t.length);return n.unshift(183+n.length),n.concat(t)}function yt(e){return k(vt(e))}function bt(e,t,n,r){let i=[];for(;n<t+1+r;){let a=xt(e,n);i.push(a.result),n+=a.consumed,n>t+1+r&&Ct.throwError(`child data too short`,_.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function xt(e,t){if(e.length===0&&Ct.throwError(`data too short`,_.errors.BUFFER_OVERRUN,{}),e[t]>=248){let n=e[t]-247;t+1+n>e.length&&Ct.throwError(`data short segment too short`,_.errors.BUFFER_OVERRUN,{});let r=_t(e,t+1,n);return t+1+n+r>e.length&&Ct.throwError(`data long segment too short`,_.errors.BUFFER_OVERRUN,{}),bt(e,t,t+1+n,n+r)}else if(e[t]>=192){let n=e[t]-192;return t+1+n>e.length&&Ct.throwError(`data array too short`,_.errors.BUFFER_OVERRUN,{}),bt(e,t,t+1,n)}else if(e[t]>=184){let n=e[t]-183;t+1+n>e.length&&Ct.throwError(`data array too short`,_.errors.BUFFER_OVERRUN,{});let r=_t(e,t+1,n);t+1+n+r>e.length&&Ct.throwError(`data array too short`,_.errors.BUFFER_OVERRUN,{});let i=k(e.slice(t+1+n,t+1+n+r));return{consumed:1+n+r,result:i}}else if(e[t]>=128){let n=e[t]-128;t+1+n>e.length&&Ct.throwError(`data too short`,_.errors.BUFFER_OVERRUN,{});let r=k(e.slice(t+1,t+1+n));return{consumed:1+n,result:r}}return{consumed:1,result:k(e[t])}}function St(e){let t=w(e),n=xt(t,0);return n.consumed!==t.length&&Ct.throwArgumentError(`invalid rlp data`,`data`,e),n.result}var Ct,wt=e((()=>{R(),v(),ht(),Ct=new _(mt)})),Tt,Et=e((()=>{Tt=`address/5.8.0`}));function Dt(e){O(e,20)||Pt.throwArgumentError(`invalid address`,`address`,e),e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=w(qe(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}function Ot(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}function kt(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>It[e]).join(``);for(;t.length>=Lt;){let e=t.substring(0,Lt);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}function At(e){let t=null;if(typeof e!=`string`&&Pt.throwArgumentError(`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!==`0x`&&(e=`0x`+e),t=Dt(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Pt.throwArgumentError(`bad address checksum`,`address`,e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==kt(e)&&Pt.throwArgumentError(`bad icap checksum`,`address`,e),t=U(e.substring(4));t.length<40;)t=`0`+t;t=Dt(`0x`+t)}else Pt.throwArgumentError(`invalid address`,`address`,e);return t}function jt(e){try{return At(e),!0}catch{}return!1}function Mt(e){let t=null;try{t=At(e.from)}catch{Pt.throwArgumentError(`missing from address`,`transaction`,e)}let n=E(w(J.from(e.nonce).toHexString()));return At(j(qe(yt([t,n])),12))}function Nt(e,t,n){return A(t)!==32&&Pt.throwArgumentError(`salt must be 32 bytes`,`salt`,t),A(n)!==32&&Pt.throwArgumentError(`initCodeHash must be 32 bytes`,`initCodeHash`,n),At(j(qe(T([`0xff`,At(e),t,n])),12))}var Pt,Ft,It,Lt,Rt=e((()=>{R(),be(),Ye(),wt(),v(),Et(),Pt=new _(Tt),Ft=9007199254740991,It={};for(let e=0;e<10;e++)It[String(e)]=String(e);for(let e=0;e<26;e++)It[String.fromCharCode(65+e)]=String(10+e);Lt=Math.floor(Ot(Ft))})),zt=n(((e,t)=>{t.exports=n;function n(e,t){if(!e)throw Error(t||`Assertion failed`)}n.equal=function(e,t,n){if(e!=t)throw Error(n||`Assertion failed: `+e+` != `+t)}})),Bt=n(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),Vt=n((e=>{var t=zt();e.inherits=Bt();function n(e,t){return(e.charCodeAt(t)&64512)!=55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)==56320}function r(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==`string`){if(!t)for(var i=0,a=0;a<e.length;a++){var o=e.charCodeAt(a);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=o&63|128):n(e,a)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++a)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else if(t===`hex`)for(e=e.replace(/[^a-z0-9]+/gi,``),e.length%2!=0&&(e=`0`+e),a=0;a<e.length;a+=2)r.push(parseInt(e[a]+e[a+1],16))}else for(a=0;a<e.length;a++)r[a]=e[a]|0;return r}e.toArray=r;function i(e){for(var t=``,n=0;n<e.length;n++)t+=s(e[n].toString(16));return t}e.toHex=i;function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24)>>>0}e.htonl=a;function o(e,t){for(var n=``,r=0;r<e.length;r++){var i=e[r];t===`little`&&(i=a(i)),n+=c(i.toString(16))}return n}e.toHex32=o;function s(e){return e.length===1?`0`+e:e}e.zero2=s;function c(e){return e.length===7?`0`+e:e.length===6?`00`+e:e.length===5?`000`+e:e.length===4?`0000`+e:e.length===3?`00000`+e:e.length===2?`000000`+e:e.length===1?`0000000`+e:e}e.zero8=c;function l(e,n,r,i){var a=r-n;t(a%4==0);for(var o=Array(a/4),s=0,c=n;s<o.length;s++,c+=4)o[s]=(i===`big`?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c])>>>0;return o}e.join32=l;function u(e,t){for(var n=Array(e.length*4),r=0,i=0;r<e.length;r++,i+=4){var a=e[r];t===`big`?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=a&255):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=a&255)}return n}e.split32=u;function d(e,t){return e>>>t|e<<32-t}e.rotr32=d;function f(e,t){return e<<t|e>>>32-t}e.rotl32=f;function p(e,t){return e+t>>>0}e.sum32=p;function m(e,t,n){return e+t+n>>>0}e.sum32_3=m;function h(e,t,n,r){return e+t+n+r>>>0}e.sum32_4=h;function g(e,t,n,r,i){return e+t+n+r+i>>>0}e.sum32_5=g;function _(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0;e[t]=(a<r?1:0)+n+i>>>
10,e[t+1]=a}e.sum64=_;function v(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0}e.sum64_hi=v;function ee(e,t,n,r){return t+r>>>0}e.sum64_lo=ee;function y(e,t,n,r,i,a,o,s){var c=0,l=t;return l=l+r>>>0,c+=l<t?1:0,l=l+a>>>0,c+=l<a?1:0,l=l+s>>>0,c+=l<s?1:0,e+n+i+o+c>>>0}e.sum64_4_hi=y;function b(e,t,n,r,i,a,o,s){return t+r+a+s>>>0}e.sum64_4_lo=b;function x(e,t,n,r,i,a,o,s,c,l){var u=0,d=t;return d=d+r>>>0,u+=d<t?1:0,d=d+a>>>0,u+=d<a?1:0,d=d+s>>>0,u+=d<s?1:0,d=d+l>>>0,u+=d<l?1:0,e+n+i+o+c+u>>>0}e.sum64_5_hi=x;function S(e,t,n,r,i,a,o,s,c,l){return t+r+a+s+l>>>0}e.sum64_5_lo=S;function C(e,t,n){return(t<<32-n|e>>>n)>>>0}e.rotr64_hi=C;function te(e,t,n){return(e<<32-n|t>>>n)>>>0}e.rotr64_lo=te;function w(e,t,n){return e>>>n}e.shr64_hi=w;function T(e,t,n){return(e<<32-n|t>>>n)>>>0}e.shr64_lo=T})),Ht=n((e=>{var t=Vt(),n=zt();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian=`big`,this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=r,r.prototype.update=function(e,n){if(e=t.toArray(e,n),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),this.pending.length===0&&(this.pending=null),e=t.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),n(this.pending===null),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,this.endian===`big`){for(var a=8;a<this.padLength;a++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=e&255}else for(r[i++]=e&255,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,a=8;a<this.padLength;a++)r[i++]=0;return r}})),Ut=n((e=>{var t=Vt().rotr32;function n(e,t,n,o){if(e===0)return r(t,n,o);if(e===1||e===3)return a(t,n,o);if(e===2)return i(t,n,o)}e.ft_1=n;function r(e,t,n){return e&t^~e&n}e.ch32=r;function i(e,t,n){return e&t^e&n^t&n}e.maj32=i;function a(e,t,n){return e^t^n}e.p32=a;function o(e){return t(e,2)^t(e,13)^t(e,22)}e.s0_256=o;function s(e){return t(e,6)^t(e,11)^t(e,25)}e.s1_256=s;function c(e){return t(e,7)^t(e,18)^e>>>3}e.g0_256=c;function l(e){return t(e,17)^t(e,19)^e>>>10}e.g1_256=l})),Wt=n(((e,t)=>{var n=Vt(),r=Ht(),i=Ut(),a=n.rotl32,o=n.sum32,s=n.sum32_5,c=i.ft_1,l=r.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}n.inherits(d,l),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=a(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],l=this.h[1],d=this.h[2],f=this.h[3],p=this.h[4];for(r=0;r<n.length;r++){var m=~~(r/20),h=s(a(i,5),c(m,l,d,f),p,n[r],u[m]);p=f,f=d,d=a(l,30),l=i,i=h}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],l),this.h[2]=o(this.h[2],d),this.h[3]=o(this.h[3],f),this.h[4]=o(this.h[4],p)},d.prototype._digest=function(e){return e===`hex`?n.toHex32(this.h,`big`):n.split32(this.h,`big`)}})),Gt=n(((e,t)=>{var n=Vt(),r=Ht(),i=Ut(),a=zt(),o=n.sum32,s=n.sum32_4,c=n.sum32_5,l=i.ch32,u=i.maj32,d=i.s0_256,f=i.s1_256,p=i.g0_256,m=i.g1_256,h=r.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
1734187,3204031479,3329325298];function _(){if(!(this instanceof _))return new _;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=Array(64)}n.inherits(_,h),t.exports=_,_.blockSize=512,_.outSize=256,_.hmacStrength=192,_.padLength=64,_.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=s(m(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var i=this.h[0],h=this.h[1],g=this.h[2],_=this.h[3],v=this.h[4],ee=this.h[5],y=this.h[6],b=this.h[7];for(a(this.k.length===n.length),r=0;r<n.length;r++){var x=c(b,f(v),l(v,ee,y),this.k[r],n[r]),S=o(d(i),u(i,h,g));b=y,y=ee,ee=v,v=o(_,x),_=g,g=h,h=i,i=o(x,S)}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],h),this.h[2]=o(this.h[2],g),this.h[3]=o(this.h[3],_),this.h[4]=o(this.h[4],v),this.h[5]=o(this.h[5],ee),this.h[6]=o(this.h[6],y),this.h[7]=o(this.h[7],b)},_.prototype._digest=function(e){return e===`hex`?n.toHex32(this.h,`big`):n.split32(this.h,`big`)}})),Kt=n(((e,t)=>{var n=Vt(),r=Gt();function i(){if(!(this instanceof i))return new i;r.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,r),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return e===`hex`?n.toHex32(this.h.slice(0,7),`big`):n.split32(this.h.slice(0,7),`big`)}})),qt=n(((e,t)=>{var n=Vt(),r=Ht(),i=zt(),a=n.rotr64_hi,o=n.rotr64_lo,s=n.shr64_hi,c=n.shr64_lo,l=n.sum64,u=n.sum64_hi,d=n.sum64_lo,f=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,h=n.sum64_5_lo,g=r.BlockHash,_=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
11126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=_,this.W=Array(160)}n.inherits(v,g),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=D(n[r-4],n[r-3]),a=O(n[r-4],n[r-3]),o=n[r-14],s=n[r-13],c=T(n[r-30],n[r-29]),l=E(n[r-30],n[r-29]),u=n[r-32],d=n[r-31];n[r]=f(i,a,o,s,c,l,u,d),n[r+1]=p(i,a,o,s,c,l,u,d)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4],f=this.h[5],p=this.h[6],g=this.h[7],_=this.h[8],v=this.h[9],T=this.h[10],E=this.h[11],D=this.h[12],O=this.h[13],k=this.h[14],A=this.h[15];i(this.k.length===n.length);for(var j=0;j<n.length;j+=2){var ne=k,M=A,N=te(_,v),re=w(_,v),P=ee(_,v,T,E,D,O),F=y(_,v,T,E,D,O),I=this.k[j],L=this.k[j+1],R=n[j],ie=n[j+1],z=m(ne,M,N,re,P,F,I,L,R,ie),B=h(ne,M,N,re,P,F,I,L,R,ie);ne=S(r,a),M=C(r,a),N=b(r,a,o,s,c,f),re=x(r,a,o,s,c,f);var ae=u(ne,M,N,re),V=d(ne,M,N,re);k=D,A=O,D=T,O=E,T=_,E=v,_=u(p,g,z,B),v=d(g,g,z,B),p=c,g=f,c=o,f=s,o=r,s=a,r=u(z,B,ae,V),a=d(z,B,ae,V)}l(this.h,0,r,a),l(this.h,2,o,s),l(this.h,4,c,f),l(this.h,6,p,g),l(this.h,8,_,v),l(this.h,10,T,E),l(this.h,12,D,O),l(this.h,14,k,A)},v.prototype._digest=function(e){return e===`hex`?n.toHex32(this.h,`big`):n.split32(this.h,`big`)};function ee(e,t,n,r,i){var a=e&n^~e&i;return a<0&&(a+=4294967296),a}function y(e,t,n,r,i,a){var o=t&r^~t&a;return o<0&&(o+=4294967296),o}function b(e,t,n,r,i){var a=e&n^e&i^n&i;return a<0&&(a+=4294967296),a}function x(e,t,n,r,i,a){var o=t&r^t&a^r&a;return o<0&&(o+=4294967296),o}function S(e,t){var n=a(e,t,28),r=a(t,e,2),i=a(t,e,7),o=n^r^i;return o<0&&(o+=4294967296),o}function C(e,t){var n=o(e,t,28),r=o(t,e,2),i=o(t,e,7),a=n^r^i;return a<0&&(a+=4294967296),a}function te(e,t){var n=a(e,t,14),r=a(e,t,18),i=a(t,e,9),o=n^r^i;return o<0&&(o+=4294967296),o}function w(e,t){var n=o(e,t,14),r=o(e,t,18),i=o(t,e,9),a=n^r^i;return a<0&&(a+=4294967296),a}function T(e,t){var n=a(e,t,1),r=a(e,t,8),i=s(e,t,7),o=n^r^i;return o<0&&(o+=4294967296),o}function E(e,t){var n=o(e,t,1),r=o(e,t,8),i=c(e,t,7),a=n^r^i;return a<0&&(a+=4294967296),a}function D(e,t){var n=a(e,t,19),r=a(t,e,29),i=s(e,t,6),o=n^r^i;return o<0&&(o+=4294967296),o}function O(e,t){var n=o(e,t,19),r=o(t,e,29),i=c(e,t,6),a=n^r^i;return a<0&&(a+=4294967296),a}})),Jt=n(((e,t)=>{var n=Vt(),r=qt();function i(){if(!(this instanceof i))return new i;r.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,r),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return e===`hex`?n.toHex32(this.h.slice(0,12),`big`):n.split32(this.h.slice(0,12),`big`)}})),Yt=n((e=>{e.sha1=Wt(),e.sha224=Kt(),e.sha256=Gt(),e.sha384=Jt(),e.sha512=qt()})),Xt=n((e=>{var t=Vt(),n=Ht(),r=t.rotl32,i=t.sum32,a=t.sum32_3,o=t.sum32_4,s=n.BlockHash;function c(){if(!(this instanceof c))return new c;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian=`little`}t.inherits(c,s),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var n=this.h[0],s=this.h[1],c=this.h[2],g=this.h[3],_=this.h[4],v=n,ee=s,y=c,b=g,x=_,S=0;S<80;S++){var C=i(r(o(n,l(S,s,c,g),e[f[S]+t],u(S)),m[S]),_);n=_,_=g,g=r(c,10),c=s,s=C,C=i(r(o(v,l(79-S,ee,y,b),e[p[S]+t],d(S)),h[S]),x),v=x,x=b,b=r(y,10),y=ee,ee=C}C=a(this.h[1],c,b),this.h[1]=a(this.h[2],g,x),this.h[2]=a(this.h[3],_,v),this.h[3]=a(this.h[4],n,ee),this.h[4]=a(this.h[0],s,y),this.h[0]=C},c.prototype._digest=function(e){return e===`hex`?t.toHex32(this.h,`little`):t.split32(this.h,`little`)};function l(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],h=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]})),Zt=n(((e,t)=>{var n=Vt(),r=zt();function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}t.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},i.prototype.update=function(e,t){return this.inner.update(e,t),this},i.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}})),Qt=n((e=>{var t=e;t.utils=Vt(),t.common=Ht(),t.sha=Yt(),t.ripemd=Xt(),t.hmac=Zt(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})),$=t(i()),$t=t(Qt());
1function en(e,t,n){return n={path:t,exports:{},require:function(e,t){return tn(e,t??n.path)}},e(n,n.exports),n.exports}function tn(){throw Error(`Dynamic requires are not currently supported by @rollup/plugin-commonjs`)}var nn=rn;function rn(e,t){if(!e)throw Error(t||`Assertion failed`)}rn.equal=function(e,t,n){if(e!=t)throw Error(n||`Assertion failed: `+e+` != `+t)};var an=en(function(e,t){var n=t;function r(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if(typeof e!=`string`){for(var r=0;r<e.length;r++)n[r]=e[r]|0;return n}if(t===`hex`){e=e.replace(/[^a-z0-9]+/gi,``),e.length%2!=0&&(e=`0`+e);for(var r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16))}else for(var r=0;r<e.length;r++){var i=e.charCodeAt(r),a=i>>8,o=i&255;a?n.push(a,o):n.push(o)}return n}n.toArray=r;function i(e){return e.length===1?`0`+e:e}n.zero2=i;function a(e){for(var t=``,n=0;n<e.length;n++)t+=i(e[n].toString(16));return t}n.toHex=a,n.encode=function(e,t){return t===`hex`?a(e):e}}),on=en(function(e,t){var n=t;n.assert=nn,n.toArray=an.toArray,n.zero2=an.zero2,n.toHex=an.toHex,n.encode=an.encode;function r(e,t,n){var r=Array(Math.max(e.bitLength(),n)+1),i;for(i=0;i<r.length;i+=1)r[i]=0;var a=1<<t+1,o=e.clone();for(i=0;i<r.length;i++){var s,c=o.andln(a-1);o.isOdd()?(s=c>(a>>1)-1?(a>>1)-c:c,o.isubn(s)):s=0,r[i]=s,o.iushrn(1)}return r}n.getNAF=r;function i(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r=0,i=0,a;e.cmpn(-r)>0||t.cmpn(-i)>0;){var o=e.andln(3)+r&3,s=t.andln(3)+i&3;o===3&&(o=-1),s===3&&(s=-1);var c;o&1?(a=e.andln(7)+r&7,c=(a===3||a===5)&&s===2?-o:o):c=0,n[0].push(c);var l;s&1?(a=t.andln(7)+i&7,l=(a===3||a===5)&&o===2?-s:s):l=0,n[1].push(l),2*r===c+1&&(r=1-r),2*i===l+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n}n.getJSF=i;function a(e,t,n){var r=`_`+t;e.prototype[t]=function(){return this[r]===void 0?this[r]=n.call(this):this[r]}}n.cachedProperty=a;function o(e){return typeof e==`string`?n.toArray(e,`hex`):e}n.parseBytes=o;function s(e){return new $.default(e,`hex`,`le`)}n.intFromLE=s}),sn=on.getNAF,cn=on.getJSF,ln=on.assert;function un(e,t){this.type=e,this.p=new $.default(t.p,16),this.red=t.prime?$.default.red(t.prime):$.default.mont(this.p),this.zero=new $.default(0).toRed(this.red),this.one=new $.default(1).toRed(this.red),this.two=new $.default(2).toRed(this.red),this.n=t.n&&new $.default(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var dn=un;un.prototype.point=function(){throw Error(`Not implemented`)},un.prototype.validate=function(){throw Error(`Not implemented`)},un.prototype._fixedNafMul=function(e,t){ln(e.precomputed);var n=e._getDoubles(),r=sn(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var a=[],o,s;for(o=0;o<r.length;o+=n.step){s=0;for(var c=o+n.step-1;c>=o;c--)s=(s<<1)+r[c];a.push(s)}for(var l=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o<a.length;o++)s=a[o],s===d?u=u.mixedAdd(n.points[o]):s===-d&&(u=u.mixedAdd(n.points[o].neg()));l=l.add(u)}return l.toP()},un.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,a=sn(t,n,this._bitLength),o=this.jpoint(null,null,null),s=a.length-1;s>=0;s--){for(var c=0;s>=0&&a[s]===0;s--)c++;if(s>=0&&c++,o=o.dblp(c),s<0)break;var l=a[s];ln(l!==0),o=e.type===`affine`?l>0?o.mixedAdd(i[l-1>>1]):o.mixedAdd(i[-l-1>>1].neg()):l>0?o.add(i[l-1>>1]):o.add(i[-l-1>>1].neg())}return e.type===`affine`?o.toP():o},un.prototype._wnafMulAdd=function(e,t,n,r,i){var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,l,u,d;for(l=0;l<r;l++){d=t[l];var f=d._getNAFPoints(e);a[l]=f.wnd,o[l]=f.points}for(l=r-1;l>=1;l-=2){var p=l-1,m=l;if(a[p]!==1||a[m]!==1){s[p]=sn(n[p],a[p],this._bitLength),s[m]=sn(n[m],a[m],this._bitLength),c=Math.max(s[p].length,c),c=Math.max(s[m].length,c);continue}var h=[t[p],null,null,t[m]];
1t[p].y.cmp(t[m].y)===0?(h[1]=t[p].add(t[m]),h[2]=t[p].toJ().mixedAdd(t[m].neg())):t[p].y.cmp(t[m].y.redNeg())===0?(h[1]=t[p].toJ().mixedAdd(t[m]),h[2]=t[p].add(t[m].neg())):(h[1]=t[p].toJ().mixedAdd(t[m]),h[2]=t[p].toJ().mixedAdd(t[m].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],_=cn(n[p],n[m]);for(c=Math.max(_[0].length,c),s[p]=Array(c),s[m]=Array(c),u=0;u<c;u++){var v=_[0][u]|0,ee=_[1][u]|0;s[p][u]=g[(v+1)*3+(ee+1)],s[m][u]=0,o[p]=h}}var y=this.jpoint(null,null,null),b=this._wnafT4;for(l=c;l>=0;l--){for(var x=0;l>=0;){var S=!0;for(u=0;u<r;u++)b[u]=s[u][l]|0,b[u]!==0&&(S=!1);if(!S)break;x++,l--}if(l>=0&&x++,y=y.dblp(x),l<0)break;for(u=0;u<r;u++){var C=b[u];C!==0&&(C>0?d=o[u][C-1>>1]:C<0&&(d=o[u][-C-1>>1].neg()),y=d.type===`affine`?y.mixedAdd(d):y.add(d))}}for(l=0;l<r;l++)o[l]=null;return i?y:y.toP()};function fn(e,t){this.curve=e,this.type=t,this.precomputed=null}un.BasePoint=fn,fn.prototype.eq=function(){throw Error(`Not implemented`)},fn.prototype.validate=function(){return this.curve.validate(this)},un.prototype.decodePoint=function(e,t){e=on.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1==2*n)return e[0]===6?ln(e[e.length-1]%2==0):e[0]===7&&ln(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw Error(`Unknown point format`)},fn.prototype.encodeCompressed=function(e){return this.encode(e,!0)},fn.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray(`be`,t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray(`be`,t))},fn.prototype.encode=function(e,t){return on.encode(this._encode(t),e)},fn.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},fn.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},fn.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)r=r.dbl();n.push(r)}return{step:e,points:n}},fn.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=n===1?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},fn.prototype._getBeta=function(){return null},fn.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t};var pn=en(function(e){typeof Object.create==`function`?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}}),mn=on.assert;function hn(e){dn.call(this,`short`,e),this.a=new $.default(e.a,16).toRed(this.red),this.b=new $.default(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}pn(hn,dn);var gn=hn;hn.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new $.default(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=r[0].cmp(r[1])<0?r[0]:r[1],t=t.toRed(this.red)}if(e.lambda)n=new $.default(e.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))===0?n=i[0]:(n=i[1],mn(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a=e.basis?e.basis.map(function(e){return{a:new $.default(e.a,16),b:new $.default(e.b,16)}}):this._getEndoBasis(n);return{beta:t,lambda:n,basis:a}}},hn.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:$.default.mont(e),n=new $.default(2).toRed(t).redInvm(),r=n.redNeg(),i=new $.default(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},hn.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,r=this.n.clone(),i=new $.default(1),a=new $.default(0),o=new $.default(0),s=new $.default(1),c,l,u,d,f,p,m,h=0,g,_;n.cmpn(0)!==0;){var v=r.div(n);g=r.sub(v.mul(n)),_=o.sub(v.mul(i));var ee=s.sub(v.mul(a));if(!u&&g.cmp(t)<0)c=m.neg(),l=i,u=g.neg(),d=_;else if(u&&++h===2)break;m=g,r=n,n=g,o=i,i=_,s=a,a=ee}f=g.neg(),p=_;var y=u.sqr().add(d.sqr());return f.sqr().add(p.sqr()).cmp(y)>=0&&(f=c,p=l),u.negative&&(u=u.neg(),d=d.neg()),f.negative&&(f=f.neg(),p=p.neg()),[{a:u,b:d},{a:f,b:p}]},hn.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),c=i.mul(n.b),l=a.mul(r.b);
1return{k1:e.sub(o).sub(s),k2:c.add(l).neg()}},hn.prototype.pointFromX=function(e,t){e=new $.default(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(r.redSqr().redSub(n).cmp(this.zero)!==0)throw Error(`invalid point`);var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},hn.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0},hn.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],c=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),r[a*2]=s,r[a*2+1]=c,i[a*2]=o.k1,i[a*2+1]=o.k2}for(var l=this._wnafMulAdd(1,r,i,a*2,n),u=0;u<a*2;u++)r[u]=null,i[u]=null;return l};function _n(e,t,n,r){dn.BasePoint.call(this,e,`affine`),t===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new $.default(t,16),this.y=new $.default(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}pn(_n,dn.BasePoint),hn.prototype.point=function(e,t,n){return new _n(this,e,t,n)},hn.prototype.pointFromJSON=function(e,t){return _n.fromJSON(this,e,t)},_n.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},_n.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},_n.fromJSON=function(e,t,n){typeof t==`string`&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var a=t[2];return r.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[r].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[r].concat(a.naf.points.map(i))}},r},_n.prototype.inspect=function(){return this.isInfinity()?`<EC Point Infinity>`:`<EC Point x: `+this.x.fromRed().toString(16,2)+` y: `+this.y.fromRed().toString(16,2)+`>`},_n.prototype.isInfinity=function(){return this.inf},_n.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},_n.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},_n.prototype.getX=function(){return this.x.fromRed()},_n.prototype.getY=function(){return this.y.fromRed()},_n.prototype.mul=function(e){return e=new $.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},_n.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},_n.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},_n.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},_n.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());
1if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},_n.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)};function vn(e,t,n,r){dn.BasePoint.call(this,e,`jacobian`),t===null&&n===null&&r===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new $.default(0)):(this.x=new $.default(t,16),this.y=new $.default(n,16),this.z=new $.default(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}pn(vn,dn.BasePoint),hn.prototype.jpoint=function(e,t,n){return new vn(this,e,t,n)},vn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},vn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},vn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),c=a.redSub(o);if(s.cmpn(0)===0)return c.cmpn(0)===0?this.dbl():this.curve.jpoint(null,null,null);var l=s.redSqr(),u=l.redMul(s),d=r.redMul(l),f=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(a.redMul(u)),m=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,p,m)},vn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=n.redSub(r),s=i.redSub(a);if(o.cmpn(0)===0)return s.cmpn(0)===0?this.dbl():this.curve.jpoint(null,null,null);var c=o.redSqr(),l=c.redMul(o),u=n.redMul(c),d=s.redSqr().redIAdd(l).redISub(u).redISub(u),f=s.redMul(u.redISub(d)).redISub(i.redMul(l)),p=this.z.redMul(o);return this.curve.jpoint(d,f,p)},vn.prototype.dblp=function(e){if(e===0||this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,s=this.z,c=s.redSqr().redSqr(),l=o.redAdd(o);for(t=0;t<e;t++){var u=a.redSqr(),d=l.redSqr(),f=d.redSqr(),p=u.redAdd(u).redIAdd(u).redIAdd(r.redMul(c)),m=a.redMul(d),h=p.redSqr().redISub(m.redAdd(m)),g=m.redISub(h),_=p.redMul(g);_=_.redIAdd(_).redISub(f);var v=l.redMul(s);t+1<e&&(c=c.redMul(f)),a=h,s=v,l=_}return this.curve.jpoint(a,l.redMul(i),s)},vn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},vn.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r),c=s.redSqr().redISub(o).redISub(o),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),e=c,t=s.redMul(o.redISub(c)).redISub(l),n=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(u).redISub(f);p=p.redIAdd(p);var m=u.redAdd(u).redIAdd(u),h=m.redSqr(),g=f.redIAdd(f);g=g.redIAdd(g),g=g.redIAdd(g),e=h.redISub(p).redISub(p),t=m.redMul(p.redISub(e)).redISub(g),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},vn.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=s.redSqr().redISub(o).redISub(o);e=c;var l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=s.redMul(o.redISub(c)).redISub(l),n=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),p=this.x.redSub(u).redMul(this.x.redAdd(u));p=p.redAdd(p).redIAdd(p);var m=f.redIAdd(f);m=m.redIAdd(m);var h=m.redAdd(m);e=p.redSqr().redISub(h),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var g=d.redSqr();g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g),t=p.redMul(m.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,n)},vn.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),a=t.redSqr(),o=n.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),c=t.redAdd(t);c=c.redIAdd(c);var l=c.redMul(o),u=s.redSqr().redISub(l.redAdd(l)),d=l.redISub(u),f=o.redSqr();f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var p=s.redMul(d).redISub(f),m=n.redAdd(n).redMul(r);return this.curve.jpoint(u,p,m)},vn.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
1var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(r);o=o.redIAdd(o),o=o.redAdd(o).redIAdd(o),o=o.redISub(a);var s=o.redSqr(),c=r.redIAdd(r);c=c.redIAdd(c),c=c.redIAdd(c),c=c.redIAdd(c);var l=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(c),u=t.redMul(l);u=u.redIAdd(u),u=u.redIAdd(u);var d=this.x.redMul(s).redISub(u);d=d.redIAdd(d),d=d.redIAdd(d);var f=this.y.redMul(l.redMul(c.redISub(l)).redISub(o.redMul(s)));f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var p=this.z.redAdd(o).redSqr().redISub(n).redISub(s);return this.curve.jpoint(d,f,p)},vn.prototype.mul=function(e,t){return e=new $.default(e,t),this.curve._wnafMul(this,e)},vn.prototype.eq=function(e){if(e.type===`affine`)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)===0},vn.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}},vn.prototype.inspect=function(){return this.isInfinity()?`<EC JPoint Infinity>`:`<EC JPoint x: `+this.x.toString(16,2)+` y: `+this.y.toString(16,2)+` z: `+this.z.toString(16,2)+`>`},vn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var yn=en(function(e,t){var n=t;n.base=dn,n.short=gn,n.mont=null,n.edwards=null}),bn=en(function(e,t){var n=t,r=on.assert;function i(e){e.type===`short`?this.curve=new yn.short(e):e.type===`edwards`?this.curve=new yn.edwards(e):this.curve=new yn.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,r(this.g.validate(),`Invalid curve`),r(this.g.mul(this.n).isInfinity(),`Invalid curve, G*N != O`)}n.PresetCurve=i;function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}a(`p192`,{type:`short`,prime:`p192`,p:`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`,a:`ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc`,b:`64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1`,n:`ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831`,hash:$t.default.sha256,gRed:!1,g:[`188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012`,`07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811`]}),a(`p224`,{type:`short`,prime:`p224`,p:`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`,a:`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe`,b:`b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4`,n:`ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d`,hash:$t.default.sha256,gRed:!1,g:[`b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21`,`bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34`]}),a(`p256`,{type:`short`,prime:null,p:`ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff`,a:`ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc`,b:`5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b`,n:`ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551`,hash:$t.default.sha256,gRed:!1,g:[`6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296`,`4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5`]}),a(`p384`,{type:`short`,prime:null,p:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff`,a:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc`,b:`b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef`,n:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973`,hash:$t.default.sha384,gRed:!1,g:[`aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7`,`3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f`]}),a(`p521`,{type:`short`,prime:null,p:`000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff`,a:`000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc`,b:`00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00`,n:`000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409`,hash:$t.default.sha512,gRed:!1,g:[`000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66`,`00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650`]}),a(`curve25519`,{type:`mont`,prime:`p25519`,p:`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`,a:`76d06`,b:`1`,n:`1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed`,hash:$t.default.sha256,gRed:!1,g:[`9`]}),a(`ed25519`,{type:`edwards`,prime:`p25519`,p:`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`,a:`-1`,c:`1`,d:`52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3`,n:`1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed`,hash:$t.default.sha256,gRed:!1,g:[`216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`,`6666666666666666666666666666666666666666666666666666666666666658`]});var o;try{o=null.crash()}catch{o=void 0}a(`secp256k1`,{type:`short`,prime:`k256`,p:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`,a:`0`,b:`7`,n:`ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141`,h:`1`,hash:$t.default.sha256,beta:`7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`,lambda:`5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72`,basis:[{a:`3086d221a7d46bcde86c90e49284eb15`,b:`-e4437ed6010e88286f547fa90abfe4c3`},{a:`114ca50f7a8e2f3f657c1108d9d44cfd8`,b:`3086d221a7d46bcde86c90e49284eb15`}],gRed:!1,g:[`79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`,`483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`,o]})});function xn(e){if(!(this instanceof xn))return new xn(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;
1var t=an.toArray(e.entropy,e.entropyEnc||`hex`),n=an.toArray(e.nonce,e.nonceEnc||`hex`),r=an.toArray(e.pers,e.persEnc||`hex`);nn(t.length>=this.minEntropy/8,`Not enough entropy. Minimum is: `+this.minEntropy+` bits`),this._init(t,n,r)}var Sn=xn;xn.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},xn.prototype._hmac=function(){return new $t.default.hmac(this.hash,this.K)},xn.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},xn.prototype.reseed=function(e,t,n,r){typeof t!=`string`&&(r=n,n=t,t=null),e=an.toArray(e,t),n=an.toArray(n,r),nn(e.length>=this.minEntropy/8,`Not enough entropy. Minimum is: `+this.minEntropy+` bits`),this._update(e.concat(n||[])),this._reseed=1},xn.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw Error(`Reseed is required`);typeof t!=`string`&&(r=n,n=t,t=null),n&&(n=an.toArray(n,r||`hex`),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(n),this._reseed++,an.encode(a,t)};var Cn=on.assert;function wn(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Tn=wn;wn.fromPublic=function(e,t,n){return t instanceof wn?t:new wn(e,{pub:t,pubEnc:n})},wn.fromPrivate=function(e,t,n){return t instanceof wn?t:new wn(e,{priv:t,privEnc:n})},wn.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:`Invalid public key`}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:`Public key * N != O`}:{result:!1,reason:`Public key is not a point`}},wn.prototype.getPublic=function(e,t){return typeof e==`string`&&(t=e,e=null),this.pub||=this.ec.g.mul(this.priv),t?this.pub.encode(t,e):this.pub},wn.prototype.getPrivate=function(e){return e===`hex`?this.priv.toString(16,2):this.priv},wn.prototype._importPrivate=function(e,t){this.priv=new $.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},wn.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type===`mont`?Cn(e.x,`Need x coordinate`):(this.ec.curve.type===`short`||this.ec.curve.type===`edwards`)&&Cn(e.x&&e.y,`Need both x and y coordinate`),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},wn.prototype.derive=function(e){return e.validate()||Cn(e.validate(),`public point not validated`),e.mul(this.priv).getX()},wn.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},wn.prototype.verify=function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},wn.prototype.inspect=function(){return`<Key priv: `+(this.priv&&this.priv.toString(16,2))+` pub: `+(this.pub&&this.pub.inspect())+` >`};var En=on.assert;function Dn(e,t){if(e instanceof Dn)return e;this._importDER(e,t)||(En(e.r&&e.s,`Signature without r or s`),this.r=new $.default(e.r,16),this.s=new $.default(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var On=Dn;function kn(){this.place=0}function An(e,t){var n=e[t.place++];if(!(n&128))return n;var r=n&15;if(r===0||r>4||e[t.place]===0)return!1;for(var i=0,a=0,o=t.place;a<r;a++,o++)i<<=8,i|=e[o],i>>>=0;return i<=127?!1:(t.place=o,i)}function jn(e){for(var t=0,n=e.length-1;!e[t]&&!(e[t+1]&128)&&t<n;)t++;return t===0?e:e.slice(t)}Dn.prototype._importDER=function(e,t){e=on.toArray(e,t);var n=new kn;if(e[n.place++]!==48)return!1;var r=An(e,n);if(r===!1||r+n.place!==e.length||e[n.place++]!==2)return!1;var i=An(e,n);if(i===!1||e[n.place]&128)return!1;var a=e.slice(n.place,i+n.place);if(n.place+=i,e[n.place++]!==2)return!1;var o=An(e,n);if(o===!1||e.length!==o+n.place||e[n.place]&128)return!1;var s=e.slice(n.place,o+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(s[0]===0)if(s[1]&128)s=s.slice(1);else return!1;return this.r=new $.default(a),this.s=new $.default(s),this.recoveryParam=null,!0};function Mn(e,t){if(t<128){e.push(t);return}var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(n|128);--n;)e.push(t>>>(n<<3)&255);e.push(t)}Dn.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=jn(t),n=jn(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var r=[2];Mn(r,t.length),r=r.concat(t),r.push(2),Mn(r,n.length);var i=r.concat(n),a=[48];return Mn(a,i.length),a=a.concat(i),on.encode(a,e)};var Nn=(function(){throw Error(`unsupported`)}),Pn=on.assert;function Fn(e){if(!(this instanceof Fn))return new Fn(e);typeof e==`string`&&(Pn(Object.prototype.hasOwnProperty.call(bn,e),`Unknown curve `+e),e=bn[e]),e instanceof bn.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var In=Fn;Fn.prototype.keyPair=function(e){return new Tn(this,e)},Fn.prototype.keyFromPrivate=function(e,t){return Tn.fromPrivate(this,e,t)},Fn.prototype.keyFromPublic=function(e,t){return Tn.fromPublic(this,e,t)},Fn.prototype.genKeyPair=function(e){e||={};for(var t=new Sn({hash:this.hash,pers:e.pers,persEnc:e.persEnc||`utf8`,entropy:e.entro
1py||Nn(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||`utf8`,nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new $.default(2));;){var i=new $.default(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Fn.prototype._truncateToN=function(e,t,n){var r;if($.default.isBN(e)||typeof e==`number`)e=new $.default(e,16),r=e.byteLength();else if(typeof e==`object`)r=e.length,e=new $.default(e,16);else{var i=e.toString();r=i.length+1>>>1,e=new $.default(i,16)}typeof n!=`number`&&(n=r*8);var a=n-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Fn.prototype.sign=function(e,t,n,r){if(typeof n==`object`&&(r=n,n=null),r||={},typeof e!=`string`&&typeof e!=`number`&&!$.default.isBN(e)){Pn(typeof e==`object`&&e&&typeof e.length==`number`,`Expected message to be an array-like, a hex string, or a BN instance`),Pn(e.length>>>0===e.length);for(var i=0;i<e.length;i++)Pn((e[i]&255)===e[i])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,r.msgBitLength),Pn(!e.isNeg(),`Can not sign a negative message`);var a=this.n.byteLength(),o=t.getPrivate().toArray(`be`,a),s=e.toArray(`be`,a);Pn(new $.default(s).eq(e),`Can not sign message`);for(var c=new Sn({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||`utf8`}),l=this.n.sub(new $.default(1)),u=0;;u++){var d=r.k?r.k(u):new $.default(c.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(l)>=0)){var f=this.g.mul(d);if(!f.isInfinity()){var p=f.getX(),m=p.umod(this.n);if(m.cmpn(0)!==0){var h=d.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(h=h.umod(this.n),h.cmpn(0)!==0){var g=(f.getY().isOdd()?1:0)|(p.cmp(m)===0?0:2);return r.canonical&&h.cmp(this.nh)>0&&(h=this.n.sub(h),g^=1),new On({r:m,s:h,recoveryParam:g})}}}}}},Fn.prototype.verify=function(e,t,n,r,i){i||={},e=this._truncateToN(e,!1,i.msgBitLength),n=this.keyFromPublic(n,r),t=new On(t,`hex`);var a=t.r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),c=s.mul(e).umod(this.n),l=s.mul(a).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(a)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(a)===0)},Fn.prototype.recoverPubKey=function(e,t,n,r){Pn((3&n)===n,`The recovery param is more than two bits`),t=new On(t,r);var i=this.n,a=new $.default(e),o=t.r,s=t.s,c=n&1,l=n>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw Error(`Unable to find sencond key candinate`);o=l?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var u=t.r.invm(i),d=i.sub(a).mul(u).umod(i),f=s.mul(u).umod(i);return this.g.mulAdd(d,o,f)},Fn.prototype.getKeyRecoveryParam=function(e,t,n,r){if(t=new On(t,r),t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch{continue}if(a.eq(n))return i}throw Error(`Unable to find valid recovery factor`)};var Ln=en(function(e,t){var n=t;n.version={version:`6.6.1`}.version,n.utils=on,n.rand=(function(){throw Error(`unsupported`)}),n.curve=yn,n.curves=bn,n.ec=In,n.eddsa=null}).ec,Rn=`signing-key/5.8.0`;R(),Fe(),v();var zn=new _(Rn),Bn=null;function Vn(){return Bn||=new Ln(`secp256k1`),Bn}var Hn=class{constructor(e){Ce(this,`curve`,`secp256k1`),Ce(this,`privateKey`,k(e)),A(this.privateKey)!==32&&zn.throwArgumentError(`invalid private key`,`privateKey`,`[[ REDACTED ]]`);let t=Vn().keyFromPrivate(w(this.privateKey));Ce(this,`publicKey`,`0x`+t.getPublic(!1,`hex`)),Ce(this,`compressedPublicKey`,`0x`+t.getPublic(!0,`hex`)),Ce(this,`_isSigningKey`,!0)}_addPoint(e){let t=Vn().keyFromPublic(w(this.publicKey)),n=Vn().keyFromPublic(w(e));return`0x`+t.pub.add(n.pub).encodeCompressed(`hex`)}signDigest(e){let t=Vn().keyFromPrivate(w(this.privateKey)),n=w(e);n.length!==32&&zn.throwArgumentError(`bad digest length`,`digest`,e);let r=t.sign(n,{canonical:!0});return P({recoveryParam:r.recoveryParam,r:re(`0x`+r.r.toString(16),32),s:re(`0x`+r.s.toString(16),32)})}computeSharedSecret(e){let t=Vn().keyFromPrivate(w(this.privateKey)),n=Vn().keyFromPublic(w(Wn(e)));return re(`0x`+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function Un(e,t){let n=P(t),r={r:w(n.r),s:w(n.s)};return`0x`+Vn().recoverPubKey(w(e),r,n.recoveryParam).encode(`hex`,!1)}function Wn(e,t){let n=w(e);if(n.length===32){let e=new Hn(n);return t?`0x`+Vn().keyFromPrivate(n).getPublic(!0,`hex`):e.publicKey}else if(n.length===33)return t?k(n):`0x`+Vn().keyFromPublic(n).getPublic(!1,`hex`);else if(n.length===65)return t?`0x`+Vn().keyFromPublic(n).getPublic(!0,`hex`):k(n);return zn.throwArgumentError(`invalid public or private key`,`key`,`[REDACTED]`)}export{F as $,Pe as A,Z as B,Ge as C,Be as D,Re as E,Fe as F,A as G,w as H,Te as I,re as J,j as K,De as L,Ae as M,Ce as N,ze as O,we as P,O as Q,be as R,qe as S,Ve as T,T as U,J as V,ne as W,R as X,k as Y,S as Z,st as _,Bt as a,it as b,Mt as c,jt as d,P as et,St as f,dt as g,pt as h,Qt as i,v as it,Ee as j,Ie as k,Nt as l,wt as m,Wn as n,D as nt,zt as o,yt as p,M as q,Un as r,_ as rt,At as s,Hn as t,E as tt,Rt as u,nt as v,Ue as w,Ye as x,at as y,ue as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.