@depay/widgets 7.14.1 → 7.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,7 +116,7 @@ var r=n(19),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n
116
116
  * @author Chen, Yi-Cyuan [emn178@gmail.com]
117
117
  * @copyright Chen, Yi-Cyuan 2015-2018
118
118
  * @license MIT
119
- */var sha3=createCommonjsModule$1((function(t){!function(){var e="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=commonjsGlobal$1:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&t.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],l=[0,8,16,24],c=[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],h=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var g=function(t,e,n){return function(r){return new N(t,e,t).update(r)[n]()}},m=function(t,e,n){return function(r,i){return new N(t,e,i).update(r)[n]()}},y=function(t,e,n){return function(e,r,i,o){return _["cshake"+t].update(e,r,i,o)[n]()}},v=function(t,e,n){return function(e,r,i,o){return _["kmac"+t].update(e,r,i,o)[n]()}},b=function(t,e,n,r){for(var i=0;i<d.length;++i){var o=d[i];t[o]=e(n,r,o)}return t},w=function(t,e){var n=g(t,e,"hex");return n.create=function(){return new N(t,e,t)},n.update=function(t){return n.create().update(t)},b(n,g,t,e)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(t,e){var n=m(t,e,"hex");return n.create=function(n){return new N(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},b(n,m,t,e)}},{name:"cshake",padding:u,bits:f,createMethod:function(t,e){var n=p[t],r=y(t,0,"hex");return r.create=function(r,i,o){return i||o?new N(t,e,r).bytepad([i,o],n):_["shake"+t].create(r)},r.update=function(t,e,n,i){return r.create(e,n,i).update(t)},b(r,y,t,e)}},{name:"kmac",padding:u,bits:f,createMethod:function(t,e){var n=p[t],r=v(t,0,"hex");return r.create=function(r,i,o){return new B(t,e,i).bytepad(["KMAC",o],n).bytepad([r],n)},r.update=function(t,e,n,i){return r.create(t,n,i).update(e)},b(r,v,t,e)}}],_={},E=[],k=0;k<A.length;++k)for(var M=A[k],S=M.bits,x=0;x<S.length;++x){var C=M.name+"_"+S[x];if(E.push(C),_[C]=M.createMethod(S[x],M.padding),"sha3"!==M.name){var T=M.name+S[x];E.push(T),_[T]=_[C]}}function N(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function B(t,e,n){N.call(this,t,e,n)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,c=t.length,h=this.blockCount,f=0,d=this.s;f<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<h+1;++i)s[i]=0;if(n)for(i=this.start;f<c&&i<u;++f)s[i>>2]|=t[f]<<l[3&i++];else for(i=this.start;f<c&&i<u;++f)(o=t.charCodeAt(f))<128?s[i>>2]|=o<<l[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<l[3&i++],s[i>>2]|=(128|o>>6&63)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),s[i>>2]|=(240|o>>18)<<l[3&i++],s[i>>2]|=(128|o>>12&63)<<l[3&i++],s[i>>2]|=(128|o>>6&63)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=s[h],i=0;i<h;++i)d[i]^=s[i];$(d),this.reset=!0}else this.start=i}return this},N.prototype.encode=function(t,e){var n=255&t,r=1,i=[n];for(n=255&(t>>=8);n>0;)i.unshift(n),n=255&(t>>=8),++r;return e?i.push(r):i.unshift(r),this.update(i),i.length},N.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},N.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r<t.length;++r)n+=this.encodeString(t[r]);var i=e-n%e,o=[];return o.length=i,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];$(r)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,u="";a<r;){for(o=0;o<e&&a<r;++o,++a)t=n[o],u+=s[t>>4&15]+s[15&t]+s[t>>12&15]+s[t>>8&15]+s[t>>20&15]+s[t>>16&15]+s[t>>28&15]+s[t>>24&15];a%e==0&&($(n),o=0)}return i&&(t=n[o],u+=s[t>>4&15]+s[15&t],i>1&&(u+=s[t>>12&15]+s[t>>8&15]),i>2&&(u+=s[t>>20&15]+s[t>>16&15])),u},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a<r;){for(o=0;o<e&&a<r;++o,++a)u[a]=n[o];a%e==0&&$(n)}return i&&(u[o]=n[o],t=t.slice(0,s)),t},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<n&&s<i;++a,++s)t=s<<2,e=r[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%n==0&&$(r)}return o&&(t=s<<2,e=r[a],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},B.prototype=new N,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var $=function(t){var e,n,r,i,o,a,s,u,l,h,f,d,p,g,m,y,v,b,w,A,_,E,k,M,S,x,C,T,N,B,$,P,I,R,O,L,D,F,j,U,H,z,G,Q,W,q,Y,V,K,J,Z,X,tt,et,nt,rt,it,ot,at,st,ut,lt,ct;for(r=0;r<48;r+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),n=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(u<<1|l>>>31),n=o^(l<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=a^(h<<1|f>>>31),n=s^(f<<1|h>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(d<<1|p>>>31),n=l^(p<<1|d>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=h^(i<<1|o>>>31),n=f^(o<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,g=t[0],m=t[1],q=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,R=t[2]<<1|t[3]>>>31,O=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,K=t[23]<<10|t[22]>>>22,B=t[33]<<13|t[32]>>>19,$=t[32]<<13|t[33]>>>19,lt=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,I=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,Q=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,U=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=g^~y&b,t[1]=m^~v&w,t[10]=M^~x&T,t[11]=S^~C&N,t[20]=R^~L&F,t[21]=O^~D&j,t[30]=Q^~q&V,t[31]=W^~Y&K,t[40]=et^~rt&ot,t[41]=nt^~it&at,t[2]=y^~b&A,t[3]=v^~w&_,t[12]=x^~T&B,t[13]=C^~N&$,t[22]=L^~F&U,t[23]=D^~j&H,t[32]=q^~V&J,t[33]=Y^~K&Z,t[42]=rt^~ot&st,t[43]=it^~at&ut,t[4]=b^~A&E,t[5]=w^~_&k,t[14]=T^~B&P,t[15]=N^~$&I,t[24]=F^~U&z,t[25]=j^~H&G,t[34]=V^~J&X,t[35]=K^~Z&tt,t[44]=ot^~st&lt,t[45]=at^~ut&ct,t[6]=A^~E&g,t[7]=_^~k&m,t[16]=B^~P&M,t[17]=$^~I&S,t[26]=U^~z&R,t[27]=H^~G&O,t[36]=J^~X&Q,t[37]=Z^~tt&W,t[46]=st^~lt&et,t[47]=ut^~ct&nt,t[8]=E^~g&y,t[9]=k^~m&v,t[18]=P^~M&x,t[19]=I^~S&C,t[28]=z^~R&L,t[29]=G^~O&D,t[38]=X^~Q&q,t[39]=tt^~W&Y,t[48]=lt^~et&rt,t[49]=ct^~nt&it,t[0]^=c[r],t[1]^=c[r+1]};if(o)t.exports=_;else for(k=0;k<E.length;++k)r[E[k]]=_[E[k]]}()})),sha3$1=sha3;function keccak256(t){return"0x"+sha3$1.keccak_256(arrayify$1(t))}const version$d="rlp/5.6.1",logger$j=new Logger$1(version$d);function arrayifyInteger(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function unarrayifyInteger(t,e,n){let r=0;for(let i=0;i<n;i++)r=256*r+t[e+i];return r}function _encode(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(_encode(t))})),e.length<=55)return e.unshift(192+e.length),e;const n=arrayifyInteger(e.length);return n.unshift(247+n.length),n.concat(e)}isBytesLike(t)||logger$j.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(arrayify$1(t));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=arrayifyInteger(e.length);return n.unshift(183+n.length),n.concat(e)}function encode$2(t){return hexlify$1(_encode(t))}function _decodeChildren(t,e,n,r){const i=[];for(;n<e+1+r;){const o=_decode(t,n);i.push(o.result),(n+=o.consumed)>e+1+r&&logger$j.throwError("child data too short",Logger$1.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function _decode(t,e){if(0===t.length&&logger$j.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{}),t[e]>=248){const n=t[e]-247;e+1+n>t.length&&logger$j.throwError("data short segment too short",Logger$1.errors.BUFFER_OVERRUN,{});const r=unarrayifyInteger(t,e+1,n);return e+1+n+r>t.length&&logger$j.throwError("data long segment too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,e,e+1+n,n+r)}if(t[e]>=192){const n=t[e]-192;return e+1+n>t.length&&logger$j.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;e+1+n>t.length&&logger$j.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const r=unarrayifyInteger(t,e+1,n);e+1+n+r>t.length&&logger$j.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:hexlify$1(t.slice(e+1+n,e+1+n+r))}}if(t[e]>=128){const n=t[e]-128;e+1+n>t.length&&logger$j.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:hexlify$1(t.slice(e+1,e+1+n))}}return{consumed:1,result:hexlify$1(t[e])}}function decode$2(t){const e=arrayify$1(t),n=_decode(e,0);return n.consumed!==e.length&&logger$j.throwArgumentError("invalid rlp data","data",t),n.result}const version$c="address/5.6.1",logger$i=new Logger$1(version$c);function getChecksumAddress(t){isHexString$1(t,20)||logger$i.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=arrayify$1(keccak256(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const MAX_SAFE_INTEGER$1=9007199254740991;function log10$1(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const ibanLookup={};for(let t=0;t<10;t++)ibanLookup[String(t)]=String(t);for(let t=0;t<26;t++)ibanLookup[String.fromCharCode(65+t)]=String(10+t);const safeDigits=Math.floor(log10$1(MAX_SAFE_INTEGER$1));function ibanChecksum(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>ibanLookup[t])).join("");for(;e.length>=safeDigits;){let t=e.substring(0,safeDigits);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}function getAddress(t){let e=null;if("string"!=typeof t&&logger$i.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=getChecksumAddress(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&logger$i.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ibanChecksum(t)&&logger$i.throwArgumentError("bad icap checksum","address",t),e=_base36To16(t.substring(4));e.length<40;)e="0"+e;e=getChecksumAddress("0x"+e)}else logger$i.throwArgumentError("invalid address","address",t);return e}function getContractAddress(t){let e=null;try{e=getAddress(t.from)}catch(e){logger$i.throwArgumentError("missing from address","transaction",t)}return getAddress(hexDataSlice(keccak256(encode$2([e,stripZeros(arrayify$1(BigNumber$1.from(t.nonce).toHexString()))])),12))}class AddressCoder extends Coder{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=getAddress(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return getAddress(hexZeroPad$1(t.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const logger$h=new Logger$1(version$e);function pack(t,e,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return r||logger$h.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]&&logger$h.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]=!0,n[r]}))}else logger$h.throwArgumentError("invalid tuple value","tuple",n);e.length!==r.length&&logger$h.throwArgumentError("types/value length mismatch","tuple",n);let i=new Writer(t.wordSize),o=new Writer(t.wordSize),a=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=o.length;t.encode(o,n);let r=i.writeUpdatableValue();a.push((t=>{r(t+e)}))}else t.encode(i,n)})),a.forEach((t=>{t(i.length)}));let s=t.appendWriter(i);return s+=t.appendWriter(o),s}function unpack(t,e){let n=[],r=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let n=t.readValue(),o=r.subReader(n.toNumber());try{i=e.decode(o)}catch(t){if(t.code===Logger$1.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===Logger$1.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&n.push(i)}));const i=e.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});e.forEach(((t,e)=>{let r=t.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[e];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let t=0;t<n.length;t++){const e=n[t];e instanceof Error&&Object.defineProperty(n,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(n)}class ArrayCoder extends Coder{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let n=this.length;-1===n&&(n=e.length,t.writeValue(e.length)),logger$h.checkArgumentCount(e.length,n,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let t=0;t<e.length;t++)r.push(this.coder);return pack(t,r,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&logger$h.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let t=0;t<e;t++)n.push(new AnonymousCoder(this.coder));return t.coerce(this.name,unpack(t,n))}}class BooleanCoder extends Coder{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=arrayify$1(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,hexlify$1(super.decode(t)))}}class FixedBytesCoder extends Coder{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=arrayify$1(e);return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return t.coerce(this.name,hexlify$1(t.readBytes(this.size)))}}class NullCoder extends Coder{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber$1.from(-1),Zero$1=BigNumber$1.from(0),One$1=BigNumber$1.from(1),MaxUint256$1=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000";class NumberCoder extends Coder{constructor(t,e,n){const r=(e?"int":"uint")+8*t;super(r,r,n,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let n=BigNumber$1.from(e),r=MaxUint256$1.mask(8*t.wordSize);if(this.signed){let t=r.mask(8*this.size-1);(n.gt(t)||n.lt(t.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",e)}else(n.lt(Zero$1)||n.gt(r.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}const version$b="strings/5.6.1",logger$g=new Logger$1(version$b);var UnicodeNormalizationForm,Utf8ErrorReason;function errorFunc(t,e,n,r,i){return logger$g.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function ignoreFunc(t,e,n,r,i){if(t===Utf8ErrorReason.BAD_PREFIX||t===Utf8ErrorReason.UNEXPECTED_CONTINUE){let t=0;for(let r=e+1;r<n.length&&n[r]>>6==2;r++)t++;return t}return t===Utf8ErrorReason.OVERRUN?n.length-e-1:0}function replaceFunc(t,e,n,r,i){return t===Utf8ErrorReason.OVERLONG?(r.push(i),0):(r.push(65533),ignoreFunc(t,e,n))}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(UnicodeNormalizationForm||(UnicodeNormalizationForm={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Utf8ErrorReason||(Utf8ErrorReason={}));const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(t,e){null==e&&(e=Utf8ErrorFuncs.error),t=arrayify$1(t);const n=[];let r=0;for(;r<t.length;){const i=t[r++];if(i>>7==0){n.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){r+=e(128==(192&i)?Utf8ErrorReason.UNEXPECTED_CONTINUE:Utf8ErrorReason.BAD_PREFIX,r-1,t,n);continue}o=3,a=65535}if(r-1+o>=t.length){r+=e(Utf8ErrorReason.OVERRUN,r-1,t,n);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=t[r];if(128!=(192&i)){r+=e(Utf8ErrorReason.MISSING_CONTINUE,r,t,n),s=null;break}s=s<<6|63&i,r++}null!==s&&(s>1114111?r+=e(Utf8ErrorReason.OUT_OF_RANGE,r-1-o,t,n,s):s>=55296&&s<=57343?r+=e(Utf8ErrorReason.UTF16_SURROGATE,r-1-o,t,n,s):s<=a?r+=e(Utf8ErrorReason.OVERLONG,r-1-o,t,n,s):n.push(s))}return n}function toUtf8Bytes(t,e=UnicodeNormalizationForm.current){e!=UnicodeNormalizationForm.current&&(logger$g.checkNormalize(),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return arrayify$1(n)}function _toUtf8String(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function toUtf8String(t,e){return _toUtf8String(getUtf8CodePoints(t,e))}function toUtf8CodePoints(t,e=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(t,e))}function bytes2(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let n=0;n<t.length;n+=4)e.push(parseInt(t.substring(n,n+4),16));return e}function createTable(t,e){e||(e=function(t){return[parseInt(t,16)]});let n=0,r={};return t.split(",").forEach((t=>{let i=t.split(":");n+=parseInt(i[0],16),r[n]=e(i[1])})),r}function createRangeTable(t){let e=0;return t.split(",").map((t=>{let n=t.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:r,h:e}}))}function matchMap(t,e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(n+=i.l,t>=n&&t<=n+i.h&&(t-n)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-n))continue;return i}}return null}const Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2),Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten(t){return t.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[])}function _nameprepTableA1(t){return!!matchMap(t,Table_A_1_ranges)}function _nameprepTableB2(t){let e=matchMap(t,Table_B_2_ranges);if(e)return[t+e.s];let n=Table_B_2_lut_abs[t];if(n)return n;let r=Table_B_2_lut_rel[t];if(r)return[t+r[0]];let i=Table_B_2_complex[t];return i||null}function _nameprepTableC(t){return!!matchMap(t,Table_C_ranges)}function nameprep(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=toUtf8CodePoints(t);e=flatten(e.map((t=>{if(Table_B_1_flags.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=_nameprepTableB2(t);return e||[t]}))),e=toUtf8CodePoints(_toUtf8String(e),UnicodeNormalizationForm.NFKC),e.forEach((t=>{if(_nameprepTableC(t))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(_nameprepTableA1(t))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=_toUtf8String(e);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}class StringCoder extends DynamicBytesCoder{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,toUtf8Bytes(e))}decode(t){return toUtf8String(super.decode(t))}}class TupleCoder extends Coder{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)}));super("tuple","tuple("+r.join(",")+")",e,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){return pack(t,this.coders,e)}decode(t){return t.coerce(this.name,unpack(t,this.coders))}}const logger$f=new Logger$1(version$e),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(t){defineReadOnly(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new AddressCoder(t.name);case"bool":return new BooleanCoder(t.name);case"string":return new StringCoder(t.name);case"bytes":return new BytesCoder(t.name);case"array":return new ArrayCoder(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new TupleCoder((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new NullCoder(t.name)}let e=t.type.match(paramTypeNumber);if(e){let n=parseInt(e[2]||"256");return(0===n||n>256||n%8!=0)&&logger$f.throwArgumentError("invalid "+e[1]+" bit length","param",t),new NumberCoder(n/8,"int"===e[1],t.name)}if(e=t.type.match(paramTypeBytes),e){let n=parseInt(e[1]);return(0===n||n>32)&&logger$f.throwArgumentError("invalid bytes length","param",t),new FixedBytesCoder(n,t.name)}return logger$f.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new Reader(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(ParamType.from(t))));return new TupleCoder(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&logger$f.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map((t=>this._getCoder(ParamType.from(t)))),r=new TupleCoder(n,"_"),i=this._getWriter();return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>this._getCoder(ParamType.from(t))));return new TupleCoder(r,"_").decode(this._getReader(arrayify$1(e),n))}}const defaultAbiCoder=new AbiCoder;function id(t){return keccak256(toUtf8Bytes(t))}const version$a="hash/5.6.1",logger$e=new Logger$1(version$a),Zeros=new Uint8Array(32);Zeros.fill(0);const Partition=new RegExp("^((.*)\\.)?([^.]+)$");function namehash(t){"string"!=typeof t&&logger$e.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,n=Zeros;for(;e.length;){const r=e.match(Partition);null!=r&&""!==r[2]||logger$e.throwArgumentError("invalid ENS address; missing component","name",t);n=keccak256(concat([n,keccak256(toUtf8Bytes(nameprep(r[3])))])),e=r[2]||""}return hexlify$1(n)}function dnsEncode(t){return hexlify$1(concat(t.split(".").map((t=>{const e=toUtf8Bytes("_"+nameprep(t));return e[0]=e.length-1,e}))))+"00"}var __awaiter$7=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$d=new Logger$1(version$a),padding=new Uint8Array(32);padding.fill(0);const NegativeOne$3=BigNumber$1.from(-1),Zero$3=BigNumber$1.from(0),One=BigNumber$1.from(1),MaxUint256=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(t){const e=arrayify$1(t),n=e.length%32;return n?hexConcat([e,padding.slice(n)]):hexlify$1(e)}const hexTrue=hexZeroPad$1(One.toHexString(),32),hexFalse=hexZeroPad$1(Zero$3.toHexString(),32),domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(t){return function(e){return"string"!=typeof e&&logger$d.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(t){try{return BigNumber$1.from(t).toString()}catch(t){}return logger$d.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return getAddress(t).toLowerCase()}catch(t){}return logger$d.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=arrayify$1(t);if(32!==e.length)throw new Error("bad length");return hexlify$1(e)}catch(t){}return logger$d.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function getBaseEncoder(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=""===e[1],r=parseInt(e[2]||"256");(r%8!=0||r>256||e[2]&&e[2]!==String(r))&&logger$d.throwArgumentError("invalid numeric width","type",t);const i=MaxUint256.mask(n?r-1:r),o=n?i.add(One).mul(NegativeOne$3):Zero$3;return function(e){const n=BigNumber$1.from(e);return(n.lt(o)||n.gt(i))&&logger$d.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),hexZeroPad$1(n.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return(0===n||n>32||e[1]!==String(n))&&logger$d.throwArgumentError("invalid bytes width","type",t),function(e){return arrayify$1(e).length!==n&&logger$d.throwArgumentError(`invalid length for ${t}`,"value",e),hexPadRight(e)}}}switch(t){case"address":return function(t){return hexZeroPad$1(getAddress(t),32)};case"bool":return function(t){return t?hexTrue:hexFalse};case"bytes":return function(t){return keccak256(t)};case"string":return function(t){return id(t)}}return null}function encodeType(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class TypedDataEncoder{constructor(t){defineReadOnly(this,"types",Object.freeze(deepCopy(t))),defineReadOnly(this,"_encoderCache",{}),defineReadOnly(this,"_types",{});const e={},n={},r={};Object.keys(t).forEach((t=>{e[t]={},n[t]=[],r[t]={}}));for(const r in t){const i={};t[r].forEach((o=>{i[o.name]&&logger$d.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",t),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&logger$d.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",t);getBaseEncoder(a)||(n[a]||logger$d.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",t),n[a].push(r),e[r][a]=!0)}))}const i=Object.keys(n).filter((t=>0===n[t].length));0===i.length?logger$d.throwArgumentError("missing primary type","types",t):i.length>1&&logger$d.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),defineReadOnly(this,"primaryType",i[0]),function i(o,a){a[o]&&logger$d.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),a[o]=!0,Object.keys(e[o]).forEach((t=>{n[t]&&(i(t,a),Object.keys(a).forEach((e=>{r[e][t]=!0})))})),delete a[o]}(this.primaryType,{});for(const e in r){const n=Object.keys(r[e]);n.sort(),this._types[e]=encodeType(e,t[e])+n.map((e=>encodeType(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=getBaseEncoder(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],n=this.getEncoder(t),r=parseInt(e[3]);return e=>{r>=0&&e.length!==r&&logger$d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(n);return this._types[t]&&(i=i.map(keccak256)),keccak256(hexConcat(i))}}const n=this.types[t];if(n){const e=id(this._types[t]);return t=>{const r=n.map((({name:e,type:n})=>{const r=this.getEncoder(n)(t[e]);return this._types[n]?keccak256(r):r}));return r.unshift(e),hexConcat(r)}}return logger$d.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||logger$d.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return keccak256(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(getBaseEncoder(t))return n(t,e);const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],i=parseInt(r[3]);return i>=0&&e.length!==i&&logger$d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,n)))}const i=this.types[t];return i?i.reduce(((t,{name:r,type:i})=>(t[r]=this._visit(i,e[r],n),t)),{}):logger$d.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new TypedDataEncoder(t)}static getPrimaryType(t){return TypedDataEncoder.from(t).primaryType}static hashStruct(t,e,n){return TypedDataEncoder.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const r=domainFieldTypes[n];r||logger$d.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:r})}return e.sort(((t,e)=>domainFieldNames.indexOf(t.name)-domainFieldNames.indexOf(e.name))),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return hexConcat(["0x1901",TypedDataEncoder.hashDomain(t),TypedDataEncoder.from(e).hash(n)])}static hash(t,e,n){return keccak256(TypedDataEncoder.encode(t,e,n))}static resolveNames(t,e,n,r){return __awaiter$7(this,void 0,void 0,(function*(){t=shallowCopy(t);const i={};t.verifyingContract&&!isHexString$1(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=TypedDataEncoder.from(e);o.visit(n,((t,e)=>("address"!==t||isHexString$1(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield r(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=o.visit(n,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:n}}))}static getPayload(t,e,n){TypedDataEncoder.hashDomain(t);const r={},i=[];domainFieldNames.forEach((e=>{const n=t[e];null!=n&&(r[e]=domainChecks[e](n),i.push({name:e,type:domainFieldTypes[e]}))}));const o=TypedDataEncoder.from(e),a=shallowCopy(e);return a.EIP712Domain?logger$d.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):a.EIP712Domain=i,o.encode(n),{types:a,domain:r,primaryType:o.primaryType,message:o.visit(n,((t,e)=>{if(t.match(/^bytes(\d*)/))return hexlify$1(arrayify$1(e));if(t.match(/^u?int/))return BigNumber$1.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&logger$d.throwArgumentError("invalid string","value",e),e}return logger$d.throwArgumentError("unsupported type","type",t)}))}}}const logger$c=new Logger$1(version$e);class LogDescription extends Description{}class TransactionDescription extends Description{}class ErrorDescription extends Description{}class Indexed extends Description{static isIndexed(t){return!(!t||!t._isIndexed)}}const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return n.error=e,n}class Interface{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,defineReadOnly(this,"fragments",e.map((t=>Fragment.from(t))).filter((t=>null!=t))),defineReadOnly(this,"_abiCoder",getStatic(new.target,"getAbiCoder")()),defineReadOnly(this,"functions",{}),defineReadOnly(this,"errors",{}),defineReadOnly(this,"events",{}),defineReadOnly(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void logger$c.warn("duplicate definition - constructor"):void defineReadOnly(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let n=t.format();e[n]?logger$c.warn("duplicate definition - "+n):e[n]=t})),this.deploy||defineReadOnly(this,"deploy",ConstructorFragment.from({payable:!1,type:"constructor"})),defineReadOnly(this,"_isInterface",!0)}format(t){t||(t=FormatTypes.full),t===FormatTypes.sighash&&logger$c.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===FormatTypes.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return defaultAbiCoder}static getAddress(t){return getAddress(t)}static getSighash(t){return hexDataSlice(id(t.format()),0,4)}static getEventTopic(t){return id(t.format())}getFunction(t){if(isHexString$1(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];logger$c.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===n.length?logger$c.throwArgumentError("no matching function","name",e):n.length>1&&logger$c.throwArgumentError("multiple matching functions","name",e),this.functions[n[0]]}const e=this.functions[FunctionFragment.fromString(t).format()];return e||logger$c.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(isHexString$1(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];logger$c.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===n.length?logger$c.throwArgumentError("no matching event","name",e):n.length>1&&logger$c.throwArgumentError("multiple matching events","name",e),this.events[n[0]]}const e=this.events[EventFragment.fromString(t).format()];return e||logger$c.throwArgumentError("no matching event","signature",t),e}getError(t){if(isHexString$1(t)){const e=getStatic(this.constructor,"getSighash");for(const n in this.errors){if(t===e(this.errors[n]))return this.errors[n]}logger$c.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===n.length?logger$c.throwArgumentError("no matching error","name",e):n.length>1&&logger$c.throwArgumentError("multiple matching errors","name",e),this.errors[n[0]]}const e=this.errors[FunctionFragment.fromString(t).format()];return e||logger$c.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return getStatic(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),getStatic(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const n=arrayify$1(e);return hexlify$1(n.slice(0,4))!==this.getSighash(t)&&logger$c.throwArgumentError(`data signature does not match error ${t.name}.`,"data",hexlify$1(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),hexlify$1(concat([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const n=arrayify$1(e);return hexlify$1(n.slice(0,4))!==this.getSighash(t)&&logger$c.throwArgumentError(`data signature does not match function ${t.name}.`,"data",hexlify$1(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),hexlify$1(concat([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let n=arrayify$1(e),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch(t){}break;case 4:{const t=hexlify$1(n.slice(0,4)),e=BuiltinErrors[t];if(e)o=this._abiCoder.decode(e.inputs,n.slice(4)),a=e.name,s=e.signature,e.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const e=this.getError(t);o=this._abiCoder.decode(e.inputs,n.slice(4)),a=e.name,s=e.format()}catch(t){}break}}return logger$c.throwError("call revert exception"+i,Logger$1.errors.CALL_EXCEPTION,{method:t.format(),data:hexlify$1(e),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),hexlify$1(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&logger$c.throwError("too many arguments for "+t.format(),Logger$1.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const r=(t,e)=>"string"===t.type?id(e):"bytes"===t.type?keccak256(hexlify$1(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),hexZeroPad$1(hexlify$1(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?logger$c.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((t=>r(o,t)))):n.push(r(o,e)):null!=e&&logger$c.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const n=[],r=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&logger$c.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const a=e[o];if(t.indexed)if("string"===t.type)n.push(id(a));else if("bytes"===t.type)n.push(keccak256(a));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([t.type],[a]))}else r.push(t),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);isHexString$1(n[0],32)&&n[0].toLowerCase()===e||logger$c.throwError("fragment/topic mismatch",Logger$1.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(ParamType.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(r.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,concat(n)):null,s=this._abiCoder.decode(i,e,!0),u=[],l=0,c=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==a)u[e]=new Indexed({_isIndexed:!0,hash:null});else if(o[e])u[e]=new Indexed({_isIndexed:!0,hash:a[c++]});else try{u[e]=a[c++]}catch(t){u[e]=t}else try{u[e]=s[l++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const n=u[e];n instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw wrapAccessError(`property ${JSON.stringify(t.name)}`,n)}}):u[t.name]=n}}));for(let t=0;t<u.length;t++){const e=u[t];e instanceof Error&&Object.defineProperty(u,t,{enumerable:!0,get:()=>{throw wrapAccessError(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new TransactionDescription({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:BigNumber$1.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new LogDescription({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=hexlify$1(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new ErrorDescription({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!(!t||!t._isInterface)}}const version$9="abstract-provider/5.6.1";var __awaiter$6=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$b=new Logger$1(version$9);class ForkEvent extends Description{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class Provider{constructor(){logger$b.checkAbstract(new.target,Provider),defineReadOnly(this,"_isProvider",!0)}getFeeData(){return __awaiter$6(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield resolveProperties({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let n=null,r=null;return t&&t.baseFeePerGas&&(r=BigNumber$1.from("1500000000"),n=t.baseFeePerGas.mul(2).add(r)),{maxFeePerGas:n,maxPriorityFeePerGas:r,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}const version$8="abstract-signer/5.6.2";var __awaiter$5=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$a=new Logger$1(version$8),allowedTransactionKeys$1=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors=[Logger$1.errors.INSUFFICIENT_FUNDS,Logger$1.errors.NONCE_EXPIRED,Logger$1.errors.REPLACEMENT_UNDERPRICED];class Signer{constructor(){logger$a.checkAbstract(new.target,Signer),defineReadOnly(this,"_isSigner",!0)}getBalance(t){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield resolveProperties(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield resolveProperties(this.checkTransaction(t));return yield this.provider.call(n,e)}))}sendTransaction(t){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)}))}getChainId(){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===allowedTransactionKeys$1.indexOf(e)&&logger$a.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=shallowCopy(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&logger$a.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return __awaiter$5(this,void 0,void 0,(function*(){const e=yield resolveProperties(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>__awaiter$5(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&logger$a.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const n=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!n?0!==e.type&&1!==e.type||!n||logger$a.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):logger$a.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(n&&logger$a.throwError("network does not support EIP-1559",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):logger$a.throwError("failed to get consistent fee data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(forwardErrors.indexOf(t.code)>=0)throw t;return logger$a.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&logger$a.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield resolveProperties(e)}))}_checkProvider(t){this.provider||logger$a.throwError("missing provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class VoidSigner extends Signer{constructor(t,e){super(),defineReadOnly(this,"address",t),defineReadOnly(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{logger$a.throwError(t,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new VoidSigner(this.address,t)}}var bn$2=createCommonjsModule$1((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:buffer.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var l=t.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,l=0,c=n;c<s;c+=r)l=u(t,c,c+r,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var h=1;for(l=u(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){l(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var c=u>>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,l=0,c=0|a[0],h=8191&c,f=c>>>13,d=0|a[1],p=8191&d,g=d>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],E=8191&_,k=_>>>13,M=0|a[5],S=8191&M,x=M>>>13,C=0|a[6],T=8191&C,N=C>>>13,B=0|a[7],$=8191&B,P=B>>>13,I=0|a[8],R=8191&I,O=I>>>13,L=0|a[9],D=8191&L,F=L>>>13,j=0|s[0],U=8191&j,H=j>>>13,z=0|s[1],G=8191&z,Q=z>>>13,W=0|s[2],q=8191&W,Y=W>>>13,V=0|s[3],K=8191&V,J=V>>>13,Z=0|s[4],X=8191&Z,tt=Z>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,lt=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(l+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,U)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(g,U)|0,o=Math.imul(g,H);var yt=(l+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,G)|0))<<13)|0;l=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,U),i=(i=Math.imul(y,H))+Math.imul(v,U)|0,o=Math.imul(v,H),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,Q)|0;var vt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,U),i=(i=Math.imul(w,H))+Math.imul(A,U)|0,o=Math.imul(A,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,Y)|0;var bt=(l+(r=r+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,K)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,U),i=(i=Math.imul(E,H))+Math.imul(k,U)|0,o=Math.imul(k,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Q)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,J)|0;var wt=(l+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,U),i=(i=Math.imul(S,H))+Math.imul(x,U)|0,o=Math.imul(x,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,K)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,U),i=(i=Math.imul(T,H))+Math.imul(N,U)|0,o=Math.imul(N,H),r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,J)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul($,U),i=(i=Math.imul($,H))+Math.imul(P,U)|0,o=Math.imul(P,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Q)|0,r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,H))+Math.imul(O,U)|0,o=Math.imul(O,H),r=r+Math.imul($,G)|0,i=(i=i+Math.imul($,Q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(S,K)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,lt)|0;var kt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,U),i=(i=Math.imul(D,H))+Math.imul(F,U)|0,o=Math.imul(F,H),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul($,q)|0,i=(i=i+Math.imul($,Y)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,Y)|0,r=r+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var Mt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Q))+Math.imul(F,G)|0,o=Math.imul(F,Q),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul($,K)|0,i=(i=i+Math.imul($,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(T,X)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(S,nt)|0,i=(i=i+Math.imul(S,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var St=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;l=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,Y))+Math.imul(F,q)|0,o=Math.imul(F,Y),r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul($,X)|0,i=(i=i+Math.imul($,tt)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var xt=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,gt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(D,K),i=(i=Math.imul(D,J))+Math.imul(F,K)|0,o=Math.imul(F,J),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul($,nt)|0,i=(i=i+Math.imul($,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul($,ot)|0,i=(i=i+Math.imul($,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,lt)|0,r=r+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(k,pt)|0))<<13)|0;l=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,nt),i=(i=Math.imul(D,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul($,ut)|0,i=(i=i+Math.imul($,lt)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ft)|0;var Nt=(l+(r=r+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(x,pt)|0))<<13)|0;l=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,lt)|0,r=r+Math.imul($,ht)|0,i=(i=i+Math.imul($,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Bt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(N,pt)|0))<<13)|0;l=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(D,ut),i=(i=Math.imul(D,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var $t=(l+(r=r+Math.imul($,pt)|0)|0)+((8191&(i=(i=i+Math.imul($,gt)|0)+Math.imul(P,pt)|0))<<13)|0;l=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(D,ht),i=(i=Math.imul(D,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Pt=(l+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(O,pt)|0))<<13)|0;l=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var It=(l+(r=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,gt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=kt,u[9]=Mt,u[10]=St,u[11]=xt,u[12]=Ct,u[13]=Tt,u[14]=Nt,u[15]=Bt,u[16]=$t,u[17]=Pt,u[18]=It,0!==l&&(u[19]=l,n.length++),n};function m(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var c=o-l,h=(0|t.words[c])*(0|e.words[l]),f=67108863&h;s=67108863&(f=f+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return m(t,e,n)}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):n<63?p(this,t,e):n<1024?m(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=r.clone()._ishlnsubmul(o,1,u);0===c.negative&&(r=c,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new k(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(A,b),r(_,b),r(E,b),E.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=a;0!==d.cmp(s);){for(var g=d,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(y),h=y.redSqr(),d=d.redMul(h),p=m}return f},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},r(M,k),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),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)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,commonjsGlobal$1)})),minimalisticAssert$1=assert$6;function assert$6(t,e){if(!t)throw new Error(e||"Assertion failed")}assert$6.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var inherits_browser$1=createCommonjsModule$1((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),inherits=createCommonjsModule$1((function(t){try{var e=util;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=inherits_browser$1}})),inherits_1=inherits;function isSurrogatePair(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function toArray(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)n.push(parseInt(t[i]+t[i+1],16))}else for(var r=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):isSurrogatePair(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<t.length;i++)n[i]=0|t[i];return n}var toArray_1=toArray;function toHex$2(t){for(var e="",n=0;n<t.length;n++)e+=zero2(t[n].toString(16));return e}var toHex_1=toHex$2;function htonl(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}var htonl_1=htonl;function toHex32(t,e){for(var n="",r=0;r<t.length;r++){var i=t[r];"little"===e&&(i=htonl(i)),n+=zero8(i.toString(16))}return n}var toHex32_1=toHex32;function zero2(t){return 1===t.length?"0"+t:t}var zero2_1=zero2;function zero8(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}var zero8_1=zero8;function join32(t,e,n,r){var i=n-e;minimalisticAssert$1(i%4==0);for(var o=new Array(i/4),a=0,s=e;a<o.length;a++,s+=4){var u;u="big"===r?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],o[a]=u>>>0}return o}var join32_1=join32;function split32(t,e){for(var n=new Array(4*t.length),r=0,i=0;r<t.length;r++,i+=4){var o=t[r];"big"===e?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n}var split32_1=split32;function rotr32$1(t,e){return t>>>e|t<<32-e}var rotr32_1=rotr32$1;function rotl32$2(t,e){return t<<e|t>>>32-e}var rotl32_1=rotl32$2;function sum32$3(t,e){return t+e>>>0}var sum32_1=sum32$3;function sum32_3$1(t,e,n){return t+e+n>>>0}var sum32_3_1=sum32_3$1;function sum32_4$2(t,e,n,r){return t+e+n+r>>>0}var sum32_4_1=sum32_4$2;function sum32_5$2(t,e,n,r,i){return t+e+n+r+i>>>0}var sum32_5_1=sum32_5$2;function sum64$1(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,a=(o<r?1:0)+n+i;t[e]=a>>>0,t[e+1]=o}var sum64_1=sum64$1;function sum64_hi$1(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0}var sum64_hi_1=sum64_hi$1;function sum64_lo$1(t,e,n,r){return e+r>>>0}var sum64_lo_1=sum64_lo$1;function sum64_4_hi$1(t,e,n,r,i,o,a,s){var u=0,l=e;return u+=(l=l+r>>>0)<e?1:0,u+=(l=l+o>>>0)<o?1:0,t+n+i+a+(u+=(l=l+s>>>0)<s?1:0)>>>0}var sum64_4_hi_1=sum64_4_hi$1;function sum64_4_lo$1(t,e,n,r,i,o,a,s){return e+r+o+s>>>0}var sum64_4_lo_1=sum64_4_lo$1;function sum64_5_hi$1(t,e,n,r,i,o,a,s,u,l){var c=0,h=e;return c+=(h=h+r>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+s>>>0)<s?1:0,t+n+i+a+u+(c+=(h=h+l>>>0)<l?1:0)>>>0}var sum64_5_hi_1=sum64_5_hi$1;function sum64_5_lo$1(t,e,n,r,i,o,a,s,u,l){return e+r+o+s+l>>>0}var sum64_5_lo_1=sum64_5_lo$1;function rotr64_hi$1(t,e,n){return(e<<32-n|t>>>n)>>>0}var rotr64_hi_1=rotr64_hi$1;function rotr64_lo$1(t,e,n){return(t<<32-n|e>>>n)>>>0}var rotr64_lo_1=rotr64_lo$1;function shr64_hi$1(t,e,n){return t>>>n}var shr64_hi_1=shr64_hi$1;function shr64_lo$1(t,e,n){return(t<<32-n|e>>>n)>>>0}var shr64_lo_1=shr64_lo$1,utils={inherits:inherits_1,toArray:toArray_1,toHex:toHex_1,htonl:htonl_1,toHex32:toHex32_1,zero2:zero2_1,zero8:zero8_1,join32:join32_1,split32:split32_1,rotr32:rotr32_1,rotl32:rotl32_1,sum32:sum32_1,sum32_3:sum32_3_1,sum32_4:sum32_4_1,sum32_5:sum32_5_1,sum64:sum64_1,sum64_hi:sum64_hi_1,sum64_lo:sum64_lo_1,sum64_4_hi:sum64_4_hi_1,sum64_4_lo:sum64_4_lo_1,sum64_5_hi:sum64_5_hi_1,sum64_5_lo:sum64_5_lo_1,rotr64_hi:rotr64_hi_1,rotr64_lo:rotr64_lo_1,shr64_hi:shr64_hi_1,shr64_lo:shr64_lo_1};function BlockHash$4(){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}var BlockHash_1=BlockHash$4;BlockHash$4.prototype.update=function(t,e){if(t=utils.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=utils.join32(t,0,t.length-n,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},BlockHash$4.prototype.digest=function(t){return this.update(this._pad()),minimalisticAssert$1(null===this.pending),this._digest(t)},BlockHash$4.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=t>>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r};var common$1={BlockHash:BlockHash_1},rotr32=utils.rotr32;function ft_1$1(t,e,n,r){return 0===t?ch32$1(e,n,r):1===t||3===t?p32(e,n,r):2===t?maj32$1(e,n,r):void 0}var ft_1_1=ft_1$1;function ch32$1(t,e,n){return t&e^~t&n}var ch32_1=ch32$1;function maj32$1(t,e,n){return t&e^t&n^e&n}var maj32_1=maj32$1;function p32(t,e,n){return t^e^n}var p32_1=p32;function s0_256$1(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}var s0_256_1=s0_256$1;function s1_256$1(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}var s1_256_1=s1_256$1;function g0_256$1(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}var g0_256_1=g0_256$1;function g1_256$1(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}var g1_256_1=g1_256$1,common={ft_1:ft_1_1,ch32:ch32_1,maj32:maj32_1,p32:p32_1,s0_256:s0_256_1,s1_256:s1_256_1,g0_256:g0_256_1,g1_256:g1_256_1},rotl32$1=utils.rotl32,sum32$2=utils.sum32,sum32_5$1=utils.sum32_5,ft_1=common.ft_1,BlockHash$3=common$1.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=rotl32$1(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),c=sum32_5$1(rotl32$1(i,5),ft_1(l,o,a,s),u,n[r],sha1_K[l]);u=s,s=a,a=rotl32$1(o,30),o=i,i=c}this.h[0]=sum32$2(this.h[0],i),this.h[1]=sum32$2(this.h[1],o),this.h[2]=sum32$2(this.h[2],a),this.h[3]=sum32$2(this.h[3],s),this.h[4]=sum32$2(this.h[4],u)},SHA1.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")};var sum32$1=utils.sum32,sum32_4$1=utils.sum32_4,sum32_5=utils.sum32_5,ch32=common.ch32,maj32=common.maj32,s0_256=common.s0_256,s1_256=common.s1_256,g0_256=common.g0_256,g1_256=common.g1_256,BlockHash$2=common$1.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function SHA256(){if(!(this instanceof SHA256))return new SHA256;BlockHash$2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils.inherits(SHA256,BlockHash$2);var _256=SHA256;function SHA224(){if(!(this instanceof SHA224))return new SHA224;_256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.padLength=64,SHA256.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=sum32_4$1(g1_256(n[r-2]),n[r-7],g0_256(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],l=this.h[5],c=this.h[6],h=this.h[7];for(minimalisticAssert$1(this.k.length===n.length),r=0;r<n.length;r++){var f=sum32_5(h,s1_256(u),ch32(u,l,c),this.k[r],n[r]),d=sum32$1(s0_256(i),maj32(i,o,a));h=c,c=l,l=u,u=sum32$1(s,f),s=a,a=o,o=i,i=sum32$1(f,d)}this.h[0]=sum32$1(this.h[0],i),this.h[1]=sum32$1(this.h[1],o),this.h[2]=sum32$1(this.h[2],a),this.h[3]=sum32$1(this.h[3],s),this.h[4]=sum32$1(this.h[4],u),this.h[5]=sum32$1(this.h[5],l),this.h[6]=sum32$1(this.h[6],c),this.h[7]=sum32$1(this.h[7],h)},SHA256.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")},utils.inherits(SHA224,_256);var _224=SHA224;SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h.slice(0,7),"big"):utils.split32(this.h.slice(0,7),"big")};var rotr64_hi=utils.rotr64_hi,rotr64_lo=utils.rotr64_lo,shr64_hi=utils.shr64_hi,shr64_lo=utils.shr64_lo,sum64=utils.sum64,sum64_hi=utils.sum64_hi,sum64_lo=utils.sum64_lo,sum64_4_hi=utils.sum64_4_hi,sum64_4_lo=utils.sum64_4_lo,sum64_5_hi=utils.sum64_5_hi,sum64_5_lo=utils.sum64_5_lo,BlockHash$1=common$1.BlockHash,sha512_K=[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,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function SHA512(){if(!(this instanceof SHA512))return new SHA512;BlockHash$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}utils.inherits(SHA512,BlockHash$1);var _512=SHA512;function ch64_hi(t,e,n,r,i){var o=t&n^~t&i;return o<0&&(o+=4294967296),o}function ch64_lo(t,e,n,r,i,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function maj64_hi(t,e,n,r,i){var o=t&n^t&i^n&i;return o<0&&(o+=4294967296),o}function maj64_lo(t,e,n,r,i,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function s0_512_hi(t,e){var n=rotr64_hi(t,e,28)^rotr64_hi(e,t,2)^rotr64_hi(e,t,7);return n<0&&(n+=4294967296),n}function s0_512_lo(t,e){var n=rotr64_lo(t,e,28)^rotr64_lo(e,t,2)^rotr64_lo(e,t,7);return n<0&&(n+=4294967296),n}function s1_512_hi(t,e){var n=rotr64_hi(t,e,14)^rotr64_hi(t,e,18)^rotr64_hi(e,t,9);return n<0&&(n+=4294967296),n}function s1_512_lo(t,e){var n=rotr64_lo(t,e,14)^rotr64_lo(t,e,18)^rotr64_lo(e,t,9);return n<0&&(n+=4294967296),n}function g0_512_hi(t,e){var n=rotr64_hi(t,e,1)^rotr64_hi(t,e,8)^shr64_hi(t,e,7);return n<0&&(n+=4294967296),n}function g0_512_lo(t,e){var n=rotr64_lo(t,e,1)^rotr64_lo(t,e,8)^shr64_lo(t,e,7);return n<0&&(n+=4294967296),n}function g1_512_hi(t,e){var n=rotr64_hi(t,e,19)^rotr64_hi(e,t,29)^shr64_hi(t,e,6);return n<0&&(n+=4294967296),n}function g1_512_lo(t,e){var n=rotr64_lo(t,e,19)^rotr64_lo(e,t,29)^shr64_lo(t,e,6);return n<0&&(n+=4294967296),n}function SHA384(){if(!(this instanceof SHA384))return new SHA384;_512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}SHA512.blockSize=1024,SHA512.outSize=512,SHA512.hmacStrength=192,SHA512.padLength=128,SHA512.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var i=g1_512_hi(n[r-4],n[r-3]),o=g1_512_lo(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=g0_512_hi(n[r-30],n[r-29]),l=g0_512_lo(n[r-30],n[r-29]),c=n[r-32],h=n[r-31];n[r]=sum64_4_hi(i,o,a,s,u,l,c,h),n[r+1]=sum64_4_lo(i,o,a,s,u,l,c,h)}},SHA512.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],l=this.h[6],c=this.h[7],h=this.h[8],f=this.h[9],d=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],y=this.h[14],v=this.h[15];minimalisticAssert$1(this.k.length===n.length);for(var b=0;b<n.length;b+=2){var w=y,A=v,_=s1_512_hi(h,f),E=s1_512_lo(h,f),k=ch64_hi(h,f,d,p,g),M=ch64_lo(h,f,d,p,g,m),S=this.k[b],x=this.k[b+1],C=n[b],T=n[b+1],N=sum64_5_hi(w,A,_,E,k,M,S,x,C,T),B=sum64_5_lo(w,A,_,E,k,M,S,x,C,T);w=s0_512_hi(r,i),A=s0_512_lo(r,i),_=maj64_hi(r,i,o,a,s),E=maj64_lo(r,i,o,a,s,u);var $=sum64_hi(w,A,_,E),P=sum64_lo(w,A,_,E);y=g,v=m,g=d,m=p,d=h,p=f,h=sum64_hi(l,c,N,B),f=sum64_lo(c,c,N,B),l=s,c=u,s=o,u=a,o=r,a=i,r=sum64_hi(N,B,$,P),i=sum64_lo(N,B,$,P)}sum64(this.h,0,r,i),sum64(this.h,2,o,a),sum64(this.h,4,s,u),sum64(this.h,6,l,c),sum64(this.h,8,h,f),sum64(this.h,10,d,p),sum64(this.h,12,g,m),sum64(this.h,14,y,v)},SHA512.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")},utils.inherits(SHA384,_512);var _384=SHA384;SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h.slice(0,12),"big"):utils.split32(this.h.slice(0,12),"big")};var sha1=_1,sha224=_224,sha256$1=_256,sha384=_384,sha512=_512,sha={sha1:sha1,sha224:sha224,sha256:sha256$1,sha384:sha384,sha512:sha512},rotl32=utils.rotl32,sum32=utils.sum32,sum32_3=utils.sum32_3,sum32_4=utils.sum32_4,BlockHash=common$1.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils.inherits(RIPEMD160,BlockHash);var ripemd160=RIPEMD160;function f(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}function K(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.padLength=64,RIPEMD160.prototype._update=function(t,e){for(var n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],u=this.h[4],l=n,c=i,h=o,d=a,p=u,g=0;g<80;g++){var m=sum32(rotl32(sum32_4(n,f(g,i,o,a),t[r[g]+e],K(g)),s[g]),u);n=u,u=a,a=rotl32(o,10),o=i,i=m,m=sum32(rotl32(sum32_4(l,f(79-g,c,h,d),t[rh[g]+e],Kh(g)),sh[g]),p),l=p,p=d,d=rotl32(h,10),h=c,c=m}m=sum32_3(this.h[1],o,d),this.h[1]=sum32_3(this.h[2],a,p),this.h[2]=sum32_3(this.h[3],u,l),this.h[3]=sum32_3(this.h[4],n,c),this.h[4]=sum32_3(this.h[0],i,h),this.h[0]=m},RIPEMD160.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"little"):utils.split32(this.h,"little")};var r=[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],rh=[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],s=[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],sh=[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],ripemd={ripemd160:ripemd160};function Hmac(t,e,n){if(!(this instanceof Hmac))return new Hmac(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(e,n))}var hmac=Hmac;Hmac.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),minimalisticAssert$1(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},Hmac.prototype.update=function(t,e){return this.inner.update(t,e),this},Hmac.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};var hash_1=createCommonjsModule$1((function(t,e){var n=e;n.utils=utils,n.common=common$1,n.sha=sha,n.ripemd=ripemd,n.hmac=hmac,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),hash=hash_1;function createCommonjsModule$2(t,e,n){return n={path:e,exports:{},require:function(t,e){return commonjsRequire(t,null==e?n.path:e)}},t(n,n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var minimalisticAssert=assert;function assert(t,e){if(!t)throw new Error(e||"Assertion failed")}assert.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var utils_1=createCommonjsModule$2((function(t,e){var n=e;function r(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(r=0;r<t.length;r++){var i=t.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(t,e){return"hex"===e?i(t):t}})),utils_1$1=createCommonjsModule$2((function(t,e){var n=e;n.assert=minimalisticAssert,n.toArray=utils_1.toArray,n.zero2=utils_1.zero2,n.toHex=utils_1.toHex,n.encode=utils_1.encode,n.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<r.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,u=t.andln(3)+i&3,l=e.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),a=0==(1&u)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==l?u:-u,n[0].push(a),s=0==(1&l)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==u?l:-l,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},n.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new bn$2(t,"hex","le")}})),getNAF=utils_1$1.getNAF,getJSF=utils_1$1.getJSF,assert$1=utils_1$1.assert;function BaseCurve(t,e){this.type=t,this.p=new bn$2(e.p,16),this.red=e.prime?bn$2.red(e.prime):bn$2.mont(this.p),this.zero=new bn$2(0).toRed(this.red),this.one=new bn$2(1).toRed(this.red),this.two=new bn$2(2).toRed(this.red),this.n=e.n&&new bn$2(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),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 base=BaseCurve;function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(t,e){assert$1(t.precomputed);var n=t._getDoubles(),r=getNAF(e,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<r.length;o+=n.step){a=0;for(var u=o+n.step-1;u>=o;u--)a=(a<<1)+r[u];s.push(a)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<s.length;o++)(a=s[o])===h?c=c.mixedAdd(n.points[o]):a===-h&&(c=c.mixedAdd(n.points[o].neg()));l=l.add(c)}return l.toP()},BaseCurve.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=getNAF(e,n,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var l=o[s];assert$1(0!==l),a="affine"===t.type?l>0?a.mixedAdd(i[l-1>>1]):a.mixedAdd(i[-l-1>>1].neg()):l>0?a.add(i[l-1>>1]):a.add(i[-l-1>>1].neg())}return"affine"===t.type?a.toP():a},BaseCurve.prototype._wnafMulAdd=function(t,e,n,r,i){var o,a,s,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o<r;o++){var f=(s=e[o])._getNAFPoints(t);u[o]=f.wnd,l[o]=f.points}for(o=r-1;o>=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=getJSF(n[d],n[p]);for(h=Math.max(y[0].length,h),c[d]=new Array(h),c[p]=new Array(h),a=0;a<h;a++){var v=0|y[0][a],b=0|y[1][a];c[d][a]=m[3*(v+1)+(b+1)],c[p][a]=0,l[d]=g}}else c[d]=getNAF(n[d],u[d],this._bitLength),c[p]=getNAF(n[p],u[p],this._bitLength),h=Math.max(c[d].length,h),h=Math.max(c[p].length,h)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(o=h;o>=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a<r;a++)A[a]=0|c[a][o],0!==A[a]&&(E=!1);if(!E)break;_++,o--}if(o>=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a<r;a++){var k=A[a];0!==k&&(k>0?s=l[a][k-1>>1]:k<0&&(s=l[a][-k-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<r;o++)l[o]=null;return i?w:w.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function(){throw new Error("Not implemented")},BasePoint.prototype.validate=function(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function(t,e){t=utils_1$1.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?assert$1(t[t.length-1]%2==0):7===t[0]&&assert$1(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function(t){return this.encode(t,!0)},BasePoint.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},BasePoint.prototype.encode=function(t,e){return utils_1$1.encode(this._encode(e),t)},BasePoint.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},BasePoint.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},BasePoint.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)r=r.dbl();n.push(r)}return{step:t,points:n}},BasePoint.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)e[i]=e[i-1].add(r);return{wnd:t,points:e}},BasePoint.prototype._getBeta=function(){return null},BasePoint.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var inherits_browser=createCommonjsModule$2((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),assert$2=utils_1$1.assert;function ShortCurve(t){base.call(this,"short",t),this.a=new bn$2(t.a,16).toRed(this.red),this.b=new bn$2(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits_browser(ShortCurve,base);var short_1=ShortCurve;function Point(t,e,n,r){base.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new bn$2(e,16),this.y=new bn$2(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)}function JPoint(t,e,n,r){base.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new bn$2(0)):(this.x=new bn$2(e,16),this.y=new bn$2(n,16),this.z=new bn$2(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}ShortCurve.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,n;if(t.beta)e=new bn$2(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)n=new bn$2(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?n=i[0]:(n=i[1],assert$2(0===this.g.mul(n).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:n,basis:t.basis?t.basis.map((function(t){return{a:new bn$2(t.a,16),b:new bn$2(t.b,16)}})):this._getEndoBasis(n)}}},ShortCurve.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:bn$2.mont(t),n=new bn$2(2).toRed(e).redInvm(),r=n.redNeg(),i=new bn$2(3).toRed(e).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},ShortCurve.prototype._getEndoBasis=function(t){for(var e,n,r,i,o,a,s,u,l,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,f=this.n.clone(),d=new bn$2(1),p=new bn$2(0),g=new bn$2(0),m=new bn$2(1),y=0;0!==h.cmpn(0);){var v=f.div(h);u=f.sub(v.mul(h)),l=g.sub(v.mul(d));var b=m.sub(v.mul(p));if(!r&&u.cmp(c)<0)e=s.neg(),n=d,r=u.neg(),i=l;else if(r&&2==++y)break;s=u,f=h,h=u,g=d,d=l,m=p,p=b}o=u.neg(),a=l;var w=r.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=e,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},ShortCurve.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],i=r.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),l=o.mul(r.b);return{k1:t.sub(a).sub(s),k2:u.add(l).neg()}},ShortCurve.prototype.pointFromX=function(t,e){(t=new bn$2(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},ShortCurve.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,r,i,2*o,n),c=0;c<2*o;c++)r[c]=null,i[c]=null;return l},inherits_browser(Point,base.BasePoint),ShortCurve.prototype.point=function(t,e,n){return new Point(this,t,e,n)},ShortCurve.prototype.pointFromJSON=function(t,e){return Point.fromJSON(this,t,e)},Point.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,r=function(t){return n.point(t.x.redMul(n.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},Point.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]},Point.fromJSON=function(t,e,n){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],n);if(!e[2])return r;function i(e){return t.point(e[0],e[1],n)}var o=e[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},Point.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)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},Point.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(t){return t=new bn$2(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},Point.prototype.jmulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},Point.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},Point.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.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 e},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits_browser(JPoint,base.BasePoint),ShortCurve.prototype.jpoint=function(t,e,n){return new JPoint(this,t,e,n)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),i=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),c=l.redMul(s),h=r.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(f,d,p)},JPoint.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=n.redMul(u),h=s.redSqr().redIAdd(l).redISub(c).redISub(c),f=s.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(a);return this.curve.jpoint(h,f,d)},JPoint.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),l=a.redAdd(a);for(e=0;e<t;e++){var c=o.redSqr(),h=l.redSqr(),f=h.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(r.redMul(u)),p=o.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),y=d.redMul(m);y=y.redIAdd(y).redISub(f);var v=l.redMul(s);e+1<t&&(u=u.redMul(f)),o=g,s=v,l=y}return this.curve.jpoint(o,l.redMul(i),s)},JPoint.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=u,e=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),f=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(c).redISub(f);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),g=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),t=g.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(m),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(t,e,n)},JPoint.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);t=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),f=this.x.redMul(h),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),g=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(g),n=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=d.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,n)},JPoint.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=e.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),l=(u=u.redIAdd(u)).redMul(a),c=s.redSqr().redISub(l.redAdd(l)),h=l.redISub(c),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=s.redMul(h).redISub(f),p=n.redAdd(n).redMul(r);return this.curve.jpoint(c,d,p)},JPoint.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),r=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),c=e.redMul(l);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(s).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.y.redMul(l.redMul(u.redISub(l)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(h,f,d)},JPoint.prototype.mul=function(t,e){return t=new bn$2(t,e),this.curve._wnafMul(this,t)},JPoint.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),i=n.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(r)).cmpn(0)},JPoint.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},JPoint.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)+">"},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var curve_1=createCommonjsModule$2((function(t,e){var n=e;n.base=base,n.short=short_1,n.mont=null,n.edwards=null})),curves_1=createCommonjsModule$2((function(t,e){var n,r=e,i=utils_1$1.assert;function o(t){"short"===t.type?this.curve=new curve_1.short(t):"edwards"===t.type?this.curve=new curve_1.edwards(t):this.curve=new curve_1.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new o(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,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:hash.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:hash.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:hash.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:hash.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:hash.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:hash.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:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(t){n=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:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function HmacDRBG(t){if(!(this instanceof HmacDRBG))return new HmacDRBG(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=utils_1.toArray(t.entropy,t.entropyEnc||"hex"),n=utils_1.toArray(t.nonce,t.nonceEnc||"hex"),r=utils_1.toArray(t.pers,t.persEnc||"hex");minimalisticAssert(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new 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},HmacDRBG.prototype._hmac=function(){return new hash.hmac(this.hash,this.K)},HmacDRBG.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG.prototype.reseed=function(t,e,n,r){"string"!=typeof e&&(r=n,n=e,e=null),t=utils_1.toArray(t,e),n=utils_1.toArray(n,r),minimalisticAssert(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},HmacDRBG.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=utils_1.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(n),this._reseed++,utils_1.encode(o,e)};var assert$3=utils_1$1.assert;function KeyPair(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var key=KeyPair;KeyPair.fromPublic=function(t,e,n){return e instanceof KeyPair?e:new KeyPair(t,{pub:e,pubEnc:n})},KeyPair.fromPrivate=function(t,e,n){return e instanceof KeyPair?e:new KeyPair(t,{priv:e,privEnc:n})},KeyPair.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},KeyPair.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},KeyPair.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(t,e){this.priv=new bn$2(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?assert$3(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert$3(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},KeyPair.prototype.derive=function(t){return t.validate()||assert$3(t.validate(),"public point not validated"),t.mul(this.priv).getX()},KeyPair.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},KeyPair.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},KeyPair.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var assert$4=utils_1$1.assert;function Signature(t,e){if(t instanceof Signature)return t;this._importDER(t,e)||(assert$4(t.r&&t.s,"Signature without r or s"),this.r=new bn$2(t.r,16),this.s=new bn$2(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var signature=Signature;function Position(){this.place=0}function getLength(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=e.place;o<r;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function rmPadding(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function constructLength(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}Signature.prototype._importDER=function(t,e){t=utils_1$1.toArray(t,e);var n=new Position;if(48!==t[n.place++])return!1;var r=getLength(t,n);if(!1===r)return!1;if(r+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var i=getLength(t,n);if(!1===i)return!1;var o=t.slice(n.place,i+n.place);if(n.place+=i,2!==t[n.place++])return!1;var a=getLength(t,n);if(!1===a)return!1;if(t.length!==a+n.place)return!1;var s=t.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new bn$2(o),this.s=new bn$2(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=rmPadding(e),n=rmPadding(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];constructLength(r,e.length),(r=r.concat(e)).push(2),constructLength(r,n.length);var i=r.concat(n),o=[48];return constructLength(o,i.length),o=o.concat(i),utils_1$1.encode(o,t)};var rand=function(){throw new Error("unsupported")},assert$5=utils_1$1.assert;function EC(t){if(!(this instanceof EC))return new EC(t);"string"==typeof t&&(assert$5(Object.prototype.hasOwnProperty.call(curves_1,t),"Unknown curve "+t),t=curves_1[t]),t instanceof curves_1.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var ec=EC;EC.prototype.keyPair=function(t){return new key(this,t)},EC.prototype.keyFromPrivate=function(t,e){return key.fromPrivate(this,t,e)},EC.prototype.keyFromPublic=function(t,e){return key.fromPublic(this,t,e)},EC.prototype.genKeyPair=function(t){t||(t={});for(var e=new hmacDrbg({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new bn$2(2));;){var i=new bn$2(e.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},EC.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},EC.prototype.sign=function(t,e,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new bn$2(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),a=t.toArray("be",i),s=new hmacDrbg({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new bn$2(1)),l=0;;l++){var c=r.k?r.k(l):new bn$2(s.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(u)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new signature({r:d,s:p,recoveryParam:g})}}}}}},EC.prototype.verify=function(t,e,n,r){t=this._truncateToN(new bn$2(t,16)),n=this.keyFromPublic(n,r);var i=(e=new signature(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(t).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},EC.prototype.recoverPubKey=function(t,e,n,r){assert$5((3&n)===n,"The recovery param is more than two bits"),e=new signature(e,r);var i=this.n,o=new bn$2(t),a=e.r,s=e.s,u=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var c=e.r.invm(i),h=i.sub(o).mul(c).umod(i),f=s.mul(c).umod(i);return this.g.mulAdd(h,a,f)},EC.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new signature(e,r)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var elliptic_1=createCommonjsModule$2((function(t,e){var n=e;n.version="6.5.4",n.utils=utils_1$1,n.rand=function(){throw new Error("unsupported")},n.curve=curve_1,n.curves=curves_1,n.ec=ec,n.eddsa=null})),EC$1=elliptic_1.ec;const version$7="signing-key/5.6.2",logger$9=new Logger$1(version$7);let _curve=null;function getCurve(){return _curve||(_curve=new EC$1("secp256k1")),_curve}class SigningKey{constructor(t){defineReadOnly(this,"curve","secp256k1"),defineReadOnly(this,"privateKey",hexlify$1(t)),32!==hexDataLength(this.privateKey)&&logger$9.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=getCurve().keyFromPrivate(arrayify$1(this.privateKey));defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),defineReadOnly(this,"_isSigningKey",!0)}_addPoint(t){const e=getCurve().keyFromPublic(arrayify$1(this.publicKey)),n=getCurve().keyFromPublic(arrayify$1(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const e=getCurve().keyFromPrivate(arrayify$1(this.privateKey)),n=arrayify$1(t);32!==n.length&&logger$9.throwArgumentError("bad digest length","digest",t);const r=e.sign(n,{canonical:!0});return splitSignature({recoveryParam:r.recoveryParam,r:hexZeroPad$1("0x"+r.r.toString(16),32),s:hexZeroPad$1("0x"+r.s.toString(16),32)})}computeSharedSecret(t){const e=getCurve().keyFromPrivate(arrayify$1(this.privateKey)),n=getCurve().keyFromPublic(arrayify$1(computePublicKey(t)));return hexZeroPad$1("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function recoverPublicKey(t,e){const n=splitSignature(e),r={r:arrayify$1(n.r),s:arrayify$1(n.s)};return"0x"+getCurve().recoverPubKey(arrayify$1(t),r,n.recoveryParam).encode("hex",!1)}function computePublicKey(t,e){const n=arrayify$1(t);if(32===n.length){const t=new SigningKey(n);return e?"0x"+getCurve().keyFromPrivate(n).getPublic(!0,"hex"):t.publicKey}return 33===n.length?e?hexlify$1(n):"0x"+getCurve().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+getCurve().keyFromPublic(n).getPublic(!0,"hex"):hexlify$1(n):logger$9.throwArgumentError("invalid public or private key","key","[REDACTED]")}const version$6="transactions/5.6.2",logger$8=new Logger$1(version$6);var TransactionTypes;function handleAddress(t){return"0x"===t?null:getAddress(t)}function handleNumber(t){return"0x"===t?Zero$1:BigNumber$1.from(t)}function computeAddress(t){return getAddress(hexDataSlice(keccak256(hexDataSlice(computePublicKey(t),1)),12))}function recoverAddress(t,e){return computeAddress(recoverPublicKey(arrayify$1(t),e))}function formatNumber(t,e){const n=stripZeros(BigNumber$1.from(t).toHexString());return n.length>32&&logger$8.throwArgumentError("invalid length for "+e,"transaction:"+e,t),n}function accessSetify(t,e){return{address:getAddress(t),storageKeys:(e||[]).map(((e,n)=>(32!==hexDataLength(e)&&logger$8.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,e),e.toLowerCase())))}}function accessListify(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&logger$8.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),accessSetify(t[0],t[1])):accessSetify(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const n=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return accessSetify(e,Object.keys(n).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function formatAccessList(t){return accessListify(t).map((t=>[t.address,t.storageKeys]))}function _serializeEip1559(t,e){if(null!=t.gasPrice){const e=BigNumber$1.from(t.gasPrice),n=BigNumber$1.from(t.maxFeePerGas||0);e.eq(n)||logger$8.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:n})}const n=[formatNumber(t.chainId||0,"chainId"),formatNumber(t.nonce||0,"nonce"),formatNumber(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(t.maxFeePerGas||0,"maxFeePerGas"),formatNumber(t.gasLimit||0,"gasLimit"),null!=t.to?getAddress(t.to):"0x",formatNumber(t.value||0,"value"),t.data||"0x",formatAccessList(t.accessList||[])];if(e){const t=splitSignature(e);n.push(formatNumber(t.recoveryParam,"recoveryParam")),n.push(stripZeros(t.r)),n.push(stripZeros(t.s))}return hexConcat(["0x02",encode$2(n)])}function _serializeEip2930(t,e){const n=[formatNumber(t.chainId||0,"chainId"),formatNumber(t.nonce||0,"nonce"),formatNumber(t.gasPrice||0,"gasPrice"),formatNumber(t.gasLimit||0,"gasLimit"),null!=t.to?getAddress(t.to):"0x",formatNumber(t.value||0,"value"),t.data||"0x",formatAccessList(t.accessList||[])];if(e){const t=splitSignature(e);n.push(formatNumber(t.recoveryParam,"recoveryParam")),n.push(stripZeros(t.r)),n.push(stripZeros(t.s))}return hexConcat(["0x01",encode$2(n)])}function _parseEipSignature(t,e,n){try{const n=handleNumber(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){logger$8.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=hexZeroPad$1(e[1],32),t.s=hexZeroPad$1(e[2],32);try{const e=keccak256(n(t));t.from=recoverAddress(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function _parseEip1559(t){const e=decode$2(t.slice(1));9!==e.length&&12!==e.length&&logger$8.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify$1(t));const n=handleNumber(e[2]),r=handleNumber(e[3]),i={type:2,chainId:handleNumber(e[0]).toNumber(),nonce:handleNumber(e[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:handleNumber(e[4]),to:handleAddress(e[5]),value:handleNumber(e[6]),data:e[7],accessList:accessListify(e[8])};return 9===e.length||(i.hash=keccak256(t),_parseEipSignature(i,e.slice(9),_serializeEip1559)),i}function _parseEip2930(t){const e=decode$2(t.slice(1));8!==e.length&&11!==e.length&&logger$8.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify$1(t));const n={type:1,chainId:handleNumber(e[0]).toNumber(),nonce:handleNumber(e[1]).toNumber(),gasPrice:handleNumber(e[2]),gasLimit:handleNumber(e[3]),to:handleAddress(e[4]),value:handleNumber(e[5]),data:e[6],accessList:accessListify(e[7])};return 8===e.length||(n.hash=keccak256(t),_parseEipSignature(n,e.slice(8),_serializeEip2930)),n}function _parse(t){const e=decode$2(t);9!==e.length&&6!==e.length&&logger$8.throwArgumentError("invalid raw transaction","rawTransaction",t);const n={nonce:handleNumber(e[0]).toNumber(),gasPrice:handleNumber(e[1]),gasLimit:handleNumber(e[2]),to:handleAddress(e[3]),value:handleNumber(e[4]),data:e[5],chainId:0};if(6===e.length)return n;try{n.v=BigNumber$1.from(e[6]).toNumber()}catch(t){return n}if(n.r=hexZeroPad$1(e[7],32),n.s=hexZeroPad$1(e[8],32),BigNumber$1.from(n.r).isZero()&&BigNumber$1.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=e.slice(0,6);0!==n.chainId&&(i.push(hexlify$1(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=keccak256(encode$2(i));try{n.from=recoverAddress(o,{r:hexlify$1(n.r),s:hexlify$1(n.s),recoveryParam:r})}catch(t){}n.hash=keccak256(t)}return n.type=null,n}function parse(t){const e=arrayify$1(t);if(e[0]>127)return _parse(e);switch(e[0]){case 1:return _parseEip2930(e);case 2:return _parseEip1559(e)}return logger$8.throwError(`unsupported transaction type: ${e[0]}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(TransactionTypes||(TransactionTypes={}));const version$5="contracts/5.6.2";var __awaiter$4=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$7=new Logger$1(version$5);function resolveName(t,e){return __awaiter$4(this,void 0,void 0,(function*(){const n=yield e;"string"!=typeof n&&logger$7.throwArgumentError("invalid address or ENS name","name",n);try{return getAddress(n)}catch(t){}t||logger$7.throwError("a provider or signer is needed to resolve ENS names",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield t.resolveName(n);return null==r&&logger$7.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function resolveAddresses(t,e,n){return __awaiter$4(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>resolveAddresses(t,Array.isArray(e)?e[r]:e[n.name],n)))):"address"===n.type?yield resolveName(t,e):"tuple"===n.type?yield resolveAddresses(t,e,n.components):"array"===n.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>resolveAddresses(t,e,n.arrayChildren)))):Promise.reject(logger$7.makeError("invalid value for array",Logger$1.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function populateTransaction(t,e,n){return __awaiter$4(this,void 0,void 0,(function*(){let r={};n.length===e.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=shallowCopy(n.pop())),logger$7.checkArgumentCount(n.length,e.inputs.length,"passed to contract"),t.signer?r.from?r.from=resolveProperties({override:resolveName(t.signer,r.from),signer:t.signer.getAddress()}).then((t=>__awaiter$4(this,void 0,void 0,(function*(){return getAddress(t.signer)!==t.override&&logger$7.throwError("Contract with a Signer cannot override from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):r.from=t.signer.getAddress():r.from&&(r.from=resolveName(t.provider,r.from));const i=yield resolveProperties({args:resolveAddresses(t.signer||t.provider,n,e.inputs),address:t.resolvedAddress,overrides:resolveProperties(r)||{}}),o=t.interface.encodeFunctionData(e,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=BigNumber$1.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=BigNumber$1.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=BigNumber$1.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=BigNumber$1.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=BigNumber$1.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=accessListify(s.accessList)),null==a.gasLimit&&null!=e.gas){let t=21e3;const n=arrayify$1(o);for(let e=0;e<n.length;e++)t+=4,n[e]&&(t+=64);a.gasLimit=BigNumber$1.from(e.gas).add(t)}if(s.value){const t=BigNumber$1.from(s.value);t.isZero()||e.payable||logger$7.throwError("non-payable method cannot override value",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),a.value=t}s.customData&&(a.customData=shallowCopy(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.ccipReadEnabled),delete r.nonce,delete r.gasLimit,delete r.gasPrice,delete r.from,delete r.value,delete r.type,delete r.accessList,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.customData,delete r.ccipReadEnabled;const u=Object.keys(r).filter((t=>null!=r[t]));return u.length&&logger$7.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function buildPopulate(t,e){return function(...n){return populateTransaction(t,e,n)}}function buildEstimate(t,e){const n=t.signer||t.provider;return function(...r){return __awaiter$4(this,void 0,void 0,(function*(){n||logger$7.throwError("estimate require a provider or signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield populateTransaction(t,e,r);return yield n.estimateGas(i)}))}}function addContractWait(t,e){const n=e.wait.bind(e);e.wait=e=>n(e).then((e=>(e.events=e.logs.map((n=>{let r=deepCopy(n),i=null;try{i=t.interface.parseLog(n)}catch(t){}return i&&(r.args=i.args,r.decode=(e,n)=>t.interface.decodeEventLog(i.eventFragment,e,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>t.provider,r.getBlock=()=>t.provider.getBlock(e.blockHash),r.getTransaction=()=>t.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(e),r})),e)))}function buildCall(t,e,n){const r=t.signer||t.provider;return function(...i){return __awaiter$4(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=shallowCopy(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const a=yield populateTransaction(t,e,i),s=yield r.call(a,o);try{let r=t.interface.decodeFunctionResult(e,s);return n&&1===e.outputs.length&&(r=r[0]),r}catch(e){throw e.code===Logger$1.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=a),e}}))}}function buildSend(t,e){return function(...n){return __awaiter$4(this,void 0,void 0,(function*(){t.signer||logger$7.throwError("sending a transaction requires a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const r=yield populateTransaction(t,e,n),i=yield t.signer.sendTransaction(r);return addContractWait(t,i),i}))}}function buildDefault(t,e,n){return e.constant?buildCall(t,e,n):buildSend(t,e)}function getEventTag$1(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class RunningEvent{constructor(t,e){defineReadOnly(this,"tag",t),defineReadOnly(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((n=>!(!e&&n.listener===t)||(e=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const n=t.slice();return setTimeout((()=>{e.listener.apply(this,n)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class ErrorRunningEvent extends RunningEvent{constructor(){super("error",null)}}class FragmentRunningEvent extends RunningEvent{constructor(t,e,n,r){const i={address:t};let o=e.getEventTopic(n);r?(o!==r[0]&&logger$7.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(getEventTag$1(i),i),defineReadOnly(this,"address",t),defineReadOnly(this,"interface",e),defineReadOnly(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=checkResultErrors(t.args);if(e.length)throw e[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class WildcardRunningEvent extends RunningEvent{constructor(t,e){super("*",{address:t}),defineReadOnly(this,"address",t),defineReadOnly(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,n)=>this.interface.decodeEventLog(e.eventFragment,t,n),t.args=e.args}catch(t){}}}class BaseContract{constructor(t,e,n){defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(e)),null==n?(defineReadOnly(this,"provider",null),defineReadOnly(this,"signer",null)):Signer.isSigner(n)?(defineReadOnly(this,"provider",n.provider||null),defineReadOnly(this,"signer",n)):Provider.isProvider(n)?(defineReadOnly(this,"provider",n),defineReadOnly(this,"signer",null)):logger$7.throwArgumentError("invalid signer or provider","signerOrProvider",n),defineReadOnly(this,"callStatic",{}),defineReadOnly(this,"estimateGas",{}),defineReadOnly(this,"functions",{}),defineReadOnly(this,"populateTransaction",{}),defineReadOnly(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const n=this.interface.events[e];defineReadOnly(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,t)}))),t[n.name]||(t[n.name]=[]),t[n.name].push(e)})),Object.keys(t).forEach((e=>{const n=t[e];1===n.length?defineReadOnly(this.filters,e,this.filters[n[0]]):logger$7.warn(`Duplicate definition of ${e} (${n.join(", ")})`)}))}if(defineReadOnly(this,"_runningEvents",{}),defineReadOnly(this,"_wrappedEmits",{}),null==t&&logger$7.throwArgumentError("invalid contract address or ENS name","addressOrName",t),defineReadOnly(this,"address",t),this.provider)defineReadOnly(this,"resolvedAddress",resolveName(this.provider,t));else try{defineReadOnly(this,"resolvedAddress",Promise.resolve(getAddress(t)))}catch(t){logger$7.throwError("provider is required to use ENS name as contract address",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])logger$7.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const n=e.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(t)}null==this[t]&&defineReadOnly(this,t,buildDefault(this,e,!0)),null==this.functions[t]&&defineReadOnly(this.functions,t,buildDefault(this,e,!1)),null==this.callStatic[t]&&defineReadOnly(this.callStatic,t,buildCall(this,e,!0)),null==this.populateTransaction[t]&&defineReadOnly(this.populateTransaction,t,buildPopulate(this,e)),null==this.estimateGas[t]&&defineReadOnly(this.estimateGas,t,buildEstimate(this,e))}})),Object.keys(r).forEach((t=>{const e=r[t];if(e.length>1)return;t=t.substring(1);const n=e[0];try{null==this[t]&&defineReadOnly(this,t,this[n])}catch(t){}null==this.functions[t]&&defineReadOnly(this.functions,t,this.functions[n]),null==this.callStatic[t]&&defineReadOnly(this.callStatic,t,this.callStatic[n]),null==this.populateTransaction[t]&&defineReadOnly(this.populateTransaction,t,this.populateTransaction[n]),null==this.estimateGas[t]&&defineReadOnly(this.estimateGas,t,this.estimateGas[n])}))}static getContractAddress(t){return getContractAddress(t)}static getInterface(t){return Interface.isInterface(t)?t:new Interface(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&logger$7.throwError("contract not deployed",Logger$1.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||logger$7.throwError("sending a transactions require a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=shallowCopy(t||{});return["from","to"].forEach((function(t){null!=e[t]&&logger$7.throwError("cannot override "+t,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new VoidSigner(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&defineReadOnly(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return Indexed.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new ErrorRunningEvent);if("event"===t)return this._normalizeRunningEvent(new RunningEvent("event",null));if("*"===t)return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const n=this.interface.getEvent(e);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,n,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag$1(e),e))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,n){const r=deepCopy(e);return r.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},r.getBlock=()=>this.provider.getBlock(e.blockHash),r.getTransaction=()=>this.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(r),r}_addEventListener(t,e,n){if(this.provider||logger$7.throwError("events require a provider or a signer with a provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const n=n=>{let r=this._wrapEvent(t,n,e);if(null==r.decodeError)try{const e=t.getEmit(r);this.emit(t.filter,...e)}catch(t){r.decodeError=t.error}null!=t.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,n){const r=this._getRunningEvent(t),i=shallowCopy(r.filter);return"string"==typeof e&&isHexString$1(e,32)?(null!=n&&logger$7.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(r,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const n=this._getRunningEvent(t),r=n.run(e)>0;return this._checkRunningEvents(n),r}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(e),this._checkRunningEvents(n),this}removeListener(t,e){return this.off(t,e)}}class Contract extends BaseContract{}class BaseX{constructor(t){defineReadOnly(this,"alphabet",t),defineReadOnly(this,"base",t.length),defineReadOnly(this,"_alphabetMap",{}),defineReadOnly(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=arrayify$1(t);if(0===e.length)return"";let n=[0];for(let t=0;t<e.length;++t){let r=e[t];for(let t=0;t<n.length;++t)r+=n[t]<<8,n[t]=r%this.base,r=r/this.base|0;for(;r>0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let t=0;0===e[t]&&t<e.length-1;++t)r+=this._leader;for(let t=n.length-1;t>=0;--t)r+=this.alphabet[n[t]];return r}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let r=this._alphabetMap[t[n]];if(void 0===r)throw new Error("Non-base"+this.base+" character");let i=r;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return arrayify$1(new Uint8Array(e.reverse()))}}new BaseX("abcdefghijklmnopqrstuvwxyz234567");const Base58=new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),version$4="sha2/5.6.1";function sha256(t){return"0x"+hash.sha256().update(arrayify$1(t)).digest("hex")}new Logger$1(version$4);const version$3$1="networks/5.6.3",logger$6=new Logger$1(version$3$1);function isRenetworkable(t){return t&&"function"==typeof t.renetwork}function ethDefaultProvider(t){const e=function(e,n){null==n&&(n={});const r=[];if(e.InfuraProvider&&"-"!==n.infura)try{r.push(new e.InfuraProvider(t,n.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==n.etherscan)try{r.push(new e.EtherscanProvider(t,n.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==n.alchemy)try{r.push(new e.AlchemyProvider(t,n.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==n.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,n.pocket);o.network&&-1===i.indexOf(o.network.name)&&r.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==n.cloudflare)try{r.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==n.ankr)try{r.push(new e.AnkrProvider(t,n.ankr))}catch(t){}if(0===r.length)return null;if(e.FallbackProvider){let i=1;return null!=n.quorum?i=n.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(r,i)}return r[0]};return e.renetwork=function(t){return ethDefaultProvider(t)},e}function etcDefaultProvider(t,e){const n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return n.renetwork=function(e){return etcDefaultProvider(t,e)},n}const homestead={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ethDefaultProvider("homestead")},ropsten={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ethDefaultProvider("ropsten")},classicMordor={chainId:63,name:"classicMordor",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/mordor","classicMordor")},networks={unspecified:{chainId:0,name:"unspecified"},homestead:homestead,mainnet:homestead,morden:{chainId:2,name:"morden"},ropsten:ropsten,testnet:ropsten,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ethDefaultProvider("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ethDefaultProvider("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ethDefaultProvider("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:classicMordor,classicTestnet:classicMordor,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ethDefaultProvider("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ethDefaultProvider("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function getNetwork(t){if(null==t)return null;if("number"==typeof t){for(const e in networks){const n=networks[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=networks[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=networks[t.name];if(!e)return"number"!=typeof t.chainId&&logger$6.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&logger$6.throwArgumentError("network chainId mismatch","network",t);let n=t._defaultProvider||null;return null==n&&e._defaultProvider&&(n=isRenetworkable(e._defaultProvider)?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:n}}function decode$1(t){t=atob(t);const e=[];for(let n=0;n<t.length;n++)e.push(t.charCodeAt(n));return arrayify$1(e)}function encode$1(t){t=arrayify$1(t);let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const version$2$1="web/5.6.1";var __awaiter$3=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function getUrl(t,e){return __awaiter$3(this,void 0,void 0,(function*(){null==e&&(e={});const n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client");const r=yield fetch(t,n),i=yield r.arrayBuffer(),o={};return r.headers.forEach?r.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):r.headers.keys().forEach((t=>{o[t.toLowerCase()]=r.headers.get(t)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:arrayify$1(new Uint8Array(i))}}))}var __awaiter$2=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$5=new Logger$1(version$2$1);function staller(t){return new Promise((e=>{setTimeout(e,t)}))}function bodyify(t,e){if(null==t)return null;if("string"==typeof t)return t;if(isBytesLike(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return toUtf8String(t)}catch(t){}return hexlify$1(t)}return t}function _fetchData(t,e,n){const r="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;logger$5.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;logger$5.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof t&&!!t.errorPassThrough,s={};let u=null;const l={method:"GET"};let c=!1,h=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||logger$5.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(h=t.timeout),t.headers)for(const e in t.headers)s[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(c=!0);if(l.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&logger$5.throwError("basic authentication requires a secure https url",Logger$1.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;s.authorization={key:"Authorization",value:"Basic "+encode$1(toUtf8Bytes(e))}}null!=t.skipFetchSetup&&(l.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:decode$1(d[2])};let e=t.body;return n&&(e=n(t.body,t)),Promise.resolve(e)}catch(t){logger$5.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(l.method="POST",l.body=e,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(s).forEach((t=>{const e=s[t];p[e.key]=e.value})),l.headers=p;const g=function(){let t=null;return{promise:new Promise((function(e,n){h&&(t=setTimeout((()=>{null!=t&&(t=null,n(logger$5.makeError("timeout",Logger$1.errors.TIMEOUT,{requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),m=function(){return __awaiter$2(this,void 0,void 0,(function*(){for(let t=0;t<r;t++){let e=null;try{if(e=yield getUrl(u,l),t<r)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===l.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let n=!0;if(i&&(n=yield i(t,u)),n){let n=0;const r=e.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):o*parseInt(String(Math.random()*Math.pow(2,t))),yield staller(n);continue}}}catch(t){e=t.response,null==e&&(g.cancel(),logger$5.throwError("missing response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,serverError:t,url:u}))}let s=e.body;if(c&&304===e.statusCode?s=null:!a&&(e.statusCode<200||e.statusCode>=300)&&(g.cancel(),logger$5.throwError("bad response",Logger$1.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:bodyify(s,e.headers?e.headers["content-type"]:null),requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,url:u})),n)try{const t=yield n(s,e);return g.cancel(),t}catch(n){if(n.throttleRetry&&t<r){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield staller(e);continue}}g.cancel(),logger$5.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(s,e.headers?e.headers["content-type"]:null),error:n,requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,url:u})}return g.cancel(),s}return logger$5.throwError("failed response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,url:u})}))}();return Promise.race([g.promise,m])}function fetchJson(t,e,n){let r=null;if(null!=e){r=toUtf8Bytes(e);const n="string"==typeof t?{url:t}:shallowCopy(t);if(n.headers){0!==Object.keys(n.headers).filter((t=>"content-type"===t.toLowerCase())).length||(n.headers=shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};t=n}return _fetchData(t,r,((t,e)=>{let r=null;if(null!=t)try{r=JSON.parse(toUtf8String(t))}catch(e){logger$5.throwError("invalid JSON",Logger$1.errors.SERVER_ERROR,{body:t,error:e})}return n&&(r=n(r,e)),r}))}function poll(t,e){return e||(e={}),null==(e=shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{a()&&r(new Error("timeout"))}),e.timeout));const s=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)a()&&n(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&r(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){a()&&r(t)}))}()}))}for(var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={},z=0;z<ALPHABET.length;z++){var x=ALPHABET.charAt(z);if(void 0!==ALPHABET_MAP[x])throw new TypeError(x+" is ambiguous");ALPHABET_MAP[x]=z}function polymodStep(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function prefixChk(t){for(var e=1,n=0;n<t.length;++n){var r=t.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+t+")";e=polymodStep(e)^r>>5}for(e=polymodStep(e),n=0;n<t.length;++n){var i=t.charCodeAt(n);e=polymodStep(e)^31&i}return e}function encode(t,e,n){if(n=n||90,t.length+7+e.length>n)throw new TypeError("Exceeds length limit");var r=prefixChk(t=t.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=t+"1",o=0;o<e.length;++o){var a=e[o];if(a>>5!=0)throw new Error("Non 5-bit word");r=polymodStep(r)^a,i+=ALPHABET.charAt(a)}for(o=0;o<6;++o)r=polymodStep(r);for(r^=1,o=0;o<6;++o){var s=r>>5*(5-o)&31;i+=ALPHABET.charAt(s)}return i}function __decode(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var n=t.toLowerCase(),r=t.toUpperCase();if(t!==n&&t!==r)return"Mixed-case string "+t;var i=(t=n).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),a=t.slice(i+1);if(a.length<6)return"Data too short";var s=prefixChk(o);if("string"==typeof s)return s;for(var u=[],l=0;l<a.length;++l){var c=a.charAt(l),h=ALPHABET_MAP[c];if(void 0===h)return"Unknown character "+c;s=polymodStep(s)^h,l+6>=a.length||u.push(h)}return 1!==s?"Invalid checksum for "+t:{prefix:o,words:u}}function decodeUnsafe(){var t=__decode.apply(null,arguments);if("object"==typeof t)return t}function decode(t){var e=__decode.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)}function convert(t,e,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=e)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}function toWordsUnsafe(t){var e=convert(t,8,5,!0);if(Array.isArray(e))return e}function toWords(t){var e=convert(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)}function fromWordsUnsafe(t){var e=convert(t,5,8,!1);if(Array.isArray(e))return e}function fromWords(t){var e=convert(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}var bech32={decodeUnsafe:decodeUnsafe,decode:decode,encode:encode,toWordsUnsafe:toWordsUnsafe,toWords:toWords,fromWordsUnsafe:fromWordsUnsafe,fromWords:fromWords};const version$1$1="providers/5.6.8",logger$4=new Logger$1(version$1$1);class Formatter{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:Formatter.allowNull(this.accessList.bind(this),null),blockHash:Formatter.allowNull(o,null),blockNumber:Formatter.allowNull(s,null),transactionIndex:Formatter.allowNull(s,null),confirmations:Formatter.allowNull(s,null),from:e,gasPrice:Formatter.allowNull(n),maxPriorityFeePerGas:Formatter.allowNull(n),maxFeePerGas:Formatter.allowNull(n),gasLimit:n,to:Formatter.allowNull(e,null),value:n,nonce:s,data:i,r:Formatter.allowNull(this.uint256),s:Formatter.allowNull(this.uint256),v:Formatter.allowNull(s),creates:Formatter.allowNull(e,null),raw:Formatter.allowNull(i)},t.transactionRequest={from:Formatter.allowNull(e),nonce:Formatter.allowNull(s),gasLimit:Formatter.allowNull(n),gasPrice:Formatter.allowNull(n),maxPriorityFeePerGas:Formatter.allowNull(n),maxFeePerGas:Formatter.allowNull(n),to:Formatter.allowNull(e),value:Formatter.allowNull(n),data:Formatter.allowNull((t=>this.data(t,!0))),type:Formatter.allowNull(s),accessList:Formatter.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:e,topics:Formatter.arrayOf(o),data:i,logIndex:s,blockHash:o},t.receipt={to:Formatter.allowNull(this.address,null),from:Formatter.allowNull(this.address,null),contractAddress:Formatter.allowNull(e,null),transactionIndex:s,root:Formatter.allowNull(a),gasUsed:n,logsBloom:Formatter.allowNull(i),blockHash:o,transactionHash:o,logs:Formatter.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Formatter.allowNull(s,null),cumulativeGasUsed:n,effectiveGasPrice:Formatter.allowNull(n),status:Formatter.allowNull(s),type:u},t.block={hash:Formatter.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Formatter.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Formatter.allowNull(e),extraData:i,transactions:Formatter.allowNull(Formatter.arrayOf(o)),baseFeePerGas:Formatter.allowNull(n)},t.blockWithTransactions=shallowCopy(t.block),t.blockWithTransactions.transactions=Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:Formatter.allowNull(r,void 0),toBlock:Formatter.allowNull(r,void 0),blockHash:Formatter.allowNull(o,void 0),address:Formatter.allowNull(e,void 0),topics:Formatter.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:Formatter.allowNull(s),blockHash:Formatter.allowNull(o),transactionIndex:s,removed:Formatter.allowNull(this.boolean.bind(this)),address:e,data:Formatter.allowFalsish(i,"0x"),topics:Formatter.arrayOf(o),transactionHash:o,logIndex:s},t}accessList(t){return accessListify(t||[])}number(t){return"0x"===t?0:BigNumber$1.from(t).toNumber()}type(t){return"0x"===t||null==t?0:BigNumber$1.from(t).toNumber()}bigNumber(t){return BigNumber$1.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),isHexString$1(t))?t.toLowerCase():logger$4.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return getAddress(t)}callAddress(t){if(!isHexString$1(t,32))return null;const e=getAddress(hexDataSlice(t,12));return e===AddressZero?null:e}contractAddress(t){return getContractAddress(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||isHexString$1(t))return hexValue(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return 32!==hexDataLength(n)?logger$4.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(null==t)return null;const e=BigNumber$1.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!isHexString$1(t))throw new Error("invalid uint256");return hexZeroPad$1(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const n=null!=t._difficulty?t._difficulty:t.difficulty,r=Formatter.check(e,t);return r._difficulty=null==n?null:BigNumber$1.from(n),r}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return Formatter.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&BigNumber$1.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=Formatter.check(this.formats.transaction,t);if(null!=t.chainId){let n=t.chainId;isHexString$1(n)&&(n=BigNumber$1.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),isHexString$1(n)&&(n=BigNumber$1.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return parse(t)}receiptLog(t){return Formatter.check(this.formats.receiptLog,t)}receipt(t){const e=Formatter.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=BigNumber$1.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&logger$4.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):logger$4.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&logger$4.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return Formatter.check(this.formats.filter,t)}filterLog(t){return Formatter.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const r in t)try{const i=t[r](e[r]);void 0!==i&&(n[r]=i)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}static allowNull(t,e){return function(n){return null==n?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach((function(e){n.push(t(e))})),n}}}var __awaiter$1=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$3$1=new Logger$1(version$1$1),MAX_CCIP_REDIRECTS=10;function checkTopic(t){return null==t?"null":(32!==hexDataLength(t)&&logger$3$1.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function serializeTopics(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[checkTopic(t)]=!0}));const n=Object.keys(e);return n.sort(),n.join("|")}return checkTopic(t)})).join("&")}function deserializeTopics(t){return""===t?[]:t.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}))}function getEventTag(t){if("string"==typeof t){if(32===hexDataLength(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+serializeTopics(t);if(ForkEvent.isForkEvent(t))throw logger$3$1.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+serializeTopics(t.topics||[])}throw new Error("invalid event - "+t)}function getTime(){return(new Date).getTime()}function stall(t){return new Promise((e=>{setTimeout(e,t)}))}const PollableEvents=["block","network","pending","poll"];class Event{constructor(t,e,n){defineReadOnly(this,"tag",t),defineReadOnly(this,"listener",e),defineReadOnly(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],n=deserializeTopics(t[2]),r={};return n.length>0&&(r.topics=n),e&&"*"!==e&&(r.address=e),r}pollable(){return this.tag.indexOf(":")>=0||PollableEvents.indexOf(this.tag)>=0}}const coinInfos={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bytes32ify(t){return hexZeroPad$1(BigNumber$1.from(t).toHexString(),32)}function base58Encode(t){return Base58.encode(concat([t,hexDataSlice(sha256(sha256(t)),0,4)]))}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i"),matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString(t,e){try{return toUtf8String(_parseBytes(t,e))}catch(t){}return null}function _parseBytes(t,e){if("0x"===t)return null;const n=BigNumber$1.from(hexDataSlice(t,e,e+32)).toNumber(),r=BigNumber$1.from(hexDataSlice(t,n,n+32)).toNumber();return hexDataSlice(t,n+32,n+32+r)}function getIpfsLink(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):logger$3$1.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function numPad(t){const e=arrayify$1(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function bytesPad(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function encodeBytes(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(null),n+=32;for(let r=0;r<t.length;r++){const i=arrayify$1(t[r]);e[r]=numPad(n),e.push(numPad(i.length)),e.push(bytesPad(i)),n+=32+32*Math.ceil(i.length/32)}return hexConcat(e)}class Resolver{constructor(t,e,n,r){defineReadOnly(this,"provider",t),defineReadOnly(this,"name",n),defineReadOnly(this,"address",t.formatter.address(e)),defineReadOnly(this,"_resolvedAddress",r)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>BigNumber$1.from(t).eq(1))).catch((t=>{if(t.code===Logger$1.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return __awaiter$1(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:hexConcat([t,namehash(this.name),e||"0x"])};let r=!1;(yield this.supportsWildcard())&&(r=!0,n.data=hexConcat(["0x9061b923",encodeBytes([dnsEncode(this.name),n.data])]));try{let t=yield this.provider.call(n);return arrayify$1(t).length%32==4&&logger$3$1.throwError("resolver threw error",Logger$1.errors.CALL_EXCEPTION,{transaction:n,data:t}),r&&(t=_parseBytes(t,0)),t}catch(t){if(t.code===Logger$1.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return __awaiter$1(this,void 0,void 0,(function*(){const n=yield this._fetch(t,e);return null!=n?_parseBytes(n,0):null}))}_getAddress(t,e){const n=coinInfos[String(t)];if(null==n&&logger$3$1.throwError(`unsupported coin type: ${t}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===n.ilk)return this.provider.formatter.address(e);const r=arrayify$1(e);if(null!=n.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return base58Encode(concat([[n.p2pkh],"0x"+t[2]]))}}if(null!=n.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return base58Encode(concat([[n.p2sh],"0x"+t[2]]))}}if(null!=n.prefix){const t=r[1];let e=r[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&r.length===2+t&&t>=1&&t<=75){const t=bech32.toWords(r.slice(2));return t.unshift(e),bech32.encode(n.prefix,t)}}return null}getAddress(t){return __awaiter$1(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||t===HashZero?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===Logger$1.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",bytes32ify(t));if(null==e||"0x"===e)return null;const n=this._getAddress(t,e);return null==n&&logger$3$1.throwError("invalid or unsupported coin data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n}))}getAvatar(){return __awaiter$1(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let n=0;n<matchers.length;n++){const r=e.match(matchers[n]);if(null==r)continue;const i=r[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:getIpfsLink(e)};case"erc721":case"erc1155":{const n="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),a=(r[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),u=hexZeroPad$1(BigNumber$1.from(a[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:hexConcat(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=BigNumber$1.from(yield this.provider.call({to:s,data:hexConcat(["0x00fdd58e",hexZeroPad$1(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const l={to:this.provider.formatter.address(a[0]),data:hexConcat([n,u])};let c=_parseString(yield this.provider.call(l),0);if(null==c)return null;t.push({type:"metadata-url-base",content:c}),"erc1155"===i&&(c=c.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:c})),c.match(/^ipfs:/i)&&(c=getIpfsLink(c)),t.push({type:"metadata-url",content:c});const h=yield fetchJson(c);if(!h)return null;t.push({type:"metadata",content:JSON.stringify(h)});let f=h.image;if("string"!=typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(matcherIpfs))return null;t.push({type:"url-ipfs",content:f}),f=getIpfsLink(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return __awaiter$1(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+Base58.encode("0x"+e[1])}const n=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const t=parseInt(n[3],16);if(n[4].length===2*t)return"ipns://"+Base58.encode("0x"+n[1])}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return"bzz://"+r[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"},e=encode$1("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]));return"sia://"+e}return logger$3$1.throwError("invalid or unsupported content hash data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return __awaiter$1(this,void 0,void 0,(function*(){let e=toUtf8Bytes(t);e=concat([bytes32ify(64),bytes32ify(e.length),e]),e.length%32!=0&&(e=concat([e,hexZeroPad$1("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",hexlify$1(e));return null==n||"0x"===n?null:toUtf8String(n)}))}}let defaultFormatter=null,nextPollId=1;class BaseProvider extends Provider{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),defineReadOnly(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=getStatic(new.target,"getNetwork")(t);e?(defineReadOnly(this,"_network",e),this.emit("network",e,null)):logger$3$1.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return __awaiter$1(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||logger$3$1.throwError("no network detected",Logger$1.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:defineReadOnly(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return poll((()=>this._ready().then((t=>t),(t=>{if(t.code!==Logger$1.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==defaultFormatter&&(defaultFormatter=new Formatter),defaultFormatter}static getNetwork(t){return getNetwork(null==t?"homestead":t)}ccipReadFetch(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<n.length;t++){const e=n[t],a=e.replace("{sender}",r).replace("{data}",i),s=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:r}),u=yield fetchJson({url:a,errorPassThrough:!0},s,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return logger$3$1.throwError(`response not found during CCIP fetch: ${l}`,Logger$1.errors.SERVER_ERROR,{url:e,errorMessage:l});o.push(l)}return logger$3$1.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,Logger$1.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(t){return __awaiter$1(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const n=yield e;if(getTime()-n.respTime<=t)return n.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=getTime(),n=resolveProperties({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=getTime();return(t=BigNumber$1.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=n,n.catch((t=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return __awaiter$1(this,void 0,void 0,(function*(){const t=nextPollId++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)logger$3$1.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",logger$3$1.makeError("network block skew detected",Logger$1.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let t=this._emitted.block+1;t<=n;t++)this.emit("block",t);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&n-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((t=>{switch(t.type){case"tx":{const n=t.hash;let r=this.getTransactionReceipt(n).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(r);break}case"filter":if(!t._inflight){t._inflight=!0;const r=t.filter;r.fromBlock=t._lastBlockNumber+1,r.toBlock=n,r.toBlock-this._maxFilterBlockRange>r.fromBlock&&(r.fromBlock=r.toBlock-this._maxFilterBlockRange);const i=this.getLogs(r).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(r,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=n,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return __awaiter$1(this,void 0,void 0,(function*(){return logger$3$1.throwError("provider does not support network detection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return __awaiter$1(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield stall(0),this._network;const n=logger$3$1.makeError("underlying network changed",Logger$1.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=getTime();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=getTime(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,n||0,null)}))}_waitForTransaction(t,e,n,r){return __awaiter$1(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((t=>{t()})),!1)},l=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,l),a.push((()=>{this.removeListener(t,l)})),r){let n=r.startBlock,i=null;const l=a=>__awaiter$1(this,void 0,void 0,(function*(){s||(yield stall(1e3),this.getTransactionCount(r.from).then((c=>__awaiter$1(this,void 0,void 0,(function*(){if(!s){if(c<=r.nonce)n=a;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=n-3,i<r.startBlock&&(i=r.startBlock));i<=a;){if(s)return;const n=yield this.getBlockWithTransactions(i);for(let i=0;i<n.transactions.length;i++){const a=n.transactions[i];if(a.hash===t)return;if(a.from===r.from&&a.nonce===r.nonce){if(s)return;const n=yield this.waitForTransaction(a.hash,e);if(u())return;let i="replaced";return a.data===r.data&&a.to===r.to&&a.value.eq(r.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(logger$3$1.makeError("transaction was replaced",Logger$1.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:t,receipt:n}))}}i++}}s||this.once("block",l)}}))),(t=>{s||this.once("block",l)})))}));if(s)return;this.once("block",l),a.push((()=>{this.removeListener("block",l)}))}if("number"==typeof n&&n>0){const t=setTimeout((()=>{u()||o(logger$3$1.makeError("timeout exceeded",Logger$1.errors.TIMEOUT,{timeout:n}))}),n);t.unref&&t.unref(),a.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return __awaiter$1(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return BigNumber$1.from(t)}catch(e){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getBalance",n);try{return BigNumber$1.from(r)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:t})}}))}getTransactionCount(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getTransactionCount",n);try{return BigNumber$1.from(r).toNumber()}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:t})}}))}getCode(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getCode",n);try{return hexlify$1(r)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:t})}}))}getStorageAt(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then((t=>hexValue(t)))}),i=yield this.perform("getStorageAt",r);try{return hexlify$1(i)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:t})}}))}_wrapTransaction(t,e,n){if(null!=e&&32!==hexDataLength(e))throw new Error("invalid response - sendTransaction");const r=t;return null!=e&&t.hash!==e&&logger$3$1.throwError("Transaction hash mismatch from Provider.sendTransaction.",Logger$1.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=(e,r)=>__awaiter$1(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==r&&(r=0),0!==e&&null!=n&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const o=yield this._waitForTransaction(t.hash,e,r,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&logger$3$1.throwError("transaction failed",Logger$1.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),r}sendTransaction(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>hexlify$1(t))),n=this.formatter.transaction(t);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,t,r)}catch(t){throw t.transaction=n,t.transactionHash=n.hash,t}}))}_getTransactionRequest(t){return __awaiter$1(this,void 0,void 0,(function*(){const e=yield t,n={};return["from","to"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?BigNumber$1.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?hexlify$1(t):null)))})),this.formatter.transactionRequest(yield resolveProperties(n))}))}_getFilter(t){return __awaiter$1(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((n=>{null!=t[n]&&(e[n]=t[n])})),["fromBlock","toBlock"].forEach((n=>{null!=t[n]&&(e[n]=this._getBlockTag(t[n]))})),this.formatter.filter(yield resolveProperties(e))}))}_call(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){n>=MAX_CCIP_REDIRECTS&&logger$3$1.throwError("CCIP read exceeded maximum redirections",Logger$1.errors.SERVER_ERROR,{redirects:n,transaction:t});const r=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(n>=0&&"latest"===e&&null!=r&&"0x556f1830"===i.substring(0,10)&&hexDataLength(i)%32==4)try{const o=hexDataSlice(i,4),a=hexDataSlice(o,0,32);BigNumber$1.from(a).eq(r)||logger$3$1.throwError("CCIP Read sender did not match",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const s=[],u=BigNumber$1.from(hexDataSlice(o,32,64)).toNumber(),l=BigNumber$1.from(hexDataSlice(o,u,u+32)).toNumber(),c=hexDataSlice(o,u+32);for(let e=0;e<l;e++){const n=_parseString(c,32*e);null==n&&logger$3$1.throwError("CCIP Read contained corrupt URL string",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s.push(n)}const h=_parseBytes(o,64);BigNumber$1.from(hexDataSlice(o,100,128)).isZero()||logger$3$1.throwError("CCIP Read callback selector included junk",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=hexDataSlice(o,96,100),d=_parseBytes(o,128),p=yield this.ccipReadFetch(t,h,s);null==p&&logger$3$1.throwError("CCIP Read disabled or provided no URLs",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const g={to:r,data:hexConcat([f,encodeBytes([p,d])])};return this._call(g,e,n+1)}catch(t){if(t.code===Logger$1.errors.SERVER_ERROR)throw t}try{return hexlify$1(i)}catch(n){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:n})}}))}call(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)}))}estimateGas(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield resolveProperties({transaction:this._getTransactionRequest(t)}),n=yield this.perform("estimateGas",e);try{return BigNumber$1.from(n)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:n,error:t})}}))}_getAddress(t){return __awaiter$1(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&logger$3$1.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&logger$3$1.throwError("ENS name not configured",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let n=-128;const r={includeTransactions:!!e};if(isHexString$1(t,32))r.blockHash=t;else try{r.blockTag=yield this._getBlockTag(t),isHexString$1(r.blockTag)&&(n=parseInt(r.blockTag.substring(2),16))}catch(e){logger$3$1.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return poll((()=>__awaiter$1(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",r);if(null==t)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(e){let e=null;for(let n=0;n<t.transactions.length;n++){const r=t.transactions[n];if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}}const n=this.formatter.blockWithTransactions(t);return n.transactions=n.transactions.map((t=>this._wrapTransaction(t))),n}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return poll((()=>__awaiter$1(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return poll((()=>__awaiter$1(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return r}))),{oncePoll:this})}))}getLogs(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield resolveProperties({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);return n.forEach((t=>{null==t.removed&&(t.removed=!1)})),Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return __awaiter$1(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return __awaiter$1(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&logger$3$1.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return __awaiter$1(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const n=yield this._getResolver(e,"getResolver");if(null!=n){const r=new Resolver(this,n,t);return e===t||(yield r.supportsWildcard())?r:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return __awaiter$1(this,void 0,void 0,(function*(){null==e&&(e="ENS");const n=yield this.getNetwork();n.ensAddress||logger$3$1.throwError("network does not support ENS",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name});try{const e=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+namehash(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return __awaiter$1(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(isHexString$1(t))throw e}"string"!=typeof t&&logger$3$1.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return __awaiter$1(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e,"lookupAddress");if(null==n)return null;const r=_parseString(yield this.call({to:n,data:"0x691f3431"+namehash(e).substring(2)}),0);return(yield this.resolveName(r))!=t?null:r}))}getAvatar(t){return __awaiter$1(this,void 0,void 0,(function*(){let e=null;if(isHexString$1(t)){const n=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;e=new Resolver(this,r,n);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==Logger$1.errors.CALL_EXCEPTION)throw t}try{const t=_parseString(yield this.call({to:r,data:"0x691f3431"+namehash(n).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==Logger$1.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const n=yield e.getAvatar();return null==n?null:n.url}))}perform(t,e){return logger$3$1.throwError(t+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,n){const r=new Event(getEventTag(t),e,n);return this._events.push(r),this._startEvent(r),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,r=[],i=getEventTag(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),n=!0,!t.once||(r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),n}listenerCount(t){if(!t)return this._events.length;let e=getEventTag(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=getEventTag(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const n=[];let r=!1,i=getEventTag(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!r||(r=!0,n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const n=getEventTag(t);this._events=this._events.filter((t=>t.tag!==n||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var __awaiter=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$2$1=new Logger$1(version$1$1),errorGas=["call","estimateGas"];function spelunk(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const n=isHexString$1(t.data)?t.data:null;if(!e||n)return{message:t.message,data:n}}if("object"==typeof t){for(const n in t){const r=spelunk(t[n],e);if(r)return r}return null}if("string"==typeof t)try{return spelunk(JSON.parse(t),e)}catch(t){}return null}function checkError(t,e,n){const r=n.transaction||n.signedTransaction;if("call"===t){const t=spelunk(e,!0);if(t)return t.data;logger$2$1.throwError("missing revert data in call exception; Transaction reverted without a reason string",Logger$1.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if("estimateGas"===t){let n=spelunk(e.body,!1);null==n&&(n=spelunk(e,!1)),n&&logger$2$1.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:t,transaction:r,error:e})}let i=e.message;throw e.code===Logger$1.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&logger$2$1.throwError("insufficient funds for intrinsic transaction cost",Logger$1.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/nonce (is )?too low/i)&&logger$2$1.throwError("nonce has already been used",Logger$1.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&logger$2$1.throwError("replacement fee too low",Logger$1.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/only replay-protected/i)&&logger$2$1.throwError("legacy pre-eip-155 transactions not supported",Logger$1.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:r}),errorGas.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&logger$2$1.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}function timer(t){return new Promise((function(e){setTimeout(e,t)}))}function getResult(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function getLowerCase(t){return t?t.toLowerCase():t}const _constructorGuard$4={};class JsonRpcSigner extends Signer{constructor(t,e,n){if(super(),t!==_constructorGuard$4)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");defineReadOnly(this,"provider",e),null==n&&(n=0),"string"==typeof n?(defineReadOnly(this,"_address",this.provider.formatter.address(n)),defineReadOnly(this,"_index",null)):"number"==typeof n?(defineReadOnly(this,"_index",n),defineReadOnly(this,"_address",null)):logger$2$1.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return logger$2$1.throwError("cannot alter JSON-RPC Signer connection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UncheckedJsonRpcSigner(_constructorGuard$4,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&logger$2$1.throwError("unknown account #"+this._index,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=shallowCopy(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const n=shallowCopy(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>__awaiter(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&logger$2$1.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),resolveProperties({tx:resolveProperties(t),sender:e}).then((({tx:e,sender:n})=>{null!=e.from?e.from.toLowerCase()!==n&&logger$2$1.throwArgumentError("from address mismatch","transaction",t):e.from=n;const r=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((t=>t),(t=>checkError("sendTransaction",t,r)))}))}signTransaction(t){return logger$2$1.throwError("signing transactions is unsupported",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return __awaiter(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield poll((()=>__awaiter(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(n);if(null!==t)return this.provider._wrapTransaction(t,n,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=n,t}}))}signMessage(t){return __awaiter(this,void 0,void 0,(function*(){const e="string"==typeof t?toUtf8Bytes(t):t,n=yield this.getAddress();return yield this.provider.send("personal_sign",[hexlify$1(e),n.toLowerCase()])}))}_legacySignMessage(t){return __awaiter(this,void 0,void 0,(function*(){const e="string"==typeof t?toUtf8Bytes(t):t,n=yield this.getAddress();return yield this.provider.send("eth_sign",[n.toLowerCase(),hexlify$1(e)])}))}_signTypedData(t,e,n){return __awaiter(this,void 0,void 0,(function*(){const r=yield TypedDataEncoder.resolveNames(t,e,n,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(r.domain,e,r.value))])}))}unlock(t){return __awaiter(this,void 0,void 0,(function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))}}class UncheckedJsonRpcSigner extends JsonRpcSigner{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const allowedTransactionKeys={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class JsonRpcProvider extends BaseProvider{constructor(t,e){let n=e;null==n&&(n=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(n),t||(t=getStatic(this.constructor,"defaultUrl")()),defineReadOnly(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(shallowCopy(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return __awaiter(this,void 0,void 0,(function*(){yield timer(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=getStatic(this.constructor,"getNetwork");try{return e(BigNumber$1.from(t).toNumber())}catch(e){return logger$2$1.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return logger$2$1.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new JsonRpcSigner(_constructorGuard$4,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:deepCopy(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(r&&this._cache[t])return this._cache[t];const i=fetchJson(this.connection,JSON.stringify(n),getResult).then((t=>(this.emit("debug",{action:"response",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:n,provider:this}),t}));return r&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase(e.address),e.blockTag]];case"getCode":return["eth_getCode",[getLowerCase(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase(e.address),hexZeroPad$1(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[getStatic(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[getStatic(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=getLowerCase(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return __awaiter(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&BigNumber$1.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=shallowCopy(e)).transaction=shallowCopy(t),delete e.transaction.type)}}const n=this.prepareRequest(t,e);null==n&&logger$2$1.throwError(t+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(n){return checkError(t,n,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;let r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return timer(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){r()}),0),null;t.send("eth_uninstallFilter",[n])})).catch((t=>{}))}(),n})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=shallowCopy(allowedTransactionKeys);if(e)for(const t in e)e[t]&&(n[t]=!0);checkProperties(t,n);const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const n=hexValue(BigNumber$1.from(t[e]));"gasLimit"===e&&(e="gas"),r[e]=n})),["from","to","data"].forEach((function(e){null!=t[e]&&(r[e]=hexlify$1(t[e]))})),t.accessList&&(r.accessList=accessListify(t.accessList)),r}}const logger$1$1=new Logger$1(version$1$1);let _nextId=1;function buildWeb3LegacyFetcher(t,e){const n="Web3LegacyFetcher";return function(t,r){const i={method:t,params:r,id:_nextId++,jsonrpc:"2.0"};return new Promise(((t,r)=>{this.emit("debug",{action:"request",fetcher:n,request:deepCopy(i),provider:this}),e(i,((e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:n,error:e,request:i,provider:this}),r(e);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const t=new Error(o.error.message);return t.code=o.error.code,t.data=o.error.data,r(t)}t(o.result)}))}))}}function buildEip1193Fetcher(t){return function(e,n){null==n&&(n=[]);const r={method:e,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:deepCopy(r),provider:this}),t.request(r).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:t,provider:this}),t}))}}class Web3Provider extends JsonRpcProvider{constructor(t,e){null==t&&logger$1$1.throwArgumentError("missing provider","provider",t);let n=null,r=null,i=null;"function"==typeof t?(n="unknown:",r=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),i=t,t.request?(""===n&&(n="eip-1193:"),r=buildEip1193Fetcher(t)):t.sendAsync?r=buildWeb3LegacyFetcher(t,t.sendAsync.bind(t)):t.send?r=buildWeb3LegacyFetcher(t,t.send.bind(t)):logger$1$1.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,e),defineReadOnly(this,"jsonRpcFetchFunc",r),defineReadOnly(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const version$j="units/5.6.1",logger$q=new Logger$1(version$j),names$1=["wei","kwei","mwei","gwei","szabo","finney","ether"];function parseUnits$1(t,e){if("string"!=typeof t&&logger$q.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=names$1.indexOf(e);-1!==t&&(e=3*t)}return parseFixed$1(t,null!=e?e:18)}function _optionalChain$3$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}class Transaction{constructor({blockchain:t,from:e,to:n,value:r,api:i,method:o,params:a,sent:s,confirmed:u,failed:l}){this.blockchain=t,this.from=e,this.to=n,this.value=_optionalChain$3$1([Transaction,"access",t=>t.bigNumberify,"call",e=>e(r,t),"optionalAccess",t=>t.toString,"call",t=>t()]),this.api=i,this.method=o,this.params=a,this.sent=s,this.confirmed=u,this.failed=l,this._confirmed=!1,this._failed=!1}async prepare({wallet:t}){this.from=await t.account()}static bigNumberify(t,e){return"number"==typeof t?parseUnits$1(t.toString(),CONSTANTS$4[e].DECIMALS):t&&t.toString?BigNumber$1.from(t.toString()):t}getContractArguments(){let t=this.getContract().interface.fragments.find((t=>t.name==this.method));if(this.params instanceof Array)return this.params;if(this.params instanceof Object)return t.inputs.map((t=>this.params[t.name]));throw"Contract params have wrong type!"}getContract(){return new Contract(this.to,this.api)}async getData(){return(await this.getContract().populateTransaction[this.method].apply(null,this.getContractArguments())).data}confirmation(){return this._confirmed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.confirmed;this.confirmed=()=>{n&&n(this),t(this)}}))}failure(){return this._failed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.failed;this.failed=()=>{n&&n(this),t(this)}}))}}const sendTransaction$2=async({transaction:t,wallet:e})=>{t=new Transaction(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new Web3Provider(window.ethereum,"any"),r=n.getSigner(0);return await executeSubmit$2({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t},executeSubmit$2=({transaction:t,provider:e,signer:n})=>t.method?submitContractInteraction$2({transaction:t,signer:n,provider:e}):submitSimpleTransfer$2({transaction:t,signer:n}),submitContractInteraction$2=({transaction:t,signer:e,provider:n})=>{let r=new Contract(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:Transaction.bigNumberify(t.value,t.blockchain)})},submitSimpleTransfer$2=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:Transaction.bigNumberify(t.value,t.blockchain)});function _optionalChain$2$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}class Web3Wallet{static __initStatic(){this.info={name:"Web3 Wallet",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 446.42 376.77'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M408.69,171.4H473.4V107.77a46.55,46.55,0,0,0-46.55-46.55H73.53A46.55,46.55,0,0,0,27,107.77v65.09H62.7L89.56,146a9.46,9.46,0,0,1,5.73-2.73h0l.41,0h78.59a47.2,47.2,0,1,1,82.63,39.56q-1.41,1.71-3,3.31t-3.31,3a47.21,47.21,0,0,1-76.31-26.9H100.21L73.34,189.07a9.43,9.43,0,0,1-5.73,2.73h0l-.41,0h-.07l-.48,0H27v74H55.83l18.25-18.24a9.39,9.39,0,0,1,5.73-2.74h0l.41,0h29.9a47.16,47.16,0,1,1,0,19H84.72L66.48,282.11a9.42,9.42,0,0,1-5.72,2.74h0l-.39,0H27V319H83.29a4,4,0,0,1,.49,0h.06l.41,0h0A9.41,9.41,0,0,1,90,321.78l28,28h57.66a47.2,47.2,0,1,1,81.48,40.9c-.6.67-1.22,1.32-1.86,2s-1.3,1.26-2,1.86a47.22,47.22,0,0,1-77.65-25.73H114.09a9.5,9.5,0,0,1-3.09-.52l-.08,0-.29-.11-.17-.07-.19-.08-.27-.12-.08,0a9.38,9.38,0,0,1-2.55-1.81l-28-28H27v53.46A46.55,46.55,0,0,0,73.53,438H426.86a46.55,46.55,0,0,0,46.54-46.55V327.82H408.69a78.22,78.22,0,0,1-78.21-78.21h0A78.22,78.22,0,0,1,408.69,171.4Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M247.91,359.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,359.29Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M246.55,152.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,152.71Z' transform='translate(-26.98 -61.22)'/%3E%3Ccircle class='cls-1' cx='129.39' cy='193.15' r='25.99'/%3E%3Cpath class='cls-1' d='M409.17,190h-.48a59.57,59.57,0,0,0-59.57,59.57h0a59.57,59.57,0,0,0,59.57,59.57h.48a59.58,59.58,0,0,0,59.58-59.57h0A59.58,59.58,0,0,0,409.17,190Zm14.45,90.61h-31l8.88-32.53a15.5,15.5,0,1,1,13.29,0Z' transform='translate(-26.98 -61.22)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.install=this.constructor.info.install,this.sendTransaction=t=>sendTransaction$2({wallet:this,transaction:t})}async account(){return(await this.accounts())[0]}async accounts(){if(!_optionalChain$2$1([window,"optionalAccess",t=>t.ethereum]))return[];return await window.ethereum.request({method:"eth_accounts"})}async connect(){if(!_optionalChain$2$1([window,"optionalAccess",t=>t.ethereum]))return[];return await window.ethereum.request({method:"eth_requestAccounts"})}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),window.ethereum.on("accountsChanged",n);break;case"accounts":n=t=>e(t),window.ethereum.on("accountsChanged",n);break;case"network":n=t=>e(Blockchain.findById(t).name),window.ethereum.on("chainChanged",n);break;case"disconnect":n=e,window.ethereum.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":window.ethereum.removeListener("accountsChanged",e);break;case"network":window.ethereum.removeListener("chainChanged",e);break;case"disconnect":window.ethereum.removeListener("disconnect",e)}return e}async connectedTo(t){const e=Blockchain.findById(await window.ethereum.request({method:"eth_chainId"}));return t?t===e.name:e.name}addNetwork(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);window.ethereum.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}switchTo(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}async sign(t){await this.account();let e=new Web3Provider(window.ethereum,"any").getSigner(0);return await e.signMessage(t)}}Web3Wallet.__initStatic();class Coinbase extends Web3Wallet{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://wallet.coinbase.com"}}}Coinbase.__initStatic();class MetaMask extends Web3Wallet{static __initStatic(){this.info={name:"MetaMask",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 485.93 450.56'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D.cls-2%7Bfill:%23e27726;stroke:%23e27726;%7D.cls-10,.cls-11,.cls-2,.cls-3,.cls-4,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9%7Bstroke-linecap:round;stroke-linejoin:round;%7D.cls-3%7Bfill:%23e37725;stroke:%23e37725;%7D.cls-4%7Bfill:%23d6c0b3;stroke:%23d6c0b3;%7D.cls-5%7Bfill:%23243447;stroke:%23243447;%7D.cls-6%7Bfill:%23cd6328;stroke:%23cd6328;%7D.cls-7%7Bfill:%23e37525;stroke:%23e37525;%7D.cls-8%7Bfill:%23f6851f;stroke:%23f6851f;%7D.cls-9%7Bfill:%23c1ae9e;stroke:%23c1ae9e;%7D.cls-10%7Bfill:%23171717;stroke:%23171717;%7D.cls-11%7Bfill:%23763e1a;stroke:%23763e1a;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M247.91,356.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,356.29Z' transform='translate(-7.97 -21.33)'/%3E%3Cpath class='cls-1' d='M246.55,149.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,149.71Z' transform='translate(-7.97 -21.33)'/%3E%3Ccircle class='cls-1' cx='148.4' cy='230.05' r='25.99'/%3E%3Cpolygon class='cls-2' points='461.28 0.5 272.06 141.03 307.05 58.12 461.28 0.5'/%3E%3Cpolygon class='cls-3' points='24.46 0.5 212.16 142.37 178.88 58.12 24.46 0.5'/%3E%3Cpolygon class='cls-3' points='393.2 326.26 342.81 403.47 450.63 433.14 481.63 327.97 393.2 326.26'/%3E%3Cpolygon class='cls-3' points='4.49 327.97 35.3 433.14 143.13 403.47 92.73 326.26 4.49 327.97'/%3E%3Cpolygon class='cls-3' points='137.04 195.8 107 241.25 214.06 246.01 210.26 130.96 137.04 195.8'/%3E%3Cpolygon class='cls-3' points='348.7 195.8 274.53 129.63 272.06 246.01 378.94 241.25 348.7 195.8'/%3E%3Cpolygon class='cls-3' points='143.13 403.47 207.41 372.09 151.88 328.73 143.13 403.47'/%3E%3Cpolygon class='cls-3' points='278.34 372.09 342.81 403.47 333.87 328.73 278.34 372.09'/%3E%3Cpolygon class='cls-4' points='342.81 403.47 278.34 372.09 283.47 414.12 282.9 431.81 342.81 403.47'/%3E%3Cpolygon class='cls-4' points='143.13 403.47 203.03 431.81 202.65 414.12 207.41 372.09 143.13 403.47'/%3E%3Cpolygon class='cls-5' points='203.98 300.97 150.35 285.18 188.2 267.88 203.98 300.97'/%3E%3Cpolygon class='cls-5' points='281.76 300.97 297.55 267.88 335.58 285.18 281.76 300.97'/%3E%3Cpolygon class='cls-6' points='143.13 403.47 152.25 326.26 92.73 327.97 143.13 403.47'/%3E%3Cpolygon class='cls-6' points='333.68 326.26 342.81 403.47 393.2 327.97 333.68 326.26'/%3E%3Cpolygon class='cls-6' points='378.94 241.25 272.06 246.01 281.95 300.97 297.74 267.88 335.77 285.18 378.94 241.25'/%3E%3Cpolygon class='cls-6' points='150.35 285.18 188.39 267.88 203.98 300.97 214.06 246.01 107 241.25 150.35 285.18'/%3E%3Cpolygon class='cls-7' points='107 241.25 151.88 328.73 150.35 285.18 107 241.25'/%3E%3Cpolygon class='cls-7' points='335.77 285.18 333.87 328.73 378.94 241.25 335.77 285.18'/%3E%3Cpolygon class='cls-7' points='214.06 246.01 203.98 300.97 216.53 365.82 219.38 280.43 214.06 246.01'/%3E%3Cpolygon class='cls-7' points='272.06 246.01 266.93 280.24 269.21 365.82 281.95 300.97 272.06 246.01'/%3E%3Cpolygon class='cls-8' points='281.95 300.97 269.21 365.82 278.34 372.09 333.87 328.73 335.77 285.18 281.95 300.97'/%3E%3Cpolygon class='cls-8' points='150.35 285.18 151.88 328.73 207.41 372.09 216.53 365.82 203.98 300.97 150.35 285.18'/%3E%3Cpolygon class='cls-9' points='282.9 431.81 283.47 414.12 278.72 409.94 207.02 409.94 202.65 414.12 203.03 431.81 143.13 403.47 164.05 420.58 206.45 450.06 279.29 450.06 321.89 420.58 342.81 403.47 282.9 431.81'/%3E%3Cpolygon class='cls-10' points='278.34 372.09 269.21 365.82 216.53 365.82 207.41 372.09 202.65 414.12 207.02 409.94 278.72 409.94 283.47 414.12 278.34 372.09'/%3E%3Cpolygon class='cls-11' points='469.27 150.16 485.43 72.57 461.28 0.5 278.34 136.28 348.7 195.8 448.16 224.9 470.22 199.23 460.71 192.38 475.92 178.5 464.13 169.37 479.35 157.77 469.27 150.16'/%3E%3Cpolygon class='cls-11' points='0.5 72.57 16.66 150.16 6.39 157.77 21.61 169.37 10.01 178.5 25.22 192.38 15.71 199.23 37.58 224.9 137.04 195.8 207.41 136.28 24.46 0.5 0.5 72.57'/%3E%3Cpolygon class='cls-8' points='448.16 224.9 348.7 195.8 378.94 241.25 333.87 328.73 393.2 327.97 481.63 327.97 448.16 224.9'/%3E%3Cpolygon class='cls-8' points='137.04 195.8 37.58 224.9 4.49 327.97 92.73 327.97 151.88 328.73 107 241.25 137.04 195.8'/%3E%3Cpolygon class='cls-8' points='272.06 246.01 278.34 136.28 307.24 58.12 178.88 58.12 207.41 136.28 214.06 246.01 216.34 280.62 216.53 365.82 269.21 365.82 269.59 280.62 272.06 246.01'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://metamask.io/download.html"}}}function _optionalChain$1$2(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}MetaMask.__initStatic();const sendTransaction$1=async({transaction:t,wallet:e})=>{if(t=new Transaction(t),await t.prepare({wallet:e}),0==await e.connectedTo(t.blockchain))throw{code:"WRONG_NETWORK"};return await executeSubmit$1({transaction:t,wallet:e}).then((async e=>{if(!e)throw"Submitting transaction failed!";{let n=Blockchain.findByName(t.blockchain);t.id=e,t.url=n.explorerUrlFor({transaction:t}),t.sent&&t.sent(t);let r=await retrieveTransaction(e,t.blockchain);t.nonce=r.nonce,r?r.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t.id=e.replacement.hash,t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t.id=e.replacement.hash,t._failed=!0,t.failed&&t.failed(t,e)):(t._failed=!0,t.failed&&t.failed(t,e))})):(t._failed=!0,console.log("Error retrieving transaction"),t.failed&&t.failed(t,"Error retrieving transaction"))}})),t},retrieveTransaction=async(t,e)=>{let n;let r=1;for(n=await provider(e).getTransaction(t);r<=120&&!n;)n=await provider(e).getTransaction(t),await new Promise((t=>setTimeout(t,5e3))),r++;return n},executeSubmit$1=({transaction:t,wallet:e})=>t.method?submitContractInteraction$1({transaction:t,wallet:e}):submitSimpleTransfer$1({transaction:t,wallet:e}),submitContractInteraction$1=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:_optionalChain$1$2([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),data:await t.getData(),gas:(await estimate(t)).toString(),gasPrice:(await provider(t.blockchain).getGasPrice()).toString()}),submitSimpleTransfer$1=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:_optionalChain$1$2([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),gas:(await estimate(t)).toString(),gasPrice:(await provider(t.blockchain).getGasPrice()).toString()});function _optionalChain$5(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}const setConnectedInstance$1=t=>{window._connectedWalletConnectInstance=t},getConnectedInstance$1=()=>window._connectedWalletConnectInstance;class WalletConnect{static __initStatic(){this.info={name:"WalletConnect",logo:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 500 500' style='enable-background:new 0 0 500 500;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%235991CD;%7D%0A%3C/style%3E%3Cg id='Page-1'%3E%3Cg id='walletconnect-logo-alt'%3E%3Cpath id='WalletConnect' class='st0' d='M102.7,162c81.5-79.8,213.6-79.8,295.1,0l9.8,9.6c4.1,4,4.1,10.5,0,14.4L374,218.9 c-2,2-5.3,2-7.4,0l-13.5-13.2c-56.8-55.7-149-55.7-205.8,0l-14.5,14.1c-2,2-5.3,2-7.4,0L91.9,187c-4.1-4-4.1-10.5,0-14.4 L102.7,162z M467.1,229.9l29.9,29.2c4.1,4,4.1,10.5,0,14.4L362.3,405.4c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L252,311.9 c-1-1-2.7-1-3.7,0h0l-95.5,93.5c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L3.4,273.6c-4.1-4-4.1-10.5,0-14.4l29.9-29.2 c4.1-4,10.7-4,14.8,0l95.5,93.5c1,1,2.7,1,3.7,0c0,0,0,0,0,0l95.5-93.5c4.1-4,10.7-4,14.8,0c0,0,0,0,0,0l95.5,93.5 c1,1,2.7,1,3.7,0l95.5-93.5C456.4,225.9,463,225.9,467.1,229.9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=WalletConnect.instance||this.newWalletConnectInstance(),this.sendTransaction=t=>sendTransaction$1({wallet:this,transaction:t})}newWalletConnectInstance(){let t=new _WalletConnect$WalletConnectClient({bridge:"https://bridge.walletconnect.org",qrcodeModal:_WalletConnect$QRCodeModal});return t.on("connect",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("session_update",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("disconnect",((t,e)=>{if(setConnectedInstance$1(void 0),t)throw t})),t.on("modal_closed",(()=>{setConnectedInstance$1(void 0),this.connector=void 0})),t}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){try{window.localStorage.removeItem("walletconnect"),null==this.connector&&(this.connector=this.newWalletConnectInstance()),this.connector.connected&&(await this.connector.killSession(),setConnectedInstance$1(void 0),this.connector=this.newWalletConnectInstance());const{accounts:e,chainId:n}=await this.connector.connect({chainId:_optionalChain$5([t,"optionalAccess",t=>t.chainId])});return e instanceof Array&&e.length&&setConnectedInstance$1(this),this.connectedAccounts=e,this.connectedChainId=n,e}catch(t){return console.log("WALLETCONNECT ERROR",t),[]}}async connectedTo(t){let e=await this.connector.sendCustomRequest({method:"eth_chainId"});const n=Blockchain.findById(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}addNetwork(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}on(t,e){let n;switch(t){case"account":n=(t,n)=>{const{accounts:r}=n.params[0];r instanceof Array&&e(r[0])},this.connector.on("session_update",n);break;case"accounts":n=(t,n)=>{const{accounts:r}=n.params[0];e(r)},this.connector.on("session_update",n);break;case"network":n=(t,n)=>{const{chainId:r}=n.params[0];r&&e(Blockchain.findByNetworkId(r).name)},this.connector.on("session_update",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":case"network":this.connector.off("session_update");break;case"disconnect":this.connector.off("disconnect")}}async sign(t){let e=await this.account();var n=[toUtf8Bytes(t),e];return await this.connector.signPersonalMessage(n)}}WalletConnect.__initStatic();const sendTransaction=async({transaction:t,wallet:e})=>{t=new Transaction(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new Web3Provider(e.connector,"any"),r=n.getSigner(0);return await executeSubmit({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t},executeSubmit=({transaction:t,provider:e,signer:n})=>t.method?submitContractInteraction({transaction:t,signer:n,provider:e}):submitSimpleTransfer({transaction:t,signer:n}),submitContractInteraction=({transaction:t,signer:e,provider:n})=>{let r=new Contract(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:Transaction.bigNumberify(t.value,t.blockchain)})},submitSimpleTransfer=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:Transaction.bigNumberify(t.value,t.blockchain)}),setConnectedInstance=t=>{window._connectedWalletLinkInstance=t},getConnectedInstance=()=>window._connectedWalletLinkInstance;class WalletLink{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://www.coinbase.com/wallet"}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=WalletLink.instance||this.newWalletLinkInstance(),this.sendTransaction=t=>sendTransaction({wallet:this,transaction:t})}newWalletLinkInstance(){return new _CoinbaseWalletSdk$CoinbaseWalletSDK({}).makeWeb3Provider()}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){(await this.connector._relayProvider()).setConnectDisabled(!1);let e=await this.connector.enable();return e instanceof Array&&e.length&&setConnectedInstance(this),this.connectedAccounts=e,this.connectedChainId=await this.connector.getChainId(),e}async connectedTo(t){let e=await this.connector.getChainId();const n=Blockchain.findByNetworkId(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);this.connector.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}addNetwork(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);this.connector.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),this.connector.on("accountsChanged",n);break;case"accounts":n=t=>e(t),this.connector.on("accountsChanged",n);break;case"network":n=t=>e(Blockchain.findById(t).name),this.connector.on("chainChanged",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":this.connector.removeListener("accountsChanged",e);break;case"network":this.connector.removeListener("chainChanged",e);break;case"disconnect":this.connector.removeListener("disconnect",e)}return e}async sign(t){await this.account();let e=new Web3Provider(this.connector,"any").getSigner(0);return await e.signMessage(t)}}WalletLink.__initStatic();const wallets={MetaMask:MetaMask,Coinbase:Coinbase,Web3Wallet:Web3Wallet,WalletConnect:WalletConnect,WalletLink:WalletLink},instances={},getWalletClass=function(){return getConnectedInstance$1()?wallets.WalletConnect:getConnectedInstance()?wallets.WalletLink:"object"==typeof window.ethereum&&window.ethereum.isMetaMask?wallets.MetaMask:"object"==typeof window.ethereum&&(window.ethereum.isCoinbaseWallet||window.ethereum.isWalletLink)?wallets.Coinbase:void 0!==window.ethereum?wallets.Web3Wallet:void 0},getWallet=function(){const t=getWalletClass(),e=instances[t];return getConnectedInstance$1()?getConnectedInstance$1():getConnectedInstance()?getConnectedInstance():e||(t?(instances[t]=new t,instances[t]):void 0)};var SelectWalletDialog=function(t){var e=_slicedToArray(react.useState(!1),2),n=e[0],r=e[1],i=react.useContext(NavigateStackContext).navigate,o=getWallet();react.useEffect((function(){_asyncToGenerator(regenerator.mark((function e(){var n;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=5;break}return e.next=3,o.accounts();case 3:null!=(n=e.sent)&&0!=n.length||(i("ConnectingWallet"),t.connect(o));case 5:case"end":return e.stop()}}),e)})))()}),[o]);var a=[wallets.WalletConnect,wallets.WalletLink];o&&a.unshift(o.constructor);var s=a.map((function(e,n){var r=e.info.name;return"WalletConnect"==r&&(r="via WalletConnect"),react.createElement("div",{key:n,className:"PaddingBottomXS"},react.createElement("button",{className:"Card small",title:"Connect ".concat(r),onClick:function(){return function(e){var n=new e;t.setWallet(n),i("ConnectingWallet"),t.connect(n)}(e)}},react.createElement("div",{className:"CardImage square"},react.createElement("img",{className:"transparent",src:e.info.logo})),react.createElement("div",{className:"CardBody"},react.createElement("div",{className:"CardBodyWrapper PaddingLeftXS"},react.createElement("h2",{className:"CardText FontWeightBold"},r)))))}));return react.createElement(Dialog,{header:react.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM TextLeft"},react.createElement("h1",{className:"LineHeightL FontSizeL"},"Select a wallet")),body:react.createElement("div",{className:"PaddingBottomS PaddingLeftS PaddingRightS"},s),footer:react.createElement("div",{className:"PaddingBottomS"},react.createElement("button",{className:"FontSizeS FontWeightBold TextButton",onClick:function(){return r(!n)}},react.createElement("strong",{className:"Opacity05"},"What is a wallet?")),n&&react.createElement("p",{className:"PaddingLeftM PaddingRightM"},"Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))})},ConnectStack=function(t){var e=react.useContext(ClosableContext),n=e.open,r=e.close,i=_slicedToArray(react.useState(),2),o=i[0],a=i[1],s=_slicedToArray(react.useState(),2),u=s[0],l=s[1],c=function(e){e.connect().then(_asyncToGenerator(regenerator.mark((function n(){var i;return regenerator.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.accounts();case 2:(i=n.sent)instanceof Array&&i.length>0&&(t.autoClose&&r(),t.resolve&&t.resolve({wallet:e,account:i[0],accounts:i}));case 4:case"end":return n.stop()}}),n)})))).catch((function(e){a(!1),4001!=(null==e?void 0:e.code)&&(-32002!=(null==e?void 0:e.code)?t.reject&&t.reject(e):a(!0))}))};return react.useEffect((function(){var t=getWallet();t&&l(t)}),[]),react.useEffect((function(){_asyncToGenerator(regenerator.mark((function e(){var n;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=5;break}return e.next=3,u.accounts();case 3:(n=e.sent)instanceof Array&&n.length>0&&t.resolve&&t.resolve({wallet:u,account:n[0],accounts:n});case 5:case"end":return e.stop()}}),e)})))()}),[u]),react.createElement(ReactDialogStack,{open:n,close:r,start:"SelectWallet",container:t.container,document:t.document,dialogs:{SelectWallet:react.createElement(SelectWalletDialog,{setWallet:l,connect:c}),ConnectingWallet:react.createElement(ConnectingWalletDialog,{wallet:u,pending:o,connect:c})}})},ensureDocument=function(t){return void 0===t?window.document:t};function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var ErrorContext=react.createContext(),ErrorGraphic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAGHCAMAAADx+xo1AAAAeFBMVEVHcEweFhTcf2s2ERDegW3egWw1EBDbg2s1EBD/h4fSfWM1EBD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DWcTeoQJSF4LkRFK4YjFIDzkEgnApEqQHnIBDOiugKwXMQCOvHkWrA8/thy2jGmEoOYSG4FQRmFzC6GTEWgs9IZgKMXs3BqwErpJsQh4FOAUc7TkoDzgiiAvFtBpgRsqeLWgPOGN+QqDXgjPFdOdpC8AwF+4SE/9u7gxWHYRiKonkITMAL4///2XEndFzquEEhBJW5Z9GNQV3o2VEaaBrTMMx5h0fZow6Xgu/SXqJRN9menTx1+5jysw73A1/ESu3K78e50eG1TpT/4MdIi15ZHck9Aw6KSQspCEXd5/5Xc5ZNdVT6d0R5K8t/pplcd6S24DlI1rpjfayQghA0ZfVz75bBUYq6tkAGQtBgsnf7COdT6uQcIQMhhAoACbidYgWABNxN8s4AJp80mQFIQAhyHgHZ5JXKzgFAAKLwJKCsvf0elt/q0P84jrZvLlvP8toe5Jxnaf2r1NpPAAI5bp6ZrrFVov/B6KT5L4DXVcQ9Lm+UXHg2FMIlnfecCQt9D4jtCQAAAAAAAAAAAABvfgCECMuQGDaxMAAAAABJRU5ErkJggg==";function _createSuper(t){var e=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(t);if(e){var i=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ErrorBoundary=function(t){_inherits(n,react.Component);var e=_createSuper(n);function n(t){return _classCallCheck(this,n),e.call(this,t)}return _createClass(n,[{key:"componentDidCatch",value:function(t,e){this.props.setError(t)}},{key:"render",value:function(){return this.props.children}}]),n}(),ErrorProvider=function(t){var e=_slicedToArray(react.useState(t.error),2),n=e[0],r=e[1],i=_slicedToArray(react.useState(!0),2),o=i[0],a=i[1],s=function(e){r(e),t.errorCallback&&t.errorCallback(e)},u=function(){a(!1),setTimeout(t.unmount,300)};return n?(console.log(n),react.createElement(ReactDialog,{container:t.container,close:u,open:o},react.createElement("div",{className:"Dialog ReactDialogAnimation"},react.createElement("div",{className:"DialogHeader"},react.createElement("div",{className:"PaddingTopS PaddingLeftS PaddingRightS"})),react.createElement("div",{className:"DialogBody TextCenter"},react.createElement("div",{className:"GraphicWrapper PaddingTopS"},react.createElement("img",{className:"Graphic",src:ErrorGraphic})),react.createElement("h1",{className:"LineHeightL Text FontSizeL PaddingTopS FontWeightBold"},"Oops, Something Went Wrong"),react.createElement("div",{className:"Text PaddingTopS PaddingBottomS PaddingLeftS PaddingRightS"},react.createElement("div",{className:"PaddingLeftS PaddingRightS"},react.createElement("pre",{className:"ErrorSnippetText"},n.toString())),react.createElement("div",{className:"PaddingTopS PaddingBottomS"},react.createElement("strong",{className:"FontSizeM PaddingTopS"},"If this keeps happening, please report it.")))),react.createElement("div",{className:"DialogFooter"},react.createElement("div",{className:"PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"},react.createElement("button",{className:"ButtonPrimary",onClick:u},"Try again")))))):react.createElement(ErrorContext.Provider,{value:{setError:s,errorCallback:t.errorCallback}},react.createElement(ErrorBoundary,{setError:s},t.children))},AlertStyle=function(t){return"\n\n .Alert {\n background: rgba(0,0,0,0.08);\n border-radius: 7px;\n font-weight: 500;\n padding: 8px;\n }\n "},BlockchainLogoStyle=function(t){return"\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n "},ButtonCircularStyle=function(){return"\n\n .ButtonCircular {\n border-radius: 9999px;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n "},ButtonPrimaryStyle=function(t){return"\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(t.colors.primary,";\n border-radius: 13px;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 21px;\n font-weight: 400;\n line-height: 45px;\n height: 58px;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n padding: 7px 0;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(t.colors.buttonText,";\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ")},CardStyle=function(t){return"\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 13px;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n min-height: 76px;\n padding: 16px 10px;\n width: 100%;\n }\n\n .Card.Row {\n border-radius: 0;\n margin-bottom: 0;\n box-shadow: none;\n min-height: 69px;\n padding: 7px 21px;\n border-top: 1px solid rgba(0,0,0,0.05);\n }\n\n .Card.Row .CardText {\n font-size: 19px;\n line-height: 40px;\n }\n\n .CardTokenSymbol {\n width: 40%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .CardTokenName {\n text-align: right;\n opacity: 0.5;\n width: 60%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .Card.Row .CardTokenName .CardText {\n font-size: 17px;\n }\n\n .Card.Row .CardImage {\n width: 40px;\n }\n\n .Card.Row .CardImage img {\n height: 30px;\n width: 30px;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 8px 8px;\n margin: 0;\n }\n\n .CardImage.small {\n width: 27px;\n }\n\n .CardImage.small img {\n height: 27px;\n width: 27px;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 7px;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 58px;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 27px;\n padding-left: 10px;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 9999px;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 45px;\n position: relative;\n vertical-align: middle;\n width: 45px;\n }\n\n .CardImage.square img {\n border-radius: 0;\n }\n\n .CardImage img.transparent {\n border: none;\n background: none;\n box-shadow: none;\n }\n \n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 15px;\n color: rgb(150,150,150);\n line-height: 20px;\n }\n \n .CardText, a .CardText {\n color: ".concat(t.colors.text,";\n flex: 1;\n font-size: 21px;\n line-height: 26px;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText.small, .CardText.small small {\n font-size: 18px;\n color: rgb(150,150,150);\n line-height: 20px;\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ")},DialogStyle=function(t){return"\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .contained .ReactDialog {\n position: absolute;\n height: 100%;\n min-height: 100%;\n width: 100%;\n min-width: 100%;\n }\n\n .contained .ReactDialogBackground {\n position: absolute;\n }\n\n .contained .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n top: 0;\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.2);\n border-radius: 13px;\n background: rgb(248,248,248);\n }\n\n @media (max-width: 450px) {\n\n .Dialog {\n border-radius: 0;\n width: 100%;\n }\n }\n\n @media (orientation: portrait) and (max-width: 800px) {\n\n .ReactDialogAnimation {\n width: 100%;\n }\n\n .ReactDialog {\n height: 100%;\n min-height: 100%;\n }\n\n .ReactDialogStack {\n align-items: flex-end;\n }\n\n .Dialog {\n align-content: stretch;\n border-radius: 13px;\n border-top-radius: 13px;\n display: flex;\n flex-direction: column;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogAnimation {\n margin-bottom: -100px !important;\n top: inherit !important;\n position: relative;\n transition: opacity 0.4s ease, margin-bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n margin-bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n align-items: flex-end;\n }\n }\n\n .DialogBody {\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\n }\n\n .DialogHeader {\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n min-height: 54px;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 48px;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\n height: 48px;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n line-height: 24px;\n min-height: 32px;\n position: relative;\n text-align: center;\n }\n\n "},FontStyle=function(t){return"\n\n *, div, div * {\n font-family: ".concat(t.fontFamily,";\n }\n\n .FontSizeS {\n font-size: 16px;\n }\n\n .FontSizeM {\n font-size: 19px;\n }\n\n .FontSizeL {\n font-size: 23px;\n }\n\n .FontSizeXL {\n font-size: 32px;\n }\n\n .FontSizeXXL {\n font-size: 42px;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ")},GraphicStyle=function(){return"\n\n .GraphicWrapper {\n display: block;\n }\n\n .Graphic {\n width: 50%;\n position: relative;\n }\n "},HeightStyle=function(){return"\n\n .MaxHeight {\n max-height: 320px;\n overflow-y: auto;\n }\n "},IconStyle=function(t){return"\n\n .Icon {\n fill : ".concat(t.colors.icons,";\n stroke : ").concat(t.colors.icons,";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .AlertIcon {\n height: 20px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 20px;\n fill: #e42626;\n stroke: transparent;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(t.colors.buttonText,";\n stroke : ").concat(t.colors.buttonText,";\n }\n\n .Loading {\n border: 3px solid ").concat(t.colors.primary,";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ")},ImageStyle=function(t){return"\n\n .MaxAmountImage {\n display: inline-block;\n padding-right: 6px;\n }\n \n .MaxAmountImage img {\n height: 16px;\n width: 16px;\n position: relative;\n top: 3px;\n }\n "},InputStyle=function(t){return"\n\n .Input {\n background: none;\n border: 1px solid transparent;\n margin: 0;\n outline: none !important;\n padding: 0 0 0 14px;\n width: 100%;\n }\n\n .Input::placeholder {\n color: rgb(210,210,210);\n }\n \n "},LinkStyle=function(t){return"\n\n .Link {\n color: ".concat(t.colors.primary,";\n cursor: pointer;\n text-decoration: none;\n }\n\n .Link:hover {\n filter: brightness(0.8);\n }\n\n .Link:active {\n filter: brightness(1.0);\n }\n ")},LoadingTextStyle=function(t){return"\n\n .LoadingText {\n color: ".concat(t.colors.buttonText,";\n display: inline-block;\n text-decoration: none;\n }\n\n @keyframes blink {\n 0% { opacity: .2; }\n 20% { opacity: 1; }\n 100% { opacity: .2; }\n }\n \n .LoadingText .dot {\n animation-name: blink;\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n }\n \n .LoadingText .dot:nth-child(2) {\n animation-delay: .2s;\n }\n \n .LoadingText .dot:nth-child(3) {\n animation-delay: .4s;\n }\n ")},OpacityStyle=function(t){return"\n\n .Opacity05 {\n opacity: 0.5;\n }\n "},PaddingStyle=function(){return"\n\n .PaddingTopXS {\n padding-top: 3px;\n }\n\n .PaddingRightXS {\n padding-right: 3px;\n }\n\n .PaddingBottomXS {\n padding-bottom: 3px;\n }\n\n .PaddingLeftXS {\n padding-left: 3px; \n }\n\n .PaddingTopS {\n padding-top: 13px;\n }\n\n .PaddingRightS {\n padding-right: 13px;\n }\n\n .PaddingBottomS {\n padding-bottom: 13px;\n }\n\n .PaddingLeftS {\n padding-left: 13px; \n }\n\n .PaddingTopM {\n padding-top: 19px;\n }\n\n .PaddingRightM {\n padding-right: 19px;\n }\n\n .PaddingBottomM {\n padding-bottom: 19px;\n }\n\n .PaddingLeftM {\n padding-left: 19px; \n }\n\n .PaddingTopL {\n padding-top: 29px;\n }\n\n .PaddingRightL {\n padding-right: 29px;\n }\n\n .PaddingBottomL {\n padding-bottom: 29px;\n }\n\n .PaddingLeftL {\n padding-left: 29px; \n }\n "},PoweredByStyle=function(t){return'\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 3px;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .contained .PoweredByWrapper {\n position: absolute;\n }\n\n .PoweredByLink {\n color: white;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;\n font-size: 14px;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 8px;\n opacity: 0.5;\n text-decoration: none;\n text-shadow: black 0 0 2px;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: '.concat(t.colors.primary,";\n }\n ")},RangeSliderStyle=function(t){return"\n\n .rangeslider {\n margin: 20px 0;\n position: relative;\n background: #e6e6e6;\n -ms-touch-action: none;\n touch-action: none;\n }\n\n .rangeslider,\n .rangeslider__fill {\n display: block;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .rangeslider__handle {\n outline: none;\n cursor: pointer;\n display: inline-block;\n position: absolute;\n border-radius: 50%;\n background-color: "+t.colors.primary+";\n border: 1px solid white;\n box-shadow: 0 0 8px rgba(0,0,0,0.1);\n }\n\n .rangeslider__handle:hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n\n .rangeslider__handle:active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.3);\n }\n\n .rangeslider__active {\n opacity: 1;\n }\n\n .rangeslider__handle-tooltip {\n display: none;\n }\n\n .rangeslider-horizontal {\n height: 12px;\n border-radius: 10px;\n }\n\n .rangeslider-horizontal .rangeslider__fill {\n height: 100%;\n background-color: "+t.colors.primary+";\n border-radius: 10px;\n top: 0;\n }\n .rangeslider-horizontal .rangeslider__handle {\n width: 18px;\n height: 18px;\n border-radius: 30px;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n\n\n .rangeslider-horizontal .rangeslider__handle-tooltip {\n top: -55px;\n }\n\n "},ResetStyle=function(){return"\n\n html, body, div, span, applet, object, iframe,\n h1, h2, h3, h4, h5, h6, p, blockquote, pre,\n a, abbr, acronym, address, big, cite, code,\n del, dfn, em, img, ins, kbd, q, s, samp,\n small, strike, strong, sub, sup, tt, var,\n b, u, i, center,\n dl, dt, dd, ol, ul, li,\n fieldset, form, label, legend,\n table, caption, tbody, tfoot, thead, tr, th, td,\n article, aside, canvas, details, embed, \n figure, figcaption, footer, header, hgroup, \n menu, nav, output, ruby, section, summary,\n time, mark, audio, video {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n text-align: inherit;\n vertical-align: baseline;\n }\n\n article, aside, details, figcaption, figure, \n footer, header, hgroup, menu, nav, section {\n display: block;\n }\n\n body {\n line-height: 1;\n }\n\n ol, ul {\n list-style: none;\n }\n\n blockquote, q {\n quotes: none;\n }\n\n blockquote:before, blockquote:after,\n q:before, q:after {\n content: '';\n content: none;\n }\n \n table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n * {\n box-sizing: border-box;\n }\n\n button {\n border: 0;\n background: none;\n outline: none;\n }\n\n "},SearchStyle=function(t){return"\n\n .Search {\n border-radius: 13px;\n border: 1px solid rgba(0,0,0,0.2);\n outline: none !important;\n color: ".concat(t.colors.text,";\n font-size: 19px;\n padding: 13px;\n width: 100%;\n }\n\n .Search::placeholder {\n color: rgb(180,180,180);\n } \n\n .Search:focus, .Search:focus-visible {\n border: 1px solid ").concat(t.colors.primary,";\n }\n\n ")},SkeletonStyle=function(){return"\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n "},TableStyle=function(t){return"\n\n .Table {\n border-collapse: separate;\n border-radius: 7px;\n border-style: hidden;\n border: 1px solid rgba(0,0,0,0.1);\n width: 100%;\n }\n\n .Table tr.small td {\n font-size: 14px;\n }\n\n .Table tr td {\n border-bottom: 1px solid rgba(0,0,0,0.1);\n word-break: break-all;\n }\n \n .Table tr:last-child td {\n border-bottom: none;\n }\n \n .Table tr td {\n padding: 8px 15px;\n text-align: left;\n }\n \n .Table tr td:first-child {\n width: 30%\n }\n\n .Table tr td:last-child {\n width: 70%\n }\n \n .Table .TableSubTitle {\n font-weight: 300;\n opacity: 0.7;\n }\n\n .Table tr td:last-child {\n font-weight: 500;\n }\n "},TextButtonStyle=function(t){return"\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(t.colors.primary,"\n }\n\n .TextButton:hover * {\n opacity: 1.0;\n }\n ")},TextStyle=function(t){return"\n\n * {\n color: ".concat(t.colors.text,";\n }\n\n h1, h2, h3, h4, h5, h6 {\n display: block;\n }\n\n .Text {\n font-size: 16px;\n line-height: 24px\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .LineHeightL {\n line-height: 32px;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 19px;\n border: 8px solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 15px;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ")},TokenAmountStyle=function(){return"\n \n .TokenAmountRow {\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n\n .TokenAmountCell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .TokenSymbolCell {\n }\n "},TokenImageStyle=function(t){return"\n\n .TokenImage img {\n border-radius: 9999px;\n border: 1px solid white;\n background: white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 45px;\n position: relative;\n vertical-align: middle;\n width: 45px;\n }\n\n .TokenImage.medium img {\n height: 93px;\n width: 93px;\n }\n "},TooltipStyle=function(t){return"\n\n .Tooltip {\n background: ".concat(t.colors.primary,";\n border-radius: 10px;\n color: ").concat(t.colors.buttonText,";\n padding: 10px 13px;\n position: relative;\n box-shadow: 0 0 8px rgba(0,0,0,0.2);\n }\n\n .TooltipArrowUp {\n border-bottom: 10px solid ").concat(t.colors.primary,";\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n height: 0; \n left: 12px;\n position: absolute;\n top: -8px;\n width: 0; \n }\n ")},styleRenderer=function(t){var e,n;return t={colors:Object.assign({primary:"#ea357a",buttonText:"#ffffff",icons:"#000000",text:"#212529"},(null===(e=t)||void 0===e?void 0:e.colors)||{}),fontFamily:(null===(n=t)||void 0===n?void 0:n.fontFamily)||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},[ResetStyle(),DialogStyle(),ButtonCircularStyle(),ButtonPrimaryStyle(t),CardStyle(t),PoweredByStyle(t),GraphicStyle(),SkeletonStyle(),TokenAmountStyle(),TextStyle(t),FontStyle(t),IconStyle(t),OpacityStyle(),PaddingStyle(),HeightStyle(),LoadingTextStyle(t),RangeSliderStyle(t),InputStyle(),TextButtonStyle(t),ImageStyle(),BlockchainLogoStyle(),SearchStyle(t),TokenImageStyle(),AlertStyle(),TableStyle(),LinkStyle(t),TooltipStyle(t)].join("")},createRoot,m=reactDom;createRoot=m.createRoot;const insideContainerClass="ReactShadowDOMInsideContainer";function createInsideContainer({document:t,shadow:e,style:n,classes:r=[]}){const i=t.createElement("div");if(i.setAttribute("class",[insideContainerClass].concat(r).join(" ")),e.appendChild(i),n&&n.length){const r=t.createElement("style");r.type="text/css",r.appendChild(t.createTextNode(n)),e.appendChild(r)}return i}const outsideContainerClass="ReactShadowDOMOutsideContainer";function createOutsideContainer({document:t,element:e,style:n}){const r=t.createElement("div");return r.setAttribute("class",outsideContainerClass),r.setAttribute("style",n),e.appendChild(r),r}function createShadow(t){let e;return e=t.shadowRoot?t.shadowRoot:t.attachShadow({mode:"open"}),e}function trimStyle(t){return t.replace(/\s*[\r\n]\s*/g,"")}function unmount({insideRoot:t,outsideContainer:e}){t.unmount(),e.remove()}function ReactShadowDOM({document:t,element:e,content:n,outsideStyle:r="",insideStyle:i="",insideClasses:o=[]}){const a=createOutsideContainer({document:t,element:e,style:trimStyle(r)}),s=createInsideContainer({document:t,shadow:createShadow(a),style:trimStyle(i),classes:o});"function"==typeof n&&(n=n(s));const u=createRoot(s);return u.render(n),{content:n,unmount:()=>unmount({insideRoot:u,outsideContainer:a})}}var mount=function(t,e){var n=t.style,r=t.container,i=t.document,o=t.closed,a=styleRenderer(n);n&&n.css&&(a=[a,n.css].join(" "));var s;s=r?"\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ":"\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ";var u=ReactShadowDOM({document:i,element:r||i.body,content:e((function(){setTimeout((function(){u(),"function"==typeof o&&o()}),300)})),outsideStyle:s,insideStyle:a,insideClasses:r?["contained"]:[]}).unmount;return u},PoweredBy=function(){return react.createElement("div",{className:"PoweredByWrapper"},react.createElement("a",{href:"https://depay.fi?utm_source="+window.location.hostname+"&utm_medium=widget&utm_campaign=WidgetV2",rel:"noopener noreferrer",target:"_blank",className:"PoweredByLink"},"by DePay"))},requireReactVersion=function(){if(parseInt(react.version.split(".")[0])<17)throw"depay/widgets require at least React v17"},UpdatableProvider=function(t){var e=_slicedToArray(react.useState(!0),2),n=e[0],r=e[1];return react.createElement(UpdatableContext.Provider,{value:{updatable:n,setUpdatable:r}},t.children)},Connect=function(t){var e,n,r;return requireReactVersion(),"object"==_typeof(t)&&(e=t.style,n=t.error,r=t.document),new Promise(function(){var t=_asyncToGenerator(regenerator.mark((function t(i,o){var a,s;return regenerator.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a=getWallet())){t.next=7;break}return t.next=4,a.accounts();case 4:if(!((s=t.sent)instanceof Array&&s.length>0)){t.next=7;break}return t.abrupt("return",i({wallet:a,accounts:s,account:s[0]}));case 7:mount({style:e,document:ensureDocument(r)},(function(t){var e=function(){o("USER_CLOSED_DIALOG"),t()};return function(a){return react.createElement(ErrorProvider,{errorCallback:n,container:a,unmount:t},react.createElement(UpdatableProvider,null,react.createElement(ClosableProvider,{unmount:e},react.createElement(ConnectStack,{document:r,container:a,resolve:i,reject:o,autoClose:!0}),react.createElement(PoweredBy,null))))}}));case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},ChangableAmountContext=react.createContext(),ConfigurationContext=react.createContext(),ConversionRateContext=react.createContext();function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}var findMaxRoute=function(t){var e=_toConsumableArray(t).sort((function(t,e){var n=BigNumber$3.from(t.fromBalance).div(BigNumber$3.from(t.fromAmount)),r=BigNumber$3.from(e.fromBalance).div(BigNumber$3.from(e.fromAmount));return n.lt(r)?-1:r.lt(n)?1:0}));return e[e.length-1]},round$1=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",r=parseFloat(t),i=r.toString().match(/\d+\.0*(\d{3})/);if(null!==(e=i)&&void 0!==e&&e.length){var o,a,s=(i=i[0]).match(/\d{3}$/)[0];return s.match(/^00/)?r:(s.match(/^0/)?(o=parseFloat("".concat(s[1],".").concat(s[2])),a=parseFloat(o).toFixed(1),a="0".concat(a).replace(".","")):(o="up"==n?parseFloat("".concat(s[0],".").concat(s[1],"9")):parseFloat("".concat(s[0],".").concat(s[1],"1")),a=parseFloat(o).toFixed(1).replace(".","")),"0"!=a.toString()[0]&&a.toString().length>2?parseInt(r.toFixed(0)):parseFloat(i.replace(/\d{3}$/,a)))}return parseFloat(r.toFixed(2))},WalletContext=react.createContext(),lodash$1=createCommonjsModule$4((function(t,e){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,u=64,l=128,c=256,h=1/0,f=9007199254740991,d=NaN,p=4294967295,g=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",u],["rearg",c]],m="[object Arguments]",y="[object Array]",v="[object Boolean]",b="[object Date]",w="[object Error]",A="[object Function]",_="[object GeneratorFunction]",E="[object Map]",k="[object Number]",M="[object Object]",S="[object Promise]",x="[object RegExp]",C="[object Set]",T="[object String]",N="[object Symbol]",B="[object WeakMap]",$="[object ArrayBuffer]",P="[object DataView]",I="[object Float32Array]",R="[object Float64Array]",O="[object Int8Array]",L="[object Int16Array]",D="[object Int32Array]",F="[object Uint8Array]",j="[object Uint8ClampedArray]",U="[object Uint16Array]",H="[object Uint32Array]",z=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,Y=RegExp(W.source),V=RegExp(q.source),K=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),it=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",Mt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['’]",Tt="[\\ud800-\\udfff]",Nt="["+xt+"]",Bt="["+_t+"]",$t="\\d+",Pt="[\\u2700-\\u27bf]",It="["+kt+"]",Rt="[^\\ud800-\\udfff"+xt+$t+Et+kt+Mt+"]",Ot="\\ud83c[\\udffb-\\udfff]",Lt="[^\\ud800-\\udfff]",Dt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",jt="["+Mt+"]",Ut="(?:"+It+"|"+Rt+")",Ht="(?:"+jt+"|"+Rt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Gt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qt="(?:"+Bt+"|"+Ot+")"+"?",Wt="[\\ufe0e\\ufe0f]?",qt=Wt+Qt+("(?:\\u200d(?:"+[Lt,Dt,Ft].join("|")+")"+Wt+Qt+")*"),Yt="(?:"+[Pt,Dt,Ft].join("|")+")"+qt,Vt="(?:"+[Lt+Bt+"?",Bt,Dt,Ft,Tt].join("|")+")",Kt=RegExp(Ct,"g"),Jt=RegExp(Bt,"g"),Zt=RegExp(Ot+"(?="+Ot+")|"+Vt+qt,"g"),Xt=RegExp([jt+"?"+It+"+"+zt+"(?="+[Nt,jt,"$"].join("|")+")",Ht+"+"+Gt+"(?="+[Nt,jt+Ut,"$"].join("|")+")",jt+"?"+Ut+"+"+zt,jt+"+"+Gt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$t,Yt].join("|"),"g"),te=RegExp("[\\u200d\\ud800-\\udfff"+_t+St+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[I]=ie[R]=ie[O]=ie[L]=ie[D]=ie[F]=ie[j]=ie[U]=ie[H]=!0,ie[m]=ie[y]=ie[$]=ie[v]=ie[P]=ie[b]=ie[w]=ie[A]=ie[E]=ie[k]=ie[M]=ie[x]=ie[C]=ie[T]=ie[B]=!1;var oe={};oe[m]=oe[y]=oe[$]=oe[P]=oe[v]=oe[b]=oe[I]=oe[R]=oe[O]=oe[L]=oe[D]=oe[E]=oe[k]=oe[M]=oe[x]=oe[C]=oe[T]=oe[N]=oe[F]=oe[j]=oe[U]=oe[H]=!0,oe[w]=oe[A]=oe[B]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof commonjsGlobal$3&&commonjsGlobal$3&&commonjsGlobal$3.Object===Object&&commonjsGlobal$3,ce="object"==typeof self&&self&&self.Object===Object&&self,he=le||ce||Function("return this")(),fe=e&&!e.nodeType&&e,de=fe&&t&&!t.nodeType&&t,pe=de&&de.exports===fe,ge=pe&&le.process,me=function(){try{var t=de&&de.require&&de.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,ve=me&&me.isDate,be=me&&me.isMap,we=me&&me.isRegExp,Ae=me&&me.isSet,_e=me&&me.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ke(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ce(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Te(t,e){return!!(null==t?0:t.length)&&Fe(t,e,0)>-1}function Ne(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Be(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function $e(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Pe(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Re(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Oe=ze("length");function Le(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function De(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Fe(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):De(t,Ue,n)}function je(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Ue(t){return t!=t}function He(t,e){var n=null==t?0:t.length;return n?We(t,e)/n:d}function ze(t){return function(e){return null==e?n:e[t]}}function Ge(t){return function(e){return null==t?n:t[e]}}function Qe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function We(t,e){for(var r,i=-1,o=t.length;++i<o;){var a=e(t[i]);a!==n&&(r=r===n?a:r+a)}return r}function qe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ye(t){return t?t.slice(0,dn(t)+1).replace(it,""):t}function Ve(t){return function(e){return t(e)}}function Ke(t,e){return Be(e,(function(e){return t[e]}))}function Je(t,e){return t.has(e)}function Ze(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function Xe(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var en=Ge({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=Ge({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rn(t){return"\\"+ae[t]}function on(t){return te.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,r=t.length,i=0,a=[];++n<r;){var s=t[n];s!==e&&s!==o||(t[n]=o,a[i++]=n)}return a}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function hn(t){return on(t)?function(t){var e=Zt.lastIndex=0;for(;Zt.test(t);)++e;return e}(t):Oe(t)}function fn(t){return on(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.split("")}(t)}function dn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var pn=Ge({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var gn=function t(e){var ot,_t=(e=null==e?he:gn.defaults(he.Object(),e,gn.pick(he,ne))).Array,Et=e.Date,kt=e.Error,Mt=e.Function,St=e.Math,xt=e.Object,Ct=e.RegExp,Tt=e.String,Nt=e.TypeError,Bt=_t.prototype,$t=Mt.prototype,Pt=xt.prototype,It=e["__core-js_shared__"],Rt=$t.toString,Ot=Pt.hasOwnProperty,Lt=0,Dt=(ot=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"",Ft=Pt.toString,jt=Rt.call(xt),Ut=he._,Ht=Ct("^"+Rt.call(Ot).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:n,Gt=e.Symbol,Qt=e.Uint8Array,Wt=zt?zt.allocUnsafe:n,qt=sn(xt.getPrototypeOf,xt),Yt=xt.create,Vt=Pt.propertyIsEnumerable,Zt=Bt.splice,te=Gt?Gt.isConcatSpreadable:n,ae=Gt?Gt.iterator:n,le=Gt?Gt.toStringTag:n,ce=function(){try{var t=po(xt,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,de=Et&&Et.now!==he.Date.now&&Et.now,ge=e.setTimeout!==he.setTimeout&&e.setTimeout,me=St.ceil,Oe=St.floor,Ge=xt.getOwnPropertySymbols,mn=zt?zt.isBuffer:n,yn=e.isFinite,vn=Bt.join,bn=sn(xt.keys,xt),wn=St.max,An=St.min,_n=Et.now,En=e.parseInt,kn=St.random,Mn=Bt.reverse,Sn=po(e,"DataView"),xn=po(e,"Map"),Cn=po(e,"Promise"),Tn=po(e,"Set"),Nn=po(e,"WeakMap"),Bn=po(xt,"create"),$n=Nn&&new Nn,Pn={},In=Uo(Sn),Rn=Uo(xn),On=Uo(Cn),Ln=Uo(Tn),Dn=Uo(Nn),Fn=Gt?Gt.prototype:n,jn=Fn?Fn.valueOf:n,Un=Fn?Fn.toString:n;function Hn(t){if(is(t)&&!qa(t)&&!(t instanceof Wn)){if(t instanceof Qn)return t;if(Ot.call(t,"__wrapped__"))return Ho(t)}return new Qn(t)}var zn=function(){function t(){}return function(e){if(!rs(e))return{};if(Yt)return Yt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function Gn(){}function Qn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vn;++e<n;)this.add(t[e])}function Jn(t){var e=this.__data__=new Yn(t);this.size=e.size}function Zn(t,e){var n=qa(t),r=!n&&Wa(t),i=!n&&!r&&Ja(t),o=!n&&!r&&!i&&fs(t),a=n||r||i||o,s=a?qe(t.length,Tt):[],u=s.length;for(var l in t)!e&&!Ot.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ao(l,u))||s.push(l);return s}function Xn(t){var e=t.length;return e?t[Kr(0,e-1)]:n}function tr(t,e){return Do(Bi(t),lr(e,0,t.length))}function er(t){return Do(Bi(t))}function nr(t,e,r){(r!==n&&!za(t[e],r)||r===n&&!(e in t))&&sr(t,e,r)}function rr(t,e,r){var i=t[e];Ot.call(t,e)&&za(i,r)&&(r!==n||e in t)||sr(t,e,r)}function ir(t,e){for(var n=t.length;n--;)if(za(t[n][0],e))return n;return-1}function or(t,e,n,r){return pr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function ar(t,e){return t&&$i(e,Is(e),t)}function sr(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ur(t,e){for(var r=-1,i=e.length,o=_t(i),a=null==t;++r<i;)o[r]=a?n:Ts(t,e[r]);return o}function lr(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function cr(t,e,r,i,o,a){var s,u=1&e,l=2&e,c=4&e;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!rs(t))return t;var h=qa(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!u)return Bi(t,s)}else{var f=yo(t),d=f==A||f==_;if(Ja(t))return Mi(t,u);if(f==M||f==m||d&&!o){if(s=l||d?{}:bo(t),!u)return l?function(t,e){return $i(t,mo(t),e)}(t,function(t,e){return t&&$i(e,Rs(e),t)}(s,t)):function(t,e){return $i(t,go(t),e)}(t,ar(s,t))}else{if(!oe[f])return o?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case $:return Si(t);case v:case b:return new r(+t);case P:return function(t,e){var n=e?Si(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case R:case O:case L:case D:case F:case j:case U:case H:return xi(t,n);case E:return new r;case k:case T:return new r(t);case x:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new r;case N:return i=t,jn?xt(jn.call(i)):{}}var i}(t,f,u)}}a||(a=new Jn);var p=a.get(t);if(p)return p;a.set(t,s),ls(t)?t.forEach((function(n){s.add(cr(n,e,r,n,t,a))})):os(t)&&t.forEach((function(n,i){s.set(i,cr(n,e,r,i,t,a))}));var g=h?n:(c?l?ao:oo:l?Rs:Is)(t);return Me(g||t,(function(n,i){g&&(n=t[i=n]),rr(s,i,cr(n,e,r,i,t,a))})),s}function hr(t,e,r){var i=r.length;if(null==t)return!i;for(t=xt(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function fr(t,e,i){if("function"!=typeof t)throw new Nt(r);return Io((function(){t.apply(n,i)}),e)}function dr(t,e,n,r){var i=-1,o=Te,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Be(e,Ve(n))),r?(o=Ne,a=!1):e.length>=200&&(o=Je,a=!1,e=new Kn(e));t:for(;++i<s;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,a&&h==h){for(var f=l;f--;)if(e[f]===h)continue t;u.push(c)}else o(e,h,r)||u.push(c)}return u}Hn.templateSettings={escape:K,evaluate:J,interpolate:Z,variable:"",imports:{_:Hn}},Hn.prototype=Gn.prototype,Hn.prototype.constructor=Hn,Qn.prototype=zn(Gn.prototype),Qn.prototype.constructor=Qn,Wn.prototype=zn(Gn.prototype),Wn.prototype.constructor=Wn,qn.prototype.clear=function(){this.__data__=Bn?Bn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(t){var e=this.__data__;if(Bn){var r=e[t];return r===i?n:r}return Ot.call(e,t)?e[t]:n},qn.prototype.has=function(t){var e=this.__data__;return Bn?e[t]!==n:Ot.call(e,t)},qn.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bn&&e===n?i:e,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=ir(e,t);return!(n<0)&&(n==e.length-1?e.pop():Zt.call(e,n,1),--this.size,!0)},Yn.prototype.get=function(t){var e=this.__data__,r=ir(e,t);return r<0?n:e[r][1]},Yn.prototype.has=function(t){return ir(this.__data__,t)>-1},Yn.prototype.set=function(t,e){var n=this.__data__,r=ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(xn||Yn),string:new qn}},Vn.prototype.delete=function(t){var e=ho(this,t).delete(t);return this.size-=e?1:0,e},Vn.prototype.get=function(t){return ho(this,t).get(t)},Vn.prototype.has=function(t){return ho(this,t).has(t)},Vn.prototype.set=function(t,e){var n=ho(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(t){return this.__data__.set(t,i),this},Kn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Jn.prototype.get=function(t){return this.__data__.get(t)},Jn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!xn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vn(r)}return n.set(t,e),this.size=n.size,this};var pr=Ri(_r),gr=Ri(Er,!0);function mr(t,e){var n=!0;return pr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function yr(t,e,r){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(u===n?s==s&&!hs(s):r(s,u)))var u=s,l=a}return l}function vr(t,e){var n=[];return pr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function br(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=wo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?br(s,e-1,n,r,i):$e(i,s):r||(i[i.length]=s)}return i}var wr=Oi(),Ar=Oi(!0);function _r(t,e){return t&&wr(t,e,Is)}function Er(t,e){return t&&Ar(t,e,Is)}function kr(t,e){return Ce(e,(function(e){return ts(t[e])}))}function Mr(t,e){for(var r=0,i=(e=Ai(e,t)).length;null!=t&&r<i;)t=t[jo(e[r++])];return r&&r==i?t:n}function Sr(t,e,n){var r=e(t);return qa(t)?r:$e(r,n(t))}function xr(t){return null==t?t===n?"[object Undefined]":"[object Null]":le&&le in xt(t)?function(t){var e=Ot.call(t,le),r=t[le];try{t[le]=n;var i=!0}catch(t){}var o=Ft.call(t);i&&(e?t[le]=r:delete t[le]);return o}(t):function(t){return Ft.call(t)}(t)}function Cr(t,e){return t>e}function Tr(t,e){return null!=t&&Ot.call(t,e)}function Nr(t,e){return null!=t&&e in xt(t)}function Br(t,e,r){for(var i=r?Ne:Te,o=t[0].length,a=t.length,s=a,u=_t(a),l=1/0,c=[];s--;){var h=t[s];s&&e&&(h=Be(h,Ve(e))),l=An(h.length,l),u[s]=!r&&(e||o>=120&&h.length>=120)?new Kn(s&&h):n}h=t[0];var f=-1,d=u[0];t:for(;++f<o&&c.length<l;){var p=h[f],g=e?e(p):p;if(p=r||0!==p?p:0,!(d?Je(d,g):i(c,g,r))){for(s=a;--s;){var m=u[s];if(!(m?Je(m,g):i(t[s],g,r)))continue t}d&&d.push(g),c.push(p)}}return c}function $r(t,e,r){var i=null==(t=No(t,e=Ai(e,t)))?t:t[jo(Xo(e))];return null==i?n:Ee(i,t,r)}function Pr(t){return is(t)&&xr(t)==m}function Ir(t,e,r,i,o){return t===e||(null==t||null==e||!is(t)&&!is(e)?t!=t&&e!=e:function(t,e,r,i,o,a){var s=qa(t),u=qa(e),l=s?y:yo(t),c=u?y:yo(e),h=(l=l==m?M:l)==M,f=(c=c==m?M:c)==M,d=l==c;if(d&&Ja(t)){if(!Ja(e))return!1;s=!0,h=!1}if(d&&!h)return a||(a=new Jn),s||fs(t)?ro(t,e,r,i,o,a):function(t,e,n,r,i,o,a){switch(n){case P:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case $:return!(t.byteLength!=e.byteLength||!o(new Qt(t),new Qt(e)));case v:case b:case k:return za(+t,+e);case w:return t.name==e.name&&t.message==e.message;case x:case T:return t==e+"";case E:var s=an;case C:var u=1&r;if(s||(s=ln),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=ro(s(t),s(e),r,i,o,a);return a.delete(t),c;case N:if(jn)return jn.call(t)==jn.call(e)}return!1}(t,e,l,r,i,o,a);if(!(1&r)){var p=h&&Ot.call(t,"__wrapped__"),g=f&&Ot.call(e,"__wrapped__");if(p||g){var A=p?t.value():t,_=g?e.value():e;return a||(a=new Jn),o(A,_,r,i,a)}}if(!d)return!1;return a||(a=new Jn),function(t,e,r,i,o,a){var s=1&r,u=oo(t),l=u.length,c=oo(e).length;if(l!=c&&!s)return!1;var h=l;for(;h--;){var f=u[h];if(!(s?f in e:Ot.call(e,f)))return!1}var d=a.get(t),p=a.get(e);if(d&&p)return d==e&&p==t;var g=!0;a.set(t,e),a.set(e,t);var m=s;for(;++h<l;){var y=t[f=u[h]],v=e[f];if(i)var b=s?i(v,y,f,e,t,a):i(y,v,f,t,e,a);if(!(b===n?y===v||o(y,v,r,i,a):b)){g=!1;break}m||(m="constructor"==f)}if(g&&!m){var w=t.constructor,A=e.constructor;w==A||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof A&&A instanceof A||(g=!1)}return a.delete(t),a.delete(e),g}(t,e,r,i,o,a)}(t,e,r,i,Ir,o))}function Rr(t,e,r,i){var o=r.length,a=o,s=!i;if(null==t)return!a;for(t=xt(t);o--;){var u=r[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=r[o])[0],c=t[l],h=u[1];if(s&&u[2]){if(c===n&&!(l in t))return!1}else{var f=new Jn;if(i)var d=i(c,h,l,t,e,f);if(!(d===n?Ir(h,c,3,i,f):d))return!1}}return!0}function Or(t){return!(!rs(t)||(e=t,Dt&&Dt in e))&&(ts(t)?Ht:mt).test(Uo(t));var e}function Lr(t){return"function"==typeof t?t:null==t?au:"object"==typeof t?qa(t)?zr(t[0],t[1]):Hr(t):gu(t)}function Dr(t){if(!So(t))return bn(t);var e=[];for(var n in xt(t))Ot.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Fr(t){if(!rs(t))return function(t){var e=[];if(null!=t)for(var n in xt(t))e.push(n);return e}(t);var e=So(t),n=[];for(var r in t)("constructor"!=r||!e&&Ot.call(t,r))&&n.push(r);return n}function jr(t,e){return t<e}function Ur(t,e){var n=-1,r=Va(t)?_t(t.length):[];return pr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Hr(t){var e=fo(t);return 1==e.length&&e[0][2]?Co(e[0][0],e[0][1]):function(n){return n===t||Rr(n,t,e)}}function zr(t,e){return Eo(t)&&xo(e)?Co(jo(t),e):function(r){var i=Ts(r,t);return i===n&&i===e?Ns(r,t):Ir(e,i,3)}}function Gr(t,e,r,i,o){t!==e&&wr(e,(function(a,s){if(o||(o=new Jn),rs(a))!function(t,e,r,i,o,a,s){var u=$o(t,r),l=$o(e,r),c=s.get(l);if(c)return void nr(t,r,c);var h=a?a(u,l,r+"",t,e,s):n,f=h===n;if(f){var d=qa(l),p=!d&&Ja(l),g=!d&&!p&&fs(l);h=l,d||p||g?qa(u)?h=u:Ka(u)?h=Bi(u):p?(f=!1,h=Mi(l,!0)):g?(f=!1,h=xi(l,!0)):h=[]:ss(l)||Wa(l)?(h=u,Wa(u)?h=ws(u):rs(u)&&!ts(u)||(h=bo(l))):f=!1}f&&(s.set(l,h),o(h,l,i,a,s),s.delete(l));nr(t,r,h)}(t,e,s,r,Gr,i,o);else{var u=i?i($o(t,s),a,s+"",t,e,o):n;u===n&&(u=a),nr(t,s,u)}}),Rs)}function Qr(t,e){var r=t.length;if(r)return Ao(e+=e<0?r:0,r)?t[e]:n}function Wr(t,e,n){e=e.length?Be(e,(function(t){return qa(t)?function(e){return Mr(e,1===t.length?t[0]:t)}:t})):[au];var r=-1;e=Be(e,Ve(co()));var i=Ur(t,(function(t,n,i){var o=Be(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;for(;++r<a;){var u=Ci(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=Mr(t,a);n(s,a)&&ei(o,Ai(a,t),s)}return o}function Yr(t,e,n,r){var i=r?je:Fe,o=-1,a=e.length,s=t;for(t===e&&(e=Bi(e)),n&&(s=Be(t,Ve(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Zt.call(s,u,1),Zt.call(t,u,1);return t}function Vr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Ao(i)?Zt.call(t,i,1):di(t,i)}}return t}function Kr(t,e){return t+Oe(kn()*(e-t+1))}function Jr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=Oe(e/2))&&(t+=t)}while(e);return n}function Zr(t,e){return Ro(To(t,e,au),t+"")}function Xr(t){return Xn(zs(t))}function ti(t,e){var n=zs(t);return Do(n,lr(e,0,n.length))}function ei(t,e,r,i){if(!rs(t))return t;for(var o=-1,a=(e=Ai(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=jo(e[o]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var h=u[l];(c=i?i(h,l,u):n)===n&&(c=rs(h)?h:Ao(e[o+1])?[]:{})}rr(u,l,c),u=u[l]}return t}var ni=$n?function(t,e){return $n.set(t,e),t}:au,ri=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:ru(e),writable:!0})}:au;function ii(t){return Do(zs(t))}function oi(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=_t(i);++r<i;)o[r]=t[r+e];return o}function ai(t,e){var n;return pr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function si(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!hs(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ui(t,e,au,n)}function ui(t,e,r,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=r(e))!=e,u=null===e,l=hs(e),c=e===n;o<a;){var h=Oe((o+a)/2),f=r(t[h]),d=f!==n,p=null===f,g=f==f,m=hs(f);if(s)var y=i||g;else y=c?g&&(i||d):u?g&&d&&(i||!p):l?g&&d&&!p&&(i||!m):!p&&!m&&(i?f<=e:f<e);y?o=h+1:a=h}return An(a,4294967294)}function li(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!za(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function ci(t){return"number"==typeof t?t:hs(t)?d:+t}function hi(t){if("string"==typeof t)return t;if(qa(t))return Be(t,hi)+"";if(hs(t))return Un?Un.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function fi(t,e,n){var r=-1,i=Te,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=Ne;else if(o>=200){var l=e?null:Ji(t);if(l)return ln(l);a=!1,i=Je,u=new Kn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue t;e&&u.push(h),s.push(c)}else i(u,h,n)||(u!==s&&u.push(h),s.push(c))}return s}function di(t,e){return null==(t=No(t,e=Ai(e,t)))||delete t[jo(Xo(e))]}function pi(t,e,n,r){return ei(t,e,n(Mr(t,e)),r)}function gi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?oi(t,r?0:o,r?o+1:i):oi(t,r?o+1:0,r?i:o)}function mi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Pe(e,(function(t,e){return e.func.apply(e.thisArg,$e([t],e.args))}),n)}function yi(t,e,n){var r=t.length;if(r<2)return r?fi(t[0]):[];for(var i=-1,o=_t(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=dr(o[i]||a,t[s],e,n));return fi(br(o,1),e,n)}function vi(t,e,r){for(var i=-1,o=t.length,a=e.length,s={};++i<o;){var u=i<a?e[i]:n;r(s,t[i],u)}return s}function bi(t){return Ka(t)?t:[]}function wi(t){return"function"==typeof t?t:au}function Ai(t,e){return qa(t)?t:Eo(t,e)?[t]:Fo(As(t))}var _i=Zr;function Ei(t,e,r){var i=t.length;return r=r===n?i:r,!e&&r>=i?t:oi(t,e,r)}var ki=fe||function(t){return he.clearTimeout(t)};function Mi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function Si(t){var e=new t.constructor(t.byteLength);return new Qt(e).set(new Qt(t)),e}function xi(t,e){var n=e?Si(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ci(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=hs(t),s=e!==n,u=null===e,l=e==e,c=hs(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||i&&s&&l||!r&&l||!o)return 1;if(!i&&!a&&!c&&t<e||c&&r&&o&&!i&&!a||u&&r&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,u=e.length,l=wn(o-a,0),c=_t(u+l),h=!r;++s<u;)c[s]=e[s];for(;++i<a;)(h||i<o)&&(c[n[i]]=t[i]);for(;l--;)c[s++]=t[i++];return c}function Ni(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,u=-1,l=e.length,c=wn(o-s,0),h=_t(c+l),f=!r;++i<c;)h[i]=t[i];for(var d=i;++u<l;)h[d+u]=e[u];for(;++a<s;)(f||i<o)&&(h[d+n[a]]=t[i++]);return h}function Bi(t,e){var n=-1,r=t.length;for(e||(e=_t(r));++n<r;)e[n]=t[n];return e}function $i(t,e,r,i){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=i?i(r[u],t[u],u,r,t):n;l===n&&(l=t[u]),o?sr(r,u,l):rr(r,u,l)}return r}function Pi(t,e){return function(n,r){var i=qa(n)?ke:or,o=e?e():{};return i(n,t,co(r,2),o)}}function Ii(t){return Zr((function(e,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&_o(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=xt(e);++i<o;){var u=r[i];u&&t(e,u,i,a)}return e}))}function Ri(t,e){return function(n,r){if(null==n)return n;if(!Va(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=xt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Oi(t){return function(e,n,r){for(var i=-1,o=xt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Li(t){return function(e){var r=on(e=As(e))?fn(e):n,i=r?r[0]:e.charAt(0),o=r?Ei(r,1).join(""):e.slice(1);return i[t]()+o}}function Di(t){return function(e){return Pe(tu(Ws(e).replace(Kt,"")),t,"")}}function Fi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=zn(t.prototype),r=t.apply(n,e);return rs(r)?r:n}}function ji(t){return function(e,r,i){var o=xt(e);if(!Va(e)){var a=co(r,3);e=Is(e),r=function(t){return a(o[t],t,o)}}var s=t(e,r,i);return s>-1?o[a?e[s]:s]:n}}function Ui(t){return io((function(e){var i=e.length,o=i,a=Qn.prototype.thru;for(t&&e.reverse();o--;){var s=e[o];if("function"!=typeof s)throw new Nt(r);if(a&&!u&&"wrapper"==uo(s))var u=new Qn([],!0)}for(o=u?o:i;++o<i;){var l=uo(s=e[o]),c="wrapper"==l?so(s):n;u=c&&ko(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[uo(c[0])].apply(u,c[3]):1==s.length&&ko(s)?u[l]():u.thru(s)}return function(){var t=arguments,n=t[0];if(u&&1==t.length&&qa(n))return u.plant(n).value();for(var r=0,o=i?e[r].apply(this,t):n;++r<i;)o=e[r].call(this,o);return o}}))}function Hi(t,e,r,i,o,a,s,u,c,h){var f=e&l,d=1&e,p=2&e,g=24&e,m=512&e,y=p?n:Fi(t);return function n(){for(var l=arguments.length,v=_t(l),b=l;b--;)v[b]=arguments[b];if(g)var w=lo(n),A=tn(v,w);if(i&&(v=Ti(v,i,o,g)),a&&(v=Ni(v,a,s,g)),l-=A,g&&l<h){var _=un(v,w);return Vi(t,e,Hi,n.placeholder,r,v,_,u,c,h-l)}var E=d?r:this,k=p?E[t]:t;return l=v.length,u?v=Bo(v,u):m&&l>1&&v.reverse(),f&&c<l&&(v.length=c),this&&this!==he&&this instanceof n&&(k=y||Fi(k)),k.apply(E,v)}}function zi(t,e){return function(n,r){return function(t,e,n,r){return _r(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Gi(t,e){return function(r,i){var o;if(r===n&&i===n)return e;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=hi(r),i=hi(i)):(r=ci(r),i=ci(i)),o=t(r,i)}return o}}function Qi(t){return io((function(e){return e=Be(e,Ve(co())),Zr((function(n){var r=this;return t(e,(function(t){return Ee(t,r,n)}))}))}))}function Wi(t,e){var r=(e=e===n?" ":hi(e)).length;if(r<2)return r?Jr(e,t):e;var i=Jr(e,me(t/hn(e)));return on(e)?Ei(fn(i),0,t).join(""):i.slice(0,t)}function qi(t){return function(e,r,i){return i&&"number"!=typeof i&&_o(e,r,i)&&(r=i=n),e=ms(e),r===n?(r=e,e=0):r=ms(r),function(t,e,n,r){for(var i=-1,o=wn(me((e-t)/(n||1)),0),a=_t(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,r,i=i===n?e<r?1:-1:ms(i),t)}}function Yi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=bs(e),n=bs(n)),t(e,n)}}function Vi(t,e,r,i,o,a,l,c,h,f){var d=8&e;e|=d?s:u,4&(e&=~(d?u:s))||(e&=-4);var p=[t,e,o,d?a:n,d?l:n,d?n:a,d?n:l,c,h,f],g=r.apply(n,p);return ko(t)&&Po(g,p),g.placeholder=i,Oo(g,t,e)}function Ki(t){var e=St[t];return function(t,n){if(t=bs(t),(n=null==n?0:An(ys(n),292))&&yn(t)){var r=(As(t)+"e").split("e");return+((r=(As(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ji=Tn&&1/ln(new Tn([,-0]))[1]==h?function(t){return new Tn(t)}:hu;function Zi(t){return function(e){var n=yo(e);return n==E?an(e):n==C?cn(e):function(t,e){return Be(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Xi(t,e,i,h,f,d,p,g){var m=2&e;if(!m&&"function"!=typeof t)throw new Nt(r);var y=h?h.length:0;if(y||(e&=-97,h=f=n),p=p===n?p:wn(ys(p),0),g=g===n?g:ys(g),y-=f?f.length:0,e&u){var v=h,b=f;h=f=n}var w=m?n:so(t),A=[t,e,i,h,f,v,b,d,p,g];if(w&&function(t,e){var n=t[1],r=e[1],i=n|r,a=i<131,s=r==l&&8==n||r==l&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!a&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var h=t[3];t[3]=h?Ti(h,u,e[4]):u,t[4]=h?un(t[3],o):e[4]}(u=e[5])&&(h=t[5],t[5]=h?Ni(h,u,e[6]):u,t[6]=h?un(t[5],o):e[6]);(u=e[7])&&(t[7]=u);r&l&&(t[8]=null==t[8]?e[8]:An(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(A,w),t=A[0],e=A[1],i=A[2],h=A[3],f=A[4],!(g=A[9]=A[9]===n?m?0:t.length:wn(A[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==a?function(t,e,r){var i=Fi(t);return function o(){for(var a=arguments.length,s=_t(a),u=a,l=lo(o);u--;)s[u]=arguments[u];var c=a<3&&s[0]!==l&&s[a-1]!==l?[]:un(s,l);return(a-=c.length)<r?Vi(t,e,Hi,o.placeholder,n,s,c,n,n,r-a):Ee(this&&this!==he&&this instanceof o?i:t,this,s)}}(t,e,g):e!=s&&33!=e||f.length?Hi.apply(n,A):function(t,e,n,r){var i=1&e,o=Fi(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=_t(l+s),h=this&&this!==he&&this instanceof e?o:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return Ee(h,i?n:this,c)}}(t,e,i,h);else var _=function(t,e,n){var r=1&e,i=Fi(t);return function e(){return(this&&this!==he&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,i);return Oo((w?ni:Po)(_,A),t,e)}function to(t,e,r,i){return t===n||za(t,Pt[r])&&!Ot.call(i,r)?e:t}function eo(t,e,r,i,o,a){return rs(t)&&rs(e)&&(a.set(e,t),Gr(t,e,n,eo,a),a.delete(e)),t}function no(t){return ss(t)?n:t}function ro(t,e,r,i,o,a){var s=1&r,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var f=-1,d=!0,p=2&r?new Kn:n;for(a.set(t,e),a.set(e,t);++f<u;){var g=t[f],m=e[f];if(i)var y=s?i(m,g,f,e,t,a):i(g,m,f,t,e,a);if(y!==n){if(y)continue;d=!1;break}if(p){if(!Re(e,(function(t,e){if(!Je(p,e)&&(g===t||o(g,t,r,i,a)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function io(t){return Ro(To(t,n,Yo),t+"")}function oo(t){return Sr(t,Is,go)}function ao(t){return Sr(t,Rs,mo)}var so=$n?function(t){return $n.get(t)}:hu;function uo(t){for(var e=t.name+"",n=Pn[e],r=Ot.call(Pn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function lo(t){return(Ot.call(Hn,"placeholder")?Hn:t).placeholder}function co(){var t=Hn.iteratee||su;return t=t===su?Lr:t,arguments.length?t(arguments[0],arguments[1]):t}function ho(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function fo(t){for(var e=Is(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,xo(i)]}return e}function po(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Or(r)?r:n}var go=Ge?function(t){return null==t?[]:(t=xt(t),Ce(Ge(t),(function(e){return Vt.call(t,e)})))}:vu,mo=Ge?function(t){for(var e=[];t;)$e(e,go(t)),t=qt(t);return e}:vu,yo=xr;function vo(t,e,n){for(var r=-1,i=(e=Ai(e,t)).length,o=!1;++r<i;){var a=jo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&ns(i)&&Ao(a,i)&&(qa(t)||Wa(t))}function bo(t){return"function"!=typeof t.constructor||So(t)?{}:zn(qt(t))}function wo(t){return qa(t)||Wa(t)||!!(te&&t&&t[te])}function Ao(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function _o(t,e,n){if(!rs(n))return!1;var r=typeof e;return!!("number"==r?Va(n)&&Ao(e,n.length):"string"==r&&e in n)&&za(n[e],t)}function Eo(t,e){if(qa(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!hs(t))||(tt.test(t)||!X.test(t)||null!=e&&t in xt(e))}function ko(t){var e=uo(t),n=Hn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=so(n);return!!r&&t===r[0]}(Sn&&yo(new Sn(new ArrayBuffer(1)))!=P||xn&&yo(new xn)!=E||Cn&&yo(Cn.resolve())!=S||Tn&&yo(new Tn)!=C||Nn&&yo(new Nn)!=B)&&(yo=function(t){var e=xr(t),r=e==M?t.constructor:n,i=r?Uo(r):"";if(i)switch(i){case In:return P;case Rn:return E;case On:return S;case Ln:return C;case Dn:return B}return e});var Mo=It?ts:bu;function So(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pt)}function xo(t){return t==t&&!rs(t)}function Co(t,e){return function(r){return null!=r&&(r[t]===e&&(e!==n||t in xt(r)))}}function To(t,e,r){return e=wn(e===n?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=wn(n.length-e,0),a=_t(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=_t(e+1);++i<e;)s[i]=n[i];return s[e]=r(a),Ee(t,this,s)}}function No(t,e){return e.length<2?t:Mr(t,oi(e,0,-1))}function Bo(t,e){for(var r=t.length,i=An(e.length,r),o=Bi(t);i--;){var a=e[i];t[i]=Ao(a,r)?o[a]:n}return t}function $o(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Po=Lo(ni),Io=ge||function(t,e){return he.setTimeout(t,e)},Ro=Lo(ri);function Oo(t,e,n){var r=e+"";return Ro(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(g,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ut):[]}(r),n)))}function Lo(t){var e=0,r=0;return function(){var i=_n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Do(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r<e;){var a=Kr(r,o),s=t[a];t[a]=t[r],t[r]=s}return t.length=e,t}var Fo=function(t){var e=La(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function jo(t){if("string"==typeof t||hs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Uo(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ho(t){if(t instanceof Wn)return t.clone();var e=new Qn(t.__wrapped__,t.__chain__);return e.__actions__=Bi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var zo=Zr((function(t,e){return Ka(t)?dr(t,br(e,1,Ka,!0)):[]})),Go=Zr((function(t,e){var r=Xo(e);return Ka(r)&&(r=n),Ka(t)?dr(t,br(e,1,Ka,!0),co(r,2)):[]})),Qo=Zr((function(t,e){var r=Xo(e);return Ka(r)&&(r=n),Ka(t)?dr(t,br(e,1,Ka,!0),n,r):[]}));function Wo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=wn(r+i,0)),De(t,co(e,3),i)}function qo(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==n&&(o=ys(r),o=r<0?wn(i+o,0):An(o,i-1)),De(t,co(e,3),o,!0)}function Yo(t){return(null==t?0:t.length)?br(t,1):[]}function Vo(t){return t&&t.length?t[0]:n}var Ko=Zr((function(t){var e=Be(t,bi);return e.length&&e[0]===t[0]?Br(e):[]})),Jo=Zr((function(t){var e=Xo(t),r=Be(t,bi);return e===Xo(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Br(r,co(e,2)):[]})),Zo=Zr((function(t){var e=Xo(t),r=Be(t,bi);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Br(r,n,e):[]}));function Xo(t){var e=null==t?0:t.length;return e?t[e-1]:n}var ta=Zr(ea);function ea(t,e){return t&&t.length&&e&&e.length?Yr(t,e):t}var na=io((function(t,e){var n=null==t?0:t.length,r=ur(t,e);return Vr(t,Be(e,(function(t){return Ao(t,n)?+t:t})).sort(Ci)),r}));function ra(t){return null==t?t:Mn.call(t)}var ia=Zr((function(t){return fi(br(t,1,Ka,!0))})),oa=Zr((function(t){var e=Xo(t);return Ka(e)&&(e=n),fi(br(t,1,Ka,!0),co(e,2))})),aa=Zr((function(t){var e=Xo(t);return e="function"==typeof e?e:n,fi(br(t,1,Ka,!0),n,e)}));function sa(t){if(!t||!t.length)return[];var e=0;return t=Ce(t,(function(t){if(Ka(t))return e=wn(t.length,e),!0})),qe(e,(function(e){return Be(t,ze(e))}))}function ua(t,e){if(!t||!t.length)return[];var r=sa(t);return null==e?r:Be(r,(function(t){return Ee(e,n,t)}))}var la=Zr((function(t,e){return Ka(t)?dr(t,e):[]})),ca=Zr((function(t){return yi(Ce(t,Ka))})),ha=Zr((function(t){var e=Xo(t);return Ka(e)&&(e=n),yi(Ce(t,Ka),co(e,2))})),fa=Zr((function(t){var e=Xo(t);return e="function"==typeof e?e:n,yi(Ce(t,Ka),n,e)})),da=Zr(sa);var pa=Zr((function(t){var e=t.length,r=e>1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,ua(t,r)}));function ga(t){var e=Hn(t);return e.__chain__=!0,e}function ma(t,e){return e(t)}var ya=io((function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return ur(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Wn&&Ao(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:ma,args:[o],thisArg:n}),new Qn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(o)}));var va=Pi((function(t,e,n){Ot.call(t,n)?++t[n]:sr(t,n,1)}));var ba=ji(Wo),wa=ji(qo);function Aa(t,e){return(qa(t)?Me:pr)(t,co(e,3))}function _a(t,e){return(qa(t)?Se:gr)(t,co(e,3))}var Ea=Pi((function(t,e,n){Ot.call(t,n)?t[n].push(e):sr(t,n,[e])}));var ka=Zr((function(t,e,n){var r=-1,i="function"==typeof e,o=Va(t)?_t(t.length):[];return pr(t,(function(t){o[++r]=i?Ee(e,t,n):$r(t,e,n)})),o})),Ma=Pi((function(t,e,n){sr(t,n,e)}));function Sa(t,e){return(qa(t)?Be:Ur)(t,co(e,3))}var xa=Pi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ca=Zr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&_o(t,e[0],e[1])?e=[]:n>2&&_o(e[0],e[1],e[2])&&(e=[e[0]]),Wr(t,br(e,1),[])})),Ta=de||function(){return he.Date.now()};function Na(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Xi(t,l,n,n,n,n,e)}function Ba(t,e){var i;if("function"!=typeof e)throw new Nt(r);return t=ys(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var $a=Zr((function(t,e,n){var r=1;if(n.length){var i=un(n,lo($a));r|=s}return Xi(t,r,e,n,i)})),Pa=Zr((function(t,e,n){var r=3;if(n.length){var i=un(n,lo(Pa));r|=s}return Xi(e,r,t,n,i)}));function Ia(t,e,i){var o,a,s,u,l,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Nt(r);function g(e){var r=o,i=a;return o=a=n,h=e,u=t.apply(i,r)}function m(t){return h=t,l=Io(v,e),f?g(t):u}function y(t){var r=t-c;return c===n||r>=e||r<0||d&&t-h>=s}function v(){var t=Ta();if(y(t))return b(t);l=Io(v,function(t){var n=e-(t-c);return d?An(n,s-(t-h)):n}(t))}function b(t){return l=n,p&&o?g(t):(o=a=n,u)}function w(){var t=Ta(),r=y(t);if(o=arguments,a=this,c=t,r){if(l===n)return m(c);if(d)return ki(l),l=Io(v,e),g(c)}return l===n&&(l=Io(v,e)),u}return e=bs(e)||0,rs(i)&&(f=!!i.leading,s=(d="maxWait"in i)?wn(bs(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p),w.cancel=function(){l!==n&&ki(l),h=0,o=c=a=l=n},w.flush=function(){return l===n?u:b(Ta())},w}var Ra=Zr((function(t,e){return fr(t,1,e)})),Oa=Zr((function(t,e,n){return fr(t,bs(e)||0,n)}));function La(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Nt(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(La.Cache||Vn),n}function Da(t){if("function"!=typeof t)throw new Nt(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}La.Cache=Vn;var Fa=_i((function(t,e){var n=(e=1==e.length&&qa(e[0])?Be(e[0],Ve(co())):Be(br(e,1),Ve(co()))).length;return Zr((function(r){for(var i=-1,o=An(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ee(t,this,r)}))})),ja=Zr((function(t,e){var r=un(e,lo(ja));return Xi(t,s,n,e,r)})),Ua=Zr((function(t,e){var r=un(e,lo(Ua));return Xi(t,u,n,e,r)})),Ha=io((function(t,e){return Xi(t,c,n,n,n,e)}));function za(t,e){return t===e||t!=t&&e!=e}var Ga=Yi(Cr),Qa=Yi((function(t,e){return t>=e})),Wa=Pr(function(){return arguments}())?Pr:function(t){return is(t)&&Ot.call(t,"callee")&&!Vt.call(t,"callee")},qa=_t.isArray,Ya=ye?Ve(ye):function(t){return is(t)&&xr(t)==$};function Va(t){return null!=t&&ns(t.length)&&!ts(t)}function Ka(t){return is(t)&&Va(t)}var Ja=mn||bu,Za=ve?Ve(ve):function(t){return is(t)&&xr(t)==b};function Xa(t){if(!is(t))return!1;var e=xr(t);return e==w||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!rs(t))return!1;var e=xr(t);return e==A||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==ys(t)}function ns(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function rs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var os=be?Ve(be):function(t){return is(t)&&yo(t)==E};function as(t){return"number"==typeof t||is(t)&&xr(t)==k}function ss(t){if(!is(t)||xr(t)!=M)return!1;var e=qt(t);if(null===e)return!0;var n=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==jt}var us=we?Ve(we):function(t){return is(t)&&xr(t)==x};var ls=Ae?Ve(Ae):function(t){return is(t)&&yo(t)==C};function cs(t){return"string"==typeof t||!qa(t)&&is(t)&&xr(t)==T}function hs(t){return"symbol"==typeof t||is(t)&&xr(t)==N}var fs=_e?Ve(_e):function(t){return is(t)&&ns(t.length)&&!!ie[xr(t)]};var ds=Yi(jr),ps=Yi((function(t,e){return t<=e}));function gs(t){if(!t)return[];if(Va(t))return cs(t)?fn(t):Bi(t);if(ae&&t[ae])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ae]());var e=yo(t);return(e==E?an:e==C?ln:zs)(t)}function ms(t){return t?(t=bs(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ys(t){var e=ms(t),n=e%1;return e==e?n?e-n:e:0}function vs(t){return t?lr(ys(t),0,p):0}function bs(t){if("number"==typeof t)return t;if(hs(t))return d;if(rs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=rs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var n=gt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):pt.test(t)?d:+t}function ws(t){return $i(t,Rs(t))}function As(t){return null==t?"":hi(t)}var _s=Ii((function(t,e){if(So(e)||Va(e))$i(e,Is(e),t);else for(var n in e)Ot.call(e,n)&&rr(t,n,e[n])})),Es=Ii((function(t,e){$i(e,Rs(e),t)})),ks=Ii((function(t,e,n,r){$i(e,Rs(e),t,r)})),Ms=Ii((function(t,e,n,r){$i(e,Is(e),t,r)})),Ss=io(ur);var xs=Zr((function(t,e){t=xt(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&_o(e[0],e[1],o)&&(i=1);++r<i;)for(var a=e[r],s=Rs(a),u=-1,l=s.length;++u<l;){var c=s[u],h=t[c];(h===n||za(h,Pt[c])&&!Ot.call(t,c))&&(t[c]=a[c])}return t})),Cs=Zr((function(t){return t.push(n,eo),Ee(Ls,n,t)}));function Ts(t,e,r){var i=null==t?n:Mr(t,e);return i===n?r:i}function Ns(t,e){return null!=t&&vo(t,e,Nr)}var Bs=zi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),t[e]=n}),ru(au)),$s=zi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),Ot.call(t,e)?t[e].push(n):t[e]=[n]}),co),Ps=Zr($r);function Is(t){return Va(t)?Zn(t):Dr(t)}function Rs(t){return Va(t)?Zn(t,!0):Fr(t)}var Os=Ii((function(t,e,n){Gr(t,e,n)})),Ls=Ii((function(t,e,n,r){Gr(t,e,n,r)})),Ds=io((function(t,e){var n={};if(null==t)return n;var r=!1;e=Be(e,(function(e){return e=Ai(e,t),r||(r=e.length>1),e})),$i(t,ao(t),n),r&&(n=cr(n,7,no));for(var i=e.length;i--;)di(n,e[i]);return n}));var Fs=io((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Ns(t,n)}))}(t,e)}));function js(t,e){if(null==t)return{};var n=Be(ao(t),(function(t){return[t]}));return e=co(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var Us=Zi(Is),Hs=Zi(Rs);function zs(t){return null==t?[]:Ke(t,Is(t))}var Gs=Di((function(t,e,n){return e=e.toLowerCase(),t+(n?Qs(e):e)}));function Qs(t){return Xs(As(t).toLowerCase())}function Ws(t){return(t=As(t))&&t.replace(bt,en).replace(Jt,"")}var qs=Di((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ys=Di((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Vs=Li("toLowerCase");var Ks=Di((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Js=Di((function(t,e,n){return t+(n?" ":"")+Xs(e)}));var Zs=Di((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Xs=Li("toUpperCase");function tu(t,e,r){return t=As(t),(e=r?n:e)===n?function(t){return ee.test(t)}(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var eu=Zr((function(t,e){try{return Ee(t,n,e)}catch(t){return Xa(t)?t:new kt(t)}})),nu=io((function(t,e){return Me(e,(function(e){e=jo(e),sr(t,e,$a(t[e],t))})),t}));function ru(t){return function(){return t}}var iu=Ui(),ou=Ui(!0);function au(t){return t}function su(t){return Lr("function"==typeof t?t:cr(t,1))}var uu=Zr((function(t,e){return function(n){return $r(n,t,e)}})),lu=Zr((function(t,e){return function(n){return $r(t,n,e)}}));function cu(t,e,n){var r=Is(e),i=kr(e,r);null!=n||rs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=kr(e,Is(e)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=ts(t);return Me(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Bi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,$e([this.value()],arguments))})})),t}function hu(){}var fu=Qi(Be),du=Qi(xe),pu=Qi(Re);function gu(t){return Eo(t)?ze(jo(t)):function(t){return function(e){return Mr(e,t)}}(t)}var mu=qi(),yu=qi(!0);function vu(){return[]}function bu(){return!1}var wu=Gi((function(t,e){return t+e}),0),Au=Ki("ceil"),_u=Gi((function(t,e){return t/e}),1),Eu=Ki("floor");var ku,Mu=Gi((function(t,e){return t*e}),1),Su=Ki("round"),xu=Gi((function(t,e){return t-e}),0);return Hn.after=function(t,e){if("function"!=typeof e)throw new Nt(r);return t=ys(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Na,Hn.assign=_s,Hn.assignIn=Es,Hn.assignInWith=ks,Hn.assignWith=Ms,Hn.at=Ss,Hn.before=Ba,Hn.bind=$a,Hn.bindAll=nu,Hn.bindKey=Pa,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qa(t)?t:[t]},Hn.chain=ga,Hn.chunk=function(t,e,r){e=(r?_o(t,e,r):e===n)?1:wn(ys(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=_t(me(i/e));o<i;)s[a++]=oi(t,o,o+=e);return s},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=_t(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return $e(qa(n)?Bi(n):[n],br(e,1))},Hn.cond=function(t){var e=null==t?0:t.length,n=co();return t=e?Be(t,(function(t){if("function"!=typeof t[1])throw new Nt(r);return[n(t[0]),t[1]]})):[],Zr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Ee(i[0],this,n))return Ee(i[1],this,n)}}))},Hn.conforms=function(t){return function(t){var e=Is(t);return function(n){return hr(n,t,e)}}(cr(t,1))},Hn.constant=ru,Hn.countBy=va,Hn.create=function(t,e){var n=zn(t);return null==e?n:ar(n,e)},Hn.curry=function t(e,r,i){var o=Xi(e,8,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Hn.curryRight=function t(e,r,i){var o=Xi(e,a,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Hn.debounce=Ia,Hn.defaults=xs,Hn.defaultsDeep=Cs,Hn.defer=Ra,Hn.delay=Oa,Hn.difference=zo,Hn.differenceBy=Go,Hn.differenceWith=Qo,Hn.drop=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,(e=r||e===n?1:ys(e))<0?0:e,i):[]},Hn.dropRight=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,0,(e=i-(e=r||e===n?1:ys(e)))<0?0:e):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?gi(t,co(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?gi(t,co(e,3),!0):[]},Hn.fill=function(t,e,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&_o(t,e,r)&&(r=0,i=o),function(t,e,r,i){var o=t.length;for((r=ys(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:ys(i))<0&&(i+=o),i=r>i?0:vs(i);r<i;)t[r++]=e;return t}(t,e,r,i)):[]},Hn.filter=function(t,e){return(qa(t)?Ce:vr)(t,co(e,3))},Hn.flatMap=function(t,e){return br(Sa(t,e),1)},Hn.flatMapDeep=function(t,e){return br(Sa(t,e),h)},Hn.flatMapDepth=function(t,e,r){return r=r===n?1:ys(r),br(Sa(t,e),r)},Hn.flatten=Yo,Hn.flattenDeep=function(t){return(null==t?0:t.length)?br(t,h):[]},Hn.flattenDepth=function(t,e){return(null==t?0:t.length)?br(t,e=e===n?1:ys(e)):[]},Hn.flip=function(t){return Xi(t,512)},Hn.flow=iu,Hn.flowRight=ou,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Hn.functions=function(t){return null==t?[]:kr(t,Is(t))},Hn.functionsIn=function(t){return null==t?[]:kr(t,Rs(t))},Hn.groupBy=Ea,Hn.initial=function(t){return(null==t?0:t.length)?oi(t,0,-1):[]},Hn.intersection=Ko,Hn.intersectionBy=Jo,Hn.intersectionWith=Zo,Hn.invert=Bs,Hn.invertBy=$s,Hn.invokeMap=ka,Hn.iteratee=su,Hn.keyBy=Ma,Hn.keys=Is,Hn.keysIn=Rs,Hn.map=Sa,Hn.mapKeys=function(t,e){var n={};return e=co(e,3),_r(t,(function(t,r,i){sr(n,e(t,r,i),t)})),n},Hn.mapValues=function(t,e){var n={};return e=co(e,3),_r(t,(function(t,r,i){sr(n,r,e(t,r,i))})),n},Hn.matches=function(t){return Hr(cr(t,1))},Hn.matchesProperty=function(t,e){return zr(t,cr(e,1))},Hn.memoize=La,Hn.merge=Os,Hn.mergeWith=Ls,Hn.method=uu,Hn.methodOf=lu,Hn.mixin=cu,Hn.negate=Da,Hn.nthArg=function(t){return t=ys(t),Zr((function(e){return Qr(e,t)}))},Hn.omit=Ds,Hn.omitBy=function(t,e){return js(t,Da(co(e)))},Hn.once=function(t){return Ba(2,t)},Hn.orderBy=function(t,e,r,i){return null==t?[]:(qa(e)||(e=null==e?[]:[e]),qa(r=i?n:r)||(r=null==r?[]:[r]),Wr(t,e,r))},Hn.over=fu,Hn.overArgs=Fa,Hn.overEvery=du,Hn.overSome=pu,Hn.partial=ja,Hn.partialRight=Ua,Hn.partition=xa,Hn.pick=Fs,Hn.pickBy=js,Hn.property=gu,Hn.propertyOf=function(t){return function(e){return null==t?n:Mr(t,e)}},Hn.pull=ta,Hn.pullAll=ea,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Yr(t,e,co(n,2)):t},Hn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Yr(t,e,n,r):t},Hn.pullAt=na,Hn.range=mu,Hn.rangeRight=yu,Hn.rearg=Ha,Hn.reject=function(t,e){return(qa(t)?Ce:vr)(t,Da(co(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=co(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Vr(t,i),n},Hn.rest=function(t,e){if("function"!=typeof t)throw new Nt(r);return Zr(t,e=e===n?e:ys(e))},Hn.reverse=ra,Hn.sampleSize=function(t,e,r){return e=(r?_o(t,e,r):e===n)?1:ys(e),(qa(t)?tr:ti)(t,e)},Hn.set=function(t,e,n){return null==t?t:ei(t,e,n)},Hn.setWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:ei(t,e,r,i)},Hn.shuffle=function(t){return(qa(t)?er:ii)(t)},Hn.slice=function(t,e,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&_o(t,e,r)?(e=0,r=i):(e=null==e?0:ys(e),r=r===n?i:ys(r)),oi(t,e,r)):[]},Hn.sortBy=Ca,Hn.sortedUniq=function(t){return t&&t.length?li(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?li(t,co(e,2)):[]},Hn.split=function(t,e,r){return r&&"number"!=typeof r&&_o(t,e,r)&&(e=r=n),(r=r===n?p:r>>>0)?(t=As(t))&&("string"==typeof e||null!=e&&!us(e))&&!(e=hi(e))&&on(t)?Ei(fn(t),0,r):t.split(e,r):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new Nt(r);return e=null==e?0:wn(ys(e),0),Zr((function(n){var r=n[e],i=Ei(n,0,e);return r&&$e(i,r),Ee(t,this,i)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Hn.take=function(t,e,r){return t&&t.length?oi(t,0,(e=r||e===n?1:ys(e))<0?0:e):[]},Hn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,(e=i-(e=r||e===n?1:ys(e)))<0?0:e,i):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?gi(t,co(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?gi(t,co(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new Nt(r);return rs(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ia(t,e,{leading:i,maxWait:e,trailing:o})},Hn.thru=ma,Hn.toArray=gs,Hn.toPairs=Us,Hn.toPairsIn=Hs,Hn.toPath=function(t){return qa(t)?Be(t,jo):hs(t)?[t]:Bi(Fo(As(t)))},Hn.toPlainObject=ws,Hn.transform=function(t,e,n){var r=qa(t),i=r||Ja(t)||fs(t);if(e=co(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:rs(t)&&ts(o)?zn(qt(t)):{}}return(i?Me:_r)(t,(function(t,r,i){return e(n,t,r,i)})),n},Hn.unary=function(t){return Na(t,1)},Hn.union=ia,Hn.unionBy=oa,Hn.unionWith=aa,Hn.uniq=function(t){return t&&t.length?fi(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?fi(t,co(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?fi(t,n,e):[]},Hn.unset=function(t,e){return null==t||di(t,e)},Hn.unzip=sa,Hn.unzipWith=ua,Hn.update=function(t,e,n){return null==t?t:pi(t,e,wi(n))},Hn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:pi(t,e,wi(r),i)},Hn.values=zs,Hn.valuesIn=function(t){return null==t?[]:Ke(t,Rs(t))},Hn.without=la,Hn.words=tu,Hn.wrap=function(t,e){return ja(wi(e),t)},Hn.xor=ca,Hn.xorBy=ha,Hn.xorWith=fa,Hn.zip=da,Hn.zipObject=function(t,e){return vi(t||[],e||[],rr)},Hn.zipObjectDeep=function(t,e){return vi(t||[],e||[],ei)},Hn.zipWith=pa,Hn.entries=Us,Hn.entriesIn=Hs,Hn.extend=Es,Hn.extendWith=ks,cu(Hn,Hn),Hn.add=wu,Hn.attempt=eu,Hn.camelCase=Gs,Hn.capitalize=Qs,Hn.ceil=Au,Hn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=bs(r))==r?r:0),e!==n&&(e=(e=bs(e))==e?e:0),lr(bs(t),e,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(t,e){return cr(t,5,e="function"==typeof e?e:n)},Hn.cloneWith=function(t,e){return cr(t,4,e="function"==typeof e?e:n)},Hn.conformsTo=function(t,e){return null==e||hr(t,e,Is(e))},Hn.deburr=Ws,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=_u,Hn.endsWith=function(t,e,r){t=As(t),e=hi(e);var i=t.length,o=r=r===n?i:lr(ys(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Hn.eq=za,Hn.escape=function(t){return(t=As(t))&&V.test(t)?t.replace(q,nn):t},Hn.escapeRegExp=function(t){return(t=As(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Hn.every=function(t,e,r){var i=qa(t)?xe:mr;return r&&_o(t,e,r)&&(e=n),i(t,co(e,3))},Hn.find=ba,Hn.findIndex=Wo,Hn.findKey=function(t,e){return Le(t,co(e,3),_r)},Hn.findLast=wa,Hn.findLastIndex=qo,Hn.findLastKey=function(t,e){return Le(t,co(e,3),Er)},Hn.floor=Eu,Hn.forEach=Aa,Hn.forEachRight=_a,Hn.forIn=function(t,e){return null==t?t:wr(t,co(e,3),Rs)},Hn.forInRight=function(t,e){return null==t?t:Ar(t,co(e,3),Rs)},Hn.forOwn=function(t,e){return t&&_r(t,co(e,3))},Hn.forOwnRight=function(t,e){return t&&Er(t,co(e,3))},Hn.get=Ts,Hn.gt=Ga,Hn.gte=Qa,Hn.has=function(t,e){return null!=t&&vo(t,e,Tr)},Hn.hasIn=Ns,Hn.head=Vo,Hn.identity=au,Hn.includes=function(t,e,n,r){t=Va(t)?t:zs(t),n=n&&!r?ys(n):0;var i=t.length;return n<0&&(n=wn(i+n,0)),cs(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=wn(r+i,0)),Fe(t,e,i)},Hn.inRange=function(t,e,r){return e=ms(e),r===n?(r=e,e=0):r=ms(r),function(t,e,n){return t>=An(e,n)&&t<wn(e,n)}(t=bs(t),e,r)},Hn.invoke=Ps,Hn.isArguments=Wa,Hn.isArray=qa,Hn.isArrayBuffer=Ya,Hn.isArrayLike=Va,Hn.isArrayLikeObject=Ka,Hn.isBoolean=function(t){return!0===t||!1===t||is(t)&&xr(t)==v},Hn.isBuffer=Ja,Hn.isDate=Za,Hn.isElement=function(t){return is(t)&&1===t.nodeType&&!ss(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Va(t)&&(qa(t)||"string"==typeof t||"function"==typeof t.splice||Ja(t)||fs(t)||Wa(t)))return!t.length;var e=yo(t);if(e==E||e==C)return!t.size;if(So(t))return!Dr(t).length;for(var n in t)if(Ot.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return Ir(t,e)},Hn.isEqualWith=function(t,e,r){var i=(r="function"==typeof r?r:n)?r(t,e):n;return i===n?Ir(t,e,n,r):!!i},Hn.isError=Xa,Hn.isFinite=function(t){return"number"==typeof t&&yn(t)},Hn.isFunction=ts,Hn.isInteger=es,Hn.isLength=ns,Hn.isMap=os,Hn.isMatch=function(t,e){return t===e||Rr(t,e,fo(e))},Hn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Rr(t,e,fo(e),r)},Hn.isNaN=function(t){return as(t)&&t!=+t},Hn.isNative=function(t){if(Mo(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=as,Hn.isObject=rs,Hn.isObjectLike=is,Hn.isPlainObject=ss,Hn.isRegExp=us,Hn.isSafeInteger=function(t){return es(t)&&t>=-9007199254740991&&t<=f},Hn.isSet=ls,Hn.isString=cs,Hn.isSymbol=hs,Hn.isTypedArray=fs,Hn.isUndefined=function(t){return t===n},Hn.isWeakMap=function(t){return is(t)&&yo(t)==B},Hn.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==xr(t)},Hn.join=function(t,e){return null==t?"":vn.call(t,e)},Hn.kebabCase=qs,Hn.last=Xo,Hn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ys(r))<0?wn(i+o,0):An(o,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):De(t,Ue,o,!0)},Hn.lowerCase=Ys,Hn.lowerFirst=Vs,Hn.lt=ds,Hn.lte=ps,Hn.max=function(t){return t&&t.length?yr(t,au,Cr):n},Hn.maxBy=function(t,e){return t&&t.length?yr(t,co(e,2),Cr):n},Hn.mean=function(t){return He(t,au)},Hn.meanBy=function(t,e){return He(t,co(e,2))},Hn.min=function(t){return t&&t.length?yr(t,au,jr):n},Hn.minBy=function(t,e){return t&&t.length?yr(t,co(e,2),jr):n},Hn.stubArray=vu,Hn.stubFalse=bu,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Mu,Hn.nth=function(t,e){return t&&t.length?Qr(t,ys(e)):n},Hn.noConflict=function(){return he._===this&&(he._=Ut),this},Hn.noop=hu,Hn.now=Ta,Hn.pad=function(t,e,n){t=As(t);var r=(e=ys(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Wi(Oe(i),n)+t+Wi(me(i),n)},Hn.padEnd=function(t,e,n){t=As(t);var r=(e=ys(e))?hn(t):0;return e&&r<e?t+Wi(e-r,n):t},Hn.padStart=function(t,e,n){t=As(t);var r=(e=ys(e))?hn(t):0;return e&&r<e?Wi(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),En(As(t).replace(it,""),e||0)},Hn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&_o(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=ms(t),e===n?(e=t,t=0):e=ms(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var o=kn();return An(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Kr(t,e)},Hn.reduce=function(t,e,n){var r=qa(t)?Pe:Qe,i=arguments.length<3;return r(t,co(e,4),n,i,pr)},Hn.reduceRight=function(t,e,n){var r=qa(t)?Ie:Qe,i=arguments.length<3;return r(t,co(e,4),n,i,gr)},Hn.repeat=function(t,e,r){return e=(r?_o(t,e,r):e===n)?1:ys(e),Jr(As(t),e)},Hn.replace=function(){var t=arguments,e=As(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,r){var i=-1,o=(e=Ai(e,t)).length;for(o||(o=1,t=n);++i<o;){var a=null==t?n:t[jo(e[i])];a===n&&(i=o,a=r),t=ts(a)?a.call(t):a}return t},Hn.round=Su,Hn.runInContext=t,Hn.sample=function(t){return(qa(t)?Xn:Xr)(t)},Hn.size=function(t){if(null==t)return 0;if(Va(t))return cs(t)?hn(t):t.length;var e=yo(t);return e==E||e==C?t.size:Dr(t).length},Hn.snakeCase=Ks,Hn.some=function(t,e,r){var i=qa(t)?Re:ai;return r&&_o(t,e,r)&&(e=n),i(t,co(e,3))},Hn.sortedIndex=function(t,e){return si(t,e)},Hn.sortedIndexBy=function(t,e,n){return ui(t,e,co(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=si(t,e);if(r<n&&za(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return si(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ui(t,e,co(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=si(t,e,!0)-1;if(za(t[n],e))return n}return-1},Hn.startCase=Js,Hn.startsWith=function(t,e,n){return t=As(t),n=null==n?0:lr(ys(n),0,t.length),e=hi(e),t.slice(n,n+e.length)==e},Hn.subtract=xu,Hn.sum=function(t){return t&&t.length?We(t,au):0},Hn.sumBy=function(t,e){return t&&t.length?We(t,co(e,2)):0},Hn.template=function(t,e,r){var i=Hn.templateSettings;r&&_o(t,e,r)&&(e=n),t=As(t),e=ks({},e,i,to);var o,a,s=ks({},e.imports,i.imports,to),u=Is(s),l=Ke(s,u),c=0,h=e.interpolate||wt,f="__p += '",d=Ct((e.escape||wt).source+"|"+h.source+"|"+(h===Z?ft:wt).source+"|"+(e.evaluate||wt).source+"|$","g"),p="//# sourceURL="+(Ot.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),f+=t.slice(c,u).replace(At,rn),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),f+="';\n";var g=Ot.call(e,"variable")&&e.variable;if(g){if(ct.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(z,""):f).replace(G,"$1").replace(Q,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m=eu((function(){return Mt(u,p+"return "+f).apply(n,l)}));if(m.source=f,Xa(m))throw m;return m},Hn.times=function(t,e){if((t=ys(t))<1||t>f)return[];var n=p,r=An(t,p);e=co(e),t-=p;for(var i=qe(r,e);++n<t;)e(n);return i},Hn.toFinite=ms,Hn.toInteger=ys,Hn.toLength=vs,Hn.toLower=function(t){return As(t).toLowerCase()},Hn.toNumber=bs,Hn.toSafeInteger=function(t){return t?lr(ys(t),-9007199254740991,f):0===t?t:0},Hn.toString=As,Hn.toUpper=function(t){return As(t).toUpperCase()},Hn.trim=function(t,e,r){if((t=As(t))&&(r||e===n))return Ye(t);if(!t||!(e=hi(e)))return t;var i=fn(t),o=fn(e);return Ei(i,Ze(i,o),Xe(i,o)+1).join("")},Hn.trimEnd=function(t,e,r){if((t=As(t))&&(r||e===n))return t.slice(0,dn(t)+1);if(!t||!(e=hi(e)))return t;var i=fn(t);return Ei(i,0,Xe(i,fn(e))+1).join("")},Hn.trimStart=function(t,e,r){if((t=As(t))&&(r||e===n))return t.replace(it,"");if(!t||!(e=hi(e)))return t;var i=fn(t);return Ei(i,Ze(i,fn(e))).join("")},Hn.truncate=function(t,e){var r=30,i="...";if(rs(e)){var o="separator"in e?e.separator:o;r="length"in e?ys(e.length):r,i="omission"in e?hi(e.omission):i}var a=(t=As(t)).length;if(on(t)){var s=fn(t);a=s.length}if(r>=a)return t;var u=r-hn(i);if(u<1)return i;var l=s?Ei(s,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(s&&(u+=l.length-u),us(o)){if(t.slice(u).search(o)){var c,h=l;for(o.global||(o=Ct(o.source,As(dt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var f=c.index;l=l.slice(0,f===n?u:f)}}else if(t.indexOf(hi(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+i},Hn.unescape=function(t){return(t=As(t))&&Y.test(t)?t.replace(W,pn):t},Hn.uniqueId=function(t){var e=++Lt;return As(t)+e},Hn.upperCase=Zs,Hn.upperFirst=Xs,Hn.each=Aa,Hn.eachRight=_a,Hn.first=Vo,cu(Hn,(ku={},_r(Hn,(function(t,e){Ot.call(Hn.prototype,e)||(ku[e]=t)})),ku),{chain:!1}),Hn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Me(["drop","take"],(function(t,e){Wn.prototype[t]=function(r){r=r===n?1:wn(ys(r),0);var i=this.__filtered__&&!e?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=An(r,i.__takeCount__):i.__views__.push({size:An(r,p),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:co(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(au)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Zr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return $r(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Da(co(t)))},Wn.prototype.slice=function(t,e){t=ys(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Wn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ys(e))<0?r.dropRight(-e):r.take(e-t)),r)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(p)},_r(Wn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Hn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Hn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof Wn,l=s[0],c=u||qa(e),h=function(t){var e=o.apply(Hn,$e([t],s));return i&&f?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,g=u&&!d;if(!a&&c){e=g?e:new Wn(this);var m=t.apply(e,s);return m.__actions__.push({func:ma,args:[h],thisArg:n}),new Qn(m,f)}return p&&g?t.apply(this,s):(m=this.thru(h),p?i?m.value()[0]:m.value():m)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Bt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],t)}return this[n]((function(n){return e.apply(qa(n)?n:[],t)}))}})),_r(Wn.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Ot.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:e,func:n})}})),Pn[Hi(n,2).name]=[{name:"wrapper",func:n}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Bi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Bi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Bi(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qa(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=An(e,t+a);break;case"takeRight":t=wn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,h=c.length,f=0,d=An(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return mi(t,this.__actions__);var p=[];t:for(;u--&&f<d;){for(var g=-1,m=t[l+=e];++g<h;){var y=c[g],v=y.iteratee,b=y.type,w=v(m);if(2==b)m=w;else if(!w){if(1==b)continue t;break t}}p[f++]=m}return p},Hn.prototype.at=ya,Hn.prototype.chain=function(){return ga(this)},Hn.prototype.commit=function(){return new Qn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===n&&(this.__values__=gs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,r=this;r instanceof Gn;){var i=Ho(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Qn(e,this.__chain__)}return this.thru(ra)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ae&&(Hn.prototype[ae]=function(){return this}),Hn}();de?((de.exports=gn)._=gn,fe._=gn):he._=gn}).call(commonjsGlobal$3)})),EXP_LIMIT=9e15,MAX_DIGITS=1e9,NUMERALS="0123456789abcdef",LN10="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",PI="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",DEFAULTS={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-EXP_LIMIT,maxE:EXP_LIMIT,crypto:!1},inexact,quadrant,external=!0,decimalError="[DecimalError] ",invalidArgument=decimalError+"Invalid argument: ",precisionLimitExceeded=decimalError+"Precision limit exceeded",cryptoUnavailable=decimalError+"crypto unavailable",tag="[object Decimal]",mathfloor=Math.floor,mathpow=Math.pow,isBinary=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,isHex=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,isOctal=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,isDecimal=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,BASE=1e7,LOG_BASE=7,MAX_SAFE_INTEGER=9007199254740991,LN10_PRECISION=LN10.length-1,PI_PRECISION=PI.length-1,P={toStringTag:tag};function digitsToString(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;e<i;e++)r=t[e]+"",(n=LOG_BASE-r.length)&&(o+=getZeroString(n)),o+=r;a=t[e],(n=LOG_BASE-(r=a+"").length)&&(o+=getZeroString(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function checkInt32(t,e,n){if(t!==~~t||t<e||t>n)throw Error(invalidArgument+t)}function checkRoundingDigits(t,e,n,r){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=LOG_BASE,i=0):(i=Math.ceil((e+1)/LOG_BASE),e%=LOG_BASE),o=mathpow(10,LOG_BASE-e),s=t[i]%o|0,null==r?e<3?(0==e?s=s/100|0:1==e&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(t[i+1]/o/100|0)==mathpow(10,e-2)-1||(s==o/2||0==s)&&0==(t[i+1]/o/100|0):e<4?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==mathpow(10,e-3)-1,a}function convertBase(t,e,n){for(var r,i,o=[0],a=0,s=t.length;a<s;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=NUMERALS.indexOf(t.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function cosine(t,e){var n,r,i;if(e.isZero())return e;(r=e.d.length)<32?i=(1/tinyPow(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=taylorSeries(t,1,e.times(i),new t(1));for(var o=n;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=n,e}P.absoluteValue=P.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),finalise(t)},P.ceil=function(){return finalise(new this.constructor(this),this.e+1,2)},P.clampedTo=P.clamp=function(t,e){var n=this,r=n.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(invalidArgument+e);return n.cmp(t)<0?t:n.cmp(e)>0?e:new r(n)},P.comparedTo=P.cmp=function(t){var e,n,r,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,u=o.s,l=t.s;if(!a||!s)return u&&l?u!==l?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-l:0;if(u!==l)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,n=(r=a.length)<(i=s.length)?r:i;e<n;++e)if(a[e]!==s[e])return a[e]>s[e]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},P.cosine=P.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+LOG_BASE,r.rounding=1,n=cosine(r,toLessThanHalfPi(r,n)),r.precision=t,r.rounding=e,finalise(2==quadrant||3==quadrant?n.neg():n,t,e,!0)):new r(1):new r(NaN)},P.cubeRoot=P.cbrt=function(){var t,e,n,r,i,o,a,s,u,l,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(external=!1,(o=c.s*mathpow(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=digitsToString(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=mathpow(n,1/3),t=mathfloor((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),a=(t=h.precision)+3;;)if(l=(u=(s=r).times(s).times(s)).plus(c),r=divide(l.plus(c).times(s),l.plus(u),a+2,1),digitsToString(s.d).slice(0,a)===(n=digitsToString(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(finalise(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(finalise(s,t+1,0),s.times(s).times(s).eq(c))){r=s;break}a+=4,i=1}return external=!0,finalise(r,t,h.rounding,e)},P.decimalPlaces=P.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=((t=e.length-1)-mathfloor(this.e/LOG_BASE))*LOG_BASE,t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},P.dividedBy=P.div=function(t){return divide(this,new this.constructor(t))},P.dividedToIntegerBy=P.divToInt=function(t){var e=this.constructor;return finalise(divide(this,new e(t),0,1,1),e.precision,e.rounding)},P.equals=P.eq=function(t){return 0===this.cmp(t)},P.floor=function(){return finalise(new this.constructor(this),this.e+1,3)},P.greaterThan=P.gt=function(t){return this.cmp(t)>0},P.greaterThanOrEqualTo=P.gte=function(t){var e=this.cmp(t);return 1==e||0===e},P.hyperbolicCosine=P.cosh=function(){var t,e,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/tinyPow(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=taylorSeries(a,1,o.times(e),new a(1),!0);for(var u,l=t,c=new a(8);l--;)u=o.times(o),o=s.minus(u.times(c.minus(u.times(c))));return finalise(o,a.precision=n,a.rounding=r,!0)},P.hyperbolicSine=P.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=taylorSeries(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=taylorSeries(o,2,i=i.times(1/tinyPow(5,t)),i,!0);for(var a,s=new o(5),u=new o(16),l=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(l))))}return o.precision=e,o.rounding=n,finalise(i,e,n,!0)},P.hyperbolicTangent=P.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,divide(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},P.inverseCosine=P.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?getPi(n,i,o):new n(0):new n(NaN):e.isZero()?getPi(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=getPi(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},P.inverseHyperbolicCosine=P.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,external=!1,n=n.times(n).minus(1).sqrt().plus(n),external=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},P.inverseHyperbolicSine=P.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,external=!1,n=n.times(n).plus(1).sqrt().plus(n),external=!0,r.precision=t,r.rounding=e,n.ln())},P.inverseHyperbolicTangent=P.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?finalise(new o(i),t,e,!0):(o.precision=n=r-i.e,i=divide(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},P.inverseSine=P.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=getPi(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},P.inverseTangent=P.atan=function(){var t,e,n,r,i,o,a,s,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&h+4<=PI_PRECISION)return(a=getPi(c,h+4,f).times(.25)).s=l.s,a}else{if(!l.s)return new c(NaN);if(h+4<=PI_PRECISION)return(a=getPi(c,h+4,f).times(.5)).s=l.s,a}for(c.precision=s=h+10,c.rounding=1,t=n=Math.min(28,s/LOG_BASE+2|0);t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(external=!1,e=Math.ceil(s/LOG_BASE),r=1,u=l.times(l),a=new c(l),i=l;-1!==t;)if(i=i.times(u),o=a.minus(i.div(r+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(r+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return n&&(a=a.times(2<<n-1)),external=!0,finalise(a,c.precision=h,c.rounding=f,!0)},P.isFinite=function(){return!!this.d},P.isInteger=P.isInt=function(){return!!this.d&&mathfloor(this.e/LOG_BASE)>this.d.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isPositive=P.isPos=function(){return this.s>0},P.isZero=function(){return!!this.d&&0===this.d[0]},P.lessThan=P.lt=function(t){return this.cmp(t)<0},P.lessThanOrEqualTo=P.lte=function(t){return this.cmp(t)<1},P.logarithm=P.log=function(t){var e,n,r,i,o,a,s,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(null==t)t=new c(10),e=!0;else{if(n=(t=new c(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new c(n&&!n[0]?-1/0:1!=l.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(external=!1,a=naturalLogarithm(l,s=h+5),r=e?getLn10(c,s+10):naturalLogarithm(t,s),checkRoundingDigits((u=divide(a,r,s,1)).d,i=h,f))do{if(a=naturalLogarithm(l,s+=10),r=e?getLn10(c,s+10):naturalLogarithm(t,s),u=divide(a,r,s,1),!o){+digitsToString(u.d).slice(i+1,i+15)+1==1e14&&(u=finalise(u,h+1,0));break}}while(checkRoundingDigits(u.d,i+=10,f));return external=!0,finalise(u,h,f)},P.minus=P.sub=function(t){var e,n,r,i,o,a,s,u,l,c,h,f,d=this,p=d.constructor;if(t=new p(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new p(t.d||d.s!==t.s?d:NaN):t=new p(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(l=d.d,f=t.d,s=p.precision,u=p.rounding,!l[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!l[0])return new p(3===u?-0:0);t=new p(d)}return external?finalise(t,s,u):t}if(n=mathfloor(t.e/LOG_BASE),c=mathfloor(d.e/LOG_BASE),l=l.slice(),o=c-n){for((h=o<0)?(e=l,o=-o,a=f.length):(e=f,n=c,a=l.length),o>(r=Math.max(Math.ceil(s/LOG_BASE),a)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=l.length)<(a=f.length))&&(a=r),r=0;r<a;r++)if(l[r]!=f[r]){h=l[r]<f[r];break}o=0}for(h&&(e=l,l=f,f=e,t.s=-t.s),a=l.length,r=f.length-a;r>0;--r)l[a++]=0;for(r=f.length;r>o;){if(l[--r]<f[r]){for(i=r;i&&0===l[--i];)l[i]=BASE-1;--l[i],l[r]+=BASE}l[r]-=f[r]}for(;0===l[--a];)l.pop();for(;0===l[0];l.shift())--n;return l[0]?(t.d=l,t.e=getBase10Exponent(l,n),external?finalise(t,s,u):t):new p(3===u?-0:0)},P.modulo=P.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?finalise(new r(n),r.precision,r.rounding):(external=!1,9==r.modulo?(e=divide(n,t.abs(),0,3,1)).s*=t.s:e=divide(n,t,0,r.modulo,1),e=e.times(t),external=!0,n.minus(e))},P.naturalExponential=P.exp=function(){return naturalExponential(this)},P.naturalLogarithm=P.ln=function(){return naturalLogarithm(this)},P.negated=P.neg=function(){var t=new this.constructor(this);return t.s=-t.s,finalise(t)},P.plus=P.add=function(t){var e,n,r,i,o,a,s,u,l,c,h=this,f=h.constructor;if(t=new f(t),!h.d||!t.d)return h.s&&t.s?h.d||(t=new f(t.d||h.s===t.s?h:NaN)):t=new f(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.minus(t);if(l=h.d,c=t.d,s=f.precision,u=f.rounding,!l[0]||!c[0])return c[0]||(t=new f(h)),external?finalise(t,s,u):t;if(o=mathfloor(h.e/LOG_BASE),r=mathfloor(t.e/LOG_BASE),l=l.slice(),i=o-r){for(i<0?(n=l,i=-i,a=c.length):(n=c,r=o,a=l.length),i>(a=(o=Math.ceil(s/LOG_BASE))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=l.length)-(i=c.length)<0&&(i=a,n=c,c=l,l=n),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/BASE|0,l[i]%=BASE;for(e&&(l.unshift(e),++r),a=l.length;0==l[--a];)l.pop();return t.d=l,t.e=getBase10Exponent(l,r),external?finalise(t,s,u):t},P.precision=P.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(invalidArgument+t);return n.d?(e=getPrecision(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},P.round=function(){var t=this,e=t.constructor;return finalise(new e(t),t.e+1,e.rounding)},P.sine=P.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+LOG_BASE,r.rounding=1,n=sine(r,toLessThanHalfPi(r,n)),r.precision=t,r.rounding=e,finalise(quadrant>2?n.neg():n,t,e,!0)):new r(NaN)},P.squareRoot=P.sqrt=function(){var t,e,n,r,i,o,a=this,s=a.d,u=a.e,l=a.s,c=a.constructor;if(1!==l||!s||!s[0])return new c(!l||l<0&&(!s||s[0])?NaN:s?a:1/0);for(external=!1,0==(l=Math.sqrt(+a))||l==1/0?(((e=digitsToString(s)).length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=mathfloor((u+1)/2)-(u<0||u%2),r=new c(e=l==1/0?"5e"+u:(e=l.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new c(l.toString()),n=(u=c.precision)+3;;)if(r=(o=r).plus(divide(a,o,n+2,1)).times(.5),digitsToString(o.d).slice(0,n)===(e=digitsToString(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(finalise(r,u+1,1),t=!r.times(r).eq(a));break}if(!i&&(finalise(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return external=!0,finalise(r,u,c.rounding,t)},P.tangent=P.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=divide(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,finalise(2==quadrant||4==quadrant?n.neg():n,t,e,!0)):new r(NaN)},P.times=P.mul=function(t){var e,n,r,i,o,a,s,u,l,c=this,h=c.constructor,f=c.d,d=(t=new h(t)).d;if(t.s*=c.s,!(f&&f[0]&&d&&d[0]))return new h(!t.s||f&&!f[0]&&!d||d&&!d[0]&&!f?NaN:f&&d?0*t.s:t.s/0);for(n=mathfloor(c.e/LOG_BASE)+mathfloor(t.e/LOG_BASE),(u=f.length)<(l=d.length)&&(o=f,f=d,d=o,a=u,u=l,l=a),o=[],r=a=u+l;r--;)o.push(0);for(r=l;--r>=0;){for(e=0,i=u+r;i>r;)s=o[i]+d[r]*f[i-r-1]+e,o[i--]=s%BASE|0,e=s/BASE|0;o[i]=(o[i]+e)%BASE|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=getBase10Exponent(o,n),external?finalise(t,h.precision,h.rounding):t},P.toBinary=function(t,e){return toStringBinary(this,2,t,e)},P.toDecimalPlaces=P.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(checkInt32(t,0,MAX_DIGITS),void 0===e?e=r.rounding:checkInt32(e,0,8),finalise(n,t+n.e+1,e))},P.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=finiteToString(r,!0):(checkInt32(t,0,MAX_DIGITS),void 0===e?e=i.rounding:checkInt32(e,0,8),n=finiteToString(r=finalise(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},P.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=finiteToString(i):(checkInt32(t,0,MAX_DIGITS),void 0===e?e=o.rounding:checkInt32(e,0,8),n=finiteToString(r=finalise(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},P.toFraction=function(t){var e,n,r,i,o,a,s,u,l,c,h,f,d=this,p=d.d,g=d.constructor;if(!p)return new g(d);if(l=n=new g(1),r=u=new g(0),a=(o=(e=new g(r)).e=getPrecision(p)-d.e-1)%LOG_BASE,e.d[0]=mathpow(10,a<0?LOG_BASE+a:a),null==t)t=o>0?e:l;else{if(!(s=new g(t)).isInt()||s.lt(l))throw Error(invalidArgument+s);t=s.gt(e)?o>0?e:l:s}for(external=!1,s=new g(digitsToString(p)),c=g.precision,g.precision=o=p.length*LOG_BASE*2;h=divide(s,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=l,l=u.plus(h.times(i)),u=i,i=e,e=s.minus(h.times(i)),s=i;return i=divide(t.minus(n),r,0,1,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=d.s,f=divide(l,r,o,1).minus(d).abs().cmp(divide(u,n,o,1).minus(d).abs())<1?[l,r]:[u,n],g.precision=c,external=!0,f},P.toHexadecimal=P.toHex=function(t,e){return toStringBinary(this,16,t,e)},P.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:checkInt32(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(external=!1,n=divide(n,t,0,e,1).times(t),external=!0,finalise(n)):(t.s=n.s,n=t),n},P.toNumber=function(){return+this},P.toOctal=function(t,e){return toStringBinary(this,8,t,e)},P.toPower=P.pow=function(t){var e,n,r,i,o,a,s=this,u=s.constructor,l=+(t=new u(t));if(!(s.d&&t.d&&s.d[0]&&t.d[0]))return new u(mathpow(+s,l));if((s=new u(s)).eq(1))return s;if(r=u.precision,o=u.rounding,t.eq(1))return finalise(s,r,o);if((e=mathfloor(t.e/LOG_BASE))>=t.d.length-1&&(n=l<0?-l:l)<=MAX_SAFE_INTEGER)return i=intPow(u,s,n,r),t.s<0?new u(1).div(i):finalise(i,r,o);if((a=s.s)<0){if(e<t.d.length-1)return new u(NaN);if(0==(1&t.d[e])&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(e=0!=(n=mathpow(+s,l))&&isFinite(n)?new u(n+"").e:mathfloor(l*(Math.log("0."+digitsToString(s.d))/Math.LN10+s.e+1)))>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(external=!1,u.rounding=s.s=1,n=Math.min(12,(e+"").length),(i=naturalExponential(t.times(naturalLogarithm(s,r+n)),r)).d&&checkRoundingDigits((i=finalise(i,r+5,1)).d,r,o)&&(e=r+10,+digitsToString((i=finalise(naturalExponential(t.times(naturalLogarithm(s,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=finalise(i,r+1,0))),i.s=a,external=!0,u.rounding=o,finalise(i,r,o))},P.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=finiteToString(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(checkInt32(t,1,MAX_DIGITS),void 0===e?e=i.rounding:checkInt32(e,0,8),n=finiteToString(r=finalise(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},P.toSignificantDigits=P.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(checkInt32(t,1,MAX_DIGITS),void 0===e?e=n.rounding:checkInt32(e,0,8)),finalise(new n(this),t,e)},P.toString=function(){var t=this,e=t.constructor,n=finiteToString(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},P.truncated=P.trunc=function(){return finalise(new this.constructor(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var t=this,e=t.constructor,n=finiteToString(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var divide=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,o,a,s,u){var l,c,h,f,d,p,g,m,y,v,b,w,A,_,E,k,M,S,x,C,T=r.constructor,N=r.s==i.s?1:-1,B=r.d,$=i.d;if(!(B&&B[0]&&$&&$[0]))return new T(r.s&&i.s&&(B?!$||B[0]!=$[0]:$)?B&&0==B[0]||!$?0*N:N/0:NaN);for(u?(d=1,c=r.e-i.e):(u=BASE,d=LOG_BASE,c=mathfloor(r.e/d)-mathfloor(i.e/d)),x=$.length,M=B.length,v=(y=new T(N)).d=[],h=0;$[h]==(B[h]||0);h++);if($[h]>(B[h]||0)&&c--,null==o?(_=o=T.precision,a=T.rounding):_=s?o+(r.e-i.e)+1:o,_<0)v.push(1),p=!0;else{if(_=_/d+2|0,h=0,1==x){for(f=0,$=$[0],_++;(h<M||f)&&_--;h++)E=f*u+(B[h]||0),v[h]=E/$|0,f=E%$|0;p=f||h<M}else{for((f=u/($[0]+1)|0)>1&&($=t($,f,u),B=t(B,f,u),x=$.length,M=B.length),k=x,w=(b=B.slice(0,x)).length;w<x;)b[w++]=0;(C=$.slice()).unshift(0),S=$[0],$[1]>=u/2&&++S;do{f=0,(l=e($,b,x,w))<0?(A=b[0],x!=w&&(A=A*u+(b[1]||0)),(f=A/S|0)>1?(f>=u&&(f=u-1),1==(l=e(g=t($,f,u),b,m=g.length,w=b.length))&&(f--,n(g,x<m?C:$,m,u))):(0==f&&(l=f=1),g=$.slice()),(m=g.length)<w&&g.unshift(0),n(b,g,w,u),-1==l&&(l=e($,b,x,w=b.length))<1&&(f++,n(b,x<w?C:$,w,u)),w=b.length):0===l&&(f++,b=[0]),v[h++]=f,l&&b[0]?b[w++]=B[k]||0:(b=[B[k]],w=1)}while((k++<M||void 0!==b[0])&&_--);p=void 0!==b[0]}v[0]||v.shift()}if(1==d)y.e=c,inexact=p;else{for(h=1,f=v[0];f>=10;f/=10)h++;y.e=h+c*d-1,finalise(y,s?o+y.e+1:o,a,p)}return y}}();function finalise(t,e,n,r){var i,o,a,s,u,l,c,h,f,d=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,s=h[0];s>=10;s/=10)i++;if((o=e-i)<0)o+=LOG_BASE,a=e,u=(c=h[f=0])/mathpow(10,i-a-1)%10|0;else if((f=Math.ceil((o+1)/LOG_BASE))>=(s=h.length)){if(!r)break t;for(;s++<=f;)h.push(0);c=u=0,i=1,a=(o%=LOG_BASE)-LOG_BASE+1}else{for(c=s=h[f],i=1;s>=10;s/=10)i++;u=(a=(o%=LOG_BASE)-LOG_BASE+i)<0?0:c/mathpow(10,i-a-1)%10|0}if(r=r||e<0||void 0!==h[f+1]||(a<0?c:c%mathpow(10,i-a-1)),l=n<4?(u||r)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?a>0?c/mathpow(10,i-a):0:h[f-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,l?(e-=t.e+1,h[0]=mathpow(10,(LOG_BASE-e%LOG_BASE)%LOG_BASE),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=f,s=1,f--):(h.length=f+1,s=mathpow(10,LOG_BASE-o),h[f]=a>0?(c/mathpow(10,i-a)%mathpow(10,a)|0)*s:0),l)for(;;){if(0==f){for(o=1,a=h[0];a>=10;a/=10)o++;for(a=h[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,h[0]==BASE&&(h[0]=1));break}if(h[f]+=s,h[f]!=BASE)break;h[f--]=0,s=1}for(o=h.length;0===h[--o];)h.pop()}return external&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e<d.minE&&(t.e=0,t.d=[0])),t}function finiteToString(t,e,n){if(!t.isFinite())return nonFiniteToString(t);var r,i=t.e,o=digitsToString(t.d),a=o.length;return e?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+getZeroString(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+getZeroString(-i-1)+o,n&&(r=n-a)>0&&(o+=getZeroString(r))):i>=a?(o+=getZeroString(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+getZeroString(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=getZeroString(r))),o}function getBase10Exponent(t,e){var n=t[0];for(e*=LOG_BASE;n>=10;n/=10)e++;return e}function getLn10(t,e,n){if(e>LN10_PRECISION)throw external=!0,n&&(t.precision=n),Error(precisionLimitExceeded);return finalise(new t(LN10),e,1,!0)}function getPi(t,e,n){if(e>PI_PRECISION)throw Error(precisionLimitExceeded);return finalise(new t(PI),e,n,!0)}function getPrecision(t){var e=t.length-1,n=e*LOG_BASE+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function getZeroString(t){for(var e="";t--;)e+="0";return e}function intPow(t,e,n,r){var i,o=new t(1),a=Math.ceil(r/LOG_BASE+4);for(external=!1;;){if(n%2&&truncate((o=o.times(e)).d,a)&&(i=!0),0===(n=mathfloor(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}truncate((e=e.times(e)).d,a)}return external=!0,o}function isOdd(t){return 1&t.d[t.d.length-1]}function maxOrMin(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;){if(!(r=new t(e[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function naturalExponential(t,e){var n,r,i,o,a,s,u,l=0,c=0,h=0,f=t.constructor,d=f.rounding,p=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(external=!1,u=p):u=e,s=new f(.03125);t.e>-2;)t=t.times(s),h+=5;for(u+=r=Math.log(mathpow(2,h))/Math.LN10*2+5|0,n=o=a=new f(1),f.precision=u;;){if(o=finalise(o.times(t),u,1),n=n.times(++c),digitsToString((s=a.plus(divide(o,n,u,1))).d).slice(0,u)===digitsToString(a.d).slice(0,u)){for(i=h;i--;)a=finalise(a.times(a),u,1);if(null!=e)return f.precision=p,a;if(!(l<3&&checkRoundingDigits(a.d,u-r,d,l)))return finalise(a,f.precision=p,d,external=!0);f.precision=u+=10,n=o=s=new f(1),c=0,l++}a=s}}function naturalLogarithm(t,e){var n,r,i,o,a,s,u,l,c,h,f,d=1,p=t,g=p.d,m=p.constructor,y=m.rounding,v=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(null==e?(external=!1,c=v):c=e,m.precision=c+=10,r=(n=digitsToString(g)).charAt(0),!(Math.abs(o=p.e)<15e14))return l=getLn10(m,c+2,v).times(o+""),p=naturalLogarithm(new m(r+"."+n.slice(1)),c-10).plus(l),m.precision=v,null==e?finalise(p,v,y,external=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=digitsToString((p=p.times(t)).d)).charAt(0),d++;for(o=p.e,r>1?(p=new m("0."+n),o++):p=new m(r+"."+n.slice(1)),h=p,u=a=p=divide(p.minus(1),p.plus(1),c,1),f=finalise(p.times(p),c,1),i=3;;){if(a=finalise(a.times(f),c,1),digitsToString((l=u.plus(divide(a,new m(i),c,1))).d).slice(0,c)===digitsToString(u.d).slice(0,c)){if(u=u.times(2),0!==o&&(u=u.plus(getLn10(m,c+2,v).times(o+""))),u=divide(u,new m(d),c,1),null!=e)return m.precision=v,u;if(!checkRoundingDigits(u.d,c-10,y,s))return finalise(u,m.precision=v,y,external=!0);m.precision=c+=10,l=a=p=divide(h.minus(1),h.plus(1),c,1),f=finalise(p.times(p),c,1),i=s=1}u=l,i+=2}}function nonFiniteToString(t){return String(t.s*t.s/0)}function parseDecimal(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%LOG_BASE,n<0&&(r+=LOG_BASE),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=LOG_BASE;r<i;)t.d.push(+e.slice(r,r+=LOG_BASE));e=e.slice(r),r=LOG_BASE-e.length}else r-=i;for(;r--;)e+="0";t.d.push(+e),external&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function parseOther(t,e){var n,r,i,o,a,s,u,l,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),isDecimal.test(e))return parseDecimal(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(isHex.test(e))n=16,e=e.toLowerCase();else if(isBinary.test(e))n=2;else{if(!isOctal.test(e))throw Error(invalidArgument+e);n=8}for((o=e.search(/p/i))>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),a=(o=e.indexOf("."))>=0,r=t.constructor,a&&(o=(s=(e=e.replace(".","")).length)-o,i=intPow(r,new r(n),o,2*o)),o=c=(l=convertBase(e,n,BASE)).length-1;0===l[o];--o)l.pop();return o<0?new r(0*t.s):(t.e=getBase10Exponent(l,c),t.d=l,external=!1,a&&(t=divide(t,i,4*s)),u&&(t=t.times(Math.abs(u)<54?mathpow(2,u):Decimal.pow(2,u))),external=!0,t)}function sine(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:taylorSeries(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=taylorSeries(t,2,e=e.times(1/tinyPow(5,n)),e);for(var i,o=new t(5),a=new t(16),s=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}function taylorSeries(t,e,n,r,i){var o,a,s,u,l=t.precision,c=Math.ceil(l/LOG_BASE);for(external=!1,u=n.times(n),s=new t(r);;){if(a=divide(s.times(u),new t(e++*e++),l,1),s=i?r.plus(a):r.minus(a),r=divide(a.times(u),new t(e++*e++),l,1),void 0!==(a=s.plus(r)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return external=!0,a.d.length=c+1,a}function tinyPow(t,e){for(var n=t;--e;)n*=t;return n}function toLessThanHalfPi(t,e){var n,r=e.s<0,i=getPi(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return quadrant=r?4:1,e;if((n=e.divToInt(i)).isZero())quadrant=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return quadrant=isOdd(n)?r?2:3:r?4:1,e;quadrant=isOdd(n)?r?1:4:r?3:2}return e.minus(i).abs()}function toStringBinary(t,e,n,r){var i,o,a,s,u,l,c,h,f,d=t.constructor,p=void 0!==n;if(p?(checkInt32(n,1,MAX_DIGITS),void 0===r?r=d.rounding:checkInt32(r,0,8)):(n=d.precision,r=d.rounding),t.isFinite()){for(p?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(c=finiteToString(t)).indexOf("."))>=0&&(c=c.replace(".",""),(f=new d(1)).e=c.length-a,f.d=convertBase(finiteToString(f),10,i),f.e=f.d.length),o=u=(h=convertBase(c,10,i)).length;0==h[--u];)h.pop();if(h[0]){if(a<0?o--:((t=new d(t)).d=h,t.e=o,h=(t=divide(t,f,n,r,0,i)).d,o=t.e,l=inexact),a=h[n],s=i/2,l=l||void 0!==h[n+1],l=r<4?(void 0!==a||l)&&(0===r||r===(t.s<0?3:2)):a>s||a===s&&(4===r||l||6===r&&1&h[n-1]||r===(t.s<0?8:7)),h.length=n,l)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(a=0,c="";a<u;a++)c+=NUMERALS.charAt(h[a]);if(p){if(u>1)if(16==e||8==e){for(a=16==e?4:3,--u;u%a;u++)c+="0";for(u=(h=convertBase(c,i,e)).length;!h[u-1];--u);for(a=1,c="1.";a<u;a++)c+=NUMERALS.charAt(h[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>u)for(o-=u;o--;)c+="0";else o<u&&(c=c.slice(0,o)+"."+c.slice(o))}else c=p?"0p+0":"0";c=(16==e?"0x":2==e?"0b":8==e?"0o":"")+c}else c=nonFiniteToString(t);return t.s<0?"-"+c:c}function truncate(t,e){if(t.length>e)return t.length=e,!0}function abs(t){return new this(t).abs()}function acos(t){return new this(t).acos()}function acosh(t){return new this(t).acosh()}function add(t,e){return new this(t).plus(e)}function asin(t){return new this(t).asin()}function asinh(t){return new this(t).asinh()}function atan(t){return new this(t).atan()}function atanh(t){return new this(t).atanh()}function atan2(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?getPi(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=getPi(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(divide(t,e,o,1)),e=getPi(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(divide(t,e,o,1)):(n=getPi(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function cbrt(t){return new this(t).cbrt()}function ceil(t){return finalise(t=new this(t),t.e+1,2)}function clamp(t,e,n){return new this(t).clamp(e,n)}function config(t){if(!t||"object"!=typeof t)throw Error(decimalError+"Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,MAX_DIGITS,"rounding",0,8,"toExpNeg",-EXP_LIMIT,0,"toExpPos",0,EXP_LIMIT,"maxE",0,EXP_LIMIT,"minE",-EXP_LIMIT,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(n=o[e],i&&(this[n]=DEFAULTS[n]),void 0!==(r=t[n])){if(!(mathfloor(r)===r&&r>=o[e+1]&&r<=o[e+2]))throw Error(invalidArgument+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=DEFAULTS[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(invalidArgument+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(cryptoUnavailable);this[n]=!0}else this[n]=!1}return this}function cos(t){return new this(t).cos()}function cosh(t){return new this(t).cosh()}function clone(t){var e,n,r;function i(t){var e,n,r,o=this;if(!(o instanceof i))return new i(t);if(o.constructor=i,isDecimalInstance(t))return o.s=t.s,void(external?!t.d||t.e>i.maxE?(o.e=NaN,o.d=null):t.e<i.minE?(o.e=0,o.d=[0]):(o.e=t.e,o.d=t.d.slice()):(o.e=t.e,o.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return o.s=1/t<0?-1:1,o.e=0,void(o.d=[0]);if(t<0?(t=-t,o.s=-1):o.s=1,t===~~t&&t<1e7){for(e=0,n=t;n>=10;n/=10)e++;return void(external?e>i.maxE?(o.e=NaN,o.d=null):e<i.minE?(o.e=0,o.d=[0]):(o.e=e,o.d=[t]):(o.e=e,o.d=[t]))}return 0*t!=0?(t||(o.s=NaN),o.e=NaN,void(o.d=null)):parseDecimal(o,t.toString())}if("string"!==r)throw Error(invalidArgument+t);return 45===(n=t.charCodeAt(0))?(t=t.slice(1),o.s=-1):(43===n&&(t=t.slice(1)),o.s=1),isDecimal.test(t)?parseDecimal(o,t):parseOther(o,t)}if(i.prototype=P,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=config,i.clone=clone,i.isDecimal=isDecimalInstance,i.abs=abs,i.acos=acos,i.acosh=acosh,i.add=add,i.asin=asin,i.asinh=asinh,i.atan=atan,i.atanh=atanh,i.atan2=atan2,i.cbrt=cbrt,i.ceil=ceil,i.clamp=clamp,i.cos=cos,i.cosh=cosh,i.div=div,i.exp=exp,i.floor=floor,i.hypot=hypot,i.ln=ln,i.log=log,i.log10=log10,i.log2=log2,i.max=max,i.min=min,i.mod=mod,i.mul=mul,i.pow=pow,i.random=random,i.round=round,i.sign=sign,i.sin=sin,i.sinh=sinh,i.sqrt=sqrt,i.sub=sub,i.sum=sum,i.tan=tan,i.tanh=tanh,i.trunc=trunc,void 0===t&&(t={}),t&&!0!==t.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<r.length;)t.hasOwnProperty(n=r[e++])||(t[n]=this[n]);return i.config(t),i}function div(t,e){return new this(t).div(e)}function exp(t){return new this(t).exp()}function floor(t){return finalise(t=new this(t),t.e+1,3)}function hypot(){var t,e,n=new this(0);for(external=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return external=!0,new this(1/0);n=e}return external=!0,n.sqrt()}function isDecimalInstance(t){return t instanceof Decimal||t&&t.toStringTag===tag||!1}function ln(t){return new this(t).ln()}function log(t,e){return new this(t).log(e)}function log2(t){return new this(t).log(2)}function log10(t){return new this(t).log(10)}function max(){return maxOrMin(this,arguments,"lt")}function min(){return maxOrMin(this,arguments,"gt")}function mod(t,e){return new this(t).mod(e)}function mul(t,e){return new this(t).mul(e)}function pow(t,e){return new this(t).pow(e)}function random(t){var e,n,r,i,o=0,a=new this(1),s=[];if(void 0===t?t=this.precision:checkInt32(t,1,MAX_DIGITS),r=Math.ceil(t/LOG_BASE),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(cryptoUnavailable);for(e=crypto.randomBytes(r*=4);o<r;)(i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(r=s[--o],t%=LOG_BASE,r&&t&&(i=mathpow(10,LOG_BASE-t),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=LOG_BASE)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<LOG_BASE&&(n-=LOG_BASE-r)}return a.e=n,a.d=s,a}function round(t){return finalise(t=new this(t),t.e+1,this.rounding)}function sign(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function sin(t){return new this(t).sin()}function sinh(t){return new this(t).sinh()}function sqrt(t){return new this(t).sqrt()}function sub(t,e){return new this(t).sub(e)}function sum(){var t=0,e=arguments,n=new this(e[t]);for(external=!1;n.s&&++t<e.length;)n=n.plus(e[t]);return external=!0,finalise(n,this.precision,this.rounding)}function tan(t){return new this(t).tan()}function tanh(t){return new this(t).tanh()}function trunc(t){return finalise(t=new this(t),t.e+1,1)}P[Symbol.for("nodejs.util.inspect.custom")]=P.toString,P[Symbol.toStringTag]="Decimal";var Decimal=P.constructor=clone(DEFAULTS);LN10=new Decimal(LN10),PI=new Decimal(PI);var BEP20=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getOwner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"renounceOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],ERC20=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],ERC20onPolygon=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}];class Token{constructor({blockchain:t,address:e}){this.blockchain=t,this.address=getAddress$2(e)}async decimals(){if(this.address==CONSTANTS$4[this.blockchain].NATIVE)return CONSTANTS$4[this.blockchain].DECIMALS;let t=0;try{t=await request({blockchain:this.blockchain,address:this.address,method:"decimals"},{api:Token[this.blockchain].DEFAULT,cache:864e5})}catch(t){}return t}async symbol(){return this.address==CONSTANTS$4[this.blockchain].NATIVE?CONSTANTS$4[this.blockchain].SYMBOL:await request({blockchain:this.blockchain,address:this.address,method:"symbol"},{api:Token[this.blockchain].DEFAULT,cache:864e5})}async name(){return this.address==CONSTANTS$4[this.blockchain].NATIVE?CONSTANTS$4[this.blockchain].CURRENCY:await request({blockchain:this.blockchain,address:this.address,method:"name"},{api:Token[this.blockchain].DEFAULT,cache:864e5})}async balance(t){return this.address==CONSTANTS$4[this.blockchain].NATIVE?await request({blockchain:this.blockchain,address:t,method:"balance"},{cache:3e4}):await request({blockchain:this.blockchain,address:this.address,method:"balanceOf"},{api:Token[this.blockchain].DEFAULT,params:[t],cache:3e4})}async allowance(t,e){return this.address==CONSTANTS$4[this.blockchain].NATIVE?BigNumber$3.from(CONSTANTS$4[this.blockchain].MAXINT):await request({blockchain:this.blockchain,address:this.address,method:"allowance"},{api:Token[this.blockchain].DEFAULT,params:[t,e],cache:3e4})}async BigNumber(t){let e=await this.decimals();return parseUnits$2(Token.safeAmount({amount:parseFloat(t),decimals:e}).toString(),e)}async readable(t){let e=await this.decimals(),n=formatUnits(t.toString(),e);return n=n.replace(/0+$/,""),n=n.replace(/\.$/,""),n}}Token.BigNumber=async({amount:t,blockchain:e,address:n})=>new Token({blockchain:e,address:n}).BigNumber(t),Token.readable=async({amount:t,blockchain:e,address:n})=>new Token({blockchain:e,address:n}).readable(t),Token.safeAmount=({amount:t,decimals:e})=>parseFloat(t.toFixed(e)),Token.ethereum={DEFAULT:ERC20,ERC20:ERC20},Token.bsc={DEFAULT:BEP20,BEP20:BEP20},Token.polygon={DEFAULT:ERC20onPolygon,ERC20:ERC20onPolygon};let UniswapV2Router02$1=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],UniswapV2Factory$1=[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],UniswapV2Pair$1=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var basics$2={blockchain:"ethereum",name:"uniswap_v2",alternativeNames:[],label:"Uniswap v2",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAI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3DHpTApCAPlIbZkODxdcUijIhc1UkEAMV7MkAGMLNTBaePSyQBA4paUHus3grVWvpaNHVXthJ2Y2JR6Q8AK7KDp/lM5tpiL7wHaKLoAXCKYphriLLjNPR1aqPaalC70j8BBxA9rjdL9/Niq7Pq2lDIZNDUeYhE8whZKBZegfqYmA9BGYncCEdK9ggV0kGaj+M1UOkOQCs122ezvF+2oiycAjKfz9fS6A5u+7Utv4AH3eVwNIPhUj2+Jt3ssrHn+DwDt8sxVEZFM6AguD/bxRqSaQ3EcljBZnHf0W5ZMPAMjZyMOXqPwGSu6iFCu9M/AwfTwgdN/qoR/snf8vazQs9cp/EFx+4Im/nGTtkK783xOBEJTS0uqRBUPpcxlJRFPlcxlJxGYg3WtiUEhHw18eMjaU8DUpqKZE8iANBbXbMJKHTCv+BzzThatBRqASBMNZ4mRQqwVsFHmrtkSQQx2coHzDF1MjBBgaNdTBYaIXfjw9QoCh0TsC7e961dLPOvNLKUW+xR3G2a0t4t2Loyff0JYQvCGi+ZO/fOKPXY+wpPA2/6zpEsP11Fjq0nGAzCmL3y29369p1zl9P3CvtiRhHrQ7P//Y0k0Msx/dsePapXj6RxhhhBFGGGGEEUYYYYQRRhhhhBFGGOF/7cEhAQAAAICg/6/dYAcAAAAAAAAAAIAtmJHpTFcLUiUAAAAASUVORK5CYII=",contracts:{router:{address:"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",api:UniswapV2Router02$1},factory:{address:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",api:UniswapV2Factory$1},pair:{api:UniswapV2Pair$1}}};let getAmount=async({amount:t,blockchain:e,address:n})=>await Token.BigNumber({amount:t,blockchain:e,address:n}),fixRouteParams=async({blockchain:t,exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:a,amountOut:s,amountInMax:u,amountOutMin:l})=>{let c={exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:a,amountOut:s,amountInMax:u,amountOutMin:l};return s&&"number"==typeof s&&(c.amountOut=await getAmount({amount:s,blockchain:t,address:o})),l&&"number"==typeof l&&(c.amountOutMin=await getAmount({amount:l,blockchain:t,address:o})),a&&"number"==typeof a&&(c.amountIn=await getAmount({amount:a,blockchain:t,address:i})),u&&"number"==typeof u&&(c.amountInMax=await getAmount({amount:u,blockchain:t,address:i})),c},preflight$3=({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s,amountOutMax:u,amountInMin:l})=>{if(void 0!==u)throw"You cannot not set amountOutMax! Only amountInMax or amountOutMin!";if(void 0!==l)throw"You cannot not set amountInMin! Only amountInMax or amountOutMin!";if(void 0!==o&&void 0!==i)throw"You cannot set amountIn and amountOut at the same time, use amountInMax or amountOutMin to describe the non exact part of the swap!";if(void 0!==a&&void 0!==s)throw"You cannot set amountInMax and amountOutMin at the same time, use amountIn or amountOut to describe the part of the swap that needs to be exact!";if(void 0!==i&&void 0!==a)throw"Setting amountIn and amountInMax at the same time makes no sense. Decide if amountIn needs to be exact or not!";if(void 0!==o&&void 0!==s)throw"Setting amountOut and amountOutMin at the same time makes no sense. Decide if amountOut needs to be exact or not!"};class Exchange{constructor({name:t,blockchain:e,alternativeNames:n,label:r,logo:i,contracts:o,route:a,getAmountIn:s}){this.name=t,this.blockchain=e,this.alternativeNames=n,this.label=r,this.logo=i,this.contracts=o,this._route=a,this.getAmountIn=s}async route({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s,amountOutMax:u,amountInMin:l}){return n===r?Promise.resolve():(preflight$3({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s,amountOutMax:u,amountInMin:l}),await this._route(await fixRouteParams({blockchain:this.blockchain,exchange:this,fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s})))}}function _optionalChain$3(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}class Route{constructor({tokenIn:t,tokenOut:e,path:n,amountIn:r,amountInMax:i,amountOut:o,amountOutMin:a,fromAddress:s,toAddress:u,transaction:l,exchange:c}){this.tokenIn=t,this.tokenOut=e,this.path=n,this.amountIn=_optionalChain$3([r,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOutMin=_optionalChain$3([a,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOut=_optionalChain$3([o,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountInMax=_optionalChain$3([i,"optionalAccess",t=>t.toString,"call",t=>t()]),this.fromAddress=s,this.toAddress=u,this.transaction=l,this.exchange=c}}function _optionalChain$2(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let fixUniswapPath$1=t=>{let e=t.map(((e,n)=>e===CONSTANTS$4.ethereum.NATIVE&&t[n+1]!=CONSTANTS$4.ethereum.WRAPPED&&t[n-1]!=CONSTANTS$4.ethereum.WRAPPED?CONSTANTS$4.ethereum.WRAPPED:e));return e[0]==CONSTANTS$4.ethereum.NATIVE&&e[1]==CONSTANTS$4.ethereum.WRAPPED?e.splice(0,1):e[e.length-1]==CONSTANTS$4.ethereum.NATIVE&&e[e.length-2]==CONSTANTS$4.ethereum.WRAPPED&&e.splice(e.length-1,1),e},minReserveRequirements$2=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(parseUnits$2(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(parseUnits$2(e.toString(),o)),pathExists$2=async t=>{if(1==fixUniswapPath$1(t).length)return!1;let e=await request({blockchain:"ethereum",address:basics$2.contracts.factory.address,method:"getPair"},{api:basics$2.contracts.factory.api,cache:36e5,params:fixUniswapPath$1(t)});if(e==CONSTANTS$4.ethereum.ZERO)return!1;let[n,r,i]=await Promise.all([request({blockchain:"ethereum",address:e,method:"getReserves"},{api:basics$2.contracts.pair.api,cache:36e5}),request({blockchain:"ethereum",address:e,method:"token0"},{api:basics$2.contracts.pair.api,cache:36e5}),request({blockchain:"ethereum",address:e,method:"token1"},{api:basics$2.contracts.pair.api,cache:36e5})]);if(t.includes(CONSTANTS$4.ethereum.WRAPPED))return minReserveRequirements$2({min:1,token:CONSTANTS$4.ethereum.WRAPPED,decimals:CONSTANTS$4.ethereum.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(CONSTANTS$4.ethereum.USD)){let t=new Token({blockchain:"ethereum",address:CONSTANTS$4.ethereum.USD}),e=await t.decimals();return minReserveRequirements$2({min:1e3,token:CONSTANTS$4.ethereum.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},findPath$2=async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(CONSTANTS$4.ethereum.NATIVE)&&[t,e].includes(CONSTANTS$4.ethereum.WRAPPED))return;let n;return await pathExists$2([t,e])?n=[t,e]:t!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([t,CONSTANTS$4.ethereum.WRAPPED])&&e!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([e,CONSTANTS$4.ethereum.WRAPPED])?n=[t,CONSTANTS$4.ethereum.WRAPPED,e]:t!=CONSTANTS$4.ethereum.USD&&await pathExists$2([t,CONSTANTS$4.ethereum.USD])&&e!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([CONSTANTS$4.ethereum.WRAPPED,e])?n=[t,CONSTANTS$4.ethereum.USD,CONSTANTS$4.ethereum.WRAPPED,e]:t!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([t,CONSTANTS$4.ethereum.WRAPPED])&&e!=CONSTANTS$4.ethereum.USD&&await pathExists$2([CONSTANTS$4.ethereum.USD,e])&&(n=[t,CONSTANTS$4.ethereum.WRAPPED,CONSTANTS$4.ethereum.USD,e]),_optionalChain$2([n,"optionalAccess",t=>t.length])&&n[0]==CONSTANTS$4.ethereum.NATIVE?n.splice(1,0,CONSTANTS$4.ethereum.WRAPPED):_optionalChain$2([n,"optionalAccess",t=>t.length])&&n[n.length-1]==CONSTANTS$4.ethereum.NATIVE&&n.splice(n.length-1,0,CONSTANTS$4.ethereum.WRAPPED),n},getAmountsOut$2=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{request({blockchain:"ethereum",address:basics$2.contracts.router.address,method:"getAmountsOut"},{api:basics$2.contracts.router.api,params:{amountIn:e,path:fixUniswapPath$1(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),getAmountIn$2=({path:t,amountOut:e,block:n})=>new Promise((r=>{request({blockchain:"ethereum",address:basics$2.contracts.router.address,method:"getAmountsIn"},{api:basics$2.contracts.router.api,params:{amountOut:e,path:fixUniswapPath$1(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),getAmounts$2=async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a})=>{if(r){if(null==(i=await getAmountIn$2({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await getAmountsOut$2({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}else if(a){if(null==(i=await getAmountIn$2({path:t,amountOut:a,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await getAmountsOut$2({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a}},getTransaction$2=({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:a,amountInMaxInput:s,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"ethereum",from:c,to:basics$2.contracts.router.address,api:basics$2.contracts.router.api};return t[0]===CONSTANTS$4.ethereum.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(a||s)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===CONSTANTS$4.ethereum.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:fixUniswapPath$1(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h};const fixCheckSum=t=>getAddress$2(t);let route$3=({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u})=>(e=fixCheckSum(e),n=fixCheckSum(n),new Promise((async l=>{let c=await findPath$2({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,a,s,u];if(({amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u}=await getAmounts$2({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u})),[o,s,a,u].every((t=>null==t)))return l();let g=getTransaction$2({path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new Route({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:g}))})));var uniswap_v2=new Exchange(Object.assign(basics$2,{route:route$3,getAmountIn:getAmountIn$2}));let PancakeRouter=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],PancakeFactory=[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[],name:"INIT_CODE_PAIR_HASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],PancakePair=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var basics$1={blockchain:"bsc",name:"pancakeswap",alternativeNames:["pancake"],label:"PancakeSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAOVBMVEVHcExjMAH+3JBcJwCSb05+VC7RiE9qOg/EsZ+jhWpfLADXjlT/45Z5QxGVWiaubzi9fkXuxH3dqmiL4XhdAAAACnRSTlMA////msX/6i5cADBNDwAAGz9JREFUeNrsnOGSmzoMhcMYg60MhPd/2itjNrSNSQKWWPtyvj/d2bZbVT46lozJDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4CjO+9ba/om1tvXuVg7u7/j60uKrmZDbngwFmpnwFX+jKSPJc3xNDLCJLPH11pcQYNW4Nua2ScC/YahvfzXFztv38TUWGshafbPmdiPJze9pwLM1rYu/JQI2ghs4kN32ufofNfAbKWZ5Pkv/kwbsr2m0Wrw1Zs3h5xz3Jzute8rzS41CAruWv/86u8++qz/RBZzlJd0HJLArvevy76iyszaCUP3Nfkzf3sAXxPQeyTCdUmS+PxgfmTNdqlZm9z/KCRl2NiM+MjCBj+V/KL1rK2B1TWAp/5IlWjOxvDIzrKmANjs+IihArby0M+ysQHyNsTeQXn+2fwGIlDZaJ6HPoADlbapWfLa9/qDTarlGZv21t6laaaXSq+SyH/yJIutXUMDO9X+XsfUhMDN/cbrLvlv/EM8wjg9mmqbwyzgO83e3OPXcsgp8qP/3GR6GcYG/DN860wN4f9oOjiObunvk+ev0mKPc+kvwgG/Xf07i8Ji6jnP7k11O71xjZylgs/6DMh9dCOmFIIKR/wAU8EV+6U19xfJKpfcx8PHvGZ2ga7aufHBwf8b2GuRjIEIfsDO/K0t9beZ3GgdD6grYmv94+bt7954ogXP6lFpxPW1Wf6yvdyU2NpsKkGq0rEmLMyz/Z+YQdRVaOdZs+evjiwzfw0a7YR8yJda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zgRAEoT2AF9GkndQlW+W3AuTY/P0eBpxX4ud96H5D0W9XnAec3f44CLlYQqw70r7mrLennAXC7iPp/UACdKEBxoO7C3IsXCsWg/AioHIB4wfIT0juicgGYPNBGwgES/tH3pfy/z4QjqJmqrN3sVq2vi0+Zv1JD74v4O2UBUK4cAFUdWAhM8XVdKdP70v0rsgAodw5AWWXt8UhgXD+rFLDV5wFKym+Q32zFXBaCsmrakHfqr+78pGsqpWDN27jU3P8XHikfBpZJUHd7s6AohsRXlQgr38Bdyv+BnB8JlklgMoHvpzRdYWpPcZ+T/WUgSvlnwgCq9SRQZa3bZLtnOcZf1WZ1Saq//jVL8vPlBBMWlFXddG3gZ3rGn97qpq5Kcnxc/VpF+5eRpzdanq4HwkgD3bX+eVAQho+pG0oPX77IuzS/UxqwL687DVANctC1vz3bOf3mtuuo6c0v+P61ifOvsALrOrsDEWHIBmXVMyEzVChsWLWeYvysiYzqXhqvZxTfHQgi/auQP25cHFhPhAkV6qbJdGfQGkz+gHE7eXo8a5qmripTdgNkK79y6HtI+b+IA4jKB15UgGkjlxO8IhrBU9lHAKqbVP9rHVDgqQ4fQPo3Bf1HiN8DINX/WQfuAAFqEx4IKMrvA5QHfJnBZkBUMvL5Q06BIBohEOEPgjyNgQQUJ24i/KFg3MBXPPcOJN2X1g+M3JAAggwH3wNJ9iXybQaygzviMfwAEdRdZH9z5I+eBErtygL65VR8ift7IX88zMLQ297OveufcU8af3cQC9IhGATnAfYApK5PHyL6h0JOnnC73xX62+P/d55AKf9+k7Y/NIgHqeEBAsKP3oCm7s/KpxL04kHPA2MMt7vhgrEHwL93CEgAM9WN/W7EXno+YuQmI6S3Hncn0Ff23yBVFwgEAoFAIBAIBAKBQCAQCAQCwb/24JAAAAAAQND/166wAQAAAAAAAAAAAAAAAAAAAAAAswCsVemaah0CHgAAAABJRU5ErkJggg==",contracts:{router:{address:"0x10ED43C718714eb63d5aA57B78B54704E256024E",api:PancakeRouter},factory:{address:"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",api:PancakeFactory},pair:{api:PancakePair}}};function _optionalChain$1$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let fixUniswapPath=t=>{let e=t.map(((e,n)=>e===CONSTANTS$4.bsc.NATIVE&&t[n+1]!=CONSTANTS$4.bsc.WRAPPED&&t[n-1]!=CONSTANTS$4.bsc.WRAPPED?CONSTANTS$4.bsc.WRAPPED:e));return e[0]==CONSTANTS$4.bsc.NATIVE&&e[1]==CONSTANTS$4.bsc.WRAPPED?e.splice(0,1):e[e.length-1]==CONSTANTS$4.bsc.NATIVE&&e[e.length-2]==CONSTANTS$4.bsc.WRAPPED&&e.splice(e.length-1,1),e},minReserveRequirements$1=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(parseUnits$2(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(parseUnits$2(e.toString(),o)),pathExists$1=async t=>{if(1==fixUniswapPath(t).length)return!1;let e=await request({blockchain:"bsc",address:basics$1.contracts.factory.address,method:"getPair"},{api:basics$1.contracts.factory.api,cache:36e5,params:fixUniswapPath(t)});if(e==CONSTANTS$4.bsc.ZERO)return!1;let[n,r,i]=await Promise.all([request({blockchain:"bsc",address:e,method:"getReserves"},{api:basics$1.contracts.pair.api,cache:36e5}),request({blockchain:"bsc",address:e,method:"token0"},{api:basics$1.contracts.pair.api,cache:36e5}),request({blockchain:"bsc",address:e,method:"token1"},{api:basics$1.contracts.pair.api,cache:36e5})]);if(t.includes(CONSTANTS$4.bsc.WRAPPED))return minReserveRequirements$1({min:1,token:CONSTANTS$4.bsc.WRAPPED,decimals:CONSTANTS$4.bsc.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(CONSTANTS$4.bsc.USD)){let t=new Token({blockchain:"bsc",address:CONSTANTS$4.bsc.USD}),e=await t.decimals();return minReserveRequirements$1({min:1e3,token:CONSTANTS$4.bsc.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},findPath$1=async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(CONSTANTS$4.bsc.NATIVE)&&[t,e].includes(CONSTANTS$4.bsc.WRAPPED))return;let n;return await pathExists$1([t,e])?n=[t,e]:t!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([t,CONSTANTS$4.bsc.WRAPPED])&&e!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([e,CONSTANTS$4.bsc.WRAPPED])?n=[t,CONSTANTS$4.bsc.WRAPPED,e]:t!=CONSTANTS$4.bsc.USD&&await pathExists$1([t,CONSTANTS$4.bsc.USD])&&e!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([CONSTANTS$4.bsc.WRAPPED,e])?n=[t,CONSTANTS$4.bsc.USD,CONSTANTS$4.bsc.WRAPPED,e]:t!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([t,CONSTANTS$4.bsc.WRAPPED])&&e!=CONSTANTS$4.bsc.USD&&await pathExists$1([CONSTANTS$4.bsc.USD,e])&&(n=[t,CONSTANTS$4.bsc.WRAPPED,CONSTANTS$4.bsc.USD,e]),_optionalChain$1$1([n,"optionalAccess",t=>t.length])&&n[0]==CONSTANTS$4.bsc.NATIVE?n.splice(1,0,CONSTANTS$4.bsc.WRAPPED):_optionalChain$1$1([n,"optionalAccess",t=>t.length])&&n[n.length-1]==CONSTANTS$4.bsc.NATIVE&&n.splice(n.length-1,0,CONSTANTS$4.bsc.WRAPPED),n},getAmountsOut$1=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{request({blockchain:"bsc",address:basics$1.contracts.router.address,method:"getAmountsOut"},{api:basics$1.contracts.router.api,params:{amountIn:e,path:fixUniswapPath(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),getAmountIn$1=({path:t,amountOut:e,block:n})=>new Promise((r=>{request({blockchain:"bsc",address:basics$1.contracts.router.address,method:"getAmountsIn"},{api:basics$1.contracts.router.api,params:{amountOut:e,path:fixUniswapPath(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),getAmounts$1=async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a})=>{if(r){if(null==(i=await getAmountIn$1({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await getAmountsOut$1({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}else if(a){if(null==(i=await getAmountIn$1({path:t,amountOut:a,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await getAmountsOut$1({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a}},getTransaction$1=({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:a,amountInMaxInput:s,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h="bsc",f={blockchain:h,from:c,to:basics$1.contracts.router.address,api:basics$1.contracts.router.api};return t[0]===CONSTANTS$4.bsc.NATIVE?o||u?(f.method="swapExactETHForTokens",f.value=e.toString(),f.params={amountOutMin:i.toString()}):(a||s)&&(f.method="swapETHForExactTokens",f.value=n.toString(),f.params={amountOut:r.toString()}):t[t.length-1]===CONSTANTS$4.bsc.NATIVE?o||u?(f.method="swapExactTokensForETH",f.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(f.method="swapTokensForExactETH",f.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(f.method="swapExactTokensForTokens",f.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(f.method="swapTokensForExactTokens",f.params={amountInMax:n.toString(),amountOut:r.toString()}),f.params=Object.assign({},f.params,{path:fixUniswapPath(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),f},route$2=({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u})=>(e=fixCheckSum(e),n=fixCheckSum(n),new Promise((async l=>{let c=await findPath$1({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,a,s,u];if(({amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u}=await getAmounts$1({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u})),[o,s,a,u].every((t=>null==t)))return l();let g=getTransaction$1({path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new Route({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:g}))})));var pancakeswap=new Exchange(Object.assign(basics$1,{route:route$2,getAmountIn:getAmountIn$1}));let UniswapV2Router02=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],UniswapV2Factory=[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],UniswapV2Pair=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var basics={blockchain:"polygon",name:"quickswap",alternativeNames:[],label:"QuickSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAXVBMVEVHcEz////////////////////5+vwVHkEOH2UgKlMfKWkmL3E8RmwvXJZUWXxtcY45gsRBispRkc2Chp1fltBrnNN3otaanLCDqtqwscClxubFxdHL2uvl6vL////QD9cpAAAAB3RSTlMAHD9rl8L0VWZaUQAALS5JREFUeNrsnYt2mzgQhoMv+PisG9sYCMGI93/MlcRlkAQSBAkLmN9pNk3aHHe/ufwzktsvFAqFQqFQKBQKhUKhUCgUCoVCoVAoFAqFQqFWrSA4HI7H4+l0OjOFgvinTlT0VxwOwRdqM2LYTycGvBwtHhAnGgoBhsJ6FRxoujPucxTSQMCSsDZR9CzlS3sKeT34Qnkvxt4qejkMsBh4K6fsxSjAIPBNFP4C7Dsm8YQNwRsFhyUSXxUGgQ9aNvPVIMB28EEFx9Mn4beeAAvBJ/Th1MdC8FFR+qVnCs8YAwvJQ/oYA4sp8JU+xsAC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9m8CUVz8V2VgCY/JzkvWrIAaf8FOLFiz5jUj2hUQL5tXgGT3ZlyOvHtjXwesg+vq8B61HE/STLpjpI3eCvx7xKngXvAxB38UH/oV/Te4AAAAAAAAAAAAALuEOW2gZr0akk1cAAAAASUVORK5CYII=",contracts:{router:{address:"0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",api:UniswapV2Router02},factory:{address:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",api:UniswapV2Factory},pair:{api:UniswapV2Pair}}};function _optionalChain$4(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let fixPath=t=>{let e=t.map(((e,n)=>e===CONSTANTS$4.polygon.NATIVE&&t[n+1]!=CONSTANTS$4.polygon.WRAPPED&&t[n-1]!=CONSTANTS$4.polygon.WRAPPED?CONSTANTS$4.polygon.WRAPPED:e));return e[0]==CONSTANTS$4.polygon.NATIVE&&e[1]==CONSTANTS$4.polygon.WRAPPED?e.splice(0,1):e[e.length-1]==CONSTANTS$4.polygon.NATIVE&&e[e.length-2]==CONSTANTS$4.polygon.WRAPPED&&e.splice(e.length-1,1),e},minReserveRequirements=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(parseUnits$2(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(parseUnits$2(e.toString(),o)),pathExists=async t=>{if(1==fixPath(t).length)return!1;let e=await request({blockchain:"polygon",address:basics.contracts.factory.address,method:"getPair"},{api:basics.contracts.factory.api,cache:36e5,params:fixPath(t)});if(e==CONSTANTS$4.polygon.ZERO)return!1;let[n,r,i]=await Promise.all([request({blockchain:"polygon",address:e,method:"getReserves"},{api:basics.contracts.pair.api,cache:36e5}),request({blockchain:"polygon",address:e,method:"token0"},{api:basics.contracts.pair.api,cache:36e5}),request({blockchain:"polygon",address:e,method:"token1"},{api:basics.contracts.pair.api,cache:36e5})]);if(t.includes(CONSTANTS$4.polygon.WRAPPED))return minReserveRequirements({min:1,token:CONSTANTS$4.polygon.WRAPPED,decimals:CONSTANTS$4.polygon.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(CONSTANTS$4.polygon.USD)){let t=new Token({blockchain:"polygon",address:CONSTANTS$4.polygon.USD}),e=await t.decimals();return minReserveRequirements({min:1e3,token:CONSTANTS$4.polygon.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},findPath=async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(CONSTANTS$4.polygon.NATIVE)&&[t,e].includes(CONSTANTS$4.polygon.WRAPPED))return;let n;return await pathExists([t,e])?n=[t,e]:t!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([t,CONSTANTS$4.polygon.WRAPPED])&&e!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([e,CONSTANTS$4.polygon.WRAPPED])?n=[t,CONSTANTS$4.polygon.WRAPPED,e]:t!=CONSTANTS$4.polygon.USD&&await pathExists([t,CONSTANTS$4.polygon.USD])&&e!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([CONSTANTS$4.polygon.WRAPPED,e])?n=[t,CONSTANTS$4.polygon.USD,CONSTANTS$4.polygon.WRAPPED,e]:t!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([t,CONSTANTS$4.polygon.WRAPPED])&&e!=CONSTANTS$4.polygon.USD&&await pathExists([CONSTANTS$4.polygon.USD,e])&&(n=[t,CONSTANTS$4.polygon.WRAPPED,CONSTANTS$4.polygon.USD,e]),_optionalChain$4([n,"optionalAccess",t=>t.length])&&n[0]==CONSTANTS$4.polygon.NATIVE?n.splice(1,0,CONSTANTS$4.polygon.WRAPPED):_optionalChain$4([n,"optionalAccess",t=>t.length])&&n[n.length-1]==CONSTANTS$4.polygon.NATIVE&&n.splice(n.length-1,0,CONSTANTS$4.polygon.WRAPPED),n},getAmountsOut=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{request({blockchain:"polygon",address:basics.contracts.router.address,method:"getAmountsOut"},{api:basics.contracts.router.api,params:{amountIn:e,path:fixPath(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),getAmountIn=({path:t,amountOut:e,block:n})=>new Promise((r=>{request({blockchain:"polygon",address:basics.contracts.router.address,method:"getAmountsIn"},{api:basics.contracts.router.api,params:{amountOut:e,path:fixPath(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),getAmounts=async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a})=>{if(r){if(null==(i=await getAmountIn({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await getAmountsOut({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}else if(a){if(null==(i=await getAmountIn({path:t,amountOut:a,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await getAmountsOut({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a}},getTransaction$3=({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:a,amountInMaxInput:s,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"polygon",from:c,to:basics.contracts.router.address,api:basics.contracts.router.api};return t[0]===CONSTANTS$4.polygon.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(a||s)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===CONSTANTS$4.polygon.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:fixPath(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h},route$1=({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u})=>(e=fixCheckSum(e),n=fixCheckSum(n),new Promise((async l=>{let c=await findPath({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,a,s,u];if(({amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u}=await getAmounts({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u})),[o,s,a,u].every((t=>null==t)))return l();let g=getTransaction$3({path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new Route({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:g}))})));var quickswap=new Exchange(Object.assign(basics,{route:route$1,getAmountIn:getAmountIn}));let all=[uniswap_v2,pancakeswap,quickswap],route$4=({blockchain:t,fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u,amountOutMax:l,amountInMin:c})=>Promise.all(all.map((h=>h.blockchain!==t?null:h.route({fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u,amountOutMax:l,amountInMin:c})))).then((t=>t.filter(Boolean)));var ChangableAmountProvider=function(t){var e=function(t){return!t.every((function(t){return void 0!==t.amount||void 0!==t.fromAmount}))},n=react.useContext(ConfigurationContext),r=n.amount;n.toAmount;var i,o=n.recover,a=_slicedToArray(react.useState(null==o&&e(t.accept)),2),s=a[0],u=a[1],l=react.useContext(WalletContext).account,c=react.useContext(ConversionRateContext),h=c.conversionRate,f=c.fixedCurrencyConversionRate,d=react.useContext(ErrorContext).setError,p=_slicedToArray(react.useState(),2),g=p[0],m=p[1],y=_slicedToArray(react.useState("object"==_typeof(r)&&r.fix&&r.currency?r.fix:null),1)[0],v=_slicedToArray(react.useState("object"==_typeof(r)&&r.fix&&r.currency?r.currency:null),1)[0];s&&(i="object"==_typeof(r)&&r.start&&r.start?r.start:"object"==_typeof(r)&&r.fix?r.fix:1);var b=_slicedToArray(react.useState(i),2),w=b[0],A=b[1],_=_slicedToArray(react.useState(),2),E=_[0],k=_[1],M=_slicedToArray(react.useState(100),2),S=M[0],x=M[1];react.useEffect((function(){o||u(e(t.accept))}),[t.accept,o]);var C=function(e){var n=e.amount,i=e.conversionRate,o=e.fixedCurrencyConversionRate;return new Promise((function(e,a){r&&r.token?e(t.accept.map((function(){return n}))):Promise.all(t.accept.map((function(t){return y?CONSTANTS$4[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/o*y:route$4({blockchain:t.blockchain,tokenIn:CONSTANTS$4[t.blockchain].USD,amountIn:1/o*y,tokenOut:t.token,fromAddress:l,toAddress:l}):CONSTANTS$4[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/i*n:route$4({blockchain:t.blockchain,tokenIn:CONSTANTS$4[t.blockchain].USD,amountIn:1/i*n,tokenOut:t.token,fromAddress:l,toAddress:l})}))).then((function(n){Promise.all(n.map((function(e,n){return"number"==typeof e?e:null==e[0]?void 0:Token.readable({blockchain:t.accept[n].blockchain,amount:e[0].amountOut,address:e[0].tokenOut})}))).then(e).catch(d)})).catch(d)}))},T=react.useCallback(lodash$1.debounce((function(e){var n=e.account,r=e.amount,i=e.conversionRate,o=e.fixedCurrencyConversionRate;C({amount:r,conversionRate:i,fixedCurrencyConversionRate:o}).then((function(e){m(t.accept.map((function(t,r){if(null!=e[r])return{blockchain:t.blockchain,amount:round$1(e[r]),token:t.token,receiver:t.receiver||n}})).filter((function(t){return!!t})))})).catch(d)}),500),[]);return react.useEffect((function(){o||s&&l&&h&&(!y||f)&&T({account:l,amount:w,conversionRate:h,fixedCurrencyConversionRate:f})}),[s,l,h,y,f,w,o]),react.useEffect((function(){s&&E?E.fromToken.readable(E.fromBalance).then((function(t){if(r&&r.token)route$4({blockchain:E.blockchain,tokenIn:E.fromToken.address,tokenOut:E.toToken.address,amountIn:parseFloat(t),fromAddress:l,toAddress:l}).then((function(t){null!=t[0]&&Token.readable({amount:t[0].amountOut,blockchain:E.blockchain,address:E.toToken.address}).then((function(t){var e=parseFloat(new Decimal(t).div(1.01).mul(h).toString());x(e>10?Math.round(e-1):round$1(e-1))})).catch(d)})).catch(d);else if(E.fromToken.address==CONSTANTS$4[E.blockchain].USD){var e=parseFloat(new Decimal(t).mul(h).toString());x(e>10?Math.round(e-1):e-1)}else route$4({blockchain:E.blockchain,tokenIn:E.fromToken.address,tokenOut:CONSTANTS$4[E.blockchain].USD,amountIn:parseFloat(t),fromAddress:l,toAddress:l}).then((function(t){null!=t[0]&&Token.readable({amount:t[0].amountOut,blockchain:E.blockchain,address:CONSTANTS$4[E.blockchain].USD}).then((function(t){var e=parseFloat(new Decimal(t).div(1.01).mul(h).toString());x(e>10?Math.round(e):round$1(e))})).catch(d)})).catch(d)})).catch(d):x(100)}),[l,E]),react.createElement(ChangableAmountContext.Provider,{value:{amountsMissing:s,fixedAmount:y,fixedCurrency:v,acceptWithAmount:g,amount:w,setAmount:A,setMaxRoute:k,maxAmount:S}},t.children)},timezoneToCurrency={"Pacific/Midway":"USD","Pacific/Niue":"NZD","Pacific/Pago_Pago":"USD","America/Adak":"USD","Pacific/Honolulu":"USD","Pacific/Rarotonga":"NZD","Pacific/Tahiti":"XPF","Pacific/Marquesas":"XPF","America/Anchorage":"USD","America/Juneau":"USD","America/Metlakatla":"USD","America/Nome":"USD","America/Sitka":"USD","America/Yakutat":"USD","Pacific/Gambier":"XPF","America/Los_Angeles":"USD","America/Tijuana":"MXN","America/Vancouver":"CAD","Pacific/Pitcairn":"NZD","America/Boise":"USD","America/Cambridge_Bay":"CAD","America/Chihuahua":"MXN","America/Creston":"CAD","America/Dawson":"CAD","America/Dawson_Creek":"CAD","America/Denver":"USD","America/Edmonton":"CAD","America/Fort_Nelson":"CAD","America/Hermosillo":"MXN","America/Inuvik":"CAD","America/Mazatlan":"MXN","America/Ojinaga":"MXN","America/Phoenix":"USD","America/Whitehorse":"CAD","America/Yellowknife":"CAD","America/Bahia_Banderas":"MXN","America/Belize":"BZD","America/Chicago":"USD","America/Costa_Rica":"CRC","America/El_Salvador":"USD","America/Guatemala":"GTQ","America/Indiana/Knox":"USD","America/Indiana/Tell_City":"USD","America/Managua":"NIO","America/Matamoros":"MXN","America/Menominee":"USD","America/Merida":"MXN","America/Mexico_City":"MXN","America/Monterrey":"MXN","America/North_Dakota/Beulah":"USD","America/North_Dakota/Center":"USD","America/North_Dakota/New_Salem":"USD","America/Rainy_River":"CAD","America/Rankin_Inlet":"CAD","America/Regina":"CAD","America/Resolute":"CAD","America/Swift_Current":"CAD","America/Tegucigalpa":"HNL","America/Winnipeg":"CAD","Pacific/Easter":"CLP","Pacific/Galapagos":"USD","America/Atikokan":"CAD","America/Bogota":"COP","America/Cancun":"MXN","America/Cayman":"KYD","America/Detroit":"USD","America/Eirunepe":"BRL","America/Grand_Turk":"USD","America/Guayaquil":"USD","America/Havana":"CUP","America/Indiana/Indianapolis":"USD","America/Indiana/Marengo":"USD","America/Indiana/Petersburg":"USD","America/Indiana/Vevay":"USD","America/Indiana/Vincennes":"USD","America/Indiana/Winamac":"USD","America/Iqaluit":"CAD","America/Jamaica":"JMD","America/Kentucky/Louisville":"USD","America/Kentucky/Monticello":"USD","America/Lima":"PEN","America/Nassau":"BSD","America/New_York":"USD","America/Nipigon":"CAD","America/Panama":"PAB","America/Pangnirtung":"CAD","America/Port-au-Prince":"HTG","America/Rio_Branco":"BRL","America/Thunder_Bay":"CAD","America/Toronto":"CAD","America/AnguillaSandy Hill":"XCD","America/Antigua":"XCD","America/Aruba":"AWG","America/Asuncion":"PYG","America/Barbados":"BBD","America/Blanc-Sablon":"CAD","America/Boa_Vista":"BRL","America/Campo_Grande":"BRL","America/Caracas":"VEB","America/Cuiaba":"BRL","America/Curacao":"ANG","America/Dominica":"DOP","America/Glace_Bay":"CAD","America/Goose_Bay":"CAD","America/Grenada":"XCD","America/Guadeloupe":"EUR","America/Guyana":"GYD","America/Halifax":"CAD","America/Kralendijk":"USD","America/La_Paz":"BOB","America/Lower_Princes":"USD","America/Manaus":"BRL","America/Marigot":"EUR","America/Martinique":"EUR","America/Moncton":"CAD","America/Montserrat":"XCD","America/Porto_Velho":"BRL","America/Port_of_Spain":"BZD","America/Puerto_Rico":"USD","America/Santiago":"CLP","America/Santo_Domingo":"DOP","America/St_Barthelemy":"EUR","America/St_Kitts":"XCD","America/St_Lucia":"XCD","America/St_Thomas":"USD","America/St_Vincent":"XCD","America/Thule":"DKK","America/Tortola":"USD","Atlantic/Bermuda":"BMD","America/St_Johns":"CAD","America/Araguaina":"BRL","America/Argentina/Buenos_Aires":"ARS","America/Argentina/Catamarca":"ARS","America/Argentina/Cordoba":"ARS","America/Argentina/Jujuy":"ARS","America/Argentina/La_Rioja":"ARS","America/Argentina/Mendoza":"ARS","America/Argentina/Rio_Gallegos":"ARS","America/Argentina/Salta":"ARS","America/Argentina/San_Juan":"ARS","America/Argentina/San_Luis":"ARS","America/Argentina/Tucuman":"ARS","America/Argentina/Ushuaia":"ARS","America/Bahia":"BRL","America/Belem":"BRL","America/Cayenne":"EUR","America/Fortaleza":"BRL","America/Godthab":"DKK","America/Maceio":"BRL","America/Miquelon":"EUR","America/Montevideo":"UYU","America/Paramaribo":"SRD","America/Punta_Arenas":"CLP","America/Recife":"BRL","America/Santarem":"BRL","America/Sao_Paulo":"BRL","Antarctica/Palmer":"USD","Antarctica/Rothera":"USD","Atlantic/Stanley":"FKP","America/Noronha":"BRL","Atlantic/South_Georgia":"GBP","America/Scoresbysund":"DKK","Atlantic/Azores":"EUR","Atlantic/Cape_Verde":"CVE","Africa/Abidjan":"XOF","Africa/Accra":"GHC","Africa/Bamako":"XOF","Africa/Banjul":"GMD","Africa/Bissau":"XOF","Africa/Casablanca":"MAD","Africa/Conakry":"GNF","Africa/Dakar":"XOF","Africa/El_Aaiun":"MAD","Africa/Freetown":"SLL","Africa/Lome":"XOF","Africa/Monrovia":"LRD","Africa/Nouakchott":"MRU","Africa/Ouagadougou":"XOF","Africa/Sao_Tome":"STD","America/Danmarkshavn":"DKK","Antarctica/Troll":"NOK","Atlantic/Canary":"EUR","Atlantic/Faroe":"DKK","Atlantic/Madeira":"EUR","Atlantic/Reykjavik":"ISK","Atlantic/St_Helena":"SHP","Europe/Dublin":"EUR","Europe/Guernsey":"GBP","Europe/Isle_of_Man":"IMP","Europe/Jersey":"GBP","Europe/Lisbon":"EUR","Europe/London":"GBP","Africa/Algiers":"DZD","Africa/Bangui":"XAF","Africa/Brazzaville":"XAF","Africa/Ceuta":"EUR","Africa/Douala":"XAF","Africa/Kinshasa":"CDF","Africa/Lagos":"NGN","Africa/Libreville":"XAF","Africa/Luanda":"AOA","Africa/Malabo":"XAF","Africa/Ndjamena":"XAF","Africa/Niamey":"XOF","Africa/Porto-Novo":"XOF","Africa/Tunis":"TND","Africa/Windhoek":"NAD","Arctic/Longyearbyen":"NOK","Europe/Amsterdam":"EUR","Europe/Andorra":"EUR","Europe/Belgrade":"RSD","Europe/Berlin":"EUR","Europe/Bratislava":"EUR","Europe/Brussels":"EUR","Europe/Budapest":"HUF","Europe/Copenhagen":"DKK","Europe/Gibraltar":"GIP","Europe/Ljubljana":"EUR","Europe/Luxembourg":"EUR","Europe/Madrid":"EUR","Europe/Malta":"EUR","Europe/Monaco":"EUR","Europe/Oslo":"NOK","Europe/Paris":"EUR","Europe/Podgorica":"EUR","Europe/Prague":"CZK","Europe/Rome":"EUR","Europe/San_Marino":"EUR","Europe/Sarajevo":"BAM","Europe/Skopje":"MKD","Europe/Stockholm":"SEK","Europe/Tirane":"ALL","Europe/Vaduz":"CHF","Europe/Vatican":"EUR","Europe/Vienna":"EUR","Europe/Warsaw":"PLN","Europe/Zagreb":"HRK","Europe/Zurich":"CHF","Africa/Blantyre":"MWK","Africa/Bujumbura":"BIF","Africa/Cairo":"EGP","Africa/Gaborone":"BWP","Africa/Harare":"ZWL","Africa/Johannesburg":"ZAR","Africa/Juba":"SSP","Africa/Khartoum":"SDG","Africa/Kigali":"RWF","Africa/Lubumbashi":"CDF","Africa/Lusaka":"ZMW","Africa/Maputo":"MZM","Africa/Maseru":"LSL","Africa/Mbabane":"SZL","Africa/Tripoli":"LYD","Asia/Amman":"JOD","Asia/Beirut":"LBP","Asia/Damascus":"SYP","Asia/Famagusta":"TRY","Asia/Gaza":"ILS","Asia/Hebron":"ILS","Asia/Jerusalem":"ILS","Asia/Nicosia":"EUR","Europe/Athens":"EUR","Europe/Bucharest":"RON","Europe/Chisinau":"MDL","Europe/Helsinki":"EUR","Europe/Kaliningrad":"RUB","Europe/Kiev":"UAH","Europe/Mariehamn":"EUR","Europe/Riga":"EUR","Europe/Sofia":"BGN","Europe/Tallinn":"EUR","Europe/Uzhgorod":"UAH","Europe/Vilnius":"EUR","Europe/Zaporozhye":"UAH","Africa/Addis_Ababa":"ETB","Africa/Asmara":"ERN","Africa/Dar_es_Salaam":"TZS","Africa/Djibouti":"DJF","Africa/Kampala":"UGX","Africa/Mogadishu":"SOS","Africa/Nairobi":"KES","Antarctica/Syowa":"EUR","Asia/Aden":"YER","Asia/Baghdad":"IQD","Asia/Bahrain":"BHD","Asia/Kuwait":"KWD","Asia/Qatar":"QAR","Asia/Riyadh":"SAR","Europe/Istanbul":"TRY","Europe/Kirov":"RUB","Europe/Minsk":"BYN","Europe/Moscow":"RUB","Europe/Simferopol":"RUB","Europe/Volgograd":"RUB","Indian/Antananarivo":"MGA","Indian/Comoro":"USD","Indian/Mayotte":"EUR","Asia/Tehran":"IRR","Asia/Baku":"AZN","Asia/Dubai":"AED","Asia/Muscat":"OMR","Asia/Tbilisi":"GEL","Asia/Yerevan":"AMD","Europe/Astrakhan":"RUB","Europe/Samara":"RUB","Europe/Saratov":"RUB","Europe/Ulyanovsk":"RUB","Indian/Mahe":"SCR","Indian/Mauritius":"MUR","Indian/Reunion":"EUR","Asia/Kabul":"AFN","Antarctica/Mawson":"USD","Asia/Aqtau":"KZT","Asia/Aqtobe":"KZT","Asia/Ashgabat":"TMM","Asia/Atyrau":"KZT","Asia/Dushanbe":"TJS","Asia/Karachi":"PKR","Asia/Oral":"KZT","Asia/Qyzylorda":"KZT","Asia/Samarkand":"UZS","Asia/Tashkent":"UZS","Asia/Yekaterinburg":"RUB","Indian/Kerguelen":"EUR","Indian/Maldives":"MVR","Asia/Colombo":"LKR","Asia/Kolkata":"INR","Asia/Kathmandu":"NPR","Antarctica/Vostok":"USD","Asia/Almaty":"KZT","Asia/Bishkek":"KGS","Asia/Dhaka":"BDT","Asia/Omsk":"RUB","Asia/Qostanay":"KZT","Asia/Thimphu":"BTN","Asia/Urumqi":"CNY","Indian/Chagos":"USD","Asia/Yangon":"MMK","Indian/Cocos":"AUD","Antarctica/Davis":"USD","Asia/Bangkok":"THB","Asia/Barnaul":"RUB","Asia/Hovd":"MNT","Asia/Ho_Chi_Minh":"VND","Asia/Jakarta":"IDR","Asia/Krasnoyarsk":"RUB","Asia/Novokuznetsk":"RUB","Asia/Novosibirsk":"RUB","Asia/Phnom_Penh":"KHR","Asia/Pontianak":"IDR","Asia/Tomsk":"RUB","Asia/Vientiane":"LAK","Indian/Christmas":"AUD","Asia/Brunei":"BND","Asia/Choibalsan":"MNT","Asia/Hong_Kong":"HKD","Asia/Irkutsk":"RUB","Asia/Kuala_Lumpur":"MYR","Asia/Kuching":"MYR","Asia/Macau":"MOP","Asia/Makassar":"IDR","Asia/Manila":"PHP","Asia/Shanghai":"CNY","Asia/Singapore":"SGD","Asia/Taipei":"TWD","Asia/Ulaanbaatar":"MNT","Australia/Perth":"AUD","Australia/Eucla":"AUD","Asia/Chita":"RUB","Asia/Dili":"USD","Asia/Jayapura":"IDR","Asia/Khandyga":"RUB","Asia/Pyongyang":"KPW","Asia/Seoul":"KRW","Asia/Tokyo":"JPY","Asia/Yakutsk":"RUB","Pacific/Palau":"USD","Australia/Adelaide":"AUD","Australia/Broken_Hill":"AUD","Australia/Darwin":"AUD","Antarctica/DumontDUrville":"USD","Antarctica/Macquarie":"USD","Asia/Ust-Nera":"RUB","Asia/Vladivostok":"RUB","Australia/Brisbane":"AUD","Australia/Currie":"AUD","Australia/Hobart":"AUD","Australia/Lindeman":"AUD","Australia/Melbourne":"AUD","Australia/Sydney":"AUD","Pacific/Chuuk":"USD","Pacific/GuamVillage":"USD","Pacific/Port_Moresby":"PGK","Pacific/Saipan":"USD","Australia/Lord_Howe":"AUD","Antarctica/Casey":"USD","Asia/Magadan":"RUB","Asia/Sakhalin":"RUB","Asia/Srednekolymsk":"RUB","Pacific/Bougainville":"PGK","Pacific/Efate":"VUV","Pacific/Guadalcanal":"SBD","Pacific/Kosrae":"USD","Pacific/Norfolk":"USD","Pacific/Noumea":"XPF","Pacific/Pohnpei":"USD","Antarctica/McMurdo":"USD","Asia/Anadyr":"RUB","Asia/Kamchatka":"RUB","Pacific/Auckland":"NZD","Pacific/Fiji":"FJD","Pacific/Funafuti":"AUD","Pacific/Kwajalein":"USD","Pacific/Majuro":"USD","Pacific/Nauru":"AUD","Pacific/Tarawa":"AUD","Pacific/Wake":"USD","Pacific/Wallis":"XPF","Pacific/Chatham":"CAD","Pacific/Apia":"NGN","Pacific/Enderbury":"USD","Pacific/Fakaofo":"NZD","Pacific/Tongatapu":"TOP","Pacific/Kiritimati":"AUD"};class Currency{constructor({amount:t,code:e,timeZone:n=Currency.timeZone()}){this.amount=t,this.code=e||window._LocalCurrencyCode||Currency.getCode(n),this.timeZone=n}static getCode(t){return window._LocalCurrencyCode||timezoneToCurrency[t||Currency.timeZone()]||"USD"}static async rate({from:t,to:e}){null==e&&(e=Currency.getCode());let n=await Currency.fromUSD({amount:1,code:t}),r=await Currency.fromUSD({amount:1,code:e});return n.amount/r.amount}static async fromUSD({amount:t,code:e,timeZone:n}){let r=new Currency({amount:t,code:e,timeZone:n}),i=await fetch("https://public.depay.fi/currencies/"+r.code).then((t=>t.json())).then((t=>parseFloat(t))).catch((()=>(r.code="USD",1)));return r.amount=r.amount*i,r}static timeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}toString(t={}){return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:this.code}).format(this.amount)}}var ConfigurationProvider=function(t){var e=new Currency({code:t.configuration.currency}).code;return react.useEffect((function(){null!=t.configuration.providers&&Object.entries(t.configuration.providers).forEach((function(t){setProviderEndpoints(t[0],t[1])}))}),[t.configuration]),react.createElement(ConfigurationContext.Provider,{value:Object.assign({},t.configuration,{currencyCode:e})},t.children)},ConversionRateProvider=function(t){react.useContext(ErrorContext).setError;var e=react.useContext(ConfigurationContext),n=e.amount,r=e.currency,i=_slicedToArray(react.useState(),2),o=i[0],a=i[1],s=_slicedToArray(react.useState(),2),u=s[0],l=s[1];return react.useEffect((function(){"object"==_typeof(n)&&n.currency&&Currency.fromUSD({amount:1,code:n.currency}).then((function(t){return l(t.amount)})),Currency.fromUSD({amount:1,code:r}).then((function(t){return a(t.amount)})).catch(a(1))}),[]),react.createElement(ConversionRateContext.Provider,{value:{conversionRate:o,fixedCurrencyConversionRate:u}},t.children)},DonationRoutingContext=react.createContext(),NavigateContext=react.createContext(),QuestionsGraphic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAHQCAMAAADgcCJ6AAAAXVBMVEVHcEwiGxq6jYEwExPTf2RKx+4uEhLSf2PSfmMvEhJKx+7UgWYvEhIvEhJOJyJrOzGHTkCdX023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cAAAAAAAAAAAAAAAAAAAAAAAD0/AOU5ijBfZTOtQAAAABJRU5ErkJggg==",NoPaymentMethodFoundDialog=function(){var t=react.useContext(ClosableContext).close;return react.createElement(Dialog,{header:react.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM"}),body:react.createElement("div",{className:"TextCenter"},react.createElement("div",{className:"GraphicWrapper"},react.createElement("img",{className:"Graphic",src:QuestionsGraphic})),react.createElement("h1",{className:"LineHeightL Text FontSizeL PaddingTopS FontWeightBold"},"Insufficient Balance"),react.createElement("div",{className:"Text PaddingTopS PaddingBottomM PaddingLeftM PaddingRightM"},react.createElement("strong",{className:"FontSizeM"},"We were not able to find any asset with enough value in your wallet. Please top up your account in order to proceed with this payment."))),footer:react.createElement("div",{className:"PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"},react.createElement("button",{className:"ButtonPrimary",onClick:t},"Ok"))})},PaymentContext=react.createContext(),PaymentRoutingContext=react.createContext(),PaymentTrackingContext=react.createContext(),TransactionTrackingContext=react.createContext(),PaymentProvider=function(t){var e=react.useContext(ErrorContext).setError,n=react.useContext(ConfigurationContext),r=n.sent,i=n.confirmed,o=n.failed,a=n.recover,s=n.before,u=react.useContext(PaymentRoutingContext),l=u.selectedRoute;u.getPaymentRoutes;var c=react.useContext(ClosableContext),h=c.open,f=c.close,d=c.setClosable,p=react.useContext(PaymentRoutingContext).allRoutes,g=react.useContext(UpdatableContext).setUpdatable,m=react.useContext(NavigateContext),y=m.navigate,v=m.set,b=react.useContext(WalletContext).wallet,w=react.useContext(PaymentTrackingContext),A=w.release,_=w.tracking,E=w.initializeTracking,k=react.useContext(TransactionTrackingContext),M=k.foundTransaction,S=k.initializeTracking,x=_slicedToArray(react.useState(),2),C=x[0],T=x[1],N=_slicedToArray(react.useState(),2),B=N[0],$=N[1],P=_slicedToArray(react.useState(),2),I=P[0],R=P[1],O=_slicedToArray(react.useState("initialized"),2),L=O[0],D=O[1],F=function(t){1!=_&&d(!0),D("confirmed"),i&&i(t)},j=function(t,e){o&&o(t,e),d(!0),v(["PaymentError"])},U=function(){var t=_asyncToGenerator(regenerator.mark((function t(){var e;return regenerator.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=4;break}if(!1!==s(C.route.transaction)){t.next=4;break}return t.abrupt("return");case 4:return d(!1),D("paying"),g(!1),t.next=9,request({blockchain:C.route.transaction.blockchain,method:"latestBlockNumber"});case 9:e=t.sent,b.sendTransaction(Object.assign({},C.route.transaction,{sent:function(t){S(t,e),r&&r(t)},confirmed:F,failed:j})).then((function(t){E(t,e,C.route),$(t)})).catch((function(t){console.log("error",t),D("initialized"),d(!0),g(!0),"WRONG_NETWORK"==(null==t?void 0:t.code)&&y("WrongNetwork")}));case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return react.useEffect((function(){A&&D("confirmed")}),[A]),react.useEffect((function(){if(a){d(!1),g(!1),D("paying"),$({blockchain:a.blockchain,id:a.transaction,url:Blockchain.findByName(a.blockchain).explorerUrlFor({transaction:{id:a.transaction}})});var t=new Token({blockchain:a.blockchain,address:a.token});Promise.all([t.name(),t.symbol()]).then((function(t){var e=_slicedToArray(t,2),n=e[0],r=e[1];T({blockchain:a.blockchain,token:a.token,name:n,symbol:r.toUpperCase(),amount:a.amount})})).catch(e)}}),[a]),react.useEffect((function(){var t;M&&M.id&&M.status&&(M.id.toLowerCase()!=B.id.toLowerCase()&&(t=Object.assign({},B,{id:M.id,url:Blockchain.findByName(B.blockchain).explorerUrlFor({transaction:M})}),$(t)),"success"==M.status?F(t||B):"failed"==M.status&&j(t||B))}),[M,B]),react.useEffect((function(){if(l){var t=l.fromToken;Promise.all([t.name(),t.symbol(),t.readable(l.fromAmount)]).then((function(e){var n=_slicedToArray(e,3),r=n[0],i=n[1],o=n[2];T({blockchain:l.blockchain,route:l,token:t.address,name:r,symbol:i.toUpperCase(),amount:o})})).catch(e)}else T(void 0)}),[l]),react.useEffect((function(){p&&0==p.length?g(!1):p&&p.length>0&&g(!0)}),[p]),p instanceof Array&&0==p.length?react.createElement(ReactDialogStack,{open:h,close:f,start:"NoPaymentMethodFound",container:t.container,document:t.document,dialogs:{NoPaymentMethodFound:react.createElement(NoPaymentMethodFoundDialog,null)}}):react.createElement(PaymentContext.Provider,{value:{payment:C,paymentState:L,pay:U,transaction:B,approve:function(){d(!1),D("approving"),b.sendTransaction(Object.assign({},C.route.approvalTransaction,{confirmed:function(){C.route.approvalRequired=!1,T(C),d(!0),D("initialized")}})).then((function(t){R(t)})).catch((function(t){console.log("error",t),D("initialized"),d(!0)}))},approvalTransaction:I}},t.children)};function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ensureNativeTokenAsset=async({address:t,options:e,assets:n,blockchain:r})=>{if(e.only&&e.only[r]&&!e.only[r].find((t=>t.toLowerCase()==CONSTANTS$4[r].NATIVE.toLowerCase())))return n;if(e.exclude&&e.exclude[r]&&e.exclude[r].find((t=>t.toLowerCase()==CONSTANTS$4[r].NATIVE.toLowerCase())))return n;if(!n.find((t=>t.address.toLowerCase()==CONSTANTS$4[r].NATIVE.toLowerCase()))){let e=await request({blockchain:r,address:t,method:"balance"},{cache:3e4});n=[{name:CONSTANTS$4[r].CURRENCY,symbol:CONSTANTS$4[r].SYMBOL,address:CONSTANTS$4[r].NATIVE,type:"NATIVE",blockchain:r,balance:e.toString()},...n]}return n},filterAssets=({assets:t,blockchain:e,options:n})=>n.only?t.filter((t=>(n.only[e]||[]).find((e=>e.toLowerCase()==t.address.toLowerCase())))):n.exclude?t.filter((t=>(n.exclude[e]||[]).find((e=>e.toLowerCase()!=t.address.toLowerCase())))):t;var getAssets=async t=>(void 0===t&&(t={accounts:{}}),Promise.all(Object.keys(t.accounts).map((e=>new Promise(((n,r)=>{const i=t.accounts[e],o=new AbortController;setTimeout((()=>o.abort()),1e4),fetch(`https://public.depay.fi/accounts/${e}/${i}/assets`,{signal:o.signal}).catch((t=>{console.log(t),n([])})).then((t=>{if(t&&t.ok)return t.json();n([])})).then((async r=>{if(r&&r.length)return await ensureNativeTokenAsset({address:i,options:t,assets:filterAssets({assets:r,blockchain:e,options:t}).map((t=>Object.assign(t,{blockchain:e}))),blockchain:e});n([])})).then(n).catch((t=>{console.log(t),n([])}))}))))).then((t=>t.flat())));const reduceAssetWithBalance=(t,e)=>Object.assign({},{address:t.address,symbol:t.symbol,name:t.name,decimals:t.decimals,type:t.type,blockchain:t.blockchain},{balance:e.toString()}),exists=({assets:t,asset:e})=>!!t.find((t=>t.blockchain==e.blockchain&&t.address.toLowerCase()==e.address.toLowerCase())),isFiltered=({options:t,address:e,blockchain:n})=>!(!(t&&t.only&&t.only[n])||t.only[n].find((t=>t.toLowerCase()==e.toLowerCase())))||!!(t&&t.exclude&&t.exclude[n]&&t.exclude[n].find((t=>t.toLowerCase()==e.toLowerCase())));var dripAssets=async t=>{void 0===t&&(t={accounts:{},priority:[]});let e=[],n=[];n=n.concat((t.priority||[]).map((n=>new Promise((async(r,i)=>{try{let i=new Token(n),o=Object.assign({},n,{name:await i.name(),symbol:await i.symbol(),decimals:await i.decimals(),balance:(await i.balance(t.accounts[n.blockchain])).toString()});if("0"!=o.balance){if(exists({assets:e,asset:n}))return r();e.push(o),"function"==typeof t.drip&&t.drip(o),r(o)}else r()}catch(t){r()}})))));let r=[];for(var i in t.accounts)Blockchain.findByName(i).tokens.forEach((e=>{isFiltered({options:t,address:e.address,blockchain:i})||r.push(Object.assign({},e,{blockchain:i}))}));if(n=n.concat(r.map((n=>new Promise(((r,i)=>{new Token(n).balance(t.accounts[n.blockchain]).then((i=>{if(exists({assets:e,asset:n}))return r();const o=reduceAssetWithBalance(n,i);"0"!=o.balance?(e.push(o),"function"==typeof t.drip&&t.drip(o),r(o)):r()})).catch((t=>{console.log(t),r()}))}))))),null==t.only||Object.keys(t.only).every((t=>0==t.length))){let r=await getAssets(t);n=n.concat(r.map((n=>new Promise(((r,i)=>new Token(n).balance(t.accounts[n.blockchain]).then((i=>{if(exists({assets:e,asset:n}))return r();const o=reduceAssetWithBalance(n,i);"0"!=o.balance?(e.push(o),"function"==typeof t.drip&&t.drip(o),r(o)):r()})).catch((t=>{console.log(t),r()})))))))}return await Promise.all(n),e};const prepareUniswapTransaction=t=>(t.params.path=t.params.path.filter(((e,n,r)=>(1!=n||e!=CONSTANTS$4[t.blockchain].WRAPPED||r[0]!=CONSTANTS$4[t.blockchain].NATIVE)&&(n!=r.length-2||e!=CONSTANTS$4[t.blockchain].WRAPPED||r[r.length-1]!=CONSTANTS$4[t.blockchain].NATIVE))),t),prepareContractCallAddressAmountBooleanTransaction=(t,e)=>(t.params.data=[e.signature,e.params[0]],t),prepareContractCallAddressPassedAmountBooleanTransaction=(t,e)=>(t.params.data=[e.signature,e.params[1]],t.params.amounts[1]||(t.params.amounts[1]="0"),t.params.amounts[2]||(t.params.amounts[2]="0"),t.params.amounts[3]||(t.params.amounts[3]="0"),t.params.amounts[4]||(t.params.amounts[4]="0"),t.params.amounts[5]=e.params[0],t),preparePaymentFeeTransaction=t=>{};var plugins={ethereum:{payment:{address:"0x99F3F4685a7178F26EB4F4Ca8B75a1724F1577B9"},uniswap_v2:{address:"0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019",prepareTransaction:prepareUniswapTransaction},paymentWithEvent:{address:"0xD8fBC10787b019fE4059Eb5AA5fB11a5862229EF"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xF984eb8b466AD6c728E0aCc7b69Af6f69B32437F",prepareTransaction:prepareContractCallAddressAmountBooleanTransaction},approveAndCallContractAddressPassedAmountBoolean:{address:"0x2D18c5A46cc1780d2460DD51B5d0996e55Fd2446",prepareTransaction:prepareContractCallAddressPassedAmountBooleanTransaction}},paymentFee:{address:"0x874Cb669D7BFff79d4A6A30F4ea52c5e413BD6A7",prepareTransaction:preparePaymentFeeTransaction}},bsc:{payment:{address:"0x8B127D169D232D5F3ebE1C3D06CE343FD7C1AA11"},pancakeswap:{address:"0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B",prepareTransaction:prepareUniswapTransaction},paymentWithEvent:{address:"0x1869E236c03eE67B9FfEd3aCA139f4AeBA79Dc21"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xd73dFeF8F9c213b449fB39B84c2b33FBBc2C8eD3",prepareTransaction:prepareContractCallAddressAmountBooleanTransaction},approveAndCallContractAddressPassedAmountBoolean:{address:"0x7E655088214d0657251A51aDccE9109CFd23B5B5",prepareTransaction:prepareContractCallAddressPassedAmountBooleanTransaction}},paymentFee:{address:"0xae33f10AD57A38113f74FCdc1ffA6B1eC47B94E3",prepareTransaction:preparePaymentFeeTransaction}},polygon:{payment:{address:"0x78C0F1c712A9AA2004C1F401A7307d8bCB62abBd"},quickswap:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",prepareTransaction:prepareUniswapTransaction},paymentWithEvent:{address:" 0xfAD2F276D464EAdB71435127BA2c2e9dDefb93a4"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0x8698E529E9867eEbcC68b4792daC627cd8870736",prepareTransaction:prepareContractCallAddressAmountBooleanTransaction},approveAndCallContractAddressPassedAmountBoolean:{address:"0xAB305eaDf5FB15AF6370106B231C67d103bBbbbC",prepareTransaction:prepareContractCallAddressPassedAmountBooleanTransaction}},paymentFee:{address:"0xd625c7087E940b2A91ed8bD8db45cB24D3526B56",prepareTransaction:preparePaymentFeeTransaction}}},routers={ethereum:{address:"0xae60aC8e69414C2Dc362D0e6a03af643d1D85b92",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},bsc:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},polygon:{address:"0x2CA727BC33915823e3D05fe043d310B8c5b2dC5b",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]}},commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==global$1?global$1:"undefined"!=typeof self?self:{};function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports}var bn=createCommonjsModule((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:buffer.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var l=t.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,l=0,c=n;c<s;c+=r)l=u(t,c,c+r,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var h=1;for(l=u(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){l(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var c=u>>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,l=0,c=0|a[0],h=8191&c,f=c>>>13,d=0|a[1],p=8191&d,g=d>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],E=8191&_,k=_>>>13,M=0|a[5],S=8191&M,x=M>>>13,C=0|a[6],T=8191&C,N=C>>>13,B=0|a[7],$=8191&B,P=B>>>13,I=0|a[8],R=8191&I,O=I>>>13,L=0|a[9],D=8191&L,F=L>>>13,j=0|s[0],U=8191&j,H=j>>>13,z=0|s[1],G=8191&z,Q=z>>>13,W=0|s[2],q=8191&W,Y=W>>>13,V=0|s[3],K=8191&V,J=V>>>13,Z=0|s[4],X=8191&Z,tt=Z>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,lt=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(l+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,U)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(g,U)|0,o=Math.imul(g,H);var yt=(l+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,G)|0))<<13)|0;l=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,U),i=(i=Math.imul(y,H))+Math.imul(v,U)|0,o=Math.imul(v,H),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,Q)|0;var vt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,U),i=(i=Math.imul(w,H))+Math.imul(A,U)|0,o=Math.imul(A,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,Y)|0;var bt=(l+(r=r+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,K)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,U),i=(i=Math.imul(E,H))+Math.imul(k,U)|0,o=Math.imul(k,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Q)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,J)|0;var wt=(l+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,U),i=(i=Math.imul(S,H))+Math.imul(x,U)|0,o=Math.imul(x,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,K)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,U),i=(i=Math.imul(T,H))+Math.imul(N,U)|0,o=Math.imul(N,H),r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,J)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul($,U),i=(i=Math.imul($,H))+Math.imul(P,U)|0,o=Math.imul(P,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Q)|0,r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,H))+Math.imul(O,U)|0,o=Math.imul(O,H),r=r+Math.imul($,G)|0,i=(i=i+Math.imul($,Q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(S,K)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,lt)|0;var kt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,U),i=(i=Math.imul(D,H))+Math.imul(F,U)|0,o=Math.imul(F,H),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul($,q)|0,i=(i=i+Math.imul($,Y)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,Y)|0,r=r+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var Mt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Q))+Math.imul(F,G)|0,o=Math.imul(F,Q),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul($,K)|0,i=(i=i+Math.imul($,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(T,X)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(S,nt)|0,i=(i=i+Math.imul(S,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var St=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;l=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,Y))+Math.imul(F,q)|0,o=Math.imul(F,Y),r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul($,X)|0,i=(i=i+Math.imul($,tt)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var xt=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,gt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(D,K),i=(i=Math.imul(D,J))+Math.imul(F,K)|0,o=Math.imul(F,J),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul($,nt)|0,i=(i=i+Math.imul($,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul($,ot)|0,i=(i=i+Math.imul($,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,lt)|0,r=r+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(k,pt)|0))<<13)|0;l=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,nt),i=(i=Math.imul(D,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul($,ut)|0,i=(i=i+Math.imul($,lt)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ft)|0;var Nt=(l+(r=r+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(x,pt)|0))<<13)|0;l=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,lt)|0,r=r+Math.imul($,ht)|0,i=(i=i+Math.imul($,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Bt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(N,pt)|0))<<13)|0;l=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(D,ut),i=(i=Math.imul(D,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var $t=(l+(r=r+Math.imul($,pt)|0)|0)+((8191&(i=(i=i+Math.imul($,gt)|0)+Math.imul(P,pt)|0))<<13)|0;l=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(D,ht),i=(i=Math.imul(D,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Pt=(l+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(O,pt)|0))<<13)|0;l=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var It=(l+(r=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,gt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=kt,u[9]=Mt,u[10]=St,u[11]=xt,u[12]=Ct,u[13]=Tt,u[14]=Nt,u[15]=Bt,u[16]=$t,u[17]=Pt,u[18]=It,0!==l&&(u[19]=l,n.length++),n};function m(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var c=o-l,h=(0|t.words[c])*(0|e.words[l]),f=67108863&h;s=67108863&(f=f+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return m(t,e,n)}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):n<63?p(this,t,e):n<1024?m(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=r.clone()._ishlnsubmul(o,1,u);0===c.negative&&(r=c,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new k(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(A,b),r(_,b),r(E,b),E.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=a;0!==d.cmp(s);){for(var g=d,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(y),h=y.redSqr(),d=d.redMul(h),p=m}return f},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},r(M,k),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),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)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,commonjsGlobal)}));const version$3="logger/5.6.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(n){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const _normalizeError=_checkNormalize();var LogLevel,ErrorCode;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(LogLevel||(LogLevel={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();null==LogLevels[n]&&this.throwArgumentError("invalid log level name","logLevel",t),_logLevel>LogLevels[n]||console.log.apply(console,e)}debug(...t){this._log(Logger.levels.DEBUG,t)}info(...t){this._log(Logger.levels.INFO,t)}warn(...t){this._log(Logger.levels.WARNING,t)}makeError(t,e,n){if(_censorErrors)return this.makeError("censored error",e,{});e||(e=Logger.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((t=>{const e=n[t];try{if(e instanceof Uint8Array){let n="";for(let t=0;t<e.length;t++)n+=HEX[e[t]>>4],n+=HEX[15&e[t]];r.push(t+"=Uint8Array(0x"+n+")")}else r.push(t+"="+JSON.stringify(e))}catch(e){r.push(t+"="+JSON.stringify(n[t].toString()))}})),r.push(`code=${e}`),r.push(`version=${this.version}`);const i=t;let o="";switch(e){case ErrorCode.NUMERIC_FAULT:{o="NUMERIC_FAULT";const 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}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(t+=" ("+r.join(", ")+")");const a=new Error(t);return a.reason=i,a.code=e,Object.keys(n).forEach((function(t){a[t]=n[t]})),a}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Logger.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,r){t||this.throwError(e,n,r)}assertArgument(t,e,n,r){t||this.throwArgumentError(e,n,r)}checkNormalize(t){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n=n?": "+n:"",t<e&&this.throwError("missing argument"+n,Logger.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Logger.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$3)),_globalLogger}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!t)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!t,_permanentCensorErrors=!!e}static setLogLevel(t){const e=LogLevels[t.toLowerCase()];null!=e?_logLevel=e:Logger.globalLogger().warn("invalid log level - "+t)}static from(t){return new Logger(t)}}Logger.errors=ErrorCode,Logger.levels=LogLevel;const version$2="bytes/5.6.1",logger$3=new Logger(version$2);function isHexable(t){return!!t.toHexString}function addSlice(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function isInteger(t){return"number"==typeof t&&t==t&&t%1==0}function isBytes(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!isInteger(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const n=t[e];if(!isInteger(n)||n<0||n>=256)return!1}return!0}function arrayify(t,e){if(e||(e={}),"number"==typeof t){logger$3.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),addSlice(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),isHexable(t)&&(t=t.toHexString()),isHexString(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":logger$3.throwArgumentError("hex data is odd-length","value",t));const r=[];for(let t=0;t<n.length;t+=2)r.push(parseInt(n.substring(t,t+2),16));return addSlice(new Uint8Array(r))}return isBytes(t)?addSlice(new Uint8Array(t)):logger$3.throwArgumentError("invalid arrayify value","value",t)}function isHexString(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}const HexCharacters="0123456789abcdef";function hexlify(t,e){if(e||(e={}),"number"==typeof t){logger$3.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=HexCharacters[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),isHexable(t))return t.toHexString();if(isHexString(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":logger$3.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(isBytes(t)){let e="0x";for(let n=0;n<t.length;n++){let r=t[n];e+=HexCharacters[(240&r)>>4]+HexCharacters[15&r]}return e}return logger$3.throwArgumentError("invalid hexlify value","value",t)}function hexZeroPad(t,e){for("string"!=typeof t?t=hexlify(t):isHexString(t)||logger$3.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&logger$3.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}const version$1="bignumber/5.6.2";var BN=bn.BN;const logger$2=new Logger(version$1),_constructorGuard$1={},MAX_SAFE=9007199254740991;function isBigNumberish(t){return null!=t&&(BigNumber.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||isHexString(t)||"bigint"==typeof t||isBytes(t))}let _warnedToStringRadix=!1;class BigNumber{constructor(t,e){t!==_constructorGuard$1&&logger$2.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return toBigNumber(toBN(this).fromTwos(t))}toTwos(t){return toBigNumber(toBN(this).toTwos(t))}abs(){return"-"===this._hex[0]?BigNumber.from(this._hex.substring(1)):this}add(t){return toBigNumber(toBN(this).add(toBN(t)))}sub(t){return toBigNumber(toBN(this).sub(toBN(t)))}div(t){return BigNumber.from(t).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber(toBN(this).div(toBN(t)))}mul(t){return toBigNumber(toBN(this).mul(toBN(t)))}mod(t){const e=toBN(t);return e.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber(toBN(this).umod(e))}pow(t){const e=toBN(t);return e.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber(toBN(this).pow(e))}and(t){const e=toBN(t);return(this.isNegative()||e.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber(toBN(this).and(e))}or(t){const e=toBN(t);return(this.isNegative()||e.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber(toBN(this).or(e))}xor(t){const e=toBN(t);return(this.isNegative()||e.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber(toBN(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&throwFault$1("negative-width","mask"),toBigNumber(toBN(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&throwFault$1("negative-width","shl"),toBigNumber(toBN(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&throwFault$1("negative-width","shr"),toBigNumber(toBN(this).shrn(t))}eq(t){return toBN(this).eq(toBN(t))}lt(t){return toBN(this).lt(toBN(t))}lte(t){return toBN(this).lte(toBN(t))}gt(t){return toBN(this).gt(toBN(t))}gte(t){return toBN(this).gte(toBN(t))}isNegative(){return"-"===this._hex[0]}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(t){throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return logger$2.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?_warnedToStringRadix||(_warnedToStringRadix=!0,logger$2.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?logger$2.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{}):logger$2.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})),toBN(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof BigNumber)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new BigNumber(_constructorGuard$1,toHex(t)):t.match(/^-?[0-9]+$/)?new BigNumber(_constructorGuard$1,toHex(new BN(t))):logger$2.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&throwFault$1("underflow","BigNumber.from",t),(t>=MAX_SAFE||t<=-MAX_SAFE)&&throwFault$1("overflow","BigNumber.from",t),BigNumber.from(String(t));const e=t;if("bigint"==typeof e)return BigNumber.from(e.toString());if(isBytes(e))return BigNumber.from(hexlify(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return BigNumber.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(isHexString(t)||"-"===t[0]&&isHexString(t.substring(1))))return BigNumber.from(t)}return logger$2.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function toHex(t){if("string"!=typeof t)return toHex(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&logger$2.throwArgumentError("invalid hex","value",t),"0x00"===(t=toHex(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function toBigNumber(t){return BigNumber.from(toHex(t))}function toBN(t){const e=BigNumber.from(t).toHexString();return"-"===e[0]?new BN("-"+e.substring(3),16):new BN(e.substring(2),16)}function throwFault$1(t,e,n){const r={fault:t,operation:e};return null!=n&&(r.value=n),logger$2.throwError(t,Logger.errors.NUMERIC_FAULT,r)}const logger$1=new Logger(version$1),_constructorGuard={},Zero=BigNumber.from(0),NegativeOne=BigNumber.from(-1);function throwFault(t,e,n,r){const i={fault:e,operation:n};return void 0!==r&&(i.value=r),logger$1.throwError(t,Logger.errors.NUMERIC_FAULT,i)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(t){if("number"!=typeof t)try{t=BigNumber.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+zeros.substring(0,t):logger$1.throwArgumentError("invalid decimal size","decimals",t)}function formatFixed(t,e){null==e&&(e=0);const n=getMultiplier(e),r=(t=BigNumber.from(t)).lt(Zero);r&&(t=t.mul(NegativeOne));let i=t.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(n).toString();return t=1===n.length?o:o+"."+i,r&&(t="-"+t),t}function parseFixed(t,e){null==e&&(e=0);const n=getMultiplier(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||logger$1.throwArgumentError("invalid decimal value","value",t);const r="-"===t.substring(0,1);r&&(t=t.substring(1)),"."===t&&logger$1.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&logger$1.throwArgumentError("too many decimal points","value",t);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&throwFault("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<n.length-1;)a+="0";const s=BigNumber.from(o),u=BigNumber.from(a);let l=s.mul(n).add(u);return r&&(l=l.mul(NegativeOne)),l}class FixedFormat{constructor(t,e,n,r){t!==_constructorGuard&&logger$1.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=n,this.decimals=r,this.name=(e?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=getMultiplier(r),Object.freeze(this)}static from(t){if(t instanceof FixedFormat)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,n=128,r=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)e=!1;else{const i=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||logger$1.throwArgumentError("invalid fixed format","format",t),e="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(t){const i=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&logger$1.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&logger$1.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&logger$1.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new FixedFormat(_constructorGuard,e,n,r)}}class FixedNumber{constructor(t,e,n,r){t!==_constructorGuard&&logger$1.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=e,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&logger$1.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=FixedNumber.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(e=e.subUnsafe(ONE.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=FixedNumber.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(e=e.addUnsafe(ONE.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&logger$1.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const n=FixedNumber.from("1"+zeros.substring(0,t),this.format),r=BUMP.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&logger$1.throwArgumentError("invalid byte width","width",t);return hexZeroPad(BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return FixedNumber.fromString(this._value,t)}static fromValue(t,e,n){return null!=n||null==e||isBigNumberish(e)||(n=e,e=null),null==e&&(e=0),null==n&&(n="fixed"),FixedNumber.fromString(formatFixed(t,e),FixedFormat.from(n))}static fromString(t,e){null==e&&(e="fixed");const n=FixedFormat.from(e),r=parseFixed(t,n.decimals);!n.signed&&r.lt(Zero)&&throwFault("unsigned value cannot be negative","overflow","value",t);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=hexZeroPad(i,n.width/8));const o=formatFixed(r,n.decimals);return new FixedNumber(_constructorGuard,i,o,n)}static fromBytes(t,e){null==e&&(e="fixed");const n=FixedFormat.from(e);if(arrayify(t).length>n.width/8)throw new Error("overflow");let r=BigNumber.from(t);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=formatFixed(r,n.decimals);return new FixedNumber(_constructorGuard,i,o,n)}static from(t,e){if("string"==typeof t)return FixedNumber.fromString(t,e);if(isBytes(t))return FixedNumber.fromBytes(t,e);try{return FixedNumber.fromValue(t,0,e)}catch(t){if(t.code!==Logger.errors.INVALID_ARGUMENT)throw t}return logger$1.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const ONE=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version="units/5.6.1",logger=new Logger(version),names=["wei","kwei","mwei","gwei","szabo","finney","ether"];function parseUnits(t,e){if("string"!=typeof t&&logger.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=names.indexOf(e);-1!==t&&(e=3*t)}return parseFixed(t,null!=e?e:18)}function _optionalChain$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let getTransaction=({paymentRoute:t,event:e,fee:n})=>{let r=t.exchangeRoutes[0],i={blockchain:t.blockchain,to:transactionAddress({paymentRoute:t,fee:n}),api:transactionApi({paymentRoute:t,fee:n}),method:transactionMethod({paymentRoute:t,fee:n}),params:transactionParams({paymentRoute:t,exchangeRoute:r,event:e,fee:n}),value:transactionValue({paymentRoute:t,exchangeRoute:r})};return r&&t.exchangePlugin&&(i=t.exchangePlugin.prepareTransaction(i)),t.contractCallPlugin&&(i=t.contractCallPlugin.prepareTransaction(i,t.toContract)),i},transactionAddress=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?t.toAddress:t.toToken.address:routers[t.blockchain].address,transactionApi=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?void 0:Token[t.blockchain].DEFAULT:routers[t.blockchain].api,transactionMethod=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?void 0:"transfer":"route",transactionParams=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>t.directTransfer&&!r?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?void 0:[t.toAddress,t.toAmount]:{path:transactionPath({paymentRoute:t,exchangeRoute:e}),amounts:transactionAmounts({paymentRoute:t,exchangeRoute:e,fee:r}),addresses:transactionAddresses({paymentRoute:t,fee:r}),plugins:transactionPlugins({paymentRoute:t,exchangeRoute:e,event:n,fee:r}),data:[]},transactionPath=({paymentRoute:t,exchangeRoute:e})=>e?e.path:[t.toToken.address],transactionAmounts=({paymentRoute:t,exchangeRoute:e,fee:n})=>{let r;r=e?[e.amountIn.toString(),subtractFee({amount:e.amountOutMin.toString(),paymentRoute:t,fee:n}),e.transaction.params.deadline]:[t.toAmount,subtractFee({amount:t.toAmount,paymentRoute:t,fee:n})],n&&(r[4]=transactionFeeAmount({paymentRoute:t,fee:n}));for(var i=0;i<r.length;i++)null==r[i]&&(r[i]="0");return r},subtractFee=({amount:t,paymentRoute:e,fee:n})=>{if(n){let r=transactionFeeAmount({paymentRoute:e,fee:n});return BigNumber.from(t).sub(r).toString()}return t},transactionFeeAmount=({paymentRoute:t,fee:e})=>{if("string"==typeof e.amount&&e.amount.match("%"))return BigNumber.from(t.toAmount).div(1e3).mul(10*parseFloat(e.amount)).toString();if("string"==typeof e.amount)return e.amount;if("number"==typeof e.amount)return parseUnits(e.amount.toString(),t.toDecimals).toString();throw"Unknown fee amount type!"},transactionAddresses=({paymentRoute:t,fee:e})=>e?[t.fromAddress,e.receiver,t.toAddress]:[t.fromAddress,t.toAddress],transactionPlugins=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>{let i=[];if(e&&(t.exchangePlugin=plugins[t.blockchain][e.exchange.name],i.push(t.exchangePlugin.address)),t.toContract){let e=t.toContract.signature.match(/\(.*\)/);if(e&&_optionalChain$1([e,"optionalAccess",t=>t.length])){e=e[0].replace(/[\(\)]/g,"");let n=e.split(",");if("address"==n[0]&&n[1].match("uint")&&"bool"==n[2]&&Number.isNaN(parseInt(t.toContract.params[0])))t.contractCallPlugin=plugins[t.blockchain].contractCall.approveAndCallContractAddressAmountBoolean;else{if("address"!=n[0]||!n[1].match("uint")||"bool"!=n[2]||Number.isNaN(parseInt(t.toContract.params[0])))throw e;t.contractCallPlugin=plugins[t.blockchain].contractCall.approveAndCallContractAddressPassedAmountBoolean}i.push(t.contractCallPlugin.address)}}else"ifSwapped"!=n||t.directTransfer?i.push(plugins[t.blockchain].payment.address):i.push(plugins[t.blockchain].paymentWithEvent.address);return r&&i.push(plugins[t.blockchain].paymentFee.address),i},transactionValue=({paymentRoute:t,exchangeRoute:e})=>t.fromToken.address==CONSTANTS$4[t.blockchain].NATIVE?e?e.amountIn.toString():t.toAmount.toString():BigNumber.from("0").toString();
119
+ */var sha3=createCommonjsModule$1((function(t){!function(){var e="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=commonjsGlobal$1:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&t.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],l=[0,8,16,24],c=[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],h=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var g=function(t,e,n){return function(r){return new N(t,e,t).update(r)[n]()}},m=function(t,e,n){return function(r,i){return new N(t,e,i).update(r)[n]()}},y=function(t,e,n){return function(e,r,i,o){return _["cshake"+t].update(e,r,i,o)[n]()}},v=function(t,e,n){return function(e,r,i,o){return _["kmac"+t].update(e,r,i,o)[n]()}},b=function(t,e,n,r){for(var i=0;i<d.length;++i){var o=d[i];t[o]=e(n,r,o)}return t},w=function(t,e){var n=g(t,e,"hex");return n.create=function(){return new N(t,e,t)},n.update=function(t){return n.create().update(t)},b(n,g,t,e)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(t,e){var n=m(t,e,"hex");return n.create=function(n){return new N(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},b(n,m,t,e)}},{name:"cshake",padding:u,bits:f,createMethod:function(t,e){var n=p[t],r=y(t,0,"hex");return r.create=function(r,i,o){return i||o?new N(t,e,r).bytepad([i,o],n):_["shake"+t].create(r)},r.update=function(t,e,n,i){return r.create(e,n,i).update(t)},b(r,y,t,e)}},{name:"kmac",padding:u,bits:f,createMethod:function(t,e){var n=p[t],r=v(t,0,"hex");return r.create=function(r,i,o){return new B(t,e,i).bytepad(["KMAC",o],n).bytepad([r],n)},r.update=function(t,e,n,i){return r.create(t,n,i).update(e)},b(r,v,t,e)}}],_={},E=[],k=0;k<A.length;++k)for(var M=A[k],S=M.bits,x=0;x<S.length;++x){var C=M.name+"_"+S[x];if(E.push(C),_[C]=M.createMethod(S[x],M.padding),"sha3"!==M.name){var T=M.name+S[x];E.push(T),_[T]=_[C]}}function N(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function B(t,e,n){N.call(this,t,e,n)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,c=t.length,h=this.blockCount,f=0,d=this.s;f<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<h+1;++i)s[i]=0;if(n)for(i=this.start;f<c&&i<u;++f)s[i>>2]|=t[f]<<l[3&i++];else for(i=this.start;f<c&&i<u;++f)(o=t.charCodeAt(f))<128?s[i>>2]|=o<<l[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<l[3&i++],s[i>>2]|=(128|o>>6&63)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),s[i>>2]|=(240|o>>18)<<l[3&i++],s[i>>2]|=(128|o>>12&63)<<l[3&i++],s[i>>2]|=(128|o>>6&63)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=s[h],i=0;i<h;++i)d[i]^=s[i];$(d),this.reset=!0}else this.start=i}return this},N.prototype.encode=function(t,e){var n=255&t,r=1,i=[n];for(n=255&(t>>=8);n>0;)i.unshift(n),n=255&(t>>=8),++r;return e?i.push(r):i.unshift(r),this.update(i),i.length},N.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},N.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r<t.length;++r)n+=this.encodeString(t[r]);var i=e-n%e,o=[];return o.length=i,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];$(r)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,u="";a<r;){for(o=0;o<e&&a<r;++o,++a)t=n[o],u+=s[t>>4&15]+s[15&t]+s[t>>12&15]+s[t>>8&15]+s[t>>20&15]+s[t>>16&15]+s[t>>28&15]+s[t>>24&15];a%e==0&&($(n),o=0)}return i&&(t=n[o],u+=s[t>>4&15]+s[15&t],i>1&&(u+=s[t>>12&15]+s[t>>8&15]),i>2&&(u+=s[t>>20&15]+s[t>>16&15])),u},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a<r;){for(o=0;o<e&&a<r;++o,++a)u[a]=n[o];a%e==0&&$(n)}return i&&(u[o]=n[o],t=t.slice(0,s)),t},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<n&&s<i;++a,++s)t=s<<2,e=r[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%n==0&&$(r)}return o&&(t=s<<2,e=r[a],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},B.prototype=new N,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var $=function(t){var e,n,r,i,o,a,s,u,l,h,f,d,p,g,m,y,v,b,w,A,_,E,k,M,S,x,C,T,N,B,$,P,I,R,O,L,D,F,j,U,H,z,G,Q,W,q,Y,V,K,J,Z,X,tt,et,nt,rt,it,ot,at,st,ut,lt,ct;for(r=0;r<48;r+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),n=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(u<<1|l>>>31),n=o^(l<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=a^(h<<1|f>>>31),n=s^(f<<1|h>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(d<<1|p>>>31),n=l^(p<<1|d>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=h^(i<<1|o>>>31),n=f^(o<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,g=t[0],m=t[1],q=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,R=t[2]<<1|t[3]>>>31,O=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,K=t[23]<<10|t[22]>>>22,B=t[33]<<13|t[32]>>>19,$=t[32]<<13|t[33]>>>19,lt=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,I=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,Q=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,U=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=g^~y&b,t[1]=m^~v&w,t[10]=M^~x&T,t[11]=S^~C&N,t[20]=R^~L&F,t[21]=O^~D&j,t[30]=Q^~q&V,t[31]=W^~Y&K,t[40]=et^~rt&ot,t[41]=nt^~it&at,t[2]=y^~b&A,t[3]=v^~w&_,t[12]=x^~T&B,t[13]=C^~N&$,t[22]=L^~F&U,t[23]=D^~j&H,t[32]=q^~V&J,t[33]=Y^~K&Z,t[42]=rt^~ot&st,t[43]=it^~at&ut,t[4]=b^~A&E,t[5]=w^~_&k,t[14]=T^~B&P,t[15]=N^~$&I,t[24]=F^~U&z,t[25]=j^~H&G,t[34]=V^~J&X,t[35]=K^~Z&tt,t[44]=ot^~st&lt,t[45]=at^~ut&ct,t[6]=A^~E&g,t[7]=_^~k&m,t[16]=B^~P&M,t[17]=$^~I&S,t[26]=U^~z&R,t[27]=H^~G&O,t[36]=J^~X&Q,t[37]=Z^~tt&W,t[46]=st^~lt&et,t[47]=ut^~ct&nt,t[8]=E^~g&y,t[9]=k^~m&v,t[18]=P^~M&x,t[19]=I^~S&C,t[28]=z^~R&L,t[29]=G^~O&D,t[38]=X^~Q&q,t[39]=tt^~W&Y,t[48]=lt^~et&rt,t[49]=ct^~nt&it,t[0]^=c[r],t[1]^=c[r+1]};if(o)t.exports=_;else for(k=0;k<E.length;++k)r[E[k]]=_[E[k]]}()})),sha3$1=sha3;function keccak256(t){return"0x"+sha3$1.keccak_256(arrayify$1(t))}const version$d="rlp/5.6.1",logger$j=new Logger$1(version$d);function arrayifyInteger(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function unarrayifyInteger(t,e,n){let r=0;for(let i=0;i<n;i++)r=256*r+t[e+i];return r}function _encode(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(_encode(t))})),e.length<=55)return e.unshift(192+e.length),e;const n=arrayifyInteger(e.length);return n.unshift(247+n.length),n.concat(e)}isBytesLike(t)||logger$j.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(arrayify$1(t));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=arrayifyInteger(e.length);return n.unshift(183+n.length),n.concat(e)}function encode$2(t){return hexlify$1(_encode(t))}function _decodeChildren(t,e,n,r){const i=[];for(;n<e+1+r;){const o=_decode(t,n);i.push(o.result),(n+=o.consumed)>e+1+r&&logger$j.throwError("child data too short",Logger$1.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function _decode(t,e){if(0===t.length&&logger$j.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{}),t[e]>=248){const n=t[e]-247;e+1+n>t.length&&logger$j.throwError("data short segment too short",Logger$1.errors.BUFFER_OVERRUN,{});const r=unarrayifyInteger(t,e+1,n);return e+1+n+r>t.length&&logger$j.throwError("data long segment too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,e,e+1+n,n+r)}if(t[e]>=192){const n=t[e]-192;return e+1+n>t.length&&logger$j.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;e+1+n>t.length&&logger$j.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const r=unarrayifyInteger(t,e+1,n);e+1+n+r>t.length&&logger$j.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:hexlify$1(t.slice(e+1+n,e+1+n+r))}}if(t[e]>=128){const n=t[e]-128;e+1+n>t.length&&logger$j.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:hexlify$1(t.slice(e+1,e+1+n))}}return{consumed:1,result:hexlify$1(t[e])}}function decode$2(t){const e=arrayify$1(t),n=_decode(e,0);return n.consumed!==e.length&&logger$j.throwArgumentError("invalid rlp data","data",t),n.result}const version$c="address/5.6.1",logger$i=new Logger$1(version$c);function getChecksumAddress(t){isHexString$1(t,20)||logger$i.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=arrayify$1(keccak256(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const MAX_SAFE_INTEGER$1=9007199254740991;function log10$1(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const ibanLookup={};for(let t=0;t<10;t++)ibanLookup[String(t)]=String(t);for(let t=0;t<26;t++)ibanLookup[String.fromCharCode(65+t)]=String(10+t);const safeDigits=Math.floor(log10$1(MAX_SAFE_INTEGER$1));function ibanChecksum(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>ibanLookup[t])).join("");for(;e.length>=safeDigits;){let t=e.substring(0,safeDigits);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}function getAddress(t){let e=null;if("string"!=typeof t&&logger$i.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=getChecksumAddress(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&logger$i.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ibanChecksum(t)&&logger$i.throwArgumentError("bad icap checksum","address",t),e=_base36To16(t.substring(4));e.length<40;)e="0"+e;e=getChecksumAddress("0x"+e)}else logger$i.throwArgumentError("invalid address","address",t);return e}function getContractAddress(t){let e=null;try{e=getAddress(t.from)}catch(e){logger$i.throwArgumentError("missing from address","transaction",t)}return getAddress(hexDataSlice(keccak256(encode$2([e,stripZeros(arrayify$1(BigNumber$1.from(t.nonce).toHexString()))])),12))}class AddressCoder extends Coder{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=getAddress(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return getAddress(hexZeroPad$1(t.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const logger$h=new Logger$1(version$e);function pack(t,e,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return r||logger$h.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]&&logger$h.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]=!0,n[r]}))}else logger$h.throwArgumentError("invalid tuple value","tuple",n);e.length!==r.length&&logger$h.throwArgumentError("types/value length mismatch","tuple",n);let i=new Writer(t.wordSize),o=new Writer(t.wordSize),a=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=o.length;t.encode(o,n);let r=i.writeUpdatableValue();a.push((t=>{r(t+e)}))}else t.encode(i,n)})),a.forEach((t=>{t(i.length)}));let s=t.appendWriter(i);return s+=t.appendWriter(o),s}function unpack(t,e){let n=[],r=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let n=t.readValue(),o=r.subReader(n.toNumber());try{i=e.decode(o)}catch(t){if(t.code===Logger$1.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===Logger$1.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&n.push(i)}));const i=e.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});e.forEach(((t,e)=>{let r=t.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[e];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let t=0;t<n.length;t++){const e=n[t];e instanceof Error&&Object.defineProperty(n,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(n)}class ArrayCoder extends Coder{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let n=this.length;-1===n&&(n=e.length,t.writeValue(e.length)),logger$h.checkArgumentCount(e.length,n,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let t=0;t<e.length;t++)r.push(this.coder);return pack(t,r,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&logger$h.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let t=0;t<e;t++)n.push(new AnonymousCoder(this.coder));return t.coerce(this.name,unpack(t,n))}}class BooleanCoder extends Coder{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=arrayify$1(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,hexlify$1(super.decode(t)))}}class FixedBytesCoder extends Coder{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=arrayify$1(e);return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return t.coerce(this.name,hexlify$1(t.readBytes(this.size)))}}class NullCoder extends Coder{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber$1.from(-1),Zero$1=BigNumber$1.from(0),One$1=BigNumber$1.from(1),MaxUint256$1=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000";class NumberCoder extends Coder{constructor(t,e,n){const r=(e?"int":"uint")+8*t;super(r,r,n,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let n=BigNumber$1.from(e),r=MaxUint256$1.mask(8*t.wordSize);if(this.signed){let t=r.mask(8*this.size-1);(n.gt(t)||n.lt(t.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",e)}else(n.lt(Zero$1)||n.gt(r.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}const version$b="strings/5.6.1",logger$g=new Logger$1(version$b);var UnicodeNormalizationForm,Utf8ErrorReason;function errorFunc(t,e,n,r,i){return logger$g.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function ignoreFunc(t,e,n,r,i){if(t===Utf8ErrorReason.BAD_PREFIX||t===Utf8ErrorReason.UNEXPECTED_CONTINUE){let t=0;for(let r=e+1;r<n.length&&n[r]>>6==2;r++)t++;return t}return t===Utf8ErrorReason.OVERRUN?n.length-e-1:0}function replaceFunc(t,e,n,r,i){return t===Utf8ErrorReason.OVERLONG?(r.push(i),0):(r.push(65533),ignoreFunc(t,e,n))}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(UnicodeNormalizationForm||(UnicodeNormalizationForm={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Utf8ErrorReason||(Utf8ErrorReason={}));const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(t,e){null==e&&(e=Utf8ErrorFuncs.error),t=arrayify$1(t);const n=[];let r=0;for(;r<t.length;){const i=t[r++];if(i>>7==0){n.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){r+=e(128==(192&i)?Utf8ErrorReason.UNEXPECTED_CONTINUE:Utf8ErrorReason.BAD_PREFIX,r-1,t,n);continue}o=3,a=65535}if(r-1+o>=t.length){r+=e(Utf8ErrorReason.OVERRUN,r-1,t,n);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=t[r];if(128!=(192&i)){r+=e(Utf8ErrorReason.MISSING_CONTINUE,r,t,n),s=null;break}s=s<<6|63&i,r++}null!==s&&(s>1114111?r+=e(Utf8ErrorReason.OUT_OF_RANGE,r-1-o,t,n,s):s>=55296&&s<=57343?r+=e(Utf8ErrorReason.UTF16_SURROGATE,r-1-o,t,n,s):s<=a?r+=e(Utf8ErrorReason.OVERLONG,r-1-o,t,n,s):n.push(s))}return n}function toUtf8Bytes(t,e=UnicodeNormalizationForm.current){e!=UnicodeNormalizationForm.current&&(logger$g.checkNormalize(),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return arrayify$1(n)}function _toUtf8String(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function toUtf8String(t,e){return _toUtf8String(getUtf8CodePoints(t,e))}function toUtf8CodePoints(t,e=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(t,e))}function bytes2(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let n=0;n<t.length;n+=4)e.push(parseInt(t.substring(n,n+4),16));return e}function createTable(t,e){e||(e=function(t){return[parseInt(t,16)]});let n=0,r={};return t.split(",").forEach((t=>{let i=t.split(":");n+=parseInt(i[0],16),r[n]=e(i[1])})),r}function createRangeTable(t){let e=0;return t.split(",").map((t=>{let n=t.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:r,h:e}}))}function matchMap(t,e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(n+=i.l,t>=n&&t<=n+i.h&&(t-n)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-n))continue;return i}}return null}const Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2),Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten(t){return t.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[])}function _nameprepTableA1(t){return!!matchMap(t,Table_A_1_ranges)}function _nameprepTableB2(t){let e=matchMap(t,Table_B_2_ranges);if(e)return[t+e.s];let n=Table_B_2_lut_abs[t];if(n)return n;let r=Table_B_2_lut_rel[t];if(r)return[t+r[0]];let i=Table_B_2_complex[t];return i||null}function _nameprepTableC(t){return!!matchMap(t,Table_C_ranges)}function nameprep(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=toUtf8CodePoints(t);e=flatten(e.map((t=>{if(Table_B_1_flags.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=_nameprepTableB2(t);return e||[t]}))),e=toUtf8CodePoints(_toUtf8String(e),UnicodeNormalizationForm.NFKC),e.forEach((t=>{if(_nameprepTableC(t))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(_nameprepTableA1(t))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=_toUtf8String(e);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}class StringCoder extends DynamicBytesCoder{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,toUtf8Bytes(e))}decode(t){return toUtf8String(super.decode(t))}}class TupleCoder extends Coder{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)}));super("tuple","tuple("+r.join(",")+")",e,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){return pack(t,this.coders,e)}decode(t){return t.coerce(this.name,unpack(t,this.coders))}}const logger$f=new Logger$1(version$e),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(t){defineReadOnly(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new AddressCoder(t.name);case"bool":return new BooleanCoder(t.name);case"string":return new StringCoder(t.name);case"bytes":return new BytesCoder(t.name);case"array":return new ArrayCoder(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new TupleCoder((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new NullCoder(t.name)}let e=t.type.match(paramTypeNumber);if(e){let n=parseInt(e[2]||"256");return(0===n||n>256||n%8!=0)&&logger$f.throwArgumentError("invalid "+e[1]+" bit length","param",t),new NumberCoder(n/8,"int"===e[1],t.name)}if(e=t.type.match(paramTypeBytes),e){let n=parseInt(e[1]);return(0===n||n>32)&&logger$f.throwArgumentError("invalid bytes length","param",t),new FixedBytesCoder(n,t.name)}return logger$f.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new Reader(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(ParamType.from(t))));return new TupleCoder(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&logger$f.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map((t=>this._getCoder(ParamType.from(t)))),r=new TupleCoder(n,"_"),i=this._getWriter();return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>this._getCoder(ParamType.from(t))));return new TupleCoder(r,"_").decode(this._getReader(arrayify$1(e),n))}}const defaultAbiCoder=new AbiCoder;function id(t){return keccak256(toUtf8Bytes(t))}const version$a="hash/5.6.1",logger$e=new Logger$1(version$a),Zeros=new Uint8Array(32);Zeros.fill(0);const Partition=new RegExp("^((.*)\\.)?([^.]+)$");function namehash(t){"string"!=typeof t&&logger$e.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,n=Zeros;for(;e.length;){const r=e.match(Partition);null!=r&&""!==r[2]||logger$e.throwArgumentError("invalid ENS address; missing component","name",t);n=keccak256(concat([n,keccak256(toUtf8Bytes(nameprep(r[3])))])),e=r[2]||""}return hexlify$1(n)}function dnsEncode(t){return hexlify$1(concat(t.split(".").map((t=>{const e=toUtf8Bytes("_"+nameprep(t));return e[0]=e.length-1,e}))))+"00"}var __awaiter$7=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$d=new Logger$1(version$a),padding=new Uint8Array(32);padding.fill(0);const NegativeOne$3=BigNumber$1.from(-1),Zero$3=BigNumber$1.from(0),One=BigNumber$1.from(1),MaxUint256=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(t){const e=arrayify$1(t),n=e.length%32;return n?hexConcat([e,padding.slice(n)]):hexlify$1(e)}const hexTrue=hexZeroPad$1(One.toHexString(),32),hexFalse=hexZeroPad$1(Zero$3.toHexString(),32),domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(t){return function(e){return"string"!=typeof e&&logger$d.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(t){try{return BigNumber$1.from(t).toString()}catch(t){}return logger$d.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return getAddress(t).toLowerCase()}catch(t){}return logger$d.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=arrayify$1(t);if(32!==e.length)throw new Error("bad length");return hexlify$1(e)}catch(t){}return logger$d.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function getBaseEncoder(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=""===e[1],r=parseInt(e[2]||"256");(r%8!=0||r>256||e[2]&&e[2]!==String(r))&&logger$d.throwArgumentError("invalid numeric width","type",t);const i=MaxUint256.mask(n?r-1:r),o=n?i.add(One).mul(NegativeOne$3):Zero$3;return function(e){const n=BigNumber$1.from(e);return(n.lt(o)||n.gt(i))&&logger$d.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),hexZeroPad$1(n.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return(0===n||n>32||e[1]!==String(n))&&logger$d.throwArgumentError("invalid bytes width","type",t),function(e){return arrayify$1(e).length!==n&&logger$d.throwArgumentError(`invalid length for ${t}`,"value",e),hexPadRight(e)}}}switch(t){case"address":return function(t){return hexZeroPad$1(getAddress(t),32)};case"bool":return function(t){return t?hexTrue:hexFalse};case"bytes":return function(t){return keccak256(t)};case"string":return function(t){return id(t)}}return null}function encodeType(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class TypedDataEncoder{constructor(t){defineReadOnly(this,"types",Object.freeze(deepCopy(t))),defineReadOnly(this,"_encoderCache",{}),defineReadOnly(this,"_types",{});const e={},n={},r={};Object.keys(t).forEach((t=>{e[t]={},n[t]=[],r[t]={}}));for(const r in t){const i={};t[r].forEach((o=>{i[o.name]&&logger$d.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",t),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&logger$d.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",t);getBaseEncoder(a)||(n[a]||logger$d.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",t),n[a].push(r),e[r][a]=!0)}))}const i=Object.keys(n).filter((t=>0===n[t].length));0===i.length?logger$d.throwArgumentError("missing primary type","types",t):i.length>1&&logger$d.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),defineReadOnly(this,"primaryType",i[0]),function i(o,a){a[o]&&logger$d.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),a[o]=!0,Object.keys(e[o]).forEach((t=>{n[t]&&(i(t,a),Object.keys(a).forEach((e=>{r[e][t]=!0})))})),delete a[o]}(this.primaryType,{});for(const e in r){const n=Object.keys(r[e]);n.sort(),this._types[e]=encodeType(e,t[e])+n.map((e=>encodeType(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=getBaseEncoder(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],n=this.getEncoder(t),r=parseInt(e[3]);return e=>{r>=0&&e.length!==r&&logger$d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(n);return this._types[t]&&(i=i.map(keccak256)),keccak256(hexConcat(i))}}const n=this.types[t];if(n){const e=id(this._types[t]);return t=>{const r=n.map((({name:e,type:n})=>{const r=this.getEncoder(n)(t[e]);return this._types[n]?keccak256(r):r}));return r.unshift(e),hexConcat(r)}}return logger$d.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||logger$d.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return keccak256(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(getBaseEncoder(t))return n(t,e);const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],i=parseInt(r[3]);return i>=0&&e.length!==i&&logger$d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,n)))}const i=this.types[t];return i?i.reduce(((t,{name:r,type:i})=>(t[r]=this._visit(i,e[r],n),t)),{}):logger$d.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new TypedDataEncoder(t)}static getPrimaryType(t){return TypedDataEncoder.from(t).primaryType}static hashStruct(t,e,n){return TypedDataEncoder.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const r=domainFieldTypes[n];r||logger$d.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:r})}return e.sort(((t,e)=>domainFieldNames.indexOf(t.name)-domainFieldNames.indexOf(e.name))),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return hexConcat(["0x1901",TypedDataEncoder.hashDomain(t),TypedDataEncoder.from(e).hash(n)])}static hash(t,e,n){return keccak256(TypedDataEncoder.encode(t,e,n))}static resolveNames(t,e,n,r){return __awaiter$7(this,void 0,void 0,(function*(){t=shallowCopy(t);const i={};t.verifyingContract&&!isHexString$1(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=TypedDataEncoder.from(e);o.visit(n,((t,e)=>("address"!==t||isHexString$1(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield r(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=o.visit(n,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:n}}))}static getPayload(t,e,n){TypedDataEncoder.hashDomain(t);const r={},i=[];domainFieldNames.forEach((e=>{const n=t[e];null!=n&&(r[e]=domainChecks[e](n),i.push({name:e,type:domainFieldTypes[e]}))}));const o=TypedDataEncoder.from(e),a=shallowCopy(e);return a.EIP712Domain?logger$d.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):a.EIP712Domain=i,o.encode(n),{types:a,domain:r,primaryType:o.primaryType,message:o.visit(n,((t,e)=>{if(t.match(/^bytes(\d*)/))return hexlify$1(arrayify$1(e));if(t.match(/^u?int/))return BigNumber$1.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&logger$d.throwArgumentError("invalid string","value",e),e}return logger$d.throwArgumentError("unsupported type","type",t)}))}}}const logger$c=new Logger$1(version$e);class LogDescription extends Description{}class TransactionDescription extends Description{}class ErrorDescription extends Description{}class Indexed extends Description{static isIndexed(t){return!(!t||!t._isIndexed)}}const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return n.error=e,n}class Interface{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,defineReadOnly(this,"fragments",e.map((t=>Fragment.from(t))).filter((t=>null!=t))),defineReadOnly(this,"_abiCoder",getStatic(new.target,"getAbiCoder")()),defineReadOnly(this,"functions",{}),defineReadOnly(this,"errors",{}),defineReadOnly(this,"events",{}),defineReadOnly(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void logger$c.warn("duplicate definition - constructor"):void defineReadOnly(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let n=t.format();e[n]?logger$c.warn("duplicate definition - "+n):e[n]=t})),this.deploy||defineReadOnly(this,"deploy",ConstructorFragment.from({payable:!1,type:"constructor"})),defineReadOnly(this,"_isInterface",!0)}format(t){t||(t=FormatTypes.full),t===FormatTypes.sighash&&logger$c.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===FormatTypes.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return defaultAbiCoder}static getAddress(t){return getAddress(t)}static getSighash(t){return hexDataSlice(id(t.format()),0,4)}static getEventTopic(t){return id(t.format())}getFunction(t){if(isHexString$1(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];logger$c.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===n.length?logger$c.throwArgumentError("no matching function","name",e):n.length>1&&logger$c.throwArgumentError("multiple matching functions","name",e),this.functions[n[0]]}const e=this.functions[FunctionFragment.fromString(t).format()];return e||logger$c.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(isHexString$1(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];logger$c.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===n.length?logger$c.throwArgumentError("no matching event","name",e):n.length>1&&logger$c.throwArgumentError("multiple matching events","name",e),this.events[n[0]]}const e=this.events[EventFragment.fromString(t).format()];return e||logger$c.throwArgumentError("no matching event","signature",t),e}getError(t){if(isHexString$1(t)){const e=getStatic(this.constructor,"getSighash");for(const n in this.errors){if(t===e(this.errors[n]))return this.errors[n]}logger$c.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===n.length?logger$c.throwArgumentError("no matching error","name",e):n.length>1&&logger$c.throwArgumentError("multiple matching errors","name",e),this.errors[n[0]]}const e=this.errors[FunctionFragment.fromString(t).format()];return e||logger$c.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return getStatic(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),getStatic(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const n=arrayify$1(e);return hexlify$1(n.slice(0,4))!==this.getSighash(t)&&logger$c.throwArgumentError(`data signature does not match error ${t.name}.`,"data",hexlify$1(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),hexlify$1(concat([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const n=arrayify$1(e);return hexlify$1(n.slice(0,4))!==this.getSighash(t)&&logger$c.throwArgumentError(`data signature does not match function ${t.name}.`,"data",hexlify$1(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),hexlify$1(concat([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let n=arrayify$1(e),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch(t){}break;case 4:{const t=hexlify$1(n.slice(0,4)),e=BuiltinErrors[t];if(e)o=this._abiCoder.decode(e.inputs,n.slice(4)),a=e.name,s=e.signature,e.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const e=this.getError(t);o=this._abiCoder.decode(e.inputs,n.slice(4)),a=e.name,s=e.format()}catch(t){}break}}return logger$c.throwError("call revert exception"+i,Logger$1.errors.CALL_EXCEPTION,{method:t.format(),data:hexlify$1(e),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),hexlify$1(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&logger$c.throwError("too many arguments for "+t.format(),Logger$1.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const r=(t,e)=>"string"===t.type?id(e):"bytes"===t.type?keccak256(hexlify$1(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),hexZeroPad$1(hexlify$1(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?logger$c.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((t=>r(o,t)))):n.push(r(o,e)):null!=e&&logger$c.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const n=[],r=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&logger$c.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const a=e[o];if(t.indexed)if("string"===t.type)n.push(id(a));else if("bytes"===t.type)n.push(keccak256(a));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([t.type],[a]))}else r.push(t),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);isHexString$1(n[0],32)&&n[0].toLowerCase()===e||logger$c.throwError("fragment/topic mismatch",Logger$1.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(ParamType.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(r.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,concat(n)):null,s=this._abiCoder.decode(i,e,!0),u=[],l=0,c=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==a)u[e]=new Indexed({_isIndexed:!0,hash:null});else if(o[e])u[e]=new Indexed({_isIndexed:!0,hash:a[c++]});else try{u[e]=a[c++]}catch(t){u[e]=t}else try{u[e]=s[l++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const n=u[e];n instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw wrapAccessError(`property ${JSON.stringify(t.name)}`,n)}}):u[t.name]=n}}));for(let t=0;t<u.length;t++){const e=u[t];e instanceof Error&&Object.defineProperty(u,t,{enumerable:!0,get:()=>{throw wrapAccessError(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new TransactionDescription({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:BigNumber$1.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new LogDescription({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=hexlify$1(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new ErrorDescription({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!(!t||!t._isInterface)}}const version$9="abstract-provider/5.6.1";var __awaiter$6=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$b=new Logger$1(version$9);class ForkEvent extends Description{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class Provider{constructor(){logger$b.checkAbstract(new.target,Provider),defineReadOnly(this,"_isProvider",!0)}getFeeData(){return __awaiter$6(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield resolveProperties({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let n=null,r=null;return t&&t.baseFeePerGas&&(r=BigNumber$1.from("1500000000"),n=t.baseFeePerGas.mul(2).add(r)),{maxFeePerGas:n,maxPriorityFeePerGas:r,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}const version$8="abstract-signer/5.6.2";var __awaiter$5=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$a=new Logger$1(version$8),allowedTransactionKeys$1=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors=[Logger$1.errors.INSUFFICIENT_FUNDS,Logger$1.errors.NONCE_EXPIRED,Logger$1.errors.REPLACEMENT_UNDERPRICED];class Signer{constructor(){logger$a.checkAbstract(new.target,Signer),defineReadOnly(this,"_isSigner",!0)}getBalance(t){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield resolveProperties(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield resolveProperties(this.checkTransaction(t));return yield this.provider.call(n,e)}))}sendTransaction(t){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)}))}getChainId(){return __awaiter$5(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return __awaiter$5(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===allowedTransactionKeys$1.indexOf(e)&&logger$a.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=shallowCopy(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&logger$a.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return __awaiter$5(this,void 0,void 0,(function*(){const e=yield resolveProperties(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>__awaiter$5(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&logger$a.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const n=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!n?0!==e.type&&1!==e.type||!n||logger$a.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):logger$a.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(n&&logger$a.throwError("network does not support EIP-1559",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):logger$a.throwError("failed to get consistent fee data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(forwardErrors.indexOf(t.code)>=0)throw t;return logger$a.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&logger$a.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield resolveProperties(e)}))}_checkProvider(t){this.provider||logger$a.throwError("missing provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class VoidSigner extends Signer{constructor(t,e){super(),defineReadOnly(this,"address",t),defineReadOnly(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{logger$a.throwError(t,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new VoidSigner(this.address,t)}}var bn$2=createCommonjsModule$1((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:buffer.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var l=t.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,l=0,c=n;c<s;c+=r)l=u(t,c,c+r,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var h=1;for(l=u(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){l(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var c=u>>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,l=0,c=0|a[0],h=8191&c,f=c>>>13,d=0|a[1],p=8191&d,g=d>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],E=8191&_,k=_>>>13,M=0|a[5],S=8191&M,x=M>>>13,C=0|a[6],T=8191&C,N=C>>>13,B=0|a[7],$=8191&B,P=B>>>13,I=0|a[8],R=8191&I,O=I>>>13,L=0|a[9],D=8191&L,F=L>>>13,j=0|s[0],U=8191&j,H=j>>>13,z=0|s[1],G=8191&z,Q=z>>>13,W=0|s[2],q=8191&W,Y=W>>>13,V=0|s[3],K=8191&V,J=V>>>13,Z=0|s[4],X=8191&Z,tt=Z>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,lt=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(l+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,U)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(g,U)|0,o=Math.imul(g,H);var yt=(l+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,G)|0))<<13)|0;l=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,U),i=(i=Math.imul(y,H))+Math.imul(v,U)|0,o=Math.imul(v,H),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,Q)|0;var vt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,U),i=(i=Math.imul(w,H))+Math.imul(A,U)|0,o=Math.imul(A,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,Y)|0;var bt=(l+(r=r+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,K)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,U),i=(i=Math.imul(E,H))+Math.imul(k,U)|0,o=Math.imul(k,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Q)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,J)|0;var wt=(l+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,U),i=(i=Math.imul(S,H))+Math.imul(x,U)|0,o=Math.imul(x,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,K)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,U),i=(i=Math.imul(T,H))+Math.imul(N,U)|0,o=Math.imul(N,H),r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,J)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul($,U),i=(i=Math.imul($,H))+Math.imul(P,U)|0,o=Math.imul(P,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Q)|0,r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,H))+Math.imul(O,U)|0,o=Math.imul(O,H),r=r+Math.imul($,G)|0,i=(i=i+Math.imul($,Q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(S,K)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,lt)|0;var kt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,U),i=(i=Math.imul(D,H))+Math.imul(F,U)|0,o=Math.imul(F,H),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul($,q)|0,i=(i=i+Math.imul($,Y)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,Y)|0,r=r+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var Mt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Q))+Math.imul(F,G)|0,o=Math.imul(F,Q),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul($,K)|0,i=(i=i+Math.imul($,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(T,X)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(S,nt)|0,i=(i=i+Math.imul(S,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var St=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;l=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,Y))+Math.imul(F,q)|0,o=Math.imul(F,Y),r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul($,X)|0,i=(i=i+Math.imul($,tt)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var xt=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,gt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(D,K),i=(i=Math.imul(D,J))+Math.imul(F,K)|0,o=Math.imul(F,J),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul($,nt)|0,i=(i=i+Math.imul($,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul($,ot)|0,i=(i=i+Math.imul($,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,lt)|0,r=r+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(k,pt)|0))<<13)|0;l=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,nt),i=(i=Math.imul(D,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul($,ut)|0,i=(i=i+Math.imul($,lt)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ft)|0;var Nt=(l+(r=r+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(x,pt)|0))<<13)|0;l=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,lt)|0,r=r+Math.imul($,ht)|0,i=(i=i+Math.imul($,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Bt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(N,pt)|0))<<13)|0;l=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(D,ut),i=(i=Math.imul(D,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var $t=(l+(r=r+Math.imul($,pt)|0)|0)+((8191&(i=(i=i+Math.imul($,gt)|0)+Math.imul(P,pt)|0))<<13)|0;l=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(D,ht),i=(i=Math.imul(D,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Pt=(l+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(O,pt)|0))<<13)|0;l=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var It=(l+(r=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,gt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=kt,u[9]=Mt,u[10]=St,u[11]=xt,u[12]=Ct,u[13]=Tt,u[14]=Nt,u[15]=Bt,u[16]=$t,u[17]=Pt,u[18]=It,0!==l&&(u[19]=l,n.length++),n};function m(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var c=o-l,h=(0|t.words[c])*(0|e.words[l]),f=67108863&h;s=67108863&(f=f+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return m(t,e,n)}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):n<63?p(this,t,e):n<1024?m(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=r.clone()._ishlnsubmul(o,1,u);0===c.negative&&(r=c,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new k(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(A,b),r(_,b),r(E,b),E.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=a;0!==d.cmp(s);){for(var g=d,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(y),h=y.redSqr(),d=d.redMul(h),p=m}return f},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},r(M,k),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),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)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,commonjsGlobal$1)})),minimalisticAssert$1=assert$6;function assert$6(t,e){if(!t)throw new Error(e||"Assertion failed")}assert$6.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var inherits_browser$1=createCommonjsModule$1((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),inherits=createCommonjsModule$1((function(t){try{var e=util;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=inherits_browser$1}})),inherits_1=inherits;function isSurrogatePair(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function toArray(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)n.push(parseInt(t[i]+t[i+1],16))}else for(var r=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):isSurrogatePair(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<t.length;i++)n[i]=0|t[i];return n}var toArray_1=toArray;function toHex$2(t){for(var e="",n=0;n<t.length;n++)e+=zero2(t[n].toString(16));return e}var toHex_1=toHex$2;function htonl(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}var htonl_1=htonl;function toHex32(t,e){for(var n="",r=0;r<t.length;r++){var i=t[r];"little"===e&&(i=htonl(i)),n+=zero8(i.toString(16))}return n}var toHex32_1=toHex32;function zero2(t){return 1===t.length?"0"+t:t}var zero2_1=zero2;function zero8(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}var zero8_1=zero8;function join32(t,e,n,r){var i=n-e;minimalisticAssert$1(i%4==0);for(var o=new Array(i/4),a=0,s=e;a<o.length;a++,s+=4){var u;u="big"===r?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],o[a]=u>>>0}return o}var join32_1=join32;function split32(t,e){for(var n=new Array(4*t.length),r=0,i=0;r<t.length;r++,i+=4){var o=t[r];"big"===e?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n}var split32_1=split32;function rotr32$1(t,e){return t>>>e|t<<32-e}var rotr32_1=rotr32$1;function rotl32$2(t,e){return t<<e|t>>>32-e}var rotl32_1=rotl32$2;function sum32$3(t,e){return t+e>>>0}var sum32_1=sum32$3;function sum32_3$1(t,e,n){return t+e+n>>>0}var sum32_3_1=sum32_3$1;function sum32_4$2(t,e,n,r){return t+e+n+r>>>0}var sum32_4_1=sum32_4$2;function sum32_5$2(t,e,n,r,i){return t+e+n+r+i>>>0}var sum32_5_1=sum32_5$2;function sum64$1(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,a=(o<r?1:0)+n+i;t[e]=a>>>0,t[e+1]=o}var sum64_1=sum64$1;function sum64_hi$1(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0}var sum64_hi_1=sum64_hi$1;function sum64_lo$1(t,e,n,r){return e+r>>>0}var sum64_lo_1=sum64_lo$1;function sum64_4_hi$1(t,e,n,r,i,o,a,s){var u=0,l=e;return u+=(l=l+r>>>0)<e?1:0,u+=(l=l+o>>>0)<o?1:0,t+n+i+a+(u+=(l=l+s>>>0)<s?1:0)>>>0}var sum64_4_hi_1=sum64_4_hi$1;function sum64_4_lo$1(t,e,n,r,i,o,a,s){return e+r+o+s>>>0}var sum64_4_lo_1=sum64_4_lo$1;function sum64_5_hi$1(t,e,n,r,i,o,a,s,u,l){var c=0,h=e;return c+=(h=h+r>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+s>>>0)<s?1:0,t+n+i+a+u+(c+=(h=h+l>>>0)<l?1:0)>>>0}var sum64_5_hi_1=sum64_5_hi$1;function sum64_5_lo$1(t,e,n,r,i,o,a,s,u,l){return e+r+o+s+l>>>0}var sum64_5_lo_1=sum64_5_lo$1;function rotr64_hi$1(t,e,n){return(e<<32-n|t>>>n)>>>0}var rotr64_hi_1=rotr64_hi$1;function rotr64_lo$1(t,e,n){return(t<<32-n|e>>>n)>>>0}var rotr64_lo_1=rotr64_lo$1;function shr64_hi$1(t,e,n){return t>>>n}var shr64_hi_1=shr64_hi$1;function shr64_lo$1(t,e,n){return(t<<32-n|e>>>n)>>>0}var shr64_lo_1=shr64_lo$1,utils={inherits:inherits_1,toArray:toArray_1,toHex:toHex_1,htonl:htonl_1,toHex32:toHex32_1,zero2:zero2_1,zero8:zero8_1,join32:join32_1,split32:split32_1,rotr32:rotr32_1,rotl32:rotl32_1,sum32:sum32_1,sum32_3:sum32_3_1,sum32_4:sum32_4_1,sum32_5:sum32_5_1,sum64:sum64_1,sum64_hi:sum64_hi_1,sum64_lo:sum64_lo_1,sum64_4_hi:sum64_4_hi_1,sum64_4_lo:sum64_4_lo_1,sum64_5_hi:sum64_5_hi_1,sum64_5_lo:sum64_5_lo_1,rotr64_hi:rotr64_hi_1,rotr64_lo:rotr64_lo_1,shr64_hi:shr64_hi_1,shr64_lo:shr64_lo_1};function BlockHash$4(){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}var BlockHash_1=BlockHash$4;BlockHash$4.prototype.update=function(t,e){if(t=utils.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=utils.join32(t,0,t.length-n,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},BlockHash$4.prototype.digest=function(t){return this.update(this._pad()),minimalisticAssert$1(null===this.pending),this._digest(t)},BlockHash$4.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=t>>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r};var common$1={BlockHash:BlockHash_1},rotr32=utils.rotr32;function ft_1$1(t,e,n,r){return 0===t?ch32$1(e,n,r):1===t||3===t?p32(e,n,r):2===t?maj32$1(e,n,r):void 0}var ft_1_1=ft_1$1;function ch32$1(t,e,n){return t&e^~t&n}var ch32_1=ch32$1;function maj32$1(t,e,n){return t&e^t&n^e&n}var maj32_1=maj32$1;function p32(t,e,n){return t^e^n}var p32_1=p32;function s0_256$1(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}var s0_256_1=s0_256$1;function s1_256$1(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}var s1_256_1=s1_256$1;function g0_256$1(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}var g0_256_1=g0_256$1;function g1_256$1(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}var g1_256_1=g1_256$1,common={ft_1:ft_1_1,ch32:ch32_1,maj32:maj32_1,p32:p32_1,s0_256:s0_256_1,s1_256:s1_256_1,g0_256:g0_256_1,g1_256:g1_256_1},rotl32$1=utils.rotl32,sum32$2=utils.sum32,sum32_5$1=utils.sum32_5,ft_1=common.ft_1,BlockHash$3=common$1.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=rotl32$1(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),c=sum32_5$1(rotl32$1(i,5),ft_1(l,o,a,s),u,n[r],sha1_K[l]);u=s,s=a,a=rotl32$1(o,30),o=i,i=c}this.h[0]=sum32$2(this.h[0],i),this.h[1]=sum32$2(this.h[1],o),this.h[2]=sum32$2(this.h[2],a),this.h[3]=sum32$2(this.h[3],s),this.h[4]=sum32$2(this.h[4],u)},SHA1.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")};var sum32$1=utils.sum32,sum32_4$1=utils.sum32_4,sum32_5=utils.sum32_5,ch32=common.ch32,maj32=common.maj32,s0_256=common.s0_256,s1_256=common.s1_256,g0_256=common.g0_256,g1_256=common.g1_256,BlockHash$2=common$1.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function SHA256(){if(!(this instanceof SHA256))return new SHA256;BlockHash$2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils.inherits(SHA256,BlockHash$2);var _256=SHA256;function SHA224(){if(!(this instanceof SHA224))return new SHA224;_256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.padLength=64,SHA256.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=sum32_4$1(g1_256(n[r-2]),n[r-7],g0_256(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],l=this.h[5],c=this.h[6],h=this.h[7];for(minimalisticAssert$1(this.k.length===n.length),r=0;r<n.length;r++){var f=sum32_5(h,s1_256(u),ch32(u,l,c),this.k[r],n[r]),d=sum32$1(s0_256(i),maj32(i,o,a));h=c,c=l,l=u,u=sum32$1(s,f),s=a,a=o,o=i,i=sum32$1(f,d)}this.h[0]=sum32$1(this.h[0],i),this.h[1]=sum32$1(this.h[1],o),this.h[2]=sum32$1(this.h[2],a),this.h[3]=sum32$1(this.h[3],s),this.h[4]=sum32$1(this.h[4],u),this.h[5]=sum32$1(this.h[5],l),this.h[6]=sum32$1(this.h[6],c),this.h[7]=sum32$1(this.h[7],h)},SHA256.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")},utils.inherits(SHA224,_256);var _224=SHA224;SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h.slice(0,7),"big"):utils.split32(this.h.slice(0,7),"big")};var rotr64_hi=utils.rotr64_hi,rotr64_lo=utils.rotr64_lo,shr64_hi=utils.shr64_hi,shr64_lo=utils.shr64_lo,sum64=utils.sum64,sum64_hi=utils.sum64_hi,sum64_lo=utils.sum64_lo,sum64_4_hi=utils.sum64_4_hi,sum64_4_lo=utils.sum64_4_lo,sum64_5_hi=utils.sum64_5_hi,sum64_5_lo=utils.sum64_5_lo,BlockHash$1=common$1.BlockHash,sha512_K=[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,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function SHA512(){if(!(this instanceof SHA512))return new SHA512;BlockHash$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}utils.inherits(SHA512,BlockHash$1);var _512=SHA512;function ch64_hi(t,e,n,r,i){var o=t&n^~t&i;return o<0&&(o+=4294967296),o}function ch64_lo(t,e,n,r,i,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function maj64_hi(t,e,n,r,i){var o=t&n^t&i^n&i;return o<0&&(o+=4294967296),o}function maj64_lo(t,e,n,r,i,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function s0_512_hi(t,e){var n=rotr64_hi(t,e,28)^rotr64_hi(e,t,2)^rotr64_hi(e,t,7);return n<0&&(n+=4294967296),n}function s0_512_lo(t,e){var n=rotr64_lo(t,e,28)^rotr64_lo(e,t,2)^rotr64_lo(e,t,7);return n<0&&(n+=4294967296),n}function s1_512_hi(t,e){var n=rotr64_hi(t,e,14)^rotr64_hi(t,e,18)^rotr64_hi(e,t,9);return n<0&&(n+=4294967296),n}function s1_512_lo(t,e){var n=rotr64_lo(t,e,14)^rotr64_lo(t,e,18)^rotr64_lo(e,t,9);return n<0&&(n+=4294967296),n}function g0_512_hi(t,e){var n=rotr64_hi(t,e,1)^rotr64_hi(t,e,8)^shr64_hi(t,e,7);return n<0&&(n+=4294967296),n}function g0_512_lo(t,e){var n=rotr64_lo(t,e,1)^rotr64_lo(t,e,8)^shr64_lo(t,e,7);return n<0&&(n+=4294967296),n}function g1_512_hi(t,e){var n=rotr64_hi(t,e,19)^rotr64_hi(e,t,29)^shr64_hi(t,e,6);return n<0&&(n+=4294967296),n}function g1_512_lo(t,e){var n=rotr64_lo(t,e,19)^rotr64_lo(e,t,29)^shr64_lo(t,e,6);return n<0&&(n+=4294967296),n}function SHA384(){if(!(this instanceof SHA384))return new SHA384;_512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}SHA512.blockSize=1024,SHA512.outSize=512,SHA512.hmacStrength=192,SHA512.padLength=128,SHA512.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var i=g1_512_hi(n[r-4],n[r-3]),o=g1_512_lo(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=g0_512_hi(n[r-30],n[r-29]),l=g0_512_lo(n[r-30],n[r-29]),c=n[r-32],h=n[r-31];n[r]=sum64_4_hi(i,o,a,s,u,l,c,h),n[r+1]=sum64_4_lo(i,o,a,s,u,l,c,h)}},SHA512.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],l=this.h[6],c=this.h[7],h=this.h[8],f=this.h[9],d=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],y=this.h[14],v=this.h[15];minimalisticAssert$1(this.k.length===n.length);for(var b=0;b<n.length;b+=2){var w=y,A=v,_=s1_512_hi(h,f),E=s1_512_lo(h,f),k=ch64_hi(h,f,d,p,g),M=ch64_lo(h,f,d,p,g,m),S=this.k[b],x=this.k[b+1],C=n[b],T=n[b+1],N=sum64_5_hi(w,A,_,E,k,M,S,x,C,T),B=sum64_5_lo(w,A,_,E,k,M,S,x,C,T);w=s0_512_hi(r,i),A=s0_512_lo(r,i),_=maj64_hi(r,i,o,a,s),E=maj64_lo(r,i,o,a,s,u);var $=sum64_hi(w,A,_,E),P=sum64_lo(w,A,_,E);y=g,v=m,g=d,m=p,d=h,p=f,h=sum64_hi(l,c,N,B),f=sum64_lo(c,c,N,B),l=s,c=u,s=o,u=a,o=r,a=i,r=sum64_hi(N,B,$,P),i=sum64_lo(N,B,$,P)}sum64(this.h,0,r,i),sum64(this.h,2,o,a),sum64(this.h,4,s,u),sum64(this.h,6,l,c),sum64(this.h,8,h,f),sum64(this.h,10,d,p),sum64(this.h,12,g,m),sum64(this.h,14,y,v)},SHA512.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")},utils.inherits(SHA384,_512);var _384=SHA384;SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h.slice(0,12),"big"):utils.split32(this.h.slice(0,12),"big")};var sha1=_1,sha224=_224,sha256$1=_256,sha384=_384,sha512=_512,sha={sha1:sha1,sha224:sha224,sha256:sha256$1,sha384:sha384,sha512:sha512},rotl32=utils.rotl32,sum32=utils.sum32,sum32_3=utils.sum32_3,sum32_4=utils.sum32_4,BlockHash=common$1.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils.inherits(RIPEMD160,BlockHash);var ripemd160=RIPEMD160;function f(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}function K(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.padLength=64,RIPEMD160.prototype._update=function(t,e){for(var n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],u=this.h[4],l=n,c=i,h=o,d=a,p=u,g=0;g<80;g++){var m=sum32(rotl32(sum32_4(n,f(g,i,o,a),t[r[g]+e],K(g)),s[g]),u);n=u,u=a,a=rotl32(o,10),o=i,i=m,m=sum32(rotl32(sum32_4(l,f(79-g,c,h,d),t[rh[g]+e],Kh(g)),sh[g]),p),l=p,p=d,d=rotl32(h,10),h=c,c=m}m=sum32_3(this.h[1],o,d),this.h[1]=sum32_3(this.h[2],a,p),this.h[2]=sum32_3(this.h[3],u,l),this.h[3]=sum32_3(this.h[4],n,c),this.h[4]=sum32_3(this.h[0],i,h),this.h[0]=m},RIPEMD160.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"little"):utils.split32(this.h,"little")};var r=[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],rh=[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],s=[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],sh=[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],ripemd={ripemd160:ripemd160};function Hmac(t,e,n){if(!(this instanceof Hmac))return new Hmac(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(e,n))}var hmac=Hmac;Hmac.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),minimalisticAssert$1(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},Hmac.prototype.update=function(t,e){return this.inner.update(t,e),this},Hmac.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};var hash_1=createCommonjsModule$1((function(t,e){var n=e;n.utils=utils,n.common=common$1,n.sha=sha,n.ripemd=ripemd,n.hmac=hmac,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),hash=hash_1;function createCommonjsModule$2(t,e,n){return n={path:e,exports:{},require:function(t,e){return commonjsRequire(t,null==e?n.path:e)}},t(n,n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var minimalisticAssert=assert;function assert(t,e){if(!t)throw new Error(e||"Assertion failed")}assert.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var utils_1=createCommonjsModule$2((function(t,e){var n=e;function r(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(r=0;r<t.length;r++){var i=t.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(t,e){return"hex"===e?i(t):t}})),utils_1$1=createCommonjsModule$2((function(t,e){var n=e;n.assert=minimalisticAssert,n.toArray=utils_1.toArray,n.zero2=utils_1.zero2,n.toHex=utils_1.toHex,n.encode=utils_1.encode,n.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<r.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,u=t.andln(3)+i&3,l=e.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),a=0==(1&u)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==l?u:-u,n[0].push(a),s=0==(1&l)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==u?l:-l,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},n.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new bn$2(t,"hex","le")}})),getNAF=utils_1$1.getNAF,getJSF=utils_1$1.getJSF,assert$1=utils_1$1.assert;function BaseCurve(t,e){this.type=t,this.p=new bn$2(e.p,16),this.red=e.prime?bn$2.red(e.prime):bn$2.mont(this.p),this.zero=new bn$2(0).toRed(this.red),this.one=new bn$2(1).toRed(this.red),this.two=new bn$2(2).toRed(this.red),this.n=e.n&&new bn$2(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),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 base=BaseCurve;function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(t,e){assert$1(t.precomputed);var n=t._getDoubles(),r=getNAF(e,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<r.length;o+=n.step){a=0;for(var u=o+n.step-1;u>=o;u--)a=(a<<1)+r[u];s.push(a)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<s.length;o++)(a=s[o])===h?c=c.mixedAdd(n.points[o]):a===-h&&(c=c.mixedAdd(n.points[o].neg()));l=l.add(c)}return l.toP()},BaseCurve.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=getNAF(e,n,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var l=o[s];assert$1(0!==l),a="affine"===t.type?l>0?a.mixedAdd(i[l-1>>1]):a.mixedAdd(i[-l-1>>1].neg()):l>0?a.add(i[l-1>>1]):a.add(i[-l-1>>1].neg())}return"affine"===t.type?a.toP():a},BaseCurve.prototype._wnafMulAdd=function(t,e,n,r,i){var o,a,s,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o<r;o++){var f=(s=e[o])._getNAFPoints(t);u[o]=f.wnd,l[o]=f.points}for(o=r-1;o>=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=getJSF(n[d],n[p]);for(h=Math.max(y[0].length,h),c[d]=new Array(h),c[p]=new Array(h),a=0;a<h;a++){var v=0|y[0][a],b=0|y[1][a];c[d][a]=m[3*(v+1)+(b+1)],c[p][a]=0,l[d]=g}}else c[d]=getNAF(n[d],u[d],this._bitLength),c[p]=getNAF(n[p],u[p],this._bitLength),h=Math.max(c[d].length,h),h=Math.max(c[p].length,h)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(o=h;o>=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a<r;a++)A[a]=0|c[a][o],0!==A[a]&&(E=!1);if(!E)break;_++,o--}if(o>=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a<r;a++){var k=A[a];0!==k&&(k>0?s=l[a][k-1>>1]:k<0&&(s=l[a][-k-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<r;o++)l[o]=null;return i?w:w.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function(){throw new Error("Not implemented")},BasePoint.prototype.validate=function(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function(t,e){t=utils_1$1.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?assert$1(t[t.length-1]%2==0):7===t[0]&&assert$1(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function(t){return this.encode(t,!0)},BasePoint.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},BasePoint.prototype.encode=function(t,e){return utils_1$1.encode(this._encode(e),t)},BasePoint.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},BasePoint.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},BasePoint.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)r=r.dbl();n.push(r)}return{step:t,points:n}},BasePoint.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)e[i]=e[i-1].add(r);return{wnd:t,points:e}},BasePoint.prototype._getBeta=function(){return null},BasePoint.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var inherits_browser=createCommonjsModule$2((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),assert$2=utils_1$1.assert;function ShortCurve(t){base.call(this,"short",t),this.a=new bn$2(t.a,16).toRed(this.red),this.b=new bn$2(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits_browser(ShortCurve,base);var short_1=ShortCurve;function Point(t,e,n,r){base.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new bn$2(e,16),this.y=new bn$2(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)}function JPoint(t,e,n,r){base.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new bn$2(0)):(this.x=new bn$2(e,16),this.y=new bn$2(n,16),this.z=new bn$2(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}ShortCurve.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,n;if(t.beta)e=new bn$2(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)n=new bn$2(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?n=i[0]:(n=i[1],assert$2(0===this.g.mul(n).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:n,basis:t.basis?t.basis.map((function(t){return{a:new bn$2(t.a,16),b:new bn$2(t.b,16)}})):this._getEndoBasis(n)}}},ShortCurve.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:bn$2.mont(t),n=new bn$2(2).toRed(e).redInvm(),r=n.redNeg(),i=new bn$2(3).toRed(e).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},ShortCurve.prototype._getEndoBasis=function(t){for(var e,n,r,i,o,a,s,u,l,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,f=this.n.clone(),d=new bn$2(1),p=new bn$2(0),g=new bn$2(0),m=new bn$2(1),y=0;0!==h.cmpn(0);){var v=f.div(h);u=f.sub(v.mul(h)),l=g.sub(v.mul(d));var b=m.sub(v.mul(p));if(!r&&u.cmp(c)<0)e=s.neg(),n=d,r=u.neg(),i=l;else if(r&&2==++y)break;s=u,f=h,h=u,g=d,d=l,m=p,p=b}o=u.neg(),a=l;var w=r.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=e,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},ShortCurve.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],i=r.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),l=o.mul(r.b);return{k1:t.sub(a).sub(s),k2:u.add(l).neg()}},ShortCurve.prototype.pointFromX=function(t,e){(t=new bn$2(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},ShortCurve.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,r,i,2*o,n),c=0;c<2*o;c++)r[c]=null,i[c]=null;return l},inherits_browser(Point,base.BasePoint),ShortCurve.prototype.point=function(t,e,n){return new Point(this,t,e,n)},ShortCurve.prototype.pointFromJSON=function(t,e){return Point.fromJSON(this,t,e)},Point.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,r=function(t){return n.point(t.x.redMul(n.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},Point.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]},Point.fromJSON=function(t,e,n){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],n);if(!e[2])return r;function i(e){return t.point(e[0],e[1],n)}var o=e[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},Point.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)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},Point.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(t){return t=new bn$2(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},Point.prototype.jmulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},Point.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},Point.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.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 e},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits_browser(JPoint,base.BasePoint),ShortCurve.prototype.jpoint=function(t,e,n){return new JPoint(this,t,e,n)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),i=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),c=l.redMul(s),h=r.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(f,d,p)},JPoint.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=n.redMul(u),h=s.redSqr().redIAdd(l).redISub(c).redISub(c),f=s.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(a);return this.curve.jpoint(h,f,d)},JPoint.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),l=a.redAdd(a);for(e=0;e<t;e++){var c=o.redSqr(),h=l.redSqr(),f=h.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(r.redMul(u)),p=o.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),y=d.redMul(m);y=y.redIAdd(y).redISub(f);var v=l.redMul(s);e+1<t&&(u=u.redMul(f)),o=g,s=v,l=y}return this.curve.jpoint(o,l.redMul(i),s)},JPoint.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=u,e=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),f=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(c).redISub(f);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),g=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),t=g.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(m),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(t,e,n)},JPoint.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);t=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),f=this.x.redMul(h),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),g=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(g),n=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=d.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,n)},JPoint.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=e.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),l=(u=u.redIAdd(u)).redMul(a),c=s.redSqr().redISub(l.redAdd(l)),h=l.redISub(c),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=s.redMul(h).redISub(f),p=n.redAdd(n).redMul(r);return this.curve.jpoint(c,d,p)},JPoint.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),r=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),c=e.redMul(l);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(s).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.y.redMul(l.redMul(u.redISub(l)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(h,f,d)},JPoint.prototype.mul=function(t,e){return t=new bn$2(t,e),this.curve._wnafMul(this,t)},JPoint.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),i=n.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(r)).cmpn(0)},JPoint.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},JPoint.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)+">"},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var curve_1=createCommonjsModule$2((function(t,e){var n=e;n.base=base,n.short=short_1,n.mont=null,n.edwards=null})),curves_1=createCommonjsModule$2((function(t,e){var n,r=e,i=utils_1$1.assert;function o(t){"short"===t.type?this.curve=new curve_1.short(t):"edwards"===t.type?this.curve=new curve_1.edwards(t):this.curve=new curve_1.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new o(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,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:hash.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:hash.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:hash.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:hash.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:hash.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:hash.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:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(t){n=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:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function HmacDRBG(t){if(!(this instanceof HmacDRBG))return new HmacDRBG(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=utils_1.toArray(t.entropy,t.entropyEnc||"hex"),n=utils_1.toArray(t.nonce,t.nonceEnc||"hex"),r=utils_1.toArray(t.pers,t.persEnc||"hex");minimalisticAssert(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new 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},HmacDRBG.prototype._hmac=function(){return new hash.hmac(this.hash,this.K)},HmacDRBG.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG.prototype.reseed=function(t,e,n,r){"string"!=typeof e&&(r=n,n=e,e=null),t=utils_1.toArray(t,e),n=utils_1.toArray(n,r),minimalisticAssert(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},HmacDRBG.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=utils_1.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(n),this._reseed++,utils_1.encode(o,e)};var assert$3=utils_1$1.assert;function KeyPair(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var key=KeyPair;KeyPair.fromPublic=function(t,e,n){return e instanceof KeyPair?e:new KeyPair(t,{pub:e,pubEnc:n})},KeyPair.fromPrivate=function(t,e,n){return e instanceof KeyPair?e:new KeyPair(t,{priv:e,privEnc:n})},KeyPair.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},KeyPair.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},KeyPair.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(t,e){this.priv=new bn$2(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?assert$3(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert$3(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},KeyPair.prototype.derive=function(t){return t.validate()||assert$3(t.validate(),"public point not validated"),t.mul(this.priv).getX()},KeyPair.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},KeyPair.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},KeyPair.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var assert$4=utils_1$1.assert;function Signature(t,e){if(t instanceof Signature)return t;this._importDER(t,e)||(assert$4(t.r&&t.s,"Signature without r or s"),this.r=new bn$2(t.r,16),this.s=new bn$2(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var signature=Signature;function Position(){this.place=0}function getLength(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=e.place;o<r;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function rmPadding(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function constructLength(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}Signature.prototype._importDER=function(t,e){t=utils_1$1.toArray(t,e);var n=new Position;if(48!==t[n.place++])return!1;var r=getLength(t,n);if(!1===r)return!1;if(r+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var i=getLength(t,n);if(!1===i)return!1;var o=t.slice(n.place,i+n.place);if(n.place+=i,2!==t[n.place++])return!1;var a=getLength(t,n);if(!1===a)return!1;if(t.length!==a+n.place)return!1;var s=t.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new bn$2(o),this.s=new bn$2(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=rmPadding(e),n=rmPadding(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];constructLength(r,e.length),(r=r.concat(e)).push(2),constructLength(r,n.length);var i=r.concat(n),o=[48];return constructLength(o,i.length),o=o.concat(i),utils_1$1.encode(o,t)};var rand=function(){throw new Error("unsupported")},assert$5=utils_1$1.assert;function EC(t){if(!(this instanceof EC))return new EC(t);"string"==typeof t&&(assert$5(Object.prototype.hasOwnProperty.call(curves_1,t),"Unknown curve "+t),t=curves_1[t]),t instanceof curves_1.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var ec=EC;EC.prototype.keyPair=function(t){return new key(this,t)},EC.prototype.keyFromPrivate=function(t,e){return key.fromPrivate(this,t,e)},EC.prototype.keyFromPublic=function(t,e){return key.fromPublic(this,t,e)},EC.prototype.genKeyPair=function(t){t||(t={});for(var e=new hmacDrbg({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new bn$2(2));;){var i=new bn$2(e.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},EC.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},EC.prototype.sign=function(t,e,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new bn$2(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),a=t.toArray("be",i),s=new hmacDrbg({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new bn$2(1)),l=0;;l++){var c=r.k?r.k(l):new bn$2(s.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(u)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new signature({r:d,s:p,recoveryParam:g})}}}}}},EC.prototype.verify=function(t,e,n,r){t=this._truncateToN(new bn$2(t,16)),n=this.keyFromPublic(n,r);var i=(e=new signature(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(t).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},EC.prototype.recoverPubKey=function(t,e,n,r){assert$5((3&n)===n,"The recovery param is more than two bits"),e=new signature(e,r);var i=this.n,o=new bn$2(t),a=e.r,s=e.s,u=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var c=e.r.invm(i),h=i.sub(o).mul(c).umod(i),f=s.mul(c).umod(i);return this.g.mulAdd(h,a,f)},EC.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new signature(e,r)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var elliptic_1=createCommonjsModule$2((function(t,e){var n=e;n.version="6.5.4",n.utils=utils_1$1,n.rand=function(){throw new Error("unsupported")},n.curve=curve_1,n.curves=curves_1,n.ec=ec,n.eddsa=null})),EC$1=elliptic_1.ec;const version$7="signing-key/5.6.2",logger$9=new Logger$1(version$7);let _curve=null;function getCurve(){return _curve||(_curve=new EC$1("secp256k1")),_curve}class SigningKey{constructor(t){defineReadOnly(this,"curve","secp256k1"),defineReadOnly(this,"privateKey",hexlify$1(t)),32!==hexDataLength(this.privateKey)&&logger$9.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=getCurve().keyFromPrivate(arrayify$1(this.privateKey));defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),defineReadOnly(this,"_isSigningKey",!0)}_addPoint(t){const e=getCurve().keyFromPublic(arrayify$1(this.publicKey)),n=getCurve().keyFromPublic(arrayify$1(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const e=getCurve().keyFromPrivate(arrayify$1(this.privateKey)),n=arrayify$1(t);32!==n.length&&logger$9.throwArgumentError("bad digest length","digest",t);const r=e.sign(n,{canonical:!0});return splitSignature({recoveryParam:r.recoveryParam,r:hexZeroPad$1("0x"+r.r.toString(16),32),s:hexZeroPad$1("0x"+r.s.toString(16),32)})}computeSharedSecret(t){const e=getCurve().keyFromPrivate(arrayify$1(this.privateKey)),n=getCurve().keyFromPublic(arrayify$1(computePublicKey(t)));return hexZeroPad$1("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function recoverPublicKey(t,e){const n=splitSignature(e),r={r:arrayify$1(n.r),s:arrayify$1(n.s)};return"0x"+getCurve().recoverPubKey(arrayify$1(t),r,n.recoveryParam).encode("hex",!1)}function computePublicKey(t,e){const n=arrayify$1(t);if(32===n.length){const t=new SigningKey(n);return e?"0x"+getCurve().keyFromPrivate(n).getPublic(!0,"hex"):t.publicKey}return 33===n.length?e?hexlify$1(n):"0x"+getCurve().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+getCurve().keyFromPublic(n).getPublic(!0,"hex"):hexlify$1(n):logger$9.throwArgumentError("invalid public or private key","key","[REDACTED]")}const version$6="transactions/5.6.2",logger$8=new Logger$1(version$6);var TransactionTypes;function handleAddress(t){return"0x"===t?null:getAddress(t)}function handleNumber(t){return"0x"===t?Zero$1:BigNumber$1.from(t)}function computeAddress(t){return getAddress(hexDataSlice(keccak256(hexDataSlice(computePublicKey(t),1)),12))}function recoverAddress(t,e){return computeAddress(recoverPublicKey(arrayify$1(t),e))}function formatNumber(t,e){const n=stripZeros(BigNumber$1.from(t).toHexString());return n.length>32&&logger$8.throwArgumentError("invalid length for "+e,"transaction:"+e,t),n}function accessSetify(t,e){return{address:getAddress(t),storageKeys:(e||[]).map(((e,n)=>(32!==hexDataLength(e)&&logger$8.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,e),e.toLowerCase())))}}function accessListify(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&logger$8.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),accessSetify(t[0],t[1])):accessSetify(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const n=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return accessSetify(e,Object.keys(n).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function formatAccessList(t){return accessListify(t).map((t=>[t.address,t.storageKeys]))}function _serializeEip1559(t,e){if(null!=t.gasPrice){const e=BigNumber$1.from(t.gasPrice),n=BigNumber$1.from(t.maxFeePerGas||0);e.eq(n)||logger$8.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:n})}const n=[formatNumber(t.chainId||0,"chainId"),formatNumber(t.nonce||0,"nonce"),formatNumber(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(t.maxFeePerGas||0,"maxFeePerGas"),formatNumber(t.gasLimit||0,"gasLimit"),null!=t.to?getAddress(t.to):"0x",formatNumber(t.value||0,"value"),t.data||"0x",formatAccessList(t.accessList||[])];if(e){const t=splitSignature(e);n.push(formatNumber(t.recoveryParam,"recoveryParam")),n.push(stripZeros(t.r)),n.push(stripZeros(t.s))}return hexConcat(["0x02",encode$2(n)])}function _serializeEip2930(t,e){const n=[formatNumber(t.chainId||0,"chainId"),formatNumber(t.nonce||0,"nonce"),formatNumber(t.gasPrice||0,"gasPrice"),formatNumber(t.gasLimit||0,"gasLimit"),null!=t.to?getAddress(t.to):"0x",formatNumber(t.value||0,"value"),t.data||"0x",formatAccessList(t.accessList||[])];if(e){const t=splitSignature(e);n.push(formatNumber(t.recoveryParam,"recoveryParam")),n.push(stripZeros(t.r)),n.push(stripZeros(t.s))}return hexConcat(["0x01",encode$2(n)])}function _parseEipSignature(t,e,n){try{const n=handleNumber(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){logger$8.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=hexZeroPad$1(e[1],32),t.s=hexZeroPad$1(e[2],32);try{const e=keccak256(n(t));t.from=recoverAddress(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function _parseEip1559(t){const e=decode$2(t.slice(1));9!==e.length&&12!==e.length&&logger$8.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify$1(t));const n=handleNumber(e[2]),r=handleNumber(e[3]),i={type:2,chainId:handleNumber(e[0]).toNumber(),nonce:handleNumber(e[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:handleNumber(e[4]),to:handleAddress(e[5]),value:handleNumber(e[6]),data:e[7],accessList:accessListify(e[8])};return 9===e.length||(i.hash=keccak256(t),_parseEipSignature(i,e.slice(9),_serializeEip1559)),i}function _parseEip2930(t){const e=decode$2(t.slice(1));8!==e.length&&11!==e.length&&logger$8.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify$1(t));const n={type:1,chainId:handleNumber(e[0]).toNumber(),nonce:handleNumber(e[1]).toNumber(),gasPrice:handleNumber(e[2]),gasLimit:handleNumber(e[3]),to:handleAddress(e[4]),value:handleNumber(e[5]),data:e[6],accessList:accessListify(e[7])};return 8===e.length||(n.hash=keccak256(t),_parseEipSignature(n,e.slice(8),_serializeEip2930)),n}function _parse(t){const e=decode$2(t);9!==e.length&&6!==e.length&&logger$8.throwArgumentError("invalid raw transaction","rawTransaction",t);const n={nonce:handleNumber(e[0]).toNumber(),gasPrice:handleNumber(e[1]),gasLimit:handleNumber(e[2]),to:handleAddress(e[3]),value:handleNumber(e[4]),data:e[5],chainId:0};if(6===e.length)return n;try{n.v=BigNumber$1.from(e[6]).toNumber()}catch(t){return n}if(n.r=hexZeroPad$1(e[7],32),n.s=hexZeroPad$1(e[8],32),BigNumber$1.from(n.r).isZero()&&BigNumber$1.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=e.slice(0,6);0!==n.chainId&&(i.push(hexlify$1(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=keccak256(encode$2(i));try{n.from=recoverAddress(o,{r:hexlify$1(n.r),s:hexlify$1(n.s),recoveryParam:r})}catch(t){}n.hash=keccak256(t)}return n.type=null,n}function parse(t){const e=arrayify$1(t);if(e[0]>127)return _parse(e);switch(e[0]){case 1:return _parseEip2930(e);case 2:return _parseEip1559(e)}return logger$8.throwError(`unsupported transaction type: ${e[0]}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(TransactionTypes||(TransactionTypes={}));const version$5="contracts/5.6.2";var __awaiter$4=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$7=new Logger$1(version$5);function resolveName(t,e){return __awaiter$4(this,void 0,void 0,(function*(){const n=yield e;"string"!=typeof n&&logger$7.throwArgumentError("invalid address or ENS name","name",n);try{return getAddress(n)}catch(t){}t||logger$7.throwError("a provider or signer is needed to resolve ENS names",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield t.resolveName(n);return null==r&&logger$7.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function resolveAddresses(t,e,n){return __awaiter$4(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>resolveAddresses(t,Array.isArray(e)?e[r]:e[n.name],n)))):"address"===n.type?yield resolveName(t,e):"tuple"===n.type?yield resolveAddresses(t,e,n.components):"array"===n.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>resolveAddresses(t,e,n.arrayChildren)))):Promise.reject(logger$7.makeError("invalid value for array",Logger$1.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function populateTransaction(t,e,n){return __awaiter$4(this,void 0,void 0,(function*(){let r={};n.length===e.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=shallowCopy(n.pop())),logger$7.checkArgumentCount(n.length,e.inputs.length,"passed to contract"),t.signer?r.from?r.from=resolveProperties({override:resolveName(t.signer,r.from),signer:t.signer.getAddress()}).then((t=>__awaiter$4(this,void 0,void 0,(function*(){return getAddress(t.signer)!==t.override&&logger$7.throwError("Contract with a Signer cannot override from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):r.from=t.signer.getAddress():r.from&&(r.from=resolveName(t.provider,r.from));const i=yield resolveProperties({args:resolveAddresses(t.signer||t.provider,n,e.inputs),address:t.resolvedAddress,overrides:resolveProperties(r)||{}}),o=t.interface.encodeFunctionData(e,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=BigNumber$1.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=BigNumber$1.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=BigNumber$1.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=BigNumber$1.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=BigNumber$1.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=accessListify(s.accessList)),null==a.gasLimit&&null!=e.gas){let t=21e3;const n=arrayify$1(o);for(let e=0;e<n.length;e++)t+=4,n[e]&&(t+=64);a.gasLimit=BigNumber$1.from(e.gas).add(t)}if(s.value){const t=BigNumber$1.from(s.value);t.isZero()||e.payable||logger$7.throwError("non-payable method cannot override value",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),a.value=t}s.customData&&(a.customData=shallowCopy(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.ccipReadEnabled),delete r.nonce,delete r.gasLimit,delete r.gasPrice,delete r.from,delete r.value,delete r.type,delete r.accessList,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.customData,delete r.ccipReadEnabled;const u=Object.keys(r).filter((t=>null!=r[t]));return u.length&&logger$7.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function buildPopulate(t,e){return function(...n){return populateTransaction(t,e,n)}}function buildEstimate(t,e){const n=t.signer||t.provider;return function(...r){return __awaiter$4(this,void 0,void 0,(function*(){n||logger$7.throwError("estimate require a provider or signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield populateTransaction(t,e,r);return yield n.estimateGas(i)}))}}function addContractWait(t,e){const n=e.wait.bind(e);e.wait=e=>n(e).then((e=>(e.events=e.logs.map((n=>{let r=deepCopy(n),i=null;try{i=t.interface.parseLog(n)}catch(t){}return i&&(r.args=i.args,r.decode=(e,n)=>t.interface.decodeEventLog(i.eventFragment,e,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>t.provider,r.getBlock=()=>t.provider.getBlock(e.blockHash),r.getTransaction=()=>t.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(e),r})),e)))}function buildCall(t,e,n){const r=t.signer||t.provider;return function(...i){return __awaiter$4(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=shallowCopy(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const a=yield populateTransaction(t,e,i),s=yield r.call(a,o);try{let r=t.interface.decodeFunctionResult(e,s);return n&&1===e.outputs.length&&(r=r[0]),r}catch(e){throw e.code===Logger$1.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=a),e}}))}}function buildSend(t,e){return function(...n){return __awaiter$4(this,void 0,void 0,(function*(){t.signer||logger$7.throwError("sending a transaction requires a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const r=yield populateTransaction(t,e,n),i=yield t.signer.sendTransaction(r);return addContractWait(t,i),i}))}}function buildDefault(t,e,n){return e.constant?buildCall(t,e,n):buildSend(t,e)}function getEventTag$1(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class RunningEvent{constructor(t,e){defineReadOnly(this,"tag",t),defineReadOnly(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((n=>!(!e&&n.listener===t)||(e=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const n=t.slice();return setTimeout((()=>{e.listener.apply(this,n)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class ErrorRunningEvent extends RunningEvent{constructor(){super("error",null)}}class FragmentRunningEvent extends RunningEvent{constructor(t,e,n,r){const i={address:t};let o=e.getEventTopic(n);r?(o!==r[0]&&logger$7.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(getEventTag$1(i),i),defineReadOnly(this,"address",t),defineReadOnly(this,"interface",e),defineReadOnly(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=checkResultErrors(t.args);if(e.length)throw e[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class WildcardRunningEvent extends RunningEvent{constructor(t,e){super("*",{address:t}),defineReadOnly(this,"address",t),defineReadOnly(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,n)=>this.interface.decodeEventLog(e.eventFragment,t,n),t.args=e.args}catch(t){}}}class BaseContract{constructor(t,e,n){defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(e)),null==n?(defineReadOnly(this,"provider",null),defineReadOnly(this,"signer",null)):Signer.isSigner(n)?(defineReadOnly(this,"provider",n.provider||null),defineReadOnly(this,"signer",n)):Provider.isProvider(n)?(defineReadOnly(this,"provider",n),defineReadOnly(this,"signer",null)):logger$7.throwArgumentError("invalid signer or provider","signerOrProvider",n),defineReadOnly(this,"callStatic",{}),defineReadOnly(this,"estimateGas",{}),defineReadOnly(this,"functions",{}),defineReadOnly(this,"populateTransaction",{}),defineReadOnly(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const n=this.interface.events[e];defineReadOnly(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,t)}))),t[n.name]||(t[n.name]=[]),t[n.name].push(e)})),Object.keys(t).forEach((e=>{const n=t[e];1===n.length?defineReadOnly(this.filters,e,this.filters[n[0]]):logger$7.warn(`Duplicate definition of ${e} (${n.join(", ")})`)}))}if(defineReadOnly(this,"_runningEvents",{}),defineReadOnly(this,"_wrappedEmits",{}),null==t&&logger$7.throwArgumentError("invalid contract address or ENS name","addressOrName",t),defineReadOnly(this,"address",t),this.provider)defineReadOnly(this,"resolvedAddress",resolveName(this.provider,t));else try{defineReadOnly(this,"resolvedAddress",Promise.resolve(getAddress(t)))}catch(t){logger$7.throwError("provider is required to use ENS name as contract address",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])logger$7.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const n=e.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(t)}null==this[t]&&defineReadOnly(this,t,buildDefault(this,e,!0)),null==this.functions[t]&&defineReadOnly(this.functions,t,buildDefault(this,e,!1)),null==this.callStatic[t]&&defineReadOnly(this.callStatic,t,buildCall(this,e,!0)),null==this.populateTransaction[t]&&defineReadOnly(this.populateTransaction,t,buildPopulate(this,e)),null==this.estimateGas[t]&&defineReadOnly(this.estimateGas,t,buildEstimate(this,e))}})),Object.keys(r).forEach((t=>{const e=r[t];if(e.length>1)return;t=t.substring(1);const n=e[0];try{null==this[t]&&defineReadOnly(this,t,this[n])}catch(t){}null==this.functions[t]&&defineReadOnly(this.functions,t,this.functions[n]),null==this.callStatic[t]&&defineReadOnly(this.callStatic,t,this.callStatic[n]),null==this.populateTransaction[t]&&defineReadOnly(this.populateTransaction,t,this.populateTransaction[n]),null==this.estimateGas[t]&&defineReadOnly(this.estimateGas,t,this.estimateGas[n])}))}static getContractAddress(t){return getContractAddress(t)}static getInterface(t){return Interface.isInterface(t)?t:new Interface(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&logger$7.throwError("contract not deployed",Logger$1.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||logger$7.throwError("sending a transactions require a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=shallowCopy(t||{});return["from","to"].forEach((function(t){null!=e[t]&&logger$7.throwError("cannot override "+t,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new VoidSigner(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&defineReadOnly(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return Indexed.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new ErrorRunningEvent);if("event"===t)return this._normalizeRunningEvent(new RunningEvent("event",null));if("*"===t)return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const n=this.interface.getEvent(e);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,n,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag$1(e),e))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,n){const r=deepCopy(e);return r.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},r.getBlock=()=>this.provider.getBlock(e.blockHash),r.getTransaction=()=>this.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(r),r}_addEventListener(t,e,n){if(this.provider||logger$7.throwError("events require a provider or a signer with a provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const n=n=>{let r=this._wrapEvent(t,n,e);if(null==r.decodeError)try{const e=t.getEmit(r);this.emit(t.filter,...e)}catch(t){r.decodeError=t.error}null!=t.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,n){const r=this._getRunningEvent(t),i=shallowCopy(r.filter);return"string"==typeof e&&isHexString$1(e,32)?(null!=n&&logger$7.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(r,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const n=this._getRunningEvent(t),r=n.run(e)>0;return this._checkRunningEvents(n),r}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(e),this._checkRunningEvents(n),this}removeListener(t,e){return this.off(t,e)}}class Contract extends BaseContract{}class BaseX{constructor(t){defineReadOnly(this,"alphabet",t),defineReadOnly(this,"base",t.length),defineReadOnly(this,"_alphabetMap",{}),defineReadOnly(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=arrayify$1(t);if(0===e.length)return"";let n=[0];for(let t=0;t<e.length;++t){let r=e[t];for(let t=0;t<n.length;++t)r+=n[t]<<8,n[t]=r%this.base,r=r/this.base|0;for(;r>0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let t=0;0===e[t]&&t<e.length-1;++t)r+=this._leader;for(let t=n.length-1;t>=0;--t)r+=this.alphabet[n[t]];return r}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let r=this._alphabetMap[t[n]];if(void 0===r)throw new Error("Non-base"+this.base+" character");let i=r;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return arrayify$1(new Uint8Array(e.reverse()))}}new BaseX("abcdefghijklmnopqrstuvwxyz234567");const Base58=new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),version$4="sha2/5.6.1";function sha256(t){return"0x"+hash.sha256().update(arrayify$1(t)).digest("hex")}new Logger$1(version$4);const version$3$1="networks/5.6.3",logger$6=new Logger$1(version$3$1);function isRenetworkable(t){return t&&"function"==typeof t.renetwork}function ethDefaultProvider(t){const e=function(e,n){null==n&&(n={});const r=[];if(e.InfuraProvider&&"-"!==n.infura)try{r.push(new e.InfuraProvider(t,n.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==n.etherscan)try{r.push(new e.EtherscanProvider(t,n.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==n.alchemy)try{r.push(new e.AlchemyProvider(t,n.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==n.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,n.pocket);o.network&&-1===i.indexOf(o.network.name)&&r.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==n.cloudflare)try{r.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==n.ankr)try{r.push(new e.AnkrProvider(t,n.ankr))}catch(t){}if(0===r.length)return null;if(e.FallbackProvider){let i=1;return null!=n.quorum?i=n.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(r,i)}return r[0]};return e.renetwork=function(t){return ethDefaultProvider(t)},e}function etcDefaultProvider(t,e){const n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return n.renetwork=function(e){return etcDefaultProvider(t,e)},n}const homestead={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ethDefaultProvider("homestead")},ropsten={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ethDefaultProvider("ropsten")},classicMordor={chainId:63,name:"classicMordor",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/mordor","classicMordor")},networks={unspecified:{chainId:0,name:"unspecified"},homestead:homestead,mainnet:homestead,morden:{chainId:2,name:"morden"},ropsten:ropsten,testnet:ropsten,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ethDefaultProvider("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ethDefaultProvider("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ethDefaultProvider("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:classicMordor,classicTestnet:classicMordor,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ethDefaultProvider("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ethDefaultProvider("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function getNetwork(t){if(null==t)return null;if("number"==typeof t){for(const e in networks){const n=networks[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=networks[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=networks[t.name];if(!e)return"number"!=typeof t.chainId&&logger$6.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&logger$6.throwArgumentError("network chainId mismatch","network",t);let n=t._defaultProvider||null;return null==n&&e._defaultProvider&&(n=isRenetworkable(e._defaultProvider)?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:n}}function decode$1(t){t=atob(t);const e=[];for(let n=0;n<t.length;n++)e.push(t.charCodeAt(n));return arrayify$1(e)}function encode$1(t){t=arrayify$1(t);let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const version$2$1="web/5.6.1";var __awaiter$3=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function getUrl(t,e){return __awaiter$3(this,void 0,void 0,(function*(){null==e&&(e={});const n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client");const r=yield fetch(t,n),i=yield r.arrayBuffer(),o={};return r.headers.forEach?r.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):r.headers.keys().forEach((t=>{o[t.toLowerCase()]=r.headers.get(t)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:arrayify$1(new Uint8Array(i))}}))}var __awaiter$2=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$5=new Logger$1(version$2$1);function staller(t){return new Promise((e=>{setTimeout(e,t)}))}function bodyify(t,e){if(null==t)return null;if("string"==typeof t)return t;if(isBytesLike(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return toUtf8String(t)}catch(t){}return hexlify$1(t)}return t}function _fetchData(t,e,n){const r="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;logger$5.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;logger$5.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof t&&!!t.errorPassThrough,s={};let u=null;const l={method:"GET"};let c=!1,h=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||logger$5.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(h=t.timeout),t.headers)for(const e in t.headers)s[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(c=!0);if(l.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&logger$5.throwError("basic authentication requires a secure https url",Logger$1.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;s.authorization={key:"Authorization",value:"Basic "+encode$1(toUtf8Bytes(e))}}null!=t.skipFetchSetup&&(l.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:decode$1(d[2])};let e=t.body;return n&&(e=n(t.body,t)),Promise.resolve(e)}catch(t){logger$5.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(l.method="POST",l.body=e,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(s).forEach((t=>{const e=s[t];p[e.key]=e.value})),l.headers=p;const g=function(){let t=null;return{promise:new Promise((function(e,n){h&&(t=setTimeout((()=>{null!=t&&(t=null,n(logger$5.makeError("timeout",Logger$1.errors.TIMEOUT,{requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),m=function(){return __awaiter$2(this,void 0,void 0,(function*(){for(let t=0;t<r;t++){let e=null;try{if(e=yield getUrl(u,l),t<r)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===l.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let n=!0;if(i&&(n=yield i(t,u)),n){let n=0;const r=e.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):o*parseInt(String(Math.random()*Math.pow(2,t))),yield staller(n);continue}}}catch(t){e=t.response,null==e&&(g.cancel(),logger$5.throwError("missing response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,serverError:t,url:u}))}let s=e.body;if(c&&304===e.statusCode?s=null:!a&&(e.statusCode<200||e.statusCode>=300)&&(g.cancel(),logger$5.throwError("bad response",Logger$1.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:bodyify(s,e.headers?e.headers["content-type"]:null),requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,url:u})),n)try{const t=yield n(s,e);return g.cancel(),t}catch(n){if(n.throttleRetry&&t<r){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield staller(e);continue}}g.cancel(),logger$5.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(s,e.headers?e.headers["content-type"]:null),error:n,requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,url:u})}return g.cancel(),s}return logger$5.throwError("failed response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(l.body,p["content-type"]),requestMethod:l.method,url:u})}))}();return Promise.race([g.promise,m])}function fetchJson(t,e,n){let r=null;if(null!=e){r=toUtf8Bytes(e);const n="string"==typeof t?{url:t}:shallowCopy(t);if(n.headers){0!==Object.keys(n.headers).filter((t=>"content-type"===t.toLowerCase())).length||(n.headers=shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};t=n}return _fetchData(t,r,((t,e)=>{let r=null;if(null!=t)try{r=JSON.parse(toUtf8String(t))}catch(e){logger$5.throwError("invalid JSON",Logger$1.errors.SERVER_ERROR,{body:t,error:e})}return n&&(r=n(r,e)),r}))}function poll(t,e){return e||(e={}),null==(e=shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{a()&&r(new Error("timeout"))}),e.timeout));const s=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)a()&&n(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&r(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){a()&&r(t)}))}()}))}for(var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={},z=0;z<ALPHABET.length;z++){var x=ALPHABET.charAt(z);if(void 0!==ALPHABET_MAP[x])throw new TypeError(x+" is ambiguous");ALPHABET_MAP[x]=z}function polymodStep(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function prefixChk(t){for(var e=1,n=0;n<t.length;++n){var r=t.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+t+")";e=polymodStep(e)^r>>5}for(e=polymodStep(e),n=0;n<t.length;++n){var i=t.charCodeAt(n);e=polymodStep(e)^31&i}return e}function encode(t,e,n){if(n=n||90,t.length+7+e.length>n)throw new TypeError("Exceeds length limit");var r=prefixChk(t=t.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=t+"1",o=0;o<e.length;++o){var a=e[o];if(a>>5!=0)throw new Error("Non 5-bit word");r=polymodStep(r)^a,i+=ALPHABET.charAt(a)}for(o=0;o<6;++o)r=polymodStep(r);for(r^=1,o=0;o<6;++o){var s=r>>5*(5-o)&31;i+=ALPHABET.charAt(s)}return i}function __decode(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var n=t.toLowerCase(),r=t.toUpperCase();if(t!==n&&t!==r)return"Mixed-case string "+t;var i=(t=n).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),a=t.slice(i+1);if(a.length<6)return"Data too short";var s=prefixChk(o);if("string"==typeof s)return s;for(var u=[],l=0;l<a.length;++l){var c=a.charAt(l),h=ALPHABET_MAP[c];if(void 0===h)return"Unknown character "+c;s=polymodStep(s)^h,l+6>=a.length||u.push(h)}return 1!==s?"Invalid checksum for "+t:{prefix:o,words:u}}function decodeUnsafe(){var t=__decode.apply(null,arguments);if("object"==typeof t)return t}function decode(t){var e=__decode.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)}function convert(t,e,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=e)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}function toWordsUnsafe(t){var e=convert(t,8,5,!0);if(Array.isArray(e))return e}function toWords(t){var e=convert(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)}function fromWordsUnsafe(t){var e=convert(t,5,8,!1);if(Array.isArray(e))return e}function fromWords(t){var e=convert(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}var bech32={decodeUnsafe:decodeUnsafe,decode:decode,encode:encode,toWordsUnsafe:toWordsUnsafe,toWords:toWords,fromWordsUnsafe:fromWordsUnsafe,fromWords:fromWords};const version$1$1="providers/5.6.8",logger$4=new Logger$1(version$1$1);class Formatter{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:Formatter.allowNull(this.accessList.bind(this),null),blockHash:Formatter.allowNull(o,null),blockNumber:Formatter.allowNull(s,null),transactionIndex:Formatter.allowNull(s,null),confirmations:Formatter.allowNull(s,null),from:e,gasPrice:Formatter.allowNull(n),maxPriorityFeePerGas:Formatter.allowNull(n),maxFeePerGas:Formatter.allowNull(n),gasLimit:n,to:Formatter.allowNull(e,null),value:n,nonce:s,data:i,r:Formatter.allowNull(this.uint256),s:Formatter.allowNull(this.uint256),v:Formatter.allowNull(s),creates:Formatter.allowNull(e,null),raw:Formatter.allowNull(i)},t.transactionRequest={from:Formatter.allowNull(e),nonce:Formatter.allowNull(s),gasLimit:Formatter.allowNull(n),gasPrice:Formatter.allowNull(n),maxPriorityFeePerGas:Formatter.allowNull(n),maxFeePerGas:Formatter.allowNull(n),to:Formatter.allowNull(e),value:Formatter.allowNull(n),data:Formatter.allowNull((t=>this.data(t,!0))),type:Formatter.allowNull(s),accessList:Formatter.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:e,topics:Formatter.arrayOf(o),data:i,logIndex:s,blockHash:o},t.receipt={to:Formatter.allowNull(this.address,null),from:Formatter.allowNull(this.address,null),contractAddress:Formatter.allowNull(e,null),transactionIndex:s,root:Formatter.allowNull(a),gasUsed:n,logsBloom:Formatter.allowNull(i),blockHash:o,transactionHash:o,logs:Formatter.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Formatter.allowNull(s,null),cumulativeGasUsed:n,effectiveGasPrice:Formatter.allowNull(n),status:Formatter.allowNull(s),type:u},t.block={hash:Formatter.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Formatter.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Formatter.allowNull(e),extraData:i,transactions:Formatter.allowNull(Formatter.arrayOf(o)),baseFeePerGas:Formatter.allowNull(n)},t.blockWithTransactions=shallowCopy(t.block),t.blockWithTransactions.transactions=Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:Formatter.allowNull(r,void 0),toBlock:Formatter.allowNull(r,void 0),blockHash:Formatter.allowNull(o,void 0),address:Formatter.allowNull(e,void 0),topics:Formatter.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:Formatter.allowNull(s),blockHash:Formatter.allowNull(o),transactionIndex:s,removed:Formatter.allowNull(this.boolean.bind(this)),address:e,data:Formatter.allowFalsish(i,"0x"),topics:Formatter.arrayOf(o),transactionHash:o,logIndex:s},t}accessList(t){return accessListify(t||[])}number(t){return"0x"===t?0:BigNumber$1.from(t).toNumber()}type(t){return"0x"===t||null==t?0:BigNumber$1.from(t).toNumber()}bigNumber(t){return BigNumber$1.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),isHexString$1(t))?t.toLowerCase():logger$4.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return getAddress(t)}callAddress(t){if(!isHexString$1(t,32))return null;const e=getAddress(hexDataSlice(t,12));return e===AddressZero?null:e}contractAddress(t){return getContractAddress(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||isHexString$1(t))return hexValue(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return 32!==hexDataLength(n)?logger$4.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(null==t)return null;const e=BigNumber$1.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!isHexString$1(t))throw new Error("invalid uint256");return hexZeroPad$1(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const n=null!=t._difficulty?t._difficulty:t.difficulty,r=Formatter.check(e,t);return r._difficulty=null==n?null:BigNumber$1.from(n),r}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return Formatter.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&BigNumber$1.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=Formatter.check(this.formats.transaction,t);if(null!=t.chainId){let n=t.chainId;isHexString$1(n)&&(n=BigNumber$1.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),isHexString$1(n)&&(n=BigNumber$1.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return parse(t)}receiptLog(t){return Formatter.check(this.formats.receiptLog,t)}receipt(t){const e=Formatter.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=BigNumber$1.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&logger$4.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):logger$4.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&logger$4.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return Formatter.check(this.formats.filter,t)}filterLog(t){return Formatter.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const r in t)try{const i=t[r](e[r]);void 0!==i&&(n[r]=i)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}static allowNull(t,e){return function(n){return null==n?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach((function(e){n.push(t(e))})),n}}}var __awaiter$1=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$3$1=new Logger$1(version$1$1),MAX_CCIP_REDIRECTS=10;function checkTopic(t){return null==t?"null":(32!==hexDataLength(t)&&logger$3$1.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function serializeTopics(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[checkTopic(t)]=!0}));const n=Object.keys(e);return n.sort(),n.join("|")}return checkTopic(t)})).join("&")}function deserializeTopics(t){return""===t?[]:t.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}))}function getEventTag(t){if("string"==typeof t){if(32===hexDataLength(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+serializeTopics(t);if(ForkEvent.isForkEvent(t))throw logger$3$1.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+serializeTopics(t.topics||[])}throw new Error("invalid event - "+t)}function getTime(){return(new Date).getTime()}function stall(t){return new Promise((e=>{setTimeout(e,t)}))}const PollableEvents=["block","network","pending","poll"];class Event{constructor(t,e,n){defineReadOnly(this,"tag",t),defineReadOnly(this,"listener",e),defineReadOnly(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],n=deserializeTopics(t[2]),r={};return n.length>0&&(r.topics=n),e&&"*"!==e&&(r.address=e),r}pollable(){return this.tag.indexOf(":")>=0||PollableEvents.indexOf(this.tag)>=0}}const coinInfos={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bytes32ify(t){return hexZeroPad$1(BigNumber$1.from(t).toHexString(),32)}function base58Encode(t){return Base58.encode(concat([t,hexDataSlice(sha256(sha256(t)),0,4)]))}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i"),matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString(t,e){try{return toUtf8String(_parseBytes(t,e))}catch(t){}return null}function _parseBytes(t,e){if("0x"===t)return null;const n=BigNumber$1.from(hexDataSlice(t,e,e+32)).toNumber(),r=BigNumber$1.from(hexDataSlice(t,n,n+32)).toNumber();return hexDataSlice(t,n+32,n+32+r)}function getIpfsLink(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):logger$3$1.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function numPad(t){const e=arrayify$1(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function bytesPad(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function encodeBytes(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(null),n+=32;for(let r=0;r<t.length;r++){const i=arrayify$1(t[r]);e[r]=numPad(n),e.push(numPad(i.length)),e.push(bytesPad(i)),n+=32+32*Math.ceil(i.length/32)}return hexConcat(e)}class Resolver{constructor(t,e,n,r){defineReadOnly(this,"provider",t),defineReadOnly(this,"name",n),defineReadOnly(this,"address",t.formatter.address(e)),defineReadOnly(this,"_resolvedAddress",r)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>BigNumber$1.from(t).eq(1))).catch((t=>{if(t.code===Logger$1.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return __awaiter$1(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:hexConcat([t,namehash(this.name),e||"0x"])};let r=!1;(yield this.supportsWildcard())&&(r=!0,n.data=hexConcat(["0x9061b923",encodeBytes([dnsEncode(this.name),n.data])]));try{let t=yield this.provider.call(n);return arrayify$1(t).length%32==4&&logger$3$1.throwError("resolver threw error",Logger$1.errors.CALL_EXCEPTION,{transaction:n,data:t}),r&&(t=_parseBytes(t,0)),t}catch(t){if(t.code===Logger$1.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return __awaiter$1(this,void 0,void 0,(function*(){const n=yield this._fetch(t,e);return null!=n?_parseBytes(n,0):null}))}_getAddress(t,e){const n=coinInfos[String(t)];if(null==n&&logger$3$1.throwError(`unsupported coin type: ${t}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===n.ilk)return this.provider.formatter.address(e);const r=arrayify$1(e);if(null!=n.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return base58Encode(concat([[n.p2pkh],"0x"+t[2]]))}}if(null!=n.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return base58Encode(concat([[n.p2sh],"0x"+t[2]]))}}if(null!=n.prefix){const t=r[1];let e=r[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&r.length===2+t&&t>=1&&t<=75){const t=bech32.toWords(r.slice(2));return t.unshift(e),bech32.encode(n.prefix,t)}}return null}getAddress(t){return __awaiter$1(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||t===HashZero?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===Logger$1.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",bytes32ify(t));if(null==e||"0x"===e)return null;const n=this._getAddress(t,e);return null==n&&logger$3$1.throwError("invalid or unsupported coin data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n}))}getAvatar(){return __awaiter$1(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let n=0;n<matchers.length;n++){const r=e.match(matchers[n]);if(null==r)continue;const i=r[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:getIpfsLink(e)};case"erc721":case"erc1155":{const n="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),a=(r[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),u=hexZeroPad$1(BigNumber$1.from(a[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:hexConcat(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=BigNumber$1.from(yield this.provider.call({to:s,data:hexConcat(["0x00fdd58e",hexZeroPad$1(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const l={to:this.provider.formatter.address(a[0]),data:hexConcat([n,u])};let c=_parseString(yield this.provider.call(l),0);if(null==c)return null;t.push({type:"metadata-url-base",content:c}),"erc1155"===i&&(c=c.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:c})),c.match(/^ipfs:/i)&&(c=getIpfsLink(c)),t.push({type:"metadata-url",content:c});const h=yield fetchJson(c);if(!h)return null;t.push({type:"metadata",content:JSON.stringify(h)});let f=h.image;if("string"!=typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(matcherIpfs))return null;t.push({type:"url-ipfs",content:f}),f=getIpfsLink(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return __awaiter$1(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+Base58.encode("0x"+e[1])}const n=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const t=parseInt(n[3],16);if(n[4].length===2*t)return"ipns://"+Base58.encode("0x"+n[1])}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return"bzz://"+r[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"},e=encode$1("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]));return"sia://"+e}return logger$3$1.throwError("invalid or unsupported content hash data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return __awaiter$1(this,void 0,void 0,(function*(){let e=toUtf8Bytes(t);e=concat([bytes32ify(64),bytes32ify(e.length),e]),e.length%32!=0&&(e=concat([e,hexZeroPad$1("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",hexlify$1(e));return null==n||"0x"===n?null:toUtf8String(n)}))}}let defaultFormatter=null,nextPollId=1;class BaseProvider extends Provider{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),defineReadOnly(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=getStatic(new.target,"getNetwork")(t);e?(defineReadOnly(this,"_network",e),this.emit("network",e,null)):logger$3$1.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return __awaiter$1(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||logger$3$1.throwError("no network detected",Logger$1.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:defineReadOnly(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return poll((()=>this._ready().then((t=>t),(t=>{if(t.code!==Logger$1.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==defaultFormatter&&(defaultFormatter=new Formatter),defaultFormatter}static getNetwork(t){return getNetwork(null==t?"homestead":t)}ccipReadFetch(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<n.length;t++){const e=n[t],a=e.replace("{sender}",r).replace("{data}",i),s=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:r}),u=yield fetchJson({url:a,errorPassThrough:!0},s,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return logger$3$1.throwError(`response not found during CCIP fetch: ${l}`,Logger$1.errors.SERVER_ERROR,{url:e,errorMessage:l});o.push(l)}return logger$3$1.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,Logger$1.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(t){return __awaiter$1(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const n=yield e;if(getTime()-n.respTime<=t)return n.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=getTime(),n=resolveProperties({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=getTime();return(t=BigNumber$1.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=n,n.catch((t=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return __awaiter$1(this,void 0,void 0,(function*(){const t=nextPollId++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)logger$3$1.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",logger$3$1.makeError("network block skew detected",Logger$1.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let t=this._emitted.block+1;t<=n;t++)this.emit("block",t);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&n-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((t=>{switch(t.type){case"tx":{const n=t.hash;let r=this.getTransactionReceipt(n).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(r);break}case"filter":if(!t._inflight){t._inflight=!0;const r=t.filter;r.fromBlock=t._lastBlockNumber+1,r.toBlock=n,r.toBlock-this._maxFilterBlockRange>r.fromBlock&&(r.fromBlock=r.toBlock-this._maxFilterBlockRange);const i=this.getLogs(r).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(r,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=n,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return __awaiter$1(this,void 0,void 0,(function*(){return logger$3$1.throwError("provider does not support network detection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return __awaiter$1(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield stall(0),this._network;const n=logger$3$1.makeError("underlying network changed",Logger$1.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=getTime();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=getTime(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,n||0,null)}))}_waitForTransaction(t,e,n,r){return __awaiter$1(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((t=>{t()})),!1)},l=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,l),a.push((()=>{this.removeListener(t,l)})),r){let n=r.startBlock,i=null;const l=a=>__awaiter$1(this,void 0,void 0,(function*(){s||(yield stall(1e3),this.getTransactionCount(r.from).then((c=>__awaiter$1(this,void 0,void 0,(function*(){if(!s){if(c<=r.nonce)n=a;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=n-3,i<r.startBlock&&(i=r.startBlock));i<=a;){if(s)return;const n=yield this.getBlockWithTransactions(i);for(let i=0;i<n.transactions.length;i++){const a=n.transactions[i];if(a.hash===t)return;if(a.from===r.from&&a.nonce===r.nonce){if(s)return;const n=yield this.waitForTransaction(a.hash,e);if(u())return;let i="replaced";return a.data===r.data&&a.to===r.to&&a.value.eq(r.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(logger$3$1.makeError("transaction was replaced",Logger$1.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:t,receipt:n}))}}i++}}s||this.once("block",l)}}))),(t=>{s||this.once("block",l)})))}));if(s)return;this.once("block",l),a.push((()=>{this.removeListener("block",l)}))}if("number"==typeof n&&n>0){const t=setTimeout((()=>{u()||o(logger$3$1.makeError("timeout exceeded",Logger$1.errors.TIMEOUT,{timeout:n}))}),n);t.unref&&t.unref(),a.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return __awaiter$1(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return BigNumber$1.from(t)}catch(e){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getBalance",n);try{return BigNumber$1.from(r)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:t})}}))}getTransactionCount(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getTransactionCount",n);try{return BigNumber$1.from(r).toNumber()}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:t})}}))}getCode(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getCode",n);try{return hexlify$1(r)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:t})}}))}getStorageAt(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield resolveProperties({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then((t=>hexValue(t)))}),i=yield this.perform("getStorageAt",r);try{return hexlify$1(i)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:t})}}))}_wrapTransaction(t,e,n){if(null!=e&&32!==hexDataLength(e))throw new Error("invalid response - sendTransaction");const r=t;return null!=e&&t.hash!==e&&logger$3$1.throwError("Transaction hash mismatch from Provider.sendTransaction.",Logger$1.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=(e,r)=>__awaiter$1(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==r&&(r=0),0!==e&&null!=n&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const o=yield this._waitForTransaction(t.hash,e,r,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&logger$3$1.throwError("transaction failed",Logger$1.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),r}sendTransaction(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>hexlify$1(t))),n=this.formatter.transaction(t);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,t,r)}catch(t){throw t.transaction=n,t.transactionHash=n.hash,t}}))}_getTransactionRequest(t){return __awaiter$1(this,void 0,void 0,(function*(){const e=yield t,n={};return["from","to"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?BigNumber$1.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?hexlify$1(t):null)))})),this.formatter.transactionRequest(yield resolveProperties(n))}))}_getFilter(t){return __awaiter$1(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((n=>{null!=t[n]&&(e[n]=t[n])})),["fromBlock","toBlock"].forEach((n=>{null!=t[n]&&(e[n]=this._getBlockTag(t[n]))})),this.formatter.filter(yield resolveProperties(e))}))}_call(t,e,n){return __awaiter$1(this,void 0,void 0,(function*(){n>=MAX_CCIP_REDIRECTS&&logger$3$1.throwError("CCIP read exceeded maximum redirections",Logger$1.errors.SERVER_ERROR,{redirects:n,transaction:t});const r=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(n>=0&&"latest"===e&&null!=r&&"0x556f1830"===i.substring(0,10)&&hexDataLength(i)%32==4)try{const o=hexDataSlice(i,4),a=hexDataSlice(o,0,32);BigNumber$1.from(a).eq(r)||logger$3$1.throwError("CCIP Read sender did not match",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const s=[],u=BigNumber$1.from(hexDataSlice(o,32,64)).toNumber(),l=BigNumber$1.from(hexDataSlice(o,u,u+32)).toNumber(),c=hexDataSlice(o,u+32);for(let e=0;e<l;e++){const n=_parseString(c,32*e);null==n&&logger$3$1.throwError("CCIP Read contained corrupt URL string",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s.push(n)}const h=_parseBytes(o,64);BigNumber$1.from(hexDataSlice(o,100,128)).isZero()||logger$3$1.throwError("CCIP Read callback selector included junk",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=hexDataSlice(o,96,100),d=_parseBytes(o,128),p=yield this.ccipReadFetch(t,h,s);null==p&&logger$3$1.throwError("CCIP Read disabled or provided no URLs",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const g={to:r,data:hexConcat([f,encodeBytes([p,d])])};return this._call(g,e,n+1)}catch(t){if(t.code===Logger$1.errors.SERVER_ERROR)throw t}try{return hexlify$1(i)}catch(n){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:n})}}))}call(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield resolveProperties({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)}))}estimateGas(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield resolveProperties({transaction:this._getTransactionRequest(t)}),n=yield this.perform("estimateGas",e);try{return BigNumber$1.from(n)}catch(t){return logger$3$1.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:n,error:t})}}))}_getAddress(t){return __awaiter$1(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&logger$3$1.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&logger$3$1.throwError("ENS name not configured",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let n=-128;const r={includeTransactions:!!e};if(isHexString$1(t,32))r.blockHash=t;else try{r.blockTag=yield this._getBlockTag(t),isHexString$1(r.blockTag)&&(n=parseInt(r.blockTag.substring(2),16))}catch(e){logger$3$1.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return poll((()=>__awaiter$1(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",r);if(null==t)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(e){let e=null;for(let n=0;n<t.transactions.length;n++){const r=t.transactions[n];if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}}const n=this.formatter.blockWithTransactions(t);return n.transactions=n.transactions.map((t=>this._wrapTransaction(t))),n}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return poll((()=>__awaiter$1(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return poll((()=>__awaiter$1(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return r}))),{oncePoll:this})}))}getLogs(t){return __awaiter$1(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield resolveProperties({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);return n.forEach((t=>{null==t.removed&&(t.removed=!1)})),Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return __awaiter$1(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return __awaiter$1(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&logger$3$1.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return __awaiter$1(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const n=yield this._getResolver(e,"getResolver");if(null!=n){const r=new Resolver(this,n,t);return e===t||(yield r.supportsWildcard())?r:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return __awaiter$1(this,void 0,void 0,(function*(){null==e&&(e="ENS");const n=yield this.getNetwork();n.ensAddress||logger$3$1.throwError("network does not support ENS",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name});try{const e=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+namehash(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return __awaiter$1(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(isHexString$1(t))throw e}"string"!=typeof t&&logger$3$1.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return __awaiter$1(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e,"lookupAddress");if(null==n)return null;const r=_parseString(yield this.call({to:n,data:"0x691f3431"+namehash(e).substring(2)}),0);return(yield this.resolveName(r))!=t?null:r}))}getAvatar(t){return __awaiter$1(this,void 0,void 0,(function*(){let e=null;if(isHexString$1(t)){const n=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;e=new Resolver(this,r,n);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==Logger$1.errors.CALL_EXCEPTION)throw t}try{const t=_parseString(yield this.call({to:r,data:"0x691f3431"+namehash(n).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==Logger$1.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const n=yield e.getAvatar();return null==n?null:n.url}))}perform(t,e){return logger$3$1.throwError(t+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,n){const r=new Event(getEventTag(t),e,n);return this._events.push(r),this._startEvent(r),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,r=[],i=getEventTag(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),n=!0,!t.once||(r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),n}listenerCount(t){if(!t)return this._events.length;let e=getEventTag(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=getEventTag(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const n=[];let r=!1,i=getEventTag(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!r||(r=!0,n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const n=getEventTag(t);this._events=this._events.filter((t=>t.tag!==n||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var __awaiter=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const logger$2$1=new Logger$1(version$1$1),errorGas=["call","estimateGas"];function spelunk(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const n=isHexString$1(t.data)?t.data:null;if(!e||n)return{message:t.message,data:n}}if("object"==typeof t){for(const n in t){const r=spelunk(t[n],e);if(r)return r}return null}if("string"==typeof t)try{return spelunk(JSON.parse(t),e)}catch(t){}return null}function checkError(t,e,n){const r=n.transaction||n.signedTransaction;if("call"===t){const t=spelunk(e,!0);if(t)return t.data;logger$2$1.throwError("missing revert data in call exception; Transaction reverted without a reason string",Logger$1.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if("estimateGas"===t){let n=spelunk(e.body,!1);null==n&&(n=spelunk(e,!1)),n&&logger$2$1.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:t,transaction:r,error:e})}let i=e.message;throw e.code===Logger$1.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&logger$2$1.throwError("insufficient funds for intrinsic transaction cost",Logger$1.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/nonce (is )?too low/i)&&logger$2$1.throwError("nonce has already been used",Logger$1.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&logger$2$1.throwError("replacement fee too low",Logger$1.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/only replay-protected/i)&&logger$2$1.throwError("legacy pre-eip-155 transactions not supported",Logger$1.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:r}),errorGas.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&logger$2$1.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}function timer(t){return new Promise((function(e){setTimeout(e,t)}))}function getResult(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function getLowerCase(t){return t?t.toLowerCase():t}const _constructorGuard$4={};class JsonRpcSigner extends Signer{constructor(t,e,n){if(super(),t!==_constructorGuard$4)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");defineReadOnly(this,"provider",e),null==n&&(n=0),"string"==typeof n?(defineReadOnly(this,"_address",this.provider.formatter.address(n)),defineReadOnly(this,"_index",null)):"number"==typeof n?(defineReadOnly(this,"_index",n),defineReadOnly(this,"_address",null)):logger$2$1.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return logger$2$1.throwError("cannot alter JSON-RPC Signer connection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UncheckedJsonRpcSigner(_constructorGuard$4,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&logger$2$1.throwError("unknown account #"+this._index,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=shallowCopy(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const n=shallowCopy(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>__awaiter(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&logger$2$1.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),resolveProperties({tx:resolveProperties(t),sender:e}).then((({tx:e,sender:n})=>{null!=e.from?e.from.toLowerCase()!==n&&logger$2$1.throwArgumentError("from address mismatch","transaction",t):e.from=n;const r=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((t=>t),(t=>checkError("sendTransaction",t,r)))}))}signTransaction(t){return logger$2$1.throwError("signing transactions is unsupported",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return __awaiter(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield poll((()=>__awaiter(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(n);if(null!==t)return this.provider._wrapTransaction(t,n,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=n,t}}))}signMessage(t){return __awaiter(this,void 0,void 0,(function*(){const e="string"==typeof t?toUtf8Bytes(t):t,n=yield this.getAddress();return yield this.provider.send("personal_sign",[hexlify$1(e),n.toLowerCase()])}))}_legacySignMessage(t){return __awaiter(this,void 0,void 0,(function*(){const e="string"==typeof t?toUtf8Bytes(t):t,n=yield this.getAddress();return yield this.provider.send("eth_sign",[n.toLowerCase(),hexlify$1(e)])}))}_signTypedData(t,e,n){return __awaiter(this,void 0,void 0,(function*(){const r=yield TypedDataEncoder.resolveNames(t,e,n,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(r.domain,e,r.value))])}))}unlock(t){return __awaiter(this,void 0,void 0,(function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))}}class UncheckedJsonRpcSigner extends JsonRpcSigner{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const allowedTransactionKeys={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class JsonRpcProvider extends BaseProvider{constructor(t,e){let n=e;null==n&&(n=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(n),t||(t=getStatic(this.constructor,"defaultUrl")()),defineReadOnly(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(shallowCopy(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return __awaiter(this,void 0,void 0,(function*(){yield timer(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=getStatic(this.constructor,"getNetwork");try{return e(BigNumber$1.from(t).toNumber())}catch(e){return logger$2$1.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return logger$2$1.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new JsonRpcSigner(_constructorGuard$4,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:deepCopy(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(r&&this._cache[t])return this._cache[t];const i=fetchJson(this.connection,JSON.stringify(n),getResult).then((t=>(this.emit("debug",{action:"response",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:n,provider:this}),t}));return r&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase(e.address),e.blockTag]];case"getCode":return["eth_getCode",[getLowerCase(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase(e.address),hexZeroPad$1(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[getStatic(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[getStatic(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=getLowerCase(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return __awaiter(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&BigNumber$1.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=shallowCopy(e)).transaction=shallowCopy(t),delete e.transaction.type)}}const n=this.prepareRequest(t,e);null==n&&logger$2$1.throwError(t+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(n){return checkError(t,n,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;let r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return timer(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){r()}),0),null;t.send("eth_uninstallFilter",[n])})).catch((t=>{}))}(),n})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=shallowCopy(allowedTransactionKeys);if(e)for(const t in e)e[t]&&(n[t]=!0);checkProperties(t,n);const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const n=hexValue(BigNumber$1.from(t[e]));"gasLimit"===e&&(e="gas"),r[e]=n})),["from","to","data"].forEach((function(e){null!=t[e]&&(r[e]=hexlify$1(t[e]))})),t.accessList&&(r.accessList=accessListify(t.accessList)),r}}const logger$1$1=new Logger$1(version$1$1);let _nextId=1;function buildWeb3LegacyFetcher(t,e){const n="Web3LegacyFetcher";return function(t,r){const i={method:t,params:r,id:_nextId++,jsonrpc:"2.0"};return new Promise(((t,r)=>{this.emit("debug",{action:"request",fetcher:n,request:deepCopy(i),provider:this}),e(i,((e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:n,error:e,request:i,provider:this}),r(e);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const t=new Error(o.error.message);return t.code=o.error.code,t.data=o.error.data,r(t)}t(o.result)}))}))}}function buildEip1193Fetcher(t){return function(e,n){null==n&&(n=[]);const r={method:e,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:deepCopy(r),provider:this}),t.request(r).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:t,provider:this}),t}))}}class Web3Provider extends JsonRpcProvider{constructor(t,e){null==t&&logger$1$1.throwArgumentError("missing provider","provider",t);let n=null,r=null,i=null;"function"==typeof t?(n="unknown:",r=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),i=t,t.request?(""===n&&(n="eip-1193:"),r=buildEip1193Fetcher(t)):t.sendAsync?r=buildWeb3LegacyFetcher(t,t.sendAsync.bind(t)):t.send?r=buildWeb3LegacyFetcher(t,t.send.bind(t)):logger$1$1.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,e),defineReadOnly(this,"jsonRpcFetchFunc",r),defineReadOnly(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const version$j="units/5.6.1",logger$q=new Logger$1(version$j),names$1=["wei","kwei","mwei","gwei","szabo","finney","ether"];function parseUnits$1(t,e){if("string"!=typeof t&&logger$q.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=names$1.indexOf(e);-1!==t&&(e=3*t)}return parseFixed$1(t,null!=e?e:18)}function _optionalChain$3$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}class Transaction{constructor({blockchain:t,from:e,to:n,value:r,api:i,method:o,params:a,sent:s,confirmed:u,failed:l}){this.blockchain=t,this.from=e,this.to=n,this.value=_optionalChain$3$1([Transaction,"access",t=>t.bigNumberify,"call",e=>e(r,t),"optionalAccess",t=>t.toString,"call",t=>t()]),this.api=i,this.method=o,this.params=a,this.sent=s,this.confirmed=u,this.failed=l,this._confirmed=!1,this._failed=!1}async prepare({wallet:t}){this.from=await t.account()}static bigNumberify(t,e){return"number"==typeof t?parseUnits$1(t.toString(),CONSTANTS$4[e].DECIMALS):t&&t.toString?BigNumber$1.from(t.toString()):t}getContractArguments(){let t=this.getContract().interface.fragments.find((t=>t.name==this.method));if(this.params instanceof Array)return this.params;if(this.params instanceof Object)return t.inputs.map((t=>this.params[t.name]));throw"Contract params have wrong type!"}getContract(){return new Contract(this.to,this.api)}async getData(){return(await this.getContract().populateTransaction[this.method].apply(null,this.getContractArguments())).data}confirmation(){return this._confirmed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.confirmed;this.confirmed=()=>{n&&n(this),t(this)}}))}failure(){return this._failed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.failed;this.failed=()=>{n&&n(this),t(this)}}))}}const sendTransaction$2=async({transaction:t,wallet:e})=>{t=new Transaction(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new Web3Provider(window.ethereum,"any"),r=n.getSigner(0);return await executeSubmit$2({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t},executeSubmit$2=({transaction:t,provider:e,signer:n})=>t.method?submitContractInteraction$2({transaction:t,signer:n,provider:e}):submitSimpleTransfer$2({transaction:t,signer:n}),submitContractInteraction$2=({transaction:t,signer:e,provider:n})=>{let r=new Contract(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:Transaction.bigNumberify(t.value,t.blockchain)})},submitSimpleTransfer$2=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:Transaction.bigNumberify(t.value,t.blockchain)});function _optionalChain$2$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}class Web3Wallet{static __initStatic(){this.info={name:"Web3 Wallet",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 446.42 376.77'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M408.69,171.4H473.4V107.77a46.55,46.55,0,0,0-46.55-46.55H73.53A46.55,46.55,0,0,0,27,107.77v65.09H62.7L89.56,146a9.46,9.46,0,0,1,5.73-2.73h0l.41,0h78.59a47.2,47.2,0,1,1,82.63,39.56q-1.41,1.71-3,3.31t-3.31,3a47.21,47.21,0,0,1-76.31-26.9H100.21L73.34,189.07a9.43,9.43,0,0,1-5.73,2.73h0l-.41,0h-.07l-.48,0H27v74H55.83l18.25-18.24a9.39,9.39,0,0,1,5.73-2.74h0l.41,0h29.9a47.16,47.16,0,1,1,0,19H84.72L66.48,282.11a9.42,9.42,0,0,1-5.72,2.74h0l-.39,0H27V319H83.29a4,4,0,0,1,.49,0h.06l.41,0h0A9.41,9.41,0,0,1,90,321.78l28,28h57.66a47.2,47.2,0,1,1,81.48,40.9c-.6.67-1.22,1.32-1.86,2s-1.3,1.26-2,1.86a47.22,47.22,0,0,1-77.65-25.73H114.09a9.5,9.5,0,0,1-3.09-.52l-.08,0-.29-.11-.17-.07-.19-.08-.27-.12-.08,0a9.38,9.38,0,0,1-2.55-1.81l-28-28H27v53.46A46.55,46.55,0,0,0,73.53,438H426.86a46.55,46.55,0,0,0,46.54-46.55V327.82H408.69a78.22,78.22,0,0,1-78.21-78.21h0A78.22,78.22,0,0,1,408.69,171.4Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M247.91,359.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,359.29Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M246.55,152.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,152.71Z' transform='translate(-26.98 -61.22)'/%3E%3Ccircle class='cls-1' cx='129.39' cy='193.15' r='25.99'/%3E%3Cpath class='cls-1' d='M409.17,190h-.48a59.57,59.57,0,0,0-59.57,59.57h0a59.57,59.57,0,0,0,59.57,59.57h.48a59.58,59.58,0,0,0,59.58-59.57h0A59.58,59.58,0,0,0,409.17,190Zm14.45,90.61h-31l8.88-32.53a15.5,15.5,0,1,1,13.29,0Z' transform='translate(-26.98 -61.22)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.install=this.constructor.info.install,this.sendTransaction=t=>sendTransaction$2({wallet:this,transaction:t})}async account(){return(await this.accounts())[0]}async accounts(){if(!_optionalChain$2$1([window,"optionalAccess",t=>t.ethereum]))return[];return await window.ethereum.request({method:"eth_accounts"})}async connect(){if(!_optionalChain$2$1([window,"optionalAccess",t=>t.ethereum]))return[];return await window.ethereum.request({method:"eth_requestAccounts"})}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),window.ethereum.on("accountsChanged",n);break;case"accounts":n=t=>e(t),window.ethereum.on("accountsChanged",n);break;case"network":n=t=>e(Blockchain.findById(t).name),window.ethereum.on("chainChanged",n);break;case"disconnect":n=e,window.ethereum.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":window.ethereum.removeListener("accountsChanged",e);break;case"network":window.ethereum.removeListener("chainChanged",e);break;case"disconnect":window.ethereum.removeListener("disconnect",e)}return e}async connectedTo(t){const e=Blockchain.findById(await window.ethereum.request({method:"eth_chainId"}));return t?t===e.name:e.name}addNetwork(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);window.ethereum.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}switchTo(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}async sign(t){await this.account();let e=new Web3Provider(window.ethereum,"any").getSigner(0);return await e.signMessage(t)}}Web3Wallet.__initStatic();class Coinbase extends Web3Wallet{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://wallet.coinbase.com"}}}Coinbase.__initStatic();class MetaMask extends Web3Wallet{static __initStatic(){this.info={name:"MetaMask",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 485.93 450.56'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D.cls-2%7Bfill:%23e27726;stroke:%23e27726;%7D.cls-10,.cls-11,.cls-2,.cls-3,.cls-4,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9%7Bstroke-linecap:round;stroke-linejoin:round;%7D.cls-3%7Bfill:%23e37725;stroke:%23e37725;%7D.cls-4%7Bfill:%23d6c0b3;stroke:%23d6c0b3;%7D.cls-5%7Bfill:%23243447;stroke:%23243447;%7D.cls-6%7Bfill:%23cd6328;stroke:%23cd6328;%7D.cls-7%7Bfill:%23e37525;stroke:%23e37525;%7D.cls-8%7Bfill:%23f6851f;stroke:%23f6851f;%7D.cls-9%7Bfill:%23c1ae9e;stroke:%23c1ae9e;%7D.cls-10%7Bfill:%23171717;stroke:%23171717;%7D.cls-11%7Bfill:%23763e1a;stroke:%23763e1a;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M247.91,356.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,356.29Z' transform='translate(-7.97 -21.33)'/%3E%3Cpath class='cls-1' d='M246.55,149.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,149.71Z' transform='translate(-7.97 -21.33)'/%3E%3Ccircle class='cls-1' cx='148.4' cy='230.05' r='25.99'/%3E%3Cpolygon class='cls-2' points='461.28 0.5 272.06 141.03 307.05 58.12 461.28 0.5'/%3E%3Cpolygon class='cls-3' points='24.46 0.5 212.16 142.37 178.88 58.12 24.46 0.5'/%3E%3Cpolygon class='cls-3' points='393.2 326.26 342.81 403.47 450.63 433.14 481.63 327.97 393.2 326.26'/%3E%3Cpolygon class='cls-3' points='4.49 327.97 35.3 433.14 143.13 403.47 92.73 326.26 4.49 327.97'/%3E%3Cpolygon class='cls-3' points='137.04 195.8 107 241.25 214.06 246.01 210.26 130.96 137.04 195.8'/%3E%3Cpolygon class='cls-3' points='348.7 195.8 274.53 129.63 272.06 246.01 378.94 241.25 348.7 195.8'/%3E%3Cpolygon class='cls-3' points='143.13 403.47 207.41 372.09 151.88 328.73 143.13 403.47'/%3E%3Cpolygon class='cls-3' points='278.34 372.09 342.81 403.47 333.87 328.73 278.34 372.09'/%3E%3Cpolygon class='cls-4' points='342.81 403.47 278.34 372.09 283.47 414.12 282.9 431.81 342.81 403.47'/%3E%3Cpolygon class='cls-4' points='143.13 403.47 203.03 431.81 202.65 414.12 207.41 372.09 143.13 403.47'/%3E%3Cpolygon class='cls-5' points='203.98 300.97 150.35 285.18 188.2 267.88 203.98 300.97'/%3E%3Cpolygon class='cls-5' points='281.76 300.97 297.55 267.88 335.58 285.18 281.76 300.97'/%3E%3Cpolygon class='cls-6' points='143.13 403.47 152.25 326.26 92.73 327.97 143.13 403.47'/%3E%3Cpolygon class='cls-6' points='333.68 326.26 342.81 403.47 393.2 327.97 333.68 326.26'/%3E%3Cpolygon class='cls-6' points='378.94 241.25 272.06 246.01 281.95 300.97 297.74 267.88 335.77 285.18 378.94 241.25'/%3E%3Cpolygon class='cls-6' points='150.35 285.18 188.39 267.88 203.98 300.97 214.06 246.01 107 241.25 150.35 285.18'/%3E%3Cpolygon class='cls-7' points='107 241.25 151.88 328.73 150.35 285.18 107 241.25'/%3E%3Cpolygon class='cls-7' points='335.77 285.18 333.87 328.73 378.94 241.25 335.77 285.18'/%3E%3Cpolygon class='cls-7' points='214.06 246.01 203.98 300.97 216.53 365.82 219.38 280.43 214.06 246.01'/%3E%3Cpolygon class='cls-7' points='272.06 246.01 266.93 280.24 269.21 365.82 281.95 300.97 272.06 246.01'/%3E%3Cpolygon class='cls-8' points='281.95 300.97 269.21 365.82 278.34 372.09 333.87 328.73 335.77 285.18 281.95 300.97'/%3E%3Cpolygon class='cls-8' points='150.35 285.18 151.88 328.73 207.41 372.09 216.53 365.82 203.98 300.97 150.35 285.18'/%3E%3Cpolygon class='cls-9' points='282.9 431.81 283.47 414.12 278.72 409.94 207.02 409.94 202.65 414.12 203.03 431.81 143.13 403.47 164.05 420.58 206.45 450.06 279.29 450.06 321.89 420.58 342.81 403.47 282.9 431.81'/%3E%3Cpolygon class='cls-10' points='278.34 372.09 269.21 365.82 216.53 365.82 207.41 372.09 202.65 414.12 207.02 409.94 278.72 409.94 283.47 414.12 278.34 372.09'/%3E%3Cpolygon class='cls-11' points='469.27 150.16 485.43 72.57 461.28 0.5 278.34 136.28 348.7 195.8 448.16 224.9 470.22 199.23 460.71 192.38 475.92 178.5 464.13 169.37 479.35 157.77 469.27 150.16'/%3E%3Cpolygon class='cls-11' points='0.5 72.57 16.66 150.16 6.39 157.77 21.61 169.37 10.01 178.5 25.22 192.38 15.71 199.23 37.58 224.9 137.04 195.8 207.41 136.28 24.46 0.5 0.5 72.57'/%3E%3Cpolygon class='cls-8' points='448.16 224.9 348.7 195.8 378.94 241.25 333.87 328.73 393.2 327.97 481.63 327.97 448.16 224.9'/%3E%3Cpolygon class='cls-8' points='137.04 195.8 37.58 224.9 4.49 327.97 92.73 327.97 151.88 328.73 107 241.25 137.04 195.8'/%3E%3Cpolygon class='cls-8' points='272.06 246.01 278.34 136.28 307.24 58.12 178.88 58.12 207.41 136.28 214.06 246.01 216.34 280.62 216.53 365.82 269.21 365.82 269.59 280.62 272.06 246.01'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://metamask.io/download.html"}}}function _optionalChain$1$2(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}MetaMask.__initStatic();const sendTransaction$1=async({transaction:t,wallet:e})=>{if(t=new Transaction(t),await t.prepare({wallet:e}),0==await e.connectedTo(t.blockchain))throw{code:"WRONG_NETWORK"};return await executeSubmit$1({transaction:t,wallet:e}).then((async e=>{if(!e)throw"Submitting transaction failed!";{let n=Blockchain.findByName(t.blockchain);t.id=e,t.url=n.explorerUrlFor({transaction:t}),t.sent&&t.sent(t);let r=await retrieveTransaction(e,t.blockchain);t.nonce=r.nonce,r?r.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t.id=e.replacement.hash,t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t.id=e.replacement.hash,t._failed=!0,t.failed&&t.failed(t,e)):(t._failed=!0,t.failed&&t.failed(t,e))})):(t._failed=!0,console.log("Error retrieving transaction"),t.failed&&t.failed(t,"Error retrieving transaction"))}})),t},retrieveTransaction=async(t,e)=>{let n;let r=1;for(n=await provider(e).getTransaction(t);r<=120&&!n;)n=await provider(e).getTransaction(t),await new Promise((t=>setTimeout(t,5e3))),r++;return n},executeSubmit$1=({transaction:t,wallet:e})=>t.method?submitContractInteraction$1({transaction:t,wallet:e}):submitSimpleTransfer$1({transaction:t,wallet:e}),submitContractInteraction$1=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:_optionalChain$1$2([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),data:await t.getData(),gas:(await estimate(t)).toString(),gasPrice:(await provider(t.blockchain).getGasPrice()).toString()}),submitSimpleTransfer$1=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:_optionalChain$1$2([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),gas:(await estimate(t)).toString(),gasPrice:(await provider(t.blockchain).getGasPrice()).toString()});function _optionalChain$5(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}const setConnectedInstance$1=t=>{window._connectedWalletConnectInstance=t},getConnectedInstance$1=()=>window._connectedWalletConnectInstance;class WalletConnect{static __initStatic(){this.info={name:"WalletConnect",logo:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 500 500' style='enable-background:new 0 0 500 500;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%235991CD;%7D%0A%3C/style%3E%3Cg id='Page-1'%3E%3Cg id='walletconnect-logo-alt'%3E%3Cpath id='WalletConnect' class='st0' d='M102.7,162c81.5-79.8,213.6-79.8,295.1,0l9.8,9.6c4.1,4,4.1,10.5,0,14.4L374,218.9 c-2,2-5.3,2-7.4,0l-13.5-13.2c-56.8-55.7-149-55.7-205.8,0l-14.5,14.1c-2,2-5.3,2-7.4,0L91.9,187c-4.1-4-4.1-10.5,0-14.4 L102.7,162z M467.1,229.9l29.9,29.2c4.1,4,4.1,10.5,0,14.4L362.3,405.4c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L252,311.9 c-1-1-2.7-1-3.7,0h0l-95.5,93.5c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L3.4,273.6c-4.1-4-4.1-10.5,0-14.4l29.9-29.2 c4.1-4,10.7-4,14.8,0l95.5,93.5c1,1,2.7,1,3.7,0c0,0,0,0,0,0l95.5-93.5c4.1-4,10.7-4,14.8,0c0,0,0,0,0,0l95.5,93.5 c1,1,2.7,1,3.7,0l95.5-93.5C456.4,225.9,463,225.9,467.1,229.9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=WalletConnect.instance||this.newWalletConnectInstance(),this.sendTransaction=t=>sendTransaction$1({wallet:this,transaction:t})}newWalletConnectInstance(){let t=new _WalletConnect$WalletConnectClient({bridge:"https://bridge.walletconnect.org",qrcodeModal:_WalletConnect$QRCodeModal});return t.on("connect",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("session_update",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("disconnect",((t,e)=>{if(setConnectedInstance$1(void 0),t)throw t})),t.on("modal_closed",(()=>{setConnectedInstance$1(void 0),this.connector=void 0})),t}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){try{window.localStorage.removeItem("walletconnect"),null==this.connector&&(this.connector=this.newWalletConnectInstance()),this.connector.connected&&(await this.connector.killSession(),setConnectedInstance$1(void 0),this.connector=this.newWalletConnectInstance());const{accounts:e,chainId:n}=await this.connector.connect({chainId:_optionalChain$5([t,"optionalAccess",t=>t.chainId])});return e instanceof Array&&e.length&&setConnectedInstance$1(this),this.connectedAccounts=e,this.connectedChainId=n,e}catch(t){return console.log("WALLETCONNECT ERROR",t),[]}}async connectedTo(t){let e=await this.connector.sendCustomRequest({method:"eth_chainId"});const n=Blockchain.findById(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}addNetwork(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}on(t,e){let n;switch(t){case"account":n=(t,n)=>{const{accounts:r}=n.params[0];r instanceof Array&&e(r[0])},this.connector.on("session_update",n);break;case"accounts":n=(t,n)=>{const{accounts:r}=n.params[0];e(r)},this.connector.on("session_update",n);break;case"network":n=(t,n)=>{const{chainId:r}=n.params[0];r&&e(Blockchain.findByNetworkId(r).name)},this.connector.on("session_update",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":case"network":this.connector.off("session_update");break;case"disconnect":this.connector.off("disconnect")}}async sign(t){let e=await this.account();var n=[toUtf8Bytes(t),e];return await this.connector.signPersonalMessage(n)}}WalletConnect.__initStatic();const sendTransaction=async({transaction:t,wallet:e})=>{t=new Transaction(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new Web3Provider(e.connector,"any"),r=n.getSigner(0);return await executeSubmit({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Blockchain.findByName(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t},executeSubmit=({transaction:t,provider:e,signer:n})=>t.method?submitContractInteraction({transaction:t,signer:n,provider:e}):submitSimpleTransfer({transaction:t,signer:n}),submitContractInteraction=({transaction:t,signer:e,provider:n})=>{let r=new Contract(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:Transaction.bigNumberify(t.value,t.blockchain)})},submitSimpleTransfer=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:Transaction.bigNumberify(t.value,t.blockchain)}),setConnectedInstance=t=>{window._connectedWalletLinkInstance=t},getConnectedInstance=()=>window._connectedWalletLinkInstance;class WalletLink{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://www.coinbase.com/wallet"}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=WalletLink.instance||this.newWalletLinkInstance(),this.sendTransaction=t=>sendTransaction({wallet:this,transaction:t})}newWalletLinkInstance(){return new _CoinbaseWalletSdk$CoinbaseWalletSDK({}).makeWeb3Provider()}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){(await this.connector._relayProvider()).setConnectDisabled(!1);let e=await this.connector.enable();return e instanceof Array&&e.length&&setConnectedInstance(this),this.connectedAccounts=e,this.connectedChainId=await this.connector.getChainId(),e}async connectedTo(t){let e=await this.connector.getChainId();const n=Blockchain.findByNetworkId(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);this.connector.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}addNetwork(t){return new Promise(((e,n)=>{const r=Blockchain.findByName(t);this.connector.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),this.connector.on("accountsChanged",n);break;case"accounts":n=t=>e(t),this.connector.on("accountsChanged",n);break;case"network":n=t=>e(Blockchain.findById(t).name),this.connector.on("chainChanged",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":this.connector.removeListener("accountsChanged",e);break;case"network":this.connector.removeListener("chainChanged",e);break;case"disconnect":this.connector.removeListener("disconnect",e)}return e}async sign(t){await this.account();let e=new Web3Provider(this.connector,"any").getSigner(0);return await e.signMessage(t)}}WalletLink.__initStatic();const wallets={MetaMask:MetaMask,Coinbase:Coinbase,Web3Wallet:Web3Wallet,WalletConnect:WalletConnect,WalletLink:WalletLink},instances={},getWalletClass=function(){return getConnectedInstance$1()?wallets.WalletConnect:getConnectedInstance()?wallets.WalletLink:"object"==typeof window.ethereum&&window.ethereum.isMetaMask?wallets.MetaMask:"object"==typeof window.ethereum&&(window.ethereum.isCoinbaseWallet||window.ethereum.isWalletLink)?wallets.Coinbase:void 0!==window.ethereum?wallets.Web3Wallet:void 0},getWallet=function(){const t=getWalletClass(),e=instances[t];return getConnectedInstance$1()?getConnectedInstance$1():getConnectedInstance()?getConnectedInstance():e||(t?(instances[t]=new t,instances[t]):void 0)};var SelectWalletDialog=function(t){var e=_slicedToArray(react.useState(!1),2),n=e[0],r=e[1],i=react.useContext(NavigateStackContext).navigate,o=getWallet();react.useEffect((function(){_asyncToGenerator(regenerator.mark((function e(){var n;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=5;break}return e.next=3,o.accounts();case 3:null!=(n=e.sent)&&0!=n.length||(i("ConnectingWallet"),t.connect(o));case 5:case"end":return e.stop()}}),e)})))()}),[o]);var a=[wallets.WalletConnect,wallets.WalletLink];o&&a.unshift(o.constructor);var s=a.map((function(e,n){var r=e.info.name;return"WalletConnect"==r&&(r="via WalletConnect"),react.createElement("div",{key:n,className:"PaddingBottomXS"},react.createElement("button",{className:"Card small",title:"Connect ".concat(r),onClick:function(){return function(e){var n=new e;t.setWallet(n),i("ConnectingWallet"),t.connect(n)}(e)}},react.createElement("div",{className:"CardImage square"},react.createElement("img",{className:"transparent",src:e.info.logo})),react.createElement("div",{className:"CardBody"},react.createElement("div",{className:"CardBodyWrapper PaddingLeftXS"},react.createElement("h2",{className:"CardText FontWeightBold"},r)))))}));return react.createElement(Dialog,{header:react.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM TextLeft"},react.createElement("h1",{className:"LineHeightL FontSizeL"},"Select a wallet")),body:react.createElement("div",{className:"PaddingBottomS PaddingLeftS PaddingRightS"},s),footer:react.createElement("div",{className:"PaddingBottomS"},react.createElement("button",{className:"FontSizeS FontWeightBold TextButton",onClick:function(){return r(!n)}},react.createElement("strong",{className:"Opacity05"},"What is a wallet?")),n&&react.createElement("p",{className:"PaddingLeftM PaddingRightM"},"Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))})},ConnectStack=function(t){var e=react.useContext(ClosableContext),n=e.open,r=e.close,i=_slicedToArray(react.useState(),2),o=i[0],a=i[1],s=_slicedToArray(react.useState(),2),u=s[0],l=s[1],c=function(e){e.connect().then(_asyncToGenerator(regenerator.mark((function n(){var i;return regenerator.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.accounts();case 2:(i=n.sent)instanceof Array&&i.length>0&&(t.autoClose&&r(),t.resolve&&t.resolve({wallet:e,account:i[0],accounts:i}));case 4:case"end":return n.stop()}}),n)})))).catch((function(e){a(!1),4001!=(null==e?void 0:e.code)&&(-32002!=(null==e?void 0:e.code)?t.reject&&t.reject(e):a(!0))}))};return react.useEffect((function(){var t=getWallet();t&&l(t)}),[]),react.useEffect((function(){_asyncToGenerator(regenerator.mark((function e(){var n;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=5;break}return e.next=3,u.accounts();case 3:(n=e.sent)instanceof Array&&n.length>0&&t.resolve&&t.resolve({wallet:u,account:n[0],accounts:n});case 5:case"end":return e.stop()}}),e)})))()}),[u]),react.createElement(ReactDialogStack,{open:n,close:r,start:"SelectWallet",container:t.container,document:t.document,dialogs:{SelectWallet:react.createElement(SelectWalletDialog,{setWallet:l,connect:c}),ConnectingWallet:react.createElement(ConnectingWalletDialog,{wallet:u,pending:o,connect:c})}})},ensureDocument=function(t){return void 0===t?window.document:t};function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var ErrorContext=react.createContext(),ErrorGraphic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAGHCAMAAADx+xo1AAAAeFBMVEVHcEweFhTcf2s2ERDegW3egWw1EBDbg2s1EBD/h4fSfWM1EBDTf2T/h4fTf2Q1EBDVgmYvEhI8EhJWLCV1QTWWV0a3Y07Ab1fOd1/PfWLXhWjUlH3/h4e8pZ3br12tub3ppI6hyNaY1Or+u6nx3mbO6/b14M3///8kXrGSAAAAEXRSTlMADSI/RWdshpqipsDG1OPj/QoziQ8AAB1ySURBVHja7J3bkqIwEIYBQTwLEUxgvNiqqZp5/zdczkFDEhCiPaa/q11WZcf+6f67ExgHQRAEQRAEQbSszmTlIPZyJmTvINayJoRsHMRaigRwdh3EVlZFAlg7iLVsCgFgArAXl6AFtJo1VgC72ROCUwCLKSvA2UHshZQK2KxXK9ddFaAdtI0N6YHlwD7ccy/6OBO0EHe97zSAHYGl1PV/TXAmZDV7rABWsyG4KmQzG+wBrAbjbzdr7ACsZoXxtxq3ir9bdIPrzX6/wUpgG5UBwGmQvdyNg3GHiH3cZQBcILYQtxgEr9elAzhjBrCcd94m4HolfkEQBGHBruRQc+qIWnKBaJjurc1nlR9bfn5xmuJk1VldC4agQeCNCIJpE1hGuQ1xHd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RU5ErkJggg==";function _createSuper(t){var e=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(t);if(e){var i=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ErrorBoundary=function(t){_inherits(n,react.Component);var e=_createSuper(n);function n(t){return _classCallCheck(this,n),e.call(this,t)}return _createClass(n,[{key:"componentDidCatch",value:function(t,e){this.props.setError(t)}},{key:"render",value:function(){return this.props.children}}]),n}(),ErrorProvider=function(t){var e=_slicedToArray(react.useState(t.error),2),n=e[0],r=e[1],i=_slicedToArray(react.useState(!0),2),o=i[0],a=i[1],s=function(e){r(e),t.errorCallback&&t.errorCallback(e)},u=function(){a(!1),setTimeout(t.unmount,300)};return n?(console.log(n),react.createElement(ReactDialog,{container:t.container,close:u,open:o},react.createElement("div",{className:"Dialog ReactDialogAnimation"},react.createElement("div",{className:"DialogHeader"},react.createElement("div",{className:"PaddingTopS PaddingLeftS PaddingRightS"})),react.createElement("div",{className:"DialogBody TextCenter"},react.createElement("div",{className:"GraphicWrapper PaddingTopS"},react.createElement("img",{className:"Graphic",src:ErrorGraphic})),react.createElement("h1",{className:"LineHeightL Text FontSizeL PaddingTopS FontWeightBold"},"Oops, Something Went Wrong"),react.createElement("div",{className:"Text PaddingTopS PaddingBottomS PaddingLeftS PaddingRightS"},react.createElement("div",{className:"PaddingLeftS PaddingRightS"},react.createElement("pre",{className:"ErrorSnippetText"},n.toString())),react.createElement("div",{className:"PaddingTopS PaddingBottomS"},react.createElement("strong",{className:"FontSizeM PaddingTopS"},"If this keeps happening, please report it.")))),react.createElement("div",{className:"DialogFooter"},react.createElement("div",{className:"PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"},react.createElement("button",{className:"ButtonPrimary",onClick:u},"Try again")))))):react.createElement(ErrorContext.Provider,{value:{setError:s,errorCallback:t.errorCallback}},react.createElement(ErrorBoundary,{setError:s},t.children))},AlertStyle=function(t){return"\n\n .Alert {\n background: rgba(0,0,0,0.08);\n border-radius: 7px;\n font-weight: 500;\n padding: 8px;\n }\n "},BlockchainLogoStyle=function(t){return"\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n "},ButtonCircularStyle=function(){return"\n\n .ButtonCircular {\n border-radius: 9999px;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n "},ButtonPrimaryStyle=function(t){return"\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(t.colors.primary,";\n border-radius: 13px;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 21px;\n font-weight: 400;\n line-height: 45px;\n height: 58px;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n padding: 7px 0;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(t.colors.buttonText,";\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ")},CardStyle=function(t){return"\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 13px;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n min-height: 76px;\n padding: 16px 10px;\n width: 100%;\n }\n\n .Card.Row {\n border-radius: 0;\n margin-bottom: 0;\n box-shadow: none;\n min-height: 69px;\n padding: 7px 21px;\n border-top: 1px solid rgba(0,0,0,0.05);\n }\n\n .Card.Row .CardText {\n font-size: 19px;\n line-height: 40px;\n }\n\n .CardTokenSymbol {\n width: 40%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .CardTokenName {\n text-align: right;\n opacity: 0.5;\n width: 60%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .Card.Row .CardTokenName .CardText {\n font-size: 17px;\n }\n\n .Card.Row .CardImage {\n width: 40px;\n }\n\n .Card.Row .CardImage img {\n height: 30px;\n width: 30px;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 8px 8px;\n margin: 0;\n }\n\n .CardImage.small {\n width: 27px;\n }\n\n .CardImage.small img {\n height: 27px;\n width: 27px;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 7px;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 58px;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 27px;\n padding-left: 10px;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 9999px;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 45px;\n position: relative;\n vertical-align: middle;\n width: 45px;\n }\n\n .CardImage.square img {\n border-radius: 0;\n }\n\n .CardImage img.transparent {\n border: none;\n background: none;\n box-shadow: none;\n }\n \n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 15px;\n color: rgb(150,150,150);\n line-height: 20px;\n }\n \n .CardText, a .CardText {\n color: ".concat(t.colors.text,";\n flex: 1;\n font-size: 21px;\n line-height: 26px;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText.small, .CardText.small small {\n font-size: 18px;\n color: rgb(150,150,150);\n line-height: 20px;\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ")},DialogStyle=function(t){return"\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .contained .ReactDialog {\n position: absolute;\n height: 100%;\n min-height: 100%;\n width: 100%;\n min-width: 100%;\n }\n\n .contained .ReactDialogBackground {\n position: absolute;\n }\n\n .contained .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n top: 0;\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.2);\n border-radius: 13px;\n background: rgb(248,248,248);\n }\n\n @media (max-width: 450px) {\n\n .Dialog {\n border-radius: 0;\n width: 100%;\n }\n }\n\n @media (orientation: portrait) and (max-width: 800px) {\n\n .ReactDialogAnimation {\n width: 100%;\n }\n\n .ReactDialog {\n height: 100%;\n min-height: 100%;\n }\n\n .ReactDialogStack {\n align-items: flex-end;\n }\n\n .Dialog {\n align-content: stretch;\n border-radius: 13px;\n border-top-radius: 13px;\n display: flex;\n flex-direction: column;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogAnimation {\n margin-bottom: -100px !important;\n top: inherit !important;\n position: relative;\n transition: opacity 0.4s ease, margin-bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n margin-bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n align-items: flex-end;\n }\n }\n\n .DialogBody {\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\n }\n\n .DialogHeader {\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n min-height: 54px;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 48px;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\n height: 48px;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n line-height: 24px;\n min-height: 32px;\n position: relative;\n text-align: center;\n }\n\n "},FontStyle=function(t){return"\n\n *, div, div * {\n font-family: ".concat(t.fontFamily,";\n }\n\n .FontSizeS {\n font-size: 16px;\n }\n\n .FontSizeM {\n font-size: 19px;\n }\n\n .FontSizeL {\n font-size: 23px;\n }\n\n .FontSizeXL {\n font-size: 32px;\n }\n\n .FontSizeXXL {\n font-size: 42px;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ")},GraphicStyle=function(){return"\n\n .GraphicWrapper {\n display: block;\n }\n\n .Graphic {\n width: 50%;\n position: relative;\n }\n "},HeightStyle=function(){return"\n\n .MaxHeight {\n max-height: 320px;\n overflow-y: auto;\n }\n "},IconStyle=function(t){return"\n\n .Icon {\n fill : ".concat(t.colors.icons,";\n stroke : ").concat(t.colors.icons,";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .AlertIcon {\n height: 20px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 20px;\n fill: #e42626;\n stroke: transparent;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(t.colors.buttonText,";\n stroke : ").concat(t.colors.buttonText,";\n }\n\n .Loading {\n border: 3px solid ").concat(t.colors.primary,";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ")},ImageStyle=function(t){return"\n\n .MaxAmountImage {\n display: inline-block;\n padding-right: 6px;\n }\n \n .MaxAmountImage img {\n height: 16px;\n width: 16px;\n position: relative;\n top: 3px;\n }\n "},InputStyle=function(t){return"\n\n .Input {\n background: none;\n border: 1px solid transparent;\n margin: 0;\n outline: none !important;\n padding: 0 0 0 14px;\n width: 100%;\n }\n\n .Input::placeholder {\n color: rgb(210,210,210);\n }\n \n "},LinkStyle=function(t){return"\n\n .Link {\n color: ".concat(t.colors.primary,";\n cursor: pointer;\n text-decoration: none;\n }\n\n .Link:hover {\n filter: brightness(0.8);\n }\n\n .Link:active {\n filter: brightness(1.0);\n }\n ")},LoadingTextStyle=function(t){return"\n\n .LoadingText {\n color: ".concat(t.colors.buttonText,";\n display: inline-block;\n text-decoration: none;\n }\n\n @keyframes blink {\n 0% { opacity: .2; }\n 20% { opacity: 1; }\n 100% { opacity: .2; }\n }\n \n .LoadingText .dot {\n animation-name: blink;\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n }\n \n .LoadingText .dot:nth-child(2) {\n animation-delay: .2s;\n }\n \n .LoadingText .dot:nth-child(3) {\n animation-delay: .4s;\n }\n ")},OpacityStyle=function(t){return"\n\n .Opacity05 {\n opacity: 0.5;\n }\n "},PaddingStyle=function(){return"\n\n .PaddingTopXS {\n padding-top: 3px;\n }\n\n .PaddingRightXS {\n padding-right: 3px;\n }\n\n .PaddingBottomXS {\n padding-bottom: 3px;\n }\n\n .PaddingLeftXS {\n padding-left: 3px; \n }\n\n .PaddingTopS {\n padding-top: 13px;\n }\n\n .PaddingRightS {\n padding-right: 13px;\n }\n\n .PaddingBottomS {\n padding-bottom: 13px;\n }\n\n .PaddingLeftS {\n padding-left: 13px; \n }\n\n .PaddingTopM {\n padding-top: 19px;\n }\n\n .PaddingRightM {\n padding-right: 19px;\n }\n\n .PaddingBottomM {\n padding-bottom: 19px;\n }\n\n .PaddingLeftM {\n padding-left: 19px; \n }\n\n .PaddingTopL {\n padding-top: 29px;\n }\n\n .PaddingRightL {\n padding-right: 29px;\n }\n\n .PaddingBottomL {\n padding-bottom: 29px;\n }\n\n .PaddingLeftL {\n padding-left: 29px; \n }\n "},PoweredByStyle=function(t){return'\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 3px;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .contained .PoweredByWrapper {\n position: absolute;\n }\n\n .PoweredByLink {\n color: white;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;\n font-size: 14px;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 8px;\n opacity: 0.5;\n text-decoration: none;\n text-shadow: black 0 0 2px;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n }\n '},RangeSliderStyle=function(t){return"\n\n .rangeslider {\n margin: 20px 0;\n position: relative;\n background: #e6e6e6;\n -ms-touch-action: none;\n touch-action: none;\n }\n\n .rangeslider,\n .rangeslider__fill {\n display: block;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .rangeslider__handle {\n outline: none;\n cursor: pointer;\n display: inline-block;\n position: absolute;\n border-radius: 50%;\n background-color: "+t.colors.primary+";\n border: 1px solid white;\n box-shadow: 0 0 8px rgba(0,0,0,0.1);\n }\n\n .rangeslider__handle:hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n\n .rangeslider__handle:active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.3);\n }\n\n .rangeslider__active {\n opacity: 1;\n }\n\n .rangeslider__handle-tooltip {\n display: none;\n }\n\n .rangeslider-horizontal {\n height: 12px;\n border-radius: 10px;\n }\n\n .rangeslider-horizontal .rangeslider__fill {\n height: 100%;\n background-color: "+t.colors.primary+";\n border-radius: 10px;\n top: 0;\n }\n .rangeslider-horizontal .rangeslider__handle {\n width: 18px;\n height: 18px;\n border-radius: 30px;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n\n\n .rangeslider-horizontal .rangeslider__handle-tooltip {\n top: -55px;\n }\n\n "},ResetStyle=function(){return"\n\n html, body, div, span, applet, object, iframe,\n h1, h2, h3, h4, h5, h6, p, blockquote, pre,\n a, abbr, acronym, address, big, cite, code,\n del, dfn, em, img, ins, kbd, q, s, samp,\n small, strike, strong, sub, sup, tt, var,\n b, u, i, center,\n dl, dt, dd, ol, ul, li,\n fieldset, form, label, legend,\n table, caption, tbody, tfoot, thead, tr, th, td,\n article, aside, canvas, details, embed, \n figure, figcaption, footer, header, hgroup, \n menu, nav, output, ruby, section, summary,\n time, mark, audio, video {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n text-align: inherit;\n vertical-align: baseline;\n }\n\n article, aside, details, figcaption, figure, \n footer, header, hgroup, menu, nav, section {\n display: block;\n }\n\n body {\n line-height: 1;\n }\n\n ol, ul {\n list-style: none;\n }\n\n blockquote, q {\n quotes: none;\n }\n\n blockquote:before, blockquote:after,\n q:before, q:after {\n content: '';\n content: none;\n }\n \n table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n * {\n box-sizing: border-box;\n }\n\n button {\n border: 0;\n background: none;\n outline: none;\n }\n\n "},SearchStyle=function(t){return"\n\n .Search {\n border-radius: 13px;\n border: 1px solid rgba(0,0,0,0.2);\n outline: none !important;\n color: ".concat(t.colors.text,";\n font-size: 19px;\n padding: 13px;\n width: 100%;\n }\n\n .Search::placeholder {\n color: rgb(180,180,180);\n } \n\n .Search:focus, .Search:focus-visible {\n border: 1px solid ").concat(t.colors.primary,";\n }\n\n ")},SkeletonStyle=function(){return"\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n "},TableStyle=function(t){return"\n\n .Table {\n border-collapse: separate;\n border-radius: 7px;\n border-style: hidden;\n border: 1px solid rgba(0,0,0,0.1);\n width: 100%;\n }\n\n .Table tr.small td {\n font-size: 14px;\n }\n\n .Table tr td {\n border-bottom: 1px solid rgba(0,0,0,0.1);\n word-break: break-all;\n }\n \n .Table tr:last-child td {\n border-bottom: none;\n }\n \n .Table tr td {\n padding: 8px 15px;\n text-align: left;\n }\n \n .Table tr td:first-child {\n width: 30%\n }\n\n .Table tr td:last-child {\n width: 70%\n }\n \n .Table .TableSubTitle {\n font-weight: 300;\n opacity: 0.7;\n }\n\n .Table tr td:last-child {\n font-weight: 500;\n }\n "},TextButtonStyle=function(t){return"\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(t.colors.primary,"\n }\n\n .TextButton:hover * {\n opacity: 1.0;\n }\n ")},TextStyle=function(t){return"\n\n * {\n color: ".concat(t.colors.text,";\n }\n\n h1, h2, h3, h4, h5, h6 {\n display: block;\n }\n\n .Text {\n font-size: 16px;\n line-height: 24px\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .LineHeightL {\n line-height: 32px;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 19px;\n border: 8px solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 15px;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ")},TokenAmountStyle=function(){return"\n \n .TokenAmountRow {\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n\n .TokenAmountCell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .TokenSymbolCell {\n }\n "},TokenImageStyle=function(t){return"\n\n .TokenImage img {\n border-radius: 9999px;\n border: 1px solid white;\n background: white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 45px;\n position: relative;\n vertical-align: middle;\n width: 45px;\n }\n\n .TokenImage.medium img {\n height: 93px;\n width: 93px;\n }\n "},TooltipStyle=function(t){return"\n\n .Tooltip {\n background: ".concat(t.colors.primary,";\n border-radius: 10px;\n color: ").concat(t.colors.buttonText,";\n padding: 10px 13px;\n position: relative;\n box-shadow: 0 0 8px rgba(0,0,0,0.2);\n }\n\n .TooltipArrowUp {\n border-bottom: 10px solid ").concat(t.colors.primary,";\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n height: 0; \n left: 12px;\n position: absolute;\n top: -8px;\n width: 0; \n }\n ")},styleRenderer=function(t){var e,n;return t={colors:Object.assign({primary:"#ea357a",buttonText:"#ffffff",icons:"#000000",text:"#212529"},(null===(e=t)||void 0===e?void 0:e.colors)||{}),fontFamily:(null===(n=t)||void 0===n?void 0:n.fontFamily)||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},[ResetStyle(),DialogStyle(),ButtonCircularStyle(),ButtonPrimaryStyle(t),CardStyle(t),PoweredByStyle(),GraphicStyle(),SkeletonStyle(),TokenAmountStyle(),TextStyle(t),FontStyle(t),IconStyle(t),OpacityStyle(),PaddingStyle(),HeightStyle(),LoadingTextStyle(t),RangeSliderStyle(t),InputStyle(),TextButtonStyle(t),ImageStyle(),BlockchainLogoStyle(),SearchStyle(t),TokenImageStyle(),AlertStyle(),TableStyle(),LinkStyle(t),TooltipStyle(t)].join("")},createRoot,m=reactDom;createRoot=m.createRoot;const insideContainerClass="ReactShadowDOMInsideContainer";function createInsideContainer({document:t,shadow:e,style:n,classes:r=[]}){const i=t.createElement("div");if(i.setAttribute("class",[insideContainerClass].concat(r).join(" ")),e.appendChild(i),n&&n.length){const r=t.createElement("style");r.type="text/css",r.appendChild(t.createTextNode(n)),e.appendChild(r)}return i}const outsideContainerClass="ReactShadowDOMOutsideContainer";function createOutsideContainer({document:t,element:e,style:n}){const r=t.createElement("div");return r.setAttribute("class",outsideContainerClass),r.setAttribute("style",n),e.appendChild(r),r}function createShadow(t){let e;return e=t.shadowRoot?t.shadowRoot:t.attachShadow({mode:"open"}),e}function trimStyle(t){return t.replace(/\s*[\r\n]\s*/g,"")}function unmount({insideRoot:t,outsideContainer:e}){t.unmount(),e.remove()}function ReactShadowDOM({document:t,element:e,content:n,outsideStyle:r="",insideStyle:i="",insideClasses:o=[]}){const a=createOutsideContainer({document:t,element:e,style:trimStyle(r)}),s=createInsideContainer({document:t,shadow:createShadow(a),style:trimStyle(i),classes:o});"function"==typeof n&&(n=n(s));const u=createRoot(s);return u.render(n),{content:n,unmount:()=>unmount({insideRoot:u,outsideContainer:a})}}var mount=function(t,e){var n=t.style,r=t.container,i=t.document,o=t.closed,a=styleRenderer(n);n&&n.css&&(a=[a,n.css].join(" "));var s;s=r?"\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ":"\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ";var u=ReactShadowDOM({document:i,element:r||i.body,content:e((function(){setTimeout((function(){u(),"function"==typeof o&&o()}),300)})),outsideStyle:s,insideStyle:a,insideClasses:r?["contained"]:[]}).unmount;return u},PoweredBy=function(){return react.createElement("div",{className:"PoweredByWrapper"},react.createElement("a",{href:"https://depay.fi?utm_source="+window.location.hostname+"&utm_medium=widget&utm_campaign=WidgetV2",rel:"noopener noreferrer",target:"_blank",className:"PoweredByLink"},"by DePay"))},requireReactVersion=function(){if(parseInt(react.version.split(".")[0])<17)throw"depay/widgets require at least React v17"},UpdatableProvider=function(t){var e=_slicedToArray(react.useState(!0),2),n=e[0],r=e[1];return react.createElement(UpdatableContext.Provider,{value:{updatable:n,setUpdatable:r}},t.children)},Connect=function(t){var e,n,r;return requireReactVersion(),"object"==_typeof(t)&&(e=t.style,n=t.error,r=t.document),new Promise(function(){var t=_asyncToGenerator(regenerator.mark((function t(i,o){var a,s;return regenerator.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a=getWallet())){t.next=7;break}return t.next=4,a.accounts();case 4:if(!((s=t.sent)instanceof Array&&s.length>0)){t.next=7;break}return t.abrupt("return",i({wallet:a,accounts:s,account:s[0]}));case 7:mount({style:e,document:ensureDocument(r)},(function(t){var e=function(){o("USER_CLOSED_DIALOG"),t()};return function(a){return react.createElement(ErrorProvider,{errorCallback:n,container:a,unmount:t},react.createElement(UpdatableProvider,null,react.createElement(ClosableProvider,{unmount:e},react.createElement(ConnectStack,{document:r,container:a,resolve:i,reject:o,autoClose:!0}),react.createElement(PoweredBy,null))))}}));case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},ChangableAmountContext=react.createContext(),ConfigurationContext=react.createContext(),ConversionRateContext=react.createContext();function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}var findMaxRoute=function(t){var e=_toConsumableArray(t).sort((function(t,e){var n=BigNumber$3.from(t.fromBalance).div(BigNumber$3.from(t.fromAmount)),r=BigNumber$3.from(e.fromBalance).div(BigNumber$3.from(e.fromAmount));return n.lt(r)?-1:r.lt(n)?1:0}));return e[e.length-1]},round$1=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",r=parseFloat(t),i=r.toString().match(/\d+\.0*(\d{3})/);if(null!==(e=i)&&void 0!==e&&e.length){var o,a,s=(i=i[0]).match(/\d{3}$/)[0];return s.match(/^00/)?r:(s.match(/^0/)?(o=parseFloat("".concat(s[1],".").concat(s[2])),a=parseFloat(o).toFixed(1),a="0".concat(a).replace(".","")):(o="up"==n?parseFloat("".concat(s[0],".").concat(s[1],"9")):parseFloat("".concat(s[0],".").concat(s[1],"1")),a=parseFloat(o).toFixed(1).replace(".","")),"0"!=a.toString()[0]&&a.toString().length>2?parseInt(r.toFixed(0)):parseFloat(i.replace(/\d{3}$/,a)))}return parseFloat(r.toFixed(2))},WalletContext=react.createContext(),lodash$1=createCommonjsModule$4((function(t,e){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,u=64,l=128,c=256,h=1/0,f=9007199254740991,d=NaN,p=4294967295,g=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",u],["rearg",c]],m="[object Arguments]",y="[object Array]",v="[object Boolean]",b="[object Date]",w="[object Error]",A="[object Function]",_="[object GeneratorFunction]",E="[object Map]",k="[object Number]",M="[object Object]",S="[object Promise]",x="[object RegExp]",C="[object Set]",T="[object String]",N="[object Symbol]",B="[object WeakMap]",$="[object ArrayBuffer]",P="[object DataView]",I="[object Float32Array]",R="[object Float64Array]",O="[object Int8Array]",L="[object Int16Array]",D="[object Int32Array]",F="[object Uint8Array]",j="[object Uint8ClampedArray]",U="[object Uint16Array]",H="[object Uint32Array]",z=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,Y=RegExp(W.source),V=RegExp(q.source),K=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),it=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",Mt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['’]",Tt="[\\ud800-\\udfff]",Nt="["+xt+"]",Bt="["+_t+"]",$t="\\d+",Pt="[\\u2700-\\u27bf]",It="["+kt+"]",Rt="[^\\ud800-\\udfff"+xt+$t+Et+kt+Mt+"]",Ot="\\ud83c[\\udffb-\\udfff]",Lt="[^\\ud800-\\udfff]",Dt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",jt="["+Mt+"]",Ut="(?:"+It+"|"+Rt+")",Ht="(?:"+jt+"|"+Rt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Gt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qt="(?:"+Bt+"|"+Ot+")"+"?",Wt="[\\ufe0e\\ufe0f]?",qt=Wt+Qt+("(?:\\u200d(?:"+[Lt,Dt,Ft].join("|")+")"+Wt+Qt+")*"),Yt="(?:"+[Pt,Dt,Ft].join("|")+")"+qt,Vt="(?:"+[Lt+Bt+"?",Bt,Dt,Ft,Tt].join("|")+")",Kt=RegExp(Ct,"g"),Jt=RegExp(Bt,"g"),Zt=RegExp(Ot+"(?="+Ot+")|"+Vt+qt,"g"),Xt=RegExp([jt+"?"+It+"+"+zt+"(?="+[Nt,jt,"$"].join("|")+")",Ht+"+"+Gt+"(?="+[Nt,jt+Ut,"$"].join("|")+")",jt+"?"+Ut+"+"+zt,jt+"+"+Gt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$t,Yt].join("|"),"g"),te=RegExp("[\\u200d\\ud800-\\udfff"+_t+St+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[I]=ie[R]=ie[O]=ie[L]=ie[D]=ie[F]=ie[j]=ie[U]=ie[H]=!0,ie[m]=ie[y]=ie[$]=ie[v]=ie[P]=ie[b]=ie[w]=ie[A]=ie[E]=ie[k]=ie[M]=ie[x]=ie[C]=ie[T]=ie[B]=!1;var oe={};oe[m]=oe[y]=oe[$]=oe[P]=oe[v]=oe[b]=oe[I]=oe[R]=oe[O]=oe[L]=oe[D]=oe[E]=oe[k]=oe[M]=oe[x]=oe[C]=oe[T]=oe[N]=oe[F]=oe[j]=oe[U]=oe[H]=!0,oe[w]=oe[A]=oe[B]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof commonjsGlobal$3&&commonjsGlobal$3&&commonjsGlobal$3.Object===Object&&commonjsGlobal$3,ce="object"==typeof self&&self&&self.Object===Object&&self,he=le||ce||Function("return this")(),fe=e&&!e.nodeType&&e,de=fe&&t&&!t.nodeType&&t,pe=de&&de.exports===fe,ge=pe&&le.process,me=function(){try{var t=de&&de.require&&de.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,ve=me&&me.isDate,be=me&&me.isMap,we=me&&me.isRegExp,Ae=me&&me.isSet,_e=me&&me.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ke(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ce(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Te(t,e){return!!(null==t?0:t.length)&&Fe(t,e,0)>-1}function Ne(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Be(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function $e(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Pe(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Re(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Oe=ze("length");function Le(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function De(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Fe(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):De(t,Ue,n)}function je(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Ue(t){return t!=t}function He(t,e){var n=null==t?0:t.length;return n?We(t,e)/n:d}function ze(t){return function(e){return null==e?n:e[t]}}function Ge(t){return function(e){return null==t?n:t[e]}}function Qe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function We(t,e){for(var r,i=-1,o=t.length;++i<o;){var a=e(t[i]);a!==n&&(r=r===n?a:r+a)}return r}function qe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ye(t){return t?t.slice(0,dn(t)+1).replace(it,""):t}function Ve(t){return function(e){return t(e)}}function Ke(t,e){return Be(e,(function(e){return t[e]}))}function Je(t,e){return t.has(e)}function Ze(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function Xe(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var en=Ge({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=Ge({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rn(t){return"\\"+ae[t]}function on(t){return te.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,r=t.length,i=0,a=[];++n<r;){var s=t[n];s!==e&&s!==o||(t[n]=o,a[i++]=n)}return a}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function hn(t){return on(t)?function(t){var e=Zt.lastIndex=0;for(;Zt.test(t);)++e;return e}(t):Oe(t)}function fn(t){return on(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.split("")}(t)}function dn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var pn=Ge({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var gn=function t(e){var ot,_t=(e=null==e?he:gn.defaults(he.Object(),e,gn.pick(he,ne))).Array,Et=e.Date,kt=e.Error,Mt=e.Function,St=e.Math,xt=e.Object,Ct=e.RegExp,Tt=e.String,Nt=e.TypeError,Bt=_t.prototype,$t=Mt.prototype,Pt=xt.prototype,It=e["__core-js_shared__"],Rt=$t.toString,Ot=Pt.hasOwnProperty,Lt=0,Dt=(ot=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"",Ft=Pt.toString,jt=Rt.call(xt),Ut=he._,Ht=Ct("^"+Rt.call(Ot).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:n,Gt=e.Symbol,Qt=e.Uint8Array,Wt=zt?zt.allocUnsafe:n,qt=sn(xt.getPrototypeOf,xt),Yt=xt.create,Vt=Pt.propertyIsEnumerable,Zt=Bt.splice,te=Gt?Gt.isConcatSpreadable:n,ae=Gt?Gt.iterator:n,le=Gt?Gt.toStringTag:n,ce=function(){try{var t=po(xt,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,de=Et&&Et.now!==he.Date.now&&Et.now,ge=e.setTimeout!==he.setTimeout&&e.setTimeout,me=St.ceil,Oe=St.floor,Ge=xt.getOwnPropertySymbols,mn=zt?zt.isBuffer:n,yn=e.isFinite,vn=Bt.join,bn=sn(xt.keys,xt),wn=St.max,An=St.min,_n=Et.now,En=e.parseInt,kn=St.random,Mn=Bt.reverse,Sn=po(e,"DataView"),xn=po(e,"Map"),Cn=po(e,"Promise"),Tn=po(e,"Set"),Nn=po(e,"WeakMap"),Bn=po(xt,"create"),$n=Nn&&new Nn,Pn={},In=Uo(Sn),Rn=Uo(xn),On=Uo(Cn),Ln=Uo(Tn),Dn=Uo(Nn),Fn=Gt?Gt.prototype:n,jn=Fn?Fn.valueOf:n,Un=Fn?Fn.toString:n;function Hn(t){if(is(t)&&!qa(t)&&!(t instanceof Wn)){if(t instanceof Qn)return t;if(Ot.call(t,"__wrapped__"))return Ho(t)}return new Qn(t)}var zn=function(){function t(){}return function(e){if(!rs(e))return{};if(Yt)return Yt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function Gn(){}function Qn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vn;++e<n;)this.add(t[e])}function Jn(t){var e=this.__data__=new Yn(t);this.size=e.size}function Zn(t,e){var n=qa(t),r=!n&&Wa(t),i=!n&&!r&&Ja(t),o=!n&&!r&&!i&&fs(t),a=n||r||i||o,s=a?qe(t.length,Tt):[],u=s.length;for(var l in t)!e&&!Ot.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ao(l,u))||s.push(l);return s}function Xn(t){var e=t.length;return e?t[Kr(0,e-1)]:n}function tr(t,e){return Do(Bi(t),lr(e,0,t.length))}function er(t){return Do(Bi(t))}function nr(t,e,r){(r!==n&&!za(t[e],r)||r===n&&!(e in t))&&sr(t,e,r)}function rr(t,e,r){var i=t[e];Ot.call(t,e)&&za(i,r)&&(r!==n||e in t)||sr(t,e,r)}function ir(t,e){for(var n=t.length;n--;)if(za(t[n][0],e))return n;return-1}function or(t,e,n,r){return pr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function ar(t,e){return t&&$i(e,Is(e),t)}function sr(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ur(t,e){for(var r=-1,i=e.length,o=_t(i),a=null==t;++r<i;)o[r]=a?n:Ts(t,e[r]);return o}function lr(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function cr(t,e,r,i,o,a){var s,u=1&e,l=2&e,c=4&e;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!rs(t))return t;var h=qa(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!u)return Bi(t,s)}else{var f=yo(t),d=f==A||f==_;if(Ja(t))return Mi(t,u);if(f==M||f==m||d&&!o){if(s=l||d?{}:bo(t),!u)return l?function(t,e){return $i(t,mo(t),e)}(t,function(t,e){return t&&$i(e,Rs(e),t)}(s,t)):function(t,e){return $i(t,go(t),e)}(t,ar(s,t))}else{if(!oe[f])return o?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case $:return Si(t);case v:case b:return new r(+t);case P:return function(t,e){var n=e?Si(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case R:case O:case L:case D:case F:case j:case U:case H:return xi(t,n);case E:return new r;case k:case T:return new r(t);case x:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new r;case N:return i=t,jn?xt(jn.call(i)):{}}var i}(t,f,u)}}a||(a=new Jn);var p=a.get(t);if(p)return p;a.set(t,s),ls(t)?t.forEach((function(n){s.add(cr(n,e,r,n,t,a))})):os(t)&&t.forEach((function(n,i){s.set(i,cr(n,e,r,i,t,a))}));var g=h?n:(c?l?ao:oo:l?Rs:Is)(t);return Me(g||t,(function(n,i){g&&(n=t[i=n]),rr(s,i,cr(n,e,r,i,t,a))})),s}function hr(t,e,r){var i=r.length;if(null==t)return!i;for(t=xt(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function fr(t,e,i){if("function"!=typeof t)throw new Nt(r);return Io((function(){t.apply(n,i)}),e)}function dr(t,e,n,r){var i=-1,o=Te,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Be(e,Ve(n))),r?(o=Ne,a=!1):e.length>=200&&(o=Je,a=!1,e=new Kn(e));t:for(;++i<s;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,a&&h==h){for(var f=l;f--;)if(e[f]===h)continue t;u.push(c)}else o(e,h,r)||u.push(c)}return u}Hn.templateSettings={escape:K,evaluate:J,interpolate:Z,variable:"",imports:{_:Hn}},Hn.prototype=Gn.prototype,Hn.prototype.constructor=Hn,Qn.prototype=zn(Gn.prototype),Qn.prototype.constructor=Qn,Wn.prototype=zn(Gn.prototype),Wn.prototype.constructor=Wn,qn.prototype.clear=function(){this.__data__=Bn?Bn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(t){var e=this.__data__;if(Bn){var r=e[t];return r===i?n:r}return Ot.call(e,t)?e[t]:n},qn.prototype.has=function(t){var e=this.__data__;return Bn?e[t]!==n:Ot.call(e,t)},qn.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bn&&e===n?i:e,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=ir(e,t);return!(n<0)&&(n==e.length-1?e.pop():Zt.call(e,n,1),--this.size,!0)},Yn.prototype.get=function(t){var e=this.__data__,r=ir(e,t);return r<0?n:e[r][1]},Yn.prototype.has=function(t){return ir(this.__data__,t)>-1},Yn.prototype.set=function(t,e){var n=this.__data__,r=ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(xn||Yn),string:new qn}},Vn.prototype.delete=function(t){var e=ho(this,t).delete(t);return this.size-=e?1:0,e},Vn.prototype.get=function(t){return ho(this,t).get(t)},Vn.prototype.has=function(t){return ho(this,t).has(t)},Vn.prototype.set=function(t,e){var n=ho(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(t){return this.__data__.set(t,i),this},Kn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Jn.prototype.get=function(t){return this.__data__.get(t)},Jn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!xn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vn(r)}return n.set(t,e),this.size=n.size,this};var pr=Ri(_r),gr=Ri(Er,!0);function mr(t,e){var n=!0;return pr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function yr(t,e,r){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(u===n?s==s&&!hs(s):r(s,u)))var u=s,l=a}return l}function vr(t,e){var n=[];return pr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function br(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=wo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?br(s,e-1,n,r,i):$e(i,s):r||(i[i.length]=s)}return i}var wr=Oi(),Ar=Oi(!0);function _r(t,e){return t&&wr(t,e,Is)}function Er(t,e){return t&&Ar(t,e,Is)}function kr(t,e){return Ce(e,(function(e){return ts(t[e])}))}function Mr(t,e){for(var r=0,i=(e=Ai(e,t)).length;null!=t&&r<i;)t=t[jo(e[r++])];return r&&r==i?t:n}function Sr(t,e,n){var r=e(t);return qa(t)?r:$e(r,n(t))}function xr(t){return null==t?t===n?"[object Undefined]":"[object Null]":le&&le in xt(t)?function(t){var e=Ot.call(t,le),r=t[le];try{t[le]=n;var i=!0}catch(t){}var o=Ft.call(t);i&&(e?t[le]=r:delete t[le]);return o}(t):function(t){return Ft.call(t)}(t)}function Cr(t,e){return t>e}function Tr(t,e){return null!=t&&Ot.call(t,e)}function Nr(t,e){return null!=t&&e in xt(t)}function Br(t,e,r){for(var i=r?Ne:Te,o=t[0].length,a=t.length,s=a,u=_t(a),l=1/0,c=[];s--;){var h=t[s];s&&e&&(h=Be(h,Ve(e))),l=An(h.length,l),u[s]=!r&&(e||o>=120&&h.length>=120)?new Kn(s&&h):n}h=t[0];var f=-1,d=u[0];t:for(;++f<o&&c.length<l;){var p=h[f],g=e?e(p):p;if(p=r||0!==p?p:0,!(d?Je(d,g):i(c,g,r))){for(s=a;--s;){var m=u[s];if(!(m?Je(m,g):i(t[s],g,r)))continue t}d&&d.push(g),c.push(p)}}return c}function $r(t,e,r){var i=null==(t=No(t,e=Ai(e,t)))?t:t[jo(Xo(e))];return null==i?n:Ee(i,t,r)}function Pr(t){return is(t)&&xr(t)==m}function Ir(t,e,r,i,o){return t===e||(null==t||null==e||!is(t)&&!is(e)?t!=t&&e!=e:function(t,e,r,i,o,a){var s=qa(t),u=qa(e),l=s?y:yo(t),c=u?y:yo(e),h=(l=l==m?M:l)==M,f=(c=c==m?M:c)==M,d=l==c;if(d&&Ja(t)){if(!Ja(e))return!1;s=!0,h=!1}if(d&&!h)return a||(a=new Jn),s||fs(t)?ro(t,e,r,i,o,a):function(t,e,n,r,i,o,a){switch(n){case P:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case $:return!(t.byteLength!=e.byteLength||!o(new Qt(t),new Qt(e)));case v:case b:case k:return za(+t,+e);case w:return t.name==e.name&&t.message==e.message;case x:case T:return t==e+"";case E:var s=an;case C:var u=1&r;if(s||(s=ln),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=ro(s(t),s(e),r,i,o,a);return a.delete(t),c;case N:if(jn)return jn.call(t)==jn.call(e)}return!1}(t,e,l,r,i,o,a);if(!(1&r)){var p=h&&Ot.call(t,"__wrapped__"),g=f&&Ot.call(e,"__wrapped__");if(p||g){var A=p?t.value():t,_=g?e.value():e;return a||(a=new Jn),o(A,_,r,i,a)}}if(!d)return!1;return a||(a=new Jn),function(t,e,r,i,o,a){var s=1&r,u=oo(t),l=u.length,c=oo(e).length;if(l!=c&&!s)return!1;var h=l;for(;h--;){var f=u[h];if(!(s?f in e:Ot.call(e,f)))return!1}var d=a.get(t),p=a.get(e);if(d&&p)return d==e&&p==t;var g=!0;a.set(t,e),a.set(e,t);var m=s;for(;++h<l;){var y=t[f=u[h]],v=e[f];if(i)var b=s?i(v,y,f,e,t,a):i(y,v,f,t,e,a);if(!(b===n?y===v||o(y,v,r,i,a):b)){g=!1;break}m||(m="constructor"==f)}if(g&&!m){var w=t.constructor,A=e.constructor;w==A||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof A&&A instanceof A||(g=!1)}return a.delete(t),a.delete(e),g}(t,e,r,i,o,a)}(t,e,r,i,Ir,o))}function Rr(t,e,r,i){var o=r.length,a=o,s=!i;if(null==t)return!a;for(t=xt(t);o--;){var u=r[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=r[o])[0],c=t[l],h=u[1];if(s&&u[2]){if(c===n&&!(l in t))return!1}else{var f=new Jn;if(i)var d=i(c,h,l,t,e,f);if(!(d===n?Ir(h,c,3,i,f):d))return!1}}return!0}function Or(t){return!(!rs(t)||(e=t,Dt&&Dt in e))&&(ts(t)?Ht:mt).test(Uo(t));var e}function Lr(t){return"function"==typeof t?t:null==t?au:"object"==typeof t?qa(t)?zr(t[0],t[1]):Hr(t):gu(t)}function Dr(t){if(!So(t))return bn(t);var e=[];for(var n in xt(t))Ot.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Fr(t){if(!rs(t))return function(t){var e=[];if(null!=t)for(var n in xt(t))e.push(n);return e}(t);var e=So(t),n=[];for(var r in t)("constructor"!=r||!e&&Ot.call(t,r))&&n.push(r);return n}function jr(t,e){return t<e}function Ur(t,e){var n=-1,r=Va(t)?_t(t.length):[];return pr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Hr(t){var e=fo(t);return 1==e.length&&e[0][2]?Co(e[0][0],e[0][1]):function(n){return n===t||Rr(n,t,e)}}function zr(t,e){return Eo(t)&&xo(e)?Co(jo(t),e):function(r){var i=Ts(r,t);return i===n&&i===e?Ns(r,t):Ir(e,i,3)}}function Gr(t,e,r,i,o){t!==e&&wr(e,(function(a,s){if(o||(o=new Jn),rs(a))!function(t,e,r,i,o,a,s){var u=$o(t,r),l=$o(e,r),c=s.get(l);if(c)return void nr(t,r,c);var h=a?a(u,l,r+"",t,e,s):n,f=h===n;if(f){var d=qa(l),p=!d&&Ja(l),g=!d&&!p&&fs(l);h=l,d||p||g?qa(u)?h=u:Ka(u)?h=Bi(u):p?(f=!1,h=Mi(l,!0)):g?(f=!1,h=xi(l,!0)):h=[]:ss(l)||Wa(l)?(h=u,Wa(u)?h=ws(u):rs(u)&&!ts(u)||(h=bo(l))):f=!1}f&&(s.set(l,h),o(h,l,i,a,s),s.delete(l));nr(t,r,h)}(t,e,s,r,Gr,i,o);else{var u=i?i($o(t,s),a,s+"",t,e,o):n;u===n&&(u=a),nr(t,s,u)}}),Rs)}function Qr(t,e){var r=t.length;if(r)return Ao(e+=e<0?r:0,r)?t[e]:n}function Wr(t,e,n){e=e.length?Be(e,(function(t){return qa(t)?function(e){return Mr(e,1===t.length?t[0]:t)}:t})):[au];var r=-1;e=Be(e,Ve(co()));var i=Ur(t,(function(t,n,i){var o=Be(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;for(;++r<a;){var u=Ci(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=Mr(t,a);n(s,a)&&ei(o,Ai(a,t),s)}return o}function Yr(t,e,n,r){var i=r?je:Fe,o=-1,a=e.length,s=t;for(t===e&&(e=Bi(e)),n&&(s=Be(t,Ve(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Zt.call(s,u,1),Zt.call(t,u,1);return t}function Vr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Ao(i)?Zt.call(t,i,1):di(t,i)}}return t}function Kr(t,e){return t+Oe(kn()*(e-t+1))}function Jr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=Oe(e/2))&&(t+=t)}while(e);return n}function Zr(t,e){return Ro(To(t,e,au),t+"")}function Xr(t){return Xn(zs(t))}function ti(t,e){var n=zs(t);return Do(n,lr(e,0,n.length))}function ei(t,e,r,i){if(!rs(t))return t;for(var o=-1,a=(e=Ai(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=jo(e[o]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var h=u[l];(c=i?i(h,l,u):n)===n&&(c=rs(h)?h:Ao(e[o+1])?[]:{})}rr(u,l,c),u=u[l]}return t}var ni=$n?function(t,e){return $n.set(t,e),t}:au,ri=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:ru(e),writable:!0})}:au;function ii(t){return Do(zs(t))}function oi(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=_t(i);++r<i;)o[r]=t[r+e];return o}function ai(t,e){var n;return pr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function si(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!hs(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ui(t,e,au,n)}function ui(t,e,r,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=r(e))!=e,u=null===e,l=hs(e),c=e===n;o<a;){var h=Oe((o+a)/2),f=r(t[h]),d=f!==n,p=null===f,g=f==f,m=hs(f);if(s)var y=i||g;else y=c?g&&(i||d):u?g&&d&&(i||!p):l?g&&d&&!p&&(i||!m):!p&&!m&&(i?f<=e:f<e);y?o=h+1:a=h}return An(a,4294967294)}function li(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!za(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function ci(t){return"number"==typeof t?t:hs(t)?d:+t}function hi(t){if("string"==typeof t)return t;if(qa(t))return Be(t,hi)+"";if(hs(t))return Un?Un.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function fi(t,e,n){var r=-1,i=Te,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=Ne;else if(o>=200){var l=e?null:Ji(t);if(l)return ln(l);a=!1,i=Je,u=new Kn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue t;e&&u.push(h),s.push(c)}else i(u,h,n)||(u!==s&&u.push(h),s.push(c))}return s}function di(t,e){return null==(t=No(t,e=Ai(e,t)))||delete t[jo(Xo(e))]}function pi(t,e,n,r){return ei(t,e,n(Mr(t,e)),r)}function gi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?oi(t,r?0:o,r?o+1:i):oi(t,r?o+1:0,r?i:o)}function mi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Pe(e,(function(t,e){return e.func.apply(e.thisArg,$e([t],e.args))}),n)}function yi(t,e,n){var r=t.length;if(r<2)return r?fi(t[0]):[];for(var i=-1,o=_t(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=dr(o[i]||a,t[s],e,n));return fi(br(o,1),e,n)}function vi(t,e,r){for(var i=-1,o=t.length,a=e.length,s={};++i<o;){var u=i<a?e[i]:n;r(s,t[i],u)}return s}function bi(t){return Ka(t)?t:[]}function wi(t){return"function"==typeof t?t:au}function Ai(t,e){return qa(t)?t:Eo(t,e)?[t]:Fo(As(t))}var _i=Zr;function Ei(t,e,r){var i=t.length;return r=r===n?i:r,!e&&r>=i?t:oi(t,e,r)}var ki=fe||function(t){return he.clearTimeout(t)};function Mi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function Si(t){var e=new t.constructor(t.byteLength);return new Qt(e).set(new Qt(t)),e}function xi(t,e){var n=e?Si(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ci(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=hs(t),s=e!==n,u=null===e,l=e==e,c=hs(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||i&&s&&l||!r&&l||!o)return 1;if(!i&&!a&&!c&&t<e||c&&r&&o&&!i&&!a||u&&r&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,u=e.length,l=wn(o-a,0),c=_t(u+l),h=!r;++s<u;)c[s]=e[s];for(;++i<a;)(h||i<o)&&(c[n[i]]=t[i]);for(;l--;)c[s++]=t[i++];return c}function Ni(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,u=-1,l=e.length,c=wn(o-s,0),h=_t(c+l),f=!r;++i<c;)h[i]=t[i];for(var d=i;++u<l;)h[d+u]=e[u];for(;++a<s;)(f||i<o)&&(h[d+n[a]]=t[i++]);return h}function Bi(t,e){var n=-1,r=t.length;for(e||(e=_t(r));++n<r;)e[n]=t[n];return e}function $i(t,e,r,i){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=i?i(r[u],t[u],u,r,t):n;l===n&&(l=t[u]),o?sr(r,u,l):rr(r,u,l)}return r}function Pi(t,e){return function(n,r){var i=qa(n)?ke:or,o=e?e():{};return i(n,t,co(r,2),o)}}function Ii(t){return Zr((function(e,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&_o(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=xt(e);++i<o;){var u=r[i];u&&t(e,u,i,a)}return e}))}function Ri(t,e){return function(n,r){if(null==n)return n;if(!Va(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=xt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Oi(t){return function(e,n,r){for(var i=-1,o=xt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Li(t){return function(e){var r=on(e=As(e))?fn(e):n,i=r?r[0]:e.charAt(0),o=r?Ei(r,1).join(""):e.slice(1);return i[t]()+o}}function Di(t){return function(e){return Pe(tu(Ws(e).replace(Kt,"")),t,"")}}function Fi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=zn(t.prototype),r=t.apply(n,e);return rs(r)?r:n}}function ji(t){return function(e,r,i){var o=xt(e);if(!Va(e)){var a=co(r,3);e=Is(e),r=function(t){return a(o[t],t,o)}}var s=t(e,r,i);return s>-1?o[a?e[s]:s]:n}}function Ui(t){return io((function(e){var i=e.length,o=i,a=Qn.prototype.thru;for(t&&e.reverse();o--;){var s=e[o];if("function"!=typeof s)throw new Nt(r);if(a&&!u&&"wrapper"==uo(s))var u=new Qn([],!0)}for(o=u?o:i;++o<i;){var l=uo(s=e[o]),c="wrapper"==l?so(s):n;u=c&&ko(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[uo(c[0])].apply(u,c[3]):1==s.length&&ko(s)?u[l]():u.thru(s)}return function(){var t=arguments,n=t[0];if(u&&1==t.length&&qa(n))return u.plant(n).value();for(var r=0,o=i?e[r].apply(this,t):n;++r<i;)o=e[r].call(this,o);return o}}))}function Hi(t,e,r,i,o,a,s,u,c,h){var f=e&l,d=1&e,p=2&e,g=24&e,m=512&e,y=p?n:Fi(t);return function n(){for(var l=arguments.length,v=_t(l),b=l;b--;)v[b]=arguments[b];if(g)var w=lo(n),A=tn(v,w);if(i&&(v=Ti(v,i,o,g)),a&&(v=Ni(v,a,s,g)),l-=A,g&&l<h){var _=un(v,w);return Vi(t,e,Hi,n.placeholder,r,v,_,u,c,h-l)}var E=d?r:this,k=p?E[t]:t;return l=v.length,u?v=Bo(v,u):m&&l>1&&v.reverse(),f&&c<l&&(v.length=c),this&&this!==he&&this instanceof n&&(k=y||Fi(k)),k.apply(E,v)}}function zi(t,e){return function(n,r){return function(t,e,n,r){return _r(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Gi(t,e){return function(r,i){var o;if(r===n&&i===n)return e;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=hi(r),i=hi(i)):(r=ci(r),i=ci(i)),o=t(r,i)}return o}}function Qi(t){return io((function(e){return e=Be(e,Ve(co())),Zr((function(n){var r=this;return t(e,(function(t){return Ee(t,r,n)}))}))}))}function Wi(t,e){var r=(e=e===n?" ":hi(e)).length;if(r<2)return r?Jr(e,t):e;var i=Jr(e,me(t/hn(e)));return on(e)?Ei(fn(i),0,t).join(""):i.slice(0,t)}function qi(t){return function(e,r,i){return i&&"number"!=typeof i&&_o(e,r,i)&&(r=i=n),e=ms(e),r===n?(r=e,e=0):r=ms(r),function(t,e,n,r){for(var i=-1,o=wn(me((e-t)/(n||1)),0),a=_t(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,r,i=i===n?e<r?1:-1:ms(i),t)}}function Yi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=bs(e),n=bs(n)),t(e,n)}}function Vi(t,e,r,i,o,a,l,c,h,f){var d=8&e;e|=d?s:u,4&(e&=~(d?u:s))||(e&=-4);var p=[t,e,o,d?a:n,d?l:n,d?n:a,d?n:l,c,h,f],g=r.apply(n,p);return ko(t)&&Po(g,p),g.placeholder=i,Oo(g,t,e)}function Ki(t){var e=St[t];return function(t,n){if(t=bs(t),(n=null==n?0:An(ys(n),292))&&yn(t)){var r=(As(t)+"e").split("e");return+((r=(As(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ji=Tn&&1/ln(new Tn([,-0]))[1]==h?function(t){return new Tn(t)}:hu;function Zi(t){return function(e){var n=yo(e);return n==E?an(e):n==C?cn(e):function(t,e){return Be(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Xi(t,e,i,h,f,d,p,g){var m=2&e;if(!m&&"function"!=typeof t)throw new Nt(r);var y=h?h.length:0;if(y||(e&=-97,h=f=n),p=p===n?p:wn(ys(p),0),g=g===n?g:ys(g),y-=f?f.length:0,e&u){var v=h,b=f;h=f=n}var w=m?n:so(t),A=[t,e,i,h,f,v,b,d,p,g];if(w&&function(t,e){var n=t[1],r=e[1],i=n|r,a=i<131,s=r==l&&8==n||r==l&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!a&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var h=t[3];t[3]=h?Ti(h,u,e[4]):u,t[4]=h?un(t[3],o):e[4]}(u=e[5])&&(h=t[5],t[5]=h?Ni(h,u,e[6]):u,t[6]=h?un(t[5],o):e[6]);(u=e[7])&&(t[7]=u);r&l&&(t[8]=null==t[8]?e[8]:An(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(A,w),t=A[0],e=A[1],i=A[2],h=A[3],f=A[4],!(g=A[9]=A[9]===n?m?0:t.length:wn(A[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==a?function(t,e,r){var i=Fi(t);return function o(){for(var a=arguments.length,s=_t(a),u=a,l=lo(o);u--;)s[u]=arguments[u];var c=a<3&&s[0]!==l&&s[a-1]!==l?[]:un(s,l);return(a-=c.length)<r?Vi(t,e,Hi,o.placeholder,n,s,c,n,n,r-a):Ee(this&&this!==he&&this instanceof o?i:t,this,s)}}(t,e,g):e!=s&&33!=e||f.length?Hi.apply(n,A):function(t,e,n,r){var i=1&e,o=Fi(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=_t(l+s),h=this&&this!==he&&this instanceof e?o:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return Ee(h,i?n:this,c)}}(t,e,i,h);else var _=function(t,e,n){var r=1&e,i=Fi(t);return function e(){return(this&&this!==he&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,i);return Oo((w?ni:Po)(_,A),t,e)}function to(t,e,r,i){return t===n||za(t,Pt[r])&&!Ot.call(i,r)?e:t}function eo(t,e,r,i,o,a){return rs(t)&&rs(e)&&(a.set(e,t),Gr(t,e,n,eo,a),a.delete(e)),t}function no(t){return ss(t)?n:t}function ro(t,e,r,i,o,a){var s=1&r,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var f=-1,d=!0,p=2&r?new Kn:n;for(a.set(t,e),a.set(e,t);++f<u;){var g=t[f],m=e[f];if(i)var y=s?i(m,g,f,e,t,a):i(g,m,f,t,e,a);if(y!==n){if(y)continue;d=!1;break}if(p){if(!Re(e,(function(t,e){if(!Je(p,e)&&(g===t||o(g,t,r,i,a)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function io(t){return Ro(To(t,n,Yo),t+"")}function oo(t){return Sr(t,Is,go)}function ao(t){return Sr(t,Rs,mo)}var so=$n?function(t){return $n.get(t)}:hu;function uo(t){for(var e=t.name+"",n=Pn[e],r=Ot.call(Pn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function lo(t){return(Ot.call(Hn,"placeholder")?Hn:t).placeholder}function co(){var t=Hn.iteratee||su;return t=t===su?Lr:t,arguments.length?t(arguments[0],arguments[1]):t}function ho(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function fo(t){for(var e=Is(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,xo(i)]}return e}function po(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Or(r)?r:n}var go=Ge?function(t){return null==t?[]:(t=xt(t),Ce(Ge(t),(function(e){return Vt.call(t,e)})))}:vu,mo=Ge?function(t){for(var e=[];t;)$e(e,go(t)),t=qt(t);return e}:vu,yo=xr;function vo(t,e,n){for(var r=-1,i=(e=Ai(e,t)).length,o=!1;++r<i;){var a=jo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&ns(i)&&Ao(a,i)&&(qa(t)||Wa(t))}function bo(t){return"function"!=typeof t.constructor||So(t)?{}:zn(qt(t))}function wo(t){return qa(t)||Wa(t)||!!(te&&t&&t[te])}function Ao(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function _o(t,e,n){if(!rs(n))return!1;var r=typeof e;return!!("number"==r?Va(n)&&Ao(e,n.length):"string"==r&&e in n)&&za(n[e],t)}function Eo(t,e){if(qa(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!hs(t))||(tt.test(t)||!X.test(t)||null!=e&&t in xt(e))}function ko(t){var e=uo(t),n=Hn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=so(n);return!!r&&t===r[0]}(Sn&&yo(new Sn(new ArrayBuffer(1)))!=P||xn&&yo(new xn)!=E||Cn&&yo(Cn.resolve())!=S||Tn&&yo(new Tn)!=C||Nn&&yo(new Nn)!=B)&&(yo=function(t){var e=xr(t),r=e==M?t.constructor:n,i=r?Uo(r):"";if(i)switch(i){case In:return P;case Rn:return E;case On:return S;case Ln:return C;case Dn:return B}return e});var Mo=It?ts:bu;function So(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pt)}function xo(t){return t==t&&!rs(t)}function Co(t,e){return function(r){return null!=r&&(r[t]===e&&(e!==n||t in xt(r)))}}function To(t,e,r){return e=wn(e===n?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=wn(n.length-e,0),a=_t(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=_t(e+1);++i<e;)s[i]=n[i];return s[e]=r(a),Ee(t,this,s)}}function No(t,e){return e.length<2?t:Mr(t,oi(e,0,-1))}function Bo(t,e){for(var r=t.length,i=An(e.length,r),o=Bi(t);i--;){var a=e[i];t[i]=Ao(a,r)?o[a]:n}return t}function $o(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Po=Lo(ni),Io=ge||function(t,e){return he.setTimeout(t,e)},Ro=Lo(ri);function Oo(t,e,n){var r=e+"";return Ro(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(g,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ut):[]}(r),n)))}function Lo(t){var e=0,r=0;return function(){var i=_n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Do(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r<e;){var a=Kr(r,o),s=t[a];t[a]=t[r],t[r]=s}return t.length=e,t}var Fo=function(t){var e=La(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function jo(t){if("string"==typeof t||hs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Uo(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ho(t){if(t instanceof Wn)return t.clone();var e=new Qn(t.__wrapped__,t.__chain__);return e.__actions__=Bi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var zo=Zr((function(t,e){return Ka(t)?dr(t,br(e,1,Ka,!0)):[]})),Go=Zr((function(t,e){var r=Xo(e);return Ka(r)&&(r=n),Ka(t)?dr(t,br(e,1,Ka,!0),co(r,2)):[]})),Qo=Zr((function(t,e){var r=Xo(e);return Ka(r)&&(r=n),Ka(t)?dr(t,br(e,1,Ka,!0),n,r):[]}));function Wo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=wn(r+i,0)),De(t,co(e,3),i)}function qo(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==n&&(o=ys(r),o=r<0?wn(i+o,0):An(o,i-1)),De(t,co(e,3),o,!0)}function Yo(t){return(null==t?0:t.length)?br(t,1):[]}function Vo(t){return t&&t.length?t[0]:n}var Ko=Zr((function(t){var e=Be(t,bi);return e.length&&e[0]===t[0]?Br(e):[]})),Jo=Zr((function(t){var e=Xo(t),r=Be(t,bi);return e===Xo(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Br(r,co(e,2)):[]})),Zo=Zr((function(t){var e=Xo(t),r=Be(t,bi);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Br(r,n,e):[]}));function Xo(t){var e=null==t?0:t.length;return e?t[e-1]:n}var ta=Zr(ea);function ea(t,e){return t&&t.length&&e&&e.length?Yr(t,e):t}var na=io((function(t,e){var n=null==t?0:t.length,r=ur(t,e);return Vr(t,Be(e,(function(t){return Ao(t,n)?+t:t})).sort(Ci)),r}));function ra(t){return null==t?t:Mn.call(t)}var ia=Zr((function(t){return fi(br(t,1,Ka,!0))})),oa=Zr((function(t){var e=Xo(t);return Ka(e)&&(e=n),fi(br(t,1,Ka,!0),co(e,2))})),aa=Zr((function(t){var e=Xo(t);return e="function"==typeof e?e:n,fi(br(t,1,Ka,!0),n,e)}));function sa(t){if(!t||!t.length)return[];var e=0;return t=Ce(t,(function(t){if(Ka(t))return e=wn(t.length,e),!0})),qe(e,(function(e){return Be(t,ze(e))}))}function ua(t,e){if(!t||!t.length)return[];var r=sa(t);return null==e?r:Be(r,(function(t){return Ee(e,n,t)}))}var la=Zr((function(t,e){return Ka(t)?dr(t,e):[]})),ca=Zr((function(t){return yi(Ce(t,Ka))})),ha=Zr((function(t){var e=Xo(t);return Ka(e)&&(e=n),yi(Ce(t,Ka),co(e,2))})),fa=Zr((function(t){var e=Xo(t);return e="function"==typeof e?e:n,yi(Ce(t,Ka),n,e)})),da=Zr(sa);var pa=Zr((function(t){var e=t.length,r=e>1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,ua(t,r)}));function ga(t){var e=Hn(t);return e.__chain__=!0,e}function ma(t,e){return e(t)}var ya=io((function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return ur(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Wn&&Ao(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:ma,args:[o],thisArg:n}),new Qn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(o)}));var va=Pi((function(t,e,n){Ot.call(t,n)?++t[n]:sr(t,n,1)}));var ba=ji(Wo),wa=ji(qo);function Aa(t,e){return(qa(t)?Me:pr)(t,co(e,3))}function _a(t,e){return(qa(t)?Se:gr)(t,co(e,3))}var Ea=Pi((function(t,e,n){Ot.call(t,n)?t[n].push(e):sr(t,n,[e])}));var ka=Zr((function(t,e,n){var r=-1,i="function"==typeof e,o=Va(t)?_t(t.length):[];return pr(t,(function(t){o[++r]=i?Ee(e,t,n):$r(t,e,n)})),o})),Ma=Pi((function(t,e,n){sr(t,n,e)}));function Sa(t,e){return(qa(t)?Be:Ur)(t,co(e,3))}var xa=Pi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ca=Zr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&_o(t,e[0],e[1])?e=[]:n>2&&_o(e[0],e[1],e[2])&&(e=[e[0]]),Wr(t,br(e,1),[])})),Ta=de||function(){return he.Date.now()};function Na(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Xi(t,l,n,n,n,n,e)}function Ba(t,e){var i;if("function"!=typeof e)throw new Nt(r);return t=ys(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var $a=Zr((function(t,e,n){var r=1;if(n.length){var i=un(n,lo($a));r|=s}return Xi(t,r,e,n,i)})),Pa=Zr((function(t,e,n){var r=3;if(n.length){var i=un(n,lo(Pa));r|=s}return Xi(e,r,t,n,i)}));function Ia(t,e,i){var o,a,s,u,l,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Nt(r);function g(e){var r=o,i=a;return o=a=n,h=e,u=t.apply(i,r)}function m(t){return h=t,l=Io(v,e),f?g(t):u}function y(t){var r=t-c;return c===n||r>=e||r<0||d&&t-h>=s}function v(){var t=Ta();if(y(t))return b(t);l=Io(v,function(t){var n=e-(t-c);return d?An(n,s-(t-h)):n}(t))}function b(t){return l=n,p&&o?g(t):(o=a=n,u)}function w(){var t=Ta(),r=y(t);if(o=arguments,a=this,c=t,r){if(l===n)return m(c);if(d)return ki(l),l=Io(v,e),g(c)}return l===n&&(l=Io(v,e)),u}return e=bs(e)||0,rs(i)&&(f=!!i.leading,s=(d="maxWait"in i)?wn(bs(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p),w.cancel=function(){l!==n&&ki(l),h=0,o=c=a=l=n},w.flush=function(){return l===n?u:b(Ta())},w}var Ra=Zr((function(t,e){return fr(t,1,e)})),Oa=Zr((function(t,e,n){return fr(t,bs(e)||0,n)}));function La(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Nt(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(La.Cache||Vn),n}function Da(t){if("function"!=typeof t)throw new Nt(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}La.Cache=Vn;var Fa=_i((function(t,e){var n=(e=1==e.length&&qa(e[0])?Be(e[0],Ve(co())):Be(br(e,1),Ve(co()))).length;return Zr((function(r){for(var i=-1,o=An(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ee(t,this,r)}))})),ja=Zr((function(t,e){var r=un(e,lo(ja));return Xi(t,s,n,e,r)})),Ua=Zr((function(t,e){var r=un(e,lo(Ua));return Xi(t,u,n,e,r)})),Ha=io((function(t,e){return Xi(t,c,n,n,n,e)}));function za(t,e){return t===e||t!=t&&e!=e}var Ga=Yi(Cr),Qa=Yi((function(t,e){return t>=e})),Wa=Pr(function(){return arguments}())?Pr:function(t){return is(t)&&Ot.call(t,"callee")&&!Vt.call(t,"callee")},qa=_t.isArray,Ya=ye?Ve(ye):function(t){return is(t)&&xr(t)==$};function Va(t){return null!=t&&ns(t.length)&&!ts(t)}function Ka(t){return is(t)&&Va(t)}var Ja=mn||bu,Za=ve?Ve(ve):function(t){return is(t)&&xr(t)==b};function Xa(t){if(!is(t))return!1;var e=xr(t);return e==w||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!rs(t))return!1;var e=xr(t);return e==A||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==ys(t)}function ns(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function rs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var os=be?Ve(be):function(t){return is(t)&&yo(t)==E};function as(t){return"number"==typeof t||is(t)&&xr(t)==k}function ss(t){if(!is(t)||xr(t)!=M)return!1;var e=qt(t);if(null===e)return!0;var n=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==jt}var us=we?Ve(we):function(t){return is(t)&&xr(t)==x};var ls=Ae?Ve(Ae):function(t){return is(t)&&yo(t)==C};function cs(t){return"string"==typeof t||!qa(t)&&is(t)&&xr(t)==T}function hs(t){return"symbol"==typeof t||is(t)&&xr(t)==N}var fs=_e?Ve(_e):function(t){return is(t)&&ns(t.length)&&!!ie[xr(t)]};var ds=Yi(jr),ps=Yi((function(t,e){return t<=e}));function gs(t){if(!t)return[];if(Va(t))return cs(t)?fn(t):Bi(t);if(ae&&t[ae])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ae]());var e=yo(t);return(e==E?an:e==C?ln:zs)(t)}function ms(t){return t?(t=bs(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ys(t){var e=ms(t),n=e%1;return e==e?n?e-n:e:0}function vs(t){return t?lr(ys(t),0,p):0}function bs(t){if("number"==typeof t)return t;if(hs(t))return d;if(rs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=rs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var n=gt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):pt.test(t)?d:+t}function ws(t){return $i(t,Rs(t))}function As(t){return null==t?"":hi(t)}var _s=Ii((function(t,e){if(So(e)||Va(e))$i(e,Is(e),t);else for(var n in e)Ot.call(e,n)&&rr(t,n,e[n])})),Es=Ii((function(t,e){$i(e,Rs(e),t)})),ks=Ii((function(t,e,n,r){$i(e,Rs(e),t,r)})),Ms=Ii((function(t,e,n,r){$i(e,Is(e),t,r)})),Ss=io(ur);var xs=Zr((function(t,e){t=xt(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&_o(e[0],e[1],o)&&(i=1);++r<i;)for(var a=e[r],s=Rs(a),u=-1,l=s.length;++u<l;){var c=s[u],h=t[c];(h===n||za(h,Pt[c])&&!Ot.call(t,c))&&(t[c]=a[c])}return t})),Cs=Zr((function(t){return t.push(n,eo),Ee(Ls,n,t)}));function Ts(t,e,r){var i=null==t?n:Mr(t,e);return i===n?r:i}function Ns(t,e){return null!=t&&vo(t,e,Nr)}var Bs=zi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),t[e]=n}),ru(au)),$s=zi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),Ot.call(t,e)?t[e].push(n):t[e]=[n]}),co),Ps=Zr($r);function Is(t){return Va(t)?Zn(t):Dr(t)}function Rs(t){return Va(t)?Zn(t,!0):Fr(t)}var Os=Ii((function(t,e,n){Gr(t,e,n)})),Ls=Ii((function(t,e,n,r){Gr(t,e,n,r)})),Ds=io((function(t,e){var n={};if(null==t)return n;var r=!1;e=Be(e,(function(e){return e=Ai(e,t),r||(r=e.length>1),e})),$i(t,ao(t),n),r&&(n=cr(n,7,no));for(var i=e.length;i--;)di(n,e[i]);return n}));var Fs=io((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Ns(t,n)}))}(t,e)}));function js(t,e){if(null==t)return{};var n=Be(ao(t),(function(t){return[t]}));return e=co(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var Us=Zi(Is),Hs=Zi(Rs);function zs(t){return null==t?[]:Ke(t,Is(t))}var Gs=Di((function(t,e,n){return e=e.toLowerCase(),t+(n?Qs(e):e)}));function Qs(t){return Xs(As(t).toLowerCase())}function Ws(t){return(t=As(t))&&t.replace(bt,en).replace(Jt,"")}var qs=Di((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ys=Di((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Vs=Li("toLowerCase");var Ks=Di((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Js=Di((function(t,e,n){return t+(n?" ":"")+Xs(e)}));var Zs=Di((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Xs=Li("toUpperCase");function tu(t,e,r){return t=As(t),(e=r?n:e)===n?function(t){return ee.test(t)}(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var eu=Zr((function(t,e){try{return Ee(t,n,e)}catch(t){return Xa(t)?t:new kt(t)}})),nu=io((function(t,e){return Me(e,(function(e){e=jo(e),sr(t,e,$a(t[e],t))})),t}));function ru(t){return function(){return t}}var iu=Ui(),ou=Ui(!0);function au(t){return t}function su(t){return Lr("function"==typeof t?t:cr(t,1))}var uu=Zr((function(t,e){return function(n){return $r(n,t,e)}})),lu=Zr((function(t,e){return function(n){return $r(t,n,e)}}));function cu(t,e,n){var r=Is(e),i=kr(e,r);null!=n||rs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=kr(e,Is(e)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=ts(t);return Me(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Bi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,$e([this.value()],arguments))})})),t}function hu(){}var fu=Qi(Be),du=Qi(xe),pu=Qi(Re);function gu(t){return Eo(t)?ze(jo(t)):function(t){return function(e){return Mr(e,t)}}(t)}var mu=qi(),yu=qi(!0);function vu(){return[]}function bu(){return!1}var wu=Gi((function(t,e){return t+e}),0),Au=Ki("ceil"),_u=Gi((function(t,e){return t/e}),1),Eu=Ki("floor");var ku,Mu=Gi((function(t,e){return t*e}),1),Su=Ki("round"),xu=Gi((function(t,e){return t-e}),0);return Hn.after=function(t,e){if("function"!=typeof e)throw new Nt(r);return t=ys(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Na,Hn.assign=_s,Hn.assignIn=Es,Hn.assignInWith=ks,Hn.assignWith=Ms,Hn.at=Ss,Hn.before=Ba,Hn.bind=$a,Hn.bindAll=nu,Hn.bindKey=Pa,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qa(t)?t:[t]},Hn.chain=ga,Hn.chunk=function(t,e,r){e=(r?_o(t,e,r):e===n)?1:wn(ys(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=_t(me(i/e));o<i;)s[a++]=oi(t,o,o+=e);return s},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=_t(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return $e(qa(n)?Bi(n):[n],br(e,1))},Hn.cond=function(t){var e=null==t?0:t.length,n=co();return t=e?Be(t,(function(t){if("function"!=typeof t[1])throw new Nt(r);return[n(t[0]),t[1]]})):[],Zr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Ee(i[0],this,n))return Ee(i[1],this,n)}}))},Hn.conforms=function(t){return function(t){var e=Is(t);return function(n){return hr(n,t,e)}}(cr(t,1))},Hn.constant=ru,Hn.countBy=va,Hn.create=function(t,e){var n=zn(t);return null==e?n:ar(n,e)},Hn.curry=function t(e,r,i){var o=Xi(e,8,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Hn.curryRight=function t(e,r,i){var o=Xi(e,a,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Hn.debounce=Ia,Hn.defaults=xs,Hn.defaultsDeep=Cs,Hn.defer=Ra,Hn.delay=Oa,Hn.difference=zo,Hn.differenceBy=Go,Hn.differenceWith=Qo,Hn.drop=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,(e=r||e===n?1:ys(e))<0?0:e,i):[]},Hn.dropRight=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,0,(e=i-(e=r||e===n?1:ys(e)))<0?0:e):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?gi(t,co(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?gi(t,co(e,3),!0):[]},Hn.fill=function(t,e,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&_o(t,e,r)&&(r=0,i=o),function(t,e,r,i){var o=t.length;for((r=ys(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:ys(i))<0&&(i+=o),i=r>i?0:vs(i);r<i;)t[r++]=e;return t}(t,e,r,i)):[]},Hn.filter=function(t,e){return(qa(t)?Ce:vr)(t,co(e,3))},Hn.flatMap=function(t,e){return br(Sa(t,e),1)},Hn.flatMapDeep=function(t,e){return br(Sa(t,e),h)},Hn.flatMapDepth=function(t,e,r){return r=r===n?1:ys(r),br(Sa(t,e),r)},Hn.flatten=Yo,Hn.flattenDeep=function(t){return(null==t?0:t.length)?br(t,h):[]},Hn.flattenDepth=function(t,e){return(null==t?0:t.length)?br(t,e=e===n?1:ys(e)):[]},Hn.flip=function(t){return Xi(t,512)},Hn.flow=iu,Hn.flowRight=ou,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Hn.functions=function(t){return null==t?[]:kr(t,Is(t))},Hn.functionsIn=function(t){return null==t?[]:kr(t,Rs(t))},Hn.groupBy=Ea,Hn.initial=function(t){return(null==t?0:t.length)?oi(t,0,-1):[]},Hn.intersection=Ko,Hn.intersectionBy=Jo,Hn.intersectionWith=Zo,Hn.invert=Bs,Hn.invertBy=$s,Hn.invokeMap=ka,Hn.iteratee=su,Hn.keyBy=Ma,Hn.keys=Is,Hn.keysIn=Rs,Hn.map=Sa,Hn.mapKeys=function(t,e){var n={};return e=co(e,3),_r(t,(function(t,r,i){sr(n,e(t,r,i),t)})),n},Hn.mapValues=function(t,e){var n={};return e=co(e,3),_r(t,(function(t,r,i){sr(n,r,e(t,r,i))})),n},Hn.matches=function(t){return Hr(cr(t,1))},Hn.matchesProperty=function(t,e){return zr(t,cr(e,1))},Hn.memoize=La,Hn.merge=Os,Hn.mergeWith=Ls,Hn.method=uu,Hn.methodOf=lu,Hn.mixin=cu,Hn.negate=Da,Hn.nthArg=function(t){return t=ys(t),Zr((function(e){return Qr(e,t)}))},Hn.omit=Ds,Hn.omitBy=function(t,e){return js(t,Da(co(e)))},Hn.once=function(t){return Ba(2,t)},Hn.orderBy=function(t,e,r,i){return null==t?[]:(qa(e)||(e=null==e?[]:[e]),qa(r=i?n:r)||(r=null==r?[]:[r]),Wr(t,e,r))},Hn.over=fu,Hn.overArgs=Fa,Hn.overEvery=du,Hn.overSome=pu,Hn.partial=ja,Hn.partialRight=Ua,Hn.partition=xa,Hn.pick=Fs,Hn.pickBy=js,Hn.property=gu,Hn.propertyOf=function(t){return function(e){return null==t?n:Mr(t,e)}},Hn.pull=ta,Hn.pullAll=ea,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Yr(t,e,co(n,2)):t},Hn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Yr(t,e,n,r):t},Hn.pullAt=na,Hn.range=mu,Hn.rangeRight=yu,Hn.rearg=Ha,Hn.reject=function(t,e){return(qa(t)?Ce:vr)(t,Da(co(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=co(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Vr(t,i),n},Hn.rest=function(t,e){if("function"!=typeof t)throw new Nt(r);return Zr(t,e=e===n?e:ys(e))},Hn.reverse=ra,Hn.sampleSize=function(t,e,r){return e=(r?_o(t,e,r):e===n)?1:ys(e),(qa(t)?tr:ti)(t,e)},Hn.set=function(t,e,n){return null==t?t:ei(t,e,n)},Hn.setWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:ei(t,e,r,i)},Hn.shuffle=function(t){return(qa(t)?er:ii)(t)},Hn.slice=function(t,e,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&_o(t,e,r)?(e=0,r=i):(e=null==e?0:ys(e),r=r===n?i:ys(r)),oi(t,e,r)):[]},Hn.sortBy=Ca,Hn.sortedUniq=function(t){return t&&t.length?li(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?li(t,co(e,2)):[]},Hn.split=function(t,e,r){return r&&"number"!=typeof r&&_o(t,e,r)&&(e=r=n),(r=r===n?p:r>>>0)?(t=As(t))&&("string"==typeof e||null!=e&&!us(e))&&!(e=hi(e))&&on(t)?Ei(fn(t),0,r):t.split(e,r):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new Nt(r);return e=null==e?0:wn(ys(e),0),Zr((function(n){var r=n[e],i=Ei(n,0,e);return r&&$e(i,r),Ee(t,this,i)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Hn.take=function(t,e,r){return t&&t.length?oi(t,0,(e=r||e===n?1:ys(e))<0?0:e):[]},Hn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,(e=i-(e=r||e===n?1:ys(e)))<0?0:e,i):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?gi(t,co(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?gi(t,co(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new Nt(r);return rs(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ia(t,e,{leading:i,maxWait:e,trailing:o})},Hn.thru=ma,Hn.toArray=gs,Hn.toPairs=Us,Hn.toPairsIn=Hs,Hn.toPath=function(t){return qa(t)?Be(t,jo):hs(t)?[t]:Bi(Fo(As(t)))},Hn.toPlainObject=ws,Hn.transform=function(t,e,n){var r=qa(t),i=r||Ja(t)||fs(t);if(e=co(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:rs(t)&&ts(o)?zn(qt(t)):{}}return(i?Me:_r)(t,(function(t,r,i){return e(n,t,r,i)})),n},Hn.unary=function(t){return Na(t,1)},Hn.union=ia,Hn.unionBy=oa,Hn.unionWith=aa,Hn.uniq=function(t){return t&&t.length?fi(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?fi(t,co(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?fi(t,n,e):[]},Hn.unset=function(t,e){return null==t||di(t,e)},Hn.unzip=sa,Hn.unzipWith=ua,Hn.update=function(t,e,n){return null==t?t:pi(t,e,wi(n))},Hn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:pi(t,e,wi(r),i)},Hn.values=zs,Hn.valuesIn=function(t){return null==t?[]:Ke(t,Rs(t))},Hn.without=la,Hn.words=tu,Hn.wrap=function(t,e){return ja(wi(e),t)},Hn.xor=ca,Hn.xorBy=ha,Hn.xorWith=fa,Hn.zip=da,Hn.zipObject=function(t,e){return vi(t||[],e||[],rr)},Hn.zipObjectDeep=function(t,e){return vi(t||[],e||[],ei)},Hn.zipWith=pa,Hn.entries=Us,Hn.entriesIn=Hs,Hn.extend=Es,Hn.extendWith=ks,cu(Hn,Hn),Hn.add=wu,Hn.attempt=eu,Hn.camelCase=Gs,Hn.capitalize=Qs,Hn.ceil=Au,Hn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=bs(r))==r?r:0),e!==n&&(e=(e=bs(e))==e?e:0),lr(bs(t),e,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(t,e){return cr(t,5,e="function"==typeof e?e:n)},Hn.cloneWith=function(t,e){return cr(t,4,e="function"==typeof e?e:n)},Hn.conformsTo=function(t,e){return null==e||hr(t,e,Is(e))},Hn.deburr=Ws,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=_u,Hn.endsWith=function(t,e,r){t=As(t),e=hi(e);var i=t.length,o=r=r===n?i:lr(ys(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Hn.eq=za,Hn.escape=function(t){return(t=As(t))&&V.test(t)?t.replace(q,nn):t},Hn.escapeRegExp=function(t){return(t=As(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Hn.every=function(t,e,r){var i=qa(t)?xe:mr;return r&&_o(t,e,r)&&(e=n),i(t,co(e,3))},Hn.find=ba,Hn.findIndex=Wo,Hn.findKey=function(t,e){return Le(t,co(e,3),_r)},Hn.findLast=wa,Hn.findLastIndex=qo,Hn.findLastKey=function(t,e){return Le(t,co(e,3),Er)},Hn.floor=Eu,Hn.forEach=Aa,Hn.forEachRight=_a,Hn.forIn=function(t,e){return null==t?t:wr(t,co(e,3),Rs)},Hn.forInRight=function(t,e){return null==t?t:Ar(t,co(e,3),Rs)},Hn.forOwn=function(t,e){return t&&_r(t,co(e,3))},Hn.forOwnRight=function(t,e){return t&&Er(t,co(e,3))},Hn.get=Ts,Hn.gt=Ga,Hn.gte=Qa,Hn.has=function(t,e){return null!=t&&vo(t,e,Tr)},Hn.hasIn=Ns,Hn.head=Vo,Hn.identity=au,Hn.includes=function(t,e,n,r){t=Va(t)?t:zs(t),n=n&&!r?ys(n):0;var i=t.length;return n<0&&(n=wn(i+n,0)),cs(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ys(n);return i<0&&(i=wn(r+i,0)),Fe(t,e,i)},Hn.inRange=function(t,e,r){return e=ms(e),r===n?(r=e,e=0):r=ms(r),function(t,e,n){return t>=An(e,n)&&t<wn(e,n)}(t=bs(t),e,r)},Hn.invoke=Ps,Hn.isArguments=Wa,Hn.isArray=qa,Hn.isArrayBuffer=Ya,Hn.isArrayLike=Va,Hn.isArrayLikeObject=Ka,Hn.isBoolean=function(t){return!0===t||!1===t||is(t)&&xr(t)==v},Hn.isBuffer=Ja,Hn.isDate=Za,Hn.isElement=function(t){return is(t)&&1===t.nodeType&&!ss(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Va(t)&&(qa(t)||"string"==typeof t||"function"==typeof t.splice||Ja(t)||fs(t)||Wa(t)))return!t.length;var e=yo(t);if(e==E||e==C)return!t.size;if(So(t))return!Dr(t).length;for(var n in t)if(Ot.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return Ir(t,e)},Hn.isEqualWith=function(t,e,r){var i=(r="function"==typeof r?r:n)?r(t,e):n;return i===n?Ir(t,e,n,r):!!i},Hn.isError=Xa,Hn.isFinite=function(t){return"number"==typeof t&&yn(t)},Hn.isFunction=ts,Hn.isInteger=es,Hn.isLength=ns,Hn.isMap=os,Hn.isMatch=function(t,e){return t===e||Rr(t,e,fo(e))},Hn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Rr(t,e,fo(e),r)},Hn.isNaN=function(t){return as(t)&&t!=+t},Hn.isNative=function(t){if(Mo(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=as,Hn.isObject=rs,Hn.isObjectLike=is,Hn.isPlainObject=ss,Hn.isRegExp=us,Hn.isSafeInteger=function(t){return es(t)&&t>=-9007199254740991&&t<=f},Hn.isSet=ls,Hn.isString=cs,Hn.isSymbol=hs,Hn.isTypedArray=fs,Hn.isUndefined=function(t){return t===n},Hn.isWeakMap=function(t){return is(t)&&yo(t)==B},Hn.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==xr(t)},Hn.join=function(t,e){return null==t?"":vn.call(t,e)},Hn.kebabCase=qs,Hn.last=Xo,Hn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ys(r))<0?wn(i+o,0):An(o,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):De(t,Ue,o,!0)},Hn.lowerCase=Ys,Hn.lowerFirst=Vs,Hn.lt=ds,Hn.lte=ps,Hn.max=function(t){return t&&t.length?yr(t,au,Cr):n},Hn.maxBy=function(t,e){return t&&t.length?yr(t,co(e,2),Cr):n},Hn.mean=function(t){return He(t,au)},Hn.meanBy=function(t,e){return He(t,co(e,2))},Hn.min=function(t){return t&&t.length?yr(t,au,jr):n},Hn.minBy=function(t,e){return t&&t.length?yr(t,co(e,2),jr):n},Hn.stubArray=vu,Hn.stubFalse=bu,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Mu,Hn.nth=function(t,e){return t&&t.length?Qr(t,ys(e)):n},Hn.noConflict=function(){return he._===this&&(he._=Ut),this},Hn.noop=hu,Hn.now=Ta,Hn.pad=function(t,e,n){t=As(t);var r=(e=ys(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Wi(Oe(i),n)+t+Wi(me(i),n)},Hn.padEnd=function(t,e,n){t=As(t);var r=(e=ys(e))?hn(t):0;return e&&r<e?t+Wi(e-r,n):t},Hn.padStart=function(t,e,n){t=As(t);var r=(e=ys(e))?hn(t):0;return e&&r<e?Wi(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),En(As(t).replace(it,""),e||0)},Hn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&_o(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=ms(t),e===n?(e=t,t=0):e=ms(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var o=kn();return An(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Kr(t,e)},Hn.reduce=function(t,e,n){var r=qa(t)?Pe:Qe,i=arguments.length<3;return r(t,co(e,4),n,i,pr)},Hn.reduceRight=function(t,e,n){var r=qa(t)?Ie:Qe,i=arguments.length<3;return r(t,co(e,4),n,i,gr)},Hn.repeat=function(t,e,r){return e=(r?_o(t,e,r):e===n)?1:ys(e),Jr(As(t),e)},Hn.replace=function(){var t=arguments,e=As(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,r){var i=-1,o=(e=Ai(e,t)).length;for(o||(o=1,t=n);++i<o;){var a=null==t?n:t[jo(e[i])];a===n&&(i=o,a=r),t=ts(a)?a.call(t):a}return t},Hn.round=Su,Hn.runInContext=t,Hn.sample=function(t){return(qa(t)?Xn:Xr)(t)},Hn.size=function(t){if(null==t)return 0;if(Va(t))return cs(t)?hn(t):t.length;var e=yo(t);return e==E||e==C?t.size:Dr(t).length},Hn.snakeCase=Ks,Hn.some=function(t,e,r){var i=qa(t)?Re:ai;return r&&_o(t,e,r)&&(e=n),i(t,co(e,3))},Hn.sortedIndex=function(t,e){return si(t,e)},Hn.sortedIndexBy=function(t,e,n){return ui(t,e,co(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=si(t,e);if(r<n&&za(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return si(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ui(t,e,co(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=si(t,e,!0)-1;if(za(t[n],e))return n}return-1},Hn.startCase=Js,Hn.startsWith=function(t,e,n){return t=As(t),n=null==n?0:lr(ys(n),0,t.length),e=hi(e),t.slice(n,n+e.length)==e},Hn.subtract=xu,Hn.sum=function(t){return t&&t.length?We(t,au):0},Hn.sumBy=function(t,e){return t&&t.length?We(t,co(e,2)):0},Hn.template=function(t,e,r){var i=Hn.templateSettings;r&&_o(t,e,r)&&(e=n),t=As(t),e=ks({},e,i,to);var o,a,s=ks({},e.imports,i.imports,to),u=Is(s),l=Ke(s,u),c=0,h=e.interpolate||wt,f="__p += '",d=Ct((e.escape||wt).source+"|"+h.source+"|"+(h===Z?ft:wt).source+"|"+(e.evaluate||wt).source+"|$","g"),p="//# sourceURL="+(Ot.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),f+=t.slice(c,u).replace(At,rn),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),f+="';\n";var g=Ot.call(e,"variable")&&e.variable;if(g){if(ct.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(z,""):f).replace(G,"$1").replace(Q,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m=eu((function(){return Mt(u,p+"return "+f).apply(n,l)}));if(m.source=f,Xa(m))throw m;return m},Hn.times=function(t,e){if((t=ys(t))<1||t>f)return[];var n=p,r=An(t,p);e=co(e),t-=p;for(var i=qe(r,e);++n<t;)e(n);return i},Hn.toFinite=ms,Hn.toInteger=ys,Hn.toLength=vs,Hn.toLower=function(t){return As(t).toLowerCase()},Hn.toNumber=bs,Hn.toSafeInteger=function(t){return t?lr(ys(t),-9007199254740991,f):0===t?t:0},Hn.toString=As,Hn.toUpper=function(t){return As(t).toUpperCase()},Hn.trim=function(t,e,r){if((t=As(t))&&(r||e===n))return Ye(t);if(!t||!(e=hi(e)))return t;var i=fn(t),o=fn(e);return Ei(i,Ze(i,o),Xe(i,o)+1).join("")},Hn.trimEnd=function(t,e,r){if((t=As(t))&&(r||e===n))return t.slice(0,dn(t)+1);if(!t||!(e=hi(e)))return t;var i=fn(t);return Ei(i,0,Xe(i,fn(e))+1).join("")},Hn.trimStart=function(t,e,r){if((t=As(t))&&(r||e===n))return t.replace(it,"");if(!t||!(e=hi(e)))return t;var i=fn(t);return Ei(i,Ze(i,fn(e))).join("")},Hn.truncate=function(t,e){var r=30,i="...";if(rs(e)){var o="separator"in e?e.separator:o;r="length"in e?ys(e.length):r,i="omission"in e?hi(e.omission):i}var a=(t=As(t)).length;if(on(t)){var s=fn(t);a=s.length}if(r>=a)return t;var u=r-hn(i);if(u<1)return i;var l=s?Ei(s,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(s&&(u+=l.length-u),us(o)){if(t.slice(u).search(o)){var c,h=l;for(o.global||(o=Ct(o.source,As(dt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var f=c.index;l=l.slice(0,f===n?u:f)}}else if(t.indexOf(hi(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+i},Hn.unescape=function(t){return(t=As(t))&&Y.test(t)?t.replace(W,pn):t},Hn.uniqueId=function(t){var e=++Lt;return As(t)+e},Hn.upperCase=Zs,Hn.upperFirst=Xs,Hn.each=Aa,Hn.eachRight=_a,Hn.first=Vo,cu(Hn,(ku={},_r(Hn,(function(t,e){Ot.call(Hn.prototype,e)||(ku[e]=t)})),ku),{chain:!1}),Hn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Me(["drop","take"],(function(t,e){Wn.prototype[t]=function(r){r=r===n?1:wn(ys(r),0);var i=this.__filtered__&&!e?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=An(r,i.__takeCount__):i.__views__.push({size:An(r,p),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:co(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(au)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Zr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return $r(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Da(co(t)))},Wn.prototype.slice=function(t,e){t=ys(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Wn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ys(e))<0?r.dropRight(-e):r.take(e-t)),r)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(p)},_r(Wn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Hn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Hn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof Wn,l=s[0],c=u||qa(e),h=function(t){var e=o.apply(Hn,$e([t],s));return i&&f?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,g=u&&!d;if(!a&&c){e=g?e:new Wn(this);var m=t.apply(e,s);return m.__actions__.push({func:ma,args:[h],thisArg:n}),new Qn(m,f)}return p&&g?t.apply(this,s):(m=this.thru(h),p?i?m.value()[0]:m.value():m)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Bt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],t)}return this[n]((function(n){return e.apply(qa(n)?n:[],t)}))}})),_r(Wn.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Ot.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:e,func:n})}})),Pn[Hi(n,2).name]=[{name:"wrapper",func:n}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Bi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Bi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Bi(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qa(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=An(e,t+a);break;case"takeRight":t=wn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,h=c.length,f=0,d=An(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return mi(t,this.__actions__);var p=[];t:for(;u--&&f<d;){for(var g=-1,m=t[l+=e];++g<h;){var y=c[g],v=y.iteratee,b=y.type,w=v(m);if(2==b)m=w;else if(!w){if(1==b)continue t;break t}}p[f++]=m}return p},Hn.prototype.at=ya,Hn.prototype.chain=function(){return ga(this)},Hn.prototype.commit=function(){return new Qn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===n&&(this.__values__=gs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,r=this;r instanceof Gn;){var i=Ho(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Qn(e,this.__chain__)}return this.thru(ra)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ae&&(Hn.prototype[ae]=function(){return this}),Hn}();de?((de.exports=gn)._=gn,fe._=gn):he._=gn}).call(commonjsGlobal$3)})),EXP_LIMIT=9e15,MAX_DIGITS=1e9,NUMERALS="0123456789abcdef",LN10="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",PI="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",DEFAULTS={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-EXP_LIMIT,maxE:EXP_LIMIT,crypto:!1},inexact,quadrant,external=!0,decimalError="[DecimalError] ",invalidArgument=decimalError+"Invalid argument: ",precisionLimitExceeded=decimalError+"Precision limit exceeded",cryptoUnavailable=decimalError+"crypto unavailable",tag="[object Decimal]",mathfloor=Math.floor,mathpow=Math.pow,isBinary=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,isHex=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,isOctal=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,isDecimal=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,BASE=1e7,LOG_BASE=7,MAX_SAFE_INTEGER=9007199254740991,LN10_PRECISION=LN10.length-1,PI_PRECISION=PI.length-1,P={toStringTag:tag};function digitsToString(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;e<i;e++)r=t[e]+"",(n=LOG_BASE-r.length)&&(o+=getZeroString(n)),o+=r;a=t[e],(n=LOG_BASE-(r=a+"").length)&&(o+=getZeroString(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function checkInt32(t,e,n){if(t!==~~t||t<e||t>n)throw Error(invalidArgument+t)}function checkRoundingDigits(t,e,n,r){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=LOG_BASE,i=0):(i=Math.ceil((e+1)/LOG_BASE),e%=LOG_BASE),o=mathpow(10,LOG_BASE-e),s=t[i]%o|0,null==r?e<3?(0==e?s=s/100|0:1==e&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(t[i+1]/o/100|0)==mathpow(10,e-2)-1||(s==o/2||0==s)&&0==(t[i+1]/o/100|0):e<4?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==mathpow(10,e-3)-1,a}function convertBase(t,e,n){for(var r,i,o=[0],a=0,s=t.length;a<s;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=NUMERALS.indexOf(t.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function cosine(t,e){var n,r,i;if(e.isZero())return e;(r=e.d.length)<32?i=(1/tinyPow(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=taylorSeries(t,1,e.times(i),new t(1));for(var o=n;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=n,e}P.absoluteValue=P.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),finalise(t)},P.ceil=function(){return finalise(new this.constructor(this),this.e+1,2)},P.clampedTo=P.clamp=function(t,e){var n=this,r=n.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(invalidArgument+e);return n.cmp(t)<0?t:n.cmp(e)>0?e:new r(n)},P.comparedTo=P.cmp=function(t){var e,n,r,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,u=o.s,l=t.s;if(!a||!s)return u&&l?u!==l?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-l:0;if(u!==l)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,n=(r=a.length)<(i=s.length)?r:i;e<n;++e)if(a[e]!==s[e])return a[e]>s[e]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},P.cosine=P.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+LOG_BASE,r.rounding=1,n=cosine(r,toLessThanHalfPi(r,n)),r.precision=t,r.rounding=e,finalise(2==quadrant||3==quadrant?n.neg():n,t,e,!0)):new r(1):new r(NaN)},P.cubeRoot=P.cbrt=function(){var t,e,n,r,i,o,a,s,u,l,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(external=!1,(o=c.s*mathpow(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=digitsToString(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=mathpow(n,1/3),t=mathfloor((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),a=(t=h.precision)+3;;)if(l=(u=(s=r).times(s).times(s)).plus(c),r=divide(l.plus(c).times(s),l.plus(u),a+2,1),digitsToString(s.d).slice(0,a)===(n=digitsToString(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(finalise(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(finalise(s,t+1,0),s.times(s).times(s).eq(c))){r=s;break}a+=4,i=1}return external=!0,finalise(r,t,h.rounding,e)},P.decimalPlaces=P.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=((t=e.length-1)-mathfloor(this.e/LOG_BASE))*LOG_BASE,t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},P.dividedBy=P.div=function(t){return divide(this,new this.constructor(t))},P.dividedToIntegerBy=P.divToInt=function(t){var e=this.constructor;return finalise(divide(this,new e(t),0,1,1),e.precision,e.rounding)},P.equals=P.eq=function(t){return 0===this.cmp(t)},P.floor=function(){return finalise(new this.constructor(this),this.e+1,3)},P.greaterThan=P.gt=function(t){return this.cmp(t)>0},P.greaterThanOrEqualTo=P.gte=function(t){var e=this.cmp(t);return 1==e||0===e},P.hyperbolicCosine=P.cosh=function(){var t,e,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/tinyPow(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=taylorSeries(a,1,o.times(e),new a(1),!0);for(var u,l=t,c=new a(8);l--;)u=o.times(o),o=s.minus(u.times(c.minus(u.times(c))));return finalise(o,a.precision=n,a.rounding=r,!0)},P.hyperbolicSine=P.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=taylorSeries(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=taylorSeries(o,2,i=i.times(1/tinyPow(5,t)),i,!0);for(var a,s=new o(5),u=new o(16),l=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(l))))}return o.precision=e,o.rounding=n,finalise(i,e,n,!0)},P.hyperbolicTangent=P.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,divide(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},P.inverseCosine=P.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?getPi(n,i,o):new n(0):new n(NaN):e.isZero()?getPi(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=getPi(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},P.inverseHyperbolicCosine=P.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,external=!1,n=n.times(n).minus(1).sqrt().plus(n),external=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},P.inverseHyperbolicSine=P.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,external=!1,n=n.times(n).plus(1).sqrt().plus(n),external=!0,r.precision=t,r.rounding=e,n.ln())},P.inverseHyperbolicTangent=P.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?finalise(new o(i),t,e,!0):(o.precision=n=r-i.e,i=divide(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},P.inverseSine=P.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=getPi(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},P.inverseTangent=P.atan=function(){var t,e,n,r,i,o,a,s,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&h+4<=PI_PRECISION)return(a=getPi(c,h+4,f).times(.25)).s=l.s,a}else{if(!l.s)return new c(NaN);if(h+4<=PI_PRECISION)return(a=getPi(c,h+4,f).times(.5)).s=l.s,a}for(c.precision=s=h+10,c.rounding=1,t=n=Math.min(28,s/LOG_BASE+2|0);t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(external=!1,e=Math.ceil(s/LOG_BASE),r=1,u=l.times(l),a=new c(l),i=l;-1!==t;)if(i=i.times(u),o=a.minus(i.div(r+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(r+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return n&&(a=a.times(2<<n-1)),external=!0,finalise(a,c.precision=h,c.rounding=f,!0)},P.isFinite=function(){return!!this.d},P.isInteger=P.isInt=function(){return!!this.d&&mathfloor(this.e/LOG_BASE)>this.d.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isPositive=P.isPos=function(){return this.s>0},P.isZero=function(){return!!this.d&&0===this.d[0]},P.lessThan=P.lt=function(t){return this.cmp(t)<0},P.lessThanOrEqualTo=P.lte=function(t){return this.cmp(t)<1},P.logarithm=P.log=function(t){var e,n,r,i,o,a,s,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(null==t)t=new c(10),e=!0;else{if(n=(t=new c(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new c(n&&!n[0]?-1/0:1!=l.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(external=!1,a=naturalLogarithm(l,s=h+5),r=e?getLn10(c,s+10):naturalLogarithm(t,s),checkRoundingDigits((u=divide(a,r,s,1)).d,i=h,f))do{if(a=naturalLogarithm(l,s+=10),r=e?getLn10(c,s+10):naturalLogarithm(t,s),u=divide(a,r,s,1),!o){+digitsToString(u.d).slice(i+1,i+15)+1==1e14&&(u=finalise(u,h+1,0));break}}while(checkRoundingDigits(u.d,i+=10,f));return external=!0,finalise(u,h,f)},P.minus=P.sub=function(t){var e,n,r,i,o,a,s,u,l,c,h,f,d=this,p=d.constructor;if(t=new p(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new p(t.d||d.s!==t.s?d:NaN):t=new p(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(l=d.d,f=t.d,s=p.precision,u=p.rounding,!l[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!l[0])return new p(3===u?-0:0);t=new p(d)}return external?finalise(t,s,u):t}if(n=mathfloor(t.e/LOG_BASE),c=mathfloor(d.e/LOG_BASE),l=l.slice(),o=c-n){for((h=o<0)?(e=l,o=-o,a=f.length):(e=f,n=c,a=l.length),o>(r=Math.max(Math.ceil(s/LOG_BASE),a)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=l.length)<(a=f.length))&&(a=r),r=0;r<a;r++)if(l[r]!=f[r]){h=l[r]<f[r];break}o=0}for(h&&(e=l,l=f,f=e,t.s=-t.s),a=l.length,r=f.length-a;r>0;--r)l[a++]=0;for(r=f.length;r>o;){if(l[--r]<f[r]){for(i=r;i&&0===l[--i];)l[i]=BASE-1;--l[i],l[r]+=BASE}l[r]-=f[r]}for(;0===l[--a];)l.pop();for(;0===l[0];l.shift())--n;return l[0]?(t.d=l,t.e=getBase10Exponent(l,n),external?finalise(t,s,u):t):new p(3===u?-0:0)},P.modulo=P.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?finalise(new r(n),r.precision,r.rounding):(external=!1,9==r.modulo?(e=divide(n,t.abs(),0,3,1)).s*=t.s:e=divide(n,t,0,r.modulo,1),e=e.times(t),external=!0,n.minus(e))},P.naturalExponential=P.exp=function(){return naturalExponential(this)},P.naturalLogarithm=P.ln=function(){return naturalLogarithm(this)},P.negated=P.neg=function(){var t=new this.constructor(this);return t.s=-t.s,finalise(t)},P.plus=P.add=function(t){var e,n,r,i,o,a,s,u,l,c,h=this,f=h.constructor;if(t=new f(t),!h.d||!t.d)return h.s&&t.s?h.d||(t=new f(t.d||h.s===t.s?h:NaN)):t=new f(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.minus(t);if(l=h.d,c=t.d,s=f.precision,u=f.rounding,!l[0]||!c[0])return c[0]||(t=new f(h)),external?finalise(t,s,u):t;if(o=mathfloor(h.e/LOG_BASE),r=mathfloor(t.e/LOG_BASE),l=l.slice(),i=o-r){for(i<0?(n=l,i=-i,a=c.length):(n=c,r=o,a=l.length),i>(a=(o=Math.ceil(s/LOG_BASE))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=l.length)-(i=c.length)<0&&(i=a,n=c,c=l,l=n),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/BASE|0,l[i]%=BASE;for(e&&(l.unshift(e),++r),a=l.length;0==l[--a];)l.pop();return t.d=l,t.e=getBase10Exponent(l,r),external?finalise(t,s,u):t},P.precision=P.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(invalidArgument+t);return n.d?(e=getPrecision(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},P.round=function(){var t=this,e=t.constructor;return finalise(new e(t),t.e+1,e.rounding)},P.sine=P.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+LOG_BASE,r.rounding=1,n=sine(r,toLessThanHalfPi(r,n)),r.precision=t,r.rounding=e,finalise(quadrant>2?n.neg():n,t,e,!0)):new r(NaN)},P.squareRoot=P.sqrt=function(){var t,e,n,r,i,o,a=this,s=a.d,u=a.e,l=a.s,c=a.constructor;if(1!==l||!s||!s[0])return new c(!l||l<0&&(!s||s[0])?NaN:s?a:1/0);for(external=!1,0==(l=Math.sqrt(+a))||l==1/0?(((e=digitsToString(s)).length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=mathfloor((u+1)/2)-(u<0||u%2),r=new c(e=l==1/0?"5e"+u:(e=l.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new c(l.toString()),n=(u=c.precision)+3;;)if(r=(o=r).plus(divide(a,o,n+2,1)).times(.5),digitsToString(o.d).slice(0,n)===(e=digitsToString(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(finalise(r,u+1,1),t=!r.times(r).eq(a));break}if(!i&&(finalise(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return external=!0,finalise(r,u,c.rounding,t)},P.tangent=P.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=divide(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,finalise(2==quadrant||4==quadrant?n.neg():n,t,e,!0)):new r(NaN)},P.times=P.mul=function(t){var e,n,r,i,o,a,s,u,l,c=this,h=c.constructor,f=c.d,d=(t=new h(t)).d;if(t.s*=c.s,!(f&&f[0]&&d&&d[0]))return new h(!t.s||f&&!f[0]&&!d||d&&!d[0]&&!f?NaN:f&&d?0*t.s:t.s/0);for(n=mathfloor(c.e/LOG_BASE)+mathfloor(t.e/LOG_BASE),(u=f.length)<(l=d.length)&&(o=f,f=d,d=o,a=u,u=l,l=a),o=[],r=a=u+l;r--;)o.push(0);for(r=l;--r>=0;){for(e=0,i=u+r;i>r;)s=o[i]+d[r]*f[i-r-1]+e,o[i--]=s%BASE|0,e=s/BASE|0;o[i]=(o[i]+e)%BASE|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=getBase10Exponent(o,n),external?finalise(t,h.precision,h.rounding):t},P.toBinary=function(t,e){return toStringBinary(this,2,t,e)},P.toDecimalPlaces=P.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(checkInt32(t,0,MAX_DIGITS),void 0===e?e=r.rounding:checkInt32(e,0,8),finalise(n,t+n.e+1,e))},P.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=finiteToString(r,!0):(checkInt32(t,0,MAX_DIGITS),void 0===e?e=i.rounding:checkInt32(e,0,8),n=finiteToString(r=finalise(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},P.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=finiteToString(i):(checkInt32(t,0,MAX_DIGITS),void 0===e?e=o.rounding:checkInt32(e,0,8),n=finiteToString(r=finalise(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},P.toFraction=function(t){var e,n,r,i,o,a,s,u,l,c,h,f,d=this,p=d.d,g=d.constructor;if(!p)return new g(d);if(l=n=new g(1),r=u=new g(0),a=(o=(e=new g(r)).e=getPrecision(p)-d.e-1)%LOG_BASE,e.d[0]=mathpow(10,a<0?LOG_BASE+a:a),null==t)t=o>0?e:l;else{if(!(s=new g(t)).isInt()||s.lt(l))throw Error(invalidArgument+s);t=s.gt(e)?o>0?e:l:s}for(external=!1,s=new g(digitsToString(p)),c=g.precision,g.precision=o=p.length*LOG_BASE*2;h=divide(s,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=l,l=u.plus(h.times(i)),u=i,i=e,e=s.minus(h.times(i)),s=i;return i=divide(t.minus(n),r,0,1,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=d.s,f=divide(l,r,o,1).minus(d).abs().cmp(divide(u,n,o,1).minus(d).abs())<1?[l,r]:[u,n],g.precision=c,external=!0,f},P.toHexadecimal=P.toHex=function(t,e){return toStringBinary(this,16,t,e)},P.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:checkInt32(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(external=!1,n=divide(n,t,0,e,1).times(t),external=!0,finalise(n)):(t.s=n.s,n=t),n},P.toNumber=function(){return+this},P.toOctal=function(t,e){return toStringBinary(this,8,t,e)},P.toPower=P.pow=function(t){var e,n,r,i,o,a,s=this,u=s.constructor,l=+(t=new u(t));if(!(s.d&&t.d&&s.d[0]&&t.d[0]))return new u(mathpow(+s,l));if((s=new u(s)).eq(1))return s;if(r=u.precision,o=u.rounding,t.eq(1))return finalise(s,r,o);if((e=mathfloor(t.e/LOG_BASE))>=t.d.length-1&&(n=l<0?-l:l)<=MAX_SAFE_INTEGER)return i=intPow(u,s,n,r),t.s<0?new u(1).div(i):finalise(i,r,o);if((a=s.s)<0){if(e<t.d.length-1)return new u(NaN);if(0==(1&t.d[e])&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(e=0!=(n=mathpow(+s,l))&&isFinite(n)?new u(n+"").e:mathfloor(l*(Math.log("0."+digitsToString(s.d))/Math.LN10+s.e+1)))>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(external=!1,u.rounding=s.s=1,n=Math.min(12,(e+"").length),(i=naturalExponential(t.times(naturalLogarithm(s,r+n)),r)).d&&checkRoundingDigits((i=finalise(i,r+5,1)).d,r,o)&&(e=r+10,+digitsToString((i=finalise(naturalExponential(t.times(naturalLogarithm(s,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=finalise(i,r+1,0))),i.s=a,external=!0,u.rounding=o,finalise(i,r,o))},P.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=finiteToString(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(checkInt32(t,1,MAX_DIGITS),void 0===e?e=i.rounding:checkInt32(e,0,8),n=finiteToString(r=finalise(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},P.toSignificantDigits=P.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(checkInt32(t,1,MAX_DIGITS),void 0===e?e=n.rounding:checkInt32(e,0,8)),finalise(new n(this),t,e)},P.toString=function(){var t=this,e=t.constructor,n=finiteToString(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},P.truncated=P.trunc=function(){return finalise(new this.constructor(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var t=this,e=t.constructor,n=finiteToString(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var divide=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,o,a,s,u){var l,c,h,f,d,p,g,m,y,v,b,w,A,_,E,k,M,S,x,C,T=r.constructor,N=r.s==i.s?1:-1,B=r.d,$=i.d;if(!(B&&B[0]&&$&&$[0]))return new T(r.s&&i.s&&(B?!$||B[0]!=$[0]:$)?B&&0==B[0]||!$?0*N:N/0:NaN);for(u?(d=1,c=r.e-i.e):(u=BASE,d=LOG_BASE,c=mathfloor(r.e/d)-mathfloor(i.e/d)),x=$.length,M=B.length,v=(y=new T(N)).d=[],h=0;$[h]==(B[h]||0);h++);if($[h]>(B[h]||0)&&c--,null==o?(_=o=T.precision,a=T.rounding):_=s?o+(r.e-i.e)+1:o,_<0)v.push(1),p=!0;else{if(_=_/d+2|0,h=0,1==x){for(f=0,$=$[0],_++;(h<M||f)&&_--;h++)E=f*u+(B[h]||0),v[h]=E/$|0,f=E%$|0;p=f||h<M}else{for((f=u/($[0]+1)|0)>1&&($=t($,f,u),B=t(B,f,u),x=$.length,M=B.length),k=x,w=(b=B.slice(0,x)).length;w<x;)b[w++]=0;(C=$.slice()).unshift(0),S=$[0],$[1]>=u/2&&++S;do{f=0,(l=e($,b,x,w))<0?(A=b[0],x!=w&&(A=A*u+(b[1]||0)),(f=A/S|0)>1?(f>=u&&(f=u-1),1==(l=e(g=t($,f,u),b,m=g.length,w=b.length))&&(f--,n(g,x<m?C:$,m,u))):(0==f&&(l=f=1),g=$.slice()),(m=g.length)<w&&g.unshift(0),n(b,g,w,u),-1==l&&(l=e($,b,x,w=b.length))<1&&(f++,n(b,x<w?C:$,w,u)),w=b.length):0===l&&(f++,b=[0]),v[h++]=f,l&&b[0]?b[w++]=B[k]||0:(b=[B[k]],w=1)}while((k++<M||void 0!==b[0])&&_--);p=void 0!==b[0]}v[0]||v.shift()}if(1==d)y.e=c,inexact=p;else{for(h=1,f=v[0];f>=10;f/=10)h++;y.e=h+c*d-1,finalise(y,s?o+y.e+1:o,a,p)}return y}}();function finalise(t,e,n,r){var i,o,a,s,u,l,c,h,f,d=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,s=h[0];s>=10;s/=10)i++;if((o=e-i)<0)o+=LOG_BASE,a=e,u=(c=h[f=0])/mathpow(10,i-a-1)%10|0;else if((f=Math.ceil((o+1)/LOG_BASE))>=(s=h.length)){if(!r)break t;for(;s++<=f;)h.push(0);c=u=0,i=1,a=(o%=LOG_BASE)-LOG_BASE+1}else{for(c=s=h[f],i=1;s>=10;s/=10)i++;u=(a=(o%=LOG_BASE)-LOG_BASE+i)<0?0:c/mathpow(10,i-a-1)%10|0}if(r=r||e<0||void 0!==h[f+1]||(a<0?c:c%mathpow(10,i-a-1)),l=n<4?(u||r)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?a>0?c/mathpow(10,i-a):0:h[f-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,l?(e-=t.e+1,h[0]=mathpow(10,(LOG_BASE-e%LOG_BASE)%LOG_BASE),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=f,s=1,f--):(h.length=f+1,s=mathpow(10,LOG_BASE-o),h[f]=a>0?(c/mathpow(10,i-a)%mathpow(10,a)|0)*s:0),l)for(;;){if(0==f){for(o=1,a=h[0];a>=10;a/=10)o++;for(a=h[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,h[0]==BASE&&(h[0]=1));break}if(h[f]+=s,h[f]!=BASE)break;h[f--]=0,s=1}for(o=h.length;0===h[--o];)h.pop()}return external&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e<d.minE&&(t.e=0,t.d=[0])),t}function finiteToString(t,e,n){if(!t.isFinite())return nonFiniteToString(t);var r,i=t.e,o=digitsToString(t.d),a=o.length;return e?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+getZeroString(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+getZeroString(-i-1)+o,n&&(r=n-a)>0&&(o+=getZeroString(r))):i>=a?(o+=getZeroString(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+getZeroString(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=getZeroString(r))),o}function getBase10Exponent(t,e){var n=t[0];for(e*=LOG_BASE;n>=10;n/=10)e++;return e}function getLn10(t,e,n){if(e>LN10_PRECISION)throw external=!0,n&&(t.precision=n),Error(precisionLimitExceeded);return finalise(new t(LN10),e,1,!0)}function getPi(t,e,n){if(e>PI_PRECISION)throw Error(precisionLimitExceeded);return finalise(new t(PI),e,n,!0)}function getPrecision(t){var e=t.length-1,n=e*LOG_BASE+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function getZeroString(t){for(var e="";t--;)e+="0";return e}function intPow(t,e,n,r){var i,o=new t(1),a=Math.ceil(r/LOG_BASE+4);for(external=!1;;){if(n%2&&truncate((o=o.times(e)).d,a)&&(i=!0),0===(n=mathfloor(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}truncate((e=e.times(e)).d,a)}return external=!0,o}function isOdd(t){return 1&t.d[t.d.length-1]}function maxOrMin(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;){if(!(r=new t(e[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function naturalExponential(t,e){var n,r,i,o,a,s,u,l=0,c=0,h=0,f=t.constructor,d=f.rounding,p=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(external=!1,u=p):u=e,s=new f(.03125);t.e>-2;)t=t.times(s),h+=5;for(u+=r=Math.log(mathpow(2,h))/Math.LN10*2+5|0,n=o=a=new f(1),f.precision=u;;){if(o=finalise(o.times(t),u,1),n=n.times(++c),digitsToString((s=a.plus(divide(o,n,u,1))).d).slice(0,u)===digitsToString(a.d).slice(0,u)){for(i=h;i--;)a=finalise(a.times(a),u,1);if(null!=e)return f.precision=p,a;if(!(l<3&&checkRoundingDigits(a.d,u-r,d,l)))return finalise(a,f.precision=p,d,external=!0);f.precision=u+=10,n=o=s=new f(1),c=0,l++}a=s}}function naturalLogarithm(t,e){var n,r,i,o,a,s,u,l,c,h,f,d=1,p=t,g=p.d,m=p.constructor,y=m.rounding,v=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(null==e?(external=!1,c=v):c=e,m.precision=c+=10,r=(n=digitsToString(g)).charAt(0),!(Math.abs(o=p.e)<15e14))return l=getLn10(m,c+2,v).times(o+""),p=naturalLogarithm(new m(r+"."+n.slice(1)),c-10).plus(l),m.precision=v,null==e?finalise(p,v,y,external=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=digitsToString((p=p.times(t)).d)).charAt(0),d++;for(o=p.e,r>1?(p=new m("0."+n),o++):p=new m(r+"."+n.slice(1)),h=p,u=a=p=divide(p.minus(1),p.plus(1),c,1),f=finalise(p.times(p),c,1),i=3;;){if(a=finalise(a.times(f),c,1),digitsToString((l=u.plus(divide(a,new m(i),c,1))).d).slice(0,c)===digitsToString(u.d).slice(0,c)){if(u=u.times(2),0!==o&&(u=u.plus(getLn10(m,c+2,v).times(o+""))),u=divide(u,new m(d),c,1),null!=e)return m.precision=v,u;if(!checkRoundingDigits(u.d,c-10,y,s))return finalise(u,m.precision=v,y,external=!0);m.precision=c+=10,l=a=p=divide(h.minus(1),h.plus(1),c,1),f=finalise(p.times(p),c,1),i=s=1}u=l,i+=2}}function nonFiniteToString(t){return String(t.s*t.s/0)}function parseDecimal(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%LOG_BASE,n<0&&(r+=LOG_BASE),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=LOG_BASE;r<i;)t.d.push(+e.slice(r,r+=LOG_BASE));e=e.slice(r),r=LOG_BASE-e.length}else r-=i;for(;r--;)e+="0";t.d.push(+e),external&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function parseOther(t,e){var n,r,i,o,a,s,u,l,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),isDecimal.test(e))return parseDecimal(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(isHex.test(e))n=16,e=e.toLowerCase();else if(isBinary.test(e))n=2;else{if(!isOctal.test(e))throw Error(invalidArgument+e);n=8}for((o=e.search(/p/i))>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),a=(o=e.indexOf("."))>=0,r=t.constructor,a&&(o=(s=(e=e.replace(".","")).length)-o,i=intPow(r,new r(n),o,2*o)),o=c=(l=convertBase(e,n,BASE)).length-1;0===l[o];--o)l.pop();return o<0?new r(0*t.s):(t.e=getBase10Exponent(l,c),t.d=l,external=!1,a&&(t=divide(t,i,4*s)),u&&(t=t.times(Math.abs(u)<54?mathpow(2,u):Decimal.pow(2,u))),external=!0,t)}function sine(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:taylorSeries(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=taylorSeries(t,2,e=e.times(1/tinyPow(5,n)),e);for(var i,o=new t(5),a=new t(16),s=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}function taylorSeries(t,e,n,r,i){var o,a,s,u,l=t.precision,c=Math.ceil(l/LOG_BASE);for(external=!1,u=n.times(n),s=new t(r);;){if(a=divide(s.times(u),new t(e++*e++),l,1),s=i?r.plus(a):r.minus(a),r=divide(a.times(u),new t(e++*e++),l,1),void 0!==(a=s.plus(r)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return external=!0,a.d.length=c+1,a}function tinyPow(t,e){for(var n=t;--e;)n*=t;return n}function toLessThanHalfPi(t,e){var n,r=e.s<0,i=getPi(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return quadrant=r?4:1,e;if((n=e.divToInt(i)).isZero())quadrant=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return quadrant=isOdd(n)?r?2:3:r?4:1,e;quadrant=isOdd(n)?r?1:4:r?3:2}return e.minus(i).abs()}function toStringBinary(t,e,n,r){var i,o,a,s,u,l,c,h,f,d=t.constructor,p=void 0!==n;if(p?(checkInt32(n,1,MAX_DIGITS),void 0===r?r=d.rounding:checkInt32(r,0,8)):(n=d.precision,r=d.rounding),t.isFinite()){for(p?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(c=finiteToString(t)).indexOf("."))>=0&&(c=c.replace(".",""),(f=new d(1)).e=c.length-a,f.d=convertBase(finiteToString(f),10,i),f.e=f.d.length),o=u=(h=convertBase(c,10,i)).length;0==h[--u];)h.pop();if(h[0]){if(a<0?o--:((t=new d(t)).d=h,t.e=o,h=(t=divide(t,f,n,r,0,i)).d,o=t.e,l=inexact),a=h[n],s=i/2,l=l||void 0!==h[n+1],l=r<4?(void 0!==a||l)&&(0===r||r===(t.s<0?3:2)):a>s||a===s&&(4===r||l||6===r&&1&h[n-1]||r===(t.s<0?8:7)),h.length=n,l)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(a=0,c="";a<u;a++)c+=NUMERALS.charAt(h[a]);if(p){if(u>1)if(16==e||8==e){for(a=16==e?4:3,--u;u%a;u++)c+="0";for(u=(h=convertBase(c,i,e)).length;!h[u-1];--u);for(a=1,c="1.";a<u;a++)c+=NUMERALS.charAt(h[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>u)for(o-=u;o--;)c+="0";else o<u&&(c=c.slice(0,o)+"."+c.slice(o))}else c=p?"0p+0":"0";c=(16==e?"0x":2==e?"0b":8==e?"0o":"")+c}else c=nonFiniteToString(t);return t.s<0?"-"+c:c}function truncate(t,e){if(t.length>e)return t.length=e,!0}function abs(t){return new this(t).abs()}function acos(t){return new this(t).acos()}function acosh(t){return new this(t).acosh()}function add(t,e){return new this(t).plus(e)}function asin(t){return new this(t).asin()}function asinh(t){return new this(t).asinh()}function atan(t){return new this(t).atan()}function atanh(t){return new this(t).atanh()}function atan2(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?getPi(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=getPi(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(divide(t,e,o,1)),e=getPi(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(divide(t,e,o,1)):(n=getPi(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function cbrt(t){return new this(t).cbrt()}function ceil(t){return finalise(t=new this(t),t.e+1,2)}function clamp(t,e,n){return new this(t).clamp(e,n)}function config(t){if(!t||"object"!=typeof t)throw Error(decimalError+"Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,MAX_DIGITS,"rounding",0,8,"toExpNeg",-EXP_LIMIT,0,"toExpPos",0,EXP_LIMIT,"maxE",0,EXP_LIMIT,"minE",-EXP_LIMIT,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(n=o[e],i&&(this[n]=DEFAULTS[n]),void 0!==(r=t[n])){if(!(mathfloor(r)===r&&r>=o[e+1]&&r<=o[e+2]))throw Error(invalidArgument+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=DEFAULTS[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(invalidArgument+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(cryptoUnavailable);this[n]=!0}else this[n]=!1}return this}function cos(t){return new this(t).cos()}function cosh(t){return new this(t).cosh()}function clone(t){var e,n,r;function i(t){var e,n,r,o=this;if(!(o instanceof i))return new i(t);if(o.constructor=i,isDecimalInstance(t))return o.s=t.s,void(external?!t.d||t.e>i.maxE?(o.e=NaN,o.d=null):t.e<i.minE?(o.e=0,o.d=[0]):(o.e=t.e,o.d=t.d.slice()):(o.e=t.e,o.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return o.s=1/t<0?-1:1,o.e=0,void(o.d=[0]);if(t<0?(t=-t,o.s=-1):o.s=1,t===~~t&&t<1e7){for(e=0,n=t;n>=10;n/=10)e++;return void(external?e>i.maxE?(o.e=NaN,o.d=null):e<i.minE?(o.e=0,o.d=[0]):(o.e=e,o.d=[t]):(o.e=e,o.d=[t]))}return 0*t!=0?(t||(o.s=NaN),o.e=NaN,void(o.d=null)):parseDecimal(o,t.toString())}if("string"!==r)throw Error(invalidArgument+t);return 45===(n=t.charCodeAt(0))?(t=t.slice(1),o.s=-1):(43===n&&(t=t.slice(1)),o.s=1),isDecimal.test(t)?parseDecimal(o,t):parseOther(o,t)}if(i.prototype=P,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=config,i.clone=clone,i.isDecimal=isDecimalInstance,i.abs=abs,i.acos=acos,i.acosh=acosh,i.add=add,i.asin=asin,i.asinh=asinh,i.atan=atan,i.atanh=atanh,i.atan2=atan2,i.cbrt=cbrt,i.ceil=ceil,i.clamp=clamp,i.cos=cos,i.cosh=cosh,i.div=div,i.exp=exp,i.floor=floor,i.hypot=hypot,i.ln=ln,i.log=log,i.log10=log10,i.log2=log2,i.max=max,i.min=min,i.mod=mod,i.mul=mul,i.pow=pow,i.random=random,i.round=round,i.sign=sign,i.sin=sin,i.sinh=sinh,i.sqrt=sqrt,i.sub=sub,i.sum=sum,i.tan=tan,i.tanh=tanh,i.trunc=trunc,void 0===t&&(t={}),t&&!0!==t.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<r.length;)t.hasOwnProperty(n=r[e++])||(t[n]=this[n]);return i.config(t),i}function div(t,e){return new this(t).div(e)}function exp(t){return new this(t).exp()}function floor(t){return finalise(t=new this(t),t.e+1,3)}function hypot(){var t,e,n=new this(0);for(external=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return external=!0,new this(1/0);n=e}return external=!0,n.sqrt()}function isDecimalInstance(t){return t instanceof Decimal||t&&t.toStringTag===tag||!1}function ln(t){return new this(t).ln()}function log(t,e){return new this(t).log(e)}function log2(t){return new this(t).log(2)}function log10(t){return new this(t).log(10)}function max(){return maxOrMin(this,arguments,"lt")}function min(){return maxOrMin(this,arguments,"gt")}function mod(t,e){return new this(t).mod(e)}function mul(t,e){return new this(t).mul(e)}function pow(t,e){return new this(t).pow(e)}function random(t){var e,n,r,i,o=0,a=new this(1),s=[];if(void 0===t?t=this.precision:checkInt32(t,1,MAX_DIGITS),r=Math.ceil(t/LOG_BASE),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(cryptoUnavailable);for(e=crypto.randomBytes(r*=4);o<r;)(i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(r=s[--o],t%=LOG_BASE,r&&t&&(i=mathpow(10,LOG_BASE-t),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=LOG_BASE)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<LOG_BASE&&(n-=LOG_BASE-r)}return a.e=n,a.d=s,a}function round(t){return finalise(t=new this(t),t.e+1,this.rounding)}function sign(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function sin(t){return new this(t).sin()}function sinh(t){return new this(t).sinh()}function sqrt(t){return new this(t).sqrt()}function sub(t,e){return new this(t).sub(e)}function sum(){var t=0,e=arguments,n=new this(e[t]);for(external=!1;n.s&&++t<e.length;)n=n.plus(e[t]);return external=!0,finalise(n,this.precision,this.rounding)}function tan(t){return new this(t).tan()}function tanh(t){return new this(t).tanh()}function trunc(t){return finalise(t=new this(t),t.e+1,1)}P[Symbol.for("nodejs.util.inspect.custom")]=P.toString,P[Symbol.toStringTag]="Decimal";var Decimal=P.constructor=clone(DEFAULTS);LN10=new Decimal(LN10),PI=new Decimal(PI);var BEP20=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getOwner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"renounceOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],ERC20=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],ERC20onPolygon=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}];class Token{constructor({blockchain:t,address:e}){this.blockchain=t,this.address=getAddress$2(e)}async decimals(){if(this.address==CONSTANTS$4[this.blockchain].NATIVE)return CONSTANTS$4[this.blockchain].DECIMALS;let t=0;try{t=await request({blockchain:this.blockchain,address:this.address,method:"decimals"},{api:Token[this.blockchain].DEFAULT,cache:864e5})}catch(t){}return t}async symbol(){return this.address==CONSTANTS$4[this.blockchain].NATIVE?CONSTANTS$4[this.blockchain].SYMBOL:await request({blockchain:this.blockchain,address:this.address,method:"symbol"},{api:Token[this.blockchain].DEFAULT,cache:864e5})}async name(){return this.address==CONSTANTS$4[this.blockchain].NATIVE?CONSTANTS$4[this.blockchain].CURRENCY:await request({blockchain:this.blockchain,address:this.address,method:"name"},{api:Token[this.blockchain].DEFAULT,cache:864e5})}async balance(t){return this.address==CONSTANTS$4[this.blockchain].NATIVE?await request({blockchain:this.blockchain,address:t,method:"balance"},{cache:3e4}):await request({blockchain:this.blockchain,address:this.address,method:"balanceOf"},{api:Token[this.blockchain].DEFAULT,params:[t],cache:3e4})}async allowance(t,e){return this.address==CONSTANTS$4[this.blockchain].NATIVE?BigNumber$3.from(CONSTANTS$4[this.blockchain].MAXINT):await request({blockchain:this.blockchain,address:this.address,method:"allowance"},{api:Token[this.blockchain].DEFAULT,params:[t,e],cache:3e4})}async BigNumber(t){let e=await this.decimals();return parseUnits$2(Token.safeAmount({amount:parseFloat(t),decimals:e}).toString(),e)}async readable(t){let e=await this.decimals(),n=formatUnits(t.toString(),e);return n=n.replace(/0+$/,""),n=n.replace(/\.$/,""),n}}Token.BigNumber=async({amount:t,blockchain:e,address:n})=>new Token({blockchain:e,address:n}).BigNumber(t),Token.readable=async({amount:t,blockchain:e,address:n})=>new Token({blockchain:e,address:n}).readable(t),Token.safeAmount=({amount:t,decimals:e})=>parseFloat(t.toFixed(e)),Token.ethereum={DEFAULT:ERC20,ERC20:ERC20},Token.bsc={DEFAULT:BEP20,BEP20:BEP20},Token.polygon={DEFAULT:ERC20onPolygon,ERC20:ERC20onPolygon};let UniswapV2Router02$1=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],UniswapV2Factory$1=[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],UniswapV2Pair$1=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var basics$2={blockchain:"ethereum",name:"uniswap_v2",alternativeNames:[],label:"Uniswap v2",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIABAMAAAAGVsnJAAAALVBMVEVHcEz/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHoZcglmAAAADnRSTlMACBMiNEtieI+kuc7j9HuCgRkAABrlSURBVHja7F37b1vVHT+2rx9xQIqoxKMpkyUGY22KLCp+GE0rbxLV2i2RKagIBlbUVUITkpWNINptRN1Yi7pqVjeNdUPDSkFj3UMWXSugW7FKCusAYbG1EhA0a92axEns8zfs3uvHPa97fa+vJX+V7/38FD9y7fO938fn+zjHJECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIIAJjSBHeIogxy6CHDH0KnCEIEcyS3AjfI4gx3ia4Eb0EkGOH6YIbgz9heBG6K8jBDfGTxDc0FYIcuQPE9xILBPkKGFPicYWCW5E/p0huJG7SnAjXseeEhXnCW6MriFPicKVUwQ3JlYJbsQo9pSoUCO4kaTTBDVC5SWCGzso8hZBlGLnw/kG8pQoQZG3CEKlOnI+PEaRtwi06iryFkEOOx+OU+x8uIidD49S5Hw4UsHOhyco8hZBjGLnwwX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0nGAzCmL3y29369p1zl9P3CvtiRhHrQ7P//Y0k0Msx/dsePapXj6RxhhhBFGGGGEEUYYYYQRRhhhhBFGGOF/7cEhAQAAAICg/6/dYAcAAAAAAAAAAIAtmJHpTFcLUiUAAAAASUVORK5CYII=",contracts:{router:{address:"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",api:UniswapV2Router02$1},factory:{address:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",api:UniswapV2Factory$1},pair:{api:UniswapV2Pair$1}}};let getAmount=async({amount:t,blockchain:e,address:n})=>await Token.BigNumber({amount:t,blockchain:e,address:n}),fixRouteParams=async({blockchain:t,exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:a,amountOut:s,amountInMax:u,amountOutMin:l})=>{let c={exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:a,amountOut:s,amountInMax:u,amountOutMin:l};return s&&"number"==typeof s&&(c.amountOut=await getAmount({amount:s,blockchain:t,address:o})),l&&"number"==typeof l&&(c.amountOutMin=await getAmount({amount:l,blockchain:t,address:o})),a&&"number"==typeof a&&(c.amountIn=await getAmount({amount:a,blockchain:t,address:i})),u&&"number"==typeof u&&(c.amountInMax=await getAmount({amount:u,blockchain:t,address:i})),c},preflight$3=({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s,amountOutMax:u,amountInMin:l})=>{if(void 0!==u)throw"You cannot not set amountOutMax! Only amountInMax or amountOutMin!";if(void 0!==l)throw"You cannot not set amountInMin! Only amountInMax or amountOutMin!";if(void 0!==o&&void 0!==i)throw"You cannot set amountIn and amountOut at the same time, use amountInMax or amountOutMin to describe the non exact part of the swap!";if(void 0!==a&&void 0!==s)throw"You cannot set amountInMax and amountOutMin at the same time, use amountIn or amountOut to describe the part of the swap that needs to be exact!";if(void 0!==i&&void 0!==a)throw"Setting amountIn and amountInMax at the same time makes no sense. Decide if amountIn needs to be exact or not!";if(void 0!==o&&void 0!==s)throw"Setting amountOut and amountOutMin at the same time makes no sense. Decide if amountOut needs to be exact or not!"};class Exchange{constructor({name:t,blockchain:e,alternativeNames:n,label:r,logo:i,contracts:o,route:a,getAmountIn:s}){this.name=t,this.blockchain=e,this.alternativeNames=n,this.label=r,this.logo=i,this.contracts=o,this._route=a,this.getAmountIn=s}async route({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s,amountOutMax:u,amountInMin:l}){return n===r?Promise.resolve():(preflight$3({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s,amountOutMax:u,amountInMin:l}),await this._route(await fixRouteParams({blockchain:this.blockchain,exchange:this,fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:a,amountOutMin:s})))}}function _optionalChain$3(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}class Route{constructor({tokenIn:t,tokenOut:e,path:n,amountIn:r,amountInMax:i,amountOut:o,amountOutMin:a,fromAddress:s,toAddress:u,transaction:l,exchange:c}){this.tokenIn=t,this.tokenOut=e,this.path=n,this.amountIn=_optionalChain$3([r,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOutMin=_optionalChain$3([a,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOut=_optionalChain$3([o,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountInMax=_optionalChain$3([i,"optionalAccess",t=>t.toString,"call",t=>t()]),this.fromAddress=s,this.toAddress=u,this.transaction=l,this.exchange=c}}function _optionalChain$2(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let fixUniswapPath$1=t=>{let e=t.map(((e,n)=>e===CONSTANTS$4.ethereum.NATIVE&&t[n+1]!=CONSTANTS$4.ethereum.WRAPPED&&t[n-1]!=CONSTANTS$4.ethereum.WRAPPED?CONSTANTS$4.ethereum.WRAPPED:e));return e[0]==CONSTANTS$4.ethereum.NATIVE&&e[1]==CONSTANTS$4.ethereum.WRAPPED?e.splice(0,1):e[e.length-1]==CONSTANTS$4.ethereum.NATIVE&&e[e.length-2]==CONSTANTS$4.ethereum.WRAPPED&&e.splice(e.length-1,1),e},minReserveRequirements$2=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(parseUnits$2(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(parseUnits$2(e.toString(),o)),pathExists$2=async t=>{if(1==fixUniswapPath$1(t).length)return!1;let e=await request({blockchain:"ethereum",address:basics$2.contracts.factory.address,method:"getPair"},{api:basics$2.contracts.factory.api,cache:36e5,params:fixUniswapPath$1(t)});if(e==CONSTANTS$4.ethereum.ZERO)return!1;let[n,r,i]=await Promise.all([request({blockchain:"ethereum",address:e,method:"getReserves"},{api:basics$2.contracts.pair.api,cache:36e5}),request({blockchain:"ethereum",address:e,method:"token0"},{api:basics$2.contracts.pair.api,cache:36e5}),request({blockchain:"ethereum",address:e,method:"token1"},{api:basics$2.contracts.pair.api,cache:36e5})]);if(t.includes(CONSTANTS$4.ethereum.WRAPPED))return minReserveRequirements$2({min:1,token:CONSTANTS$4.ethereum.WRAPPED,decimals:CONSTANTS$4.ethereum.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(CONSTANTS$4.ethereum.USD)){let t=new Token({blockchain:"ethereum",address:CONSTANTS$4.ethereum.USD}),e=await t.decimals();return minReserveRequirements$2({min:1e3,token:CONSTANTS$4.ethereum.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},findPath$2=async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(CONSTANTS$4.ethereum.NATIVE)&&[t,e].includes(CONSTANTS$4.ethereum.WRAPPED))return;let n;return await pathExists$2([t,e])?n=[t,e]:t!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([t,CONSTANTS$4.ethereum.WRAPPED])&&e!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([e,CONSTANTS$4.ethereum.WRAPPED])?n=[t,CONSTANTS$4.ethereum.WRAPPED,e]:t!=CONSTANTS$4.ethereum.USD&&await pathExists$2([t,CONSTANTS$4.ethereum.USD])&&e!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([CONSTANTS$4.ethereum.WRAPPED,e])?n=[t,CONSTANTS$4.ethereum.USD,CONSTANTS$4.ethereum.WRAPPED,e]:t!=CONSTANTS$4.ethereum.WRAPPED&&await pathExists$2([t,CONSTANTS$4.ethereum.WRAPPED])&&e!=CONSTANTS$4.ethereum.USD&&await pathExists$2([CONSTANTS$4.ethereum.USD,e])&&(n=[t,CONSTANTS$4.ethereum.WRAPPED,CONSTANTS$4.ethereum.USD,e]),_optionalChain$2([n,"optionalAccess",t=>t.length])&&n[0]==CONSTANTS$4.ethereum.NATIVE?n.splice(1,0,CONSTANTS$4.ethereum.WRAPPED):_optionalChain$2([n,"optionalAccess",t=>t.length])&&n[n.length-1]==CONSTANTS$4.ethereum.NATIVE&&n.splice(n.length-1,0,CONSTANTS$4.ethereum.WRAPPED),n},getAmountsOut$2=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{request({blockchain:"ethereum",address:basics$2.contracts.router.address,method:"getAmountsOut"},{api:basics$2.contracts.router.api,params:{amountIn:e,path:fixUniswapPath$1(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),getAmountIn$2=({path:t,amountOut:e,block:n})=>new Promise((r=>{request({blockchain:"ethereum",address:basics$2.contracts.router.address,method:"getAmountsIn"},{api:basics$2.contracts.router.api,params:{amountOut:e,path:fixUniswapPath$1(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),getAmounts$2=async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a})=>{if(r){if(null==(i=await getAmountIn$2({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await getAmountsOut$2({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}else if(a){if(null==(i=await getAmountIn$2({path:t,amountOut:a,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await getAmountsOut$2({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a}},getTransaction$2=({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:a,amountInMaxInput:s,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"ethereum",from:c,to:basics$2.contracts.router.address,api:basics$2.contracts.router.api};return t[0]===CONSTANTS$4.ethereum.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(a||s)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===CONSTANTS$4.ethereum.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:fixUniswapPath$1(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h};const fixCheckSum=t=>getAddress$2(t);let route$3=({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u})=>(e=fixCheckSum(e),n=fixCheckSum(n),new Promise((async l=>{let c=await findPath$2({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,a,s,u];if(({amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u}=await getAmounts$2({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u})),[o,s,a,u].every((t=>null==t)))return l();let g=getTransaction$2({path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new Route({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:g}))})));var uniswap_v2=new Exchange(Object.assign(basics$2,{route:route$3,getAmountIn:getAmountIn$2}));let PancakeRouter=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],PancakeFactory=[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[],name:"INIT_CODE_PAIR_HASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],PancakePair=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var basics$1={blockchain:"bsc",name:"pancakeswap",alternativeNames:["pancake"],label:"PancakeSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAOVBMVEVHcExjMAH+3JBcJwCSb05+VC7RiE9qOg/EsZ+jhWpfLADXjlT/45Z5QxGVWiaubzi9fkXuxH3dqmiL4XhdAAAACnRSTlMA////msX/6i5cADBNDwAAGz9JREFUeNrsnOGSmzoMhcMYg60MhPd/2itjNrSNSQKWWPtyvj/d2bZbVT46lozJDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4CjO+9ba/om1tvXuVg7u7/j60uKrmZDbngwFmpnwFX+jKSPJc3xNDLCJLPH11pcQYNW4Nua2ScC/YahvfzXFztv38TUWGshafbPmdiPJze9pwLM1rYu/JQI2ghs4kN32ufofNfAbKWZ5Pkv/kwbsr2m0Wrw1Zs3h5xz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jKB15UgGkjlxO8IhrBU9lHAKqbVP9rHVDgqQ4fQPo3Bf1HiN8DINX/WQfuAAFqEx4IKMrvA5QHfJnBZkBUMvL5Q06BIBohEOEPgjyNgQQUJ24i/KFg3MBXPPcOJN2X1g+M3JAAggwH3wNJ9iXybQaygzviMfwAEdRdZH9z5I+eBErtygL65VR8ift7IX88zMLQ297OveufcU8af3cQC9IhGATnAfYApK5PHyL6h0JOnnC73xX62+P/d55AKf9+k7Y/NIgHqeEBAsKP3oCm7s/KpxL04kHPA2MMt7vhgrEHwL93CEgAM9WN/W7EXno+YuQmI6S3Hncn0Ff23yBVFwgEAoFAIBAIBAKBQCAQCAQCwb/24JAAAAAAQND/166wAQAAAAAAAAAAAAAAAAAAAAAAswCsVemaah0CHgAAAABJRU5ErkJggg==",contracts:{router:{address:"0x10ED43C718714eb63d5aA57B78B54704E256024E",api:PancakeRouter},factory:{address:"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",api:PancakeFactory},pair:{api:PancakePair}}};function _optionalChain$1$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let fixUniswapPath=t=>{let e=t.map(((e,n)=>e===CONSTANTS$4.bsc.NATIVE&&t[n+1]!=CONSTANTS$4.bsc.WRAPPED&&t[n-1]!=CONSTANTS$4.bsc.WRAPPED?CONSTANTS$4.bsc.WRAPPED:e));return e[0]==CONSTANTS$4.bsc.NATIVE&&e[1]==CONSTANTS$4.bsc.WRAPPED?e.splice(0,1):e[e.length-1]==CONSTANTS$4.bsc.NATIVE&&e[e.length-2]==CONSTANTS$4.bsc.WRAPPED&&e.splice(e.length-1,1),e},minReserveRequirements$1=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(parseUnits$2(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(parseUnits$2(e.toString(),o)),pathExists$1=async t=>{if(1==fixUniswapPath(t).length)return!1;let e=await request({blockchain:"bsc",address:basics$1.contracts.factory.address,method:"getPair"},{api:basics$1.contracts.factory.api,cache:36e5,params:fixUniswapPath(t)});if(e==CONSTANTS$4.bsc.ZERO)return!1;let[n,r,i]=await Promise.all([request({blockchain:"bsc",address:e,method:"getReserves"},{api:basics$1.contracts.pair.api,cache:36e5}),request({blockchain:"bsc",address:e,method:"token0"},{api:basics$1.contracts.pair.api,cache:36e5}),request({blockchain:"bsc",address:e,method:"token1"},{api:basics$1.contracts.pair.api,cache:36e5})]);if(t.includes(CONSTANTS$4.bsc.WRAPPED))return minReserveRequirements$1({min:1,token:CONSTANTS$4.bsc.WRAPPED,decimals:CONSTANTS$4.bsc.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(CONSTANTS$4.bsc.USD)){let t=new Token({blockchain:"bsc",address:CONSTANTS$4.bsc.USD}),e=await t.decimals();return minReserveRequirements$1({min:1e3,token:CONSTANTS$4.bsc.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},findPath$1=async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(CONSTANTS$4.bsc.NATIVE)&&[t,e].includes(CONSTANTS$4.bsc.WRAPPED))return;let n;return await pathExists$1([t,e])?n=[t,e]:t!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([t,CONSTANTS$4.bsc.WRAPPED])&&e!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([e,CONSTANTS$4.bsc.WRAPPED])?n=[t,CONSTANTS$4.bsc.WRAPPED,e]:t!=CONSTANTS$4.bsc.USD&&await pathExists$1([t,CONSTANTS$4.bsc.USD])&&e!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([CONSTANTS$4.bsc.WRAPPED,e])?n=[t,CONSTANTS$4.bsc.USD,CONSTANTS$4.bsc.WRAPPED,e]:t!=CONSTANTS$4.bsc.WRAPPED&&await pathExists$1([t,CONSTANTS$4.bsc.WRAPPED])&&e!=CONSTANTS$4.bsc.USD&&await pathExists$1([CONSTANTS$4.bsc.USD,e])&&(n=[t,CONSTANTS$4.bsc.WRAPPED,CONSTANTS$4.bsc.USD,e]),_optionalChain$1$1([n,"optionalAccess",t=>t.length])&&n[0]==CONSTANTS$4.bsc.NATIVE?n.splice(1,0,CONSTANTS$4.bsc.WRAPPED):_optionalChain$1$1([n,"optionalAccess",t=>t.length])&&n[n.length-1]==CONSTANTS$4.bsc.NATIVE&&n.splice(n.length-1,0,CONSTANTS$4.bsc.WRAPPED),n},getAmountsOut$1=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{request({blockchain:"bsc",address:basics$1.contracts.router.address,method:"getAmountsOut"},{api:basics$1.contracts.router.api,params:{amountIn:e,path:fixUniswapPath(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),getAmountIn$1=({path:t,amountOut:e,block:n})=>new Promise((r=>{request({blockchain:"bsc",address:basics$1.contracts.router.address,method:"getAmountsIn"},{api:basics$1.contracts.router.api,params:{amountOut:e,path:fixUniswapPath(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),getAmounts$1=async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a})=>{if(r){if(null==(i=await getAmountIn$1({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await getAmountsOut$1({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}else if(a){if(null==(i=await getAmountIn$1({path:t,amountOut:a,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await getAmountsOut$1({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a}},getTransaction$1=({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:a,amountInMaxInput:s,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h="bsc",f={blockchain:h,from:c,to:basics$1.contracts.router.address,api:basics$1.contracts.router.api};return t[0]===CONSTANTS$4.bsc.NATIVE?o||u?(f.method="swapExactETHForTokens",f.value=e.toString(),f.params={amountOutMin:i.toString()}):(a||s)&&(f.method="swapETHForExactTokens",f.value=n.toString(),f.params={amountOut:r.toString()}):t[t.length-1]===CONSTANTS$4.bsc.NATIVE?o||u?(f.method="swapExactTokensForETH",f.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(f.method="swapTokensForExactETH",f.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(f.method="swapExactTokensForTokens",f.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(f.method="swapTokensForExactTokens",f.params={amountInMax:n.toString(),amountOut:r.toString()}),f.params=Object.assign({},f.params,{path:fixUniswapPath(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),f},route$2=({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u})=>(e=fixCheckSum(e),n=fixCheckSum(n),new Promise((async l=>{let c=await findPath$1({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,a,s,u];if(({amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u}=await getAmounts$1({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u})),[o,s,a,u].every((t=>null==t)))return l();let g=getTransaction$1({path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new Route({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:g}))})));var pancakeswap=new Exchange(Object.assign(basics$1,{route:route$2,getAmountIn:getAmountIn$1}));let UniswapV2Router02=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],UniswapV2Factory=[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],UniswapV2Pair=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var basics={blockchain:"polygon",name:"quickswap",alternativeNames:[],label:"QuickSwap",logo:"data:image/png;base64,iVBORw0KGgo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XJ+hbrBWQx7XtJU9+/vavMgYeuI+3TQVndLB9f+B+vEuTn23619sGXlQwDbdukcFXhbB/Q+upHyaxvFdI+tfcBv6A5j4Ot94LYSf2VQ90YDvyXeeZ1zj1eZc/sbLgX4QwjUOQgkfbttePaD26QPptGMbprkp8IelPPQv+G03T3D+g0We8vPRnwASsorDjb8QE7OBnKemvmkA9/tUE6vSvJlCPv/hDkUSQ+c1PnQM1/NU5UN2/zoHq/nUOVPevc6C6/6dzoBQJXKr7lxwF6vD/VxTIXgLNjzr8C06DTc1+JUug0l+0BCr9RUug0l90HKz0f0cC2fQCNfkXXQ1dKv2/2rF3LYRiEIiikgT+/5MFtbB0aR5wPbvUcgaC/lCBXv0Y4E/f2+1/70EbxD9B1WOA3T9NwZeA4Z+s1hpg+Feo0gGGf5kCTwHpL5a6AzZY/Ru0nB0g/Y18D+S6B0h/O+lpbkIdjfRPkDaOPwamnavvpKOLgNHPofX9m8CUVz8V2VgCY/JzkvWrIAaf8FOLFiz5jUj2hUQL5tXgGT3ZlyOvHtjXwesg+vq8B61HE/STLpjpI3eCvx7xKngXvAxB38UH/oV/Te4AAAAAAAAAAAAALuEOW2gZr0akk1cAAAAASUVORK5CYII=",contracts:{router:{address:"0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",api:UniswapV2Router02},factory:{address:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",api:UniswapV2Factory},pair:{api:UniswapV2Pair}}};function _optionalChain$4(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let fixPath=t=>{let e=t.map(((e,n)=>e===CONSTANTS$4.polygon.NATIVE&&t[n+1]!=CONSTANTS$4.polygon.WRAPPED&&t[n-1]!=CONSTANTS$4.polygon.WRAPPED?CONSTANTS$4.polygon.WRAPPED:e));return e[0]==CONSTANTS$4.polygon.NATIVE&&e[1]==CONSTANTS$4.polygon.WRAPPED?e.splice(0,1):e[e.length-1]==CONSTANTS$4.polygon.NATIVE&&e[e.length-2]==CONSTANTS$4.polygon.WRAPPED&&e.splice(e.length-1,1),e},minReserveRequirements=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(parseUnits$2(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(parseUnits$2(e.toString(),o)),pathExists=async t=>{if(1==fixPath(t).length)return!1;let e=await request({blockchain:"polygon",address:basics.contracts.factory.address,method:"getPair"},{api:basics.contracts.factory.api,cache:36e5,params:fixPath(t)});if(e==CONSTANTS$4.polygon.ZERO)return!1;let[n,r,i]=await Promise.all([request({blockchain:"polygon",address:e,method:"getReserves"},{api:basics.contracts.pair.api,cache:36e5}),request({blockchain:"polygon",address:e,method:"token0"},{api:basics.contracts.pair.api,cache:36e5}),request({blockchain:"polygon",address:e,method:"token1"},{api:basics.contracts.pair.api,cache:36e5})]);if(t.includes(CONSTANTS$4.polygon.WRAPPED))return minReserveRequirements({min:1,token:CONSTANTS$4.polygon.WRAPPED,decimals:CONSTANTS$4.polygon.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(CONSTANTS$4.polygon.USD)){let t=new Token({blockchain:"polygon",address:CONSTANTS$4.polygon.USD}),e=await t.decimals();return minReserveRequirements({min:1e3,token:CONSTANTS$4.polygon.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},findPath=async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(CONSTANTS$4.polygon.NATIVE)&&[t,e].includes(CONSTANTS$4.polygon.WRAPPED))return;let n;return await pathExists([t,e])?n=[t,e]:t!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([t,CONSTANTS$4.polygon.WRAPPED])&&e!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([e,CONSTANTS$4.polygon.WRAPPED])?n=[t,CONSTANTS$4.polygon.WRAPPED,e]:t!=CONSTANTS$4.polygon.USD&&await pathExists([t,CONSTANTS$4.polygon.USD])&&e!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([CONSTANTS$4.polygon.WRAPPED,e])?n=[t,CONSTANTS$4.polygon.USD,CONSTANTS$4.polygon.WRAPPED,e]:t!=CONSTANTS$4.polygon.WRAPPED&&await pathExists([t,CONSTANTS$4.polygon.WRAPPED])&&e!=CONSTANTS$4.polygon.USD&&await pathExists([CONSTANTS$4.polygon.USD,e])&&(n=[t,CONSTANTS$4.polygon.WRAPPED,CONSTANTS$4.polygon.USD,e]),_optionalChain$4([n,"optionalAccess",t=>t.length])&&n[0]==CONSTANTS$4.polygon.NATIVE?n.splice(1,0,CONSTANTS$4.polygon.WRAPPED):_optionalChain$4([n,"optionalAccess",t=>t.length])&&n[n.length-1]==CONSTANTS$4.polygon.NATIVE&&n.splice(n.length-1,0,CONSTANTS$4.polygon.WRAPPED),n},getAmountsOut=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{request({blockchain:"polygon",address:basics.contracts.router.address,method:"getAmountsOut"},{api:basics.contracts.router.api,params:{amountIn:e,path:fixPath(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),getAmountIn=({path:t,amountOut:e,block:n})=>new Promise((r=>{request({blockchain:"polygon",address:basics.contracts.router.address,method:"getAmountsIn"},{api:basics.contracts.router.api,params:{amountOut:e,path:fixPath(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),getAmounts=async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a})=>{if(r){if(null==(i=await getAmountIn({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await getAmountsOut({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}else if(a){if(null==(i=await getAmountIn({path:t,amountOut:a,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await getAmountsOut({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||a&&r.lt(a))return{};void 0===a&&(a=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:a}},getTransaction$3=({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:a,amountInMaxInput:s,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"polygon",from:c,to:basics.contracts.router.address,api:basics.contracts.router.api};return t[0]===CONSTANTS$4.polygon.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(a||s)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===CONSTANTS$4.polygon.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(a||s)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:fixPath(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h},route$1=({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u})=>(e=fixCheckSum(e),n=fixCheckSum(n),new Promise((async l=>{let c=await findPath({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,a,s,u];if(({amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u}=await getAmounts({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u})),[o,s,a,u].every((t=>null==t)))return l();let g=getTransaction$3({path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new Route({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:s,amountOut:a,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:g}))})));var quickswap=new Exchange(Object.assign(basics,{route:route$1,getAmountIn:getAmountIn}));let all=[uniswap_v2,pancakeswap,quickswap],route$4=({blockchain:t,fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u,amountOutMax:l,amountInMin:c})=>Promise.all(all.map((h=>h.blockchain!==t?null:h.route({fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:a,amountInMax:s,amountOutMin:u,amountOutMax:l,amountInMin:c})))).then((t=>t.filter(Boolean)));var ChangableAmountProvider=function(t){var e=function(t){return!t.every((function(t){return void 0!==t.amount||void 0!==t.fromAmount}))},n=react.useContext(ConfigurationContext),r=n.amount;n.toAmount;var i,o=n.recover,a=_slicedToArray(react.useState(null==o&&e(t.accept)),2),s=a[0],u=a[1],l=react.useContext(WalletContext).account,c=react.useContext(ConversionRateContext),h=c.conversionRate,f=c.fixedCurrencyConversionRate,d=react.useContext(ErrorContext).setError,p=_slicedToArray(react.useState(),2),g=p[0],m=p[1],y=_slicedToArray(react.useState("object"==_typeof(r)&&r.fix&&r.currency?r.fix:null),1)[0],v=_slicedToArray(react.useState("object"==_typeof(r)&&r.fix&&r.currency?r.currency:null),1)[0];s&&(i="object"==_typeof(r)&&r.start&&r.start?r.start:"object"==_typeof(r)&&r.fix?r.fix:1);var b=_slicedToArray(react.useState(i),2),w=b[0],A=b[1],_=_slicedToArray(react.useState(),2),E=_[0],k=_[1],M=_slicedToArray(react.useState(100),2),S=M[0],x=M[1];react.useEffect((function(){o||u(e(t.accept))}),[t.accept,o]);var C=function(e){var n=e.amount,i=e.conversionRate,o=e.fixedCurrencyConversionRate;return new Promise((function(e,a){r&&r.token?e(t.accept.map((function(){return n}))):Promise.all(t.accept.map((function(t){return y?CONSTANTS$4[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/o*y:route$4({blockchain:t.blockchain,tokenIn:CONSTANTS$4[t.blockchain].USD,amountIn:1/o*y,tokenOut:t.token,fromAddress:l,toAddress:l}):CONSTANTS$4[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/i*n:route$4({blockchain:t.blockchain,tokenIn:CONSTANTS$4[t.blockchain].USD,amountIn:1/i*n,tokenOut:t.token,fromAddress:l,toAddress:l})}))).then((function(n){Promise.all(n.map((function(e,n){return"number"==typeof e?e:null==e[0]?void 0:Token.readable({blockchain:t.accept[n].blockchain,amount:e[0].amountOut,address:e[0].tokenOut})}))).then(e).catch(d)})).catch(d)}))},T=react.useCallback(lodash$1.debounce((function(e){var n=e.account,r=e.amount,i=e.conversionRate,o=e.fixedCurrencyConversionRate;C({amount:r,conversionRate:i,fixedCurrencyConversionRate:o}).then((function(e){m(t.accept.map((function(t,r){if(null!=e[r])return{blockchain:t.blockchain,amount:round$1(e[r]),token:t.token,receiver:t.receiver||n}})).filter((function(t){return!!t})))})).catch(d)}),500),[]);return react.useEffect((function(){o||s&&l&&h&&(!y||f)&&T({account:l,amount:w,conversionRate:h,fixedCurrencyConversionRate:f})}),[s,l,h,y,f,w,o]),react.useEffect((function(){s&&E?E.fromToken.readable(E.fromBalance).then((function(t){if(r&&r.token)route$4({blockchain:E.blockchain,tokenIn:E.fromToken.address,tokenOut:E.toToken.address,amountIn:parseFloat(t),fromAddress:l,toAddress:l}).then((function(t){null!=t[0]&&Token.readable({amount:t[0].amountOut,blockchain:E.blockchain,address:E.toToken.address}).then((function(t){var e=parseFloat(new Decimal(t).div(1.01).mul(h).toString());x(e>10?Math.round(e-1):round$1(e-1))})).catch(d)})).catch(d);else if(E.fromToken.address==CONSTANTS$4[E.blockchain].USD){var e=parseFloat(new Decimal(t).mul(h).toString());x(e>10?Math.round(e-1):e-1)}else route$4({blockchain:E.blockchain,tokenIn:E.fromToken.address,tokenOut:CONSTANTS$4[E.blockchain].USD,amountIn:parseFloat(t),fromAddress:l,toAddress:l}).then((function(t){null!=t[0]&&Token.readable({amount:t[0].amountOut,blockchain:E.blockchain,address:CONSTANTS$4[E.blockchain].USD}).then((function(t){var e=parseFloat(new Decimal(t).div(1.01).mul(h).toString());x(e>10?Math.round(e):round$1(e))})).catch(d)})).catch(d)})).catch(d):x(100)}),[l,E]),react.createElement(ChangableAmountContext.Provider,{value:{amountsMissing:s,fixedAmount:y,fixedCurrency:v,acceptWithAmount:g,amount:w,setAmount:A,setMaxRoute:k,maxAmount:S}},t.children)},timezoneToCurrency={"Pacific/Midway":"USD","Pacific/Niue":"NZD","Pacific/Pago_Pago":"USD","America/Adak":"USD","Pacific/Honolulu":"USD","Pacific/Rarotonga":"NZD","Pacific/Tahiti":"XPF","Pacific/Marquesas":"XPF","America/Anchorage":"USD","America/Juneau":"USD","America/Metlakatla":"USD","America/Nome":"USD","America/Sitka":"USD","America/Yakutat":"USD","Pacific/Gambier":"XPF","America/Los_Angeles":"USD","America/Tijuana":"MXN","America/Vancouver":"CAD","Pacific/Pitcairn":"NZD","America/Boise":"USD","America/Cambridge_Bay":"CAD","America/Chihuahua":"MXN","America/Creston":"CAD","America/Dawson":"CAD","America/Dawson_Creek":"CAD","America/Denver":"USD","America/Edmonton":"CAD","America/Fort_Nelson":"CAD","America/Hermosillo":"MXN","America/Inuvik":"CAD","America/Mazatlan":"MXN","America/Ojinaga":"MXN","America/Phoenix":"USD","America/Whitehorse":"CAD","America/Yellowknife":"CAD","America/Bahia_Banderas":"MXN","America/Belize":"BZD","America/Chicago":"USD","America/Costa_Rica":"CRC","America/El_Salvador":"USD","America/Guatemala":"GTQ","America/Indiana/Knox":"USD","America/Indiana/Tell_City":"USD","America/Managua":"NIO","America/Matamoros":"MXN","America/Menominee":"USD","America/Merida":"MXN","America/Mexico_City":"MXN","America/Monterrey":"MXN","America/North_Dakota/Beulah":"USD","America/North_Dakota/Center":"USD","America/North_Dakota/New_Salem":"USD","America/Rainy_River":"CAD","America/Rankin_Inlet":"CAD","America/Regina":"CAD","America/Resolute":"CAD","America/Swift_Current":"CAD","America/Tegucigalpa":"HNL","America/Winnipeg":"CAD","Pacific/Easter":"CLP","Pacific/Galapagos":"USD","America/Atikokan":"CAD","America/Bogota":"COP","America/Cancun":"MXN","America/Cayman":"KYD","America/Detroit":"USD","America/Eirunepe":"BRL","America/Grand_Turk":"USD","America/Guayaquil":"USD","America/Havana":"CUP","America/Indiana/Indianapolis":"USD","America/Indiana/Marengo":"USD","America/Indiana/Petersburg":"USD","America/Indiana/Vevay":"USD","America/Indiana/Vincennes":"USD","America/Indiana/Winamac":"USD","America/Iqaluit":"CAD","America/Jamaica":"JMD","America/Kentucky/Louisville":"USD","America/Kentucky/Monticello":"USD","America/Lima":"PEN","America/Nassau":"BSD","America/New_York":"USD","America/Nipigon":"CAD","America/Panama":"PAB","America/Pangnirtung":"CAD","America/Port-au-Prince":"HTG","America/Rio_Branco":"BRL","America/Thunder_Bay":"CAD","America/Toronto":"CAD","America/AnguillaSandy Hill":"XCD","America/Antigua":"XCD","America/Aruba":"AWG","America/Asuncion":"PYG","America/Barbados":"BBD","America/Blanc-Sablon":"CAD","America/Boa_Vista":"BRL","America/Campo_Grande":"BRL","America/Caracas":"VEB","America/Cuiaba":"BRL","America/Curacao":"ANG","America/Dominica":"DOP","America/Glace_Bay":"CAD","America/Goose_Bay":"CAD","America/Grenada":"XCD","America/Guadeloupe":"EUR","America/Guyana":"GYD","America/Halifax":"CAD","America/Kralendijk":"USD","America/La_Paz":"BOB","America/Lower_Princes":"USD","America/Manaus":"BRL","America/Marigot":"EUR","America/Martinique":"EUR","America/Moncton":"CAD","America/Montserrat":"XCD","America/Porto_Velho":"BRL","America/Port_of_Spain":"BZD","America/Puerto_Rico":"USD","America/Santiago":"CLP","America/Santo_Domingo":"DOP","America/St_Barthelemy":"EUR","America/St_Kitts":"XCD","America/St_Lucia":"XCD","America/St_Thomas":"USD","America/St_Vincent":"XCD","America/Thule":"DKK","America/Tortola":"USD","Atlantic/Bermuda":"BMD","America/St_Johns":"CAD","America/Araguaina":"BRL","America/Argentina/Buenos_Aires":"ARS","America/Argentina/Catamarca":"ARS","America/Argentina/Cordoba":"ARS","America/Argentina/Jujuy":"ARS","America/Argentina/La_Rioja":"ARS","America/Argentina/Mendoza":"ARS","America/Argentina/Rio_Gallegos":"ARS","America/Argentina/Salta":"ARS","America/Argentina/San_Juan":"ARS","America/Argentina/San_Luis":"ARS","America/Argentina/Tucuman":"ARS","America/Argentina/Ushuaia":"ARS","America/Bahia":"BRL","America/Belem":"BRL","America/Cayenne":"EUR","America/Fortaleza":"BRL","America/Godthab":"DKK","America/Maceio":"BRL","America/Miquelon":"EUR","America/Montevideo":"UYU","America/Paramaribo":"SRD","America/Punta_Arenas":"CLP","America/Recife":"BRL","America/Santarem":"BRL","America/Sao_Paulo":"BRL","Antarctica/Palmer":"USD","Antarctica/Rothera":"USD","Atlantic/Stanley":"FKP","America/Noronha":"BRL","Atlantic/South_Georgia":"GBP","America/Scoresbysund":"DKK","Atlantic/Azores":"EUR","Atlantic/Cape_Verde":"CVE","Africa/Abidjan":"XOF","Africa/Accra":"GHC","Africa/Bamako":"XOF","Africa/Banjul":"GMD","Africa/Bissau":"XOF","Africa/Casablanca":"MAD","Africa/Conakry":"GNF","Africa/Dakar":"XOF","Africa/El_Aaiun":"MAD","Africa/Freetown":"SLL","Africa/Lome":"XOF","Africa/Monrovia":"LRD","Africa/Nouakchott":"MRU","Africa/Ouagadougou":"XOF","Africa/Sao_Tome":"STD","America/Danmarkshavn":"DKK","Antarctica/Troll":"NOK","Atlantic/Canary":"EUR","Atlantic/Faroe":"DKK","Atlantic/Madeira":"EUR","Atlantic/Reykjavik":"ISK","Atlantic/St_Helena":"SHP","Europe/Dublin":"EUR","Europe/Guernsey":"GBP","Europe/Isle_of_Man":"IMP","Europe/Jersey":"GBP","Europe/Lisbon":"EUR","Europe/London":"GBP","Africa/Algiers":"DZD","Africa/Bangui":"XAF","Africa/Brazzaville":"XAF","Africa/Ceuta":"EUR","Africa/Douala":"XAF","Africa/Kinshasa":"CDF","Africa/Lagos":"NGN","Africa/Libreville":"XAF","Africa/Luanda":"AOA","Africa/Malabo":"XAF","Africa/Ndjamena":"XAF","Africa/Niamey":"XOF","Africa/Porto-Novo":"XOF","Africa/Tunis":"TND","Africa/Windhoek":"NAD","Arctic/Longyearbyen":"NOK","Europe/Amsterdam":"EUR","Europe/Andorra":"EUR","Europe/Belgrade":"RSD","Europe/Berlin":"EUR","Europe/Bratislava":"EUR","Europe/Brussels":"EUR","Europe/Budapest":"HUF","Europe/Copenhagen":"DKK","Europe/Gibraltar":"GIP","Europe/Ljubljana":"EUR","Europe/Luxembourg":"EUR","Europe/Madrid":"EUR","Europe/Malta":"EUR","Europe/Monaco":"EUR","Europe/Oslo":"NOK","Europe/Paris":"EUR","Europe/Podgorica":"EUR","Europe/Prague":"CZK","Europe/Rome":"EUR","Europe/San_Marino":"EUR","Europe/Sarajevo":"BAM","Europe/Skopje":"MKD","Europe/Stockholm":"SEK","Europe/Tirane":"ALL","Europe/Vaduz":"CHF","Europe/Vatican":"EUR","Europe/Vienna":"EUR","Europe/Warsaw":"PLN","Europe/Zagreb":"HRK","Europe/Zurich":"CHF","Africa/Blantyre":"MWK","Africa/Bujumbura":"BIF","Africa/Cairo":"EGP","Africa/Gaborone":"BWP","Africa/Harare":"ZWL","Africa/Johannesburg":"ZAR","Africa/Juba":"SSP","Africa/Khartoum":"SDG","Africa/Kigali":"RWF","Africa/Lubumbashi":"CDF","Africa/Lusaka":"ZMW","Africa/Maputo":"MZM","Africa/Maseru":"LSL","Africa/Mbabane":"SZL","Africa/Tripoli":"LYD","Asia/Amman":"JOD","Asia/Beirut":"LBP","Asia/Damascus":"SYP","Asia/Famagusta":"TRY","Asia/Gaza":"ILS","Asia/Hebron":"ILS","Asia/Jerusalem":"ILS","Asia/Nicosia":"EUR","Europe/Athens":"EUR","Europe/Bucharest":"RON","Europe/Chisinau":"MDL","Europe/Helsinki":"EUR","Europe/Kaliningrad":"RUB","Europe/Kiev":"UAH","Europe/Mariehamn":"EUR","Europe/Riga":"EUR","Europe/Sofia":"BGN","Europe/Tallinn":"EUR","Europe/Uzhgorod":"UAH","Europe/Vilnius":"EUR","Europe/Zaporozhye":"UAH","Africa/Addis_Ababa":"ETB","Africa/Asmara":"ERN","Africa/Dar_es_Salaam":"TZS","Africa/Djibouti":"DJF","Africa/Kampala":"UGX","Africa/Mogadishu":"SOS","Africa/Nairobi":"KES","Antarctica/Syowa":"EUR","Asia/Aden":"YER","Asia/Baghdad":"IQD","Asia/Bahrain":"BHD","Asia/Kuwait":"KWD","Asia/Qatar":"QAR","Asia/Riyadh":"SAR","Europe/Istanbul":"TRY","Europe/Kirov":"RUB","Europe/Minsk":"BYN","Europe/Moscow":"RUB","Europe/Simferopol":"RUB","Europe/Volgograd":"RUB","Indian/Antananarivo":"MGA","Indian/Comoro":"USD","Indian/Mayotte":"EUR","Asia/Tehran":"IRR","Asia/Baku":"AZN","Asia/Dubai":"AED","Asia/Muscat":"OMR","Asia/Tbilisi":"GEL","Asia/Yerevan":"AMD","Europe/Astrakhan":"RUB","Europe/Samara":"RUB","Europe/Saratov":"RUB","Europe/Ulyanovsk":"RUB","Indian/Mahe":"SCR","Indian/Mauritius":"MUR","Indian/Reunion":"EUR","Asia/Kabul":"AFN","Antarctica/Mawson":"USD","Asia/Aqtau":"KZT","Asia/Aqtobe":"KZT","Asia/Ashgabat":"TMM","Asia/Atyrau":"KZT","Asia/Dushanbe":"TJS","Asia/Karachi":"PKR","Asia/Oral":"KZT","Asia/Qyzylorda":"KZT","Asia/Samarkand":"UZS","Asia/Tashkent":"UZS","Asia/Yekaterinburg":"RUB","Indian/Kerguelen":"EUR","Indian/Maldives":"MVR","Asia/Colombo":"LKR","Asia/Kolkata":"INR","Asia/Kathmandu":"NPR","Antarctica/Vostok":"USD","Asia/Almaty":"KZT","Asia/Bishkek":"KGS","Asia/Dhaka":"BDT","Asia/Omsk":"RUB","Asia/Qostanay":"KZT","Asia/Thimphu":"BTN","Asia/Urumqi":"CNY","Indian/Chagos":"USD","Asia/Yangon":"MMK","Indian/Cocos":"AUD","Antarctica/Davis":"USD","Asia/Bangkok":"THB","Asia/Barnaul":"RUB","Asia/Hovd":"MNT","Asia/Ho_Chi_Minh":"VND","Asia/Jakarta":"IDR","Asia/Krasnoyarsk":"RUB","Asia/Novokuznetsk":"RUB","Asia/Novosibirsk":"RUB","Asia/Phnom_Penh":"KHR","Asia/Pontianak":"IDR","Asia/Tomsk":"RUB","Asia/Vientiane":"LAK","Indian/Christmas":"AUD","Asia/Brunei":"BND","Asia/Choibalsan":"MNT","Asia/Hong_Kong":"HKD","Asia/Irkutsk":"RUB","Asia/Kuala_Lumpur":"MYR","Asia/Kuching":"MYR","Asia/Macau":"MOP","Asia/Makassar":"IDR","Asia/Manila":"PHP","Asia/Shanghai":"CNY","Asia/Singapore":"SGD","Asia/Taipei":"TWD","Asia/Ulaanbaatar":"MNT","Australia/Perth":"AUD","Australia/Eucla":"AUD","Asia/Chita":"RUB","Asia/Dili":"USD","Asia/Jayapura":"IDR","Asia/Khandyga":"RUB","Asia/Pyongyang":"KPW","Asia/Seoul":"KRW","Asia/Tokyo":"JPY","Asia/Yakutsk":"RUB","Pacific/Palau":"USD","Australia/Adelaide":"AUD","Australia/Broken_Hill":"AUD","Australia/Darwin":"AUD","Antarctica/DumontDUrville":"USD","Antarctica/Macquarie":"USD","Asia/Ust-Nera":"RUB","Asia/Vladivostok":"RUB","Australia/Brisbane":"AUD","Australia/Currie":"AUD","Australia/Hobart":"AUD","Australia/Lindeman":"AUD","Australia/Melbourne":"AUD","Australia/Sydney":"AUD","Pacific/Chuuk":"USD","Pacific/GuamVillage":"USD","Pacific/Port_Moresby":"PGK","Pacific/Saipan":"USD","Australia/Lord_Howe":"AUD","Antarctica/Casey":"USD","Asia/Magadan":"RUB","Asia/Sakhalin":"RUB","Asia/Srednekolymsk":"RUB","Pacific/Bougainville":"PGK","Pacific/Efate":"VUV","Pacific/Guadalcanal":"SBD","Pacific/Kosrae":"USD","Pacific/Norfolk":"USD","Pacific/Noumea":"XPF","Pacific/Pohnpei":"USD","Antarctica/McMurdo":"USD","Asia/Anadyr":"RUB","Asia/Kamchatka":"RUB","Pacific/Auckland":"NZD","Pacific/Fiji":"FJD","Pacific/Funafuti":"AUD","Pacific/Kwajalein":"USD","Pacific/Majuro":"USD","Pacific/Nauru":"AUD","Pacific/Tarawa":"AUD","Pacific/Wake":"USD","Pacific/Wallis":"XPF","Pacific/Chatham":"CAD","Pacific/Apia":"NGN","Pacific/Enderbury":"USD","Pacific/Fakaofo":"NZD","Pacific/Tongatapu":"TOP","Pacific/Kiritimati":"AUD"};class Currency{constructor({amount:t,code:e,timeZone:n=Currency.timeZone()}){this.amount=t,this.code=e||window._LocalCurrencyCode||Currency.getCode(n),this.timeZone=n}static getCode(t){return window._LocalCurrencyCode||timezoneToCurrency[t||Currency.timeZone()]||"USD"}static async rate({from:t,to:e}){null==e&&(e=Currency.getCode());let n=await Currency.fromUSD({amount:1,code:t}),r=await Currency.fromUSD({amount:1,code:e});return n.amount/r.amount}static async fromUSD({amount:t,code:e,timeZone:n}){let r=new Currency({amount:t,code:e,timeZone:n}),i=await fetch("https://public.depay.fi/currencies/"+r.code).then((t=>t.json())).then((t=>parseFloat(t))).catch((()=>(r.code="USD",1)));return r.amount=r.amount*i,r}static timeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}toString(t={}){return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:this.code}).format(this.amount)}}var ConfigurationProvider=function(t){var e=new Currency({code:t.configuration.currency}).code;return react.useEffect((function(){null!=t.configuration.providers&&Object.entries(t.configuration.providers).forEach((function(t){setProviderEndpoints(t[0],t[1])}))}),[t.configuration]),react.createElement(ConfigurationContext.Provider,{value:Object.assign({},t.configuration,{currencyCode:e})},t.children)},ConversionRateProvider=function(t){react.useContext(ErrorContext).setError;var e=react.useContext(ConfigurationContext),n=e.amount,r=e.currency,i=_slicedToArray(react.useState(),2),o=i[0],a=i[1],s=_slicedToArray(react.useState(),2),u=s[0],l=s[1];return react.useEffect((function(){"object"==_typeof(n)&&n.currency&&Currency.fromUSD({amount:1,code:n.currency}).then((function(t){return l(t.amount)})),Currency.fromUSD({amount:1,code:r}).then((function(t){return a(t.amount)})).catch(a(1))}),[]),react.createElement(ConversionRateContext.Provider,{value:{conversionRate:o,fixedCurrencyConversionRate:u}},t.children)},DonationRoutingContext=react.createContext(),NavigateContext=react.createContext(),QuestionsGraphic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAHQCAMAAADgcCJ6AAAAXVBMVEVHcEwiGxq6jYEwExPTf2RKx+4uEhLSf2PSfmMvEhJKx+7UgWYvEhIvEhJOJyJrOzGHTkCdX023Y07Ab1bOd1/SgGPXhWhKx+7gm3roq5j/u6nx3mbu1MT37OL///+EeM1aAAAADXRSTlMADSZMUmqDg6y4udfdNJi0SgAAHCNJREFUeNrsndl6qjAUhU1KBIM4hej7v2lBxSBTgATF7PXflc+eVtfaY6BnAwAAAAAAAAAAAAAAAOBH4ELKW4GUgm8AMQr1bzXgAVpU6r97YANowO/ywwJUMfK3LYBCEDz8NgiSQOCImwW5AQFT6A8HEOapP6oAUQr94QDCiNtI2AYECHvKizaAKPI2GqwDAqRYACAFUKboAJACKPOUFoMAUXhvuhdCogaEjxg8AOQSNSBwhCXTC9SAsBG2w1+BGhA0oq0/a7wCBggZYV34MhggZLh91H9rBDcgMFr9HwxAi2aTBwMQg1nnfIkeIGiEbcxHExg4Ylh/gUVQ6HBpFgBtJAwQPlwIwXryA+4KIw3HJpg2EmdBpCkKALYAhMFhMG3EDQmAMgJ3BJJG4IZA0gg8GUYaiWcCKMMkHgmgDIf+pBF4JIg00J82EvpThkF/0nA8Ekwajr8SShqBB8JJg/afNhzpnzQc4U8a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LineDoAQ/O1MPl+zzIzDSC8yUIyMxcw7P1ECAzngrW6AEPzpzh2dYRQG4GRZtvJRFkZuoC8+0lgMxMIZ6ngIACmLvADB8GRTBrmGUSCUpgSvEcDQQogmkxN/1nQSG0gwI94GmZ63jy/gFkpW7avm/bhpGKu72jDl5XV2tghaPQ9PSyjMkAzf4esG7p3WuwwAFg08uTA7w0p/8WfUj88hXgyBjRa/ohzHsT2UAsHKC4wAcFwPS0gw7mfu160DvgPynfxwHM4hPNoKW2VMvuSgwuyAoz0A9aGqNc7GITJRQB8EBWTPrXg8EAZswGIMa/ggdywvYYoHU3QD/oqeGAvLAyEwAWSIVZNrthSzi3kz0MkJkN2UIFwG8R0MAAmXGWrZ81CxICDYMBMrOlWt2u1Tem//bF+lUvWTMYIDsWso37d2ozcBQ/AHUzXU5dDfoXAfPm8v0nwIWgfx6Cy8QukP9gOI/5KJeF9HmJqJAhEy7YEC6LtTzYsgcAAAAAAAAAAAAAAAAAAAAAAAD0/AOU5ijBfZTOtQAAAABJRU5ErkJggg==",NoPaymentMethodFoundDialog=function(){var t=react.useContext(ClosableContext).close;return react.createElement(Dialog,{header:react.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM"}),body:react.createElement("div",{className:"TextCenter"},react.createElement("div",{className:"GraphicWrapper"},react.createElement("img",{className:"Graphic",src:QuestionsGraphic})),react.createElement("h1",{className:"LineHeightL Text FontSizeL PaddingTopS FontWeightBold"},"Insufficient Balance"),react.createElement("div",{className:"Text PaddingTopS PaddingBottomM PaddingLeftM PaddingRightM"},react.createElement("strong",{className:"FontSizeM"},"We were not able to find any asset with enough value in your wallet. Please top up your account in order to proceed with this payment."))),footer:react.createElement("div",{className:"PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"},react.createElement("button",{className:"ButtonPrimary",onClick:t},"Ok"))})},PaymentContext=react.createContext(),PaymentRoutingContext=react.createContext(),PaymentTrackingContext=react.createContext(),TransactionTrackingContext=react.createContext(),PaymentProvider=function(t){var e=react.useContext(ErrorContext).setError,n=react.useContext(ConfigurationContext),r=n.sent,i=n.confirmed,o=n.failed,a=n.recover,s=n.before,u=react.useContext(PaymentRoutingContext),l=u.selectedRoute;u.getPaymentRoutes;var c=react.useContext(ClosableContext),h=c.open,f=c.close,d=c.setClosable,p=react.useContext(PaymentRoutingContext).allRoutes,g=react.useContext(UpdatableContext).setUpdatable,m=react.useContext(NavigateContext),y=m.navigate,v=m.set,b=react.useContext(WalletContext).wallet,w=react.useContext(PaymentTrackingContext),A=w.release,_=w.tracking,E=w.initializeTracking,k=react.useContext(TransactionTrackingContext),M=k.foundTransaction,S=k.initializeTracking,x=_slicedToArray(react.useState(),2),C=x[0],T=x[1],N=_slicedToArray(react.useState(),2),B=N[0],$=N[1],P=_slicedToArray(react.useState(),2),I=P[0],R=P[1],O=_slicedToArray(react.useState("initialized"),2),L=O[0],D=O[1],F=function(t){1!=_&&d(!0),D("confirmed"),i&&i(t)},j=function(t,e){o&&o(t,e),d(!0),v(["PaymentError"])},U=function(){var t=_asyncToGenerator(regenerator.mark((function t(){var e;return regenerator.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=4;break}if(!1!==s(C.route.transaction)){t.next=4;break}return t.abrupt("return");case 4:return d(!1),D("paying"),g(!1),t.next=9,request({blockchain:C.route.transaction.blockchain,method:"latestBlockNumber"});case 9:e=t.sent,b.sendTransaction(Object.assign({},C.route.transaction,{sent:function(t){S(t,e),r&&r(t)},confirmed:F,failed:j})).then((function(t){E(t,e,C.route),$(t)})).catch((function(t){console.log("error",t),D("initialized"),d(!0),g(!0),"WRONG_NETWORK"==(null==t?void 0:t.code)&&y("WrongNetwork")}));case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return react.useEffect((function(){A&&D("confirmed")}),[A]),react.useEffect((function(){if(a){d(!1),g(!1),D("paying"),$({blockchain:a.blockchain,id:a.transaction,url:Blockchain.findByName(a.blockchain).explorerUrlFor({transaction:{id:a.transaction}})});var t=new Token({blockchain:a.blockchain,address:a.token});Promise.all([t.name(),t.symbol()]).then((function(t){var e=_slicedToArray(t,2),n=e[0],r=e[1];T({blockchain:a.blockchain,token:a.token,name:n,symbol:r.toUpperCase(),amount:a.amount})})).catch(e)}}),[a]),react.useEffect((function(){var t;M&&M.id&&M.status&&(M.id.toLowerCase()!=B.id.toLowerCase()&&(t=Object.assign({},B,{id:M.id,url:Blockchain.findByName(B.blockchain).explorerUrlFor({transaction:M})}),$(t)),"success"==M.status?F(t||B):"failed"==M.status&&j(t||B))}),[M,B]),react.useEffect((function(){if(l){var t=l.fromToken;Promise.all([t.name(),t.symbol(),t.readable(l.fromAmount)]).then((function(e){var n=_slicedToArray(e,3),r=n[0],i=n[1],o=n[2];T({blockchain:l.blockchain,route:l,token:t.address,name:r,symbol:i.toUpperCase(),amount:o})})).catch(e)}else T(void 0)}),[l]),react.useEffect((function(){p&&0==p.length?g(!1):p&&p.length>0&&g(!0)}),[p]),p instanceof Array&&0==p.length?react.createElement(ReactDialogStack,{open:h,close:f,start:"NoPaymentMethodFound",container:t.container,document:t.document,dialogs:{NoPaymentMethodFound:react.createElement(NoPaymentMethodFoundDialog,null)}}):react.createElement(PaymentContext.Provider,{value:{payment:C,paymentState:L,pay:U,transaction:B,approve:function(){d(!1),D("approving"),b.sendTransaction(Object.assign({},C.route.approvalTransaction,{confirmed:function(){C.route.approvalRequired=!1,T(C),d(!0),D("initialized")}})).then((function(t){R(t)})).catch((function(t){console.log("error",t),D("initialized"),d(!0)}))},approvalTransaction:I}},t.children)};function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ensureNativeTokenAsset=async({address:t,options:e,assets:n,blockchain:r})=>{if(e.only&&e.only[r]&&!e.only[r].find((t=>t.toLowerCase()==CONSTANTS$4[r].NATIVE.toLowerCase())))return n;if(e.exclude&&e.exclude[r]&&e.exclude[r].find((t=>t.toLowerCase()==CONSTANTS$4[r].NATIVE.toLowerCase())))return n;if(!n.find((t=>t.address.toLowerCase()==CONSTANTS$4[r].NATIVE.toLowerCase()))){let e=await request({blockchain:r,address:t,method:"balance"},{cache:3e4});n=[{name:CONSTANTS$4[r].CURRENCY,symbol:CONSTANTS$4[r].SYMBOL,address:CONSTANTS$4[r].NATIVE,type:"NATIVE",blockchain:r,balance:e.toString()},...n]}return n},filterAssets=({assets:t,blockchain:e,options:n})=>n.only?t.filter((t=>(n.only[e]||[]).find((e=>e.toLowerCase()==t.address.toLowerCase())))):n.exclude?t.filter((t=>(n.exclude[e]||[]).find((e=>e.toLowerCase()!=t.address.toLowerCase())))):t;var getAssets=async t=>(void 0===t&&(t={accounts:{}}),Promise.all(Object.keys(t.accounts).map((e=>new Promise(((n,r)=>{const i=t.accounts[e],o=new AbortController;setTimeout((()=>o.abort()),1e4),fetch(`https://public.depay.fi/accounts/${e}/${i}/assets`,{signal:o.signal}).catch((t=>{console.log(t),n([])})).then((t=>{if(t&&t.ok)return t.json();n([])})).then((async r=>{if(r&&r.length)return await ensureNativeTokenAsset({address:i,options:t,assets:filterAssets({assets:r,blockchain:e,options:t}).map((t=>Object.assign(t,{blockchain:e}))),blockchain:e});n([])})).then(n).catch((t=>{console.log(t),n([])}))}))))).then((t=>t.flat())));const reduceAssetWithBalance=(t,e)=>Object.assign({},{address:t.address,symbol:t.symbol,name:t.name,decimals:t.decimals,type:t.type,blockchain:t.blockchain},{balance:e.toString()}),exists=({assets:t,asset:e})=>!!t.find((t=>t.blockchain==e.blockchain&&t.address.toLowerCase()==e.address.toLowerCase())),isFiltered=({options:t,address:e,blockchain:n})=>!(!(t&&t.only&&t.only[n])||t.only[n].find((t=>t.toLowerCase()==e.toLowerCase())))||!!(t&&t.exclude&&t.exclude[n]&&t.exclude[n].find((t=>t.toLowerCase()==e.toLowerCase())));var dripAssets=async t=>{void 0===t&&(t={accounts:{},priority:[]});let e=[],n=[];n=n.concat((t.priority||[]).map((n=>new Promise((async(r,i)=>{try{let i=new Token(n),o=Object.assign({},n,{name:await i.name(),symbol:await i.symbol(),decimals:await i.decimals(),balance:(await i.balance(t.accounts[n.blockchain])).toString()});if("0"!=o.balance){if(exists({assets:e,asset:n}))return r();e.push(o),"function"==typeof t.drip&&t.drip(o),r(o)}else r()}catch(t){r()}})))));let r=[];for(var i in t.accounts)Blockchain.findByName(i).tokens.forEach((e=>{isFiltered({options:t,address:e.address,blockchain:i})||r.push(Object.assign({},e,{blockchain:i}))}));if(n=n.concat(r.map((n=>new Promise(((r,i)=>{new Token(n).balance(t.accounts[n.blockchain]).then((i=>{if(exists({assets:e,asset:n}))return r();const o=reduceAssetWithBalance(n,i);"0"!=o.balance?(e.push(o),"function"==typeof t.drip&&t.drip(o),r(o)):r()})).catch((t=>{console.log(t),r()}))}))))),null==t.only||Object.keys(t.only).every((t=>0==t.length))){let r=await getAssets(t);n=n.concat(r.map((n=>new Promise(((r,i)=>new Token(n).balance(t.accounts[n.blockchain]).then((i=>{if(exists({assets:e,asset:n}))return r();const o=reduceAssetWithBalance(n,i);"0"!=o.balance?(e.push(o),"function"==typeof t.drip&&t.drip(o),r(o)):r()})).catch((t=>{console.log(t),r()})))))))}return await Promise.all(n),e};const prepareUniswapTransaction=t=>(t.params.path=t.params.path.filter(((e,n,r)=>(1!=n||e!=CONSTANTS$4[t.blockchain].WRAPPED||r[0]!=CONSTANTS$4[t.blockchain].NATIVE)&&(n!=r.length-2||e!=CONSTANTS$4[t.blockchain].WRAPPED||r[r.length-1]!=CONSTANTS$4[t.blockchain].NATIVE))),t),prepareContractCallAddressAmountBooleanTransaction=(t,e)=>(t.params.data=[e.signature,e.params[0]],t),prepareContractCallAddressPassedAmountBooleanTransaction=(t,e)=>(t.params.data=[e.signature,e.params[1]],t.params.amounts[1]||(t.params.amounts[1]="0"),t.params.amounts[2]||(t.params.amounts[2]="0"),t.params.amounts[3]||(t.params.amounts[3]="0"),t.params.amounts[4]||(t.params.amounts[4]="0"),t.params.amounts[5]=e.params[0],t),preparePaymentFeeTransaction=t=>{};var plugins={ethereum:{payment:{address:"0x99F3F4685a7178F26EB4F4Ca8B75a1724F1577B9"},uniswap_v2:{address:"0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019",prepareTransaction:prepareUniswapTransaction},paymentWithEvent:{address:"0xD8fBC10787b019fE4059Eb5AA5fB11a5862229EF"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xF984eb8b466AD6c728E0aCc7b69Af6f69B32437F",prepareTransaction:prepareContractCallAddressAmountBooleanTransaction},approveAndCallContractAddressPassedAmountBoolean:{address:"0x2D18c5A46cc1780d2460DD51B5d0996e55Fd2446",prepareTransaction:prepareContractCallAddressPassedAmountBooleanTransaction}},paymentFee:{address:"0x874Cb669D7BFff79d4A6A30F4ea52c5e413BD6A7",prepareTransaction:preparePaymentFeeTransaction}},bsc:{payment:{address:"0x8B127D169D232D5F3ebE1C3D06CE343FD7C1AA11"},pancakeswap:{address:"0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B",prepareTransaction:prepareUniswapTransaction},paymentWithEvent:{address:"0x1869E236c03eE67B9FfEd3aCA139f4AeBA79Dc21"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xd73dFeF8F9c213b449fB39B84c2b33FBBc2C8eD3",prepareTransaction:prepareContractCallAddressAmountBooleanTransaction},approveAndCallContractAddressPassedAmountBoolean:{address:"0x7E655088214d0657251A51aDccE9109CFd23B5B5",prepareTransaction:prepareContractCallAddressPassedAmountBooleanTransaction}},paymentFee:{address:"0xae33f10AD57A38113f74FCdc1ffA6B1eC47B94E3",prepareTransaction:preparePaymentFeeTransaction}},polygon:{payment:{address:"0x78C0F1c712A9AA2004C1F401A7307d8bCB62abBd"},quickswap:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",prepareTransaction:prepareUniswapTransaction},paymentWithEvent:{address:" 0xfAD2F276D464EAdB71435127BA2c2e9dDefb93a4"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0x8698E529E9867eEbcC68b4792daC627cd8870736",prepareTransaction:prepareContractCallAddressAmountBooleanTransaction},approveAndCallContractAddressPassedAmountBoolean:{address:"0xAB305eaDf5FB15AF6370106B231C67d103bBbbbC",prepareTransaction:prepareContractCallAddressPassedAmountBooleanTransaction}},paymentFee:{address:"0xd625c7087E940b2A91ed8bD8db45cB24D3526B56",prepareTransaction:preparePaymentFeeTransaction}}},routers={ethereum:{address:"0xae60aC8e69414C2Dc362D0e6a03af643d1D85b92",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},bsc:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},polygon:{address:"0x2CA727BC33915823e3D05fe043d310B8c5b2dC5b",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]}},commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==global$1?global$1:"undefined"!=typeof self?self:{};function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports}var bn=createCommonjsModule((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:buffer.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var l=t.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,l=0,c=n;c<s;c+=r)l=u(t,c,c+r,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var h=1;for(l=u(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){l(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var c=u>>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,l=0,c=0|a[0],h=8191&c,f=c>>>13,d=0|a[1],p=8191&d,g=d>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],E=8191&_,k=_>>>13,M=0|a[5],S=8191&M,x=M>>>13,C=0|a[6],T=8191&C,N=C>>>13,B=0|a[7],$=8191&B,P=B>>>13,I=0|a[8],R=8191&I,O=I>>>13,L=0|a[9],D=8191&L,F=L>>>13,j=0|s[0],U=8191&j,H=j>>>13,z=0|s[1],G=8191&z,Q=z>>>13,W=0|s[2],q=8191&W,Y=W>>>13,V=0|s[3],K=8191&V,J=V>>>13,Z=0|s[4],X=8191&Z,tt=Z>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,lt=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(l+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,U)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(g,U)|0,o=Math.imul(g,H);var yt=(l+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,G)|0))<<13)|0;l=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,U),i=(i=Math.imul(y,H))+Math.imul(v,U)|0,o=Math.imul(v,H),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,Q)|0;var vt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,U),i=(i=Math.imul(w,H))+Math.imul(A,U)|0,o=Math.imul(A,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,Y)|0;var bt=(l+(r=r+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,K)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,U),i=(i=Math.imul(E,H))+Math.imul(k,U)|0,o=Math.imul(k,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Q)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,J)|0;var wt=(l+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,U),i=(i=Math.imul(S,H))+Math.imul(x,U)|0,o=Math.imul(x,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,K)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,U),i=(i=Math.imul(T,H))+Math.imul(N,U)|0,o=Math.imul(N,H),r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,J)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul($,U),i=(i=Math.imul($,H))+Math.imul(P,U)|0,o=Math.imul(P,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Q)|0,r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,H))+Math.imul(O,U)|0,o=Math.imul(O,H),r=r+Math.imul($,G)|0,i=(i=i+Math.imul($,Q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(S,K)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,lt)|0;var kt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,U),i=(i=Math.imul(D,H))+Math.imul(F,U)|0,o=Math.imul(F,H),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul($,q)|0,i=(i=i+Math.imul($,Y)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,Y)|0,r=r+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var Mt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Q))+Math.imul(F,G)|0,o=Math.imul(F,Q),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul($,K)|0,i=(i=i+Math.imul($,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(T,X)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(S,nt)|0,i=(i=i+Math.imul(S,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var St=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;l=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,Y))+Math.imul(F,q)|0,o=Math.imul(F,Y),r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul($,X)|0,i=(i=i+Math.imul($,tt)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var xt=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,gt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(D,K),i=(i=Math.imul(D,J))+Math.imul(F,K)|0,o=Math.imul(F,J),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul($,nt)|0,i=(i=i+Math.imul($,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul($,ot)|0,i=(i=i+Math.imul($,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,lt)|0,r=r+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(k,pt)|0))<<13)|0;l=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,nt),i=(i=Math.imul(D,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul($,ut)|0,i=(i=i+Math.imul($,lt)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ft)|0;var Nt=(l+(r=r+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(x,pt)|0))<<13)|0;l=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,lt)|0,r=r+Math.imul($,ht)|0,i=(i=i+Math.imul($,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Bt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(N,pt)|0))<<13)|0;l=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(D,ut),i=(i=Math.imul(D,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var $t=(l+(r=r+Math.imul($,pt)|0)|0)+((8191&(i=(i=i+Math.imul($,gt)|0)+Math.imul(P,pt)|0))<<13)|0;l=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(D,ht),i=(i=Math.imul(D,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Pt=(l+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(O,pt)|0))<<13)|0;l=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var It=(l+(r=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,gt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=kt,u[9]=Mt,u[10]=St,u[11]=xt,u[12]=Ct,u[13]=Tt,u[14]=Nt,u[15]=Bt,u[16]=$t,u[17]=Pt,u[18]=It,0!==l&&(u[19]=l,n.length++),n};function m(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var c=o-l,h=(0|t.words[c])*(0|e.words[l]),f=67108863&h;s=67108863&(f=f+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return m(t,e,n)}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):n<63?p(this,t,e):n<1024?m(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=r.clone()._ishlnsubmul(o,1,u);0===c.negative&&(r=c,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new k(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(A,b),r(_,b),r(E,b),E.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=a;0!==d.cmp(s);){for(var g=d,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(y),h=y.redSqr(),d=d.redMul(h),p=m}return f},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},r(M,k),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),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)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,commonjsGlobal)}));const version$3="logger/5.6.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(n){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const _normalizeError=_checkNormalize();var LogLevel,ErrorCode;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(LogLevel||(LogLevel={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();null==LogLevels[n]&&this.throwArgumentError("invalid log level name","logLevel",t),_logLevel>LogLevels[n]||console.log.apply(console,e)}debug(...t){this._log(Logger.levels.DEBUG,t)}info(...t){this._log(Logger.levels.INFO,t)}warn(...t){this._log(Logger.levels.WARNING,t)}makeError(t,e,n){if(_censorErrors)return this.makeError("censored error",e,{});e||(e=Logger.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((t=>{const e=n[t];try{if(e instanceof Uint8Array){let n="";for(let t=0;t<e.length;t++)n+=HEX[e[t]>>4],n+=HEX[15&e[t]];r.push(t+"=Uint8Array(0x"+n+")")}else r.push(t+"="+JSON.stringify(e))}catch(e){r.push(t+"="+JSON.stringify(n[t].toString()))}})),r.push(`code=${e}`),r.push(`version=${this.version}`);const i=t;let o="";switch(e){case ErrorCode.NUMERIC_FAULT:{o="NUMERIC_FAULT";const 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}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(t+=" ("+r.join(", ")+")");const a=new Error(t);return a.reason=i,a.code=e,Object.keys(n).forEach((function(t){a[t]=n[t]})),a}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Logger.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,r){t||this.throwError(e,n,r)}assertArgument(t,e,n,r){t||this.throwArgumentError(e,n,r)}checkNormalize(t){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n=n?": "+n:"",t<e&&this.throwError("missing argument"+n,Logger.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Logger.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",Logger.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$3)),_globalLogger}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!t)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!t,_permanentCensorErrors=!!e}static setLogLevel(t){const e=LogLevels[t.toLowerCase()];null!=e?_logLevel=e:Logger.globalLogger().warn("invalid log level - "+t)}static from(t){return new Logger(t)}}Logger.errors=ErrorCode,Logger.levels=LogLevel;const version$2="bytes/5.6.1",logger$3=new Logger(version$2);function isHexable(t){return!!t.toHexString}function addSlice(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function isInteger(t){return"number"==typeof t&&t==t&&t%1==0}function isBytes(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!isInteger(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const n=t[e];if(!isInteger(n)||n<0||n>=256)return!1}return!0}function arrayify(t,e){if(e||(e={}),"number"==typeof t){logger$3.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),addSlice(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),isHexable(t)&&(t=t.toHexString()),isHexString(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":logger$3.throwArgumentError("hex data is odd-length","value",t));const r=[];for(let t=0;t<n.length;t+=2)r.push(parseInt(n.substring(t,t+2),16));return addSlice(new Uint8Array(r))}return isBytes(t)?addSlice(new Uint8Array(t)):logger$3.throwArgumentError("invalid arrayify value","value",t)}function isHexString(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}const HexCharacters="0123456789abcdef";function hexlify(t,e){if(e||(e={}),"number"==typeof t){logger$3.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=HexCharacters[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),isHexable(t))return t.toHexString();if(isHexString(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":logger$3.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(isBytes(t)){let e="0x";for(let n=0;n<t.length;n++){let r=t[n];e+=HexCharacters[(240&r)>>4]+HexCharacters[15&r]}return e}return logger$3.throwArgumentError("invalid hexlify value","value",t)}function hexZeroPad(t,e){for("string"!=typeof t?t=hexlify(t):isHexString(t)||logger$3.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&logger$3.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}const version$1="bignumber/5.6.2";var BN=bn.BN;const logger$2=new Logger(version$1),_constructorGuard$1={},MAX_SAFE=9007199254740991;function isBigNumberish(t){return null!=t&&(BigNumber.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||isHexString(t)||"bigint"==typeof t||isBytes(t))}let _warnedToStringRadix=!1;class BigNumber{constructor(t,e){t!==_constructorGuard$1&&logger$2.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return toBigNumber(toBN(this).fromTwos(t))}toTwos(t){return toBigNumber(toBN(this).toTwos(t))}abs(){return"-"===this._hex[0]?BigNumber.from(this._hex.substring(1)):this}add(t){return toBigNumber(toBN(this).add(toBN(t)))}sub(t){return toBigNumber(toBN(this).sub(toBN(t)))}div(t){return BigNumber.from(t).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber(toBN(this).div(toBN(t)))}mul(t){return toBigNumber(toBN(this).mul(toBN(t)))}mod(t){const e=toBN(t);return e.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber(toBN(this).umod(e))}pow(t){const e=toBN(t);return e.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber(toBN(this).pow(e))}and(t){const e=toBN(t);return(this.isNegative()||e.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber(toBN(this).and(e))}or(t){const e=toBN(t);return(this.isNegative()||e.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber(toBN(this).or(e))}xor(t){const e=toBN(t);return(this.isNegative()||e.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber(toBN(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&throwFault$1("negative-width","mask"),toBigNumber(toBN(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&throwFault$1("negative-width","shl"),toBigNumber(toBN(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&throwFault$1("negative-width","shr"),toBigNumber(toBN(this).shrn(t))}eq(t){return toBN(this).eq(toBN(t))}lt(t){return toBN(this).lt(toBN(t))}lte(t){return toBN(this).lte(toBN(t))}gt(t){return toBN(this).gt(toBN(t))}gte(t){return toBN(this).gte(toBN(t))}isNegative(){return"-"===this._hex[0]}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(t){throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return logger$2.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?_warnedToStringRadix||(_warnedToStringRadix=!0,logger$2.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?logger$2.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{}):logger$2.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})),toBN(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof BigNumber)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new BigNumber(_constructorGuard$1,toHex(t)):t.match(/^-?[0-9]+$/)?new BigNumber(_constructorGuard$1,toHex(new BN(t))):logger$2.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&throwFault$1("underflow","BigNumber.from",t),(t>=MAX_SAFE||t<=-MAX_SAFE)&&throwFault$1("overflow","BigNumber.from",t),BigNumber.from(String(t));const e=t;if("bigint"==typeof e)return BigNumber.from(e.toString());if(isBytes(e))return BigNumber.from(hexlify(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return BigNumber.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(isHexString(t)||"-"===t[0]&&isHexString(t.substring(1))))return BigNumber.from(t)}return logger$2.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function toHex(t){if("string"!=typeof t)return toHex(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&logger$2.throwArgumentError("invalid hex","value",t),"0x00"===(t=toHex(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function toBigNumber(t){return BigNumber.from(toHex(t))}function toBN(t){const e=BigNumber.from(t).toHexString();return"-"===e[0]?new BN("-"+e.substring(3),16):new BN(e.substring(2),16)}function throwFault$1(t,e,n){const r={fault:t,operation:e};return null!=n&&(r.value=n),logger$2.throwError(t,Logger.errors.NUMERIC_FAULT,r)}const logger$1=new Logger(version$1),_constructorGuard={},Zero=BigNumber.from(0),NegativeOne=BigNumber.from(-1);function throwFault(t,e,n,r){const i={fault:e,operation:n};return void 0!==r&&(i.value=r),logger$1.throwError(t,Logger.errors.NUMERIC_FAULT,i)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(t){if("number"!=typeof t)try{t=BigNumber.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+zeros.substring(0,t):logger$1.throwArgumentError("invalid decimal size","decimals",t)}function formatFixed(t,e){null==e&&(e=0);const n=getMultiplier(e),r=(t=BigNumber.from(t)).lt(Zero);r&&(t=t.mul(NegativeOne));let i=t.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(n).toString();return t=1===n.length?o:o+"."+i,r&&(t="-"+t),t}function parseFixed(t,e){null==e&&(e=0);const n=getMultiplier(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||logger$1.throwArgumentError("invalid decimal value","value",t);const r="-"===t.substring(0,1);r&&(t=t.substring(1)),"."===t&&logger$1.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&logger$1.throwArgumentError("too many decimal points","value",t);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&throwFault("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<n.length-1;)a+="0";const s=BigNumber.from(o),u=BigNumber.from(a);let l=s.mul(n).add(u);return r&&(l=l.mul(NegativeOne)),l}class FixedFormat{constructor(t,e,n,r){t!==_constructorGuard&&logger$1.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=n,this.decimals=r,this.name=(e?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=getMultiplier(r),Object.freeze(this)}static from(t){if(t instanceof FixedFormat)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,n=128,r=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)e=!1;else{const i=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||logger$1.throwArgumentError("invalid fixed format","format",t),e="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(t){const i=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&logger$1.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&logger$1.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&logger$1.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new FixedFormat(_constructorGuard,e,n,r)}}class FixedNumber{constructor(t,e,n,r){t!==_constructorGuard&&logger$1.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=e,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&logger$1.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=parseFixed(this._value,this.format.decimals),n=parseFixed(t._value,t.format.decimals);return FixedNumber.fromValue(e.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=FixedNumber.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(e=e.subUnsafe(ONE.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=FixedNumber.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(e=e.addUnsafe(ONE.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&logger$1.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const n=FixedNumber.from("1"+zeros.substring(0,t),this.format),r=BUMP.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&logger$1.throwArgumentError("invalid byte width","width",t);return hexZeroPad(BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return FixedNumber.fromString(this._value,t)}static fromValue(t,e,n){return null!=n||null==e||isBigNumberish(e)||(n=e,e=null),null==e&&(e=0),null==n&&(n="fixed"),FixedNumber.fromString(formatFixed(t,e),FixedFormat.from(n))}static fromString(t,e){null==e&&(e="fixed");const n=FixedFormat.from(e),r=parseFixed(t,n.decimals);!n.signed&&r.lt(Zero)&&throwFault("unsigned value cannot be negative","overflow","value",t);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=hexZeroPad(i,n.width/8));const o=formatFixed(r,n.decimals);return new FixedNumber(_constructorGuard,i,o,n)}static fromBytes(t,e){null==e&&(e="fixed");const n=FixedFormat.from(e);if(arrayify(t).length>n.width/8)throw new Error("overflow");let r=BigNumber.from(t);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=formatFixed(r,n.decimals);return new FixedNumber(_constructorGuard,i,o,n)}static from(t,e){if("string"==typeof t)return FixedNumber.fromString(t,e);if(isBytes(t))return FixedNumber.fromBytes(t,e);try{return FixedNumber.fromValue(t,0,e)}catch(t){if(t.code!==Logger.errors.INVALID_ARGUMENT)throw t}return logger$1.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const ONE=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version="units/5.6.1",logger=new Logger(version),names=["wei","kwei","mwei","gwei","szabo","finney","ether"];function parseUnits(t,e){if("string"!=typeof t&&logger.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=names.indexOf(e);-1!==t&&(e=3*t)}return parseFixed(t,null!=e?e:18)}function _optionalChain$1(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],o=t[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(e=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o(((...t)=>n.call(e,...t))),e=void 0)}return n}let getTransaction=({paymentRoute:t,event:e,fee:n})=>{let r=t.exchangeRoutes[0],i={blockchain:t.blockchain,to:transactionAddress({paymentRoute:t,fee:n}),api:transactionApi({paymentRoute:t,fee:n}),method:transactionMethod({paymentRoute:t,fee:n}),params:transactionParams({paymentRoute:t,exchangeRoute:r,event:e,fee:n}),value:transactionValue({paymentRoute:t,exchangeRoute:r})};return r&&t.exchangePlugin&&(i=t.exchangePlugin.prepareTransaction(i)),t.contractCallPlugin&&(i=t.contractCallPlugin.prepareTransaction(i,t.toContract)),i},transactionAddress=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?t.toAddress:t.toToken.address:routers[t.blockchain].address,transactionApi=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?void 0:Token[t.blockchain].DEFAULT:routers[t.blockchain].api,transactionMethod=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?void 0:"transfer":"route",transactionParams=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>t.directTransfer&&!r?t.toToken.address==CONSTANTS$4[t.blockchain].NATIVE?void 0:[t.toAddress,t.toAmount]:{path:transactionPath({paymentRoute:t,exchangeRoute:e}),amounts:transactionAmounts({paymentRoute:t,exchangeRoute:e,fee:r}),addresses:transactionAddresses({paymentRoute:t,fee:r}),plugins:transactionPlugins({paymentRoute:t,exchangeRoute:e,event:n,fee:r}),data:[]},transactionPath=({paymentRoute:t,exchangeRoute:e})=>e?e.path:[t.toToken.address],transactionAmounts=({paymentRoute:t,exchangeRoute:e,fee:n})=>{let r;r=e?[e.amountIn.toString(),subtractFee({amount:e.amountOutMin.toString(),paymentRoute:t,fee:n}),e.transaction.params.deadline]:[t.toAmount,subtractFee({amount:t.toAmount,paymentRoute:t,fee:n})],n&&(r[4]=transactionFeeAmount({paymentRoute:t,fee:n}));for(var i=0;i<r.length;i++)null==r[i]&&(r[i]="0");return r},subtractFee=({amount:t,paymentRoute:e,fee:n})=>{if(n){let r=transactionFeeAmount({paymentRoute:e,fee:n});return BigNumber.from(t).sub(r).toString()}return t},transactionFeeAmount=({paymentRoute:t,fee:e})=>{if("string"==typeof e.amount&&e.amount.match("%"))return BigNumber.from(t.toAmount).div(1e3).mul(10*parseFloat(e.amount)).toString();if("string"==typeof e.amount)return e.amount;if("number"==typeof e.amount)return parseUnits(e.amount.toString(),t.toDecimals).toString();throw"Unknown fee amount type!"},transactionAddresses=({paymentRoute:t,fee:e})=>e?[t.fromAddress,e.receiver,t.toAddress]:[t.fromAddress,t.toAddress],transactionPlugins=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>{let i=[];if(e&&(t.exchangePlugin=plugins[t.blockchain][e.exchange.name],i.push(t.exchangePlugin.address)),t.toContract){let e=t.toContract.signature.match(/\(.*\)/);if(e&&_optionalChain$1([e,"optionalAccess",t=>t.length])){e=e[0].replace(/[\(\)]/g,"");let n=e.split(",");if("address"==n[0]&&n[1].match("uint")&&"bool"==n[2]&&Number.isNaN(parseInt(t.toContract.params[0])))t.contractCallPlugin=plugins[t.blockchain].contractCall.approveAndCallContractAddressAmountBoolean;else{if("address"!=n[0]||!n[1].match("uint")||"bool"!=n[2]||Number.isNaN(parseInt(t.toContract.params[0])))throw e;t.contractCallPlugin=plugins[t.blockchain].contractCall.approveAndCallContractAddressPassedAmountBoolean}i.push(t.contractCallPlugin.address)}}else"ifSwapped"!=n||t.directTransfer?i.push(plugins[t.blockchain].payment.address):i.push(plugins[t.blockchain].paymentWithEvent.address);return r&&i.push(plugins[t.blockchain].paymentFee.address),i},transactionValue=({paymentRoute:t,exchangeRoute:e})=>t.fromToken.address==CONSTANTS$4[t.blockchain].NATIVE?e?e.amountIn.toString():t.toAmount.toString():BigNumber.from("0").toString();
120
120
  /**
121
121
  * @license
122
122
  * Lodash <https://lodash.com/>