@dodoex/widgets 2.3.2 → 2.3.3
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.
- package/dist/cjs/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +7 -7
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@lingui/react"),t=require("bignumber.js"),r=require("lodash"),n=require("react"),o=require("@emotion/react"),i=require("@dodoex/icons"),s=require("@emotion/styled"),a=require("react-dom"),c=require("react-redux"),u=require("identicon.js"),l=require("@web3-react/core"),d=require("@reduxjs/toolkit"),h=require("redux"),f=require("@ethersproject/contracts"),p=require("@web3-react/eip1193"),m=require("@web3-react/walletconnect"),g=require("@web3-react/metamask"),y=require("@web3-react/types"),b=require("axios"),v=require("@ethersproject/bignumber"),w=require("@lingui/core"),x=require("react-window");function E(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function A(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var R,k=E(t),_=E(n),S=A(n),N=E(s),M=A(a),T=E(a),O=E(u),I=E(b),W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},F={exports:{}},C={exports:{}},j={};var U,D,B,V,P,Z,z,L,H,Y,X,J,G,q,K={};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@lingui/react"),t=require("bignumber.js"),r=require("lodash"),n=require("react"),o=require("@emotion/react"),i=require("@dodoex/icons"),s=require("@emotion/styled"),a=require("react-dom"),c=require("react-redux"),u=require("identicon.js"),l=require("@web3-react/core"),d=require("@reduxjs/toolkit"),h=require("redux"),f=require("@ethersproject/contracts"),p=require("@web3-react/eip1193"),m=require("@web3-react/walletconnect-v2"),g=require("@web3-react/metamask"),y=require("@web3-react/types"),b=require("axios"),v=require("@ethersproject/bignumber"),w=require("@lingui/core"),x=require("react-window");function E(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function A(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var R,k=E(t),_=E(n),S=A(n),N=E(s),M=A(a),T=E(a),O=E(u),I=E(b),W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},F={exports:{}},C={exports:{}},j={};var U,D,B,V,P,Z,z,L,H,Y,X,J,G,q,K={};
|
|
2
2
|
/** @license React v16.13.1
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
@@ -41,4 +41,4 @@ object-assign
|
|
|
41
41
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
42
42
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
43
43
|
* @license MIT
|
|
44
|
-
*/!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=W:o&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&e.exports,s=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),c=[4,1024,262144,67108864],u=[0,8,16,24],l=[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],d=[224,256,384,512],h=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,r){return function(n){return new T(e,t,e).update(n)[r]()}},g=function(e,t,r){return function(n,o){return new T(e,t,o).update(n)[r]()}},y=function(e,t,r){return function(t,n,o,i){return E["cshake"+e].update(t,n,o,i)[r]()}},b=function(e,t,r){return function(t,n,o,i){return E["kmac"+e].update(t,n,o,i)[r]()}},v=function(e,t,r,n){for(var o=0;o<f.length;++o){var i=f[o];e[i]=t(r,n,i)}return e},w=function(e,t){var r=m(e,t,"hex");return r.create=function(){return new T(e,t,e)},r.update=function(e){return r.create().update(e)},v(r,m,e,t)},x=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(e,t){var r=g(e,t,"hex");return r.create=function(r){return new T(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},v(r,g,e,t)}},{name:"cshake",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=y(e,0,"hex");return n.create=function(n,o,i){return o||i?new T(e,t,n).bytepad([o,i],r):E["shake"+e].create(n)},n.update=function(e,t,r,o){return n.create(t,r,o).update(e)},v(n,y,e,t)}},{name:"kmac",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=b(e,0,"hex");return n.create=function(n,o,i){return new O(e,t,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(e,t,r,o){return n.create(e,r,o).update(t)},v(n,b,e,t)}}],E={},A=[],R=0;R<x.length;++R)for(var k=x[R],_=k.bits,S=0;S<_.length;++S){var N=k.name+"_"+_[S];if(A.push(N),E[N]=k.createMethod(_[S],k.padding),"sha3"!==k.name){var M=k.name+_[S];A.push(M),E[M]=E[N]}}function T(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function O(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var o,i,a=this.blocks,c=this.byteCount,l=e.length,d=this.blockCount,h=0,f=this.s;h<l;){if(this.reset)for(this.reset=!1,a[0]=this.block,o=1;o<d+1;++o)a[o]=0;if(r)for(o=this.start;h<l&&o<c;++h)a[o>>2]|=e[h]<<u[3&o++];else for(o=this.start;h<l&&o<c;++h)(i=e.charCodeAt(h))<128?a[o>>2]|=i<<u[3&o++]:i<2048?(a[o>>2]|=(192|i>>6)<<u[3&o++],a[o>>2]|=(128|63&i)<<u[3&o++]):i<55296||i>=57344?(a[o>>2]|=(224|i>>12)<<u[3&o++],a[o>>2]|=(128|i>>6&63)<<u[3&o++],a[o>>2]|=(128|63&i)<<u[3&o++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),a[o>>2]|=(240|i>>18)<<u[3&o++],a[o>>2]|=(128|i>>12&63)<<u[3&o++],a[o>>2]|=(128|i>>6&63)<<u[3&o++],a[o>>2]|=(128|63&i)<<u[3&o++]);if(this.lastByteIndex=o,o>=c){for(this.start=o-c,this.block=a[d],o=0;o<d;++o)f[o]^=a[o];I(f),this.reset=!0}else this.start=o}return this},T.prototype.encode=function(e,t){var r=255&e,n=1,o=[r];for(r=255&(e>>=8);r>0;)o.unshift(r),r=255&(e>>=8),++n;return t?o.push(n):o.unshift(n),this.update(o),o.length},T.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var o=0,i=e.length;if(r)o=i;else for(var a=0;a<e.length;++a){var c=e.charCodeAt(a);c<128?o+=1:c<2048?o+=2:c<55296||c>=57344?o+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++a)),o+=4)}return o+=this.encode(8*o),this.update(e),o},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var o=t-r%t,i=[];return i.length=o,this.update(i),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];I(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,c="";s<n;){for(i=0;i<t&&s<n;++i,++s)e=r[i],c+=a[e>>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(I(r),i=0)}return o&&(e=r[i],c+=a[e>>4&15]+a[15&e],o>1&&(c+=a[e>>12&15]+a[e>>8&15]),o>2&&(c+=a[e>>20&15]+a[e>>16&15])),c},T.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,a=this.outputBits>>3;e=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<n;){for(i=0;i<t&&s<n;++i,++s)c[s]=r[i];s%t==0&&I(r)}return o&&(c[i]=r[i],e=e.slice(0,a)),e},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,s=0,a=0,c=[];a<o;){for(s=0;s<r&&a<o;++s,++a)e=a<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r==0&&I(n)}return i&&(e=a<<2,t=n[s],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},O.prototype=new T,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var I=function(e){var t,r,n,o,i,s,a,c,u,d,h,f,p,m,g,y,b,v,w,x,E,A,R,k,_,S,N,M,T,O,I,W,F,C,j,U,D,B,V,P,Z,z,L,H,Y,X,J,G,q,K,Q,$,ee,te,re,ne,oe,ie,se,ae,ce,ue,le;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(c<<1|u>>>31),r=i^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(d<<1|h>>>31),r=a^(h<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(f<<1|p>>>31),r=u^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(o<<1|i>>>31),r=h^(i<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],X=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,T=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,L=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,j=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,G=e[22]<<10|e[23]>>>22,q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,K=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,W=e[45]<<29|e[44]>>>3,F=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,_=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,V=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,P=e[38]<<8|e[39]>>>24,Z=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,R=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=k^~S&M,e[11]=_^~N&T,e[20]=C^~U&B,e[21]=j^~D&V,e[30]=H^~X&G,e[31]=Y^~J&q,e[40]=te^~ne&ie,e[41]=re^~oe&se,e[2]=y^~v&x,e[3]=b^~w&E,e[12]=S^~M&O,e[13]=N^~T&I,e[22]=U^~B&P,e[23]=D^~V&Z,e[32]=X^~G&K,e[33]=J^~q&Q,e[42]=ne^~ie&ae,e[43]=oe^~se&ce,e[4]=v^~x&A,e[5]=w^~E&R,e[14]=M^~O&W,e[15]=T^~I&F,e[24]=B^~P&z,e[25]=V^~Z&L,e[34]=G^~K&$,e[35]=q^~Q&ee,e[44]=ie^~ae&ue,e[45]=se^~ce&le,e[6]=x^~A&m,e[7]=E^~R&g,e[16]=O^~W&k,e[17]=I^~F&_,e[26]=P^~z&C,e[27]=Z^~L&j,e[36]=K^~$&H,e[37]=Q^~ee&Y,e[46]=ae^~ue&te,e[47]=ce^~le&re,e[8]=A^~m&y,e[9]=R^~g&b,e[18]=W^~k&S,e[19]=F^~_&N,e[28]=z^~C&U,e[29]=L^~j&D,e[38]=$^~H&X,e[39]=ee^~Y&J,e[48]=ue^~te&ne,e[49]=le^~re&oe,e[0]^=l[n],e[1]^=l[n+1]};if(i)e.exports=E;else for(R=0;R<A.length;++R)n[A[R]]=E[A[R]]}()}(Bi);var Vi=Bi.exports;function Pi(e){return"0x"+Vi.keccak_256(Ni(e))}const Zi=new xi("rlp/5.7.0");function zi(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Li(e,t,r){let n=0;for(let o=0;o<r;o++)n=256*n+e[t+o];return n}function Hi(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(Hi(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=zi(t.length);return r.unshift(247+r.length),r.concat(t)}ki(e)||Zi.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(Ni(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=zi(t.length);return r.unshift(183+r.length),r.concat(t)}function Yi(e){return Ii(Hi(e))}function Xi(e,t,r,n){const o=[];for(;r<t+1+n;){const i=Ji(e,r);o.push(i.result),(r+=i.consumed)>t+1+n&&Zi.throwError("child data too short",xi.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function Ji(e,t){if(0===e.length&&Zi.throwError("data too short",xi.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&Zi.throwError("data short segment too short",xi.errors.BUFFER_OVERRUN,{});const n=Li(e,t+1,r);return t+1+r+n>e.length&&Zi.throwError("data long segment too short",xi.errors.BUFFER_OVERRUN,{}),Xi(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&Zi.throwError("data array too short",xi.errors.BUFFER_OVERRUN,{}),Xi(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&Zi.throwError("data array too short",xi.errors.BUFFER_OVERRUN,{});const n=Li(e,t+1,r);t+1+r+n>e.length&&Zi.throwError("data array too short",xi.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:Ii(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&Zi.throwError("data too short",xi.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:Ii(e.slice(t+1,t+1+r))}}return{consumed:1,result:Ii(e[t])}}function Gi(e){const t=Ni(e),r=Ji(t,0);return r.consumed!==t.length&&Zi.throwArgumentError("invalid rlp data","data",e),r.result}const qi=new xi("address/5.7.0");function Ki(e){Oi(e,20)||qi.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=Ni(Pi(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Qi={};for(let e=0;e<10;e++)Qi[String(e)]=String(e);for(let e=0;e<26;e++)Qi[String.fromCharCode(65+e)]=String(10+e);const $i=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function es(e){let t=null;if("string"!=typeof e&&qi.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Ki(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&qi.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Qi[e])).join("");for(;t.length>=$i;){let e=t.substring(0,$i);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&qi.throwArgumentError("bad icap checksum","address",e),t=v._base36To16(e.substring(4));t.length<40;)t="0"+t;t=Ki("0x"+t)}else qi.throwArgumentError("invalid address","address",e);return t}const ts=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const r=e.substring(2,e.length).toLowerCase(),n=t.substring(2,t.length).toLowerCase();return r.length>n.length?r.endsWith(n):n.endsWith(r)};const rs=e=>{const t={isMainnet:1===e,isRinkeby:4===e,isGor:5===e};return Object.assign(Object.assign({},t),{isETH:t.isMainnet||t.isRinkeby||t.isGor})};var ns;!function(e){e[e.MAINNET=1]="MAINNET",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.HECO=128]="HECO",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_RINKEBY=421611]="ARBITRUM_RINKEBY",e[e.AURORA=1313161554]="AURORA",e[e.MOONRIVER=1285]="MOONRIVER",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.BOBA=288]="BOBA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CRONOS=25]="CRONOS"}(ns||(ns={}));const os={[ns.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[ns.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[ns.GOERLI]:["https://goerli.optimism.io/"],[ns.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org","https://bsc-dataseed4.binance.org","https://bsc-dataseed1.defibit.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed3.defibit.io","https://bsc-dataseed4.defibit.io","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.ninicoin.io","https://bsc-dataseed3.ninicoin.io","https://bsc-dataseed4.ninicoin.io","https://bsc-dataseed.binance.org","https://rpc.ankr.com/bsc","https://bscrpc.com","https://bsc.mytokenpocket.vip","https://binance.nodereal.io","https://rpc-bsc.bnb48.club"],[ns.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[ns.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.matic.network","https://matic-mainnet.chainstacklabs.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://matic-mainnet-full-rpc.bwarelabs.com","https://matic-mainnet-archive-rpc.bwarelabs.com","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon","https://polygon-mainnet.public.blastapi.io"],[ns.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[ns.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[ns.AURORA]:["https://mainnet.aurora.dev/"],[ns.MOONRIVER]:["https://rpc.api.moonriver.moonbeam.network","https://moonriver.api.onfinality.io/rpc?apikey=673e1fae-c9c9-4c7f-a3d5-2121e8274366","https://moonriver.api.onfinality.io/public","https://moonriver.public.blastapi.io"],[ns.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[ns.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[ns.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[ns.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[ns.CRONOS]:["https://evm.cronos.org","https://cronos-rpc.heavenswail.one","https://evm-cronos.crypto.org","https://cronosrpc-1.xstaking.sg","https://cronos-rpc.elk.finance"]},is={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},ss={[ns.MAINNET]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[ns.RINKEBY]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[ns.GOERLI]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[ns.OPTIMISM]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[ns.CRONOS]:Object.assign(Object.assign({},is),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[ns.BOBA]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[ns.BSC]:Object.assign(Object.assign({},is),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[ns.OKCHAIN]:Object.assign(Object.assign({},is),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[ns.HECO]:Object.assign(Object.assign({},is),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[ns.POLYGON]:Object.assign(Object.assign({},is),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[ns.MOONRIVER]:Object.assign(Object.assign({},is),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[ns.ARBITRUM_ONE]:Object.assign(Object.assign({},is),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[ns.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},is),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[ns.AURORA]:Object.assign(Object.assign({},is),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[ns.AVALANCHE]:Object.assign(Object.assign({},is),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},as={[ns.MAINNET]:"ethereum",[ns.RINKEBY]:"rinkeby",[ns.GOERLI]:"goerli",[ns.OPTIMISM]:"optimism",[ns.CRONOS]:"cronos",[ns.BOBA]:"boba",[ns.BSC]:"bsc",[ns.OKCHAIN]:"okex-chain",[ns.HECO]:"heco",[ns.POLYGON]:"polygon",[ns.MOONRIVER]:"moonriver",[ns.ARBITRUM_ONE]:"arbitrum",[ns.ARBITRUM_RINKEBY]:"arb-rinkeby",[ns.AURORA]:"aurora",[ns.AVALANCHE]:"avalanche"},cs={[ns.MAINNET]:"etherscan.io",[ns.RINKEBY]:"rinkeby.etherscan.io",[ns.GOERLI]:"goerli.etherscan.io",[ns.OPTIMISM]:"optimistic.etherscan.io",[ns.CRONOS]:"cronoscan.com",[ns.BOBA]:"blockexplorer.boba.network",[ns.BSC]:"bscscan.com",[ns.OKCHAIN]:"www.oklink.com/okexchain",[ns.HECO]:"hecoinfo.com",[ns.POLYGON]:"polygonscan.com",[ns.MOONRIVER]:"moonriver.moonscan.io",[ns.ARBITRUM_ONE]:"arbiscan.io",[ns.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[ns.AURORA]:"aurorascan.dev",[ns.AVALANCHE]:"snowtrace.io"};function us(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function ls(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}const ds={colorMode:"dark",slippage:3..toString(),ddl:20};var hs=(e=ds,t)=>{switch(t.type){case"SET_COLOR_MODE":return Object.assign(Object.assign({},e),{colorMode:t.payload});case"SET_SLIPPAGE":return Object.assign(Object.assign({},e),{slippage:t.payload});case"SET_TRANSACTION_DDL":return Object.assign(Object.assign({},e),{ddl:t.payload});default:return e}};const fs={chainId:ns.MAINNET,latestBlockNumber:0};var ps=(e=fs,t)=>{switch(t.type){case"SET_CHAIN_ID":return Object.assign(Object.assign({},e),{chainId:t.payload});case"SET_BLOCK_NUMBER":return Object.assign(Object.assign({},e),{latestBlockNumber:t.payload});default:return e}};const ms={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var gs,ys=(e=ms,t)=>{switch(t.type){case"SET_TOKEN_LIST":return Object.assign(Object.assign({},e),{tokenList:t.payload});case"SET_POPULAR_TOKEN_LIST":return Object.assign(Object.assign({},e),{popularTokenList:t.payload});case"SET_SLIPPAGE_WITH_TOKENS":return Object.assign(Object.assign({},e),{slippageWithTokens:t.payload});case"SET_ETH_BALANCE":return Object.assign(Object.assign({},e),{ethBalance:t.payload});case"SET_DEFAULT_FROM_TOKEN":return Object.assign(Object.assign({},e),{defaultFromToken:t.payload});case"SET_DEFAULT_TO_TOKEN":return Object.assign(Object.assign({},e),{defaultToToken:t.payload});case"SET_ACCOUNT_BALANCES":return Object.assign(Object.assign({},e),{accountBalances:Object.assign(Object.assign({},e.accountBalances),t.payload)});case"SET_ACCOUNT_ALLOWANCES":const r=e.accountBalances;return Object.keys(r).map((e=>{r[e].tokenAllowances=t.payload})),Object.assign(Object.assign({},e),{accountBalances:r});case"SET_BALANCE_LOADINGS":return Object.assign(Object.assign({},e),{balanceLoadings:Object.assign(Object.assign({},e.balanceLoadings),t.payload)});default:return e}};!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(gs||(gs={}));const bs={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:gs.Initial};var vs=(e=bs,t)=>"SET_GLOBAL_PROPS"===t.type?Object.assign(Object.assign({},e),t.payload):e;const ws={settings:ds,wallet:fs,globals:bs,token:ms},xs=h.combineReducers({settings:hs,wallet:ps,token:ys,globals:vs}),Es=d.configureStore({reducer:xs,middleware:e=>e({serializableCheck:{ignoredActions:["SET_ACCOUNT_BALANCES","SET_ETH_BALANCE"],ignoredPaths:["token.accountBalances","token.ethBalance"]}}),preloadedState:ws}),As=e=>(null!=e?e:Es.getState()).wallet.chainId,Rs=e=>(null!=e?e:Es.getState()).wallet.latestBlockNumber,ks=e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),_s=e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})})),Ss="0x0000000000000000000000000000000000000000",Ns=v.BigNumber.from(-1),Ms=v.BigNumber.from(0),Ts=v.BigNumber.from(1),Os=v.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Is=[{constant:!0,inputs:[],name:"getCurrentBlockTimestamp",outputs:[{name:"timestamp",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{components:[{name:"target",type:"address"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{name:"blockNumber",type:"uint256"},{name:"returnData",type:"bytes[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getLastBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockDifficulty",outputs:[{name:"difficulty",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockGasLimit",outputs:[{name:"gaslimit",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockCoinbase",outputs:[{name:"coinbase",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],Ws={[ns.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[ns.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[ns.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[ns.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[ns.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[ns.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[ns.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[ns.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[ns.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[ns.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[ns.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[ns.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[ns.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[ns.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[ns.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};var Fs=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Cs=new xi("properties/5.7.0");function js(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function Us(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Ds(e){return Fs(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function Bs(e){const t={};for(const r in e)t[r]=e[r];return t}const Vs={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Ps(e){if(null==e||Vs[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!Ps(n))return!1}return!0}return Cs.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Zs(e){if(Ps(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>zs(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&js(t,r,zs(n))}return t}return Cs.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function zs(e){return Zs(e)}class Ls{constructor(e){for(const t in e)this[t]=zs(e[t])}}const Hs=new xi("abi/5.7.0"),Ys={};let Xs={calldata:!0,memory:!0,storage:!0},Js={calldata:!0,memory:!0};function Gs(e,t){if("bytes"===e||"string"===e){if(Xs[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Js[t])return!0;return(Xs[t]||"payable"===t)&&Hs.throwArgumentError("invalid modifier","name",t),!1}function qs(e,t){for(let r in t)js(e,r,t[r])}const Ks=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Qs=new RegExp(/^(.*)\[([0-9]*)\]$/);class $s{constructor(e,t){e!==Ys&&Hs.throwError("use fromString",xi.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),qs(this,t);let r=this.type.match(Qs);qs(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:$s.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ks.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ks.full?", ":",")+")"):t+=this.type,e!==Ks.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ks.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?$s.fromString(e,t):$s.fromObject(e)}static fromObject(e){return $s.isParamType(e)?e:new $s(Ys,{name:e.name||null,type:la(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map($s.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Hs.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},s=i;for(let r=0;r<e.length;r++){let i=e[r];switch(i){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=la(s.type),s.components=[o(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Gs(s.type,s.name)&&(s.name=""),s.type=la(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Gs(s.type,s.name)&&(s.name=""),s.type=la(s.type);let a=o(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=la(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Gs(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=i,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=i,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=i,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=i,delete s.state.allowArray):s.state.readArray?s.type+=i:n(r)}}return s.parent&&Hs.throwArgumentError("unexpected eof","param",e),delete i.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Gs(s.type,s.name)&&(s.name=""),i.type=la(i.type),i}(e,!!t),$s.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function ea(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];","===i&&0===n?(t.push(r),r=""):(r+=i,"("===i?n++:")"===i&&(n--,-1===n&&Hs.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>$s.fromString(e,t)))}class ta{constructor(e,t){e!==Ys&&Hs.throwError("use a static from method",xi.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),qs(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return ta.isFragment(e)?e:"string"==typeof e?ta.fromString(e):ta.fromObject(e)}static fromObject(e){if(ta.isFragment(e))return e;switch(e.type){case"function":return aa.fromObject(e);case"event":return ra.fromObject(e);case"constructor":return sa.fromObject(e);case"error":return ua.fromObject(e);case"fallback":case"receive":return null}return Hs.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?ra.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?aa.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?sa.fromString(e.trim()):"error"===e.split(" ")[0]?ua.fromString(e.substring(5).trim()):Hs.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class ra extends ta{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ks.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ",e!==Ks.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?ra.fromString(e):ra.fromObject(e)}static fromObject(e){if(ra.isEventFragment(e))return e;"event"!==e.type&&Hs.throwArgumentError("invalid event object","value",e);const t={name:ha(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map($s.fromObject):[],type:"event"};return new ra(Ys,t)}static fromString(e){let t=e.match(fa);t||Hs.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:Hs.warn("unknown modifier: "+e)}})),ra.fromObject({name:t[1].trim(),anonymous:r,inputs:ea(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function na(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Hs.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Hs.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=v.BigNumber.from(r[1]),r[0]):e}function oa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function ia(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Hs.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Hs.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Hs.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Hs.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Hs.throwArgumentError("unable to determine stateMutability","value",e),t}class sa extends ta{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Ks.sighash&&Hs.throwError("cannot format a constructor for sighash",xi.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?sa.fromString(e):sa.fromObject(e)}static fromObject(e){if(sa.isConstructorFragment(e))return e;"constructor"!==e.type&&Hs.throwArgumentError("invalid constructor object","value",e);let t=ia(e);t.constant&&Hs.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map($s.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?v.BigNumber.from(e.gas):null};return new sa(Ys,r)}static fromString(e){let t={type:"constructor"},r=(e=na(e,t)).match(fa);return r&&"constructor"===r[1].trim()||Hs.throwArgumentError("invalid constructor string","value",e),t.inputs=ea(r[2].trim(),!1),oa(r[3].trim(),t),sa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class aa extends sa{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ks.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ",e!==Ks.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?aa.fromString(e):aa.fromObject(e)}static fromObject(e){if(aa.isFunctionFragment(e))return e;"function"!==e.type&&Hs.throwArgumentError("invalid function object","value",e);let t=ia(e);const r={type:e.type,name:ha(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map($s.fromObject):[],outputs:e.outputs?e.outputs.map($s.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?v.BigNumber.from(e.gas):null};return new aa(Ys,r)}static fromString(e){let t={type:"function"},r=(e=na(e,t)).split(" returns ");r.length>2&&Hs.throwArgumentError("invalid function string","value",e);let n=r[0].match(fa);if(n||Hs.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&ha(t.name),t.inputs=ea(n[2],!1),oa(n[3].trim(),t),r.length>1){let n=r[1].match(fa);""==n[1].trim()&&""==n[3].trim()||Hs.throwArgumentError("unexpected tokens","value",e),t.outputs=ea(n[2],!1)}else t.outputs=[];return aa.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function ca(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Hs.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class ua extends ta{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ks.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?ua.fromString(e):ua.fromObject(e)}static fromObject(e){if(ua.isErrorFragment(e))return e;"error"!==e.type&&Hs.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:ha(e.name),inputs:e.inputs?e.inputs.map($s.fromObject):[]};return ca(new ua(Ys,t))}static fromString(e){let t={type:"error"},r=e.match(fa);return r||Hs.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&ha(t.name),t.inputs=ea(r[2],!1),ca(ua.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function la(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const da=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function ha(e){return e&&e.match(da)||Hs.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const fa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const pa=new xi("abi/5.7.0");class ma{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){pa.throwArgumentError(e,this.localName,t)}}class ga{constructor(e){js(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Ci(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Mi(e._data))}writeBytes(e){let t=Ni(e);const r=t.length%this.wordSize;return r&&(t=Mi([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Ni(v.BigNumber.from(e));return t.length>this.wordSize&&pa.throwError("value out-of-bounds",xi.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Mi([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class ya{constructor(e,t,r,n){js(this,"_data",Ni(e)),js(this,"wordSize",t||32),js(this,"_coerceFunc",r),js(this,"allowLoose",n),this._offset=0}get data(){return Ii(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):ya.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:pa.throwError("data out-of-bounds",xi.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new ya(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return v.BigNumber.from(this.readBytes(this.wordSize))}}class ba extends ma{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=es(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return es(Ui(e.readValue().toHexString(),20))}}class va extends ma{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const wa=new xi("abi/5.7.0");function xa(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||wa.throwError("cannot encode object for signature with missing names",xi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&wa.throwError("cannot encode object for signature with duplicate names",xi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else wa.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&wa.throwArgumentError("types/value length mismatch","tuple",r);let o=new ga(e.wordSize),i=new ga(e.wordSize),s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(o,r)})),s.forEach((e=>{e(o.length)}));let a=e.appendWriter(o);return a+=e.appendWriter(i),a}function Ea(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),i=n.subReader(r.toNumber());try{o=t.decode(i)}catch(e){if(e.code===xi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(e.code===xi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}null!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class Aa extends ma{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),wa.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return xa(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&wa.throwError("insufficient data length",xi.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new va(this.coder));return e.coerce(this.name,Ea(e,r))}}class Ra extends ma{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class ka extends ma{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Ni(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class _a extends ka{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Ii(super.decode(e)))}}class Sa extends ma{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=Ni(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,Ii(e.readBytes(this.size)))}}class Na extends ma{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class Ma extends ma{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=v.BigNumber.from(t),n=Os.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(Ts).mul(Ns)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Ms)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const Ta=new xi("strings/5.7.0");var Oa,Ia;function Wa(e,t,r,n,o){if(e===Ia.BAD_PREFIX||e===Ia.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===Ia.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Oa||(Oa={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Ia||(Ia={}));const Fa=Object.freeze({error:function(e,t,r,n,o){return Ta.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Wa,replace:function(e,t,r,n,o){return e===Ia.OVERLONG?(n.push(o),0):(n.push(65533),Wa(e,t,r))}});function Ca(e,t){null==t&&(t=Fa.error),e=Ni(e);const r=[];let n=0;for(;n<e.length;){const o=e[n++];if(o>>7==0){r.push(o);continue}let i=null,s=null;if(192==(224&o))i=1,s=127;else if(224==(240&o))i=2,s=2047;else{if(240!=(248&o)){n+=t(128==(192&o)?Ia.UNEXPECTED_CONTINUE:Ia.BAD_PREFIX,n-1,e,r);continue}i=3,s=65535}if(n-1+i>=e.length){n+=t(Ia.OVERRUN,n-1,e,r);continue}let a=o&(1<<8-i-1)-1;for(let o=0;o<i;o++){let o=e[n];if(128!=(192&o)){n+=t(Ia.MISSING_CONTINUE,n,e,r),a=null;break}a=a<<6|63&o,n++}null!==a&&(a>1114111?n+=t(Ia.OUT_OF_RANGE,n-1-i,e,r,a):a>=55296&&a<=57343?n+=t(Ia.UTF16_SURROGATE,n-1-i,e,r,a):a<=s?n+=t(Ia.OVERLONG,n-1-i,e,r,a):r.push(a))}return r}function ja(e,t=Oa.current){t!=Oa.current&&(Ta.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const o=e.charCodeAt(t);if(t>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&o);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Ni(r)}function Ua(e,t){return Ca(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class Da extends ka{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,ja(t))}decode(e){return Ua(super.decode(e))}}class Ba extends ma{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return xa(e,this.coders,t)}decode(e){return e.coerce(this.name,Ea(e,this.coders))}}const Va=new xi("abi/5.7.0"),Pa=new RegExp(/^bytes([0-9]*)$/),Za=new RegExp(/^(u?int)([0-9]*)$/);const za=new class{constructor(e){js(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new ba(e.name);case"bool":return new Ra(e.name);case"string":return new Da(e.name);case"bytes":return new _a(e.name);case"array":return new Aa(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Ba((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Na(e.name)}let t=e.type.match(Za);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&Va.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Ma(r/8,"int"===t[1],e.name)}if(t=e.type.match(Pa),t){let r=parseInt(t[1]);return(0===r||r>32)&&Va.throwArgumentError("invalid bytes length","param",e),new Sa(r,e.name)}return Va.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new ya(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new ga(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder($s.from(e))));return new Ba(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Va.throwError("types/values length mismatch",xi.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder($s.from(e)))),n=new Ba(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this._getCoder($s.from(e))));return new Ba(n,"_").decode(this._getReader(Ni(t),r))}};function La(e){return Pi(ja(e))}function Ha(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return Ni(t)}function Ya(e){e=Ni(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Xa(e,t){null==t&&(t=1);const r=[],n=r.forEach,o=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function Ja(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,i=[0,1];for(let e=1;e<n;e++)i.push(o+=r());let s=r(),a=t;t+=s;let c=0,u=0;function l(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const d=Math.pow(2,31),h=d>>>1,f=h>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|l();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*o-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<i[n]?r=n:t=n}if(0==t)break;g.push(t);let s=y+Math.floor(b*i[t]/o),a=y+Math.floor(b*i[t+1]/o)-1;for(;0==((s^a)&h);)m=m<<1&p|l(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&f;)m=m&h|m<<1&p>>>1|l(),s=s<<1^h,a=(a^h)<<1|h|1;y=s,b=1+a-s}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function Ga(e){return 1&e?~e>>1:e>>1}function qa(e,t){let r=Array(e);for(let n=0,o=-1;n<e;n++)r[n]=o+=1+t();return r}function Ka(e,t){let r=Array(e);for(let n=0,o=0;n<e;n++)r[n]=o+=Ga(t());return r}function Qa(e,t){let r=qa(e(),e),n=e(),o=qa(n,e),i=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<i[e];t++)r.push(o[e]+t);return t?r.map((e=>t[e])):r}function $a(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;o<t;o++)Ka(e,r).forEach(((e,t)=>n[t].push(e)));return n}function ec(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return Xa($a(o.length,1+e,t).map(((e,t)=>{const i=e[0],s=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[i+t*r,s.map((e=>e+o))]}))})))}function tc(e,t){return $a(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const rc=Ja(Ha("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),nc=new Set(Qa(rc)),oc=new Set(Qa(rc)),ic=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(ec(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(tc(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(Xa(t))}(rc),sc=function(e){let t=Qa(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let o=Qa(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),i=o%3;o=o/3|0;let s=!!(1&o);return o>>=1,{branches:n,valid:i,fe0f:s,save:1==o,check:2==o}}()}(rc);function ac(e){return function(e,t=Oa.current){return Ca(ja(e,t))}(e)}function cc(e){return e.filter((e=>65039!=e))}function uc(e){for(let t of e.split(".")){let e=ac(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function lc(e){return uc(function(e,t){let r=ac(e).reverse(),n=[];for(;r.length;){let e=dc(r);if(e){n.push(...t(e));continue}let o=r.pop();if(nc.has(o)){n.push(o);continue}if(oc.has(o))continue;let i=ic[o];if(!i)throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`);n.push(...i)}return uc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,cc))}function dc(e,t){var r;let n,o,i=sc,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(i=null===(r=i.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!i)break;if(i.save)o=c;else if(i.check&&c===o)break;s.push(c),i.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),i.valid&&(n=s.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}const hc=new xi("hash/5.7.0"),fc=new Uint8Array(32);function pc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function mc(e){const t=ja(lc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(pc(t.slice(n,e))),n=e+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(pc(t.slice(n))),r}function gc(e){"string"!=typeof e&&hc.throwArgumentError("invalid ENS name; not a string","name",e);let t=fc;const r=mc(e);for(;r.length;)t=Pi(Mi([t,Pi(r.pop())]));return Ii(t)}fc.fill(0);var yc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const bc=new xi("hash/5.7.0"),vc=new Uint8Array(32);vc.fill(0);const wc=v.BigNumber.from(-1),xc=v.BigNumber.from(0),Ec=v.BigNumber.from(1),Ac=v.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Rc=Ui(Ec.toHexString(),32),kc=Ui(xc.toHexString(),32),_c={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Sc=["name","version","chainId","verifyingContract","salt"];function Nc(e){return function(t){return"string"!=typeof t&&bc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Mc={name:Nc("name"),version:Nc("version"),chainId:function(e){try{return v.BigNumber.from(e).toString()}catch(e){}return bc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return es(e).toLowerCase()}catch(e){}return bc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Ni(e);if(32!==t.length)throw new Error("bad length");return Ii(t)}catch(e){}return bc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Tc(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&bc.throwArgumentError("invalid numeric width","type",e);const o=Ac.mask(r?n-1:n),i=r?o.add(Ec).mul(wc):xc;return function(t){const r=v.BigNumber.from(t);return(r.lt(i)||r.gt(o))&&bc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Ui(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&bc.throwArgumentError("invalid bytes width","type",e),function(t){return Ni(t).length!==r&&bc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Ni(e),r=t.length%32;return r?Ci([t,vc.slice(r)]):Ii(t)}(t)}}}switch(e){case"address":return function(e){return Ui(es(e),32)};case"bool":return function(e){return e?Rc:kc};case"bytes":return function(e){return Pi(e)};case"string":return function(e){return La(e)}}return null}function Oc(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Ic{constructor(e){js(this,"types",Object.freeze(zs(e))),js(this,"_encoderCache",{}),js(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const o={};e[n].forEach((i=>{o[i.name]&&bc.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&bc.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);Tc(s)||(r[s]||bc.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?bc.throwArgumentError("missing primary type","types",e):o.length>1&&bc.throwArgumentError(`ambiguous primary types or unused types: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),js(this,"primaryType",o[0]),function o(i,s){s[i]&&bc.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e),s[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(o(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[i]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=Oc(t,e[t])+r.map((t=>Oc(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Tc(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&bc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(Pi)),Pi(Ci(o))}}const r=this.types[e];if(r){const t=La(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?Pi(n):n}));return n.unshift(t),Ci(n)}}return bc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||bc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Pi(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Tc(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&bc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{}):bc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Ic(e)}static getPrimaryType(e){return Ic.from(e).primaryType}static hashStruct(e,t,r){return Ic.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=_c[r];n||bc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>Sc.indexOf(e.name)-Sc.indexOf(t.name))),Ic.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return Ci(["0x1901",Ic.hashDomain(e),Ic.from(t).hash(r)])}static hash(e,t,r){return Pi(Ic.encode(e,t,r))}static resolveNames(e,t,r,n){return yc(this,void 0,void 0,(function*(){e=Bs(e);const o={};e.verifyingContract&&!Oi(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=Ic.from(t);i.visit(r,((e,t)=>("address"!==e||Oi(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){Ic.hashDomain(e);const n={},o=[];Sc.forEach((t=>{const r=e[t];null!=r&&(n[t]=Mc[t](r),o.push({name:t,type:_c[t]}))}));const i=Ic.from(t),s=Bs(t);return s.EIP712Domain?bc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=o,i.encode(r),{types:s,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return Ii(Ni(t));if(e.match(/^u?int/))return v.BigNumber.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&bc.throwArgumentError("invalid string","value",t),t}return bc.throwArgumentError("unsupported type","type",e)}))}}}const Wc=new xi("abi/5.7.0");class Fc extends Ls{}class Cc extends Ls{}class jc extends Ls{}class Uc extends Ls{static isIndexed(e){return!(!e||!e._isIndexed)}}const Dc={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Bc(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class Vc{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,js(this,"fragments",t.map((e=>ta.from(e))).filter((e=>null!=e))),js(this,"_abiCoder",Us(new.target,"getAbiCoder")()),js(this,"functions",{}),js(this,"errors",{}),js(this,"events",{}),js(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Wc.warn("duplicate definition - constructor"):void js(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?Wc.warn("duplicate definition - "+r):t[r]=e})),this.deploy||js(this,"deploy",sa.from({payable:!1,type:"constructor"})),js(this,"_isInterface",!0)}format(e){e||(e=Ks.full),e===Ks.sighash&&Wc.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ks.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return za}static getAddress(e){return es(e)}static getSighash(e){return Fi(La(e.format()),0,4)}static getEventTopic(e){return La(e.format())}getFunction(e){if(Oi(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Wc.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?Wc.throwArgumentError("no matching function","name",t):r.length>1&&Wc.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[aa.fromString(e).format()];return t||Wc.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Oi(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Wc.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?Wc.throwArgumentError("no matching event","name",t):r.length>1&&Wc.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[ra.fromString(e).format()];return t||Wc.throwArgumentError("no matching event","signature",e),t}getError(e){if(Oi(e)){const t=Us(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Wc.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?Wc.throwArgumentError("no matching error","name",t):r.length>1&&Wc.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[aa.fromString(e).format()];return t||Wc.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return Us(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Us(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=Ni(t);return Ii(r.slice(0,4))!==this.getSighash(e)&&Wc.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Ii(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Ii(Mi([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Ni(t);return Ii(r.slice(0,4))!==this.getSighash(e)&&Wc.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ii(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ii(Mi([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Ni(t),n=null,o="",i=null,s=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=Ii(r.slice(0,4)),t=Dc[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.signature,t.reason&&(n=i[0]),"Error"===s?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===s&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.format()}catch(e){}break}}return Wc.throwError("call revert exception"+o,xi.errors.CALL_EXCEPTION,{method:e.format(),data:Ii(t),errorArgs:i,errorName:s,errorSignature:a,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ii(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Wc.throwError("too many arguments for "+e.format(),xi.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?La(t):"bytes"===e.type?Pi(Ii(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=v.BigNumber.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Ui(Ii(t),32));for(t.forEach(((t,o)=>{let i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?Wc.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>n(i,e)))):r.push(n(i,t)):null!=t&&Wc.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Wc.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const s=t[i];if(e.indexed)if("string"===e.type)r.push(La(s));else if("bytes"===e.type)r.push(Pi(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),o.push(s)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Oi(r[0],32)&&r[0].toLowerCase()===t||Wc.throwError("fragment/topic mismatch",xi.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push($s.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let s=null!=r?this._abiCoder.decode(n,Mi(r)):null,a=this._abiCoder.decode(o,t,!0),c=[],u=0,l=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==s)c[t]=new Uc({_isIndexed:!0,hash:null});else if(i[t])c[t]=new Uc({_isIndexed:!0,hash:s[l++]});else try{c[t]=s[l++]}catch(e){c[t]=e}else try{c[t]=a[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw Bc(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e<c.length;e++){const t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:()=>{throw Bc(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Cc({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:v.BigNumber.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Fc({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Ii(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new jc({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}function Pc(e,t,...r){return ls(this,void 0,void 0,(function*(){const n=[];for(const e of r)for(const t of e)t.callData&&n.push(t.callData);const o=yield function(e,t,r){return ls(this,void 0,void 0,(function*(){const n=yield Zc(e,t,r),o=new Map;for(const{req:e,resp:t}of n)o.set(e,t);return e.map((e=>({req:e,resp:o.get(e)})))}))}(n,e,t),i=new Map;for(const{req:e,resp:t}of o)i.set(e,null==t?void 0:t.result);return r.map((e=>e.filter((e=>!e.callData||i.get(e.callData))).map(((e,t)=>e.processor(e.callData?i.get(e.callData):null,t)))))}))}function Zc(e,t,n){return ls(this,void 0,void 0,(function*(){let o=[e];e.length>800&&(o=r.chunk(e,800));let i=[];const s=o.map((e=>ls(this,void 0,void 0,(function*(){const r=e.map((e=>[e.to,e.data])),o={data:t.interface.encodeFunctionData("aggregate",[r]),to:n};let s;try{s=yield t.provider.call(o)}catch(r){const o=e.length;if(o>20){const r=Math.floor(o/2),[s,a]=yield Promise.all([Zc(e.slice(0,r),t,n),Zc(e.slice(r,o),t,n)]);i=[...i,...s,...a]}else{const e="[sendCallReqs] error";console.error(e,r)}}if(void 0===s)throw new Error("Unexpected batch result");const[a,c]=za.decode(["uint256","bytes[]"],s);if(e.length!==c.length)throw new Error("Unexpected length mismatch");return c.map(((t,r)=>({resp:{result:t},req:e[r]})))}))));return(yield Promise.allSettled(s)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{i=[...i,...e]})),i}))}function zc(e,t,r,n){if(!function(e){try{return es(e)}catch(e){return!1}}(e)||e===Ss)throw Error(`Invalid 'address' parameter '${e}'.`);return new f.Contract(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(r,n))}function Lc(){const{provider:e,account:t,chainId:r}=l.useWeb3React(),[o,i]=n.useState(!1),s=n.useMemo((()=>Ws[r]),[r]),a=n.useCallback(((r,n)=>{if(e)return zc(r,n,e,t)}),[e,t]),c=n.useCallback((e=>{if(!s)return;const{MULTI_CALL:t}=s,r=a(t,Is);return(()=>ls(this,void 0,void 0,(function*(){if(r){i(!0);try{const[n]=yield Pc(r,t,e);return n}catch(e){console.error("Contract: useMultiContract is error",e)}i(!1)}})))()}),[s,a]);return{getContract:a,contractConfig:s,call:c,loading:o}}var Hc=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"isERC20",outputs:[{internalType:"bool",name:"isOk",type:"bool"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"judgeERC20",outputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"}];function Yc(){const{provider:e,account:t}=l.useWeb3React(),r=c.useDispatch(),o=c.useSelector(Rs);n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBalance(t);r((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_ETH_BALANCE",payload:e})})))(new k.default(n.toString()).div(1e18)))}))})()}),[e,t,r,o])}function Xc(){const{provider:e,chainId:t}=l.useWeb3React(),r=c.useDispatch(),o=n.useCallback((()=>ls(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBlockNumber();r((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(n))}))),[e,t]);return{updateBlockNumber:o}}var Jc,Gc;!function(e){e.All="all",e.Default="default",e.Coingecko="coingecko"}(Jc||(Jc={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(Gc||(Gc={}));var qc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Kc=new xi("abstract-provider/5.7.0");class Qc extends Ls{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class $c{constructor(){Kc.checkAbstract(new.target,$c),js(this,"_isProvider",!0)}getFeeData(){return qc(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield Ds({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=v.BigNumber.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}const eu=new xi("networks/5.7.1");function tu(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const i=new t.PocketProvider(e,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],i=new t.AnkrProvider(e,r.ankr);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return tu(e)},t}function ru(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return ru(e,t)},r}const nu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:tu("homestead")},ou={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:tu("ropsten")},iu={chainId:63,name:"classicMordor",_defaultProvider:ru("https://www.ethercluster.com/mordor","classicMordor")},su={unspecified:{chainId:0,name:"unspecified"},homestead:nu,mainnet:nu,morden:{chainId:2,name:"morden"},ropsten:ou,testnet:ou,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:tu("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:tu("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:tu("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:tu("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ru("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:iu,classicTestnet:iu,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ru("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:tu("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:tu("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"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};class au{constructor(e){js(this,"alphabet",e),js(this,"base",e.length),js(this,"_alphabetMap",{}),js(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=Ni(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let o=n;for(let e=0;e<t.length;++e)o+=t[e]*this.base,t[e]=255&o,o>>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return Ni(new Uint8Array(t.reverse()))}}new au("abcdefghijklmnopqrstuvwxyz234567");const cu=new au("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var uu={},lu={},du=hu;function hu(e,t){if(!e)throw new Error(t||"Assertion failed")}hu.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var fu,pu={exports:{}},mu={exports:{}};!function(e){try{var t=require("util");if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(fu||(fu=1,"function"==typeof Object.create?mu.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:mu.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),mu.exports)}}(pu);var gu=du,yu=pu.exports;function bu(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function vu(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function wu(e){return 1===e.length?"0"+e:e}function xu(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}lu.inherits=yu,lu.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):bu(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},lu.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=wu(e[r].toString(16));return t},lu.htonl=vu,lu.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=vu(o)),r+=xu(o.toString(16))}return r},lu.zero2=wu,lu.zero8=xu,lu.join32=function(e,t,r,n){var o=r-t;gu(o%4==0);for(var i=new Array(o/4),s=0,a=t;s<i.length;s++,a+=4){var c;c="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],i[s]=c>>>0}return i},lu.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},lu.rotr32=function(e,t){return e>>>t|e<<32-t},lu.rotl32=function(e,t){return e<<t|e>>>32-t},lu.sum32=function(e,t){return e+t>>>0},lu.sum32_3=function(e,t,r){return e+t+r>>>0},lu.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},lu.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},lu.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,s=(i<n?1:0)+r+o;e[t]=s>>>0,e[t+1]=i},lu.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},lu.sum64_lo=function(e,t,r,n){return t+n>>>0},lu.sum64_4_hi=function(e,t,r,n,o,i,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+i>>>0)<i?1:0,e+r+o+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},lu.sum64_4_lo=function(e,t,r,n,o,i,s,a){return t+n+i+a>>>0},lu.sum64_5_hi=function(e,t,r,n,o,i,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+i>>>0)<i?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+o+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},lu.sum64_5_lo=function(e,t,r,n,o,i,s,a,c,u){return t+n+i+a+u>>>0},lu.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},lu.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},lu.shr64_hi=function(e,t,r){return e>>>r},lu.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var Eu={},Au=lu,Ru=du;function ku(){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}Eu.BlockHash=ku,ku.prototype.update=function(e,t){if(e=Au.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=Au.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},ku.prototype.digest=function(e){return this.update(this._pad()),Ru(null===this.pending),this._digest(e)},ku.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n};var _u={},Su={},Nu=lu.rotr32;function Mu(e,t,r){return e&t^~e&r}function Tu(e,t,r){return e&t^e&r^t&r}function Ou(e,t,r){return e^t^r}Su.ft_1=function(e,t,r,n){return 0===e?Mu(t,r,n):1===e||3===e?Ou(t,r,n):2===e?Tu(t,r,n):void 0},Su.ch32=Mu,Su.maj32=Tu,Su.p32=Ou,Su.s0_256=function(e){return Nu(e,2)^Nu(e,13)^Nu(e,22)},Su.s1_256=function(e){return Nu(e,6)^Nu(e,11)^Nu(e,25)},Su.g0_256=function(e){return Nu(e,7)^Nu(e,18)^e>>>3},Su.g1_256=function(e){return Nu(e,17)^Nu(e,19)^e>>>10};var Iu=lu,Wu=Eu,Fu=Su,Cu=Iu.rotl32,ju=Iu.sum32,Uu=Iu.sum32_5,Du=Fu.ft_1,Bu=Wu.BlockHash,Vu=[1518500249,1859775393,2400959708,3395469782];function Pu(){if(!(this instanceof Pu))return new Pu;Bu.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Iu.inherits(Pu,Bu);var Zu=Pu;Pu.blockSize=512,Pu.outSize=160,Pu.hmacStrength=80,Pu.padLength=64,Pu.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Cu(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var u=~~(n/20),l=Uu(Cu(o,5),Du(u,i,s,a),c,r[n],Vu[u]);c=a,a=s,s=Cu(i,30),i=o,o=l}this.h[0]=ju(this.h[0],o),this.h[1]=ju(this.h[1],i),this.h[2]=ju(this.h[2],s),this.h[3]=ju(this.h[3],a),this.h[4]=ju(this.h[4],c)},Pu.prototype._digest=function(e){return"hex"===e?Iu.toHex32(this.h,"big"):Iu.split32(this.h,"big")};var zu=lu,Lu=Eu,Hu=Su,Yu=du,Xu=zu.sum32,Ju=zu.sum32_4,Gu=zu.sum32_5,qu=Hu.ch32,Ku=Hu.maj32,Qu=Hu.s0_256,$u=Hu.s1_256,el=Hu.g0_256,tl=Hu.g1_256,rl=Lu.BlockHash,nl=[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 ol(){if(!(this instanceof ol))return new ol;rl.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=nl,this.W=new Array(64)}zu.inherits(ol,rl);var il=ol;ol.blockSize=512,ol.outSize=256,ol.hmacStrength=192,ol.padLength=64,ol.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Ju(tl(r[n-2]),r[n-7],el(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],d=this.h[7];for(Yu(this.k.length===r.length),n=0;n<r.length;n++){var h=Gu(d,$u(c),qu(c,u,l),this.k[n],r[n]),f=Xu(Qu(o),Ku(o,i,s));d=l,l=u,u=c,c=Xu(a,h),a=s,s=i,i=o,o=Xu(h,f)}this.h[0]=Xu(this.h[0],o),this.h[1]=Xu(this.h[1],i),this.h[2]=Xu(this.h[2],s),this.h[3]=Xu(this.h[3],a),this.h[4]=Xu(this.h[4],c),this.h[5]=Xu(this.h[5],u),this.h[6]=Xu(this.h[6],l),this.h[7]=Xu(this.h[7],d)},ol.prototype._digest=function(e){return"hex"===e?zu.toHex32(this.h,"big"):zu.split32(this.h,"big")};var sl=lu,al=il;function cl(){if(!(this instanceof cl))return new cl;al.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sl.inherits(cl,al);var ul=cl;cl.blockSize=512,cl.outSize=224,cl.hmacStrength=192,cl.padLength=64,cl.prototype._digest=function(e){return"hex"===e?sl.toHex32(this.h.slice(0,7),"big"):sl.split32(this.h.slice(0,7),"big")};var ll=lu,dl=Eu,hl=du,fl=ll.rotr64_hi,pl=ll.rotr64_lo,ml=ll.shr64_hi,gl=ll.shr64_lo,yl=ll.sum64,bl=ll.sum64_hi,vl=ll.sum64_lo,wl=ll.sum64_4_hi,xl=ll.sum64_4_lo,El=ll.sum64_5_hi,Al=ll.sum64_5_lo,Rl=dl.BlockHash,kl=[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 _l(){if(!(this instanceof _l))return new _l;Rl.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=kl,this.W=new Array(160)}ll.inherits(_l,Rl);var Sl=_l;function Nl(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function Ml(e,t,r,n,o,i){var s=t&n^~t&i;return s<0&&(s+=4294967296),s}function Tl(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function Ol(e,t,r,n,o,i){var s=t&n^t&i^n&i;return s<0&&(s+=4294967296),s}function Il(e,t){var r=fl(e,t,28)^fl(t,e,2)^fl(t,e,7);return r<0&&(r+=4294967296),r}function Wl(e,t){var r=pl(e,t,28)^pl(t,e,2)^pl(t,e,7);return r<0&&(r+=4294967296),r}function Fl(e,t){var r=fl(e,t,14)^fl(e,t,18)^fl(t,e,9);return r<0&&(r+=4294967296),r}function Cl(e,t){var r=pl(e,t,14)^pl(e,t,18)^pl(t,e,9);return r<0&&(r+=4294967296),r}function jl(e,t){var r=fl(e,t,1)^fl(e,t,8)^ml(e,t,7);return r<0&&(r+=4294967296),r}function Ul(e,t){var r=pl(e,t,1)^pl(e,t,8)^gl(e,t,7);return r<0&&(r+=4294967296),r}function Dl(e,t){var r=fl(e,t,19)^fl(t,e,29)^ml(e,t,6);return r<0&&(r+=4294967296),r}function Bl(e,t){var r=pl(e,t,19)^pl(t,e,29)^gl(e,t,6);return r<0&&(r+=4294967296),r}_l.blockSize=1024,_l.outSize=512,_l.hmacStrength=192,_l.padLength=128,_l.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=Dl(r[n-4],r[n-3]),i=Bl(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=jl(r[n-30],r[n-29]),u=Ul(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=wl(o,i,s,a,c,u,l,d),r[n+1]=xl(o,i,s,a,c,u,l,d)}},_l.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],i=this.h[2],s=this.h[3],a=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],d=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],y=this.h[14],b=this.h[15];hl(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=y,x=b,E=Fl(d,h),A=Cl(d,h),R=Nl(d,h,f,p,m),k=Ml(d,h,f,p,m,g),_=this.k[v],S=this.k[v+1],N=r[v],M=r[v+1],T=El(w,x,E,A,R,k,_,S,N,M),O=Al(w,x,E,A,R,k,_,S,N,M);w=Il(n,o),x=Wl(n,o),E=Tl(n,o,i,s,a),A=Ol(n,o,i,s,a,c);var I=bl(w,x,E,A),W=vl(w,x,E,A);y=m,b=g,m=f,g=p,f=d,p=h,d=bl(u,l,T,O),h=vl(l,l,T,O),u=a,l=c,a=i,c=s,i=n,s=o,n=bl(T,O,I,W),o=vl(T,O,I,W)}yl(this.h,0,n,o),yl(this.h,2,i,s),yl(this.h,4,a,c),yl(this.h,6,u,l),yl(this.h,8,d,h),yl(this.h,10,f,p),yl(this.h,12,m,g),yl(this.h,14,y,b)},_l.prototype._digest=function(e){return"hex"===e?ll.toHex32(this.h,"big"):ll.split32(this.h,"big")};var Vl=lu,Pl=Sl;function Zl(){if(!(this instanceof Zl))return new Zl;Pl.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Vl.inherits(Zl,Pl);var zl=Zl;Zl.blockSize=1024,Zl.outSize=384,Zl.hmacStrength=192,Zl.padLength=128,Zl.prototype._digest=function(e){return"hex"===e?Vl.toHex32(this.h.slice(0,12),"big"):Vl.split32(this.h.slice(0,12),"big")},_u.sha1=Zu,_u.sha224=ul,_u.sha256=il,_u.sha384=zl,_u.sha512=Sl;var Ll={},Hl=lu,Yl=Eu,Xl=Hl.rotl32,Jl=Hl.sum32,Gl=Hl.sum32_3,ql=Hl.sum32_4,Kl=Yl.BlockHash;function Ql(){if(!(this instanceof Ql))return new Ql;Kl.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function $l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function ed(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function td(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Hl.inherits(Ql,Kl),Ll.ripemd160=Ql,Ql.blockSize=512,Ql.outSize=160,Ql.hmacStrength=192,Ql.padLength=64,Ql.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],i=this.h[3],s=this.h[4],a=r,c=n,u=o,l=i,d=s,h=0;h<80;h++){var f=Jl(Xl(ql(r,$l(h,n,o,i),e[rd[h]+t],ed(h)),od[h]),s);r=s,s=i,i=Xl(o,10),o=n,n=f,f=Jl(Xl(ql(a,$l(79-h,c,u,l),e[nd[h]+t],td(h)),id[h]),d),a=d,d=l,l=Xl(u,10),u=c,c=f}f=Gl(this.h[1],o,l),this.h[1]=Gl(this.h[2],i,d),this.h[2]=Gl(this.h[3],s,a),this.h[3]=Gl(this.h[4],r,c),this.h[4]=Gl(this.h[0],n,u),this.h[0]=f},Ql.prototype._digest=function(e){return"hex"===e?Hl.toHex32(this.h,"little"):Hl.split32(this.h,"little")};var rd=[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],nd=[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],od=[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],id=[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],sd=lu,ad=du;function cd(e,t,r){if(!(this instanceof cd))return new cd(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(sd.toArray(t,r))}var ud=cd;cd.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),ad(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},cd.prototype.update=function(e,t){return this.inner.update(e,t),this},cd.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=uu;t.utils=lu,t.common=Eu,t.sha=_u,t.ripemd=Ll,t.hmac=ud,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var ld=uu;function dd(e){return"0x"+ld.sha256().update(Ni(e)).digest("hex")}new xi("sha2/5.7.0");var hd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};function fd(e,t){return hd(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:Ni(new Uint8Array(o))}}))}var pd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const md=new xi("web/5.7.1");function gd(e){return new Promise((t=>{setTimeout(t,e)}))}function yd(e,t){if(null==e)return null;if("string"==typeof e)return e;if(ki(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ua(e)}catch(e){}return Ii(e)}return e}function bd(e,t,r){let n=null;if(null!=t){n=ja(t);const r="string"==typeof e?{url:e}:Bs(e);if(r.headers){const e=0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(r.headers=Bs(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return function(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;md.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"==typeof e?e.throttleCallback:null,i="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;md.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const s="object"==typeof e&&!!e.errorPassThrough,a={};let c=null;const u={method:"GET"};let l=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||md.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)a[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&md.throwError("basic authentication requires a secure https url",xi.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+Ya(ja(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=Bs(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=c?c.match(h):null;if(f)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]||"text/plain"},body:f[2]?Ha(f[3]):(p=f[3],ja(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){md.throwError("processing response error",xi.errors.SERVER_ERROR,{body:yd(f[1],f[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(a).forEach((e=>{const t=a[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(md.makeError("timeout",xi.errors.TIMEOUT,{requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return pd(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield fd(c,u),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===u.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(o&&(r=yield o(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):i*parseInt(String(Math.random()*Math.pow(2,e))),yield gd(r);continue}}}catch(e){t=e.response,null==t&&(g.cancel(),md.throwError("missing response",xi.errors.SERVER_ERROR,{requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,serverError:e,url:c}))}let a=t.body;if(l&&304===t.statusCode?a=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(g.cancel(),md.throwError("bad response",xi.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:yd(a,t.headers?t.headers["content-type"]:null),requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(a,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(o&&(t=yield o(e,c)),t){const t=i*parseInt(String(Math.random()*Math.pow(2,e)));yield gd(t);continue}}g.cancel(),md.throwError("processing response error",xi.errors.SERVER_ERROR,{body:yd(a,t.headers?t.headers["content-type"]:null),error:r,requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,url:c})}return g.cancel(),a}return md.throwError("failed response",xi.errors.SERVER_ERROR,{requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,url:c})}))}();return Promise.race([g.promise,y])}(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Ua(e))}catch(t){md.throwError("invalid JSON",xi.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function vd(e,t){return t||(t={}),null==(t=Bs(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,i=!1;const s=()=>!i&&(i=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function o(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!i){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){s()&&n(e)}))}()}))}for(var wd="qpzry9x8gf2tvdw0s3jn54khce6mua7l",xd={},Ed=0;Ed<wd.length;Ed++){var Ad=wd.charAt(Ed);if(void 0!==xd[Ad])throw new TypeError(Ad+" is ambiguous");xd[Ad]=Ed}function Rd(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function kd(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=Rd(t)^n>>5}for(t=Rd(t),r=0;r<e.length;++r){var o=e.charCodeAt(r);t=Rd(t)^31&o}return t}function _d(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var i=e.slice(0,o),s=e.slice(o+1);if(s.length<6)return"Data too short";var a=kd(i);if("string"==typeof a)return a;for(var c=[],u=0;u<s.length;++u){var l=s.charAt(u),d=xd[l];if(void 0===d)return"Unknown character "+l;a=Rd(a)^d,u+6>=s.length||c.push(d)}return 1!==a?"Invalid checksum for "+e:{prefix:i,words:c}}function Sd(e,t,r,n){for(var o=0,i=0,s=(1<<r)-1,a=[],c=0;c<e.length;++c)for(o=o<<t|e[c],i+=t;i>=r;)i-=r,a.push(o>>i&s);if(n)i>0&&a.push(o<<r-i&s);else{if(i>=t)return"Excess padding";if(o<<r-i&s)return"Non-zero padding"}return a}var Nd={decodeUnsafe:function(){var e=_d.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=_d.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=kd(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var o=e+"1",i=0;i<t.length;++i){var s=t[i];if(s>>5!=0)throw new Error("Non 5-bit word");n=Rd(n)^s,o+=wd.charAt(s)}for(i=0;i<6;++i)n=Rd(n);for(n^=1,i=0;i<6;++i){o+=wd.charAt(n>>5*(5-i)&31)}return o},toWordsUnsafe:function(e){var t=Sd(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Sd(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Sd(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Sd(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const Md="providers/5.7.2";var Td={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,n,o){for(var i=0,s=0,a=Math.min(e.length,n),c=t;c<a;c++){var u=e.charCodeAt(c)-48;i*=o,s=u>=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s<o,"Invalid character"),i+=s}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,s=i%n,a=Math.min(i,i-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){u(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],s=o*i,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,h=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=h;f++){var p=u-f|0;l+=(s=(o=0|e.words[p])*(i=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<o|i)).toString(16);i=a>>>24-o&16777215,(o+=2)>=26&&(o-=26,s--),n=0!==i||s!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],l=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);n=(p=p.idivn(l)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},i&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,o),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===i?(r<e.length&&(e[r++]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===i?(r>=0&&(e[r--]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,o,i,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,h=l>>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,E=0|s[4],A=8191&E,R=E>>>13,k=0|s[5],_=8191&k,S=k>>>13,N=0|s[6],M=8191&N,T=N>>>13,O=0|s[7],I=8191&O,W=O>>>13,F=0|s[8],C=8191&F,j=F>>>13,U=0|s[9],D=8191&U,B=U>>>13,V=0|a[0],P=8191&V,Z=V>>>13,z=0|a[1],L=8191&z,H=z>>>13,Y=0|a[2],X=8191&Y,J=Y>>>13,G=0|a[3],q=8191&G,K=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,oe=0|a[6],ie=8191&oe,se=oe>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,P))|0)+((8191&(o=(o=Math.imul(d,Z))+Math.imul(h,P)|0))<<13)|0;u=((i=Math.imul(h,Z))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,P),o=(o=Math.imul(p,Z))+Math.imul(m,P)|0,i=Math.imul(m,Z);var ye=(u+(n=n+Math.imul(d,L)|0)|0)+((8191&(o=(o=o+Math.imul(d,H)|0)+Math.imul(h,L)|0))<<13)|0;u=((i=i+Math.imul(h,H)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,P),o=(o=Math.imul(y,Z))+Math.imul(b,P)|0,i=Math.imul(b,Z),n=n+Math.imul(p,L)|0,o=(o=o+Math.imul(p,H)|0)+Math.imul(m,L)|0,i=i+Math.imul(m,H)|0;var be=(u+(n=n+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,J)|0)+Math.imul(h,X)|0))<<13)|0;u=((i=i+Math.imul(h,J)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,P),o=(o=Math.imul(w,Z))+Math.imul(x,P)|0,i=Math.imul(x,Z),n=n+Math.imul(y,L)|0,o=(o=o+Math.imul(y,H)|0)+Math.imul(b,L)|0,i=i+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,o=(o=o+Math.imul(p,J)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,J)|0;var ve=(u+(n=n+Math.imul(d,q)|0)|0)+((8191&(o=(o=o+Math.imul(d,K)|0)+Math.imul(h,q)|0))<<13)|0;u=((i=i+Math.imul(h,K)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,P),o=(o=Math.imul(A,Z))+Math.imul(R,P)|0,i=Math.imul(R,Z),n=n+Math.imul(w,L)|0,o=(o=o+Math.imul(w,H)|0)+Math.imul(x,L)|0,i=i+Math.imul(x,H)|0,n=n+Math.imul(y,X)|0,o=(o=o+Math.imul(y,J)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,q)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,K)|0;var we=(u+(n=n+Math.imul(d,$)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;u=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,P),o=(o=Math.imul(_,Z))+Math.imul(S,P)|0,i=Math.imul(S,Z),n=n+Math.imul(A,L)|0,o=(o=o+Math.imul(A,H)|0)+Math.imul(R,L)|0,i=i+Math.imul(R,H)|0,n=n+Math.imul(w,X)|0,o=(o=o+Math.imul(w,J)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(y,q)|0,o=(o=o+Math.imul(y,K)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0;var xe=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(o=(o=o+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;u=((i=i+Math.imul(h,ne)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,P),o=(o=Math.imul(M,Z))+Math.imul(T,P)|0,i=Math.imul(T,Z),n=n+Math.imul(_,L)|0,o=(o=o+Math.imul(_,H)|0)+Math.imul(S,L)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,J)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(y,$)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var Ee=(u+(n=n+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,se)|0)+Math.imul(h,ie)|0))<<13)|0;u=((i=i+Math.imul(h,se)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,P),o=(o=Math.imul(I,Z))+Math.imul(W,P)|0,i=Math.imul(W,Z),n=n+Math.imul(M,L)|0,o=(o=o+Math.imul(M,H)|0)+Math.imul(T,L)|0,i=i+Math.imul(T,H)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,J)|0)+Math.imul(S,X)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,q)|0,o=(o=o+Math.imul(A,K)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,o=(o=o+Math.imul(y,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,se)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,se)|0;var Ae=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(o=(o=o+Math.imul(d,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((i=i+Math.imul(h,ue)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,P),o=(o=Math.imul(C,Z))+Math.imul(j,P)|0,i=Math.imul(j,Z),n=n+Math.imul(I,L)|0,o=(o=o+Math.imul(I,H)|0)+Math.imul(W,L)|0,i=i+Math.imul(W,H)|0,n=n+Math.imul(M,X)|0,o=(o=o+Math.imul(M,J)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,J)|0,n=n+Math.imul(_,q)|0,o=(o=o+Math.imul(_,K)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(A,$)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,ue)|0;var Re=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;u=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,P),o=(o=Math.imul(D,Z))+Math.imul(B,P)|0,i=Math.imul(B,Z),n=n+Math.imul(C,L)|0,o=(o=o+Math.imul(C,H)|0)+Math.imul(j,L)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(I,X)|0,o=(o=o+Math.imul(I,J)|0)+Math.imul(W,X)|0,i=i+Math.imul(W,J)|0,n=n+Math.imul(M,q)|0,o=(o=o+Math.imul(M,K)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(_,$)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(y,ce)|0,o=(o=o+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0;var ke=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;u=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,L),o=(o=Math.imul(D,H))+Math.imul(B,L)|0,i=Math.imul(B,H),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,J)|0)+Math.imul(j,X)|0,i=i+Math.imul(j,J)|0,n=n+Math.imul(I,q)|0,o=(o=o+Math.imul(I,K)|0)+Math.imul(W,q)|0,i=i+Math.imul(W,K)|0,n=n+Math.imul(M,$)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(_,re)|0,o=(o=o+Math.imul(_,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(y,de)|0,o=(o=o+Math.imul(y,he)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,he)|0;var _e=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,X),o=(o=Math.imul(D,J))+Math.imul(B,X)|0,i=Math.imul(B,J),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(W,$)|0,i=i+Math.imul(W,ee)|0,n=n+Math.imul(M,re)|0,o=(o=o+Math.imul(M,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,se)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,se)|0,n=n+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,ue)|0,n=n+Math.imul(w,de)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,he)|0;var Se=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(o=(o=o+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),o=(o=Math.imul(D,K))+Math.imul(B,q)|0,i=Math.imul(B,K),n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(W,re)|0,i=i+Math.imul(W,ne)|0,n=n+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,se)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,se)|0,n=n+Math.imul(_,ce)|0,o=(o=o+Math.imul(_,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,he)|0)+Math.imul(R,de)|0,i=i+Math.imul(R,he)|0;var Ne=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,$),o=(o=Math.imul(D,ee))+Math.imul(B,$)|0,i=Math.imul(B,ee),n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,se)|0)+Math.imul(W,ie)|0,i=i+Math.imul(W,se)|0,n=n+Math.imul(M,ce)|0,o=(o=o+Math.imul(M,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,n=n+Math.imul(_,de)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,he)|0;var Me=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(R,pe)|0))<<13)|0;u=((i=i+Math.imul(R,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,re),o=(o=Math.imul(D,ne))+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,se)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,se)|0,n=n+Math.imul(I,ce)|0,o=(o=o+Math.imul(I,ue)|0)+Math.imul(W,ce)|0,i=i+Math.imul(W,ue)|0,n=n+Math.imul(M,de)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,he)|0;var Te=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((i=i+Math.imul(S,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,ie),o=(o=Math.imul(D,se))+Math.imul(B,ie)|0,i=Math.imul(B,se),n=n+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,n=n+Math.imul(I,de)|0,o=(o=o+Math.imul(I,he)|0)+Math.imul(W,de)|0,i=i+Math.imul(W,he)|0;var Oe=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((i=i+Math.imul(T,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,ce),o=(o=Math.imul(D,ue))+Math.imul(B,ce)|0,i=Math.imul(B,ue),n=n+Math.imul(C,de)|0,o=(o=o+Math.imul(C,he)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,he)|0;var Ie=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,me)|0)+Math.imul(W,pe)|0))<<13)|0;u=((i=i+Math.imul(W,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,de),o=(o=Math.imul(D,he))+Math.imul(B,de)|0,i=Math.imul(B,he);var We=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,me)|0)+Math.imul(j,pe)|0))<<13)|0;u=((i=i+Math.imul(j,me)|0)+(o>>>13)|0)+(We>>>26)|0,We&=67108863;var Fe=(u+(n=Math.imul(D,pe))|0)+((8191&(o=(o=Math.imul(D,me))+Math.imul(B,pe)|0))<<13)|0;return u=((i=Math.imul(B,me))+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ee,c[7]=Ae,c[8]=Re,c[9]=ke,c[10]=_e,c[11]=Se,c[12]=Ne,c[13]=Me,c[14]=Te,c[15]=Oe,c[16]=Ie,c[17]=We,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var s=o;o=0;for(var a=67108863&n,c=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=c;u++){var l=i-u,d=(0|e.words[l])*(0|t.words[u]),h=67108863&d;a=67108863&(h=h+a|0),o+=(s=(s=s+(d/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}r.words[i]=a,n=s,s=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,s=(67108863&i)+(67108863&n);n>>=26,n+=i/67108864|0,n+=s>>>26,this.words[o]=67108863&s}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=e.words[n]>>>o&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&i,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this._strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),a=67108863^67108863>>>i<<i,c=n;if(o-=s,o=Math.max(0,o),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=o);u--){var d=0|this.words[u];this.words[u]=l<<26-i|d>>>i,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,s=e.length+n;this._expand(s);var a=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+a;var c=(0|e.words[o])*t;a=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this._strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new R(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){R.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var s=0|e.words[o];e.words[o-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(x,v),n(E,v),n(A,v),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return b[e]=t,t},R.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},R.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},R.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},R.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=g}return h},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},n(k,R),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Td,W);var Od=Td.exports;function Id(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Wd=Fd;function Fd(e,t){if(!e)throw new Error(t||"Assertion failed")}Fd.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Cd=Id((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,s=255&o;i?r.push(i,s):r.push(s)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),jd=Id((function(e,t){var r=t;r.assert=Wd,r.toArray=Cd.toArray,r.zero2=Cd.zero2,r.toHex=Cd.toHex,r.encode=Cd.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),s=0;s<n.length;s++){var a,c=i.andln(o-1);i.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,i.isubn(a)):a=0,n[s]=a,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var s,a,c=e.andln(3)+o&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*o===s+1&&(o=1-o),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new Od(e,"hex","le")}})),Ud=jd.getNAF,Dd=jd.getJSF,Bd=jd.assert;function Vd(e,t){this.type=e,this.p=new Od(t.p,16),this.red=t.prime?Od.red(t.prime):Od.mont(this.p),this.zero=new Od(0).toRed(this.red),this.one=new Od(1).toRed(this.red),this.two=new Od(2).toRed(this.red),this.n=t.n&&new Od(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Pd=Vd;function Zd(e,t){this.curve=e,this.type=t,this.precomputed=null}Vd.prototype.point=function(){throw new Error("Not implemented")},Vd.prototype.validate=function(){throw new Error("Not implemented")},Vd.prototype._fixedNafMul=function(e,t){Bd(e.precomputed);var r=e._getDoubles(),n=Ud(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,s,a=[];for(i=0;i<n.length;i+=r.step){s=0;for(var c=i+r.step-1;c>=i;c--)s=(s<<1)+n[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=o;d>0;d--){for(i=0;i<a.length;i++)(s=a[i])===d?l=l.mixedAdd(r.points[i]):s===-d&&(l=l.mixedAdd(r.points[i].neg()));u=u.add(l)}return u.toP()},Vd.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=Ud(t,r,this._bitLength),s=this.jpoint(null,null,null),a=i.length-1;a>=0;a--){for(var c=0;a>=0&&0===i[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=i[a];Bd(0!==u),s="affine"===e.type?u>0?s.mixedAdd(o[u-1>>1]):s.mixedAdd(o[-u-1>>1].neg()):u>0?s.add(o[u-1>>1]):s.add(o[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},Vd.prototype._wnafMulAdd=function(e,t,r,n,o){var i,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(i=0;i<n;i++){var h=(a=t[i])._getNAFPoints(e);c[i]=h.wnd,u[i]=h.points}for(i=n-1;i>=1;i-=2){var f=i-1,p=i;if(1===c[f]&&1===c[p]){var m=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(m[1]=t[f].add(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].add(t[p].neg())):(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=Dd(r[f],r[p]);for(d=Math.max(y[0].length,d),l[f]=new Array(d),l[p]=new Array(d),s=0;s<d;s++){var b=0|y[0][s],v=0|y[1][s];l[f][s]=g[3*(b+1)+(v+1)],l[p][s]=0,u[f]=m}}else l[f]=Ud(r[f],c[f],this._bitLength),l[p]=Ud(r[p],c[p],this._bitLength),d=Math.max(l[f].length,d),d=Math.max(l[p].length,d)}var w=this.jpoint(null,null,null),x=this._wnafT4;for(i=d;i>=0;i--){for(var E=0;i>=0;){var A=!0;for(s=0;s<n;s++)x[s]=0|l[s][i],0!==x[s]&&(A=!1);if(!A)break;E++,i--}if(i>=0&&E++,w=w.dblp(E),i<0)break;for(s=0;s<n;s++){var R=x[s];0!==R&&(R>0?a=u[s][R-1>>1]:R<0&&(a=u[s][-R-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(i=0;i<n;i++)u[i]=null;return o?w:w.toP()},Vd.BasePoint=Zd,Zd.prototype.eq=function(){throw new Error("Not implemented")},Zd.prototype.validate=function(){return this.curve.validate(this)},Vd.prototype.decodePoint=function(e,t){e=jd.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Bd(e[e.length-1]%2==0):7===e[0]&&Bd(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},Zd.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Zd.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},Zd.prototype.encode=function(e,t){return jd.encode(this._encode(t),e)},Zd.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Zd.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},Zd.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},Zd.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},Zd.prototype._getBeta=function(){return null},Zd.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var zd=Id((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),Ld=jd.assert;function Hd(e){Pd.call(this,"short",e),this.a=new Od(e.a,16).toRed(this.red),this.b=new Od(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}zd(Hd,Pd);var Yd=Hd;function Xd(e,t,r,n){Pd.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Od(t,16),this.y=new Od(r,16),n&&(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 Jd(e,t,r,n){Pd.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Od(0)):(this.x=new Od(t,16),this.y=new Od(r,16),this.z=new Od(n,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}Hd.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new Od(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new Od(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],Ld(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new Od(e.a,16),b:new Od(e.b,16)}})):this._getEndoBasis(r)}}},Hd.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Od.mont(e),r=new Od(2).toRed(t).redInvm(),n=r.redNeg(),o=new Od(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},Hd.prototype._getEndoBasis=function(e){for(var t,r,n,o,i,s,a,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),f=new Od(1),p=new Od(0),m=new Od(0),g=new Od(1),y=0;0!==d.cmpn(0);){var b=h.div(d);c=h.sub(b.mul(d)),u=m.sub(b.mul(f));var v=g.sub(b.mul(p));if(!n&&c.cmp(l)<0)t=a.neg(),r=f,n=c.neg(),o=u;else if(n&&2==++y)break;a=c,h=d,d=c,m=f,f=u,g=p,p=v}i=c.neg(),s=u;var w=n.sqr().add(o.sqr());return i.sqr().add(s.sqr()).cmp(w)>=0&&(i=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),s=s.neg()),[{a:n,b:o},{a:i,b:s}]},Hd.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=o.mul(r.a),a=i.mul(n.a),c=o.mul(r.b),u=i.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},Hd.prototype.pointFromX=function(e,t){(e=new Od(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},Hd.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},Hd.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),a=e[i],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=a,n[2*i+1]=c,o[2*i]=s.k1,o[2*i+1]=s.k2}for(var u=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return u},zd(Xd,Pd.BasePoint),Hd.prototype.point=function(e,t,r){return new Xd(this,e,t,r)},Hd.prototype.pointFromJSON=function(e,t){return Xd.fromJSON(this,e,t)},Xd.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},Xd.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]},Xd.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},Xd.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)+">"},Xd.prototype.isInfinity=function(){return this.inf},Xd.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Xd.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},Xd.prototype.getX=function(){return this.x.fromRed()},Xd.prototype.getY=function(){return this.y.fromRed()},Xd.prototype.mul=function(e){return e=new Od(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Xd.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},Xd.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},Xd.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Xd.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Xd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},zd(Jd,Pd.BasePoint),Hd.prototype.jpoint=function(e,t,r){return new Jd(this,e,t,r)},Jd.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Jd.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Jd.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(o),c=i.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(d).redISub(d),f=c.redMul(d.redISub(h)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},Jd.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=o.redSub(i);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(d)).redISub(o.redMul(u)),f=this.z.redMul(s);return this.curve.jpoint(d,h,f)},Jd.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=i.redSqr(),d=u.redSqr(),h=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=i.redMul(d),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(h);var b=u.redMul(a);t+1<e&&(c=c.redMul(h)),i=m,a=b,u=y}return this.curve.jpoint(i,u.redMul(o),a)},Jd.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Jd.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(h);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Jd.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Jd.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),a=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=a.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,p)},Jd.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=o.redIAdd(s).redSqr().redISub(i).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,h,f)},Jd.prototype.mul=function(e,t){return e=new Od(e,t),this.curve._wnafMul(this,e)},Jd.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},Jd.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},Jd.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)+">"},Jd.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Gd=Id((function(e,t){var r=t;r.base=Pd,r.short=Yd,r.mont=null,r.edwards=null})),qd=Id((function(e,t){var r,n=t,o=jd.assert;function i(e){"short"===e.type?this.curve=new Gd.short(e):"edwards"===e.type?this.curve=new Gd.edwards(e):this.curve=new Gd.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,s("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:ld.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:ld.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:ld.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:ld.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"]}),s("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:ld.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ld.sha256,gRed:!1,g:["9"]}),s("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:ld.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("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:ld.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Kd(e){if(!(this instanceof Kd))return new Kd(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Cd.toArray(e.entropy,e.entropyEnc||"hex"),r=Cd.toArray(e.nonce,e.nonceEnc||"hex"),n=Cd.toArray(e.pers,e.persEnc||"hex");Wd(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Qd=Kd;Kd.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Kd.prototype._hmac=function(){return new ld.hmac(this.hash,this.K)},Kd.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Kd.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Cd.toArray(e,t),r=Cd.toArray(r,n),Wd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Kd.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Cd.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,e);return this._update(r),this._reseed++,Cd.encode(i,t)};var $d=jd.assert;function eh(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var th=eh;eh.fromPublic=function(e,t,r){return t instanceof eh?t:new eh(e,{pub:t,pubEnc:r})},eh.fromPrivate=function(e,t,r){return t instanceof eh?t:new eh(e,{priv:t,privEnc:r})},eh.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},eh.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},eh.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},eh.prototype._importPrivate=function(e,t){this.priv=new Od(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},eh.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?$d(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||$d(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},eh.prototype.derive=function(e){return e.validate()||$d(e.validate(),"public point not validated"),e.mul(this.priv).getX()},eh.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},eh.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},eh.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var rh=jd.assert;function nh(e,t){if(e instanceof nh)return e;this._importDER(e,t)||(rh(e.r&&e.s,"Signature without r or s"),this.r=new Od(e.r,16),this.s=new Od(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var oh=nh;function ih(){this.place=0}function sh(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,s=t.place;i<n;i++,s++)o<<=8,o|=e[s],o>>>=0;return!(o<=127)&&(t.place=s,o)}function ah(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function ch(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}nh.prototype._importDER=function(e,t){e=jd.toArray(e,t);var r=new ih;if(48!==e[r.place++])return!1;var n=sh(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=sh(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=sh(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new Od(i),this.s=new Od(a),this.recoveryParam=null,!0},nh.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=ah(t),r=ah(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];ch(n,t.length),(n=n.concat(t)).push(2),ch(n,r.length);var o=n.concat(r),i=[48];return ch(i,o.length),i=i.concat(o),jd.encode(i,e)};var uh=function(){throw new Error("unsupported")},lh=jd.assert;function dh(e){if(!(this instanceof dh))return new dh(e);"string"==typeof e&&(lh(Object.prototype.hasOwnProperty.call(qd,e),"Unknown curve "+e),e=qd[e]),e instanceof qd.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var hh=dh;dh.prototype.keyPair=function(e){return new th(this,e)},dh.prototype.keyFromPrivate=function(e,t){return th.fromPrivate(this,e,t)},dh.prototype.keyFromPublic=function(e,t){return th.fromPublic(this,e,t)},dh.prototype.genKeyPair=function(e){e||(e={});for(var t=new Qd({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||uh(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Od(2));;){var o=new Od(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},dh.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},dh.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Od(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),s=e.toArray("be",o),a=new Qd({hash:this.hash,entropy:i,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Od(1)),u=0;;u++){var l=n.k?n.k(u):new Od(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var h=d.getX(),f=h.umod(this.n);if(0!==f.cmpn(0)){var p=l.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new oh({r:f,s:p,recoveryParam:m})}}}}}},dh.prototype.verify=function(e,t,r,n){e=this._truncateToN(new Od(e,16)),r=this.keyFromPublic(r,n);var o=(t=new oh(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var s,a=i.invm(this.n),c=a.mul(e).umod(this.n),u=a.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},dh.prototype.recoverPubKey=function(e,t,r,n){lh((3&r)===r,"The recovery param is more than two bits"),t=new oh(t,n);var o=this.n,i=new Od(e),s=t.r,a=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var l=t.r.invm(o),d=o.sub(i).mul(l).umod(o),h=a.mul(l).umod(o);return this.g.mulAdd(d,s,h)},dh.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new oh(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var fh=Id((function(e,t){var r=t;r.version="6.5.4",r.utils=jd,r.rand=function(){throw new Error("unsupported")},r.curve=Gd,r.curves=qd,r.ec=hh,r.eddsa=null})).ec;const ph=new xi("signing-key/5.7.0");let mh=null;function gh(){return mh||(mh=new fh("secp256k1")),mh}class yh{constructor(e){js(this,"curve","secp256k1"),js(this,"privateKey",Ii(e)),32!==Wi(this.privateKey)&&ph.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=gh().keyFromPrivate(Ni(this.privateKey));js(this,"publicKey","0x"+t.getPublic(!1,"hex")),js(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),js(this,"_isSigningKey",!0)}_addPoint(e){const t=gh().keyFromPublic(Ni(this.publicKey)),r=gh().keyFromPublic(Ni(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=gh().keyFromPrivate(Ni(this.privateKey)),r=Ni(e);32!==r.length&&ph.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Di({recoveryParam:n.recoveryParam,r:Ui("0x"+n.r.toString(16),32),s:Ui("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=gh().keyFromPrivate(Ni(this.privateKey)),r=gh().keyFromPublic(Ni(bh(e)));return Ui("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function bh(e,t){const r=Ni(e);if(32===r.length){const e=new yh(r);return t?"0x"+gh().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?Ii(r):"0x"+gh().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+gh().keyFromPublic(r).getPublic(!0,"hex"):Ii(r):ph.throwArgumentError("invalid public or private key","key","[REDACTED]")}const vh=new xi("transactions/5.7.0");var wh;function xh(e){return"0x"===e?null:es(e)}function Eh(e){return"0x"===e?Ms:v.BigNumber.from(e)}function Ah(e,t){return function(e){return es(Fi(Pi(Fi(bh(e),1)),12))}(function(e,t){const r=Di(t),n={r:Ni(r.r),s:Ni(r.s)};return"0x"+gh().recoverPubKey(Ni(e),n,r.recoveryParam).encode("hex",!1)}(Ni(e),t))}function Rh(e,t){const r=Ti(v.BigNumber.from(e).toHexString());return r.length>32&&vh.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function kh(e,t){return{address:es(e),storageKeys:(t||[]).map(((t,r)=>(32!==Wi(t)&&vh.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function _h(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&vh.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),kh(e[0],e[1])):kh(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return kh(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Sh(e){return _h(e).map((e=>[e.address,e.storageKeys]))}function Nh(e,t){if(null!=e.gasPrice){const t=v.BigNumber.from(e.gasPrice),r=v.BigNumber.from(e.maxFeePerGas||0);t.eq(r)||vh.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Rh(e.chainId||0,"chainId"),Rh(e.nonce||0,"nonce"),Rh(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Rh(e.maxFeePerGas||0,"maxFeePerGas"),Rh(e.gasLimit||0,"gasLimit"),null!=e.to?es(e.to):"0x",Rh(e.value||0,"value"),e.data||"0x",Sh(e.accessList||[])];if(t){const e=Di(t);r.push(Rh(e.recoveryParam,"recoveryParam")),r.push(Ti(e.r)),r.push(Ti(e.s))}return Ci(["0x02",Yi(r)])}function Mh(e,t){const r=[Rh(e.chainId||0,"chainId"),Rh(e.nonce||0,"nonce"),Rh(e.gasPrice||0,"gasPrice"),Rh(e.gasLimit||0,"gasLimit"),null!=e.to?es(e.to):"0x",Rh(e.value||0,"value"),e.data||"0x",Sh(e.accessList||[])];if(t){const e=Di(t);r.push(Rh(e.recoveryParam,"recoveryParam")),r.push(Ti(e.r)),r.push(Ti(e.s))}return Ci(["0x01",Yi(r)])}function Th(e,t,r){try{const r=Eh(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){vh.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Ui(t[1],32),e.s=Ui(t[2],32);try{const t=Pi(r(e));e.from=Ah(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Oh(e){const t=Ni(e);if(t[0]>127)return function(e){const t=Gi(e);9!==t.length&&6!==t.length&&vh.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Eh(t[0]).toNumber(),gasPrice:Eh(t[1]),gasLimit:Eh(t[2]),to:xh(t[3]),value:Eh(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=v.BigNumber.from(t[6]).toNumber()}catch(e){return r}if(r.r=Ui(t[7],32),r.s=Ui(t[8],32),v.BigNumber.from(r.r).isZero()&&v.BigNumber.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push(Ii(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);const i=Pi(Yi(o));try{r.from=Ah(i,{r:Ii(r.r),s:Ii(r.s),recoveryParam:n})}catch(e){}r.hash=Pi(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Gi(e.slice(1));8!==t.length&&11!==t.length&&vh.throwArgumentError("invalid component count for transaction type: 1","payload",Ii(e));const r={type:1,chainId:Eh(t[0]).toNumber(),nonce:Eh(t[1]).toNumber(),gasPrice:Eh(t[2]),gasLimit:Eh(t[3]),to:xh(t[4]),value:Eh(t[5]),data:t[6],accessList:_h(t[7])};return 8===t.length||(r.hash=Pi(e),Th(r,t.slice(8),Mh)),r}(t);case 2:return function(e){const t=Gi(e.slice(1));9!==t.length&&12!==t.length&&vh.throwArgumentError("invalid component count for transaction type: 2","payload",Ii(e));const r=Eh(t[2]),n=Eh(t[3]),o={type:2,chainId:Eh(t[0]).toNumber(),nonce:Eh(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Eh(t[4]),to:xh(t[5]),value:Eh(t[6]),data:t[7],accessList:_h(t[8])};return 9===t.length||(o.hash=Pi(e),Th(o,t.slice(9),Nh)),o}(t)}return vh.throwError(`unsupported transaction type: ${t[0]}`,xi.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(wh||(wh={}));const Ih=new xi(Md);class Wh{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),i=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:i,type:c,accessList:Wh.allowNull(this.accessList.bind(this),null),blockHash:Wh.allowNull(i,null),blockNumber:Wh.allowNull(a,null),transactionIndex:Wh.allowNull(a,null),confirmations:Wh.allowNull(a,null),from:t,gasPrice:Wh.allowNull(r),maxPriorityFeePerGas:Wh.allowNull(r),maxFeePerGas:Wh.allowNull(r),gasLimit:r,to:Wh.allowNull(t,null),value:r,nonce:a,data:o,r:Wh.allowNull(this.uint256),s:Wh.allowNull(this.uint256),v:Wh.allowNull(a),creates:Wh.allowNull(t,null),raw:Wh.allowNull(o)},e.transactionRequest={from:Wh.allowNull(t),nonce:Wh.allowNull(a),gasLimit:Wh.allowNull(r),gasPrice:Wh.allowNull(r),maxPriorityFeePerGas:Wh.allowNull(r),maxFeePerGas:Wh.allowNull(r),to:Wh.allowNull(t),value:Wh.allowNull(r),data:Wh.allowNull((e=>this.data(e,!0))),type:Wh.allowNull(a),accessList:Wh.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:i,address:t,topics:Wh.arrayOf(i),data:o,logIndex:a,blockHash:i},e.receipt={to:Wh.allowNull(this.address,null),from:Wh.allowNull(this.address,null),contractAddress:Wh.allowNull(t,null),transactionIndex:a,root:Wh.allowNull(s),gasUsed:r,logsBloom:Wh.allowNull(o),blockHash:i,transactionHash:i,logs:Wh.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:Wh.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:Wh.allowNull(r),status:Wh.allowNull(a),type:c},e.block={hash:Wh.allowNull(i),parentHash:i,number:a,timestamp:a,nonce:Wh.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Wh.allowNull(t),extraData:o,transactions:Wh.allowNull(Wh.arrayOf(i)),baseFeePerGas:Wh.allowNull(r)},e.blockWithTransactions=Bs(e.block),e.blockWithTransactions.transactions=Wh.allowNull(Wh.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Wh.allowNull(n,void 0),toBlock:Wh.allowNull(n,void 0),blockHash:Wh.allowNull(i,void 0),address:Wh.allowNull(t,void 0),topics:Wh.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Wh.allowNull(a),blockHash:Wh.allowNull(i),transactionIndex:a,removed:Wh.allowNull(this.boolean.bind(this)),address:t,data:Wh.allowFalsish(o,"0x"),topics:Wh.arrayOf(i),transactionHash:i,logIndex:a},e}accessList(e){return _h(e||[])}number(e){return"0x"===e?0:v.BigNumber.from(e).toNumber()}type(e){return"0x"===e||null==e?0:v.BigNumber.from(e).toNumber()}bigNumber(e){return v.BigNumber.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Oi(e))?e.toLowerCase():Ih.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return es(e)}callAddress(e){if(!Oi(e,32))return null;const t=es(Fi(e,12));return t===Ss?null:t}contractAddress(e){return function(e){let t=null;try{t=es(e.from)}catch(t){qi.throwArgumentError("missing from address","transaction",e)}return es(Fi(Pi(Yi([t,Ti(Ni(v.BigNumber.from(e.nonce).toHexString()))])),12))}(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Oi(e))return ji(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==Wi(r)?Ih.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=v.BigNumber.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Oi(e))throw new Error("invalid uint256");return Ui(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Wh.check(t,e);return n._difficulty=null==r?null:v.BigNumber.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Wh.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&v.BigNumber.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Wh.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Oi(r)&&(r=v.BigNumber.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Oi(r)&&(r=v.BigNumber.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Oh(e)}receiptLog(e){return Wh.check(this.formats.receiptLog,e)}receipt(e){const t=Wh.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=v.BigNumber.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Ih.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Ih.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Ih.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Wh.check(this.formats.filter,e)}filterLog(e){return Wh.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const o=e[n](t[n]);void 0!==o&&(r[n]=o)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Fh=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Ch=new xi(Md);function jh(e){return null==e?"null":(32!==Wi(e)&&Ch.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Uh(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[jh(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return jh(e)})).join("&")}function Dh(e){if("string"==typeof e){if(32===Wi(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Uh(e);if(Qc.isForkEvent(e))throw Ch.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Uh(e.topics||[])}throw new Error("invalid event - "+e)}function Bh(){return(new Date).getTime()}function Vh(e){return new Promise((t=>{setTimeout(t,e)}))}const Ph=["block","network","pending","poll"];class Zh{constructor(e,t,r){js(this,"tag",e),js(this,"listener",t),js(this,"once",r),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 e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||Ph.indexOf(this.tag)>=0}}const zh={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 Lh(e){return Ui(v.BigNumber.from(e).toHexString(),32)}function Hh(e){return cu.encode(Mi([e,Fi(dd(dd(e)),0,4)]))}const Yh=new RegExp("^(ipfs)://(.*)$","i"),Xh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Yh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Jh(e,t){try{return Ua(Gh(e,t))}catch(e){}return null}function Gh(e,t){if("0x"===e)return null;const r=v.BigNumber.from(Fi(e,t,t+32)).toNumber(),n=v.BigNumber.from(Fi(e,r,r+32)).toNumber();return Fi(e,r+32,r+32+n)}function qh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Ch.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Kh(e){const t=Ni(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Qh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function $h(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const o=Ni(e[n]);t[n]=Kh(r),t.push(Kh(o.length)),t.push(Qh(o)),r+=32+32*Math.ceil(o.length/32)}return Ci(t)}class ef{constructor(e,t,r,n){js(this,"provider",e),js(this,"name",r),js(this,"address",e.formatter.address(t)),js(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>v.BigNumber.from(e).eq(1))).catch((e=>{if(e.code===xi.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Fh(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:Ci([e,gc(this.name),t||"0x"])};let n=!1;var o;(yield this.supportsWildcard())&&(n=!0,r.data=Ci(["0x9061b923",$h([(o=this.name,Ii(Mi(mc(o).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]));try{let e=yield this.provider.call(r);return Ni(e).length%32==4&&Ch.throwError("resolver threw error",xi.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Gh(e,0)),e}catch(e){if(e.code===xi.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Fh(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Gh(r,0):null}))}_getAddress(e,t){const r=zh[String(e)];if(null==r&&Ch.throwError(`unsupported coin type: ${e}`,xi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Ni(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Hh(Mi([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Hh(Mi([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Nd.toWords(n.slice(2));return e.unshift(t),Nd.encode(r.prefix,e)}}return null}getAddress(e){return Fh(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===xi.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Lh(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Ch.throwError("invalid or unsupported coin data",xi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Fh(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<Xh.length;r++){const n=t.match(Xh[r]);if(null==n)continue;const o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:qh(t)};case"erc721":case"erc1155":{const r="erc721"===o?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const i=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=Ui(v.BigNumber.from(s[1]).toHexString(),32);if("erc721"===o){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:Ci(["0x6352211e",c])}));if(i!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===o){const t=v.BigNumber.from(yield this.provider.call({to:a,data:Ci(["0x00fdd58e",Ui(i,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(s[0]),data:Ci([r,c])};let l=Jh(yield this.provider.call(u),0);if(null==l)return null;e.push({type:"metadata-url-base",content:l}),"erc1155"===o&&(l=l.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=qh(l)),e.push({type:"metadata-url",content:l});const d=yield bd(l);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let h=d.image;if("string"!=typeof h)return null;if(h.match(/^(https:\/\/|data:)/i));else{if(null==h.match(Yh))return null;e.push({type:"url-ipfs",content:h}),h=qh(h)}return e.push({type:"url",content:h}),{linkage:e,url:h}}}}}catch(e){}return null}))}getContentHash(){return Fh(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+cu.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+cu.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&68===o[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+Ya("0x"+o[1]).replace(/[=+\/]/g,(t=>e[t]))}return Ch.throwError("invalid or unsupported content hash data",xi.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Fh(this,void 0,void 0,(function*(){let t=ja(e);t=Mi([Lh(64),Lh(t.length),t]),t.length%32!=0&&(t=Mi([t,Ui("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Ii(t));return null==r||"0x"===r?null:Ua(r)}))}}let tf=null,rf=1;class nf extends $c{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),js(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=Us(new.target,"getNetwork")(e);t?(js(this,"_network",t),this.emit("network",t,null)):Ch.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Fh(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Ch.throwError("no network detected",xi.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:js(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return vd((()=>this._ready().then((e=>e),(e=>{if(e.code!==xi.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==tf&&(tf=new Wh),tf}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in su){const r=su[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=su[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=su[e.name];if(!t)return"number"!=typeof e.chainId&&eu.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&eu.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Fh(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),i=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",o),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),c=yield bd({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Ch.throwError(`response not found during CCIP fetch: ${u}`,xi.errors.SERVER_ERROR,{url:t,errorMessage:u});i.push(u)}return Ch.throwError(`error encountered during CCIP fetch: ${i.map((e=>JSON.stringify(e))).join(", ")}`,xi.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(e){return Fh(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Bh()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Bh(),r=Ds({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=Bh();return(e=v.BigNumber.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:o}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Fh(this,void 0,void 0,(function*(){const e=rf++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Ch.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Ch.makeError("network block skew detected",xi.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Fh(this,void 0,void 0,(function*(){return Ch.throwError("provider does not support network detection",xi.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Fh(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield Vh(0),this._network;const r=Ch.makeError("underlying network changed",xi.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!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))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Bh();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=Bh(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Fh(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Fh(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,i)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},u=e=>{e.confirmations<t||c()||o(e)};if(this.on(e,u),s.push((()=>{this.removeListener(e,u)})),n){let r=n.startBlock,o=null;const u=s=>Fh(this,void 0,void 0,(function*(){a||(yield Vh(1e3),this.getTransactionCount(n.from).then((l=>Fh(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o<n.startBlock&&(o=n.startBlock));o<=s;){if(a)return;const r=yield this.getBlockWithTransactions(o);for(let o=0;o<r.transactions.length;o++){const s=r.transactions[o];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(c())return;let o="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?o="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(o="cancelled"),void i(Ch.makeError("transaction was replaced",xi.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===o||"cancelled"===o,reason:o,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}o++}}a||this.once("block",u)}}))),(e=>{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||i(Ch.makeError("timeout exceeded",xi.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Fh(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return v.BigNumber.from(e)}catch(t){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return v.BigNumber.from(n)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return v.BigNumber.from(n).toNumber()}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return Ii(n)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>ji(e)))}),o=yield this.perform("getStorageAt",n);try{return Ii(o)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==Wi(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Ch.throwError("Transaction hash mismatch from Provider.sendTransaction.",xi.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Fh(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const i=yield this._waitForTransaction(e.hash,t,n,o);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&Ch.throwError("transaction failed",xi.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),n}sendTransaction(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Ii(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Fh(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?v.BigNumber.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Ii(e):null)))})),this.formatter.transactionRequest(yield Ds(r))}))}_getFilter(e){return Fh(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield Ds(t))}))}_call(e,t,r){return Fh(this,void 0,void 0,(function*(){r>=10&&Ch.throwError("CCIP read exceeded maximum redirections",xi.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&Wi(o)%32==4)try{const i=Fi(o,4),s=Fi(i,0,32);v.BigNumber.from(s).eq(n)||Ch.throwError("CCIP Read sender did not match",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const a=[],c=v.BigNumber.from(Fi(i,32,64)).toNumber(),u=v.BigNumber.from(Fi(i,c,c+32)).toNumber(),l=Fi(i,c+32);for(let t=0;t<u;t++){const r=Jh(l,32*t);null==r&&Ch.throwError("CCIP Read contained corrupt URL string",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),a.push(r)}const d=Gh(i,64);v.BigNumber.from(Fi(i,100,128)).isZero()||Ch.throwError("CCIP Read callback selector included junk",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const h=Fi(i,96,100),f=Gh(i,128),p=yield this.ccipReadFetch(e,d,a);null==p&&Ch.throwError("CCIP Read disabled or provided no URLs",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const m={to:n,data:Ci([h,$h([p,f])])};return this._call(m,t,r+1)}catch(e){if(e.code===xi.errors.SERVER_ERROR)throw e}try{return Ii(o)}catch(r){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:r})}}))}call(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Ds({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return v.BigNumber.from(r)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return Fh(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&Ch.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&Ch.throwError("ENS name not configured",xi.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(Oi(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),Oi(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){Ch.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return vd((()=>Fh(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return vd((()=>Fh(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return vd((()=>Fh(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Ds({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Wh.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Fh(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Fh(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Ch.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Fh(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new ef(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Fh(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Ch.throwError("network does not support ENS",xi.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+gc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Fh(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Oi(e))throw t}"string"!=typeof e&&Ch.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Fh(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=Jh(yield this.call({to:r,data:"0x691f3431"+gc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Fh(this,void 0,void 0,(function*(){let t=null;if(Oi(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new ef(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==xi.errors.CALL_EXCEPTION)throw e}try{const e=Jh(yield this.call({to:n,data:"0x691f3431"+gc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==xi.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Ch.throwError(e+" not implemented",xi.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new Zh(Dh(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],o=Dh(e);return this._events=this._events.filter((e=>e.tag!==o||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Dh(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Dh(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=Dh(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Dh(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var of=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const sf=new xi("abstract-signer/5.7.0"),af=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],cf=[xi.errors.INSUFFICIENT_FUNDS,xi.errors.NONCE_EXPIRED,xi.errors.REPLACEMENT_UNDERPRICED];class uf{constructor(){sf.checkAbstract(new.target,uf),js(this,"_isSigner",!0)}getBalance(e){return of(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return of(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return of(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield Ds(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return of(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield Ds(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return of(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return of(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return of(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return of(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return of(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===af.indexOf(t)&&sf.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=Bs(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&sf.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return of(this,void 0,void 0,(function*(){const t=yield Ds(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>of(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&sf.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||sf.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):sf.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&sf.throwError("network does not support EIP-1559",xi.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):sf.throwError("failed to get consistent fee data",xi.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(cf.indexOf(e.code)>=0)throw e;return sf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xi.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&sf.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield Ds(t)}))}_checkProvider(e){this.provider||sf.throwError("missing provider",xi.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}var lf=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const df=new xi(Md),hf=["call","estimateGas"];function ff(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Oi(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=ff(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return ff(JSON.parse(e),t)}catch(e){}return null}function pf(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=ff(t,!0);if(e)return e.data;df.throwError("missing revert data in call exception; Transaction reverted without a reason string",xi.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=ff(t.body,!1);null==r&&(r=ff(t,!1)),r&&df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xi.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===xi.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&df.throwError("insufficient funds for intrinsic transaction cost",xi.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&df.throwError("nonce has already been used",xi.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&df.throwError("replacement fee too low",xi.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&df.throwError("legacy pre-eip-155 transactions not supported",xi.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),hf.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xi.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function mf(e){return new Promise((function(t){setTimeout(t,e)}))}function gf(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function yf(e){return e?e.toLowerCase():e}const bf={};class vf extends uf{constructor(e,t,r){if(super(),e!==bf)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");js(this,"provider",t),null==r&&(r=0),"string"==typeof r?(js(this,"_address",this.provider.formatter.address(r)),js(this,"_index",null)):"number"==typeof r?(js(this,"_index",r),js(this,"_address",null)):df.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return df.throwError("cannot alter JSON-RPC Signer connection",xi.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new wf(bf,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&df.throwError("unknown account #"+this._index,xi.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=Bs(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=Bs(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>lf(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&df.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),Ds({tx:Ds(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&df.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&df.throwError("user rejected transaction",xi.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),pf("sendTransaction",e,n))))}))}signTransaction(e){return df.throwError("signing transactions is unsupported",xi.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return lf(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield vd((()=>lf(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return lf(this,void 0,void 0,(function*(){const t="string"==typeof e?ja(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ii(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&df.throwError("user rejected signing",xi.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return lf(this,void 0,void 0,(function*(){const t="string"==typeof e?ja(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),Ii(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&df.throwError("user rejected signing",xi.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return lf(this,void 0,void 0,(function*(){const n=yield Ic.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Ic.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&df.throwError("user rejected signing",xi.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return lf(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class wf extends vf{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const xf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ef extends nf{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=Us(this.constructor,"defaultUrl")()),js(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(Bs(e))),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 lf(this,void 0,void 0,(function*(){yield mf(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=Us(this.constructor,"getNetwork");try{return t(v.BigNumber.from(e).toNumber())}catch(t){return df.throwError("could not detect network",xi.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return df.throwError("could not detect network",xi.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new vf(bf,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:zs(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=bd(this.connection,JSON.stringify(r),gf).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[yf(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[yf(t.address),t.blockTag]];case"getCode":return["eth_getCode",[yf(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[yf(t.address),Ui(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Us(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Us(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=yf(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return lf(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&v.BigNumber.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=Bs(t)).transaction=Bs(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&df.throwError(e+" not implemented",xi.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return pf(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return mf(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=Bs(xf);if(t)for(const e in t)t[e]&&(r[e]=!0);var n,o;o=r,(n=e)&&"object"==typeof n||Cs.throwArgumentError("invalid object","object",n),Object.keys(n).forEach((e=>{o[e]||Cs.throwArgumentError("invalid object key - "+e,"transaction:"+e,n)}));const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=ji(v.BigNumber.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Ii(e[t]))})),e.accessList&&(i.accessList=_h(e.accessList)),i}}function Af(e){return Number.parseInt(e,16)}new xi(Md);class Rf extends y.Connector{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:Af(e)})})).on("disconnect",(e=>{var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.actions.resetState()})).on("chainChanged",(e=>{this.actions.update({chainId:Af(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return ls(this,void 0,void 0,(function*(){this.actions.startActivation();const e=this.customProvider;try{const[{chainId:t},r]=yield Promise.all([e.getNetwork(),e.listAccounts()]);this.actions.update({chainId:t,accounts:r})}catch(e){throw this.actions.resetState(),e}}))}}function kf([e,t]){return[e,t]}var _f;function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sf.apply(this,arguments)}var Nf,Mf;function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tf.apply(this,arguments)}var Of;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(Of||(Of={}));const If={[Of.METAMASK]:{name:"MetaMask",type:Of.METAMASK,icon:function(e){return S.createElement("svg",Sf({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),_f||(_f=S.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},S.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),S.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),S.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),S.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),S.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),S.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),S.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),S.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),S.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),S.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),S.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),S.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),S.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),S.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),S.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),S.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),S.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),S.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),S.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},S.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),S.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),S.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),S.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),S.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),S.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),S.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),S.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),S.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),S.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),S.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),S.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))))},link:"https://metamask.io"},[Of.WALLET_CONNECT]:{name:"WalletConnect",type:Of.WALLET_CONNECT,icon:function(e){return S.createElement("svg",Tf({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Nf||(Nf=S.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},S.createElement("stop",{offset:0,stopColor:"#5d9df6"}),S.createElement("stop",{offset:1,stopColor:"#006fff"}))),Mf||(Mf=S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("path",{d:"m256 0c141.384896 0 256 114.615104 256 256s-114.615104 256-256 256-256-114.615104-256-256 114.615104-256 256-256z",fill:"url(#a)"}),S.createElement("path",{d:"m64.6917558 37.7088298c51.5328072-50.2784397 135.0839942-50.2784397 186.6167992 0l6.202057 6.0510906c2.57664 2.5139218 2.57664 6.5897948 0 9.1037177l-21.215998 20.6995759c-1.288321 1.2569619-3.3771 1.2569619-4.665421 0l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544 0l-9.1400282 8.9175519c-1.2883217 1.2569609-3.3771016 1.2569609-4.6654208 0l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958 0-9.1037177zm230.4934852 42.8089117 18.882279 18.4227262c2.576627 2.5139103 2.576642 6.5897593.000032 9.1036863l-85.141498 83.070358c-2.576623 2.513941-6.754182 2.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271 0-.000004.000004-.000008.000007-.000012.000011l-60.4269683 58.957408c-2.5766141 2.513947-6.7541746 2.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795 0-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222 6.7541993-2.5139222 9.3308397 0l60.4291347 58.9582758c.6441608.62848 1.6885495.62848 2.3327103 0 .0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398 6.754142-2.5140743 9.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056 58.9583548c.644159.628479 1.688549.628479 2.332709 0l60.428079-58.9571925c2.57664-2.5139231 6.754199-2.5139231 9.330839 0z",fill:"#fff",fillRule:"nonzero",transform:"translate(98 160)"}))))}}},Wf={};function Ff({provider:e,jsonRpcUrlMap:t,defaultChainId:r}){const o=console.error,i=n.useMemo((()=>function(e,t){if(t){if(Ef.isProvider(t))return kf(l.initializeConnector((e=>new Rf(e,t))));if(Ef.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return kf(l.initializeConnector((r=>new p.EIP1193({actions:r,provider:t,onError:e}))))}}(o,e)),[o,e]),s=n.useMemo((()=>function(e){return kf(l.initializeConnector((t=>new g.MetaMask({actions:t,onError:e}))))}(o)),[o]),a=n.useMemo((()=>t?Object.assign(Object.assign({},os),t):os),[t]),c=n.useMemo((()=>function(e,t,r,n){return kf(l.initializeConnector((o=>new m.WalletConnect({actions:o,options:{rpc:t,qrcode:e},onError:n,defaultChainId:r}))))}(!0,a,r,o)),[a,r,o]);return i&&(Wf[Of.INTEGRATOR]=i),Wf[Of.METAMASK]=s,Wf[Of.WALLET_CONNECT]=c,Object.values(Wf)}function Cf(){const{chainId:e}=l.useWeb3React(),t=c.useSelector(As);return n.useMemo((()=>e||t||1),[e,t])}var jf={};function Uf(e){e&&(e.value=!0)}function Df(){}function Bf(e){return void 0===e.size&&(e.size=e.__iterate(Pf)),e.size}function Vf(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?Bf(e)+t:t}function Pf(){return!0}function Zf(e,t,r){return(0===e&&!Yf(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function zf(e,t){return Hf(e,t,0)}function Lf(e,t){return Hf(e,t,t)}function Hf(e,t,r){return void 0===e?r:Yf(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function Yf(e){return e<0||0===e&&1/e==-1/0}function Xf(e){return Boolean(e&&e["@@__IMMUTABLE_ITERABLE__@@"])}function Jf(e){return Boolean(e&&e["@@__IMMUTABLE_KEYED__@@"])}function Gf(e){return Boolean(e&&e["@@__IMMUTABLE_INDEXED__@@"])}function qf(e){return Jf(e)||Gf(e)}var Kf=function(e){return Xf(e)?e:yp(e)},Qf=function(e){function t(e){return Jf(e)?e:bp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Kf),$f=function(e){function t(e){return Gf(e)?e:vp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Kf),ep=function(e){function t(e){return Xf(e)&&!qf(e)?e:wp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Kf);Kf.Keyed=Qf,Kf.Indexed=$f,Kf.Set=ep;function tp(e){return Boolean(e&&e["@@__IMMUTABLE_SEQ__@@"])}function rp(e){return Boolean(e&&e["@@__IMMUTABLE_RECORD__@@"])}function np(e){return Xf(e)||rp(e)}var op="@@__IMMUTABLE_ORDERED__@@";function ip(e){return Boolean(e&&e[op])}var sp="function"==typeof Symbol&&Symbol.iterator,ap=sp||"@@iterator",cp=function(e){this.next=e};function up(e,t,r,n){var o=0===e?t:1===e?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function lp(){return{value:void 0,done:!0}}function dp(e){return!!Array.isArray(e)||!!pp(e)}function hp(e){return e&&"function"==typeof e.next}function fp(e){var t=pp(e);return t&&t.call(e)}function pp(e){var t=e&&(sp&&e[sp]||e["@@iterator"]);if("function"==typeof t)return t}cp.prototype.toString=function(){return"[Iterator]"},cp.KEYS=0,cp.VALUES=1,cp.ENTRIES=2,cp.prototype.inspect=cp.prototype.toSource=function(){return this.toString()},cp.prototype[ap]=function(){return this};var mp=Object.prototype.hasOwnProperty;function gp(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var yp=function(e){function t(e){return null==e?kp():np(e)?e.toSeq():function(e){var t=Np(e);if(t)return(n=pp(r=e))&&n===r.entries?t.fromEntrySeq():function(e){var t=pp(e);return t&&t===e.keys}(e)?t.toSetSeq():t;var r,n;if("object"==typeof e)return new Ep(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,o=0;o!==n;){var i=r[t?n-++o:o++];if(!1===e(i[1],i[0],this))break}return o}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,o=0;return new cp((function(){if(o===n)return{value:void 0,done:!0};var i=r[t?n-++o:o++];return up(e,i[0],i[1])}))}return this.__iteratorUncached(e,t)},t}(Kf),bp=function(e){function t(e){return null==e?kp().toKeyedSeq():Xf(e)?Jf(e)?e.toSeq():e.fromEntrySeq():rp(e)?e.toSeq():_p(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(yp),vp=function(e){function t(e){return null==e?kp():Xf(e)?Jf(e)?e.entrySeq():e.toIndexedSeq():rp(e)?e.toSeq().entrySeq():Sp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(yp),wp=function(e){function t(e){return(Xf(e)&&!qf(e)?e:vp(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(yp);yp.isSeq=tp,yp.Keyed=bp,yp.Set=wp,yp.Indexed=vp,yp.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var xp=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[Vf(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,o=0;o!==n;){var i=t?n-++o:o++;if(!1===e(r[i],i,this))break}return o},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,o=0;return new cp((function(){if(o===n)return{value:void 0,done:!0};var i=t?n-++o:o++;return up(e,i,r[i])}))},t}(vp),Ep=function(e){function t(e){var t=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return mp.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,o=n.length,i=0;i!==o;){var s=n[t?o-++i:i++];if(!1===e(r[s],s,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,o=n.length,i=0;return new cp((function(){if(i===o)return{value:void 0,done:!0};var s=n[t?o-++i:i++];return up(e,s,r[s])}))},t}(bp);Ep.prototype[op]=!0;var Ap,Rp=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=fp(this._collection),n=0;if(hp(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=fp(this._collection);if(!hp(r))return new cp(lp);var n=0;return new cp((function(){var t=r.next();return t.done?t:up(e,n++,t.value)}))},t}(vp);function kp(){return Ap||(Ap=new xp([]))}function _p(e){var t=Np(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new Ep(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Sp(e){var t=Np(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function Np(e){return gp(e)?new xp(e):dp(e)?new Rp(e):void 0}function Mp(e){return Boolean(e&&e["@@__IMMUTABLE_MAP__@@"])}function Tp(e){return Mp(e)&&ip(e)}function Op(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function Ip(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(Op(e)&&Op(t)&&e.equals(t))}var Wp="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function Fp(e){return e>>>1&1073741824|3221225471&e}var Cp=Object.prototype.valueOf;function jp(e){if(null==e)return Up(e);if("function"==typeof e.hashCode)return Fp(e.hashCode(e));var t,r=(t=e).valueOf!==Cp&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==r)return Up(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return Fp(t)}(r);case"string":return r.length>Xp?function(e){var t=qp[e];void 0===t&&(t=Dp(e),Gp===Jp&&(Gp=0,qp={}),Gp++,qp[e]=t);return t}(r):Dp(r);case"object":case"function":return function(e){var t;if(zp&&void 0!==(t=Zp.get(e)))return t;if(void 0!==(t=e[Yp]))return t;if(!Vp){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Yp]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=Pp(),zp)Zp.set(e,t);else{if(void 0!==Bp&&!1===Bp(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Vp)Object.defineProperty(e,Yp,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Yp]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Yp]=t}}return t}(r);case"symbol":return function(e){var t=Lp[e];if(void 0!==t)return t;return t=Pp(),Lp[e]=t,t}(r);default:if("function"==typeof r.toString)return Dp(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function Up(e){return null===e?1108378658:1108378659}function Dp(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Fp(t)}var Bp=Object.isExtensible,Vp=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function Pp(){var e=++Hp;return 1073741824&Hp&&(Hp=0),e}var Zp,zp="function"==typeof WeakMap;zp&&(Zp=new WeakMap);var Lp=Object.create(null),Hp=0,Yp="__immutablehash__";"function"==typeof Symbol&&(Yp=Symbol(Yp));var Xp=16,Jp=255,Gp=0,qp={},Kp=function(e){function t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this._iter.get(e,t)},t.prototype.has=function(e){return this._iter.has(e)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var e=this,t=nm(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},t.prototype.map=function(e,t){var r=this,n=rm(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t,n){return e(t,n,r)}),t)},t.prototype.__iterator=function(e,t){return this._iter.__iterator(e,t)},t}(bp);Kp.prototype[op]=!0;var Qp=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return t&&Bf(this),this._iter.__iterate((function(o){return e(o,t?r.size-++n:n++,r)}),t)},t.prototype.__iterator=function(e,t){var r=this,n=this._iter.__iterator(1,t),o=0;return t&&Bf(this),new cp((function(){var i=n.next();return i.done?i:up(e,t?r.size-++o:o++,i.value,i)}))},t}(vp),$p=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new cp((function(){var t=r.next();return t.done?t:up(e,t.value,t.value,t)}))},t}(wp),em=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){pm(t);var n=Xf(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new cp((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){pm(n);var o=Xf(n);return up(e,o?n.get(0):n[0],o?n.get(1):n[1],t)}}}))},t}(bp);function tm(e){var t=gm(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=ym,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new cp((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function rm(e,t,r){var n=gm(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,o){var i=e.get(n,jf);return i===jf?o:t.call(r,i,n,e)},n.__iterateUncached=function(n,o){var i=this;return e.__iterate((function(e,o,s){return!1!==n(t.call(r,e,o,s),o,i)}),o)},n.__iteratorUncached=function(n,o){var i=e.__iterator(2,o);return new cp((function(){var o=i.next();if(o.done)return o;var s=o.value,a=s[0];return up(n,a,t.call(r,s[1],a,e),o)}))},n}function nm(e,t){var r=this,n=gm(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=tm(e);return t.reverse=function(){return e.flip()},t}),n.get=function(r,n){return e.get(t?r:-1-r,n)},n.has=function(r){return e.has(t?r:-1-r)},n.includes=function(t){return e.includes(t)},n.cacheResult=ym,n.__iterate=function(r,n){var o=this,i=0;return n&&Bf(e),e.__iterate((function(e,s){return r(e,t?s:n?o.size-++i:i++,o)}),!n)},n.__iterator=function(n,o){var i=0;o&&Bf(e);var s=e.__iterator(2,!o);return new cp((function(){var e=s.next();if(e.done)return e;var a=e.value;return up(n,t?a[0]:o?r.size-++i:i++,a[1],e)}))},n}function om(e,t,r,n){var o=gm(e);return n&&(o.has=function(n){var o=e.get(n,jf);return o!==jf&&!!t.call(r,o,n,e)},o.get=function(n,o){var i=e.get(n,jf);return i!==jf&&t.call(r,i,n,e)?i:o}),o.__iterateUncached=function(o,i){var s=this,a=0;return e.__iterate((function(e,i,c){if(t.call(r,e,i,c))return a++,o(e,n?i:a-1,s)}),i),a},o.__iteratorUncached=function(o,i){var s=e.__iterator(2,i),a=0;return new cp((function(){for(;;){var i=s.next();if(i.done)return i;var c=i.value,u=c[0],l=c[1];if(t.call(r,l,u,e))return up(o,n?u:a++,l,i)}}))},o}function im(e,t,r,n){var o=e.size;if(Zf(t,r,o))return e;var i=zf(t,o),s=Lf(r,o);if(i!=i||s!=s)return im(e.toSeq().cacheResult(),t,r,n);var a,c=s-i;c==c&&(a=c<0?0:c);var u=gm(e);return u.size=0===a?a:e.size&&a||void 0,!n&&tp(e)&&a>=0&&(u.get=function(t,r){return(t=Vf(this,t))>=0&&t<a?e.get(t+i,r):r}),u.__iterateUncached=function(t,r){var o=this;if(0===a)return 0;if(r)return this.cacheResult().__iterate(t,r);var s=0,c=!0,u=0;return e.__iterate((function(e,r){if(!c||!(c=s++<i))return u++,!1!==t(e,n?r:u-1,o)&&u!==a})),u},u.__iteratorUncached=function(t,r){if(0!==a&&r)return this.cacheResult().__iterator(t,r);if(0===a)return new cp(lp);var o=e.__iterator(t,r),s=0,c=0;return new cp((function(){for(;s++<i;)o.next();if(++c>a)return{value:void 0,done:!0};var e=o.next();return n||1===t||e.done?e:up(t,c-1,0===t?void 0:e.value[1],e)}))},u}function sm(e,t,r,n){var o=gm(e);return o.__iterateUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterate(o,i);var a=!0,c=0;return e.__iterate((function(e,i,u){if(!a||!(a=t.call(r,e,i,u)))return c++,o(e,n?i:c-1,s)})),c},o.__iteratorUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(2,i),c=!0,u=0;return new cp((function(){var e,i,l;do{if((e=a.next()).done)return n||1===o?e:up(o,u++,0===o?void 0:e.value[1],e);var d=e.value;i=d[0],l=d[1],c&&(c=t.call(r,l,i,s))}while(c);return 2===o?e:up(o,i,l,e)}))},o}function am(e,t){var r=Jf(e),n=[e].concat(t).map((function(e){return Xf(e)?r&&(e=Qf(e)):e=r?_p(e):Sp(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var o=n[0];if(o===e||r&&Jf(o)||Gf(e)&&Gf(o))return o}var i=new xp(n);return r?i=i.toKeyedSeq():Gf(e)||(i=i.toSetSeq()),(i=i.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),i}function cm(e,t,r){var n=gm(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var s=0,a=!1;return function e(c,u){c.__iterate((function(i,c){return(!t||u<t)&&Xf(i)?e(i,u+1):(s++,!1===o(i,r?c:s-1,n)&&(a=!0)),!a}),i)}(e,0),s},n.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=e.__iterator(n,o),s=[],a=0;return new cp((function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(2===n&&(c=c[1]),t&&!(s.length<t)||!Xf(c))return r?e:up(n,a++,c,e);s.push(i),i=c.__iterator(n,o)}else i=s.pop()}return{value:void 0,done:!0}}))},n}function um(e,t,r){t||(t=bm);var n=Jf(e),o=0,i=e.toSeq().map((function(t,n){return[n,t,o++,r?r(t,n,e):t]})).valueSeq().toArray();return i.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),n?bp(i):Gf(e)?vp(i):wp(i)}function lm(e,t,r){if(t||(t=bm),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return dm(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return dm(t,e,r)?r:e}))}function dm(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function hm(e,t,r,n){var o=gm(e),i=new xp(r).map((function(e){return e.size}));return o.size=n?i.max():i.min(),o.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),o=0;!(r=n.next()).done&&!1!==e(r.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=Kf(e),fp(o?e.reverse():e)})),s=0,a=!1;return new cp((function(){var r;return a||(r=i.map((function(e){return e.next()})),a=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),a?{value:void 0,done:!0}:up(e,s++,t.apply(null,r.map((function(e){return e.value}))))}))},o}function fm(e,t){return e===t?e:tp(e)?t:e.constructor(t)}function pm(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function mm(e){return Jf(e)?Qf:Gf(e)?$f:ep}function gm(e){return Object.create((Jf(e)?bp:Gf(e)?vp:wp).prototype)}function ym(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):yp.prototype.cacheResult.call(this)}function bm(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e<t?-1:0}function vm(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function wm(e,t){if(!e)throw new Error(t)}function xm(e){wm(e!==1/0,"Cannot perform this action with an infinite size.")}function Em(e){if(gp(e)&&"string"!=typeof e)return e;if(ip(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}Qp.prototype.cacheResult=Kp.prototype.cacheResult=$p.prototype.cacheResult=em.prototype.cacheResult=ym;var Am=Object.prototype.toString;function Rm(e){return"object"==typeof e&&(np(e)||Array.isArray(e)||function(e){if(!e||"object"!=typeof e||"[object Object]"!==Am.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t,n=Object.getPrototypeOf(t);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===t}(e))}function km(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function _m(e,t,r){return np(e)?e.get(t,r):function(e,t){return np(e)?e.has(t):Rm(e)&&mp.call(e,t)}(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function Sm(e){if(Array.isArray(e))return vm(e);var t={};for(var r in e)mp.call(e,r)&&(t[r]=e[r]);return t}function Nm(e,t,r,n){n||(n=r,r=void 0);var o=Mm(np(e),e,Em(t),0,r,n);return o===jf?r:o}function Mm(e,t,r,n,o,i){var s=t===jf;if(n===r.length){var a=s?o:t,c=i(a);return c===a?t:c}if(!s&&!Rm(t))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(km)+"]: "+t);var u=r[n],l=s?jf:_m(t,u,jf),d=Mm(l===jf?e:np(l),l,r,n+1,o,i);return d===l?t:d===jf?function(e,t){if(!Rm(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(np(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!mp.call(e,t))return e;var r=Sm(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}(t,u):function(e,t,r){if(!Rm(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(np(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(mp.call(e,t)&&r===e[t])return e;var n=Sm(e);return n[t]=r,n}(s?e?sg():{}:t,u,d)}function Tm(e,t){return function(e,t,r){return Nm(e,t,jf,(function(){return r}))}(this,e,t)}function Om(e){return function(e,t){return Nm(e,t,(function(){return jf}))}(this,e)}function Im(e,t,r,n){return Nm(e,[t],r,n)}function Wm(e,t,r){return 1===arguments.length?e(this):Im(this,e,t,r)}function Fm(e,t,r){return Nm(this,e,t,r)}function Cm(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Um(this,e)}function jm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return Um(this,t,e)}function Um(e,t,r){for(var n=[],o=0;o<t.length;o++){var i=Qf(t[o]);0!==i.size&&n.push(i)}return 0===n.length?e:0!==e.toSeq().size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var t=r?function(t,n){Im(e,n,jf,(function(e){return e===jf?t:r(e,t,n)}))}:function(t,r){e.set(r,t)},o=0;o<n.length;o++)n[o].forEach(t)})):e.constructor(n[0])}function Dm(e,t,r){return Bm(e,t,function(e){function t(r,n,o){return Rm(r)&&Rm(n)&&(i=n,s=yp(r),a=yp(i),Gf(s)===Gf(a)&&Jf(s)===Jf(a))?Bm(r,[n],t):e?e(r,n,o):n;var i,s,a}return t}(r))}function Bm(e,t,r){if(!Rm(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(np(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),o=e,i=n?$f:Qf,s=n?function(t){o===e&&(o=Sm(o)),o.push(t)}:function(t,n){var i=mp.call(o,n),s=i&&r?r(o[n],t,n):t;i&&s===o[n]||(o===e&&(o=Sm(o)),o[n]=s)},a=0;a<t.length;a++)i(t[a]).forEach(s);return o}function Vm(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Dm(this,e)}function Pm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Dm(this,t,e)}function Zm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Nm(this,e,sg(),(function(e){return Bm(e,t)}))}function zm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Nm(this,e,sg(),(function(e){return Dm(e,t)}))}function Lm(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Hm(){return this.__ownerID?this:this.__ensureOwner(new Df)}function Ym(){return this.__ensureOwner()}function Xm(){return this.__altered}var Jm=function(e){function t(t){return null==t?sg():Mp(t)&&!ip(t)?t:sg().withMutations((function(r){var n=e(t);xm(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return sg().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return ag(this,e,t)},t.prototype.remove=function(e){return ag(this,e,jf)},t.prototype.deleteAll=function(e){var t=Kf(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):sg()},t.prototype.sort=function(e){return Og(um(this,e))},t.prototype.sortBy=function(e,t){return Og(um(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(o,i){n.set(i,e.call(t,o,i,r))}))}))},t.prototype.__iterator=function(e,t){return new rg(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ig(this.size,this._root,e,this.__hash):0===this.size?sg():(this.__ownerID=e,this.__altered=!1,this)},t}(Qf);Jm.isMap=Mp;var Gm=Jm.prototype;Gm["@@__IMMUTABLE_MAP__@@"]=!0,Gm.delete=Gm.remove,Gm.removeAll=Gm.deleteAll,Gm.setIn=Tm,Gm.removeIn=Gm.deleteIn=Om,Gm.update=Wm,Gm.updateIn=Fm,Gm.merge=Gm.concat=Cm,Gm.mergeWith=jm,Gm.mergeDeep=Vm,Gm.mergeDeepWith=Pm,Gm.mergeIn=Zm,Gm.mergeDeepIn=zm,Gm.withMutations=Lm,Gm.wasAltered=Xm,Gm.asImmutable=Ym,Gm["@@transducer/init"]=Gm.asMutable=Hm,Gm["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Gm["@@transducer/result"]=function(e){return e.asImmutable()};var qm=function(e,t){this.ownerID=e,this.entries=t};qm.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(Ip(r,o[i][0]))return o[i][1];return n},qm.prototype.update=function(e,t,r,n,o,i,s){for(var a=o===jf,c=this.entries,u=0,l=c.length;u<l&&!Ip(n,c[u][0]);u++);var d=u<l;if(d?c[u][1]===o:a)return this;if(Uf(s),(a||!d)&&Uf(i),!a||1!==c.length){if(!d&&!a&&c.length>=fg)return function(e,t,r,n){e||(e=new Df);for(var o=new eg(e,jp(r),[r,n]),i=0;i<t.length;i++){var s=t[i];o=o.update(e,0,void 0,s[0],s[1])}return o}(e,c,n,o);var h=e&&e===this.ownerID,f=h?c:vm(c);return d?a?u===l-1?f.pop():f[u]=f.pop():f[u]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new qm(e,f)}};var Km=function(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r};Km.prototype.get=function(e,t,r,n){void 0===t&&(t=jp(r));var o=1<<(31&(0===e?t:t>>>e)),i=this.bitmap;return 0==(i&o)?n:this.nodes[dg(i&o-1)].get(e+5,t,r,n)},Km.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=jp(n));var a=31&(0===t?r:r>>>t),c=1<<a,u=this.bitmap,l=0!=(u&c);if(!l&&o===jf)return this;var d=dg(u&c-1),h=this.nodes,f=l?h[d]:void 0,p=cg(f,e,t+5,r,n,o,i,s);if(p===f)return this;if(!l&&p&&h.length>=pg)return function(e,t,r,n,o){for(var i=0,s=new Array(32),a=0;0!==r;a++,r>>>=1)s[a]=1&r?t[i++]:void 0;return s[n]=o,new Qm(e,i+1,s)}(e,h,u,a,p);if(l&&!p&&2===h.length&&ug(h[1^d]))return h[1^d];if(l&&p&&1===h.length&&ug(p))return p;var m=e&&e===this.ownerID,g=l?p?u:u^c:u|c,y=l?p?hg(h,d,p,m):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,s=0;s<n;s++)s===t&&(i=1),o[s]=e[s+i];return o}(h,d,m):function(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),s=0,a=0;a<o;a++)a===t?(i[a]=r,s=-1):i[a]=e[a+s];return i}(h,d,p,m);return m?(this.bitmap=g,this.nodes=y,this):new Km(e,g,y)};var Qm=function(e,t,r){this.ownerID=e,this.count=t,this.nodes=r};Qm.prototype.get=function(e,t,r,n){void 0===t&&(t=jp(r));var o=31&(0===e?t:t>>>e),i=this.nodes[o];return i?i.get(e+5,t,r,n):n},Qm.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=jp(n));var a=31&(0===t?r:r>>>t),c=o===jf,u=this.nodes,l=u[a];if(c&&!l)return this;var d=cg(l,e,t+5,r,n,o,i,s);if(d===l)return this;var h=this.count;if(l){if(!d&&--h<mg)return function(e,t,r,n){for(var o=0,i=0,s=new Array(r),a=0,c=1,u=t.length;a<u;a++,c<<=1){var l=t[a];void 0!==l&&a!==n&&(o|=c,s[i++]=l)}return new Km(e,o,s)}(e,u,h,a)}else h++;var f=e&&e===this.ownerID,p=hg(u,a,d,f);return f?(this.count=h,this.nodes=p,this):new Qm(e,h,p)};var $m=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r};$m.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(Ip(r,o[i][0]))return o[i][1];return n},$m.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=jp(n));var a=o===jf;if(r!==this.keyHash)return a?this:(Uf(s),Uf(i),lg(this,e,t,r,[n,o]));for(var c=this.entries,u=0,l=c.length;u<l&&!Ip(n,c[u][0]);u++);var d=u<l;if(d?c[u][1]===o:a)return this;if(Uf(s),(a||!d)&&Uf(i),a&&2===l)return new eg(e,this.keyHash,c[1^u]);var h=e&&e===this.ownerID,f=h?c:vm(c);return d?a?u===l-1?f.pop():f[u]=f.pop():f[u]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new $m(e,this.keyHash,f)};var eg=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r};eg.prototype.get=function(e,t,r,n){return Ip(r,this.entry[0])?this.entry[1]:n},eg.prototype.update=function(e,t,r,n,o,i,s){var a=o===jf,c=Ip(n,this.entry[0]);return(c?o===this.entry[1]:a)?this:(Uf(s),a?void Uf(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new eg(e,this.keyHash,[n,o]):(Uf(i),lg(this,e,t,jp(n),[n,o])))},qm.prototype.iterate=$m.prototype.iterate=function(e,t){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(!1===e(r[t?o-n:n]))return!1},Km.prototype.iterate=Qm.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[t?o-n:n];if(i&&!1===i.iterate(e,t))return!1}},eg.prototype.iterate=function(e,t){return e(this.entry)};var tg,rg=function(e){function t(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&og(e._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r=t.node,n=t.index++,o=void 0;if(r.entry){if(0===n)return ng(e,r.entry)}else if(r.entries){if(n<=(o=r.entries.length-1))return ng(e,r.entries[this._reverse?o-n:n])}else if(n<=(o=r.nodes.length-1)){var i=r.nodes[this._reverse?o-n:n];if(i){if(i.entry)return ng(e,i.entry);t=this._stack=og(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}},t}(cp);function ng(e,t){return up(e,t[0],t[1])}function og(e,t){return{node:e,index:0,__prev:t}}function ig(e,t,r,n){var o=Object.create(Gm);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function sg(){return tg||(tg=ig(0))}function ag(e,t,r){var n,o;if(e._root){var i={value:!1},s={value:!1};if(n=cg(e._root,e.__ownerID,0,void 0,t,r,i,s),!s.value)return e;o=e.size+(i.value?r===jf?-1:1:0)}else{if(r===jf)return e;o=1,n=new qm(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?ig(o,n):sg()}function cg(e,t,r,n,o,i,s,a){return e?e.update(t,r,n,o,i,s,a):i===jf?e:(Uf(a),Uf(s),new eg(t,n,[o,i]))}function ug(e){return e.constructor===eg||e.constructor===$m}function lg(e,t,r,n,o){if(e.keyHash===n)return new $m(t,n,[e.entry,o]);var i,s=31&(0===r?e.keyHash:e.keyHash>>>r),a=31&(0===r?n:n>>>r),c=s===a?[lg(e,t,r+5,n,o)]:(i=new eg(t,n,o),s<a?[e,i]:[i,e]);return new Km(t,1<<s|1<<a,c)}function dg(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function hg(e,t,r,n){var o=n?e:vm(e);return o[t]=r,o}var fg=8,pg=16,mg=8;function gg(e){return Boolean(e&&e["@@__IMMUTABLE_LIST__@@"])}var yg=function(e){function t(t){var r=Rg();if(null==t)return r;if(gg(t))return t;var n=e(t),o=n.size;return 0===o?r:(xm(o),o>0&&o<32?Ag(0,o,5,null,new vg(n.toArray())):r.withMutations((function(e){e.setSize(o),n.forEach((function(t,r){return e.set(r,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=Vf(this,e))>=0&&e<this.size){var r=Sg(this,e+=this._origin);return r&&r.array[31&e]}return t},t.prototype.set=function(e,t){return function(e,t,r){if((t=Vf(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Ng(e,t).set(0,r):Ng(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,o=e._root,i={value:!1};t>=Mg(e._capacity)?n=kg(n,e.__ownerID,0,t,r,i):o=kg(o,e.__ownerID,e._level,t,r,i);if(!i.value)return e;if(e.__ownerID)return e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return Ag(e._origin,e._capacity,e._level,o,n)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Rg()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){Ng(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},t.prototype.pop=function(){return Ng(this,0,-1)},t.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Ng(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},t.prototype.shift=function(){return Ng(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++){var o=t[n],i=e("string"!=typeof o&&dp(o)?o:[o]);0!==i.size&&r.push(i)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(e){r.forEach((function(t){return t.forEach((function(t){return e.push(t)}))}))})):this.constructor(r[0])},t.prototype.setSize=function(e){return Ng(this,0,e)},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){for(var o=0;o<r.size;o++)n.set(o,e.call(t,n.get(o),o,r))}))},t.prototype.slice=function(e,t){var r=this.size;return Zf(e,t,r)?this:Ng(this,zf(e,r),Lf(t,r))},t.prototype.__iterator=function(e,t){var r=t?this.size:0,n=Eg(this,t);return new cp((function(){var o=n();return o===xg?{value:void 0,done:!0}:up(e,t?--r:r++,o)}))},t.prototype.__iterate=function(e,t){for(var r,n=t?this.size:0,o=Eg(this,t);(r=o())!==xg&&!1!==e(r,t?--n:n++,this););return n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ag(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):0===this.size?Rg():(this.__ownerID=e,this.__altered=!1,this)},t}($f);yg.isList=gg;var bg=yg.prototype;bg["@@__IMMUTABLE_LIST__@@"]=!0,bg.delete=bg.remove,bg.merge=bg.concat,bg.setIn=Tm,bg.deleteIn=bg.removeIn=Om,bg.update=Wm,bg.updateIn=Fm,bg.mergeIn=Zm,bg.mergeDeepIn=zm,bg.withMutations=Lm,bg.wasAltered=Xm,bg.asImmutable=Ym,bg["@@transducer/init"]=bg.asMutable=Hm,bg["@@transducer/step"]=function(e,t){return e.push(t)},bg["@@transducer/result"]=function(e){return e.asImmutable()};var vg=function(e,t){this.array=e,this.ownerID=t};vg.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&31;if(n>=this.array.length)return new vg([],e);var o,i=0===n;if(t>0){var s=this.array[n];if((o=s&&s.removeBefore(e,t-5,r))===s&&i)return this}if(i&&!o)return this;var a=_g(this,e);if(!i)for(var c=0;c<n;c++)a.array[c]=void 0;return o&&(a.array[n]=o),a},vg.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,o=r-1>>>t&31;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((n=i&&i.removeAfter(e,t-5,r))===i&&o===this.array.length-1)return this}var s=_g(this,e);return s.array.splice(o+1),n&&(s.array[o]=n),s};var wg,xg={};function Eg(e,t){var r=e._origin,n=e._capacity,o=Mg(n),i=e._tail;return s(e._root,e._level,0);function s(e,a,c){return 0===a?function(e,s){var a=s===o?i&&i.array:e&&e.array,c=s>r?0:r-s,u=n-s;u>32&&(u=32);return function(){if(c===u)return xg;var e=t?--u:c++;return a&&a[e]}}(e,c):function(e,o,i){var a,c=e&&e.array,u=i>r?0:r-i>>o,l=1+(n-i>>o);l>32&&(l=32);return function(){for(;;){if(a){var e=a();if(e!==xg)return e;a=null}if(u===l)return xg;var r=t?--l:u++;a=s(c&&c[r],o-5,i+(r<<o))}}}(e,a,c)}}function Ag(e,t,r,n,o,i,s){var a=Object.create(bg);return a.size=t-e,a._origin=e,a._capacity=t,a._level=r,a._root=n,a._tail=o,a.__ownerID=i,a.__hash=s,a.__altered=!1,a}function Rg(){return wg||(wg=Ag(0,0,5))}function kg(e,t,r,n,o,i){var s,a=n>>>r&31,c=e&&a<e.array.length;if(!c&&void 0===o)return e;if(r>0){var u=e&&e.array[a],l=kg(u,t,r-5,n,o,i);return l===u?e:((s=_g(e,t)).array[a]=l,s)}return c&&e.array[a]===o?e:(i&&Uf(i),s=_g(e,t),void 0===o&&a===s.array.length-1?s.array.pop():s.array[a]=o,s)}function _g(e,t){return t&&e&&t===e.ownerID?e:new vg(e?e.array.slice():[],t)}function Sg(e,t){if(t>=Mg(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&31],n-=5;return r}}function Ng(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new Df,o=e._origin,i=e._capacity,s=o+t,a=void 0===r?i:r<0?i+r:o+r;if(s===o&&a===i)return e;if(s>=a)return e.clear();for(var c=e._level,u=e._root,l=0;s+l<0;)u=new vg(u&&u.array.length?[void 0,u]:[],n),l+=1<<(c+=5);l&&(s+=l,o+=l,a+=l,i+=l);for(var d=Mg(i),h=Mg(a);h>=1<<c+5;)u=new vg(u&&u.array.length?[u]:[],n),c+=5;var f=e._tail,p=h<d?Sg(e,a-1):h>d?new vg([],n):f;if(f&&h>d&&s<i&&f.array.length){for(var m=u=_g(u,n),g=c;g>5;g-=5){var y=d>>>g&31;m=m.array[y]=_g(m.array[y],n)}m.array[d>>>5&31]=f}if(a<i&&(p=p&&p.removeAfter(n,0,a)),s>=h)s-=h,a-=h,c=5,u=null,p=p&&p.removeBefore(n,0,s);else if(s>o||h<d){for(l=0;u;){var b=s>>>c&31;if(b!==h>>>c&31)break;b&&(l+=(1<<c)*b),c-=5,u=u.array[b]}u&&s>o&&(u=u.removeBefore(n,c,s-l)),u&&h<d&&(u=u.removeAfter(n,c,h-l)),l&&(s-=l,a-=l)}return e.__ownerID?(e.size=a-s,e._origin=s,e._capacity=a,e._level=c,e._root=u,e._tail=p,e.__hash=void 0,e.__altered=!0,e):Ag(s,a,c,u,p)}function Mg(e){return e<32?0:e-1>>>5<<5}var Tg,Og=function(e){function t(e){return null==e?Wg():Tp(e)?e:Wg().withMutations((function(t){var r=Qf(e);xm(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Wg()},t.prototype.set=function(e,t){return Fg(this,e,t)},t.prototype.remove=function(e){return Fg(this,e,jf)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?Ig(t,r,e,this.__hash):0===this.size?Wg():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(Jm);function Ig(e,t,r,n){var o=Object.create(Og.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Wg(){return Tg||(Tg=Ig(sg(),Rg()))}function Fg(e,t,r){var n,o,i=e._map,s=e._list,a=i.get(t),c=void 0!==a;if(r===jf){if(!c)return e;s.size>=32&&s.size>=2*i.size?(n=(o=s.filter((function(e,t){return void 0!==e&&a!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=o.__ownerID=e.__ownerID)):(n=i.remove(t),o=a===s.size-1?s.pop():s.set(a,void 0))}else if(c){if(r===s.get(a)[1])return e;n=i,o=s.set(a,[t,r])}else n=i.set(t,s.size),o=s.set(s.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=o,e.__hash=void 0,e.__altered=!0,e):Ig(n,o)}Og.isOrderedMap=Tp,Og.prototype[op]=!0,Og.prototype.delete=Og.prototype.remove;function Cg(e){return Boolean(e&&e["@@__IMMUTABLE_STACK__@@"])}var jg=function(e){function t(e){return null==e?Vg():Cg(e)?e:Vg().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=Vf(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):Bg(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&Cg(t))return t;xm(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Bg(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Vg()},t.prototype.slice=function(t,r){if(Zf(t,r,this.size))return this;var n=zf(t,this.size);if(Lf(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):Bg(o,i)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Bg(this.size,this._head,e,this.__hash):0===this.size?Vg():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new xp(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,o=this._head;o&&!1!==e(o.value,n++,this);)o=o.next;return n},t.prototype.__iterator=function(e,t){if(t)return new xp(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new cp((function(){if(n){var t=n.value;return n=n.next,up(e,r++,t)}return{value:void 0,done:!0}}))},t}($f);jg.isStack=Cg;var Ug,Dg=jg.prototype;function Bg(e,t,r,n){var o=Object.create(Dg);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Vg(){return Ug||(Ug=Bg(0))}Dg["@@__IMMUTABLE_STACK__@@"]=!0,Dg.shift=Dg.pop,Dg.unshift=Dg.push,Dg.unshiftAll=Dg.pushAll,Dg.withMutations=Lm,Dg.wasAltered=Xm,Dg.asImmutable=Ym,Dg["@@transducer/init"]=Dg.asMutable=Hm,Dg["@@transducer/step"]=function(e,t){return e.unshift(t)},Dg["@@transducer/result"]=function(e){return e.asImmutable()};function Pg(e){return Boolean(e&&e["@@__IMMUTABLE_SET__@@"])}function Zg(e){return Pg(e)&&ip(e)}function zg(e,t){if(e===t)return!0;if(!Xf(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||Jf(e)!==Jf(t)||Gf(e)!==Gf(t)||ip(e)!==ip(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!qf(e);if(ip(e)){var n=e.entries();return t.every((function(e,t){var o=n.next().value;return o&&Ip(o[1],e)&&(r||Ip(o[0],t))}))&&n.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var s=!0,a=t.__iterate((function(t,n){if(r?!e.has(t):o?!Ip(t,e.get(n,jf)):!Ip(e.get(n,jf),t))return s=!1,!1}));return s&&e.size===a}function Lg(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function Hg(e){if(!e||"object"!=typeof e)return e;if(!Xf(e)){if(!Rm(e))return e;e=yp(e)}if(Jf(e)){var t={};return e.__iterate((function(e,r){t[r]=Hg(e)})),t}var r=[];return e.__iterate((function(e){r.push(Hg(e))})),r}var Yg=function(e){function t(t){return null==t?Kg():Pg(t)&&!ip(t)?t:Kg().withMutations((function(r){var n=e(t);xm(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(Qf(e).keySeq())},t.intersect=function(e){return(e=Kf(e).toArray()).length?Jg.intersect.apply(t(e.pop()),e):Kg()},t.union=function(e){return(e=Kf(e).toArray()).length?Jg.union.apply(t(e.pop()),e):Kg()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return Gg(this,this._map.set(e,e))},t.prototype.remove=function(e){return Gg(this,this._map.remove(e))},t.prototype.clear=function(){return Gg(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,o=Gg(this,this._map.mapEntries((function(o){var i=o[1],s=e.call(t,i,i,r);return s!==i&&(n=!0),[s,s]}),t));return n?o:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return t=t.filter((function(e){return 0!==e.size})),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n<t.length;n++)e(t[n]).forEach((function(e){return r.add(e)}))})):this.constructor(t[0])},t.prototype.intersect=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.every((function(t){return t.includes(e)}))||n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.subtract=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.some((function(t){return t.includes(e)}))&&n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.sort=function(e){return my(um(this,e))},t.prototype.sortBy=function(e,t){return my(um(this,t,e))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){return this._map.__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):0===this.size?this.__empty():(this.__ownerID=e,this._map=t,this)},t}(ep);Yg.isSet=Pg;var Xg,Jg=Yg.prototype;function Gg(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function qg(e,t){var r=Object.create(Jg);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Kg(){return Xg||(Xg=qg(sg()))}Jg["@@__IMMUTABLE_SET__@@"]=!0,Jg.delete=Jg.remove,Jg.merge=Jg.concat=Jg.union,Jg.withMutations=Lm,Jg.asImmutable=Ym,Jg["@@transducer/init"]=Jg.asMutable=Hm,Jg["@@transducer/step"]=function(e,t){return e.add(t)},Jg["@@transducer/result"]=function(e){return e.asImmutable()},Jg.__empty=Kg,Jg.__make=qg;var Qg,$g=function(e){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);if(wm(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(Qg)return Qg;Qg=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},t.prototype.get=function(e,t){return this.has(e)?this._start+Vf(this,e)*this._step:t},t.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},t.prototype.slice=function(e,r){return Zf(e,r,this.size)?this:(e=zf(e,this.size),(r=Lf(r,this.size))<=e?new t(0,0):new t(this.get(e,this._end),this.get(r,this._end),this._step))},t.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},t.prototype.lastIndexOf=function(e){return this.indexOf(e)},t.prototype.__iterate=function(e,t){for(var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;i!==r&&!1!==e(o,t?r-++i:i++,this);)o+=t?-n:n;return i},t.prototype.__iterator=function(e,t){var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;return new cp((function(){if(i===r)return{value:void 0,done:!0};var s=o;return o+=t?-n:n,up(e,t?r-++i:i++,s)}))},t.prototype.equals=function(e){return e instanceof t?this._start===e._start&&this._end===e._end&&this._step===e._step:zg(this,e)},t}(vp);function ey(e,t,r){for(var n=Em(t),o=0;o!==n.length;)if((e=_m(e,n[o++],jf))===jf)return r;return e}function ty(e,t){return ey(this,e,t)}function ry(){xm(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e}Kf.isIterable=Xf,Kf.isKeyed=Jf,Kf.isIndexed=Gf,Kf.isAssociative=qf,Kf.isOrdered=ip,Kf.Iterator=cp,Lg(Kf,{toArray:function(){xm(this.size);var e=new Array(this.size||0),t=Jf(this),r=0;return this.__iterate((function(n,o){e[r++]=t?[o,n]:n})),e},toIndexedSeq:function(){return new Qp(this)},toJS:function(){return Hg(this)},toKeyedSeq:function(){return new Kp(this,!0)},toMap:function(){return Jm(this.toKeyedSeq())},toObject:ry,toOrderedMap:function(){return Og(this.toKeyedSeq())},toOrderedSet:function(){return my(Jf(this)?this.valueSeq():this)},toSet:function(){return Yg(Jf(this)?this.valueSeq():this)},toSetSeq:function(){return new $p(this)},toSeq:function(){return Gf(this)?this.toIndexedSeq():Jf(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return jg(Jf(this)?this.valueSeq():this)},toList:function(){return yg(Jf(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return fm(this,am(this,e))},includes:function(e){return this.some((function(t){return Ip(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){xm(this.size);var r=!0;return this.__iterate((function(n,o,i){if(!e.call(t,n,o,i))return r=!1,!1})),r},filter:function(e,t){return fm(this,om(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return xm(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){xm(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return fm(this,rm(this,e,t))},reduce:function(e,t,r){return ay(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return ay(this,e,t,r,arguments.length<2,!0)},reverse:function(){return fm(this,nm(this,!0))},slice:function(e,t){return fm(this,im(this,e,t,!0))},some:function(e,t){return!this.every(ly(e),t)},sort:function(e){return fm(this,um(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return Bf(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=Jm().asMutable();return e.__iterate((function(o,i){n.update(t.call(r,o,i,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return zg(this,e)},entrySeq:function(){var e=this;if(e._cache)return new xp(e._cache);var t=e.toSeq().map(uy).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(ly(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(Pf,null,e)},flatMap:function(e,t){return fm(this,function(e,t,r){var n=mm(e);return e.toSeq().map((function(o,i){return n(t.call(r,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return fm(this,cm(this,e,!0))},fromEntrySeq:function(){return new em(this)},get:function(e,t){return this.find((function(t,r){return Ip(r,e)}),void 0,t)},getIn:ty,groupBy:function(e,t){return function(e,t,r){var n=Jf(e),o=(ip(e)?Og():Jm()).asMutable();e.__iterate((function(i,s){o.update(t.call(r,i,s,e),(function(e){return(e=e||[]).push(n?[s,i]:i),e}))}));var i=mm(e);return o.map((function(t){return fm(e,i(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,jf)!==jf},hasIn:function(e){return ey(this,e,jf)!==jf},isSubset:function(e){return e="function"==typeof e.includes?e:Kf(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:Kf(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return Ip(t,e)}))},keySeq:function(){return this.toSeq().map(cy).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return lm(this,e)},maxBy:function(e,t){return lm(this,t,e)},min:function(e){return lm(this,e?dy(e):fy)},minBy:function(e,t){return lm(this,t?dy(t):fy,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return fm(this,sm(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(ly(e),t)},sortBy:function(e,t){return fm(this,um(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return fm(this,function(e,t,r){var n=gm(e);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var s=0;return e.__iterate((function(e,o,a){return t.call(r,e,o,a)&&++s&&n(e,o,i)})),s},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var s=e.__iterator(2,o),a=!0;return new cp((function(){if(!a)return{value:void 0,done:!0};var e=s.next();if(e.done)return e;var o=e.value,c=o[0],u=o[1];return t.call(r,u,c,i)?2===n?e:up(n,c,u,e):(a=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(ly(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=ip(e),r=Jf(e),n=t?1:0,o=e.__iterate(r?t?function(e,t){n=31*n+py(jp(e),jp(t))|0}:function(e,t){n=n+py(jp(e),jp(t))|0}:t?function(e){n=31*n+jp(e)|0}:function(e){n=n+jp(e)|0});return function(e,t){return t=Wp(t,3432918353),t=Wp(t<<15|t>>>-15,461845907),t=Wp(t<<13|t>>>-13,5),t=Wp((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Fp((t=Wp(t^t>>>13,3266489909))^t>>>16)}(o,n)}(this))}});var ny=Kf.prototype;ny["@@__IMMUTABLE_ITERABLE__@@"]=!0,ny[ap]=ny.values,ny.toJSON=ny.toArray,ny.__toStringMapper=km,ny.inspect=ny.toSource=function(){return this.toString()},ny.chain=ny.flatMap,ny.contains=ny.includes,Lg(Qf,{flip:function(){return fm(this,tm(this))},mapEntries:function(e,t){var r=this,n=0;return fm(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return fm(this,this.toSeq().flip().map((function(n,o){return e.call(t,n,o,r)})).flip())}});var oy=Qf.prototype;oy["@@__IMMUTABLE_KEYED__@@"]=!0,oy[ap]=ny.entries,oy.toJSON=ry,oy.__toStringMapper=function(e,t){return km(t)+": "+km(e)},Lg($f,{toKeyedSeq:function(){return new Kp(this,!1)},filter:function(e,t){return fm(this,om(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return fm(this,nm(this,!1))},slice:function(e,t){return fm(this,im(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=zf(e,e<0?this.count():this.size);var n=this.slice(0,e);return fm(this,1===r?n:n.concat(vm(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return fm(this,cm(this,e,!1))},get:function(e,t){return(e=Vf(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=Vf(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return fm(this,function(e,t){var r=gm(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var o=this,i=0;return e.__iterate((function(e){return(!i||!1!==r(t,i++,o))&&!1!==r(e,i++,o)}),n),i},r.__iteratorUncached=function(r,n){var o,i=e.__iterator(1,n),s=0;return new cp((function(){return(!o||s%2)&&(o=i.next()).done?o:s%2?up(r,s++,t):up(r,s++,o.value,o)}))},r}(this,e))},interleave:function(){var e=[this].concat(vm(arguments)),t=hm(this.toSeq(),vp.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),fm(this,r)},keySeq:function(){return $g(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return fm(this,sm(this,e,t,!1))},zip:function(){var e=[this].concat(vm(arguments));return fm(this,hm(this,hy,e))},zipAll:function(){var e=[this].concat(vm(arguments));return fm(this,hm(this,hy,e,!0))},zipWith:function(e){var t=vm(arguments);return t[0]=this,fm(this,hm(this,e,t))}});var iy=$f.prototype;iy["@@__IMMUTABLE_INDEXED__@@"]=!0,iy[op]=!0,Lg(ep,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var sy=ep.prototype;function ay(e,t,r,n,o,i){return xm(e.size),e.__iterate((function(e,i,s){o?(o=!1,r=e):r=t.call(n,r,e,i,s)}),i),r}function cy(e,t){return t}function uy(e,t){return[t,e]}function ly(e){return function(){return!e.apply(this,arguments)}}function dy(e){return function(){return-e.apply(this,arguments)}}function hy(){return vm(arguments)}function fy(e,t){return e<t?1:e>t?-1:0}function py(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}sy.has=ny.includes,sy.contains=sy.includes,sy.keys=sy.values,Lg(bp,oy),Lg(vp,iy),Lg(wp,sy);var my=function(e){function t(e){return null==e?vy():Zg(e)?e:vy().withMutations((function(t){var r=ep(e);xm(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(Qf(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(Yg);my.isOrderedSet=Zg;var gy,yy=my.prototype;function by(e,t){var r=Object.create(yy);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function vy(){return gy||(gy=by(Wg()))}yy[op]=!0,yy.zip=iy.zip,yy.zipWith=iy.zipWith,yy.zipAll=iy.zipAll,yy.__empty=vy,yy.__make=by;var wy=function(e,t){var r;!function(e){if(rp(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(np(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(i){var s=this;if(i instanceof n)return i;if(!(this instanceof n))return new n(i);if(!r){r=!0;var a=Object.keys(e),c=o._indices={};o._name=t,o._keys=a,o._defaultValues=e;for(var u=0;u<a.length;u++){var l=a[u];c[l]=u,o[l]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+Ay(this)+' with property "'+l+'" since that property name is part of the Record API.'):ky(o,l)}}return this.__ownerID=void 0,this._values=yg().withMutations((function(e){e.setSize(s._keys.length),Qf(i).forEach((function(t,r){e.set(s._indices[r],t===s._defaultValues[r]?void 0:t)}))})),this},o=n.prototype=Object.create(xy);return o.constructor=n,t&&(n.displayName=t),n};wy.prototype.toString=function(){for(var e,t=Ay(this)+" { ",r=this._keys,n=0,o=r.length;n!==o;n++)t+=(n?", ":"")+(e=r[n])+": "+km(this.get(e));return t+" }"},wy.prototype.equals=function(e){return this===e||rp(e)&&Ry(this).equals(Ry(e))},wy.prototype.hashCode=function(){return Ry(this).hashCode()},wy.prototype.has=function(e){return this._indices.hasOwnProperty(e)},wy.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._indices[e],n=this._values.get(r);return void 0===n?this._defaultValues[e]:n},wy.prototype.set=function(e,t){if(this.has(e)){var r=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(r!==this._values&&!this.__ownerID)return Ey(this,r)}return this},wy.prototype.remove=function(e){return this.set(e)},wy.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:Ey(this,e)},wy.prototype.wasAltered=function(){return this._values.wasAltered()},wy.prototype.toSeq=function(){return Ry(this)},wy.prototype.toJS=function(){return Hg(this)},wy.prototype.entries=function(){return this.__iterator(2)},wy.prototype.__iterator=function(e,t){return Ry(this).__iterator(e,t)},wy.prototype.__iterate=function(e,t){return Ry(this).__iterate(e,t)},wy.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?Ey(this,t,e):(this.__ownerID=e,this._values=t,this)},wy.isRecord=rp,wy.getDescriptiveName=Ay;var xy=wy.prototype;function Ey(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function Ay(e){return e.constructor.displayName||e.constructor.name||"Record"}function Ry(e){return _p(e._keys.map((function(t){return[t,e.get(t)]})))}function ky(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){wm(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch(e){}}xy["@@__IMMUTABLE_RECORD__@@"]=!0,xy.delete=xy.remove,xy.deleteIn=xy.removeIn=Om,xy.getIn=ty,xy.hasIn=ny.hasIn,xy.merge=Cm,xy.mergeWith=jm,xy.mergeIn=Zm,xy.mergeDeep=Vm,xy.mergeDeepWith=Pm,xy.mergeDeepIn=zm,xy.setIn=Tm,xy.update=Wm,xy.updateIn=Fm,xy.withMutations=Lm,xy.asMutable=Hm,xy.asImmutable=Ym,xy[ap]=xy.entries,xy.toJSON=xy.toObject=ny.toObject,xy.inspect=xy.toSource=function(){return this.toString()};var _y;function Sy(){const e=Cf(),[t,r]=n.useState(_y.Initial),[o,i]=n.useState(yg([])),s=n.useCallback((()=>ls(this,void 0,void 0,(function*(){try{r(_y.Loading);const t=(e=>({[ns.ARBITRUM_ONE]:"https://tokens.coingecko.com/arbitrum-one/all.json",[ns.AURORA]:"https://tokens.coingecko.com/aurora/all.json",[ns.BSC]:"https://tokens.coingecko.com/binance-smart-chain/all.json"}[e]||"https://tokens.coingecko.com/uniswap/all.json"))(e),n=yield I.default.get(t);n&&n.data&&n.data.tokens&&i(yg(n.data.tokens)),r(_y.Success)}catch(e){r(_y.Failed),console.error(e)}}))),[e]);return n.useEffect((()=>{e&&s()}),[e]),{cgTokenList:o,loading:t===_y.Loading,refetch:s}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(_y||(_y={}));var Ny=[{chainId:1,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:1,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1,address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/xZmadzpVOnpuq2jNG_5EGKeqMET0LU_gmfnp4VxkcxI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSHQwWXZKMGNnU0lGTFM0aHExTV9jOXVITV9fMHpXaHBKSGVOQU5neTBuby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkoxYzJSZk4ySTJOalJpWWpReVpDOWlkWE5rWHpkaU5qWTBZbUkwTW1RdWNHNW4ucG5n.webp"},{chainId:1,address:"0x6b175474e89094c44da98b954eedeac495271d0f",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/h2lbKBfBJ2LNSTNCuwjsBkshT4eXzDDmAV0lhWS0llA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUnVJNWt2eHBwalI4TTZsenFZZVAyTTB4eVFMUGJ0S1hONDdWVTN1dUszZy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpBNU5qUmpPVFUxT1M1d2JtYy5wbmc.webp"},{chainId:1,address:"0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:1,address:"0xdac17f958d2ee523a2206206994597c13d831ec7",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/mI69kq-S-tNT1W57qYizPd5r2WNFzpAq5y6NhOcrTkY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVEZhSVNLVVZIWThLTVhyTkVmZDRXRUJmMGJoSHRweHY3Q1hDT0dKbGY2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT0dVeFpEaG1PVEEyWlM1d2JtYy5wbmc.webp"},{chainId:4,address:"0x99cf6999fc481663fb10be55827f3584e3c25f3c",name:"LINE",decimals:18,symbol:"LINE",logoURI:""},{chainId:4,address:"0xeaa70c2a40820dF9D38149C84dd943CFcB562587",name:"DODO",decimals:18,symbol:"DODO",logoURI:""},{chainId:4,address:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:""},{chainId:4,address:"0xab0733588776B8881F7712f6AbCa98F510e6B63D",name:"USDC",decimals:6,symbol:"USDC",logoURI:""},{chainId:4,address:"0x0aDCBAE18580120667f7Ff6c6451A426B13c67B7",name:"USDT Token",decimals:6,symbol:"USDT",logoURI:""},{chainId:4,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:""},{chainId:5,symbol:"USDC",address:"0xC4106029d03c33731Ca01Ba59b5A6368c660E596",name:"USDC",decimals:6,logoURI:""},{chainId:5,symbol:"USDT",address:"0xed8a325D87D3b6edED04FB992A1482231647EE5e",name:"USDT Token",decimals:6,logoURI:""},{chainId:5,symbol:"WETH",address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",name:"Wrapped Ether",decimals:18,logoURI:""},{chainId:5,symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,logoURI:""},{chainId:56,address:"0xe9e7cea3dedca5984780bafc599bd69add087d56",name:"BUSD Token",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/BvxyffA5gsLB4bLmlOVkfu7AVami78-VcW_6_i8I6kc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vbC1Sa25meFB3ZXlCOGVYSWJ2b04wdHczLTlzckZOckxfRHdTTnRLSHVRRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZlluVnpaRjgyTXpsbFlqZzNZV0V4WDJKMWMyUmZOak01WldJNE4yRmhNVjlsT1dVMVlXRTBOemxtTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0x55d398326f99059ff775485246999027b3197955",name:"Tether USD",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/QOl7CvP_WSmTUOMthbxQsNKjDj0s5kSjup69dW_-UeA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTjdQU3RXV2ZGaGNTVzM1QlE2TEJIaF9keVROUEJqa1RLTXRwTll5cEhSWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZmRYTmtkRjh4TlRZME1XWmpaRFF3WDNWelpIUmZNVFUyTkRGbVkyUTBNRjlqWmpJMVpUYzVZVE5qTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:56,address:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",name:"BTCB Token",decimals:18,symbol:"BTCB",logoURI:"https://cmp.dodoex.io/fZG0z_RZ1U73_LuuC3RGrrZvNR-bgrCUjkwvaro-PCY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZ1NXN0RuYWNkMnc2YWxSQnFmcENqTHNDZWJhc2VtQTc0dDJlTEdDZjhfNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpJNVlXRmpZamxoTVM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3",name:"Dai Token",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/bhz9Vtma8hPb_-GnhwqQkhfTQ5PwKcR1Qbzn7aBKlfs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZW04OHB4YXNDdEg0Nl9BcjhVandzZWR2SFBFUUtjVWVkc0FmV2lvenB2Yy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWVRoaFptSmxaRFppWkM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:56,address:"0x2170ed0880ac9a755fd29b2688956bd959f933f8",name:"Ethereum Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:56,address:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",name:"Binance-Peg USD Coin",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:56,address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",name:"Wrapped BNB",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/-Pua5rc9k9iW4yuF5ajLVKzMkRhBq06D8HiEZ5gjezA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDZOWTdBTmdOYWdFOHpXYUMtX2IzYXVPOUxsTEp6QlpLTUR3VlM5eW9DQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT1dRellXTmtZMlEzTnk1d2JtYy5wbmc.webp"},{chainId:128,address:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f",name:"Wrapped HT",decimals:18,symbol:"WHT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x0298c2b32eae4da002a15f36fdf7615bea3da047",name:"Heco-Peg HUSD Token",decimals:8,symbol:"HUSD",logoURI:"https://cmp.dodoex.io/LiOyD0GGt0t4bk4xz3RWAxvqFPyYCqfM4z0AqneT3xM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVXRWWnNCVUxTREZNR002SUM0OGI0VV9UV05oYUU4MzFkdnh1Y1hkLTE2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTkRjM09WODFZbU0yWVdFek9EUTRMbkJ1WncucG5n.webp"},{chainId:128,address:"0x3d760a45d0887dfd89a2f5385a236b29cb46ed2a",name:"Heco-Peg DAIHECO Token",decimals:18,symbol:"DAI-HECO",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:128,address:"0x64ff637fb478863b7468bc97d30a5bf3a428a1fd",name:"Heco-Peg ETH Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:128,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"HT",decimals:18,symbol:"HT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x9362bbef4b8313a8aa9f0c9808b80577aa26b73b",name:"Heco-Peg USDCHECO Token",decimals:6,symbol:"USDC-HECO",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:128,address:"0xa71edc38d189767582c38a3145b5873052c3e47a",name:"Heco-Peg USDTHECO Token",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:137,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MATIC",decimals:18,symbol:"MATIC",logoURI:"https://cmp.dodoex.io/cQFrEB6yGIqMkh_6Pie8VR3kIStL58IS-y8FbroHVwA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2VNUUk2dkpoaXljeldrczJaWWdGdk8zSEoxSWFIa053LXZYeXFneER4US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekZmTWpkbE56TXlNRE13TWk4eFh6STNaVGN6TWpBek1ESXVjRzVuLnBuZw.webp"},{chainId:137,address:"0xe4bf2864ebec7b7fdf6eeca9bacae7cdfdaffe78",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/KEPetVp3nQkB6BZ_cb05trEfBbGxFEg92UnF8NZsEzM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE5wTlRseEJGbFRDalM1ZFh3SWJ3Mm1hZ3NPUFFkZ3Z1UEhuZDZrNWdyMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk4yUTBaamxtTldOaU15OUVUMFJQWHpka05HWTVaalZqWWpNdWNHNW4ucG5n.webp"},{chainId:137,address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/hdRkGay_hj0t1OzN5C3c30cmch26tJhHUSroffg7ciY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOHd3UndQOG9DTTdBcF9NOW11bGVOQWRqYjhBOXpvX2FYUE5pVTNBYUtzYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhnMlgwSXhOelUwTnpSZlJUZzVNRGswWDBNME5GOUVZVGs0WWprMU5GOUZaV1JsWDBGRFh6UTVOVEkzTVdRd1gwWmZiRzluYjE4MFpXSXdNVE0zTVRZeExuQnVady5wbmc.webp"},{chainId:137,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:137,address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/er3iAGv39hCC7F8AydW_AteD3hnZj9HI2XcAaruHeqA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE9WUWtzN3JQWU5OZWdmNTRuNC1Za1NGTFYyLXVGZmlJRFVYem85aVMzOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlFUQmlPRFk1T1RGak5qSXhPR0l6Tm1NeFpERTVYMFEwWVRKbE9WOUZZakJqWDBVek5qQTJaVjlDTkRoZmJHOW5iMTlpTmpGbE5EVmtNbVF6TG5CdVp3LnBuZw.webp"},{chainId:137,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/WeK6L9_RjWUfAsnMuOAdyXIZVE3JK_H3lZU5vk2m7Tg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTFJ0aEt6X2VrSXdmTEh6NnAycW5rSkRFeUk1RXZrODlXQ0J2VW43MUJLNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoa1gwRkRYekUzWDBZNU5UaGZSREpsWlRVeU0yRXlNakEyTWpBMk9UazBOVGszWDBNeE0xOUVPRE14WldNM1gyeHZaMjlmWXpCbU9XVTFaamxoTmk1d2JtYy5wbmc.webp"},{chainId:137,address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/_KjvB9pCVqbIIv_UnQvRWpjySBHiFnuHNSXUm_52UZM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDQ4OVYzTW1NMi1qaFJueEQ2Y3MyY1gydXdGS2tkRHpiRGZsbkZhTTJxOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhneU1qWXdYMFpCUTE4MVgwVTFOVFF5WVRjM00xOUJZVFEwWmw5Q1gwTm1aVjlFWmpkZlF6RTVNMkpqTWw5RE5UazVYMnh2WjI5Zk5HTmpORE0zTlRneFppNXdibWMucG5n.webp"},{chainId:137,address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",name:"Wrapped MATIC",decimals:18,symbol:"WMATIC",logoURI:"https://cmp.dodoex.io/HfZVSaAES3QRplSybW2uoKmYf6pVTRaxufn95_Qto_A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMERhZEZTUUVFX0d4YlBoMHY3Wk1Hb1FwaWtOQm1vaWFyZTFlaFdJbU44dy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjFoZEdsalgyVmlOekZtTkdFMU9XRXZiV0YwYVdOZlpXSTNNV1kwWVRVNVlTNTNaV0p3LndlYnA.webp"},{chainId:42161,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:42161,address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/6VmZGvbENd4TM1VK0rsYrfznRtG-GwxP-zCy2qyc9bM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWnJZUDB0ZHVTLUdDNE5FTThmRmV1RHhVWklPNUZpWnpqdkdBc0lfNlBQMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh5TW1GbU4yVTVOVFJpTDFkRlZFaGZhV052Ymw4eU1tRm1OMlU1TlRSaUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:42161,address:"0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/6U51l5aajoRrCaO6cpbrclQ2olWNDzuShggOCfoktCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8va3RkSlhwQ3dsQVZtZXNPb1dvQV95SG9IazBnV3UxUExienBKa1AxYnlJdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5tTmtPVEV4WXprNE15OUVUMFJQWHpaalpEa3hNV001T0RNdWNHNW4ucG5n.webp"},{chainId:42161,address:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",name:"USD Coin (Arb1)",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:42161,address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1285,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MOVR",decimals:18,symbol:"MOVR",logoURI:"https://cmp.dodoex.io/Clhd0YhBfsWh48Ej4taGHcJ7dfKiCbtdMgyhNU7QAJg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZlBFT3c5LVdpQWhDVDJteGRmQ2gtb2hnQU1aaXBvWnllUl9TcVNpa3R4NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMemt5T0RWZk4yWTVNREF5T1dNMU1pODVNamcxWHpkbU9UQXdNamxqTlRJdWQyVmljQS53ZWJw.webp"},{chainId:1285,address:"0x98878b06940ae243284ca214f92bb71a2b032b8a",name:"Wrapped MOVR",decimals:18,symbol:"WMOVR",logoURI:"https://cmp.dodoex.io/oXW0_VSLU29rbyQK3LtaHymbMfdv6F_ri20EeyMVBEU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDVYMDFLd21zZXFRNFB6SGxJdEdvN3dveHVaUkFVbmQ5bDhCNU5VQ2N6by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMGhmVG1OdmRWOUlNSGhmTkRBd2VEUXdNRjlrTlRBNFpHSmxNVE0yTDBoZlRtTnZkVjlJTUhoZk5EQXdlRFF3TUY5a05UQTRaR0psTVRNMkxtcHdady5qcGc.webp"},{chainId:1285,address:"0x5D9ab5522c64E1F6ef5e3627ECCc093f56167818",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/SKu1xTvsm3q0RZC9CdiGw0zkq9k1P2ygK4TMenBYNC8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQVMtWEpUX3pncF9MSlFxdFJiaE1Fd3lTZlNBMWp0MUhHbUFGYV9QQUdTdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWRYTmtYems0TjJNd1lUUmtNRGt1YW5Cbi5qcGc.webp"},{chainId:1285,address:"0x80A16016cC4A2E6a2CACA8a4a498b1699fF0f844",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0xE9460BD2FFB12b668fA32919C785C239f974D37C",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/onw4bpUWC5-GPBwFMHLE3BcRaQ1S_hqlUxW-8H3l5g0/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTi1ITXhGVWtxUU9fR3cxRFl1empZblgwejFzQ1pIMG1nMWRlOG5Qdmk2NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zll6SXdZVEl4WTJFNU5pOUVUMFJQWDJNeU1HRXlNV05oT1RZdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xB44a9B6905aF7c801311e8F4E76932ee959c663C",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/LyxjB8w94UjDhRuXa9xNlg7YcMuOC6akWBPCtgbq_Qw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vLXNSOWJzZTlrLTFIY1VUeUE3WE9KZWplQkRRS2ZtSFpRV2I3RE1iemlHMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkhSZk1UVTJOREZtWTJRME1DOTFjMlIwWHpFMU5qUXhabU5rTkRBdWMzWm4uc3Zn.webp"},{chainId:1285,address:"0x2bF9b864cdc97b08B6D79ad4663e71B8aB65c45c",name:"WBNB Token",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/HSdBZz6OV3HFUq1RqW8hdavA1cfhjWEfqP12BINZppw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUTAzVVlDM3hSN0J2SHo5UmgtcHZ0WWctRGdPNlF1b2xKUmE0QjBHaWlmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWJtSmZNalE0TmpZeFpHTXhaaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8",name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/6qiR9e_WPVs0u8U4DgdGMcaKFzJzypJqME5wUNe7XsY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMUMxeHZaUVJ4b0NlTW1sNXg0eUMzTGcySmhNXzYwcHpMMlk3elBwSGJFQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMnh2WjI5Zk4ySXpNMlU0TW1WbFlTOXNiMmR2WHpkaU16TmxPREpsWldFdWNHNW4ucG5n.webp"},{chainId:1285,address:"0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:66,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"OKT",decimals:18,symbol:"OKT",logoURI:"https://cmp.dodoex.io/pcltGNcIp7DP33nj3YxxBpuFEekNcOW3pwq9tjSrpY4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTzJHSDJYTndRancwbXMzQXNidG5xNzRkVEROVld3QWFOU1dXU2ZnU01QTS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTVOalF5T1RCZk1qQXlNakExTWpBd056STNORFl3TWpJdWMzWm4uc3Zn.webp"},{chainId:66,address:"0x382bB369d343125BfB2117af9c149795C6C65C50",name:"USDT",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:66,address:"0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:66,address:"0x54e4622DC504176b3BB432dCCAf504569699a7fF",name:"BTCK",decimals:18,symbol:"BTCK",logoURI:"https://cmp.dodoex.io/L3kcNUKg94qnX8OPFlEvHKqWybnJD8SA9HTne3PW-Rg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vNU1MQTB3Q3V6eEs4Q3ZMV0RqempuOVhzalBTWE1zbUpWZ0RRN1RPMG9FWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpVUTB0Zk1HWmlaRGRsTWpnNU5pOUNWRU5MWHpCbVltUTNaVEk0T1RZdWNHNW4ucG5n.webp"},{chainId:66,address:"0x332730a4F6E03D9C55829435f10360E13cfA41Ff",name:"BUSD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:66,address:"0x21cDE7E32a6CAF4742d00d44B07279e7596d26B9",name:"DAIK",decimals:18,symbol:"DAIK",logoURI:"https://cmp.dodoex.io/LOb-sXupURNN9HA0zBSfLfpZlx52N9qRSDUyzk3cg0A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vck5pZzMtWU5TOUl4T3ZHX19taTFRSU9WYTZsczdZNXViRVhGcTJJVGplby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJCU1V0Zk5ESTVNV1l4WlRoa1pTOUVRVWxMWHpReU9URm1NV1U0WkdVdWNHNW4ucG5n.webp"},{chainId:66,address:"0xEF71CA2EE68F45B9Ad6F72fbdb33d707b872315C",name:"ETHK",decimals:18,symbol:"ETHK",logoURI:"https://cmp.dodoex.io/IwBclhMMQLOo79RdRo6-HnUiXxshO_hSi02YK3L6MFI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcFBSd192aEx2MHh3WkRHU2k3eGYyYVJiQjlocVhfU2tacUdGc3RJR0pYRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFZVU0V0Zk1UQTVNamMzTW1VMU9DOUZWRWhMWHpFd09USTNOekpsTlRndWNHNW4ucG5n.webp"},{chainId:66,address:"0xc946DAf81b08146B1C7A8Da2A851Ddf2B3EAaf85",name:"USDC",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0xdCAC52E001f5bd413aa6ea83956438F29098166b",name:"USDK",decimals:18,symbol:"USDK",logoURI:"https://cmp.dodoex.io/X-_D75ZOpI-yC70WjdgC8wiqcssfRIALEv0eUfD3HiE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vd290dHEzaWdkTDVzQlhSR2VFZkhQLTNpZHhDZzV0V3VGQmE3YjNrNUZITS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkV0Zk56aGpZekV6TW1OaVpDOVZVMFJMWHpjNFkyTXhNekpqWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0x506f731F7656e2FB34b587B912808f2a7aB640BD",name:"WBTCK",decimals:18,symbol:"WBTCK",logoURI:"https://cmp.dodoex.io/7Gb1gYkvjWESf9ungWe4YKOrr5GY5UILmTwU_U95kCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOTQ4NWZpU2NmUzBNc2V1YVZXWXo2Z1RuNVVidXJvZkxmN1VGSWhMdndjTS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOTFgyVXlZamRpWVRJNU16TXZWMEpVUTB0ZlpUSmlOMkpoTWprek15NXdibWMucG5n.webp"},{chainId:288,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:288,address:"0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:288,address:"0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b",name:"Binance",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:288,address:"0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7",name:"Boba Token",decimals:18,symbol:"BOBA",logoURI:"https://cmp.dodoex.io/p7--p24wKrXpF7IGh6Q_RT6J0ZGS2_FURnXxeyMDvO4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQlVsWE9GWS1wUTIxbTJJOTdIRFN2VHlvMzR2MGJWQllYU1ByczFwaWNuYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpQUWtGZk16SmtZamczT1dJMk1TOUNUMEpCWHpNeVpHSTROemxpTmpFdWNHNW4ucG5n.webp"},{chainId:288,address:"0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:288,address:"0x572c5B5BF34f75FB62c39b9BFE9A75bb0bb47984",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/8CGANX_wy00isVg8PgA_A-IKbfIn55Yu9ZujzUukXlQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDJhLVNEOFJvWDlGaW9IUVNzSkh2WkZzNlBpbVlNTWxTZGhZalJmMXVVQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk1tRm1NMll4WkRZd055OUVUMFJQWHpKaFpqTm1NV1EyTURjdWNHNW4ucG5n.webp"},{chainId:288,address:"0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:288,address:"0xdc0486f8bf31DF57a952bcd3c1d3e166e3d9eC8b",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:288,address:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:1313161554,address:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79",name:"Aurora",decimals:18,symbol:"Aurora",logoURI:"https://cmp.dodoex.io/2C2jfpO2-VYuwlga3SdtP5I6eJNJXIYq3LvPU4aFuiU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcHFWVWlJOEQ4VU5iUEZYRElvUnA3cFhEZFc4dmx4dWEtTmxubmxlam1PMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkYxY205eVlWOHlOVEprWlRFeE56YzBMMkYxY205eVlWOHlOVEprWlRFeE56YzBMbmRsWW5BLndlYnA.webp"},{chainId:1313161554,address:"0xe3520349F477A5F6EB06107066048508498A291b",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1313161554,address:"0xe301eD8C7630C9678c39E4E45193D1e7Dfb914f7",name:"DODO Bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/SEcMDWMmtHb3GFW5l7fTKYurpTqALHdZI3D6qzad1rs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQXRNMzllUjhRQzhYTl8tem5HU0pSLS1lV0tPUW91V3p2ci0zQ014WlJTSS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekl3TUhneU1EQmZNVjh3WWpReFl6VTJZV1UxTHpJd01IZ3lNREJmTVY4d1lqUXhZelUyWVdVMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x4988a896b1227218e4A686fdE5EabdcAbd91571f",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1313161554,address:"0xF4eB217Ba2454613b15dBdea6e5f22276410e89e",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Avalanche",decimals:18,symbol:"AVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",name:"Wrapped AVAX",decimals:18,symbol:"WAVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98",name:"Binance USD",decimals:18,symbol:"BUSD.e",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",name:"Dai Stablecoin",decimals:18,symbol:"DAI.e",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:43114,address:"0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",name:"USD Coin",decimals:6,symbol:"USDC.e",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xc7198437980c041c805A1EDcbA50c1Ce5db95118",name:"Tether USD",decimals:6,symbol:"USDT.e ",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:43114,address:"0x50b7545627a5162F82A992c33b87aDc75187B218",name:"Wrapped BTC",decimals:8,symbol:"WBTC.e",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",name:"Wrapped Ether",decimals:18,symbol:"WETH.e",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:25,address:"0x66e428c3f67a68878562e79A0234c1F83c208770",name:"USDT",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/p_nSk7MW-bCcwp-tgtWC8az4e4Q0YMirg6rv6yVjC-I/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vODVNVlpTTllrTFlySWdlX2VQemNVOUpydkNKeFpDM2JhaGV0NnN5S0d5WS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTJPREl3TWpoZk1qQXlNakExTVRjd016STVNakV6TURjdWQyVmljQS53ZWJw.webp"},{chainId:25,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"CRO",decimals:1,symbol:"CRO",logoURI:"https://cmp.dodoex.io/HYsQIOyyuC6P1Ik_Rs5a6ws2CKMzJbajJewE77C0rf8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZzc2UURUMEIwbHJjc3VTSTlodTZTTnlqMEp3WWNtUEFRWV9qWDV0VVBhMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6YzRNRGc0TkRkZk1qQXlNakExTVRjd056UXdNekExTWpFdWNHNW4ucG5n.webp"},{chainId:10,address:"0x4200000000000000000000000000000000000006",name:"WETH",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/f9SbZq39ynUZS5ueKvAwzLmKUfcZvYpKDaysT3dkcvM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2NkVzJUWjladmRiX3BVSjZ3b2YzeHRvYk94YUw3bEV5RmhhemhJUFhlMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RXdNamd3TkRaZk1qQXlNakEwTWpJd01UQXpORGc1TURVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"DAI",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/04gwZiu2K_9fdb2zLwzsX1nONCbBWrZOvTyOoEFhx3g/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaDJCcmdhUmZxUzBLZDBEOVpZbEUteEtNMVdzeFFtRzBEWVpKOGJCaWN4US9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6SXlNRFUwTVRsZk1qQXlNakEwTWpJd01UQTBNak00TlRVdWFuQm4uanBn.webp"},{chainId:10,address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",name:"USDC",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/XbtxsPIscM6p5ClHbLO0JumFHA9U23eON8-MDh-Plkg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaG1nM3hRa1BUTUtkcUNFVnd0LXU4S2lwTW5od1JCdGhLYWxENW9vSWlTZy9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6UXlNRFEyTkRaZk1qQXlNakEwTWpJd01UQTFNekF4TmpVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/bcyoORJ04NyP1HhYUZ9RrTZ-MEOFeNnMcrr__JZ6Ruw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vV1lHaU9IVFVnVWs4Q3Z3WmNyN0hWX2w4SlNrQjRVQUh1UXpzaWd4U3Nmay9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6VTVPREk0T1Y4eU1ESXlNRFF5TWpBeU1qTTBNelk0TlM1d2JtYy5wbmc.webp"}];function My({tokenList:e,popularTokenList:t}){const o=c.useDispatch(),[i,s]=n.useState([]),{account:a}=l.useWeb3React(),u=Cf(),{cgTokenList:d}=Sy(),h=c.useSelector(Rs),f=n.useMemo((()=>(null==Ny?void 0:Ny.filter((e=>e.chainId===u)))||[]),[Ny,u]),p=n.useMemo((()=>(null==t?void 0:t.filter((e=>e.chainId===u)))||[]),[t,u]);!function({tokenList:e,addresses:t,blockNumber:r}){const{account:o}=l.useWeb3React(),i=c.useDispatch(),s=n.useMemo((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,JSON.stringify(t)]),{getContract:a,contractConfig:u,call:d}=Lc(),[h,f]=n.useState(),p=n.useMemo((()=>{if(!o||!s.length||!u)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=u,r=a(t,Hc);if(!r)return;let n={};const c=s.map((i=>(n[i]=!0,{callData:{data:r.interface.encodeFunctionData("isERC20",[i,o,e]),to:t},processor:e=>{const t=new Vc(Hc).decodeFunctionResult("isERC20",e),{balance:r,isOk:n}=t,o=parseInt(t.decimals),s=new k.default(10).pow(o),a=new k.default(t.allownance.toString()).div(s);return n?{address:i,decimals:o,symbol:t.symbol,name:t.name,balance:new k.default(r.toString()).div(s),allowance:a}:{address:i,balance:new k.default(0),allowance:new k.default(0)}}})));return i(_s(n)),c}),[o,a,JSON.stringify(s)]);n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){if(!p)return;const e=yield d(p),t={};e&&(e.forEach((e=>{e.address.toLocaleLowerCase()!=="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".toLocaleLowerCase()&&(t[e.address.toLocaleLowerCase()]={tokenBalances:e.balance,tokenAllowances:e.allowance})})),i(ks(t))),f(e);let r={};s.forEach((e=>{r[e]=!1})),i(_s(r))}))})()}),[p,r])}({addresses:n.useMemo((()=>{const e=i.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[i,t]),blockNumber:h}),n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){let t=[];if(r.isArray(e))t=e;else if(e===Jc.Coingecko||e===Jc.All){const e=f.concat(d.toArray());t=r.unionBy(p,e,(e=>e.address.toLowerCase()))}else t=r.unionBy(p,f,(e=>e.address.toLowerCase()));const n=u,i=t.filter((e=>e.chainId===n));s(i),o((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(i))}))})()}),[e,o,u,d,p,f]),n.useEffect((()=>{o(ks({}))}),[a,u]),n.useEffect((()=>{o((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(p))}),[p,o])}const Ty=e=>(null!=e?e:Es.getState()).token.tokenList,Oy=e=>(null!=e?e:Es.getState()).token.accountBalances,Iy=e=>(null!=e?e:Es.getState()).token.ethBalance||new k.default(NaN),Wy=e=>(null!=e?e:Es.getState()).token.defaultFromToken,Fy=e=>(null!=e?e:Es.getState()).token.defaultToToken,Cy=e=>(null!=e?e:Es.getState()).token.balanceLoadings;function jy(){const{account:e,chainId:t}=l.useWeb3React(),r=c.useSelector(Oy),o=c.useSelector(Iy),i=n.useMemo((()=>ss[t||1]),[t]),s=n.useCallback((t=>{var n;if(!e)return null;if(t.symbol===i.symbol&&ts(t.address,i.address))return!o||(null==o?void 0:o.isNaN())?null:o;const s=null===(n=r[t.address.toLocaleLowerCase()])||void 0===n?void 0:n.tokenBalances;return!s||(null==s?void 0:s.isNaN())?null:s}),[r,o,e]);return s}var Uy;function Dy(e,t,r,n=0){if(r&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return Uy.fully+n;const o=e.indexOf(t);return 0===o?Uy.prefix+n:o>0?Uy.other+n:Uy.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(Uy||(Uy={}));function By({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:o,showAddrs:i,side:s}){const[a,u]=n.useState(""),l=c.useSelector(Ty),d=Cf(),h=jy(),f=c.useSelector((e=>((e,t)=>(null!=t?t:Es.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)))(d,e))),p=n.useMemo((()=>(null==Ny?void 0:Ny.filter((e=>e.chainId===d)))||[]),[Ny,d]),m=n.useMemo((()=>new Set(o?o.map((e=>e.toLowerCase())):void 0)),[o]),g=n.useMemo((()=>i?new Set(i.map((e=>e.toLowerCase()))):void 0),[i]),y=n.useCallback((e=>e.filter((e=>{if(e.chainId!==d)return!1;let t=!0;return t=g?g.has(e.address.toLowerCase()):!m.has(e.address.toLowerCase()),t&&s&&(t=!e.side||e.side===s),t}))),[g,d,m]),b=n.useMemo((()=>y(f)),[f,y]),v=n.useCallback((t=>{if(null===t)return null;const n=[];a?t.forEach((e=>{const t=((e,t,{matchAddress:r}={})=>{if(!t)return 0;const n=t.toLocaleLowerCase();let o=0;r&&e.address.toLocaleLowerCase()===n&&(o=1),o||(o=Dy(e.symbol.toLocaleLowerCase(),n,!1,1));if(o)e.name.toLocaleLowerCase()===n&&(o=Uy.fully+1);else{let t=Dy(e.name.toLocaleLowerCase(),n,!1,10);t=t===Uy.fully+10?Uy.fully+1:t,o=t}return o})(e,a,{matchAddress:!0});t&&n.push({sort:t,token:e})})):t.forEach((e=>{n.push({sort:0,token:e})}));const o=[];return n.sort(((t,n)=>{const o=t.token,i=n.token;if(e){if(o.address===e.address)return-1;if(i.address===e.address)return 1}if(null==r?void 0:r.includes(o.address))return-1;if(null==r?void 0:r.includes(i.address))return 1;const s=h&&h(o)||new k.default(0),a=h&&h(i)||new k.default(0);if(!s.eq(a))return s.gt(a)?-1:1;if(t.sort!==n.sort)return t.sort>n.sort?1:-1;const c=b.map((e=>e.address));if(null==c?void 0:c.includes(o.address))return-1;if(null==c?void 0:c.includes(i.address))return 1;const u=p.map((e=>e.address));return(null==u?void 0:u.includes(o.address))?-1:(null==u?void 0:u.includes(i.address))?1:o.symbol.localeCompare(i.symbol)})).some((e=>!!(a&&o.length>21)||(o.push(e.token),!1))),o}),[a,h,r,e,b,p]),w=n.useCallback((e=>{const n=e.address.toLowerCase();t(e,!!(null==r?void 0:r.some((e=>e.toLowerCase()===n))))}),[t,r]),x=n.useMemo((()=>{const e=y(l);return v(e)||[]}),[l,y,v]);return{filter:a,setFilter:u,showTokenList:x,onSelectToken:w,popularTokenList:b}}function Vy({width:e=24,height:t=24,marginRight:r=8,url:o,zIndex:i,cross:s,address:a,token:u,sx:d}){const[h,f]=n.useState(!1),[p,m]=n.useState(""),[g,y]=n.useState(""),[b,v]=n.useState(!1),w=n.useCallback((()=>f(!0)),[]);let x=function(e){const t=c.useSelector(Ty),{chainId:r}=l.useWeb3React();return n.useMemo((()=>{if(!e)return;let n=t.find((({address:t,chainId:n})=>n===r&&t===e));return n||(n=t.find((({address:t})=>t===e))),n}),[e,t,r])}(a);u&&(x=u);const E=a||(null==x?void 0:x.address),A=null==x?void 0:x.symbol,R=null==A?void 0:A.charAt(0).toUpperCase(),k=n.useMemo((()=>{const e=null==x?void 0:x.logoURI;return o||e||""}),[o,x]);return n.useEffect((()=>{v(!1)}),[E,k]),n.useEffect((()=>{s&&(k?function(e,t){const r=new XMLHttpRequest;let n;r.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(r.response)},r.onerror=function(){t()};try{n=new URL(e)}catch(e){}finally{r.open("GET",n||e),r.responseType="blob",r.send()}}(k,(e=>{m(e)})):m(""))}),[k,s]),n.useEffect((()=>{try{let t=E;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const r=new O.default(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();y(`data:image/svg+xml;base64,${r}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[E,e]),ne.exports.jsxs(Er,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e,width:e,height:t,marginRight:r,zIndex:i},d||{}),style:{width:e,height:t},children:[!h&&ne.exports.jsx(Er,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:R}),ne.exports.jsx(Er,{component:"img",src:!(s?p:k)||b?g:s?p:k,onLoad:w,onError:e=>{const t=e.target;E&&g&&v(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]})}function Py({token:t,onClick:r}){var n,o;const s=vr();return ne.exports.jsxs(Er,{component:pn,sx:{display:"flex",alignItems:"center",color:s.palette.text.primary,typography:"h5",fontWeight:600},onClick:e=>{r&&r(e)},"data-testid":"swap-select-token-btn",children:[(null==t?void 0:t.address)?ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Vy,{url:null==t?void 0:t.logoURI,address:null!==(n=null==t?void 0:t.address)&&void 0!==n?n:"",marginRight:6}),ne.exports.jsx(Er,{children:null!==(o=null==t?void 0:t.symbol)&&void 0!==o?o:"-"})]}):ne.exports.jsx(e.Trans,{id:"SELECT TOKEN"}),ne.exports.jsx(Er,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:i.CaretUp})]})}function Zy({onClick:t,balance:r,decimals:n,address:o,showMaxBtn:i}){const{palette:s}=vr();return ne.exports.jsxs(Er,{sx:{display:"flex",typography:"body2",color:s.text.secondary},children:[ne.exports.jsx(e.Trans,{id:"Balance:"})," ",o?ci({input:r,decimals:Math.min(n||4,4)}):"-",i&&r&&r.gt(0)&&ne.exports.jsx(Er,{component:pn,sx:{ml:6,color:(null==r?void 0:r.gt(0))?s.primary.main:s.text.disabled,cursor:o&&t?"pointer":"unset"},onClick:()=>t&&t(r?r.toString():""),children:ne.exports.jsx(e.Trans,{id:"Max"})})]})}function zy({readOnly:e,sx:t,value:r,decimals:o,onChange:s,suffix:a,withClear:c,onFocus:u,placeholder:l}){const d=vr(),h=n.useMemo((()=>a||(c&&r&&s?ne.exports.jsx(Er,{component:pn,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s&&s("")},children:ne.exports.jsx(Er,{component:i.Error,sx:{width:12,color:"text.primary"}})}):void 0)),[s,a,d.palette.text.primary,r,c]);return ne.exports.jsxs(Er,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[ne.exports.jsx(kn,{fullWidth:!0,value:r,readOnly:e,placeholder:l||"0.00",onFocus:u,onChange:e=>{const t=e.target.value,r=0===t.length?"":di(t,o);s&&s(r)},sx:{width:"inherit",border:"none","& .MuiInput-input":{fontSize:24,border:"none",outline:"none",height:24,padding:0,color:"text.primary","&::placeholder":{fontSize:24,color:"text.disabled"}}}}),!e&&r&&h]})}function Ly({open:e,onClose:t,afterClose:r,title:n,rightSlot:o,canBack:s=!0,children:a,height:c,testId:u}){return ne.exports.jsxs(Er,{sx:{position:"absolute",top:e?0:"100%",transition:"top 300ms",zIndex:1,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:c},"data-testid":u,"data-active":e?"1":"0",children:[n?ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[ne.exports.jsx(Er,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&s&&ne.exports.jsx(Er,{component:i.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>r&&r()),300)}})]}):"",a]})}const Hy=e=>(null!=e?e:Es.getState()).globals;function Yy({token:e,disabled:t,onClick:r}){return ne.exports.jsxs(Er,{sx:Object.assign({display:"inline-flex",alignItems:"center",p:8,border:"solid 1px",typography:"body2",borderRadius:8},t?{borderColor:"transparent",backgroundColor:"border.disabled",cursor:"auto"}:{borderColor:"border.main",cursor:"pointer","&:hover":{backgroundColor:"hover.default"}}),onClick:()=>{t||r()},children:[ne.exports.jsx(Vy,{token:e}),e.symbol]})}function Xy({token:e,disabled:t,style:r,onClick:n}){const o=vr(),s=jy(),{account:a}=l.useWeb3React(),c=s(e),u=c?ai({input:c}):"";return ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",px:6,py:5,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:r,onClick:()=>{t||n()},"data-testid":"token-picker-item",children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(Vy,{token:e}),ne.exports.jsxs(Er,{children:[ne.exports.jsx(Er,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),a&&ne.exports.jsx(Er,{sx:{mt:4,textAlign:"left"},children:(null==c?void 0:c.gte(0))?u:ne.exports.jsx(Er,{component:i.Loading,width:18,sx:{"& path":{fill:o.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})]}),ne.exports.jsx(Er,{sx:{color:"text.secondary",textAlign:"right"},children:e.name})]})}function Jy({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:o,showAddrs:i,visible:s,side:a}){const{showTokenList:c,filter:u,setFilter:l,onSelectToken:d,popularTokenList:h}=By({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:o,showAddrs:i,side:a}),f=n.useRef(null),[p,m]=n.useState(0);n.useEffect((()=>{s&&f.current&&m(f.current.offsetHeight-34)}),[f,s]);const g=n.useCallback((({key:t,index:r,style:n})=>{const o=!!(null==h?void 0:h.length);if(0===r&&o)return ne.exports.jsx(Er,{sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},style:Object.assign(Object.assign({},n),{visibility:n.height?"visible":"hidden",height:n.height?n.height:"auto"}),children:h.map((t=>ne.exports.jsx(Yy,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>d(t)},t.address)))},t);const i=c[o?r-1:r];return ne.exports.jsx(Xy,{token:i,disabled:!!e&&e.address===i.address,style:n,onClick:()=>d(i)},t)}),[c,h,e]),y=n.useCallback((e=>{if(0===e&&(null==h?void 0:h.length)){return 74+51*Math.floor(h.length/3)}return 52}),[h]);return ne.exports.jsxs(Er,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[ne.exports.jsx(In,{fullWidth:!0,height:48,value:u,onChange:e=>l(e.target.value),clearValue:()=>l(""),placeholder:w.i18n._("Enter the token symbol or address")}),ne.exports.jsx(Er,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:f,children:ne.exports.jsx(x.VariableSizeList,{height:p,itemCount:c.length+((null==h?void 0:h.length)?1:0),itemSize:y,width:"100%",className:"token-list",children:g},h.length)})]})}function Gy({open:t,value:r,onClose:n,occupiedAddrs:o,onTokenChange:i,side:s}){const{height:a}=c.useSelector(Hy);return ne.exports.jsx(Ly,{height:a,open:t,onClose:n,title:ne.exports.jsx(e.Trans,{id:"Select a token"}),testId:"token-picker-wrapper",children:ne.exports.jsx(Jy,{value:r,visible:t,onChange:i,occupiedAddrs:o,side:s})})}function qy({sx:e,amt:t,token:r,readOnly:o,showMaxBtn:i,onMaxClick:s,fiatPriceTxt:a,occupiedAddrs:c,onInputFocus:u,onTokenClick:l,onInputChange:d,onTokenChange:h,side:f}){const p=vr(),m=jy(),[g,y]=n.useState(!1),b=r?m(r):null;return ne.exports.jsxs(Er,{sx:Object.assign({width:"100%",minHeight:133,padding:20,borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:p.palette.background.input},e),children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[ne.exports.jsx(Py,{token:r,onClick:()=>y(!0)}),ne.exports.jsx(Zy,{balance:b,onClick:s,showMaxBtn:i,address:null==r?void 0:r.address,decimals:null==r?void 0:r.decimals})]}),ne.exports.jsx(zy,{value:t,onFocus:u,onChange:d,readOnly:o,withClear:!0}),ne.exports.jsx(Er,{sx:{mt:4,typography:"body2",color:p.palette.text.secondary},children:a}),ne.exports.jsx(Gy,{value:r,open:g,side:f,occupiedAddrs:c,onClose:()=>{y(!1),l&&l()},onTokenChange:(e,t)=>{y(!1),setTimeout((()=>h(e,t)),300)}})]})}const Ky=(e,t)=>{const r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?1==i&&11!=s?"one":2==i&&12!=s?"two":3==i&&13!=s?"few":"other":1==e&&n?"one":"other"},Qy={"en-US":Ky,"zh-CN":(e,t)=>"other",pseudo:Ky};function $y({locale:t,children:r}){return n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){yield function(e="en-US"){return ls(this,void 0,void 0,(function*(){w.i18n.loadLocaleData(e,{plurals:()=>Qy[e]});try{const r=yield(t=`./locales/${e}.js`,Promise.resolve().then((function(){return A(require(t))})));w.i18n.load(e,r.messages||r.default.messages)}catch(e){}var t;w.i18n.activate(e)}))}(t)}))})()}),[t]),ne.exports.jsx(e.I18nProvider,{i18n:w.i18n,children:r})}var eb,tb,rb;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(eb||(eb={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(tb||(tb={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(rb||(rb={}));var nb,ob=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],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:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],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:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(nb||(nb={}));const ib=(e,t)=>ls(void 0,void 0,void 0,(function*(){const{value:r,from:n,to:o,data:i}=e,s={from:n,to:o,value:r,data:i};r&&!/^0x0*$/.test(r)||delete s.value;try{return(yield t.estimateGas(s)).add(5e4)}catch(e){t.call(s).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null})),sb=(e,t)=>ls(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(w.i18n._("Transaction rejected.")):e}}));var ab,cb;!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(ab||(ab={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(cb||(cb={}));const ub=new k.default(2).pow(256).minus(1),lb=e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function db({onTxFail:e,onTxSubmit:t,onTxSuccess:r}={}){const{account:o,provider:i}=l.useWeb3React(),s=Cf(),[a,u]=n.useState(!1),[d,h]=n.useState(new Map),f=c.useDispatch(),[p,m]=n.useState(null),[g,y]=n.useState(""),[b,v]=n.useState(null),[x,E]=n.useState(!1),[A,R]=n.useState(),{updateBlockNumber:_}=Xc(),S=n.useCallback(((n,a,c,l=!1,d,p,g,b)=>ls(this,void 0,void 0,(function*(){if(y(""),m(""),!o||!i)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let x,A,S;R((()=>g)),u(!1);try{if(u(!0),a.opcode===ab.Approval)S=yield((e,t,r,n,o,i)=>ls(void 0,void 0,void 0,(function*(){const s=zc(e,ob,o,i).interface.encodeFunctionData("approve",[r,n.toFixed()]),a={from:t,to:e,data:s,value:`0x${new k.default("0").toString(16)}`,gasLimit:void 0},c=yield ib(a,o);return c&&(a.gasLimit=c),yield sb(a,o)})))(a.token.address,o,a.contract,a.amt||ub,i,o),x=S.hash,y(x);else{if(a.opcode!==ab.TX)throw new Error(`Op ${a.opcode} not implemented!`);if(""===a.to)throw new Error("Submission: malformed to");if(0===a.data.length)throw new Error("Submission: malformed data");if(0===a.data.indexOf("0x")&&a.data.length<=2)throw new Error("Submission: malformed data");if(A={value:a.value,data:a.data,to:a.to,gasLimit:a.gasLimit,from:o,chainId:s},!A.gasLimit)try{const e=yield ib(A,i);e&&(A.gasLimit=e)}catch(e){console.debug(e)}if(S=yield sb(A,i),x=S.hash,y(x),!x)throw new Error(`Unexpected tx: ${x}`)}}catch(t){if(u(!1),v({spec:a,brief:n,subtitle:c}),console.error(t),t.message){f(lb({contractStatus:gs.Failed}));const r={error:t.message,brief:n};p&&Object.assign(r,p),e&&e(t,p),m(function(e,t){var r;const n=null===(r=ss[e])||void 0===r?void 0:r.symbol,o=[{error:"insufficient",msg:w.i18n._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:n})},{error:["External Swap execution Failed","Return amount is not enough"],msg:w.i18n._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:w.i18n._("SafeERC20: low-level call failed. Please contact the DODO team.")},{error:["User denied","cancel","User rejected","user rejected"],msg:w.i18n._("User denied transaction signature.")},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:w.i18n._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:w.i18n._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:w.i18n._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:w.i18n._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:w.i18n._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:w.i18n._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:w.i18n._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:w.i18n._("Service update, please wait and try again")}];let i="";return o.some((e=>Array.isArray(e.error)?e.error.some((r=>t.indexOf(r)>-1&&(i=e.msg,!0))):t.indexOf(e.error)>-1&&(i=e.msg,!0))),i||t}(s,t.message))}return tb.Failed}v({spec:a,brief:n,subtitle:c}),E(!1),u(!1);const N=Object.assign(Object.assign(Object.assign(Object.assign({brief:n},a),A),{tx:x,subtitle:c}),p);f(lb({contractStatus:gs.Pending})),t&&t(x,N),d&&d();const M={brief:n,spec:a,tx:x,subtitle:c};if(h((e=>e.set(x,[M,eb.Running]))),l)return tb.Submitted;if(d&&d(),null==S?void 0:S.wait){const e=yield S.wait(1);if(E(!0),e.status===rb.Success)return"TX"===N.opcode&&f(lb({contractStatus:gs.TxSuccess})),"APPROVAL"===N.opcode&&f(lb({contractStatus:gs.ApproveSuccess})),b&&b(x),r&&r(x,N),yield _(),h((e=>e.set(x,[M,eb.Success]))),tb.Success}return yield _(),E(!0),h((e=>e.set(x,[M,eb.Failed]))),tb.Failed}))),[o,s,u,i,_]),N=n.useMemo((()=>({execute:S,requests:d,setShowing:v,waitingSubmit:a})),[S,d,v]),M=n.useCallback((()=>{v(null),A&&(A(),R(void 0))}),[A]);return{showing:b,showingDone:x,transactionTx:g,errorMessage:p,setErrorMessage:m,closeShowing:M,ctxVal:N,requests:d}}function hb(){const{requests:e}=pb(),t=[];return null==e||e.forEach((function([e,r]){r===eb.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const fb=n.createContext({execute:()=>Promise.resolve(tb.Canceled),requests:void 0,waitingSubmit:!1});function pb(){return n.useContext(fb)}var mb;function gb(){return gb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gb.apply(this,arguments)}var yb=function(e){return S.createElement("svg",gb({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),mb||(mb=S.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},S.createElement("g",{transform:"translate(18.000000, 291.000000)"},S.createElement("g",{transform:"translate(40.000000, 83.000000)"},S.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function bb({showingDone:e,errorMessage:t}){return t?ne.exports.jsx(Er,{component:i.ErrorWarn,sx:{width:64,height:64,color:"error.main"}}):e?ne.exports.jsx(Er,{component:i.DoneBorder,sx:{width:64,height:64,color:"success.main"}}):ne.exports.jsx(Er,{sx:{mx:"auto",border:e=>{var t;return`6px solid ${null===(t=e.palette)||void 0===t?void 0:t.background.input}`},borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:ne.exports.jsx(Er,{component:yb,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function vb({showingDone:e,showing:t}){return ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[ne.exports.jsx(Er,{sx:{mt:60},children:e?w.i18n._("{0} confirmed",{0:null==t?void 0:t.brief}):w.i18n._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?ne.exports.jsx(Er,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function wb({isStarted:t,isEnded:r,tx:o}){const[s,a]=n.useState(0),{chainId:c}=l.useWeb3React(),u=n.useMemo((()=>`https://${cs[c||1]}/tx/${o}`),[o,c]),d=n.useMemo((()=>{const e=Math.floor(s/60),t=s%60;return e?`${e}m ${t}s`:`${t}s`}),[s]),h=n.useRef();return n.useEffect((()=>(t&&(a(0),clearInterval(h.current),h.current=setInterval((()=>{a((e=>e+1))}),1e3)),()=>{clearInterval(h.current)})),[t]),n.useEffect((()=>{clearInterval(h.current)}),[r]),ne.exports.jsxs(Er,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsx(e.Trans,{id:"Transaction Time:"}),d]}),ne.exports.jsxs(On,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:u,target:"_blank",rel:"noopener noreferrer",children:[ne.exports.jsx(e.Trans,{id:"Tx"}),ne.exports.jsx(Er,{component:i.ArrowTopRightBorder,sx:{width:16,height:16,ml:6}})]})]})}function xb(t){var{children:r}=t,n=us(t,["children"]);const{ctxVal:o,showing:i,closeShowing:s,showingDone:a,errorMessage:u,transactionTx:l}=db(n),d=c.useDispatch();return ne.exports.jsxs(fb.Provider,{value:o,children:[r,ne.exports.jsx(Ly,{open:!!i,onClose:s,children:ne.exports.jsxs(Er,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsx(Er,{sx:{textAlign:"center",pt:60},children:ne.exports.jsx(bb,{showingDone:a,errorMessage:u})}),u?ne.exports.jsxs(Er,{sx:{textAlign:"center",mt:60},children:[ne.exports.jsx(Er,{children:ne.exports.jsx(e.Trans,{id:"Something went wrong."})}),ne.exports.jsx(Er,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:u})]}):ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(vb,{showingDone:a,showing:i}),ne.exports.jsx(wb,{isStarted:!!i,isEnded:a,tx:l})]})]}),ne.exports.jsx(ln,{fullWidth:!0,size:ln.Size.big,onClick:()=>{d(lb({contractStatus:gs.Initial})),s()},sx:{mt:20},children:u?ne.exports.jsx(e.Trans,{id:"Dismiss"}):ne.exports.jsx(e.Trans,{id:"Close"})})]})})]})}function Eb({token:e,fiatPrice:r}){return{marginAmount:n.useMemo((()=>{var n;const o=null!==(n=null==e?void 0:e.decimals)&&void 0!==n?n:6,i=((e,r,n)=>{const o=new t.BigNumber(e).times(new t.BigNumber(10).pow(r));return n?o:o.dp(0)})(null!=r?new k.default(500).div(r):new k.default(0),o);return(i.lt(new k.default(1).times(new k.default(10).pow(o-3)))?new k.default(0):i).toString(10)}),[null==e?void 0:e.decimals,r])}}function Ab({width:e,height:t,feeRate:r,rebateTo:o,colorMode:i,apikey:s,defaultChainId:a,defaultToToken:u,defaultFromToken:l}){const d=c.useDispatch();n.useEffect((()=>{i&&d((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(i))}),[i]),n.useEffect((()=>{var e;a&&d((e=a,t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[a]),n.useEffect((()=>{d(lb({height:t}))}),[t]),n.useEffect((()=>{d(lb({width:e}))}),[e]),n.useEffect((()=>{s&&d(lb({apikey:s}))}),[s]),n.useEffect((()=>{r&&d(lb({feeRate:r}))}),[r]),n.useEffect((()=>{o&&d(lb({rebateTo:o}))}),[o]),n.useEffect((()=>{l&&d((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(l))}),[l]),n.useEffect((()=>{u&&d((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(u))}),[u])}function Rb({refetch:e,interval:t}){let r;n.useEffect((()=>(e(),clearTimeout(r),r=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(r))),[e])}function kb({fromToken:e,toToken:t,chainId:r}){const[o,i]=n.useState(!1),{apikey:s}=c.useSelector(Hy),[a,u]=n.useState(""),[l,d]=n.useState(""),h=n.useCallback((()=>{if(!r||!e||!t)return;i(!0);const n=[e,t];I.default.post("https://api.dodoex.io/frontend-price-api/current/batch",{networks:n.map((()=>(e=>as[e]||as[ns.MAINNET])(r))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},{headers:{apikey:s}}).then((r=>{var n;i(!1);const o=null===(n=r.data)||void 0===n?void 0:n.data;o&&(u(o.find((t=>t.address===e.address)).price),d(o.find((e=>e.address===t.address)).price))})).catch((e=>{i(!1),console.error(e)}))}),[r,e,t,s]);return Rb({refetch:h}),{loading:o,refetch:h,toFiatPrice:l,fromFiatPrice:a}}const _b=e=>(null!=e?e:Es.getState()).settings.slippage,Sb=e=>(null!=e?e:Es.getState()).settings.ddl;var Nb;function Mb({toToken:e,fromToken:t,fromAmount:r,toAmount:o,marginAmount:i}){const{account:s,chainId:a,provider:u}=l.useWeb3React(),d=c.useSelector(As),h=n.useMemo((()=>a||d),[a,d]),f=c.useSelector(_b)||3,p=c.useSelector(Sb)||20,{feeRate:m,rebateTo:g,apikey:y,isReverseRouting:b}=c.useSelector(Hy),x=n.useMemo((()=>Math.floor(Date.now()/1e3)+60*p),[p]),[E,A]=n.useState(Nb.Initial),[R,k]=n.useState(null),[_,S]=n.useState(""),[N,M]=n.useState(null),[T,O]=n.useState(null),[W,F]=n.useState(null),[C,j]=n.useState(v.BigNumber.from(0)),[U,D]=n.useState(null),[B,V]=n.useState(null),[P,Z]=n.useState(""),[z,L]=n.useState(""),[H,Y]=n.useState(""),[X,J]=n.useState(0),G=n.useCallback((()=>ls(this,void 0,void 0,(function*(){if(!h||!t||!e)return;if(!b&&!r)return;if(b&&!o)return;A(Nb.Loading);const n={chainId:h,deadLine:x,apikey:y,slippage:f,source:"dodoV2AndMixWasm",toTokenAddress:e.address,toTokenDecimals:e.decimals,fromTokenAddress:t.address,fromTokenDecimals:t.decimals,userAddr:s||"0x0000000000000000000000000000000000000000"};b?n.toAmount=v.parseFixed(String(o||1),e.decimals).toString():n.fromAmount=v.parseFixed(String(r||1),t.decimals).toString(),g&&m&&(n.rebateTo=g,n.fee=m);try{const e=(yield I.default.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:n})).data.data;if((null==e?void 0:e.resAmount)?(A(Nb.Success),k(e.resAmount),F(e.priceImpact),D(e.resPricePerFromToken),V(e.resPricePerToToken),M(e.baseFeeAmount),O(e.additionalFeeAmount),Z(e.to),L(e.data),S(e.value),Y(e.useSource),J(e.duration)):A(Nb.Failed),!s||!u)return;const t=yield ib({from:s,to:e.to,value:e.value,data:e.data},u);t&&j(t)}catch(e){A(Nb.Failed),console.error(e)}}))),[x,s,h,e,m,f,g,t,u,r,o,y,b]);Rb({refetch:G});const q=n.useMemo((()=>{const e=b?o:r;return E!==Nb.Loading&&e?R:null}),[E,b,o,r,R]),K=function(){const{chainId:e,account:t}=l.useWeb3React(),r=pb(),o=n.useCallback((({to:e,data:n,useSource:o,duration:i,ddl:s,gasLimit:a,subtitle:c,value:u})=>{const l=60*s,d=u;o&&"weth"!==o.toLowerCase()&&a&&a.lt(3e4)&&console.debug("Warning: GasLimit less than the minimum!");const h={from:t,to:e,data:n,value:d,route:o,duration:i,ddlSecRel:l,gasLimit:a};r.execute(w.i18n._("Swap"),Object.assign({opcode:ab.TX},h),c)}),[t,e]);return o}(),Q=n.useCallback((e=>{t&&(b?R:r)&&K({to:P,data:z,useSource:H,duration:X,ddl:p,value:_,subtitle:e})}),[P,p,z,X,H,t,r,C,R,_,b]);return{status:E,refetch:G,priceImpact:W,executeSwap:Q,baseFeeAmount:N,resAmount:q,additionalFeeAmount:T,resPricePerToToken:B,resPricePerFromToken:U}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(Nb||(Nb={}));function Tb(e){My(e),Yc(),Xc();const{provider:t,connector:r}=l.useWeb3React();n.useEffect((()=>{const t=e.defaultChainId||1;(null==r?void 0:r.connectEagerly)?r.connectEagerly(t):r.activate(t)}),[r]),n.useEffect((()=>{const e=null==t?void 0:t.provider;e&&e.once&&e.once("chainChanged",(()=>{setTimeout((()=>{window.location.reload()}),200||100)}))}),[t]);const o=e.width||375,i=e.height||494;return Ab(Object.assign(Object.assign({},e),{width:o,height:i})),ne.exports.jsx(Er,{sx:{width:o,height:i,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:"dodo-widget-container",children:ne.exports.jsx(xb,{...e,children:e.children})})}function Ob(e){const t=function(e){for(var t=void 0===e?{}:e,n=t.mode,o=void 0===n?"light":n,i=t.lang,s=t.theme,a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];var u=Hr(o,s,i);return dr(u=a.reduce((function(e,t){return r.merge(e,t)}),u))}({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),o=n.useMemo((()=>e.defaultChainId||1),[e.defaultChainId]),i=Ff({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:o}),s=`${i.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${o}`;return ne.exports.jsx(c.Provider,{store:Es,children:ne.exports.jsx($y,{locale:e.locale,children:ne.exports.jsx(Dr,{theme:t,children:ne.exports.jsxs(l.Web3ReactProvider,{connectors:i,children:[ne.exports.jsx(Gr,{container:".dodo-widget-container"}),ne.exports.jsx(Tb,{...e})]},s)})})})}function Ib(e){const{width:t}=c.useSelector(Hy),r=n.useMemo((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return ne.exports.jsx(si,{container:document.querySelector(".dodo-widget-container"),maxWidth:r,...e})}function Wb({onClick:e}){const t=vr();return ne.exports.jsx(On,{sx:{width:"100%",position:"relative"},onClick:e,children:ne.exports.jsx(Er,{component:pn,sx:{width:36,height:36,borderRadius:"50%",backgroundColor:t.palette.background.input,border:`4px solid ${t.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)"},children:ne.exports.jsx(Er,{component:i.ArrowBack,sx:{width:18,color:"text.secondary"}})})})}function Fb({open:t,execute:r,onClose:o,toToken:s,fromToken:a,fromAmount:u,toAmount:l,priceImpact:d,clearFromAmt:h,clearToAmt:f,baseFeeAmount:p,curToFiatPrice:m,curFromFiatPrice:g,pricePerFromToken:y,additionalFeeAmount:b}){var v,w;const x=vr(),E=c.useSelector(_b),A=c.useDispatch(),{contractStatus:R}=c.useSelector(Hy),_=n.useMemo((()=>new k.default(d).gt(15)),[d]),[S,N]=n.useState(!1),[M,T]=n.useState(!1);return n.useEffect((()=>{R!==gs.Pending&&o(),R===gs.TxSuccess&&(f(),h())}),[R]),n.useEffect((()=>{N(!1)}),[m]),ne.exports.jsx(Ly,{open:t,onClose:()=>{A(lb({contractStatus:gs.Initial})),o()},title:ne.exports.jsx(e.Trans,{id:"Swap summary"}),children:ne.exports.jsxs(Er,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${x.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${x.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[ne.exports.jsx(Vy,{width:16,height:16,url:null==a?void 0:a.logoURI,address:null!==(v=null==a?void 0:a.address)&&void 0!==v?v:"",marginRight:6}),ne.exports.jsx(Er,{children:`${ci({input:u,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`})]}),ne.exports.jsx(Er,{sx:{mt:4,typography:"h6",color:x.palette.text.secondary},children:g?`$${ai({input:g,showDecimals:1})}`:"-"})]}),ne.exports.jsx(Er,{sx:{width:16,mx:16},component:i.DoubleRight}),ne.exports.jsxs(Er,{children:[ne.exports.jsxs(Er,{sx:{display:"flex"},children:[ne.exports.jsx(Vy,{width:16,height:16,marginRight:6,url:null==s?void 0:s.logoURI,address:null!==(w=null==s?void 0:s.address)&&void 0!==w?w:""}),ne.exports.jsx(Er,{children:`${ci({input:l,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsx(Er,{sx:{typography:"h6",mt:4,color:x.palette.text.secondary},children:m?`$${ai({input:m,showDecimals:1})}(${d}%)`:"-"})]})]}),ne.exports.jsx(Er,{sx:{mt:12,typography:"h6"},children:`1 ${null==a?void 0:a.symbol} = ${ci({input:new k.default(l).dividedBy(new k.default(u)),decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsxs(Er,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${x.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:x.palette.text.secondary},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(Er,{sx:{width:16,mr:7},component:i.DetailBorder}),ne.exports.jsx(e.Trans,{id:"Swap Detail"})]}),ne.exports.jsx(Er,{component:pn,children:ne.exports.jsx(Er,{onClick:()=>T(!M),sx:{width:10,color:"text.secondary",transform:M?"rotateX(0deg)":"rotateX(180deg)"},component:i.CaretUp})})]}),ne.exports.jsxs(Er,{sx:{mt:16,display:M?"initial":"none"},children:[ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Basic Fee"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Estimated service provider fees"}),ml:5})]}),ne.exports.jsx(Er,{children:`${ci({input:p,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Additional Fee"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),ne.exports.jsx(Er,{children:`${ci({input:b,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Price Impact"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),ne.exports.jsx(Er,{children:`${d}%`})]}),ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Slippage"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),ne.exports.jsx(Er,{children:E})]})]})]}),ne.exports.jsx(Er,{sx:{flex:1}}),_&&ne.exports.jsxs(Er,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>N(!S),children:[ne.exports.jsx(Er,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:S?ne.exports.jsx(Er,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:ne.exports.jsx(Er,{component:i.Done,sx:{width:14,color:"#1a1a1b"}})}):ne.exports.jsx(Er,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${x.palette.text.secondary}`}})}),ne.exports.jsx(Er,{children:ne.exports.jsx(e.Trans,{components:{0:ne.exports.jsx(Er,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:d},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),ne.exports.jsx(ln,{isLoading:R==gs.Pending,disabled:_&&!S,fullWidth:!0,onClick:()=>{r(),A(lb({contractStatus:gs.Pending}))},children:R==gs.Pending?ne.exports.jsx(e.Trans,{id:"Confirming"}):ne.exports.jsx(e.Trans,{id:"Confirm swap"})})]})})}function Cb(e){var{sx:r,maxVal:n,decimals:o=2,onInputChange:i}=e,s=us(e,["sx","maxVal","decimals","onInputChange"]);return vr(),ne.exports.jsx(kn,{...s,onChange:e=>{const r=0===e.target.value.length?null:di(e.target.value,o),s=n&&r&&new t.BigNumber(r).gt(n)?n.toString():r;console.log("finalVal:",s),i&&i(s)}})}function jb({open:t,onClose:r}){const o=vr(),i=c.useDispatch(),s=c.useSelector(_b),a=c.useSelector(Sb),u=n.useMemo((()=>Number(s)>=50),[s]);return ne.exports.jsx(Ly,{open:t,onClose:r,title:ne.exports.jsx(e.Trans,{id:"Settings"}),children:ne.exports.jsxs(Er,{sx:{mx:20},children:[ne.exports.jsxs(Er,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{mb:16,display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Slippage Tolerance"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),ne.exports.jsxs(Er,{sx:{display:"flex",flexDirection:"column"},children:[ne.exports.jsx(Cb,{fullWidth:!0,maxVal:100,value:s,placeholder:3..toString(),onInputChange:e=>{i((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:ne.exports.jsx(Er,{sx:{color:"text.disabled"},children:"%"}),height:36}),u&&ne.exports.jsx(Er,{sx:{typography:"h6",mt:6,color:"error.main"},children:ne.exports.jsx(e.Trans,{id:"Maximum slippage do not exceed 50%"})})]})]}),ne.exports.jsxs(Er,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{mb:16,display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Transaction Deadline"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),ne.exports.jsx(Cb,{value:a,fullWidth:!0,height:36,placeholder:w.i18n._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{i((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function Ub({toToken:t,fromToken:r,priceStatus:o,pricePerToToken:s,pricePerFromToken:a}){const[c,u]=n.useState("-"),[l,d]=n.useState(null),[h,f]=n.useState("-"),[p,m]=n.useState(null);n.useEffect((()=>{u(null==r?void 0:r.symbol),f(null==t?void 0:t.symbol),d(s),m(a)}),[r,t,s,a]);const g=n.useCallback((()=>{u(h),f(c),d(p),m(l)}),[c,l,h,p]);return ne.exports.jsx(Er,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[Nb.Initial]:"-",[Nb.Loading]:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Wn,{sx:{mr:5}}),ne.exports.jsx(e.Trans,{id:"Fetching best price..."})]}),[Nb.Failed]:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Er,{component:i.Warn,sx:{width:15,mr:5,color:"warning.main"}}),ne.exports.jsx(e.Trans,{id:"Quote not available"})]}),[Nb.Success]:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Er,{sx:{typography:"body2"},children:`1 ${c} = ${ai({input:p,showDecimals:4})} ${h}`}),ne.exports.jsx(Er,{component:pn,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:ne.exports.jsx(Er,{sx:{width:16,color:"text.secondary"},onClick:g,component:i.Switch})})]})}[o]})}function Db({open:t,onClose:r}){const n=c.useSelector(As);return ne.exports.jsx(Ly,{title:ne.exports.jsx(e.Trans,{id:"Connect to your wallet"}),open:t,onClose:r,children:ne.exports.jsx(Er,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(If).map((t=>ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",flexDirection:"column",mt:20,p:20,backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:()=>{!function(e,t,r){var n;const o=Wf[e];if(!o)throw new Error(`Unknown wallet type: ${e}`);const[i]=o;null===(n=i.activate(t))||void 0===n||n.catch((e=>{4001!==e.code?r(e):i.connectEagerly?i.connectEagerly(t):i.activate(t)}))}(t.type,n,(e=>{console.error(e)}))},children:[ne.exports.jsx(Er,{component:t.icon,sx:{width:32,height:32}}),ne.exports.jsx(Er,{sx:{mt:8,typography:"caption"},children:t.name}),ne.exports.jsx(Er,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:ne.exports.jsx(e.Trans,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function Bb(){const{connector:t}=l.useWeb3React(),[r,o]=n.useState(!1);return ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(ln,{size:ln.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),o(!0)},"data-testid":"connect-wallet-btn",children:ne.exports.jsx(e.Trans,{id:"Connect to a wallet"})}),ne.exports.jsx(Db,{open:r,onClose:()=>o(!1)})]})}const Vb=({account:e,chainId:t,offset:r,contractAddress:o})=>{var i;const s=c.useSelector(As),a=n.useMemo((()=>{var e;return Ws[null!==(e=t)&&void 0!==e?e:s]}),[t]),{isETH:u}=n.useMemo((()=>rs(t)),[t]),{DODO_APPROVE:d}=a||{},h=null!==(i=null!=o?o:d)&&void 0!==i?i:null,f=function(e){const{account:t}=l.useWeb3React(),r=c.useSelector(As),o=c.useSelector(Oy),i=n.useMemo((()=>ss[r]),[r]),s=n.useCallback((r=>{var n;if(!t||!e)return null;if(r.symbol===i.symbol&&ts(r.address,i.address))return new k.default(ub);const s=null===(n=null==o?void 0:o[r.address.toLowerCase()])||void 0===n?void 0:n.tokenAllowances;return null!=s?s:null}),[t,e,i.symbol,i.address,o]);return s}(h),p=jy(),{runningRequests:m}=hb(),g=c.useSelector(Cy),y=n.useMemo((()=>{var e;return null===(e=ss[null!=t?t:s])||void 0===e?void 0:e.address}),[t]),b=n.useCallback(((t,n,o)=>{if(!t)return Gc.Loading;const i=!!(null==m?void 0:m.find((e=>e.spec.opcode===ab.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),s=null!=o?o:t?p(t):null,a=t?f(t):null,c=new k.default(null!=n?n:0);if(!e)return Gc.Unchecked;if(!s||c.minus(null!=r?r:0).gt(s))return Gc.Unchecked;if(c.isZero())return Gc.Unchecked;return t.address===y?Gc.Sufficient:i?Gc.Approving:a&&c.minus(null!=r?r:0).gt(a)?Gc.Insufficient:Gc.Sufficient}),[p,f,e,r,h,t,g,m,y]),v=n.useCallback((e=>{const t=e?f(e):null;return("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)}),[f]),x=pb(),E=c.useDispatch(),A=n.useCallback(((t,r)=>ls(void 0,void 0,void 0,(function*(){if(!h||!e||!t)return;const n=(e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t})(t),o=r?new k.default(0):void 0,i=r?w.i18n._("Reset"):w.i18n._("Approve");var s;(yield x.execute(`${i} ${n}`,{opcode:ab.Approval,token:t,contract:h,amt:o}))===tb.Success&&E((s=null!=o?o:ub,e=>ls(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:s})}))))}))),[h,e,t,x,E]),R=n.useCallback((e=>{const t=new k.default(0);if(!e)return t.toString();const r=p(e);if(!r)return t.toString();let n=r;const o=u?.1:.02;return y===(null==e?void 0:e.address)&&(n=r.gt(o)?r.minus(o):t),n.toString()}),[t,p,u]);return{getApprovalState:b,getPendingRest:v,getMaxBalance:R,submitApprove:A}};function Pb(){var t,o;const s=vr(),{isInflight:a}=hb(),{chainId:u,account:d}=l.useWeb3React(),h=c.useDispatch(),{isReverseRouting:f}=c.useSelector(Hy),p=c.useSelector(As),m=c.useSelector(Fy),g=c.useSelector(Wy),{isETH:y}=n.useMemo((()=>rs(u)),[u]),b=n.useMemo((()=>{var e;return null===(e=ss[null!=u?u:p])||void 0===e?void 0:e.address}),[u]),[v,w]=n.useState(""),[x,E]=n.useState(""),[A,R]=n.useState(""),[_,S]=n.useState(""),N=n.useMemo((()=>r.debounce((e=>R(e)),1e3)),[]),M=n.useMemo((()=>r.debounce((e=>S(e)),1e3)),[]),[T,O]=n.useState(null),[I,W]=n.useState(null),[F,C]=n.useState(!1),[j,U]=n.useState(!1),{toFiatPrice:D,fromFiatPrice:B}=kb({chainId:u,toToken:I,fromToken:T}),V=jy(),P=n.useMemo((()=>T?V(T):null),[T,V]);n.useMemo((()=>I?V(I):null),[I,V]);const{getApprovalState:Z,submitApprove:z,getPendingRest:L,getMaxBalance:H}=Vb({account:d,chainId:u}),Y=n.useMemo((()=>L(f?I:T)),[null==T?void 0:T.address,null==I?void 0:I.address,L,f]),{marginAmount:X}=Eb({token:f?I:T,fiatPrice:f?D:B}),{resAmount:J,priceImpact:G,executeSwap:q,baseFeeAmount:K,additionalFeeAmount:Q,resPricePerToToken:$,resPricePerFromToken:ee,status:te}=Mb({toToken:I,fromToken:T,marginAmount:X,fromAmount:A,toAmount:_}),re=n.useCallback((e=>{const t=e.toString();w(t),N(t)}),[w,N]),oe=n.useCallback((e=>{const t=e.toString();E(t),M(t)}),[E,M]),ie=c.useSelector(Ty),se=()=>{let e=null;T||g&&g.chainId===u||ie.some((t=>!(t.chainId!==u||t.side&&"from"!==t.side)&&(e=t,O(t),!0))),I||m&&m.chainId===u||ie.some((t=>!(t.chainId!==u||e&&e.address===t.address||t.side&&"to"!==t.side)&&(W(t),!0)))};n.useEffect((()=>{u&&(W(null),O(null),f?oe(""):re("")),g&&g.chainId===u&&(O(g),g.amount&&(h(lb({isReverseRouting:!1})),re(g.amount))),m&&m.chainId===u&&(W(m),m.amount&&g&&!g.amount&&(h(lb({isReverseRouting:!0})),oe(m.amount))),se()}),[m,g,u,re,oe]),n.useEffect((()=>{se()}),[ie]);const ae=n.useCallback((()=>{re(""),oe(""),O(I),W(T)}),[O,I,W,T,re,oe]),ce=n.useCallback((e=>f?oe(H(I)):re(H(T))),[re,oe,H,T,I,f]),ue=n.useMemo((()=>(100*Number(G)).toFixed(2)),[G]),le=n.useMemo((()=>{const e=f?J:A;return e&&B?new k.default(B).multipliedBy(e):null}),[B,A,f,J]),de=n.useMemo((()=>{const e=f?_:J;return e&&D?new k.default(D).multipliedBy(e):null}),[D,_,f,J]),he=n.useMemo((()=>ne.exports.jsxs(Er,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),ne.exports.jsxs(Er,{sx:{display:"flex"},children:[ne.exports.jsx(e.Trans,{id:"Current price impact"}),ne.exports.jsxs(Er,{sx:{color:s.palette.error.main,ml:4},children:[ue,"%"]})]})]})),[ue]),fe=n.useMemo((()=>ne.exports.jsx(Ub,{toToken:I,fromToken:T,priceStatus:te,pricePerToToken:$,pricePerFromToken:ee})),[I,T,te,$,ee]),pe=n.useMemo((()=>!ns[u||1]),[u]),me=n.useMemo((()=>te===Nb.Loading?ne.exports.jsx(Er,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Wn,{sx:{mr:5}}),ne.exports.jsx(e.Trans,{id:"Fetching best price..."})]})}):pe?ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Er,{component:i.Warn,sx:{mr:6,width:16,color:"warning.main"}}),ne.exports.jsx(e.Trans,{id:"Unsupported network - switch to trade"})]}):v&&new k.default(ue).gt(15)?he:fe),[te,fe,v,he,ue,pe]),ge=n.useMemo((()=>f?new k.default(x).gt(0)?ci({input:J,decimals:null==T?void 0:T.decimals}):"-":v),[v,x,J,T,f]),ye=n.useMemo((()=>f?x:new k.default(v).gt(0)?ci({input:J,decimals:null==I?void 0:I.decimals}):"-"),[v,x,J,I,f]),be=n.useMemo((()=>{const t=Z(T,f?J||0:A),r=t===Gc.Approving,n=t===Gc.Insufficient&&!Y,o=y?.1:.02,i=b===(null==T?void 0:T.address),s=new k.default(P||0);return d?a?ne.exports.jsx(ln,{fullWidth:!0,isLoading:!0,disabled:!0,children:ne.exports.jsx(e.Trans,{id:"Transaction Pending"})}):T&&I?n?ne.exports.jsx(ln,{fullWidth:!0,disabled:r,onClick:()=>z(T),children:r?ne.exports.jsx(e.Trans,{id:"Approving"}):ne.exports.jsx(e.Trans,{id:"Approve"})}):new k.default(f?_:A).gt(0)?te===Nb.Loading?ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:ne.exports.jsx(e.Trans,{id:"Fetching Price..."})}):J&&te!==Nb.Failed?s.lt(f?J:A)||i&&s.lte(o)?ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:ne.exports.jsx(e.Trans,{id:"Insufficient balance"})}):ne.exports.jsx(ln,{fullWidth:!0,onClick:()=>C(!0),"data-testid":"swap-review-btn",children:ne.exports.jsx(e.Trans,{id:"Review Swap"})}):ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,children:ne.exports.jsx(e.Trans,{id:"Quote not available"})}):ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:ne.exports.jsx(e.Trans,{id:"Enter an amount"})}):ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:ne.exports.jsx(e.Trans,{id:"Select Tokens"})}):ne.exports.jsx(Bb,{})}),[y,d,_,A,I,J,T,a,q,Y,z,te,P,Z,b,f]),ve=n.useMemo((()=>T&&I?ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(Vy,{token:T,sx:{width:16,height:16,mr:6}}),`${ci({input:f?J:A,decimals:null==T?void 0:T.decimals})} ${null==T?void 0:T.symbol}`,ne.exports.jsx(Er,{component:i.DoubleRight,sx:{width:12,height:12,mx:16}}),ne.exports.jsx(Vy,{token:I,sx:{width:16,height:16,mr:6}}),`${ci({input:f?_:J,decimals:null==I?void 0:I.decimals})} ${null==I?void 0:I.symbol}`]}):ne.exports.jsx(Er,{})),[T,I,A,_,J,f]);return ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsxs(Er,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[ne.exports.jsx(e.Trans,{id:"Swap"}),ne.exports.jsx(Er,{component:pn,children:ne.exports.jsx(Er,{component:i.Setting,onClick:()=>U(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),ne.exports.jsxs(Er,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsx(qy,{sx:{mb:4},token:T,side:"from",amt:ge,onMaxClick:ce,onInputChange:re,onInputFocus:()=>{f&&re(""),h(lb({isReverseRouting:!1}))},showMaxBtn:!f&&!v,occupiedAddrs:[null!==(t=null==I?void 0:I.address)&&void 0!==t?t:""],fiatPriceTxt:le?`$${ai({input:le,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return ae();re(""),oe(""),O(e)},readOnly:f}),ne.exports.jsx(Wb,{onClick:ae}),ne.exports.jsx(qy,{token:I,side:"to",amt:ye,onInputChange:oe,onInputFocus:()=>{f||oe(""),h(lb({isReverseRouting:!0}))},occupiedAddrs:[null!==(o=null==T?void 0:T.address)&&void 0!==o?o:""],fiatPriceTxt:de?`$${ai({input:de,showDecimals:1})}(${ue}%)`:"-",onTokenChange:(e,t)=>{if(t)return ae();re(""),oe(""),W(e)},readOnly:!f}),ne.exports.jsx(Er,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:me})]}),be,ne.exports.jsxs(Er,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:s.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[ne.exports.jsx(Er,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:s.palette.text.disabled}},component:i.Dodo}),ne.exports.jsx(e.Trans,{id:"Powered by DODO protocol"})]})]}),ne.exports.jsx(Fb,{toToken:I,fromToken:T,fromAmount:f?J:A,toAmount:f?_:J,open:F,baseFeeAmount:K,priceImpact:ue,additionalFeeAmount:Q,curToFiatPrice:de,execute:()=>q(ve),clearFromAmt:()=>re(""),clearToAmt:()=>oe(""),curFromFiatPrice:le,pricePerFromToken:ee,onClose:()=>C(!1)}),ne.exports.jsx(jb,{open:j,onClose:()=>U(!1)})]})}var Zb,zb=T.default;if("production"===process.env.NODE_ENV)Zb=zb.createRoot,zb.hydrateRoot;else{var Lb=zb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Zb=function(e,t){Lb.usingClientEntryPoint=!0;try{return zb.createRoot(e,t)}finally{Lb.usingClientEntryPoint=!1}}}exports.InitSwapWidget=function(e){const t=document.getElementById("dodo-swap-widget");Zb(t).render(ne.exports.jsx(Ob,{...e,children:ne.exports.jsx(Pb,{})}))},exports.SwapWidget=function(e){return ne.exports.jsx(Ob,{...e,children:ne.exports.jsx(Pb,{})})};
|
|
44
|
+
*/!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=W:o&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&e.exports,s=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),c=[4,1024,262144,67108864],u=[0,8,16,24],l=[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],d=[224,256,384,512],h=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,r){return function(n){return new T(e,t,e).update(n)[r]()}},g=function(e,t,r){return function(n,o){return new T(e,t,o).update(n)[r]()}},y=function(e,t,r){return function(t,n,o,i){return E["cshake"+e].update(t,n,o,i)[r]()}},b=function(e,t,r){return function(t,n,o,i){return E["kmac"+e].update(t,n,o,i)[r]()}},v=function(e,t,r,n){for(var o=0;o<f.length;++o){var i=f[o];e[i]=t(r,n,i)}return e},w=function(e,t){var r=m(e,t,"hex");return r.create=function(){return new T(e,t,e)},r.update=function(e){return r.create().update(e)},v(r,m,e,t)},x=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(e,t){var r=g(e,t,"hex");return r.create=function(r){return new T(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},v(r,g,e,t)}},{name:"cshake",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=y(e,0,"hex");return n.create=function(n,o,i){return o||i?new T(e,t,n).bytepad([o,i],r):E["shake"+e].create(n)},n.update=function(e,t,r,o){return n.create(t,r,o).update(e)},v(n,y,e,t)}},{name:"kmac",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=b(e,0,"hex");return n.create=function(n,o,i){return new O(e,t,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(e,t,r,o){return n.create(e,r,o).update(t)},v(n,b,e,t)}}],E={},A=[],R=0;R<x.length;++R)for(var k=x[R],_=k.bits,S=0;S<_.length;++S){var N=k.name+"_"+_[S];if(A.push(N),E[N]=k.createMethod(_[S],k.padding),"sha3"!==k.name){var M=k.name+_[S];A.push(M),E[M]=E[N]}}function T(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function O(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var o,i,a=this.blocks,c=this.byteCount,l=e.length,d=this.blockCount,h=0,f=this.s;h<l;){if(this.reset)for(this.reset=!1,a[0]=this.block,o=1;o<d+1;++o)a[o]=0;if(r)for(o=this.start;h<l&&o<c;++h)a[o>>2]|=e[h]<<u[3&o++];else for(o=this.start;h<l&&o<c;++h)(i=e.charCodeAt(h))<128?a[o>>2]|=i<<u[3&o++]:i<2048?(a[o>>2]|=(192|i>>6)<<u[3&o++],a[o>>2]|=(128|63&i)<<u[3&o++]):i<55296||i>=57344?(a[o>>2]|=(224|i>>12)<<u[3&o++],a[o>>2]|=(128|i>>6&63)<<u[3&o++],a[o>>2]|=(128|63&i)<<u[3&o++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),a[o>>2]|=(240|i>>18)<<u[3&o++],a[o>>2]|=(128|i>>12&63)<<u[3&o++],a[o>>2]|=(128|i>>6&63)<<u[3&o++],a[o>>2]|=(128|63&i)<<u[3&o++]);if(this.lastByteIndex=o,o>=c){for(this.start=o-c,this.block=a[d],o=0;o<d;++o)f[o]^=a[o];I(f),this.reset=!0}else this.start=o}return this},T.prototype.encode=function(e,t){var r=255&e,n=1,o=[r];for(r=255&(e>>=8);r>0;)o.unshift(r),r=255&(e>>=8),++n;return t?o.push(n):o.unshift(n),this.update(o),o.length},T.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var o=0,i=e.length;if(r)o=i;else for(var a=0;a<e.length;++a){var c=e.charCodeAt(a);c<128?o+=1:c<2048?o+=2:c<55296||c>=57344?o+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++a)),o+=4)}return o+=this.encode(8*o),this.update(e),o},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var o=t-r%t,i=[];return i.length=o,this.update(i),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];I(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,c="";s<n;){for(i=0;i<t&&s<n;++i,++s)e=r[i],c+=a[e>>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(I(r),i=0)}return o&&(e=r[i],c+=a[e>>4&15]+a[15&e],o>1&&(c+=a[e>>12&15]+a[e>>8&15]),o>2&&(c+=a[e>>20&15]+a[e>>16&15])),c},T.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,a=this.outputBits>>3;e=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<n;){for(i=0;i<t&&s<n;++i,++s)c[s]=r[i];s%t==0&&I(r)}return o&&(c[i]=r[i],e=e.slice(0,a)),e},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,s=0,a=0,c=[];a<o;){for(s=0;s<r&&a<o;++s,++a)e=a<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r==0&&I(n)}return i&&(e=a<<2,t=n[s],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},O.prototype=new T,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var I=function(e){var t,r,n,o,i,s,a,c,u,d,h,f,p,m,g,y,b,v,w,x,E,A,R,k,_,S,N,M,T,O,I,W,F,C,j,U,D,B,V,P,Z,z,L,H,Y,X,J,G,q,K,Q,$,ee,te,re,ne,oe,ie,se,ae,ce,ue,le;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(c<<1|u>>>31),r=i^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(d<<1|h>>>31),r=a^(h<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(f<<1|p>>>31),r=u^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(o<<1|i>>>31),r=h^(i<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],X=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,T=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,L=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,j=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,G=e[22]<<10|e[23]>>>22,q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,K=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,W=e[45]<<29|e[44]>>>3,F=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,_=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,V=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,P=e[38]<<8|e[39]>>>24,Z=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,R=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=k^~S&M,e[11]=_^~N&T,e[20]=C^~U&B,e[21]=j^~D&V,e[30]=H^~X&G,e[31]=Y^~J&q,e[40]=te^~ne&ie,e[41]=re^~oe&se,e[2]=y^~v&x,e[3]=b^~w&E,e[12]=S^~M&O,e[13]=N^~T&I,e[22]=U^~B&P,e[23]=D^~V&Z,e[32]=X^~G&K,e[33]=J^~q&Q,e[42]=ne^~ie&ae,e[43]=oe^~se&ce,e[4]=v^~x&A,e[5]=w^~E&R,e[14]=M^~O&W,e[15]=T^~I&F,e[24]=B^~P&z,e[25]=V^~Z&L,e[34]=G^~K&$,e[35]=q^~Q&ee,e[44]=ie^~ae&ue,e[45]=se^~ce&le,e[6]=x^~A&m,e[7]=E^~R&g,e[16]=O^~W&k,e[17]=I^~F&_,e[26]=P^~z&C,e[27]=Z^~L&j,e[36]=K^~$&H,e[37]=Q^~ee&Y,e[46]=ae^~ue&te,e[47]=ce^~le&re,e[8]=A^~m&y,e[9]=R^~g&b,e[18]=W^~k&S,e[19]=F^~_&N,e[28]=z^~C&U,e[29]=L^~j&D,e[38]=$^~H&X,e[39]=ee^~Y&J,e[48]=ue^~te&ne,e[49]=le^~re&oe,e[0]^=l[n],e[1]^=l[n+1]};if(i)e.exports=E;else for(R=0;R<A.length;++R)n[A[R]]=E[A[R]]}()}(Bi);var Vi=Bi.exports;function Pi(e){return"0x"+Vi.keccak_256(Ni(e))}const Zi=new xi("rlp/5.7.0");function zi(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Li(e,t,r){let n=0;for(let o=0;o<r;o++)n=256*n+e[t+o];return n}function Hi(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(Hi(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=zi(t.length);return r.unshift(247+r.length),r.concat(t)}ki(e)||Zi.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(Ni(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=zi(t.length);return r.unshift(183+r.length),r.concat(t)}function Yi(e){return Ii(Hi(e))}function Xi(e,t,r,n){const o=[];for(;r<t+1+n;){const i=Ji(e,r);o.push(i.result),(r+=i.consumed)>t+1+n&&Zi.throwError("child data too short",xi.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function Ji(e,t){if(0===e.length&&Zi.throwError("data too short",xi.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&Zi.throwError("data short segment too short",xi.errors.BUFFER_OVERRUN,{});const n=Li(e,t+1,r);return t+1+r+n>e.length&&Zi.throwError("data long segment too short",xi.errors.BUFFER_OVERRUN,{}),Xi(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&Zi.throwError("data array too short",xi.errors.BUFFER_OVERRUN,{}),Xi(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&Zi.throwError("data array too short",xi.errors.BUFFER_OVERRUN,{});const n=Li(e,t+1,r);t+1+r+n>e.length&&Zi.throwError("data array too short",xi.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:Ii(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&Zi.throwError("data too short",xi.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:Ii(e.slice(t+1,t+1+r))}}return{consumed:1,result:Ii(e[t])}}function Gi(e){const t=Ni(e),r=Ji(t,0);return r.consumed!==t.length&&Zi.throwArgumentError("invalid rlp data","data",e),r.result}const qi=new xi("address/5.7.0");function Ki(e){Oi(e,20)||qi.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=Ni(Pi(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Qi={};for(let e=0;e<10;e++)Qi[String(e)]=String(e);for(let e=0;e<26;e++)Qi[String.fromCharCode(65+e)]=String(10+e);const $i=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function es(e){let t=null;if("string"!=typeof e&&qi.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Ki(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&qi.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Qi[e])).join("");for(;t.length>=$i;){let e=t.substring(0,$i);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&qi.throwArgumentError("bad icap checksum","address",e),t=v._base36To16(e.substring(4));t.length<40;)t="0"+t;t=Ki("0x"+t)}else qi.throwArgumentError("invalid address","address",e);return t}const ts=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const r=e.substring(2,e.length).toLowerCase(),n=t.substring(2,t.length).toLowerCase();return r.length>n.length?r.endsWith(n):n.endsWith(r)};const rs=e=>{const t={isMainnet:1===e,isRinkeby:4===e,isGor:5===e};return Object.assign(Object.assign({},t),{isETH:t.isMainnet||t.isRinkeby||t.isGor})};var ns;!function(e){e[e.MAINNET=1]="MAINNET",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.HECO=128]="HECO",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_RINKEBY=421611]="ARBITRUM_RINKEBY",e[e.AURORA=1313161554]="AURORA",e[e.MOONRIVER=1285]="MOONRIVER",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.BOBA=288]="BOBA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CRONOS=25]="CRONOS"}(ns||(ns={}));const os={[ns.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[ns.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[ns.GOERLI]:["https://goerli.optimism.io/"],[ns.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org","https://bsc-dataseed4.binance.org","https://bsc-dataseed1.defibit.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed3.defibit.io","https://bsc-dataseed4.defibit.io","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.ninicoin.io","https://bsc-dataseed3.ninicoin.io","https://bsc-dataseed4.ninicoin.io","https://bsc-dataseed.binance.org","https://rpc.ankr.com/bsc","https://bscrpc.com","https://bsc.mytokenpocket.vip","https://binance.nodereal.io","https://rpc-bsc.bnb48.club"],[ns.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[ns.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.matic.network","https://matic-mainnet.chainstacklabs.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://matic-mainnet-full-rpc.bwarelabs.com","https://matic-mainnet-archive-rpc.bwarelabs.com","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon","https://polygon-mainnet.public.blastapi.io"],[ns.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[ns.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[ns.AURORA]:["https://mainnet.aurora.dev/"],[ns.MOONRIVER]:["https://rpc.api.moonriver.moonbeam.network","https://moonriver.api.onfinality.io/rpc?apikey=673e1fae-c9c9-4c7f-a3d5-2121e8274366","https://moonriver.api.onfinality.io/public","https://moonriver.public.blastapi.io"],[ns.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[ns.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[ns.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[ns.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[ns.CRONOS]:["https://evm.cronos.org","https://cronos-rpc.heavenswail.one","https://evm-cronos.crypto.org","https://cronosrpc-1.xstaking.sg","https://cronos-rpc.elk.finance"]},is={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},ss={[ns.MAINNET]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[ns.RINKEBY]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[ns.GOERLI]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[ns.OPTIMISM]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[ns.CRONOS]:Object.assign(Object.assign({},is),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[ns.BOBA]:Object.assign(Object.assign({},is),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[ns.BSC]:Object.assign(Object.assign({},is),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[ns.OKCHAIN]:Object.assign(Object.assign({},is),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[ns.HECO]:Object.assign(Object.assign({},is),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[ns.POLYGON]:Object.assign(Object.assign({},is),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[ns.MOONRIVER]:Object.assign(Object.assign({},is),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[ns.ARBITRUM_ONE]:Object.assign(Object.assign({},is),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[ns.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},is),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[ns.AURORA]:Object.assign(Object.assign({},is),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[ns.AVALANCHE]:Object.assign(Object.assign({},is),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},as={[ns.MAINNET]:"ethereum",[ns.RINKEBY]:"rinkeby",[ns.GOERLI]:"goerli",[ns.OPTIMISM]:"optimism",[ns.CRONOS]:"cronos",[ns.BOBA]:"boba",[ns.BSC]:"bsc",[ns.OKCHAIN]:"okex-chain",[ns.HECO]:"heco",[ns.POLYGON]:"polygon",[ns.MOONRIVER]:"moonriver",[ns.ARBITRUM_ONE]:"arbitrum",[ns.ARBITRUM_RINKEBY]:"arb-rinkeby",[ns.AURORA]:"aurora",[ns.AVALANCHE]:"avalanche"},cs={[ns.MAINNET]:"etherscan.io",[ns.RINKEBY]:"rinkeby.etherscan.io",[ns.GOERLI]:"goerli.etherscan.io",[ns.OPTIMISM]:"optimistic.etherscan.io",[ns.CRONOS]:"cronoscan.com",[ns.BOBA]:"blockexplorer.boba.network",[ns.BSC]:"bscscan.com",[ns.OKCHAIN]:"www.oklink.com/okexchain",[ns.HECO]:"hecoinfo.com",[ns.POLYGON]:"polygonscan.com",[ns.MOONRIVER]:"moonriver.moonscan.io",[ns.ARBITRUM_ONE]:"arbiscan.io",[ns.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[ns.AURORA]:"aurorascan.dev",[ns.AVALANCHE]:"snowtrace.io"};function us(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function ls(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}const ds={colorMode:"dark",slippage:3..toString(),ddl:20};var hs=(e=ds,t)=>{switch(t.type){case"SET_COLOR_MODE":return Object.assign(Object.assign({},e),{colorMode:t.payload});case"SET_SLIPPAGE":return Object.assign(Object.assign({},e),{slippage:t.payload});case"SET_TRANSACTION_DDL":return Object.assign(Object.assign({},e),{ddl:t.payload});default:return e}};const fs={chainId:ns.MAINNET,latestBlockNumber:0};var ps=(e=fs,t)=>{switch(t.type){case"SET_CHAIN_ID":return Object.assign(Object.assign({},e),{chainId:t.payload});case"SET_BLOCK_NUMBER":return Object.assign(Object.assign({},e),{latestBlockNumber:t.payload});default:return e}};const ms={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var gs,ys=(e=ms,t)=>{switch(t.type){case"SET_TOKEN_LIST":return Object.assign(Object.assign({},e),{tokenList:t.payload});case"SET_POPULAR_TOKEN_LIST":return Object.assign(Object.assign({},e),{popularTokenList:t.payload});case"SET_SLIPPAGE_WITH_TOKENS":return Object.assign(Object.assign({},e),{slippageWithTokens:t.payload});case"SET_ETH_BALANCE":return Object.assign(Object.assign({},e),{ethBalance:t.payload});case"SET_DEFAULT_FROM_TOKEN":return Object.assign(Object.assign({},e),{defaultFromToken:t.payload});case"SET_DEFAULT_TO_TOKEN":return Object.assign(Object.assign({},e),{defaultToToken:t.payload});case"SET_ACCOUNT_BALANCES":return Object.assign(Object.assign({},e),{accountBalances:Object.assign(Object.assign({},e.accountBalances),t.payload)});case"SET_ACCOUNT_ALLOWANCES":const r=e.accountBalances;return Object.keys(r).map((e=>{r[e].tokenAllowances=t.payload})),Object.assign(Object.assign({},e),{accountBalances:r});case"SET_BALANCE_LOADINGS":return Object.assign(Object.assign({},e),{balanceLoadings:Object.assign(Object.assign({},e.balanceLoadings),t.payload)});default:return e}};!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(gs||(gs={}));const bs={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:gs.Initial};var vs=(e=bs,t)=>"SET_GLOBAL_PROPS"===t.type?Object.assign(Object.assign({},e),t.payload):e;const ws={settings:ds,wallet:fs,globals:bs,token:ms},xs=h.combineReducers({settings:hs,wallet:ps,token:ys,globals:vs}),Es=d.configureStore({reducer:xs,middleware:e=>e({serializableCheck:{ignoredActions:["SET_ACCOUNT_BALANCES","SET_ETH_BALANCE"],ignoredPaths:["token.accountBalances","token.ethBalance"]}}),preloadedState:ws}),As=e=>(null!=e?e:Es.getState()).wallet.chainId,Rs=e=>(null!=e?e:Es.getState()).wallet.latestBlockNumber,ks=e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),_s=e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})})),Ss="0x0000000000000000000000000000000000000000",Ns=v.BigNumber.from(-1),Ms=v.BigNumber.from(0),Ts=v.BigNumber.from(1),Os=v.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Is=[{constant:!0,inputs:[],name:"getCurrentBlockTimestamp",outputs:[{name:"timestamp",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{components:[{name:"target",type:"address"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{name:"blockNumber",type:"uint256"},{name:"returnData",type:"bytes[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getLastBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockDifficulty",outputs:[{name:"difficulty",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockGasLimit",outputs:[{name:"gaslimit",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockCoinbase",outputs:[{name:"coinbase",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],Ws={[ns.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[ns.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[ns.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[ns.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[ns.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[ns.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[ns.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[ns.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[ns.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[ns.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[ns.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[ns.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[ns.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[ns.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[ns.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};var Fs=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Cs=new xi("properties/5.7.0");function js(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function Us(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Ds(e){return Fs(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function Bs(e){const t={};for(const r in e)t[r]=e[r];return t}const Vs={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Ps(e){if(null==e||Vs[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!Ps(n))return!1}return!0}return Cs.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Zs(e){if(Ps(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>zs(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&js(t,r,zs(n))}return t}return Cs.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function zs(e){return Zs(e)}class Ls{constructor(e){for(const t in e)this[t]=zs(e[t])}}const Hs=new xi("abi/5.7.0"),Ys={};let Xs={calldata:!0,memory:!0,storage:!0},Js={calldata:!0,memory:!0};function Gs(e,t){if("bytes"===e||"string"===e){if(Xs[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Js[t])return!0;return(Xs[t]||"payable"===t)&&Hs.throwArgumentError("invalid modifier","name",t),!1}function qs(e,t){for(let r in t)js(e,r,t[r])}const Ks=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Qs=new RegExp(/^(.*)\[([0-9]*)\]$/);class $s{constructor(e,t){e!==Ys&&Hs.throwError("use fromString",xi.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),qs(this,t);let r=this.type.match(Qs);qs(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:$s.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ks.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ks.full?", ":",")+")"):t+=this.type,e!==Ks.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ks.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?$s.fromString(e,t):$s.fromObject(e)}static fromObject(e){return $s.isParamType(e)?e:new $s(Ys,{name:e.name||null,type:la(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map($s.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Hs.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},s=i;for(let r=0;r<e.length;r++){let i=e[r];switch(i){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=la(s.type),s.components=[o(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Gs(s.type,s.name)&&(s.name=""),s.type=la(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Gs(s.type,s.name)&&(s.name=""),s.type=la(s.type);let a=o(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=la(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Gs(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=i,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=i,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=i,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=i,delete s.state.allowArray):s.state.readArray?s.type+=i:n(r)}}return s.parent&&Hs.throwArgumentError("unexpected eof","param",e),delete i.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Gs(s.type,s.name)&&(s.name=""),i.type=la(i.type),i}(e,!!t),$s.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function ea(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];","===i&&0===n?(t.push(r),r=""):(r+=i,"("===i?n++:")"===i&&(n--,-1===n&&Hs.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>$s.fromString(e,t)))}class ta{constructor(e,t){e!==Ys&&Hs.throwError("use a static from method",xi.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),qs(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return ta.isFragment(e)?e:"string"==typeof e?ta.fromString(e):ta.fromObject(e)}static fromObject(e){if(ta.isFragment(e))return e;switch(e.type){case"function":return aa.fromObject(e);case"event":return ra.fromObject(e);case"constructor":return sa.fromObject(e);case"error":return ua.fromObject(e);case"fallback":case"receive":return null}return Hs.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?ra.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?aa.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?sa.fromString(e.trim()):"error"===e.split(" ")[0]?ua.fromString(e.substring(5).trim()):Hs.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class ra extends ta{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ks.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ",e!==Ks.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?ra.fromString(e):ra.fromObject(e)}static fromObject(e){if(ra.isEventFragment(e))return e;"event"!==e.type&&Hs.throwArgumentError("invalid event object","value",e);const t={name:ha(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map($s.fromObject):[],type:"event"};return new ra(Ys,t)}static fromString(e){let t=e.match(fa);t||Hs.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:Hs.warn("unknown modifier: "+e)}})),ra.fromObject({name:t[1].trim(),anonymous:r,inputs:ea(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function na(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Hs.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Hs.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=v.BigNumber.from(r[1]),r[0]):e}function oa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function ia(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Hs.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Hs.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Hs.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Hs.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Hs.throwArgumentError("unable to determine stateMutability","value",e),t}class sa extends ta{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Ks.sighash&&Hs.throwError("cannot format a constructor for sighash",xi.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?sa.fromString(e):sa.fromObject(e)}static fromObject(e){if(sa.isConstructorFragment(e))return e;"constructor"!==e.type&&Hs.throwArgumentError("invalid constructor object","value",e);let t=ia(e);t.constant&&Hs.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map($s.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?v.BigNumber.from(e.gas):null};return new sa(Ys,r)}static fromString(e){let t={type:"constructor"},r=(e=na(e,t)).match(fa);return r&&"constructor"===r[1].trim()||Hs.throwArgumentError("invalid constructor string","value",e),t.inputs=ea(r[2].trim(),!1),oa(r[3].trim(),t),sa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class aa extends sa{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ks.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ",e!==Ks.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?aa.fromString(e):aa.fromObject(e)}static fromObject(e){if(aa.isFunctionFragment(e))return e;"function"!==e.type&&Hs.throwArgumentError("invalid function object","value",e);let t=ia(e);const r={type:e.type,name:ha(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map($s.fromObject):[],outputs:e.outputs?e.outputs.map($s.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?v.BigNumber.from(e.gas):null};return new aa(Ys,r)}static fromString(e){let t={type:"function"},r=(e=na(e,t)).split(" returns ");r.length>2&&Hs.throwArgumentError("invalid function string","value",e);let n=r[0].match(fa);if(n||Hs.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&ha(t.name),t.inputs=ea(n[2],!1),oa(n[3].trim(),t),r.length>1){let n=r[1].match(fa);""==n[1].trim()&&""==n[3].trim()||Hs.throwArgumentError("unexpected tokens","value",e),t.outputs=ea(n[2],!1)}else t.outputs=[];return aa.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function ca(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Hs.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class ua extends ta{format(e){if(e||(e=Ks.sighash),Ks[e]||Hs.throwArgumentError("invalid format type","format",e),e===Ks.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ks.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ks.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?ua.fromString(e):ua.fromObject(e)}static fromObject(e){if(ua.isErrorFragment(e))return e;"error"!==e.type&&Hs.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:ha(e.name),inputs:e.inputs?e.inputs.map($s.fromObject):[]};return ca(new ua(Ys,t))}static fromString(e){let t={type:"error"},r=e.match(fa);return r||Hs.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&ha(t.name),t.inputs=ea(r[2],!1),ca(ua.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function la(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const da=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function ha(e){return e&&e.match(da)||Hs.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const fa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const pa=new xi("abi/5.7.0");class ma{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){pa.throwArgumentError(e,this.localName,t)}}class ga{constructor(e){js(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Ci(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Mi(e._data))}writeBytes(e){let t=Ni(e);const r=t.length%this.wordSize;return r&&(t=Mi([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Ni(v.BigNumber.from(e));return t.length>this.wordSize&&pa.throwError("value out-of-bounds",xi.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Mi([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class ya{constructor(e,t,r,n){js(this,"_data",Ni(e)),js(this,"wordSize",t||32),js(this,"_coerceFunc",r),js(this,"allowLoose",n),this._offset=0}get data(){return Ii(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):ya.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:pa.throwError("data out-of-bounds",xi.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new ya(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return v.BigNumber.from(this.readBytes(this.wordSize))}}class ba extends ma{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=es(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return es(Ui(e.readValue().toHexString(),20))}}class va extends ma{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const wa=new xi("abi/5.7.0");function xa(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||wa.throwError("cannot encode object for signature with missing names",xi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&wa.throwError("cannot encode object for signature with duplicate names",xi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else wa.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&wa.throwArgumentError("types/value length mismatch","tuple",r);let o=new ga(e.wordSize),i=new ga(e.wordSize),s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(o,r)})),s.forEach((e=>{e(o.length)}));let a=e.appendWriter(o);return a+=e.appendWriter(i),a}function Ea(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),i=n.subReader(r.toNumber());try{o=t.decode(i)}catch(e){if(e.code===xi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(e.code===xi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}null!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class Aa extends ma{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),wa.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return xa(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&wa.throwError("insufficient data length",xi.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new va(this.coder));return e.coerce(this.name,Ea(e,r))}}class Ra extends ma{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class ka extends ma{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Ni(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class _a extends ka{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Ii(super.decode(e)))}}class Sa extends ma{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=Ni(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,Ii(e.readBytes(this.size)))}}class Na extends ma{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class Ma extends ma{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=v.BigNumber.from(t),n=Os.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(Ts).mul(Ns)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Ms)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const Ta=new xi("strings/5.7.0");var Oa,Ia;function Wa(e,t,r,n,o){if(e===Ia.BAD_PREFIX||e===Ia.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===Ia.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Oa||(Oa={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Ia||(Ia={}));const Fa=Object.freeze({error:function(e,t,r,n,o){return Ta.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Wa,replace:function(e,t,r,n,o){return e===Ia.OVERLONG?(n.push(o),0):(n.push(65533),Wa(e,t,r))}});function Ca(e,t){null==t&&(t=Fa.error),e=Ni(e);const r=[];let n=0;for(;n<e.length;){const o=e[n++];if(o>>7==0){r.push(o);continue}let i=null,s=null;if(192==(224&o))i=1,s=127;else if(224==(240&o))i=2,s=2047;else{if(240!=(248&o)){n+=t(128==(192&o)?Ia.UNEXPECTED_CONTINUE:Ia.BAD_PREFIX,n-1,e,r);continue}i=3,s=65535}if(n-1+i>=e.length){n+=t(Ia.OVERRUN,n-1,e,r);continue}let a=o&(1<<8-i-1)-1;for(let o=0;o<i;o++){let o=e[n];if(128!=(192&o)){n+=t(Ia.MISSING_CONTINUE,n,e,r),a=null;break}a=a<<6|63&o,n++}null!==a&&(a>1114111?n+=t(Ia.OUT_OF_RANGE,n-1-i,e,r,a):a>=55296&&a<=57343?n+=t(Ia.UTF16_SURROGATE,n-1-i,e,r,a):a<=s?n+=t(Ia.OVERLONG,n-1-i,e,r,a):r.push(a))}return r}function ja(e,t=Oa.current){t!=Oa.current&&(Ta.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const o=e.charCodeAt(t);if(t>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&o);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Ni(r)}function Ua(e,t){return Ca(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class Da extends ka{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,ja(t))}decode(e){return Ua(super.decode(e))}}class Ba extends ma{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return xa(e,this.coders,t)}decode(e){return e.coerce(this.name,Ea(e,this.coders))}}const Va=new xi("abi/5.7.0"),Pa=new RegExp(/^bytes([0-9]*)$/),Za=new RegExp(/^(u?int)([0-9]*)$/);const za=new class{constructor(e){js(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new ba(e.name);case"bool":return new Ra(e.name);case"string":return new Da(e.name);case"bytes":return new _a(e.name);case"array":return new Aa(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Ba((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Na(e.name)}let t=e.type.match(Za);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&Va.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Ma(r/8,"int"===t[1],e.name)}if(t=e.type.match(Pa),t){let r=parseInt(t[1]);return(0===r||r>32)&&Va.throwArgumentError("invalid bytes length","param",e),new Sa(r,e.name)}return Va.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new ya(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new ga(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder($s.from(e))));return new Ba(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Va.throwError("types/values length mismatch",xi.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder($s.from(e)))),n=new Ba(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this._getCoder($s.from(e))));return new Ba(n,"_").decode(this._getReader(Ni(t),r))}};function La(e){return Pi(ja(e))}function Ha(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return Ni(t)}function Ya(e){e=Ni(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Xa(e,t){null==t&&(t=1);const r=[],n=r.forEach,o=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function Ja(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,i=[0,1];for(let e=1;e<n;e++)i.push(o+=r());let s=r(),a=t;t+=s;let c=0,u=0;function l(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const d=Math.pow(2,31),h=d>>>1,f=h>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|l();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*o-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<i[n]?r=n:t=n}if(0==t)break;g.push(t);let s=y+Math.floor(b*i[t]/o),a=y+Math.floor(b*i[t+1]/o)-1;for(;0==((s^a)&h);)m=m<<1&p|l(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&f;)m=m&h|m<<1&p>>>1|l(),s=s<<1^h,a=(a^h)<<1|h|1;y=s,b=1+a-s}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function Ga(e){return 1&e?~e>>1:e>>1}function qa(e,t){let r=Array(e);for(let n=0,o=-1;n<e;n++)r[n]=o+=1+t();return r}function Ka(e,t){let r=Array(e);for(let n=0,o=0;n<e;n++)r[n]=o+=Ga(t());return r}function Qa(e,t){let r=qa(e(),e),n=e(),o=qa(n,e),i=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<i[e];t++)r.push(o[e]+t);return t?r.map((e=>t[e])):r}function $a(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;o<t;o++)Ka(e,r).forEach(((e,t)=>n[t].push(e)));return n}function ec(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return Xa($a(o.length,1+e,t).map(((e,t)=>{const i=e[0],s=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[i+t*r,s.map((e=>e+o))]}))})))}function tc(e,t){return $a(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const rc=Ja(Ha("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),nc=new Set(Qa(rc)),oc=new Set(Qa(rc)),ic=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(ec(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(tc(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(Xa(t))}(rc),sc=function(e){let t=Qa(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let o=Qa(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),i=o%3;o=o/3|0;let s=!!(1&o);return o>>=1,{branches:n,valid:i,fe0f:s,save:1==o,check:2==o}}()}(rc);function ac(e){return function(e,t=Oa.current){return Ca(ja(e,t))}(e)}function cc(e){return e.filter((e=>65039!=e))}function uc(e){for(let t of e.split(".")){let e=ac(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function lc(e){return uc(function(e,t){let r=ac(e).reverse(),n=[];for(;r.length;){let e=dc(r);if(e){n.push(...t(e));continue}let o=r.pop();if(nc.has(o)){n.push(o);continue}if(oc.has(o))continue;let i=ic[o];if(!i)throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`);n.push(...i)}return uc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,cc))}function dc(e,t){var r;let n,o,i=sc,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(i=null===(r=i.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!i)break;if(i.save)o=c;else if(i.check&&c===o)break;s.push(c),i.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),i.valid&&(n=s.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}const hc=new xi("hash/5.7.0"),fc=new Uint8Array(32);function pc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function mc(e){const t=ja(lc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(pc(t.slice(n,e))),n=e+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(pc(t.slice(n))),r}function gc(e){"string"!=typeof e&&hc.throwArgumentError("invalid ENS name; not a string","name",e);let t=fc;const r=mc(e);for(;r.length;)t=Pi(Mi([t,Pi(r.pop())]));return Ii(t)}fc.fill(0);var yc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const bc=new xi("hash/5.7.0"),vc=new Uint8Array(32);vc.fill(0);const wc=v.BigNumber.from(-1),xc=v.BigNumber.from(0),Ec=v.BigNumber.from(1),Ac=v.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Rc=Ui(Ec.toHexString(),32),kc=Ui(xc.toHexString(),32),_c={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Sc=["name","version","chainId","verifyingContract","salt"];function Nc(e){return function(t){return"string"!=typeof t&&bc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Mc={name:Nc("name"),version:Nc("version"),chainId:function(e){try{return v.BigNumber.from(e).toString()}catch(e){}return bc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return es(e).toLowerCase()}catch(e){}return bc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Ni(e);if(32!==t.length)throw new Error("bad length");return Ii(t)}catch(e){}return bc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Tc(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&bc.throwArgumentError("invalid numeric width","type",e);const o=Ac.mask(r?n-1:n),i=r?o.add(Ec).mul(wc):xc;return function(t){const r=v.BigNumber.from(t);return(r.lt(i)||r.gt(o))&&bc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Ui(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&bc.throwArgumentError("invalid bytes width","type",e),function(t){return Ni(t).length!==r&&bc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Ni(e),r=t.length%32;return r?Ci([t,vc.slice(r)]):Ii(t)}(t)}}}switch(e){case"address":return function(e){return Ui(es(e),32)};case"bool":return function(e){return e?Rc:kc};case"bytes":return function(e){return Pi(e)};case"string":return function(e){return La(e)}}return null}function Oc(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Ic{constructor(e){js(this,"types",Object.freeze(zs(e))),js(this,"_encoderCache",{}),js(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const o={};e[n].forEach((i=>{o[i.name]&&bc.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&bc.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);Tc(s)||(r[s]||bc.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?bc.throwArgumentError("missing primary type","types",e):o.length>1&&bc.throwArgumentError(`ambiguous primary types or unused types: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),js(this,"primaryType",o[0]),function o(i,s){s[i]&&bc.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e),s[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(o(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[i]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=Oc(t,e[t])+r.map((t=>Oc(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Tc(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&bc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(Pi)),Pi(Ci(o))}}const r=this.types[e];if(r){const t=La(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?Pi(n):n}));return n.unshift(t),Ci(n)}}return bc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||bc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Pi(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Tc(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&bc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{}):bc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Ic(e)}static getPrimaryType(e){return Ic.from(e).primaryType}static hashStruct(e,t,r){return Ic.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=_c[r];n||bc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>Sc.indexOf(e.name)-Sc.indexOf(t.name))),Ic.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return Ci(["0x1901",Ic.hashDomain(e),Ic.from(t).hash(r)])}static hash(e,t,r){return Pi(Ic.encode(e,t,r))}static resolveNames(e,t,r,n){return yc(this,void 0,void 0,(function*(){e=Bs(e);const o={};e.verifyingContract&&!Oi(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=Ic.from(t);i.visit(r,((e,t)=>("address"!==e||Oi(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){Ic.hashDomain(e);const n={},o=[];Sc.forEach((t=>{const r=e[t];null!=r&&(n[t]=Mc[t](r),o.push({name:t,type:_c[t]}))}));const i=Ic.from(t),s=Bs(t);return s.EIP712Domain?bc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=o,i.encode(r),{types:s,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return Ii(Ni(t));if(e.match(/^u?int/))return v.BigNumber.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&bc.throwArgumentError("invalid string","value",t),t}return bc.throwArgumentError("unsupported type","type",e)}))}}}const Wc=new xi("abi/5.7.0");class Fc extends Ls{}class Cc extends Ls{}class jc extends Ls{}class Uc extends Ls{static isIndexed(e){return!(!e||!e._isIndexed)}}const Dc={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Bc(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class Vc{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,js(this,"fragments",t.map((e=>ta.from(e))).filter((e=>null!=e))),js(this,"_abiCoder",Us(new.target,"getAbiCoder")()),js(this,"functions",{}),js(this,"errors",{}),js(this,"events",{}),js(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Wc.warn("duplicate definition - constructor"):void js(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?Wc.warn("duplicate definition - "+r):t[r]=e})),this.deploy||js(this,"deploy",sa.from({payable:!1,type:"constructor"})),js(this,"_isInterface",!0)}format(e){e||(e=Ks.full),e===Ks.sighash&&Wc.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ks.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return za}static getAddress(e){return es(e)}static getSighash(e){return Fi(La(e.format()),0,4)}static getEventTopic(e){return La(e.format())}getFunction(e){if(Oi(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Wc.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?Wc.throwArgumentError("no matching function","name",t):r.length>1&&Wc.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[aa.fromString(e).format()];return t||Wc.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Oi(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Wc.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?Wc.throwArgumentError("no matching event","name",t):r.length>1&&Wc.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[ra.fromString(e).format()];return t||Wc.throwArgumentError("no matching event","signature",e),t}getError(e){if(Oi(e)){const t=Us(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Wc.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?Wc.throwArgumentError("no matching error","name",t):r.length>1&&Wc.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[aa.fromString(e).format()];return t||Wc.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return Us(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Us(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=Ni(t);return Ii(r.slice(0,4))!==this.getSighash(e)&&Wc.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Ii(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Ii(Mi([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Ni(t);return Ii(r.slice(0,4))!==this.getSighash(e)&&Wc.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ii(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ii(Mi([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Ni(t),n=null,o="",i=null,s=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=Ii(r.slice(0,4)),t=Dc[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.signature,t.reason&&(n=i[0]),"Error"===s?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===s&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.format()}catch(e){}break}}return Wc.throwError("call revert exception"+o,xi.errors.CALL_EXCEPTION,{method:e.format(),data:Ii(t),errorArgs:i,errorName:s,errorSignature:a,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ii(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Wc.throwError("too many arguments for "+e.format(),xi.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?La(t):"bytes"===e.type?Pi(Ii(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=v.BigNumber.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Ui(Ii(t),32));for(t.forEach(((t,o)=>{let i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?Wc.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>n(i,e)))):r.push(n(i,t)):null!=t&&Wc.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Wc.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const s=t[i];if(e.indexed)if("string"===e.type)r.push(La(s));else if("bytes"===e.type)r.push(Pi(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),o.push(s)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Oi(r[0],32)&&r[0].toLowerCase()===t||Wc.throwError("fragment/topic mismatch",xi.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push($s.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let s=null!=r?this._abiCoder.decode(n,Mi(r)):null,a=this._abiCoder.decode(o,t,!0),c=[],u=0,l=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==s)c[t]=new Uc({_isIndexed:!0,hash:null});else if(i[t])c[t]=new Uc({_isIndexed:!0,hash:s[l++]});else try{c[t]=s[l++]}catch(e){c[t]=e}else try{c[t]=a[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw Bc(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e<c.length;e++){const t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:()=>{throw Bc(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Cc({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:v.BigNumber.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Fc({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Ii(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new jc({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}function Pc(e,t,...r){return ls(this,void 0,void 0,(function*(){const n=[];for(const e of r)for(const t of e)t.callData&&n.push(t.callData);const o=yield function(e,t,r){return ls(this,void 0,void 0,(function*(){const n=yield Zc(e,t,r),o=new Map;for(const{req:e,resp:t}of n)o.set(e,t);return e.map((e=>({req:e,resp:o.get(e)})))}))}(n,e,t),i=new Map;for(const{req:e,resp:t}of o)i.set(e,null==t?void 0:t.result);return r.map((e=>e.filter((e=>!e.callData||i.get(e.callData))).map(((e,t)=>e.processor(e.callData?i.get(e.callData):null,t)))))}))}function Zc(e,t,n){return ls(this,void 0,void 0,(function*(){let o=[e];e.length>800&&(o=r.chunk(e,800));let i=[];const s=o.map((e=>ls(this,void 0,void 0,(function*(){const r=e.map((e=>[e.to,e.data])),o={data:t.interface.encodeFunctionData("aggregate",[r]),to:n};let s;try{s=yield t.provider.call(o)}catch(r){const o=e.length;if(o>20){const r=Math.floor(o/2),[s,a]=yield Promise.all([Zc(e.slice(0,r),t,n),Zc(e.slice(r,o),t,n)]);i=[...i,...s,...a]}else{const e="[sendCallReqs] error";console.error(e,r)}}if(void 0===s)throw new Error("Unexpected batch result");const[a,c]=za.decode(["uint256","bytes[]"],s);if(e.length!==c.length)throw new Error("Unexpected length mismatch");return c.map(((t,r)=>({resp:{result:t},req:e[r]})))}))));return(yield Promise.allSettled(s)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{i=[...i,...e]})),i}))}function zc(e,t,r,n){if(!function(e){try{return es(e)}catch(e){return!1}}(e)||e===Ss)throw Error(`Invalid 'address' parameter '${e}'.`);return new f.Contract(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(r,n))}function Lc(){const{provider:e,account:t,chainId:r}=l.useWeb3React(),[o,i]=n.useState(!1),s=n.useMemo((()=>Ws[r]),[r]),a=n.useCallback(((r,n)=>{if(e)return zc(r,n,e,t)}),[e,t]),c=n.useCallback((e=>{if(!s)return;const{MULTI_CALL:t}=s,r=a(t,Is);return(()=>ls(this,void 0,void 0,(function*(){if(r){i(!0);try{const[n]=yield Pc(r,t,e);return n}catch(e){console.error("Contract: useMultiContract is error",e)}i(!1)}})))()}),[s,a]);return{getContract:a,contractConfig:s,call:c,loading:o}}var Hc=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"isERC20",outputs:[{internalType:"bool",name:"isOk",type:"bool"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"judgeERC20",outputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"}];function Yc(){const{provider:e,account:t}=l.useWeb3React(),r=c.useDispatch(),o=c.useSelector(Rs);n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBalance(t);r((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_ETH_BALANCE",payload:e})})))(new k.default(n.toString()).div(1e18)))}))})()}),[e,t,r,o])}function Xc(){const{provider:e,chainId:t}=l.useWeb3React(),r=c.useDispatch(),o=n.useCallback((()=>ls(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBlockNumber();r((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(n))}))),[e,t]);return{updateBlockNumber:o}}var Jc,Gc;!function(e){e.All="all",e.Default="default",e.Coingecko="coingecko"}(Jc||(Jc={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(Gc||(Gc={}));var qc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Kc=new xi("abstract-provider/5.7.0");class Qc extends Ls{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class $c{constructor(){Kc.checkAbstract(new.target,$c),js(this,"_isProvider",!0)}getFeeData(){return qc(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield Ds({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=v.BigNumber.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}const eu=new xi("networks/5.7.1");function tu(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const i=new t.PocketProvider(e,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],i=new t.AnkrProvider(e,r.ankr);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return tu(e)},t}function ru(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return ru(e,t)},r}const nu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:tu("homestead")},ou={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:tu("ropsten")},iu={chainId:63,name:"classicMordor",_defaultProvider:ru("https://www.ethercluster.com/mordor","classicMordor")},su={unspecified:{chainId:0,name:"unspecified"},homestead:nu,mainnet:nu,morden:{chainId:2,name:"morden"},ropsten:ou,testnet:ou,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:tu("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:tu("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:tu("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:tu("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ru("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:iu,classicTestnet:iu,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ru("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:tu("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:tu("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"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};class au{constructor(e){js(this,"alphabet",e),js(this,"base",e.length),js(this,"_alphabetMap",{}),js(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=Ni(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let o=n;for(let e=0;e<t.length;++e)o+=t[e]*this.base,t[e]=255&o,o>>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return Ni(new Uint8Array(t.reverse()))}}new au("abcdefghijklmnopqrstuvwxyz234567");const cu=new au("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var uu={},lu={},du=hu;function hu(e,t){if(!e)throw new Error(t||"Assertion failed")}hu.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var fu,pu={exports:{}},mu={exports:{}};!function(e){try{var t=require("util");if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(fu||(fu=1,"function"==typeof Object.create?mu.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:mu.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),mu.exports)}}(pu);var gu=du,yu=pu.exports;function bu(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function vu(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function wu(e){return 1===e.length?"0"+e:e}function xu(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}lu.inherits=yu,lu.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):bu(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},lu.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=wu(e[r].toString(16));return t},lu.htonl=vu,lu.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=vu(o)),r+=xu(o.toString(16))}return r},lu.zero2=wu,lu.zero8=xu,lu.join32=function(e,t,r,n){var o=r-t;gu(o%4==0);for(var i=new Array(o/4),s=0,a=t;s<i.length;s++,a+=4){var c;c="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],i[s]=c>>>0}return i},lu.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},lu.rotr32=function(e,t){return e>>>t|e<<32-t},lu.rotl32=function(e,t){return e<<t|e>>>32-t},lu.sum32=function(e,t){return e+t>>>0},lu.sum32_3=function(e,t,r){return e+t+r>>>0},lu.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},lu.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},lu.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,s=(i<n?1:0)+r+o;e[t]=s>>>0,e[t+1]=i},lu.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},lu.sum64_lo=function(e,t,r,n){return t+n>>>0},lu.sum64_4_hi=function(e,t,r,n,o,i,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+i>>>0)<i?1:0,e+r+o+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},lu.sum64_4_lo=function(e,t,r,n,o,i,s,a){return t+n+i+a>>>0},lu.sum64_5_hi=function(e,t,r,n,o,i,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+i>>>0)<i?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+o+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},lu.sum64_5_lo=function(e,t,r,n,o,i,s,a,c,u){return t+n+i+a+u>>>0},lu.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},lu.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},lu.shr64_hi=function(e,t,r){return e>>>r},lu.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var Eu={},Au=lu,Ru=du;function ku(){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}Eu.BlockHash=ku,ku.prototype.update=function(e,t){if(e=Au.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=Au.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},ku.prototype.digest=function(e){return this.update(this._pad()),Ru(null===this.pending),this._digest(e)},ku.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n};var _u={},Su={},Nu=lu.rotr32;function Mu(e,t,r){return e&t^~e&r}function Tu(e,t,r){return e&t^e&r^t&r}function Ou(e,t,r){return e^t^r}Su.ft_1=function(e,t,r,n){return 0===e?Mu(t,r,n):1===e||3===e?Ou(t,r,n):2===e?Tu(t,r,n):void 0},Su.ch32=Mu,Su.maj32=Tu,Su.p32=Ou,Su.s0_256=function(e){return Nu(e,2)^Nu(e,13)^Nu(e,22)},Su.s1_256=function(e){return Nu(e,6)^Nu(e,11)^Nu(e,25)},Su.g0_256=function(e){return Nu(e,7)^Nu(e,18)^e>>>3},Su.g1_256=function(e){return Nu(e,17)^Nu(e,19)^e>>>10};var Iu=lu,Wu=Eu,Fu=Su,Cu=Iu.rotl32,ju=Iu.sum32,Uu=Iu.sum32_5,Du=Fu.ft_1,Bu=Wu.BlockHash,Vu=[1518500249,1859775393,2400959708,3395469782];function Pu(){if(!(this instanceof Pu))return new Pu;Bu.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Iu.inherits(Pu,Bu);var Zu=Pu;Pu.blockSize=512,Pu.outSize=160,Pu.hmacStrength=80,Pu.padLength=64,Pu.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Cu(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var u=~~(n/20),l=Uu(Cu(o,5),Du(u,i,s,a),c,r[n],Vu[u]);c=a,a=s,s=Cu(i,30),i=o,o=l}this.h[0]=ju(this.h[0],o),this.h[1]=ju(this.h[1],i),this.h[2]=ju(this.h[2],s),this.h[3]=ju(this.h[3],a),this.h[4]=ju(this.h[4],c)},Pu.prototype._digest=function(e){return"hex"===e?Iu.toHex32(this.h,"big"):Iu.split32(this.h,"big")};var zu=lu,Lu=Eu,Hu=Su,Yu=du,Xu=zu.sum32,Ju=zu.sum32_4,Gu=zu.sum32_5,qu=Hu.ch32,Ku=Hu.maj32,Qu=Hu.s0_256,$u=Hu.s1_256,el=Hu.g0_256,tl=Hu.g1_256,rl=Lu.BlockHash,nl=[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 ol(){if(!(this instanceof ol))return new ol;rl.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=nl,this.W=new Array(64)}zu.inherits(ol,rl);var il=ol;ol.blockSize=512,ol.outSize=256,ol.hmacStrength=192,ol.padLength=64,ol.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Ju(tl(r[n-2]),r[n-7],el(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],d=this.h[7];for(Yu(this.k.length===r.length),n=0;n<r.length;n++){var h=Gu(d,$u(c),qu(c,u,l),this.k[n],r[n]),f=Xu(Qu(o),Ku(o,i,s));d=l,l=u,u=c,c=Xu(a,h),a=s,s=i,i=o,o=Xu(h,f)}this.h[0]=Xu(this.h[0],o),this.h[1]=Xu(this.h[1],i),this.h[2]=Xu(this.h[2],s),this.h[3]=Xu(this.h[3],a),this.h[4]=Xu(this.h[4],c),this.h[5]=Xu(this.h[5],u),this.h[6]=Xu(this.h[6],l),this.h[7]=Xu(this.h[7],d)},ol.prototype._digest=function(e){return"hex"===e?zu.toHex32(this.h,"big"):zu.split32(this.h,"big")};var sl=lu,al=il;function cl(){if(!(this instanceof cl))return new cl;al.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sl.inherits(cl,al);var ul=cl;cl.blockSize=512,cl.outSize=224,cl.hmacStrength=192,cl.padLength=64,cl.prototype._digest=function(e){return"hex"===e?sl.toHex32(this.h.slice(0,7),"big"):sl.split32(this.h.slice(0,7),"big")};var ll=lu,dl=Eu,hl=du,fl=ll.rotr64_hi,pl=ll.rotr64_lo,ml=ll.shr64_hi,gl=ll.shr64_lo,yl=ll.sum64,bl=ll.sum64_hi,vl=ll.sum64_lo,wl=ll.sum64_4_hi,xl=ll.sum64_4_lo,El=ll.sum64_5_hi,Al=ll.sum64_5_lo,Rl=dl.BlockHash,kl=[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 _l(){if(!(this instanceof _l))return new _l;Rl.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=kl,this.W=new Array(160)}ll.inherits(_l,Rl);var Sl=_l;function Nl(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function Ml(e,t,r,n,o,i){var s=t&n^~t&i;return s<0&&(s+=4294967296),s}function Tl(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function Ol(e,t,r,n,o,i){var s=t&n^t&i^n&i;return s<0&&(s+=4294967296),s}function Il(e,t){var r=fl(e,t,28)^fl(t,e,2)^fl(t,e,7);return r<0&&(r+=4294967296),r}function Wl(e,t){var r=pl(e,t,28)^pl(t,e,2)^pl(t,e,7);return r<0&&(r+=4294967296),r}function Fl(e,t){var r=fl(e,t,14)^fl(e,t,18)^fl(t,e,9);return r<0&&(r+=4294967296),r}function Cl(e,t){var r=pl(e,t,14)^pl(e,t,18)^pl(t,e,9);return r<0&&(r+=4294967296),r}function jl(e,t){var r=fl(e,t,1)^fl(e,t,8)^ml(e,t,7);return r<0&&(r+=4294967296),r}function Ul(e,t){var r=pl(e,t,1)^pl(e,t,8)^gl(e,t,7);return r<0&&(r+=4294967296),r}function Dl(e,t){var r=fl(e,t,19)^fl(t,e,29)^ml(e,t,6);return r<0&&(r+=4294967296),r}function Bl(e,t){var r=pl(e,t,19)^pl(t,e,29)^gl(e,t,6);return r<0&&(r+=4294967296),r}_l.blockSize=1024,_l.outSize=512,_l.hmacStrength=192,_l.padLength=128,_l.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=Dl(r[n-4],r[n-3]),i=Bl(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=jl(r[n-30],r[n-29]),u=Ul(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=wl(o,i,s,a,c,u,l,d),r[n+1]=xl(o,i,s,a,c,u,l,d)}},_l.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],i=this.h[2],s=this.h[3],a=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],d=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],y=this.h[14],b=this.h[15];hl(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=y,x=b,E=Fl(d,h),A=Cl(d,h),R=Nl(d,h,f,p,m),k=Ml(d,h,f,p,m,g),_=this.k[v],S=this.k[v+1],N=r[v],M=r[v+1],T=El(w,x,E,A,R,k,_,S,N,M),O=Al(w,x,E,A,R,k,_,S,N,M);w=Il(n,o),x=Wl(n,o),E=Tl(n,o,i,s,a),A=Ol(n,o,i,s,a,c);var I=bl(w,x,E,A),W=vl(w,x,E,A);y=m,b=g,m=f,g=p,f=d,p=h,d=bl(u,l,T,O),h=vl(l,l,T,O),u=a,l=c,a=i,c=s,i=n,s=o,n=bl(T,O,I,W),o=vl(T,O,I,W)}yl(this.h,0,n,o),yl(this.h,2,i,s),yl(this.h,4,a,c),yl(this.h,6,u,l),yl(this.h,8,d,h),yl(this.h,10,f,p),yl(this.h,12,m,g),yl(this.h,14,y,b)},_l.prototype._digest=function(e){return"hex"===e?ll.toHex32(this.h,"big"):ll.split32(this.h,"big")};var Vl=lu,Pl=Sl;function Zl(){if(!(this instanceof Zl))return new Zl;Pl.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Vl.inherits(Zl,Pl);var zl=Zl;Zl.blockSize=1024,Zl.outSize=384,Zl.hmacStrength=192,Zl.padLength=128,Zl.prototype._digest=function(e){return"hex"===e?Vl.toHex32(this.h.slice(0,12),"big"):Vl.split32(this.h.slice(0,12),"big")},_u.sha1=Zu,_u.sha224=ul,_u.sha256=il,_u.sha384=zl,_u.sha512=Sl;var Ll={},Hl=lu,Yl=Eu,Xl=Hl.rotl32,Jl=Hl.sum32,Gl=Hl.sum32_3,ql=Hl.sum32_4,Kl=Yl.BlockHash;function Ql(){if(!(this instanceof Ql))return new Ql;Kl.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function $l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function ed(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function td(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Hl.inherits(Ql,Kl),Ll.ripemd160=Ql,Ql.blockSize=512,Ql.outSize=160,Ql.hmacStrength=192,Ql.padLength=64,Ql.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],i=this.h[3],s=this.h[4],a=r,c=n,u=o,l=i,d=s,h=0;h<80;h++){var f=Jl(Xl(ql(r,$l(h,n,o,i),e[rd[h]+t],ed(h)),od[h]),s);r=s,s=i,i=Xl(o,10),o=n,n=f,f=Jl(Xl(ql(a,$l(79-h,c,u,l),e[nd[h]+t],td(h)),id[h]),d),a=d,d=l,l=Xl(u,10),u=c,c=f}f=Gl(this.h[1],o,l),this.h[1]=Gl(this.h[2],i,d),this.h[2]=Gl(this.h[3],s,a),this.h[3]=Gl(this.h[4],r,c),this.h[4]=Gl(this.h[0],n,u),this.h[0]=f},Ql.prototype._digest=function(e){return"hex"===e?Hl.toHex32(this.h,"little"):Hl.split32(this.h,"little")};var rd=[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],nd=[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],od=[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],id=[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],sd=lu,ad=du;function cd(e,t,r){if(!(this instanceof cd))return new cd(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(sd.toArray(t,r))}var ud=cd;cd.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),ad(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},cd.prototype.update=function(e,t){return this.inner.update(e,t),this},cd.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=uu;t.utils=lu,t.common=Eu,t.sha=_u,t.ripemd=Ll,t.hmac=ud,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var ld=uu;function dd(e){return"0x"+ld.sha256().update(Ni(e)).digest("hex")}new xi("sha2/5.7.0");var hd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};function fd(e,t){return hd(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:Ni(new Uint8Array(o))}}))}var pd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const md=new xi("web/5.7.1");function gd(e){return new Promise((t=>{setTimeout(t,e)}))}function yd(e,t){if(null==e)return null;if("string"==typeof e)return e;if(ki(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ua(e)}catch(e){}return Ii(e)}return e}function bd(e,t,r){let n=null;if(null!=t){n=ja(t);const r="string"==typeof e?{url:e}:Bs(e);if(r.headers){const e=0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(r.headers=Bs(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return function(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;md.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"==typeof e?e.throttleCallback:null,i="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;md.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const s="object"==typeof e&&!!e.errorPassThrough,a={};let c=null;const u={method:"GET"};let l=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||md.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)a[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&md.throwError("basic authentication requires a secure https url",xi.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+Ya(ja(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=Bs(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=c?c.match(h):null;if(f)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]||"text/plain"},body:f[2]?Ha(f[3]):(p=f[3],ja(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){md.throwError("processing response error",xi.errors.SERVER_ERROR,{body:yd(f[1],f[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(a).forEach((e=>{const t=a[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(md.makeError("timeout",xi.errors.TIMEOUT,{requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return pd(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield fd(c,u),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===u.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(o&&(r=yield o(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):i*parseInt(String(Math.random()*Math.pow(2,e))),yield gd(r);continue}}}catch(e){t=e.response,null==t&&(g.cancel(),md.throwError("missing response",xi.errors.SERVER_ERROR,{requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,serverError:e,url:c}))}let a=t.body;if(l&&304===t.statusCode?a=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(g.cancel(),md.throwError("bad response",xi.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:yd(a,t.headers?t.headers["content-type"]:null),requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(a,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(o&&(t=yield o(e,c)),t){const t=i*parseInt(String(Math.random()*Math.pow(2,e)));yield gd(t);continue}}g.cancel(),md.throwError("processing response error",xi.errors.SERVER_ERROR,{body:yd(a,t.headers?t.headers["content-type"]:null),error:r,requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,url:c})}return g.cancel(),a}return md.throwError("failed response",xi.errors.SERVER_ERROR,{requestBody:yd(u.body,m["content-type"]),requestMethod:u.method,url:c})}))}();return Promise.race([g.promise,y])}(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Ua(e))}catch(t){md.throwError("invalid JSON",xi.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function vd(e,t){return t||(t={}),null==(t=Bs(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,i=!1;const s=()=>!i&&(i=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function o(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!i){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){s()&&n(e)}))}()}))}for(var wd="qpzry9x8gf2tvdw0s3jn54khce6mua7l",xd={},Ed=0;Ed<wd.length;Ed++){var Ad=wd.charAt(Ed);if(void 0!==xd[Ad])throw new TypeError(Ad+" is ambiguous");xd[Ad]=Ed}function Rd(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function kd(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=Rd(t)^n>>5}for(t=Rd(t),r=0;r<e.length;++r){var o=e.charCodeAt(r);t=Rd(t)^31&o}return t}function _d(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var i=e.slice(0,o),s=e.slice(o+1);if(s.length<6)return"Data too short";var a=kd(i);if("string"==typeof a)return a;for(var c=[],u=0;u<s.length;++u){var l=s.charAt(u),d=xd[l];if(void 0===d)return"Unknown character "+l;a=Rd(a)^d,u+6>=s.length||c.push(d)}return 1!==a?"Invalid checksum for "+e:{prefix:i,words:c}}function Sd(e,t,r,n){for(var o=0,i=0,s=(1<<r)-1,a=[],c=0;c<e.length;++c)for(o=o<<t|e[c],i+=t;i>=r;)i-=r,a.push(o>>i&s);if(n)i>0&&a.push(o<<r-i&s);else{if(i>=t)return"Excess padding";if(o<<r-i&s)return"Non-zero padding"}return a}var Nd={decodeUnsafe:function(){var e=_d.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=_d.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=kd(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var o=e+"1",i=0;i<t.length;++i){var s=t[i];if(s>>5!=0)throw new Error("Non 5-bit word");n=Rd(n)^s,o+=wd.charAt(s)}for(i=0;i<6;++i)n=Rd(n);for(n^=1,i=0;i<6;++i){o+=wd.charAt(n>>5*(5-i)&31)}return o},toWordsUnsafe:function(e){var t=Sd(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Sd(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Sd(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Sd(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const Md="providers/5.7.2";var Td={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,n,o){for(var i=0,s=0,a=Math.min(e.length,n),c=t;c<a;c++){var u=e.charCodeAt(c)-48;i*=o,s=u>=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s<o,"Invalid character"),i+=s}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,s=i%n,a=Math.min(i,i-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){u(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],s=o*i,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,h=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=h;f++){var p=u-f|0;l+=(s=(o=0|e.words[p])*(i=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<o|i)).toString(16);i=a>>>24-o&16777215,(o+=2)>=26&&(o-=26,s--),n=0!==i||s!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],l=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);n=(p=p.idivn(l)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},i&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,o),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===i?(r<e.length&&(e[r++]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===i?(r>=0&&(e[r--]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,o,i,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,h=l>>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,E=0|s[4],A=8191&E,R=E>>>13,k=0|s[5],_=8191&k,S=k>>>13,N=0|s[6],M=8191&N,T=N>>>13,O=0|s[7],I=8191&O,W=O>>>13,F=0|s[8],C=8191&F,j=F>>>13,U=0|s[9],D=8191&U,B=U>>>13,V=0|a[0],P=8191&V,Z=V>>>13,z=0|a[1],L=8191&z,H=z>>>13,Y=0|a[2],X=8191&Y,J=Y>>>13,G=0|a[3],q=8191&G,K=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,oe=0|a[6],ie=8191&oe,se=oe>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,P))|0)+((8191&(o=(o=Math.imul(d,Z))+Math.imul(h,P)|0))<<13)|0;u=((i=Math.imul(h,Z))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,P),o=(o=Math.imul(p,Z))+Math.imul(m,P)|0,i=Math.imul(m,Z);var ye=(u+(n=n+Math.imul(d,L)|0)|0)+((8191&(o=(o=o+Math.imul(d,H)|0)+Math.imul(h,L)|0))<<13)|0;u=((i=i+Math.imul(h,H)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,P),o=(o=Math.imul(y,Z))+Math.imul(b,P)|0,i=Math.imul(b,Z),n=n+Math.imul(p,L)|0,o=(o=o+Math.imul(p,H)|0)+Math.imul(m,L)|0,i=i+Math.imul(m,H)|0;var be=(u+(n=n+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,J)|0)+Math.imul(h,X)|0))<<13)|0;u=((i=i+Math.imul(h,J)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,P),o=(o=Math.imul(w,Z))+Math.imul(x,P)|0,i=Math.imul(x,Z),n=n+Math.imul(y,L)|0,o=(o=o+Math.imul(y,H)|0)+Math.imul(b,L)|0,i=i+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,o=(o=o+Math.imul(p,J)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,J)|0;var ve=(u+(n=n+Math.imul(d,q)|0)|0)+((8191&(o=(o=o+Math.imul(d,K)|0)+Math.imul(h,q)|0))<<13)|0;u=((i=i+Math.imul(h,K)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,P),o=(o=Math.imul(A,Z))+Math.imul(R,P)|0,i=Math.imul(R,Z),n=n+Math.imul(w,L)|0,o=(o=o+Math.imul(w,H)|0)+Math.imul(x,L)|0,i=i+Math.imul(x,H)|0,n=n+Math.imul(y,X)|0,o=(o=o+Math.imul(y,J)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,q)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,K)|0;var we=(u+(n=n+Math.imul(d,$)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;u=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,P),o=(o=Math.imul(_,Z))+Math.imul(S,P)|0,i=Math.imul(S,Z),n=n+Math.imul(A,L)|0,o=(o=o+Math.imul(A,H)|0)+Math.imul(R,L)|0,i=i+Math.imul(R,H)|0,n=n+Math.imul(w,X)|0,o=(o=o+Math.imul(w,J)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(y,q)|0,o=(o=o+Math.imul(y,K)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0;var xe=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(o=(o=o+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;u=((i=i+Math.imul(h,ne)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,P),o=(o=Math.imul(M,Z))+Math.imul(T,P)|0,i=Math.imul(T,Z),n=n+Math.imul(_,L)|0,o=(o=o+Math.imul(_,H)|0)+Math.imul(S,L)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,J)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(y,$)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var Ee=(u+(n=n+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,se)|0)+Math.imul(h,ie)|0))<<13)|0;u=((i=i+Math.imul(h,se)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,P),o=(o=Math.imul(I,Z))+Math.imul(W,P)|0,i=Math.imul(W,Z),n=n+Math.imul(M,L)|0,o=(o=o+Math.imul(M,H)|0)+Math.imul(T,L)|0,i=i+Math.imul(T,H)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,J)|0)+Math.imul(S,X)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,q)|0,o=(o=o+Math.imul(A,K)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,o=(o=o+Math.imul(y,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,se)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,se)|0;var Ae=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(o=(o=o+Math.imul(d,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((i=i+Math.imul(h,ue)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,P),o=(o=Math.imul(C,Z))+Math.imul(j,P)|0,i=Math.imul(j,Z),n=n+Math.imul(I,L)|0,o=(o=o+Math.imul(I,H)|0)+Math.imul(W,L)|0,i=i+Math.imul(W,H)|0,n=n+Math.imul(M,X)|0,o=(o=o+Math.imul(M,J)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,J)|0,n=n+Math.imul(_,q)|0,o=(o=o+Math.imul(_,K)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(A,$)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,ue)|0;var Re=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;u=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,P),o=(o=Math.imul(D,Z))+Math.imul(B,P)|0,i=Math.imul(B,Z),n=n+Math.imul(C,L)|0,o=(o=o+Math.imul(C,H)|0)+Math.imul(j,L)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(I,X)|0,o=(o=o+Math.imul(I,J)|0)+Math.imul(W,X)|0,i=i+Math.imul(W,J)|0,n=n+Math.imul(M,q)|0,o=(o=o+Math.imul(M,K)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(_,$)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(y,ce)|0,o=(o=o+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0;var ke=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;u=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,L),o=(o=Math.imul(D,H))+Math.imul(B,L)|0,i=Math.imul(B,H),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,J)|0)+Math.imul(j,X)|0,i=i+Math.imul(j,J)|0,n=n+Math.imul(I,q)|0,o=(o=o+Math.imul(I,K)|0)+Math.imul(W,q)|0,i=i+Math.imul(W,K)|0,n=n+Math.imul(M,$)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(_,re)|0,o=(o=o+Math.imul(_,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(y,de)|0,o=(o=o+Math.imul(y,he)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,he)|0;var _e=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,X),o=(o=Math.imul(D,J))+Math.imul(B,X)|0,i=Math.imul(B,J),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(W,$)|0,i=i+Math.imul(W,ee)|0,n=n+Math.imul(M,re)|0,o=(o=o+Math.imul(M,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,se)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,se)|0,n=n+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,ue)|0,n=n+Math.imul(w,de)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,he)|0;var Se=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(o=(o=o+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),o=(o=Math.imul(D,K))+Math.imul(B,q)|0,i=Math.imul(B,K),n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(W,re)|0,i=i+Math.imul(W,ne)|0,n=n+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,se)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,se)|0,n=n+Math.imul(_,ce)|0,o=(o=o+Math.imul(_,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,he)|0)+Math.imul(R,de)|0,i=i+Math.imul(R,he)|0;var Ne=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,$),o=(o=Math.imul(D,ee))+Math.imul(B,$)|0,i=Math.imul(B,ee),n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,se)|0)+Math.imul(W,ie)|0,i=i+Math.imul(W,se)|0,n=n+Math.imul(M,ce)|0,o=(o=o+Math.imul(M,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,n=n+Math.imul(_,de)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,he)|0;var Me=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(R,pe)|0))<<13)|0;u=((i=i+Math.imul(R,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,re),o=(o=Math.imul(D,ne))+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,se)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,se)|0,n=n+Math.imul(I,ce)|0,o=(o=o+Math.imul(I,ue)|0)+Math.imul(W,ce)|0,i=i+Math.imul(W,ue)|0,n=n+Math.imul(M,de)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,he)|0;var Te=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((i=i+Math.imul(S,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,ie),o=(o=Math.imul(D,se))+Math.imul(B,ie)|0,i=Math.imul(B,se),n=n+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,n=n+Math.imul(I,de)|0,o=(o=o+Math.imul(I,he)|0)+Math.imul(W,de)|0,i=i+Math.imul(W,he)|0;var Oe=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((i=i+Math.imul(T,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,ce),o=(o=Math.imul(D,ue))+Math.imul(B,ce)|0,i=Math.imul(B,ue),n=n+Math.imul(C,de)|0,o=(o=o+Math.imul(C,he)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,he)|0;var Ie=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,me)|0)+Math.imul(W,pe)|0))<<13)|0;u=((i=i+Math.imul(W,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,de),o=(o=Math.imul(D,he))+Math.imul(B,de)|0,i=Math.imul(B,he);var We=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,me)|0)+Math.imul(j,pe)|0))<<13)|0;u=((i=i+Math.imul(j,me)|0)+(o>>>13)|0)+(We>>>26)|0,We&=67108863;var Fe=(u+(n=Math.imul(D,pe))|0)+((8191&(o=(o=Math.imul(D,me))+Math.imul(B,pe)|0))<<13)|0;return u=((i=Math.imul(B,me))+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ee,c[7]=Ae,c[8]=Re,c[9]=ke,c[10]=_e,c[11]=Se,c[12]=Ne,c[13]=Me,c[14]=Te,c[15]=Oe,c[16]=Ie,c[17]=We,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var s=o;o=0;for(var a=67108863&n,c=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=c;u++){var l=i-u,d=(0|e.words[l])*(0|t.words[u]),h=67108863&d;a=67108863&(h=h+a|0),o+=(s=(s=s+(d/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}r.words[i]=a,n=s,s=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,s=(67108863&i)+(67108863&n);n>>=26,n+=i/67108864|0,n+=s>>>26,this.words[o]=67108863&s}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=e.words[n]>>>o&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&i,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this._strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),a=67108863^67108863>>>i<<i,c=n;if(o-=s,o=Math.max(0,o),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=o);u--){var d=0|this.words[u];this.words[u]=l<<26-i|d>>>i,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,s=e.length+n;this._expand(s);var a=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+a;var c=(0|e.words[o])*t;a=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this._strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new R(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){R.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var s=0|e.words[o];e.words[o-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(x,v),n(E,v),n(A,v),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return b[e]=t,t},R.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},R.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},R.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},R.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=g}return h},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},n(k,R),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Td,W);var Od=Td.exports;function Id(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Wd=Fd;function Fd(e,t){if(!e)throw new Error(t||"Assertion failed")}Fd.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Cd=Id((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,s=255&o;i?r.push(i,s):r.push(s)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),jd=Id((function(e,t){var r=t;r.assert=Wd,r.toArray=Cd.toArray,r.zero2=Cd.zero2,r.toHex=Cd.toHex,r.encode=Cd.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),s=0;s<n.length;s++){var a,c=i.andln(o-1);i.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,i.isubn(a)):a=0,n[s]=a,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var s,a,c=e.andln(3)+o&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*o===s+1&&(o=1-o),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new Od(e,"hex","le")}})),Ud=jd.getNAF,Dd=jd.getJSF,Bd=jd.assert;function Vd(e,t){this.type=e,this.p=new Od(t.p,16),this.red=t.prime?Od.red(t.prime):Od.mont(this.p),this.zero=new Od(0).toRed(this.red),this.one=new Od(1).toRed(this.red),this.two=new Od(2).toRed(this.red),this.n=t.n&&new Od(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Pd=Vd;function Zd(e,t){this.curve=e,this.type=t,this.precomputed=null}Vd.prototype.point=function(){throw new Error("Not implemented")},Vd.prototype.validate=function(){throw new Error("Not implemented")},Vd.prototype._fixedNafMul=function(e,t){Bd(e.precomputed);var r=e._getDoubles(),n=Ud(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,s,a=[];for(i=0;i<n.length;i+=r.step){s=0;for(var c=i+r.step-1;c>=i;c--)s=(s<<1)+n[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=o;d>0;d--){for(i=0;i<a.length;i++)(s=a[i])===d?l=l.mixedAdd(r.points[i]):s===-d&&(l=l.mixedAdd(r.points[i].neg()));u=u.add(l)}return u.toP()},Vd.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=Ud(t,r,this._bitLength),s=this.jpoint(null,null,null),a=i.length-1;a>=0;a--){for(var c=0;a>=0&&0===i[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=i[a];Bd(0!==u),s="affine"===e.type?u>0?s.mixedAdd(o[u-1>>1]):s.mixedAdd(o[-u-1>>1].neg()):u>0?s.add(o[u-1>>1]):s.add(o[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},Vd.prototype._wnafMulAdd=function(e,t,r,n,o){var i,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(i=0;i<n;i++){var h=(a=t[i])._getNAFPoints(e);c[i]=h.wnd,u[i]=h.points}for(i=n-1;i>=1;i-=2){var f=i-1,p=i;if(1===c[f]&&1===c[p]){var m=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(m[1]=t[f].add(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].add(t[p].neg())):(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=Dd(r[f],r[p]);for(d=Math.max(y[0].length,d),l[f]=new Array(d),l[p]=new Array(d),s=0;s<d;s++){var b=0|y[0][s],v=0|y[1][s];l[f][s]=g[3*(b+1)+(v+1)],l[p][s]=0,u[f]=m}}else l[f]=Ud(r[f],c[f],this._bitLength),l[p]=Ud(r[p],c[p],this._bitLength),d=Math.max(l[f].length,d),d=Math.max(l[p].length,d)}var w=this.jpoint(null,null,null),x=this._wnafT4;for(i=d;i>=0;i--){for(var E=0;i>=0;){var A=!0;for(s=0;s<n;s++)x[s]=0|l[s][i],0!==x[s]&&(A=!1);if(!A)break;E++,i--}if(i>=0&&E++,w=w.dblp(E),i<0)break;for(s=0;s<n;s++){var R=x[s];0!==R&&(R>0?a=u[s][R-1>>1]:R<0&&(a=u[s][-R-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(i=0;i<n;i++)u[i]=null;return o?w:w.toP()},Vd.BasePoint=Zd,Zd.prototype.eq=function(){throw new Error("Not implemented")},Zd.prototype.validate=function(){return this.curve.validate(this)},Vd.prototype.decodePoint=function(e,t){e=jd.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Bd(e[e.length-1]%2==0):7===e[0]&&Bd(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},Zd.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Zd.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},Zd.prototype.encode=function(e,t){return jd.encode(this._encode(t),e)},Zd.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Zd.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},Zd.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},Zd.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},Zd.prototype._getBeta=function(){return null},Zd.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var zd=Id((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),Ld=jd.assert;function Hd(e){Pd.call(this,"short",e),this.a=new Od(e.a,16).toRed(this.red),this.b=new Od(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}zd(Hd,Pd);var Yd=Hd;function Xd(e,t,r,n){Pd.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Od(t,16),this.y=new Od(r,16),n&&(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 Jd(e,t,r,n){Pd.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Od(0)):(this.x=new Od(t,16),this.y=new Od(r,16),this.z=new Od(n,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}Hd.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new Od(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new Od(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],Ld(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new Od(e.a,16),b:new Od(e.b,16)}})):this._getEndoBasis(r)}}},Hd.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Od.mont(e),r=new Od(2).toRed(t).redInvm(),n=r.redNeg(),o=new Od(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},Hd.prototype._getEndoBasis=function(e){for(var t,r,n,o,i,s,a,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),f=new Od(1),p=new Od(0),m=new Od(0),g=new Od(1),y=0;0!==d.cmpn(0);){var b=h.div(d);c=h.sub(b.mul(d)),u=m.sub(b.mul(f));var v=g.sub(b.mul(p));if(!n&&c.cmp(l)<0)t=a.neg(),r=f,n=c.neg(),o=u;else if(n&&2==++y)break;a=c,h=d,d=c,m=f,f=u,g=p,p=v}i=c.neg(),s=u;var w=n.sqr().add(o.sqr());return i.sqr().add(s.sqr()).cmp(w)>=0&&(i=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),s=s.neg()),[{a:n,b:o},{a:i,b:s}]},Hd.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=o.mul(r.a),a=i.mul(n.a),c=o.mul(r.b),u=i.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},Hd.prototype.pointFromX=function(e,t){(e=new Od(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},Hd.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},Hd.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),a=e[i],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=a,n[2*i+1]=c,o[2*i]=s.k1,o[2*i+1]=s.k2}for(var u=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return u},zd(Xd,Pd.BasePoint),Hd.prototype.point=function(e,t,r){return new Xd(this,e,t,r)},Hd.prototype.pointFromJSON=function(e,t){return Xd.fromJSON(this,e,t)},Xd.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},Xd.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]},Xd.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},Xd.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)+">"},Xd.prototype.isInfinity=function(){return this.inf},Xd.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Xd.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},Xd.prototype.getX=function(){return this.x.fromRed()},Xd.prototype.getY=function(){return this.y.fromRed()},Xd.prototype.mul=function(e){return e=new Od(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Xd.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},Xd.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},Xd.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Xd.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Xd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},zd(Jd,Pd.BasePoint),Hd.prototype.jpoint=function(e,t,r){return new Jd(this,e,t,r)},Jd.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Jd.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Jd.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(o),c=i.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(d).redISub(d),f=c.redMul(d.redISub(h)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},Jd.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=o.redSub(i);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(d)).redISub(o.redMul(u)),f=this.z.redMul(s);return this.curve.jpoint(d,h,f)},Jd.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=i.redSqr(),d=u.redSqr(),h=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=i.redMul(d),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(h);var b=u.redMul(a);t+1<e&&(c=c.redMul(h)),i=m,a=b,u=y}return this.curve.jpoint(i,u.redMul(o),a)},Jd.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Jd.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(h);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Jd.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Jd.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),a=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=a.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,p)},Jd.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=o.redIAdd(s).redSqr().redISub(i).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,h,f)},Jd.prototype.mul=function(e,t){return e=new Od(e,t),this.curve._wnafMul(this,e)},Jd.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},Jd.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},Jd.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)+">"},Jd.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Gd=Id((function(e,t){var r=t;r.base=Pd,r.short=Yd,r.mont=null,r.edwards=null})),qd=Id((function(e,t){var r,n=t,o=jd.assert;function i(e){"short"===e.type?this.curve=new Gd.short(e):"edwards"===e.type?this.curve=new Gd.edwards(e):this.curve=new Gd.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,s("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:ld.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:ld.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:ld.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:ld.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"]}),s("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:ld.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ld.sha256,gRed:!1,g:["9"]}),s("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:ld.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("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:ld.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Kd(e){if(!(this instanceof Kd))return new Kd(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Cd.toArray(e.entropy,e.entropyEnc||"hex"),r=Cd.toArray(e.nonce,e.nonceEnc||"hex"),n=Cd.toArray(e.pers,e.persEnc||"hex");Wd(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Qd=Kd;Kd.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Kd.prototype._hmac=function(){return new ld.hmac(this.hash,this.K)},Kd.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Kd.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Cd.toArray(e,t),r=Cd.toArray(r,n),Wd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Kd.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Cd.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,e);return this._update(r),this._reseed++,Cd.encode(i,t)};var $d=jd.assert;function eh(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var th=eh;eh.fromPublic=function(e,t,r){return t instanceof eh?t:new eh(e,{pub:t,pubEnc:r})},eh.fromPrivate=function(e,t,r){return t instanceof eh?t:new eh(e,{priv:t,privEnc:r})},eh.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},eh.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},eh.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},eh.prototype._importPrivate=function(e,t){this.priv=new Od(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},eh.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?$d(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||$d(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},eh.prototype.derive=function(e){return e.validate()||$d(e.validate(),"public point not validated"),e.mul(this.priv).getX()},eh.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},eh.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},eh.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var rh=jd.assert;function nh(e,t){if(e instanceof nh)return e;this._importDER(e,t)||(rh(e.r&&e.s,"Signature without r or s"),this.r=new Od(e.r,16),this.s=new Od(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var oh=nh;function ih(){this.place=0}function sh(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,s=t.place;i<n;i++,s++)o<<=8,o|=e[s],o>>>=0;return!(o<=127)&&(t.place=s,o)}function ah(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function ch(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}nh.prototype._importDER=function(e,t){e=jd.toArray(e,t);var r=new ih;if(48!==e[r.place++])return!1;var n=sh(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=sh(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=sh(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new Od(i),this.s=new Od(a),this.recoveryParam=null,!0},nh.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=ah(t),r=ah(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];ch(n,t.length),(n=n.concat(t)).push(2),ch(n,r.length);var o=n.concat(r),i=[48];return ch(i,o.length),i=i.concat(o),jd.encode(i,e)};var uh=function(){throw new Error("unsupported")},lh=jd.assert;function dh(e){if(!(this instanceof dh))return new dh(e);"string"==typeof e&&(lh(Object.prototype.hasOwnProperty.call(qd,e),"Unknown curve "+e),e=qd[e]),e instanceof qd.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var hh=dh;dh.prototype.keyPair=function(e){return new th(this,e)},dh.prototype.keyFromPrivate=function(e,t){return th.fromPrivate(this,e,t)},dh.prototype.keyFromPublic=function(e,t){return th.fromPublic(this,e,t)},dh.prototype.genKeyPair=function(e){e||(e={});for(var t=new Qd({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||uh(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Od(2));;){var o=new Od(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},dh.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},dh.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Od(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),s=e.toArray("be",o),a=new Qd({hash:this.hash,entropy:i,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Od(1)),u=0;;u++){var l=n.k?n.k(u):new Od(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var h=d.getX(),f=h.umod(this.n);if(0!==f.cmpn(0)){var p=l.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new oh({r:f,s:p,recoveryParam:m})}}}}}},dh.prototype.verify=function(e,t,r,n){e=this._truncateToN(new Od(e,16)),r=this.keyFromPublic(r,n);var o=(t=new oh(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var s,a=i.invm(this.n),c=a.mul(e).umod(this.n),u=a.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},dh.prototype.recoverPubKey=function(e,t,r,n){lh((3&r)===r,"The recovery param is more than two bits"),t=new oh(t,n);var o=this.n,i=new Od(e),s=t.r,a=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var l=t.r.invm(o),d=o.sub(i).mul(l).umod(o),h=a.mul(l).umod(o);return this.g.mulAdd(d,s,h)},dh.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new oh(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var fh=Id((function(e,t){var r=t;r.version="6.5.4",r.utils=jd,r.rand=function(){throw new Error("unsupported")},r.curve=Gd,r.curves=qd,r.ec=hh,r.eddsa=null})).ec;const ph=new xi("signing-key/5.7.0");let mh=null;function gh(){return mh||(mh=new fh("secp256k1")),mh}class yh{constructor(e){js(this,"curve","secp256k1"),js(this,"privateKey",Ii(e)),32!==Wi(this.privateKey)&&ph.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=gh().keyFromPrivate(Ni(this.privateKey));js(this,"publicKey","0x"+t.getPublic(!1,"hex")),js(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),js(this,"_isSigningKey",!0)}_addPoint(e){const t=gh().keyFromPublic(Ni(this.publicKey)),r=gh().keyFromPublic(Ni(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=gh().keyFromPrivate(Ni(this.privateKey)),r=Ni(e);32!==r.length&&ph.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Di({recoveryParam:n.recoveryParam,r:Ui("0x"+n.r.toString(16),32),s:Ui("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=gh().keyFromPrivate(Ni(this.privateKey)),r=gh().keyFromPublic(Ni(bh(e)));return Ui("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function bh(e,t){const r=Ni(e);if(32===r.length){const e=new yh(r);return t?"0x"+gh().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?Ii(r):"0x"+gh().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+gh().keyFromPublic(r).getPublic(!0,"hex"):Ii(r):ph.throwArgumentError("invalid public or private key","key","[REDACTED]")}const vh=new xi("transactions/5.7.0");var wh;function xh(e){return"0x"===e?null:es(e)}function Eh(e){return"0x"===e?Ms:v.BigNumber.from(e)}function Ah(e,t){return function(e){return es(Fi(Pi(Fi(bh(e),1)),12))}(function(e,t){const r=Di(t),n={r:Ni(r.r),s:Ni(r.s)};return"0x"+gh().recoverPubKey(Ni(e),n,r.recoveryParam).encode("hex",!1)}(Ni(e),t))}function Rh(e,t){const r=Ti(v.BigNumber.from(e).toHexString());return r.length>32&&vh.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function kh(e,t){return{address:es(e),storageKeys:(t||[]).map(((t,r)=>(32!==Wi(t)&&vh.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function _h(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&vh.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),kh(e[0],e[1])):kh(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return kh(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Sh(e){return _h(e).map((e=>[e.address,e.storageKeys]))}function Nh(e,t){if(null!=e.gasPrice){const t=v.BigNumber.from(e.gasPrice),r=v.BigNumber.from(e.maxFeePerGas||0);t.eq(r)||vh.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Rh(e.chainId||0,"chainId"),Rh(e.nonce||0,"nonce"),Rh(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Rh(e.maxFeePerGas||0,"maxFeePerGas"),Rh(e.gasLimit||0,"gasLimit"),null!=e.to?es(e.to):"0x",Rh(e.value||0,"value"),e.data||"0x",Sh(e.accessList||[])];if(t){const e=Di(t);r.push(Rh(e.recoveryParam,"recoveryParam")),r.push(Ti(e.r)),r.push(Ti(e.s))}return Ci(["0x02",Yi(r)])}function Mh(e,t){const r=[Rh(e.chainId||0,"chainId"),Rh(e.nonce||0,"nonce"),Rh(e.gasPrice||0,"gasPrice"),Rh(e.gasLimit||0,"gasLimit"),null!=e.to?es(e.to):"0x",Rh(e.value||0,"value"),e.data||"0x",Sh(e.accessList||[])];if(t){const e=Di(t);r.push(Rh(e.recoveryParam,"recoveryParam")),r.push(Ti(e.r)),r.push(Ti(e.s))}return Ci(["0x01",Yi(r)])}function Th(e,t,r){try{const r=Eh(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){vh.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Ui(t[1],32),e.s=Ui(t[2],32);try{const t=Pi(r(e));e.from=Ah(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Oh(e){const t=Ni(e);if(t[0]>127)return function(e){const t=Gi(e);9!==t.length&&6!==t.length&&vh.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Eh(t[0]).toNumber(),gasPrice:Eh(t[1]),gasLimit:Eh(t[2]),to:xh(t[3]),value:Eh(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=v.BigNumber.from(t[6]).toNumber()}catch(e){return r}if(r.r=Ui(t[7],32),r.s=Ui(t[8],32),v.BigNumber.from(r.r).isZero()&&v.BigNumber.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push(Ii(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);const i=Pi(Yi(o));try{r.from=Ah(i,{r:Ii(r.r),s:Ii(r.s),recoveryParam:n})}catch(e){}r.hash=Pi(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Gi(e.slice(1));8!==t.length&&11!==t.length&&vh.throwArgumentError("invalid component count for transaction type: 1","payload",Ii(e));const r={type:1,chainId:Eh(t[0]).toNumber(),nonce:Eh(t[1]).toNumber(),gasPrice:Eh(t[2]),gasLimit:Eh(t[3]),to:xh(t[4]),value:Eh(t[5]),data:t[6],accessList:_h(t[7])};return 8===t.length||(r.hash=Pi(e),Th(r,t.slice(8),Mh)),r}(t);case 2:return function(e){const t=Gi(e.slice(1));9!==t.length&&12!==t.length&&vh.throwArgumentError("invalid component count for transaction type: 2","payload",Ii(e));const r=Eh(t[2]),n=Eh(t[3]),o={type:2,chainId:Eh(t[0]).toNumber(),nonce:Eh(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Eh(t[4]),to:xh(t[5]),value:Eh(t[6]),data:t[7],accessList:_h(t[8])};return 9===t.length||(o.hash=Pi(e),Th(o,t.slice(9),Nh)),o}(t)}return vh.throwError(`unsupported transaction type: ${t[0]}`,xi.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(wh||(wh={}));const Ih=new xi(Md);class Wh{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),i=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:i,type:c,accessList:Wh.allowNull(this.accessList.bind(this),null),blockHash:Wh.allowNull(i,null),blockNumber:Wh.allowNull(a,null),transactionIndex:Wh.allowNull(a,null),confirmations:Wh.allowNull(a,null),from:t,gasPrice:Wh.allowNull(r),maxPriorityFeePerGas:Wh.allowNull(r),maxFeePerGas:Wh.allowNull(r),gasLimit:r,to:Wh.allowNull(t,null),value:r,nonce:a,data:o,r:Wh.allowNull(this.uint256),s:Wh.allowNull(this.uint256),v:Wh.allowNull(a),creates:Wh.allowNull(t,null),raw:Wh.allowNull(o)},e.transactionRequest={from:Wh.allowNull(t),nonce:Wh.allowNull(a),gasLimit:Wh.allowNull(r),gasPrice:Wh.allowNull(r),maxPriorityFeePerGas:Wh.allowNull(r),maxFeePerGas:Wh.allowNull(r),to:Wh.allowNull(t),value:Wh.allowNull(r),data:Wh.allowNull((e=>this.data(e,!0))),type:Wh.allowNull(a),accessList:Wh.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:i,address:t,topics:Wh.arrayOf(i),data:o,logIndex:a,blockHash:i},e.receipt={to:Wh.allowNull(this.address,null),from:Wh.allowNull(this.address,null),contractAddress:Wh.allowNull(t,null),transactionIndex:a,root:Wh.allowNull(s),gasUsed:r,logsBloom:Wh.allowNull(o),blockHash:i,transactionHash:i,logs:Wh.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:Wh.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:Wh.allowNull(r),status:Wh.allowNull(a),type:c},e.block={hash:Wh.allowNull(i),parentHash:i,number:a,timestamp:a,nonce:Wh.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Wh.allowNull(t),extraData:o,transactions:Wh.allowNull(Wh.arrayOf(i)),baseFeePerGas:Wh.allowNull(r)},e.blockWithTransactions=Bs(e.block),e.blockWithTransactions.transactions=Wh.allowNull(Wh.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Wh.allowNull(n,void 0),toBlock:Wh.allowNull(n,void 0),blockHash:Wh.allowNull(i,void 0),address:Wh.allowNull(t,void 0),topics:Wh.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Wh.allowNull(a),blockHash:Wh.allowNull(i),transactionIndex:a,removed:Wh.allowNull(this.boolean.bind(this)),address:t,data:Wh.allowFalsish(o,"0x"),topics:Wh.arrayOf(i),transactionHash:i,logIndex:a},e}accessList(e){return _h(e||[])}number(e){return"0x"===e?0:v.BigNumber.from(e).toNumber()}type(e){return"0x"===e||null==e?0:v.BigNumber.from(e).toNumber()}bigNumber(e){return v.BigNumber.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Oi(e))?e.toLowerCase():Ih.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return es(e)}callAddress(e){if(!Oi(e,32))return null;const t=es(Fi(e,12));return t===Ss?null:t}contractAddress(e){return function(e){let t=null;try{t=es(e.from)}catch(t){qi.throwArgumentError("missing from address","transaction",e)}return es(Fi(Pi(Yi([t,Ti(Ni(v.BigNumber.from(e.nonce).toHexString()))])),12))}(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Oi(e))return ji(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==Wi(r)?Ih.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=v.BigNumber.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Oi(e))throw new Error("invalid uint256");return Ui(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Wh.check(t,e);return n._difficulty=null==r?null:v.BigNumber.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Wh.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&v.BigNumber.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Wh.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Oi(r)&&(r=v.BigNumber.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Oi(r)&&(r=v.BigNumber.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Oh(e)}receiptLog(e){return Wh.check(this.formats.receiptLog,e)}receipt(e){const t=Wh.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=v.BigNumber.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Ih.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Ih.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Ih.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Wh.check(this.formats.filter,e)}filterLog(e){return Wh.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const o=e[n](t[n]);void 0!==o&&(r[n]=o)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Fh=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Ch=new xi(Md);function jh(e){return null==e?"null":(32!==Wi(e)&&Ch.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Uh(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[jh(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return jh(e)})).join("&")}function Dh(e){if("string"==typeof e){if(32===Wi(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Uh(e);if(Qc.isForkEvent(e))throw Ch.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Uh(e.topics||[])}throw new Error("invalid event - "+e)}function Bh(){return(new Date).getTime()}function Vh(e){return new Promise((t=>{setTimeout(t,e)}))}const Ph=["block","network","pending","poll"];class Zh{constructor(e,t,r){js(this,"tag",e),js(this,"listener",t),js(this,"once",r),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 e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||Ph.indexOf(this.tag)>=0}}const zh={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 Lh(e){return Ui(v.BigNumber.from(e).toHexString(),32)}function Hh(e){return cu.encode(Mi([e,Fi(dd(dd(e)),0,4)]))}const Yh=new RegExp("^(ipfs)://(.*)$","i"),Xh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Yh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Jh(e,t){try{return Ua(Gh(e,t))}catch(e){}return null}function Gh(e,t){if("0x"===e)return null;const r=v.BigNumber.from(Fi(e,t,t+32)).toNumber(),n=v.BigNumber.from(Fi(e,r,r+32)).toNumber();return Fi(e,r+32,r+32+n)}function qh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Ch.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Kh(e){const t=Ni(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Qh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function $h(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const o=Ni(e[n]);t[n]=Kh(r),t.push(Kh(o.length)),t.push(Qh(o)),r+=32+32*Math.ceil(o.length/32)}return Ci(t)}class ef{constructor(e,t,r,n){js(this,"provider",e),js(this,"name",r),js(this,"address",e.formatter.address(t)),js(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>v.BigNumber.from(e).eq(1))).catch((e=>{if(e.code===xi.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Fh(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:Ci([e,gc(this.name),t||"0x"])};let n=!1;var o;(yield this.supportsWildcard())&&(n=!0,r.data=Ci(["0x9061b923",$h([(o=this.name,Ii(Mi(mc(o).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]));try{let e=yield this.provider.call(r);return Ni(e).length%32==4&&Ch.throwError("resolver threw error",xi.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Gh(e,0)),e}catch(e){if(e.code===xi.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Fh(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Gh(r,0):null}))}_getAddress(e,t){const r=zh[String(e)];if(null==r&&Ch.throwError(`unsupported coin type: ${e}`,xi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Ni(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Hh(Mi([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Hh(Mi([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Nd.toWords(n.slice(2));return e.unshift(t),Nd.encode(r.prefix,e)}}return null}getAddress(e){return Fh(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===xi.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Lh(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Ch.throwError("invalid or unsupported coin data",xi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Fh(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<Xh.length;r++){const n=t.match(Xh[r]);if(null==n)continue;const o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:qh(t)};case"erc721":case"erc1155":{const r="erc721"===o?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const i=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=Ui(v.BigNumber.from(s[1]).toHexString(),32);if("erc721"===o){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:Ci(["0x6352211e",c])}));if(i!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===o){const t=v.BigNumber.from(yield this.provider.call({to:a,data:Ci(["0x00fdd58e",Ui(i,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(s[0]),data:Ci([r,c])};let l=Jh(yield this.provider.call(u),0);if(null==l)return null;e.push({type:"metadata-url-base",content:l}),"erc1155"===o&&(l=l.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=qh(l)),e.push({type:"metadata-url",content:l});const d=yield bd(l);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let h=d.image;if("string"!=typeof h)return null;if(h.match(/^(https:\/\/|data:)/i));else{if(null==h.match(Yh))return null;e.push({type:"url-ipfs",content:h}),h=qh(h)}return e.push({type:"url",content:h}),{linkage:e,url:h}}}}}catch(e){}return null}))}getContentHash(){return Fh(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+cu.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+cu.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&68===o[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+Ya("0x"+o[1]).replace(/[=+\/]/g,(t=>e[t]))}return Ch.throwError("invalid or unsupported content hash data",xi.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Fh(this,void 0,void 0,(function*(){let t=ja(e);t=Mi([Lh(64),Lh(t.length),t]),t.length%32!=0&&(t=Mi([t,Ui("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Ii(t));return null==r||"0x"===r?null:Ua(r)}))}}let tf=null,rf=1;class nf extends $c{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),js(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=Us(new.target,"getNetwork")(e);t?(js(this,"_network",t),this.emit("network",t,null)):Ch.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Fh(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Ch.throwError("no network detected",xi.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:js(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return vd((()=>this._ready().then((e=>e),(e=>{if(e.code!==xi.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==tf&&(tf=new Wh),tf}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in su){const r=su[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=su[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=su[e.name];if(!t)return"number"!=typeof e.chainId&&eu.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&eu.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Fh(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),i=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",o),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),c=yield bd({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Ch.throwError(`response not found during CCIP fetch: ${u}`,xi.errors.SERVER_ERROR,{url:t,errorMessage:u});i.push(u)}return Ch.throwError(`error encountered during CCIP fetch: ${i.map((e=>JSON.stringify(e))).join(", ")}`,xi.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(e){return Fh(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Bh()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Bh(),r=Ds({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=Bh();return(e=v.BigNumber.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:o}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Fh(this,void 0,void 0,(function*(){const e=rf++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Ch.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Ch.makeError("network block skew detected",xi.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Fh(this,void 0,void 0,(function*(){return Ch.throwError("provider does not support network detection",xi.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Fh(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield Vh(0),this._network;const r=Ch.makeError("underlying network changed",xi.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!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))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Bh();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=Bh(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Fh(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Fh(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,i)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},u=e=>{e.confirmations<t||c()||o(e)};if(this.on(e,u),s.push((()=>{this.removeListener(e,u)})),n){let r=n.startBlock,o=null;const u=s=>Fh(this,void 0,void 0,(function*(){a||(yield Vh(1e3),this.getTransactionCount(n.from).then((l=>Fh(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o<n.startBlock&&(o=n.startBlock));o<=s;){if(a)return;const r=yield this.getBlockWithTransactions(o);for(let o=0;o<r.transactions.length;o++){const s=r.transactions[o];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(c())return;let o="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?o="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(o="cancelled"),void i(Ch.makeError("transaction was replaced",xi.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===o||"cancelled"===o,reason:o,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}o++}}a||this.once("block",u)}}))),(e=>{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||i(Ch.makeError("timeout exceeded",xi.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Fh(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return v.BigNumber.from(e)}catch(t){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return v.BigNumber.from(n)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return v.BigNumber.from(n).toNumber()}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return Ii(n)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Ds({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>ji(e)))}),o=yield this.perform("getStorageAt",n);try{return Ii(o)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==Wi(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Ch.throwError("Transaction hash mismatch from Provider.sendTransaction.",xi.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Fh(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const i=yield this._waitForTransaction(e.hash,t,n,o);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&Ch.throwError("transaction failed",xi.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),n}sendTransaction(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Ii(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Fh(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?v.BigNumber.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Ii(e):null)))})),this.formatter.transactionRequest(yield Ds(r))}))}_getFilter(e){return Fh(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield Ds(t))}))}_call(e,t,r){return Fh(this,void 0,void 0,(function*(){r>=10&&Ch.throwError("CCIP read exceeded maximum redirections",xi.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&Wi(o)%32==4)try{const i=Fi(o,4),s=Fi(i,0,32);v.BigNumber.from(s).eq(n)||Ch.throwError("CCIP Read sender did not match",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const a=[],c=v.BigNumber.from(Fi(i,32,64)).toNumber(),u=v.BigNumber.from(Fi(i,c,c+32)).toNumber(),l=Fi(i,c+32);for(let t=0;t<u;t++){const r=Jh(l,32*t);null==r&&Ch.throwError("CCIP Read contained corrupt URL string",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),a.push(r)}const d=Gh(i,64);v.BigNumber.from(Fi(i,100,128)).isZero()||Ch.throwError("CCIP Read callback selector included junk",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const h=Fi(i,96,100),f=Gh(i,128),p=yield this.ccipReadFetch(e,d,a);null==p&&Ch.throwError("CCIP Read disabled or provided no URLs",xi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const m={to:n,data:Ci([h,$h([p,f])])};return this._call(m,t,r+1)}catch(e){if(e.code===xi.errors.SERVER_ERROR)throw e}try{return Ii(o)}catch(r){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:r})}}))}call(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Ds({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Ds({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return v.BigNumber.from(r)}catch(e){return Ch.throwError("bad result from backend",xi.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return Fh(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&Ch.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&Ch.throwError("ENS name not configured",xi.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(Oi(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),Oi(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){Ch.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return vd((()=>Fh(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return vd((()=>Fh(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return vd((()=>Fh(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Fh(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Ds({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Wh.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Fh(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Fh(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Ch.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Fh(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new ef(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Fh(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Ch.throwError("network does not support ENS",xi.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+gc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Fh(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Oi(e))throw t}"string"!=typeof e&&Ch.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Fh(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=Jh(yield this.call({to:r,data:"0x691f3431"+gc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Fh(this,void 0,void 0,(function*(){let t=null;if(Oi(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new ef(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==xi.errors.CALL_EXCEPTION)throw e}try{const e=Jh(yield this.call({to:n,data:"0x691f3431"+gc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==xi.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Ch.throwError(e+" not implemented",xi.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new Zh(Dh(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],o=Dh(e);return this._events=this._events.filter((e=>e.tag!==o||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Dh(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Dh(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=Dh(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Dh(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var of=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const sf=new xi("abstract-signer/5.7.0"),af=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],cf=[xi.errors.INSUFFICIENT_FUNDS,xi.errors.NONCE_EXPIRED,xi.errors.REPLACEMENT_UNDERPRICED];class uf{constructor(){sf.checkAbstract(new.target,uf),js(this,"_isSigner",!0)}getBalance(e){return of(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return of(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return of(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield Ds(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return of(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield Ds(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return of(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return of(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return of(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return of(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return of(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===af.indexOf(t)&&sf.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=Bs(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&sf.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return of(this,void 0,void 0,(function*(){const t=yield Ds(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>of(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&sf.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||sf.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):sf.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&sf.throwError("network does not support EIP-1559",xi.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):sf.throwError("failed to get consistent fee data",xi.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(cf.indexOf(e.code)>=0)throw e;return sf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xi.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&sf.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield Ds(t)}))}_checkProvider(e){this.provider||sf.throwError("missing provider",xi.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}var lf=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const df=new xi(Md),hf=["call","estimateGas"];function ff(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Oi(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=ff(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return ff(JSON.parse(e),t)}catch(e){}return null}function pf(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=ff(t,!0);if(e)return e.data;df.throwError("missing revert data in call exception; Transaction reverted without a reason string",xi.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=ff(t.body,!1);null==r&&(r=ff(t,!1)),r&&df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xi.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===xi.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&df.throwError("insufficient funds for intrinsic transaction cost",xi.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&df.throwError("nonce has already been used",xi.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&df.throwError("replacement fee too low",xi.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&df.throwError("legacy pre-eip-155 transactions not supported",xi.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),hf.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",xi.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function mf(e){return new Promise((function(t){setTimeout(t,e)}))}function gf(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function yf(e){return e?e.toLowerCase():e}const bf={};class vf extends uf{constructor(e,t,r){if(super(),e!==bf)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");js(this,"provider",t),null==r&&(r=0),"string"==typeof r?(js(this,"_address",this.provider.formatter.address(r)),js(this,"_index",null)):"number"==typeof r?(js(this,"_index",r),js(this,"_address",null)):df.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return df.throwError("cannot alter JSON-RPC Signer connection",xi.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new wf(bf,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&df.throwError("unknown account #"+this._index,xi.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=Bs(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=Bs(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>lf(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&df.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),Ds({tx:Ds(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&df.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&df.throwError("user rejected transaction",xi.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),pf("sendTransaction",e,n))))}))}signTransaction(e){return df.throwError("signing transactions is unsupported",xi.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return lf(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield vd((()=>lf(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return lf(this,void 0,void 0,(function*(){const t="string"==typeof e?ja(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ii(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&df.throwError("user rejected signing",xi.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return lf(this,void 0,void 0,(function*(){const t="string"==typeof e?ja(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),Ii(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&df.throwError("user rejected signing",xi.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return lf(this,void 0,void 0,(function*(){const n=yield Ic.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Ic.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&df.throwError("user rejected signing",xi.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return lf(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class wf extends vf{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const xf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ef extends nf{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=Us(this.constructor,"defaultUrl")()),js(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(Bs(e))),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 lf(this,void 0,void 0,(function*(){yield mf(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=Us(this.constructor,"getNetwork");try{return t(v.BigNumber.from(e).toNumber())}catch(t){return df.throwError("could not detect network",xi.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return df.throwError("could not detect network",xi.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new vf(bf,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:zs(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=bd(this.connection,JSON.stringify(r),gf).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[yf(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[yf(t.address),t.blockTag]];case"getCode":return["eth_getCode",[yf(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[yf(t.address),Ui(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Us(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Us(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=yf(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return lf(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&v.BigNumber.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=Bs(t)).transaction=Bs(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&df.throwError(e+" not implemented",xi.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return pf(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return mf(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=Bs(xf);if(t)for(const e in t)t[e]&&(r[e]=!0);var n,o;o=r,(n=e)&&"object"==typeof n||Cs.throwArgumentError("invalid object","object",n),Object.keys(n).forEach((e=>{o[e]||Cs.throwArgumentError("invalid object key - "+e,"transaction:"+e,n)}));const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=ji(v.BigNumber.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Ii(e[t]))})),e.accessList&&(i.accessList=_h(e.accessList)),i}}function Af(e){return Number.parseInt(e,16)}new xi(Md);class Rf extends y.Connector{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:Af(e)})})).on("disconnect",(e=>{var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.actions.resetState()})).on("chainChanged",(e=>{this.actions.update({chainId:Af(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return ls(this,void 0,void 0,(function*(){this.actions.startActivation();const e=this.customProvider;try{const[{chainId:t},r]=yield Promise.all([e.getNetwork(),e.listAccounts()]);this.actions.update({chainId:t,accounts:r})}catch(e){throw this.actions.resetState(),e}}))}}function kf([e,t]){return[e,t]}var _f;function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sf.apply(this,arguments)}var Nf,Mf;function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tf.apply(this,arguments)}var Of;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(Of||(Of={}));const If={[Of.METAMASK]:{name:"MetaMask",type:Of.METAMASK,icon:function(e){return S.createElement("svg",Sf({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),_f||(_f=S.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},S.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),S.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),S.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),S.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),S.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),S.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),S.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),S.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),S.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),S.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),S.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),S.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),S.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),S.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),S.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),S.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),S.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),S.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),S.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},S.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),S.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),S.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),S.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),S.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),S.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),S.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),S.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),S.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),S.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),S.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),S.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))))},link:"https://metamask.io"},[Of.WALLET_CONNECT]:{name:"WalletConnect",type:Of.WALLET_CONNECT,icon:function(e){return S.createElement("svg",Tf({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Nf||(Nf=S.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},S.createElement("stop",{offset:0,stopColor:"#5d9df6"}),S.createElement("stop",{offset:1,stopColor:"#006fff"}))),Mf||(Mf=S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("path",{d:"m256 0c141.384896 0 256 114.615104 256 256s-114.615104 256-256 256-256-114.615104-256-256 114.615104-256 256-256z",fill:"url(#a)"}),S.createElement("path",{d:"m64.6917558 37.7088298c51.5328072-50.2784397 135.0839942-50.2784397 186.6167992 0l6.202057 6.0510906c2.57664 2.5139218 2.57664 6.5897948 0 9.1037177l-21.215998 20.6995759c-1.288321 1.2569619-3.3771 1.2569619-4.665421 0l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544 0l-9.1400282 8.9175519c-1.2883217 1.2569609-3.3771016 1.2569609-4.6654208 0l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958 0-9.1037177zm230.4934852 42.8089117 18.882279 18.4227262c2.576627 2.5139103 2.576642 6.5897593.000032 9.1036863l-85.141498 83.070358c-2.576623 2.513941-6.754182 2.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271 0-.000004.000004-.000008.000007-.000012.000011l-60.4269683 58.957408c-2.5766141 2.513947-6.7541746 2.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795 0-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222 6.7541993-2.5139222 9.3308397 0l60.4291347 58.9582758c.6441608.62848 1.6885495.62848 2.3327103 0 .0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398 6.754142-2.5140743 9.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056 58.9583548c.644159.628479 1.688549.628479 2.332709 0l60.428079-58.9571925c2.57664-2.5139231 6.754199-2.5139231 9.330839 0z",fill:"#fff",fillRule:"nonzero",transform:"translate(98 160)"}))))}}},Wf={};function Ff({provider:e,jsonRpcUrlMap:t,defaultChainId:r}){const o=console.error,i=n.useMemo((()=>function(e,t){if(t){if(Ef.isProvider(t))return kf(l.initializeConnector((e=>new Rf(e,t))));if(Ef.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return kf(l.initializeConnector((r=>new p.EIP1193({actions:r,provider:t,onError:e}))))}}(o,e)),[o,e]),s=n.useMemo((()=>function(e){return kf(l.initializeConnector((t=>new g.MetaMask({actions:t,onError:e}))))}(o)),[o]),a=n.useMemo((()=>t?Object.assign(Object.assign({},os),t):os),[t]),c=n.useMemo((()=>function(e,t,r,n){return kf(l.initializeConnector((o=>new m.WalletConnect({actions:o,options:{rpcMap:t,projectId:"59e050d1f27ed617e65bb9637c9498d6",chains:r?[r]:[],showQrModal:e},onError:n,defaultChainId:r}))))}(!0,a,r,o)),[a,r,o]);return i&&(Wf[Of.INTEGRATOR]=i),Wf[Of.METAMASK]=s,Wf[Of.WALLET_CONNECT]=c,Object.values(Wf)}function Cf(){const{chainId:e}=l.useWeb3React(),t=c.useSelector(As);return n.useMemo((()=>e||t||1),[e,t])}var jf={};function Uf(e){e&&(e.value=!0)}function Df(){}function Bf(e){return void 0===e.size&&(e.size=e.__iterate(Pf)),e.size}function Vf(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?Bf(e)+t:t}function Pf(){return!0}function Zf(e,t,r){return(0===e&&!Yf(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function zf(e,t){return Hf(e,t,0)}function Lf(e,t){return Hf(e,t,t)}function Hf(e,t,r){return void 0===e?r:Yf(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function Yf(e){return e<0||0===e&&1/e==-1/0}function Xf(e){return Boolean(e&&e["@@__IMMUTABLE_ITERABLE__@@"])}function Jf(e){return Boolean(e&&e["@@__IMMUTABLE_KEYED__@@"])}function Gf(e){return Boolean(e&&e["@@__IMMUTABLE_INDEXED__@@"])}function qf(e){return Jf(e)||Gf(e)}var Kf=function(e){return Xf(e)?e:yp(e)},Qf=function(e){function t(e){return Jf(e)?e:bp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Kf),$f=function(e){function t(e){return Gf(e)?e:vp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Kf),ep=function(e){function t(e){return Xf(e)&&!qf(e)?e:wp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Kf);Kf.Keyed=Qf,Kf.Indexed=$f,Kf.Set=ep;function tp(e){return Boolean(e&&e["@@__IMMUTABLE_SEQ__@@"])}function rp(e){return Boolean(e&&e["@@__IMMUTABLE_RECORD__@@"])}function np(e){return Xf(e)||rp(e)}var op="@@__IMMUTABLE_ORDERED__@@";function ip(e){return Boolean(e&&e[op])}var sp="function"==typeof Symbol&&Symbol.iterator,ap=sp||"@@iterator",cp=function(e){this.next=e};function up(e,t,r,n){var o=0===e?t:1===e?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function lp(){return{value:void 0,done:!0}}function dp(e){return!!Array.isArray(e)||!!pp(e)}function hp(e){return e&&"function"==typeof e.next}function fp(e){var t=pp(e);return t&&t.call(e)}function pp(e){var t=e&&(sp&&e[sp]||e["@@iterator"]);if("function"==typeof t)return t}cp.prototype.toString=function(){return"[Iterator]"},cp.KEYS=0,cp.VALUES=1,cp.ENTRIES=2,cp.prototype.inspect=cp.prototype.toSource=function(){return this.toString()},cp.prototype[ap]=function(){return this};var mp=Object.prototype.hasOwnProperty;function gp(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var yp=function(e){function t(e){return null==e?kp():np(e)?e.toSeq():function(e){var t=Np(e);if(t)return(n=pp(r=e))&&n===r.entries?t.fromEntrySeq():function(e){var t=pp(e);return t&&t===e.keys}(e)?t.toSetSeq():t;var r,n;if("object"==typeof e)return new Ep(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,o=0;o!==n;){var i=r[t?n-++o:o++];if(!1===e(i[1],i[0],this))break}return o}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,o=0;return new cp((function(){if(o===n)return{value:void 0,done:!0};var i=r[t?n-++o:o++];return up(e,i[0],i[1])}))}return this.__iteratorUncached(e,t)},t}(Kf),bp=function(e){function t(e){return null==e?kp().toKeyedSeq():Xf(e)?Jf(e)?e.toSeq():e.fromEntrySeq():rp(e)?e.toSeq():_p(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(yp),vp=function(e){function t(e){return null==e?kp():Xf(e)?Jf(e)?e.entrySeq():e.toIndexedSeq():rp(e)?e.toSeq().entrySeq():Sp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(yp),wp=function(e){function t(e){return(Xf(e)&&!qf(e)?e:vp(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(yp);yp.isSeq=tp,yp.Keyed=bp,yp.Set=wp,yp.Indexed=vp,yp.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var xp=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[Vf(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,o=0;o!==n;){var i=t?n-++o:o++;if(!1===e(r[i],i,this))break}return o},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,o=0;return new cp((function(){if(o===n)return{value:void 0,done:!0};var i=t?n-++o:o++;return up(e,i,r[i])}))},t}(vp),Ep=function(e){function t(e){var t=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return mp.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,o=n.length,i=0;i!==o;){var s=n[t?o-++i:i++];if(!1===e(r[s],s,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,o=n.length,i=0;return new cp((function(){if(i===o)return{value:void 0,done:!0};var s=n[t?o-++i:i++];return up(e,s,r[s])}))},t}(bp);Ep.prototype[op]=!0;var Ap,Rp=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=fp(this._collection),n=0;if(hp(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=fp(this._collection);if(!hp(r))return new cp(lp);var n=0;return new cp((function(){var t=r.next();return t.done?t:up(e,n++,t.value)}))},t}(vp);function kp(){return Ap||(Ap=new xp([]))}function _p(e){var t=Np(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new Ep(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Sp(e){var t=Np(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function Np(e){return gp(e)?new xp(e):dp(e)?new Rp(e):void 0}function Mp(e){return Boolean(e&&e["@@__IMMUTABLE_MAP__@@"])}function Tp(e){return Mp(e)&&ip(e)}function Op(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function Ip(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(Op(e)&&Op(t)&&e.equals(t))}var Wp="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function Fp(e){return e>>>1&1073741824|3221225471&e}var Cp=Object.prototype.valueOf;function jp(e){if(null==e)return Up(e);if("function"==typeof e.hashCode)return Fp(e.hashCode(e));var t,r=(t=e).valueOf!==Cp&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==r)return Up(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return Fp(t)}(r);case"string":return r.length>Xp?function(e){var t=qp[e];void 0===t&&(t=Dp(e),Gp===Jp&&(Gp=0,qp={}),Gp++,qp[e]=t);return t}(r):Dp(r);case"object":case"function":return function(e){var t;if(zp&&void 0!==(t=Zp.get(e)))return t;if(void 0!==(t=e[Yp]))return t;if(!Vp){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Yp]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=Pp(),zp)Zp.set(e,t);else{if(void 0!==Bp&&!1===Bp(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Vp)Object.defineProperty(e,Yp,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Yp]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Yp]=t}}return t}(r);case"symbol":return function(e){var t=Lp[e];if(void 0!==t)return t;return t=Pp(),Lp[e]=t,t}(r);default:if("function"==typeof r.toString)return Dp(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function Up(e){return null===e?1108378658:1108378659}function Dp(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Fp(t)}var Bp=Object.isExtensible,Vp=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function Pp(){var e=++Hp;return 1073741824&Hp&&(Hp=0),e}var Zp,zp="function"==typeof WeakMap;zp&&(Zp=new WeakMap);var Lp=Object.create(null),Hp=0,Yp="__immutablehash__";"function"==typeof Symbol&&(Yp=Symbol(Yp));var Xp=16,Jp=255,Gp=0,qp={},Kp=function(e){function t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this._iter.get(e,t)},t.prototype.has=function(e){return this._iter.has(e)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var e=this,t=nm(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},t.prototype.map=function(e,t){var r=this,n=rm(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t,n){return e(t,n,r)}),t)},t.prototype.__iterator=function(e,t){return this._iter.__iterator(e,t)},t}(bp);Kp.prototype[op]=!0;var Qp=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return t&&Bf(this),this._iter.__iterate((function(o){return e(o,t?r.size-++n:n++,r)}),t)},t.prototype.__iterator=function(e,t){var r=this,n=this._iter.__iterator(1,t),o=0;return t&&Bf(this),new cp((function(){var i=n.next();return i.done?i:up(e,t?r.size-++o:o++,i.value,i)}))},t}(vp),$p=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new cp((function(){var t=r.next();return t.done?t:up(e,t.value,t.value,t)}))},t}(wp),em=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){pm(t);var n=Xf(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new cp((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){pm(n);var o=Xf(n);return up(e,o?n.get(0):n[0],o?n.get(1):n[1],t)}}}))},t}(bp);function tm(e){var t=gm(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=ym,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new cp((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function rm(e,t,r){var n=gm(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,o){var i=e.get(n,jf);return i===jf?o:t.call(r,i,n,e)},n.__iterateUncached=function(n,o){var i=this;return e.__iterate((function(e,o,s){return!1!==n(t.call(r,e,o,s),o,i)}),o)},n.__iteratorUncached=function(n,o){var i=e.__iterator(2,o);return new cp((function(){var o=i.next();if(o.done)return o;var s=o.value,a=s[0];return up(n,a,t.call(r,s[1],a,e),o)}))},n}function nm(e,t){var r=this,n=gm(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=tm(e);return t.reverse=function(){return e.flip()},t}),n.get=function(r,n){return e.get(t?r:-1-r,n)},n.has=function(r){return e.has(t?r:-1-r)},n.includes=function(t){return e.includes(t)},n.cacheResult=ym,n.__iterate=function(r,n){var o=this,i=0;return n&&Bf(e),e.__iterate((function(e,s){return r(e,t?s:n?o.size-++i:i++,o)}),!n)},n.__iterator=function(n,o){var i=0;o&&Bf(e);var s=e.__iterator(2,!o);return new cp((function(){var e=s.next();if(e.done)return e;var a=e.value;return up(n,t?a[0]:o?r.size-++i:i++,a[1],e)}))},n}function om(e,t,r,n){var o=gm(e);return n&&(o.has=function(n){var o=e.get(n,jf);return o!==jf&&!!t.call(r,o,n,e)},o.get=function(n,o){var i=e.get(n,jf);return i!==jf&&t.call(r,i,n,e)?i:o}),o.__iterateUncached=function(o,i){var s=this,a=0;return e.__iterate((function(e,i,c){if(t.call(r,e,i,c))return a++,o(e,n?i:a-1,s)}),i),a},o.__iteratorUncached=function(o,i){var s=e.__iterator(2,i),a=0;return new cp((function(){for(;;){var i=s.next();if(i.done)return i;var c=i.value,u=c[0],l=c[1];if(t.call(r,l,u,e))return up(o,n?u:a++,l,i)}}))},o}function im(e,t,r,n){var o=e.size;if(Zf(t,r,o))return e;var i=zf(t,o),s=Lf(r,o);if(i!=i||s!=s)return im(e.toSeq().cacheResult(),t,r,n);var a,c=s-i;c==c&&(a=c<0?0:c);var u=gm(e);return u.size=0===a?a:e.size&&a||void 0,!n&&tp(e)&&a>=0&&(u.get=function(t,r){return(t=Vf(this,t))>=0&&t<a?e.get(t+i,r):r}),u.__iterateUncached=function(t,r){var o=this;if(0===a)return 0;if(r)return this.cacheResult().__iterate(t,r);var s=0,c=!0,u=0;return e.__iterate((function(e,r){if(!c||!(c=s++<i))return u++,!1!==t(e,n?r:u-1,o)&&u!==a})),u},u.__iteratorUncached=function(t,r){if(0!==a&&r)return this.cacheResult().__iterator(t,r);if(0===a)return new cp(lp);var o=e.__iterator(t,r),s=0,c=0;return new cp((function(){for(;s++<i;)o.next();if(++c>a)return{value:void 0,done:!0};var e=o.next();return n||1===t||e.done?e:up(t,c-1,0===t?void 0:e.value[1],e)}))},u}function sm(e,t,r,n){var o=gm(e);return o.__iterateUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterate(o,i);var a=!0,c=0;return e.__iterate((function(e,i,u){if(!a||!(a=t.call(r,e,i,u)))return c++,o(e,n?i:c-1,s)})),c},o.__iteratorUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(2,i),c=!0,u=0;return new cp((function(){var e,i,l;do{if((e=a.next()).done)return n||1===o?e:up(o,u++,0===o?void 0:e.value[1],e);var d=e.value;i=d[0],l=d[1],c&&(c=t.call(r,l,i,s))}while(c);return 2===o?e:up(o,i,l,e)}))},o}function am(e,t){var r=Jf(e),n=[e].concat(t).map((function(e){return Xf(e)?r&&(e=Qf(e)):e=r?_p(e):Sp(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var o=n[0];if(o===e||r&&Jf(o)||Gf(e)&&Gf(o))return o}var i=new xp(n);return r?i=i.toKeyedSeq():Gf(e)||(i=i.toSetSeq()),(i=i.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),i}function cm(e,t,r){var n=gm(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var s=0,a=!1;return function e(c,u){c.__iterate((function(i,c){return(!t||u<t)&&Xf(i)?e(i,u+1):(s++,!1===o(i,r?c:s-1,n)&&(a=!0)),!a}),i)}(e,0),s},n.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=e.__iterator(n,o),s=[],a=0;return new cp((function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(2===n&&(c=c[1]),t&&!(s.length<t)||!Xf(c))return r?e:up(n,a++,c,e);s.push(i),i=c.__iterator(n,o)}else i=s.pop()}return{value:void 0,done:!0}}))},n}function um(e,t,r){t||(t=bm);var n=Jf(e),o=0,i=e.toSeq().map((function(t,n){return[n,t,o++,r?r(t,n,e):t]})).valueSeq().toArray();return i.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),n?bp(i):Gf(e)?vp(i):wp(i)}function lm(e,t,r){if(t||(t=bm),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return dm(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return dm(t,e,r)?r:e}))}function dm(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function hm(e,t,r,n){var o=gm(e),i=new xp(r).map((function(e){return e.size}));return o.size=n?i.max():i.min(),o.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),o=0;!(r=n.next()).done&&!1!==e(r.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=Kf(e),fp(o?e.reverse():e)})),s=0,a=!1;return new cp((function(){var r;return a||(r=i.map((function(e){return e.next()})),a=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),a?{value:void 0,done:!0}:up(e,s++,t.apply(null,r.map((function(e){return e.value}))))}))},o}function fm(e,t){return e===t?e:tp(e)?t:e.constructor(t)}function pm(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function mm(e){return Jf(e)?Qf:Gf(e)?$f:ep}function gm(e){return Object.create((Jf(e)?bp:Gf(e)?vp:wp).prototype)}function ym(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):yp.prototype.cacheResult.call(this)}function bm(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e<t?-1:0}function vm(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function wm(e,t){if(!e)throw new Error(t)}function xm(e){wm(e!==1/0,"Cannot perform this action with an infinite size.")}function Em(e){if(gp(e)&&"string"!=typeof e)return e;if(ip(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}Qp.prototype.cacheResult=Kp.prototype.cacheResult=$p.prototype.cacheResult=em.prototype.cacheResult=ym;var Am=Object.prototype.toString;function Rm(e){return"object"==typeof e&&(np(e)||Array.isArray(e)||function(e){if(!e||"object"!=typeof e||"[object Object]"!==Am.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t,n=Object.getPrototypeOf(t);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===t}(e))}function km(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function _m(e,t,r){return np(e)?e.get(t,r):function(e,t){return np(e)?e.has(t):Rm(e)&&mp.call(e,t)}(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function Sm(e){if(Array.isArray(e))return vm(e);var t={};for(var r in e)mp.call(e,r)&&(t[r]=e[r]);return t}function Nm(e,t,r,n){n||(n=r,r=void 0);var o=Mm(np(e),e,Em(t),0,r,n);return o===jf?r:o}function Mm(e,t,r,n,o,i){var s=t===jf;if(n===r.length){var a=s?o:t,c=i(a);return c===a?t:c}if(!s&&!Rm(t))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(km)+"]: "+t);var u=r[n],l=s?jf:_m(t,u,jf),d=Mm(l===jf?e:np(l),l,r,n+1,o,i);return d===l?t:d===jf?function(e,t){if(!Rm(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(np(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!mp.call(e,t))return e;var r=Sm(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}(t,u):function(e,t,r){if(!Rm(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(np(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(mp.call(e,t)&&r===e[t])return e;var n=Sm(e);return n[t]=r,n}(s?e?sg():{}:t,u,d)}function Tm(e,t){return function(e,t,r){return Nm(e,t,jf,(function(){return r}))}(this,e,t)}function Om(e){return function(e,t){return Nm(e,t,(function(){return jf}))}(this,e)}function Im(e,t,r,n){return Nm(e,[t],r,n)}function Wm(e,t,r){return 1===arguments.length?e(this):Im(this,e,t,r)}function Fm(e,t,r){return Nm(this,e,t,r)}function Cm(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Um(this,e)}function jm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return Um(this,t,e)}function Um(e,t,r){for(var n=[],o=0;o<t.length;o++){var i=Qf(t[o]);0!==i.size&&n.push(i)}return 0===n.length?e:0!==e.toSeq().size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var t=r?function(t,n){Im(e,n,jf,(function(e){return e===jf?t:r(e,t,n)}))}:function(t,r){e.set(r,t)},o=0;o<n.length;o++)n[o].forEach(t)})):e.constructor(n[0])}function Dm(e,t,r){return Bm(e,t,function(e){function t(r,n,o){return Rm(r)&&Rm(n)&&(i=n,s=yp(r),a=yp(i),Gf(s)===Gf(a)&&Jf(s)===Jf(a))?Bm(r,[n],t):e?e(r,n,o):n;var i,s,a}return t}(r))}function Bm(e,t,r){if(!Rm(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(np(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),o=e,i=n?$f:Qf,s=n?function(t){o===e&&(o=Sm(o)),o.push(t)}:function(t,n){var i=mp.call(o,n),s=i&&r?r(o[n],t,n):t;i&&s===o[n]||(o===e&&(o=Sm(o)),o[n]=s)},a=0;a<t.length;a++)i(t[a]).forEach(s);return o}function Vm(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Dm(this,e)}function Pm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Dm(this,t,e)}function Zm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Nm(this,e,sg(),(function(e){return Bm(e,t)}))}function zm(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Nm(this,e,sg(),(function(e){return Dm(e,t)}))}function Lm(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Hm(){return this.__ownerID?this:this.__ensureOwner(new Df)}function Ym(){return this.__ensureOwner()}function Xm(){return this.__altered}var Jm=function(e){function t(t){return null==t?sg():Mp(t)&&!ip(t)?t:sg().withMutations((function(r){var n=e(t);xm(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return sg().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return ag(this,e,t)},t.prototype.remove=function(e){return ag(this,e,jf)},t.prototype.deleteAll=function(e){var t=Kf(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):sg()},t.prototype.sort=function(e){return Og(um(this,e))},t.prototype.sortBy=function(e,t){return Og(um(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(o,i){n.set(i,e.call(t,o,i,r))}))}))},t.prototype.__iterator=function(e,t){return new rg(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ig(this.size,this._root,e,this.__hash):0===this.size?sg():(this.__ownerID=e,this.__altered=!1,this)},t}(Qf);Jm.isMap=Mp;var Gm=Jm.prototype;Gm["@@__IMMUTABLE_MAP__@@"]=!0,Gm.delete=Gm.remove,Gm.removeAll=Gm.deleteAll,Gm.setIn=Tm,Gm.removeIn=Gm.deleteIn=Om,Gm.update=Wm,Gm.updateIn=Fm,Gm.merge=Gm.concat=Cm,Gm.mergeWith=jm,Gm.mergeDeep=Vm,Gm.mergeDeepWith=Pm,Gm.mergeIn=Zm,Gm.mergeDeepIn=zm,Gm.withMutations=Lm,Gm.wasAltered=Xm,Gm.asImmutable=Ym,Gm["@@transducer/init"]=Gm.asMutable=Hm,Gm["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Gm["@@transducer/result"]=function(e){return e.asImmutable()};var qm=function(e,t){this.ownerID=e,this.entries=t};qm.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(Ip(r,o[i][0]))return o[i][1];return n},qm.prototype.update=function(e,t,r,n,o,i,s){for(var a=o===jf,c=this.entries,u=0,l=c.length;u<l&&!Ip(n,c[u][0]);u++);var d=u<l;if(d?c[u][1]===o:a)return this;if(Uf(s),(a||!d)&&Uf(i),!a||1!==c.length){if(!d&&!a&&c.length>=fg)return function(e,t,r,n){e||(e=new Df);for(var o=new eg(e,jp(r),[r,n]),i=0;i<t.length;i++){var s=t[i];o=o.update(e,0,void 0,s[0],s[1])}return o}(e,c,n,o);var h=e&&e===this.ownerID,f=h?c:vm(c);return d?a?u===l-1?f.pop():f[u]=f.pop():f[u]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new qm(e,f)}};var Km=function(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r};Km.prototype.get=function(e,t,r,n){void 0===t&&(t=jp(r));var o=1<<(31&(0===e?t:t>>>e)),i=this.bitmap;return 0==(i&o)?n:this.nodes[dg(i&o-1)].get(e+5,t,r,n)},Km.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=jp(n));var a=31&(0===t?r:r>>>t),c=1<<a,u=this.bitmap,l=0!=(u&c);if(!l&&o===jf)return this;var d=dg(u&c-1),h=this.nodes,f=l?h[d]:void 0,p=cg(f,e,t+5,r,n,o,i,s);if(p===f)return this;if(!l&&p&&h.length>=pg)return function(e,t,r,n,o){for(var i=0,s=new Array(32),a=0;0!==r;a++,r>>>=1)s[a]=1&r?t[i++]:void 0;return s[n]=o,new Qm(e,i+1,s)}(e,h,u,a,p);if(l&&!p&&2===h.length&&ug(h[1^d]))return h[1^d];if(l&&p&&1===h.length&&ug(p))return p;var m=e&&e===this.ownerID,g=l?p?u:u^c:u|c,y=l?p?hg(h,d,p,m):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,s=0;s<n;s++)s===t&&(i=1),o[s]=e[s+i];return o}(h,d,m):function(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),s=0,a=0;a<o;a++)a===t?(i[a]=r,s=-1):i[a]=e[a+s];return i}(h,d,p,m);return m?(this.bitmap=g,this.nodes=y,this):new Km(e,g,y)};var Qm=function(e,t,r){this.ownerID=e,this.count=t,this.nodes=r};Qm.prototype.get=function(e,t,r,n){void 0===t&&(t=jp(r));var o=31&(0===e?t:t>>>e),i=this.nodes[o];return i?i.get(e+5,t,r,n):n},Qm.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=jp(n));var a=31&(0===t?r:r>>>t),c=o===jf,u=this.nodes,l=u[a];if(c&&!l)return this;var d=cg(l,e,t+5,r,n,o,i,s);if(d===l)return this;var h=this.count;if(l){if(!d&&--h<mg)return function(e,t,r,n){for(var o=0,i=0,s=new Array(r),a=0,c=1,u=t.length;a<u;a++,c<<=1){var l=t[a];void 0!==l&&a!==n&&(o|=c,s[i++]=l)}return new Km(e,o,s)}(e,u,h,a)}else h++;var f=e&&e===this.ownerID,p=hg(u,a,d,f);return f?(this.count=h,this.nodes=p,this):new Qm(e,h,p)};var $m=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r};$m.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(Ip(r,o[i][0]))return o[i][1];return n},$m.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=jp(n));var a=o===jf;if(r!==this.keyHash)return a?this:(Uf(s),Uf(i),lg(this,e,t,r,[n,o]));for(var c=this.entries,u=0,l=c.length;u<l&&!Ip(n,c[u][0]);u++);var d=u<l;if(d?c[u][1]===o:a)return this;if(Uf(s),(a||!d)&&Uf(i),a&&2===l)return new eg(e,this.keyHash,c[1^u]);var h=e&&e===this.ownerID,f=h?c:vm(c);return d?a?u===l-1?f.pop():f[u]=f.pop():f[u]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new $m(e,this.keyHash,f)};var eg=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r};eg.prototype.get=function(e,t,r,n){return Ip(r,this.entry[0])?this.entry[1]:n},eg.prototype.update=function(e,t,r,n,o,i,s){var a=o===jf,c=Ip(n,this.entry[0]);return(c?o===this.entry[1]:a)?this:(Uf(s),a?void Uf(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new eg(e,this.keyHash,[n,o]):(Uf(i),lg(this,e,t,jp(n),[n,o])))},qm.prototype.iterate=$m.prototype.iterate=function(e,t){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(!1===e(r[t?o-n:n]))return!1},Km.prototype.iterate=Qm.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[t?o-n:n];if(i&&!1===i.iterate(e,t))return!1}},eg.prototype.iterate=function(e,t){return e(this.entry)};var tg,rg=function(e){function t(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&og(e._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r=t.node,n=t.index++,o=void 0;if(r.entry){if(0===n)return ng(e,r.entry)}else if(r.entries){if(n<=(o=r.entries.length-1))return ng(e,r.entries[this._reverse?o-n:n])}else if(n<=(o=r.nodes.length-1)){var i=r.nodes[this._reverse?o-n:n];if(i){if(i.entry)return ng(e,i.entry);t=this._stack=og(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}},t}(cp);function ng(e,t){return up(e,t[0],t[1])}function og(e,t){return{node:e,index:0,__prev:t}}function ig(e,t,r,n){var o=Object.create(Gm);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function sg(){return tg||(tg=ig(0))}function ag(e,t,r){var n,o;if(e._root){var i={value:!1},s={value:!1};if(n=cg(e._root,e.__ownerID,0,void 0,t,r,i,s),!s.value)return e;o=e.size+(i.value?r===jf?-1:1:0)}else{if(r===jf)return e;o=1,n=new qm(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?ig(o,n):sg()}function cg(e,t,r,n,o,i,s,a){return e?e.update(t,r,n,o,i,s,a):i===jf?e:(Uf(a),Uf(s),new eg(t,n,[o,i]))}function ug(e){return e.constructor===eg||e.constructor===$m}function lg(e,t,r,n,o){if(e.keyHash===n)return new $m(t,n,[e.entry,o]);var i,s=31&(0===r?e.keyHash:e.keyHash>>>r),a=31&(0===r?n:n>>>r),c=s===a?[lg(e,t,r+5,n,o)]:(i=new eg(t,n,o),s<a?[e,i]:[i,e]);return new Km(t,1<<s|1<<a,c)}function dg(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function hg(e,t,r,n){var o=n?e:vm(e);return o[t]=r,o}var fg=8,pg=16,mg=8;function gg(e){return Boolean(e&&e["@@__IMMUTABLE_LIST__@@"])}var yg=function(e){function t(t){var r=Rg();if(null==t)return r;if(gg(t))return t;var n=e(t),o=n.size;return 0===o?r:(xm(o),o>0&&o<32?Ag(0,o,5,null,new vg(n.toArray())):r.withMutations((function(e){e.setSize(o),n.forEach((function(t,r){return e.set(r,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=Vf(this,e))>=0&&e<this.size){var r=Sg(this,e+=this._origin);return r&&r.array[31&e]}return t},t.prototype.set=function(e,t){return function(e,t,r){if((t=Vf(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Ng(e,t).set(0,r):Ng(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,o=e._root,i={value:!1};t>=Mg(e._capacity)?n=kg(n,e.__ownerID,0,t,r,i):o=kg(o,e.__ownerID,e._level,t,r,i);if(!i.value)return e;if(e.__ownerID)return e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return Ag(e._origin,e._capacity,e._level,o,n)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Rg()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){Ng(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},t.prototype.pop=function(){return Ng(this,0,-1)},t.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Ng(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},t.prototype.shift=function(){return Ng(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++){var o=t[n],i=e("string"!=typeof o&&dp(o)?o:[o]);0!==i.size&&r.push(i)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(e){r.forEach((function(t){return t.forEach((function(t){return e.push(t)}))}))})):this.constructor(r[0])},t.prototype.setSize=function(e){return Ng(this,0,e)},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){for(var o=0;o<r.size;o++)n.set(o,e.call(t,n.get(o),o,r))}))},t.prototype.slice=function(e,t){var r=this.size;return Zf(e,t,r)?this:Ng(this,zf(e,r),Lf(t,r))},t.prototype.__iterator=function(e,t){var r=t?this.size:0,n=Eg(this,t);return new cp((function(){var o=n();return o===xg?{value:void 0,done:!0}:up(e,t?--r:r++,o)}))},t.prototype.__iterate=function(e,t){for(var r,n=t?this.size:0,o=Eg(this,t);(r=o())!==xg&&!1!==e(r,t?--n:n++,this););return n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ag(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):0===this.size?Rg():(this.__ownerID=e,this.__altered=!1,this)},t}($f);yg.isList=gg;var bg=yg.prototype;bg["@@__IMMUTABLE_LIST__@@"]=!0,bg.delete=bg.remove,bg.merge=bg.concat,bg.setIn=Tm,bg.deleteIn=bg.removeIn=Om,bg.update=Wm,bg.updateIn=Fm,bg.mergeIn=Zm,bg.mergeDeepIn=zm,bg.withMutations=Lm,bg.wasAltered=Xm,bg.asImmutable=Ym,bg["@@transducer/init"]=bg.asMutable=Hm,bg["@@transducer/step"]=function(e,t){return e.push(t)},bg["@@transducer/result"]=function(e){return e.asImmutable()};var vg=function(e,t){this.array=e,this.ownerID=t};vg.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&31;if(n>=this.array.length)return new vg([],e);var o,i=0===n;if(t>0){var s=this.array[n];if((o=s&&s.removeBefore(e,t-5,r))===s&&i)return this}if(i&&!o)return this;var a=_g(this,e);if(!i)for(var c=0;c<n;c++)a.array[c]=void 0;return o&&(a.array[n]=o),a},vg.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,o=r-1>>>t&31;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((n=i&&i.removeAfter(e,t-5,r))===i&&o===this.array.length-1)return this}var s=_g(this,e);return s.array.splice(o+1),n&&(s.array[o]=n),s};var wg,xg={};function Eg(e,t){var r=e._origin,n=e._capacity,o=Mg(n),i=e._tail;return s(e._root,e._level,0);function s(e,a,c){return 0===a?function(e,s){var a=s===o?i&&i.array:e&&e.array,c=s>r?0:r-s,u=n-s;u>32&&(u=32);return function(){if(c===u)return xg;var e=t?--u:c++;return a&&a[e]}}(e,c):function(e,o,i){var a,c=e&&e.array,u=i>r?0:r-i>>o,l=1+(n-i>>o);l>32&&(l=32);return function(){for(;;){if(a){var e=a();if(e!==xg)return e;a=null}if(u===l)return xg;var r=t?--l:u++;a=s(c&&c[r],o-5,i+(r<<o))}}}(e,a,c)}}function Ag(e,t,r,n,o,i,s){var a=Object.create(bg);return a.size=t-e,a._origin=e,a._capacity=t,a._level=r,a._root=n,a._tail=o,a.__ownerID=i,a.__hash=s,a.__altered=!1,a}function Rg(){return wg||(wg=Ag(0,0,5))}function kg(e,t,r,n,o,i){var s,a=n>>>r&31,c=e&&a<e.array.length;if(!c&&void 0===o)return e;if(r>0){var u=e&&e.array[a],l=kg(u,t,r-5,n,o,i);return l===u?e:((s=_g(e,t)).array[a]=l,s)}return c&&e.array[a]===o?e:(i&&Uf(i),s=_g(e,t),void 0===o&&a===s.array.length-1?s.array.pop():s.array[a]=o,s)}function _g(e,t){return t&&e&&t===e.ownerID?e:new vg(e?e.array.slice():[],t)}function Sg(e,t){if(t>=Mg(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&31],n-=5;return r}}function Ng(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new Df,o=e._origin,i=e._capacity,s=o+t,a=void 0===r?i:r<0?i+r:o+r;if(s===o&&a===i)return e;if(s>=a)return e.clear();for(var c=e._level,u=e._root,l=0;s+l<0;)u=new vg(u&&u.array.length?[void 0,u]:[],n),l+=1<<(c+=5);l&&(s+=l,o+=l,a+=l,i+=l);for(var d=Mg(i),h=Mg(a);h>=1<<c+5;)u=new vg(u&&u.array.length?[u]:[],n),c+=5;var f=e._tail,p=h<d?Sg(e,a-1):h>d?new vg([],n):f;if(f&&h>d&&s<i&&f.array.length){for(var m=u=_g(u,n),g=c;g>5;g-=5){var y=d>>>g&31;m=m.array[y]=_g(m.array[y],n)}m.array[d>>>5&31]=f}if(a<i&&(p=p&&p.removeAfter(n,0,a)),s>=h)s-=h,a-=h,c=5,u=null,p=p&&p.removeBefore(n,0,s);else if(s>o||h<d){for(l=0;u;){var b=s>>>c&31;if(b!==h>>>c&31)break;b&&(l+=(1<<c)*b),c-=5,u=u.array[b]}u&&s>o&&(u=u.removeBefore(n,c,s-l)),u&&h<d&&(u=u.removeAfter(n,c,h-l)),l&&(s-=l,a-=l)}return e.__ownerID?(e.size=a-s,e._origin=s,e._capacity=a,e._level=c,e._root=u,e._tail=p,e.__hash=void 0,e.__altered=!0,e):Ag(s,a,c,u,p)}function Mg(e){return e<32?0:e-1>>>5<<5}var Tg,Og=function(e){function t(e){return null==e?Wg():Tp(e)?e:Wg().withMutations((function(t){var r=Qf(e);xm(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Wg()},t.prototype.set=function(e,t){return Fg(this,e,t)},t.prototype.remove=function(e){return Fg(this,e,jf)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?Ig(t,r,e,this.__hash):0===this.size?Wg():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(Jm);function Ig(e,t,r,n){var o=Object.create(Og.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Wg(){return Tg||(Tg=Ig(sg(),Rg()))}function Fg(e,t,r){var n,o,i=e._map,s=e._list,a=i.get(t),c=void 0!==a;if(r===jf){if(!c)return e;s.size>=32&&s.size>=2*i.size?(n=(o=s.filter((function(e,t){return void 0!==e&&a!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=o.__ownerID=e.__ownerID)):(n=i.remove(t),o=a===s.size-1?s.pop():s.set(a,void 0))}else if(c){if(r===s.get(a)[1])return e;n=i,o=s.set(a,[t,r])}else n=i.set(t,s.size),o=s.set(s.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=o,e.__hash=void 0,e.__altered=!0,e):Ig(n,o)}Og.isOrderedMap=Tp,Og.prototype[op]=!0,Og.prototype.delete=Og.prototype.remove;function Cg(e){return Boolean(e&&e["@@__IMMUTABLE_STACK__@@"])}var jg=function(e){function t(e){return null==e?Vg():Cg(e)?e:Vg().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=Vf(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):Bg(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&Cg(t))return t;xm(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Bg(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Vg()},t.prototype.slice=function(t,r){if(Zf(t,r,this.size))return this;var n=zf(t,this.size);if(Lf(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):Bg(o,i)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Bg(this.size,this._head,e,this.__hash):0===this.size?Vg():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new xp(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,o=this._head;o&&!1!==e(o.value,n++,this);)o=o.next;return n},t.prototype.__iterator=function(e,t){if(t)return new xp(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new cp((function(){if(n){var t=n.value;return n=n.next,up(e,r++,t)}return{value:void 0,done:!0}}))},t}($f);jg.isStack=Cg;var Ug,Dg=jg.prototype;function Bg(e,t,r,n){var o=Object.create(Dg);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Vg(){return Ug||(Ug=Bg(0))}Dg["@@__IMMUTABLE_STACK__@@"]=!0,Dg.shift=Dg.pop,Dg.unshift=Dg.push,Dg.unshiftAll=Dg.pushAll,Dg.withMutations=Lm,Dg.wasAltered=Xm,Dg.asImmutable=Ym,Dg["@@transducer/init"]=Dg.asMutable=Hm,Dg["@@transducer/step"]=function(e,t){return e.unshift(t)},Dg["@@transducer/result"]=function(e){return e.asImmutable()};function Pg(e){return Boolean(e&&e["@@__IMMUTABLE_SET__@@"])}function Zg(e){return Pg(e)&&ip(e)}function zg(e,t){if(e===t)return!0;if(!Xf(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||Jf(e)!==Jf(t)||Gf(e)!==Gf(t)||ip(e)!==ip(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!qf(e);if(ip(e)){var n=e.entries();return t.every((function(e,t){var o=n.next().value;return o&&Ip(o[1],e)&&(r||Ip(o[0],t))}))&&n.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var s=!0,a=t.__iterate((function(t,n){if(r?!e.has(t):o?!Ip(t,e.get(n,jf)):!Ip(e.get(n,jf),t))return s=!1,!1}));return s&&e.size===a}function Lg(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function Hg(e){if(!e||"object"!=typeof e)return e;if(!Xf(e)){if(!Rm(e))return e;e=yp(e)}if(Jf(e)){var t={};return e.__iterate((function(e,r){t[r]=Hg(e)})),t}var r=[];return e.__iterate((function(e){r.push(Hg(e))})),r}var Yg=function(e){function t(t){return null==t?Kg():Pg(t)&&!ip(t)?t:Kg().withMutations((function(r){var n=e(t);xm(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(Qf(e).keySeq())},t.intersect=function(e){return(e=Kf(e).toArray()).length?Jg.intersect.apply(t(e.pop()),e):Kg()},t.union=function(e){return(e=Kf(e).toArray()).length?Jg.union.apply(t(e.pop()),e):Kg()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return Gg(this,this._map.set(e,e))},t.prototype.remove=function(e){return Gg(this,this._map.remove(e))},t.prototype.clear=function(){return Gg(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,o=Gg(this,this._map.mapEntries((function(o){var i=o[1],s=e.call(t,i,i,r);return s!==i&&(n=!0),[s,s]}),t));return n?o:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return t=t.filter((function(e){return 0!==e.size})),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n<t.length;n++)e(t[n]).forEach((function(e){return r.add(e)}))})):this.constructor(t[0])},t.prototype.intersect=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.every((function(t){return t.includes(e)}))||n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.subtract=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.some((function(t){return t.includes(e)}))&&n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.sort=function(e){return my(um(this,e))},t.prototype.sortBy=function(e,t){return my(um(this,t,e))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){return this._map.__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):0===this.size?this.__empty():(this.__ownerID=e,this._map=t,this)},t}(ep);Yg.isSet=Pg;var Xg,Jg=Yg.prototype;function Gg(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function qg(e,t){var r=Object.create(Jg);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Kg(){return Xg||(Xg=qg(sg()))}Jg["@@__IMMUTABLE_SET__@@"]=!0,Jg.delete=Jg.remove,Jg.merge=Jg.concat=Jg.union,Jg.withMutations=Lm,Jg.asImmutable=Ym,Jg["@@transducer/init"]=Jg.asMutable=Hm,Jg["@@transducer/step"]=function(e,t){return e.add(t)},Jg["@@transducer/result"]=function(e){return e.asImmutable()},Jg.__empty=Kg,Jg.__make=qg;var Qg,$g=function(e){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);if(wm(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(Qg)return Qg;Qg=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},t.prototype.get=function(e,t){return this.has(e)?this._start+Vf(this,e)*this._step:t},t.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},t.prototype.slice=function(e,r){return Zf(e,r,this.size)?this:(e=zf(e,this.size),(r=Lf(r,this.size))<=e?new t(0,0):new t(this.get(e,this._end),this.get(r,this._end),this._step))},t.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},t.prototype.lastIndexOf=function(e){return this.indexOf(e)},t.prototype.__iterate=function(e,t){for(var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;i!==r&&!1!==e(o,t?r-++i:i++,this);)o+=t?-n:n;return i},t.prototype.__iterator=function(e,t){var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;return new cp((function(){if(i===r)return{value:void 0,done:!0};var s=o;return o+=t?-n:n,up(e,t?r-++i:i++,s)}))},t.prototype.equals=function(e){return e instanceof t?this._start===e._start&&this._end===e._end&&this._step===e._step:zg(this,e)},t}(vp);function ey(e,t,r){for(var n=Em(t),o=0;o!==n.length;)if((e=_m(e,n[o++],jf))===jf)return r;return e}function ty(e,t){return ey(this,e,t)}function ry(){xm(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e}Kf.isIterable=Xf,Kf.isKeyed=Jf,Kf.isIndexed=Gf,Kf.isAssociative=qf,Kf.isOrdered=ip,Kf.Iterator=cp,Lg(Kf,{toArray:function(){xm(this.size);var e=new Array(this.size||0),t=Jf(this),r=0;return this.__iterate((function(n,o){e[r++]=t?[o,n]:n})),e},toIndexedSeq:function(){return new Qp(this)},toJS:function(){return Hg(this)},toKeyedSeq:function(){return new Kp(this,!0)},toMap:function(){return Jm(this.toKeyedSeq())},toObject:ry,toOrderedMap:function(){return Og(this.toKeyedSeq())},toOrderedSet:function(){return my(Jf(this)?this.valueSeq():this)},toSet:function(){return Yg(Jf(this)?this.valueSeq():this)},toSetSeq:function(){return new $p(this)},toSeq:function(){return Gf(this)?this.toIndexedSeq():Jf(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return jg(Jf(this)?this.valueSeq():this)},toList:function(){return yg(Jf(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return fm(this,am(this,e))},includes:function(e){return this.some((function(t){return Ip(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){xm(this.size);var r=!0;return this.__iterate((function(n,o,i){if(!e.call(t,n,o,i))return r=!1,!1})),r},filter:function(e,t){return fm(this,om(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return xm(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){xm(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return fm(this,rm(this,e,t))},reduce:function(e,t,r){return ay(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return ay(this,e,t,r,arguments.length<2,!0)},reverse:function(){return fm(this,nm(this,!0))},slice:function(e,t){return fm(this,im(this,e,t,!0))},some:function(e,t){return!this.every(ly(e),t)},sort:function(e){return fm(this,um(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return Bf(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=Jm().asMutable();return e.__iterate((function(o,i){n.update(t.call(r,o,i,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return zg(this,e)},entrySeq:function(){var e=this;if(e._cache)return new xp(e._cache);var t=e.toSeq().map(uy).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(ly(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(Pf,null,e)},flatMap:function(e,t){return fm(this,function(e,t,r){var n=mm(e);return e.toSeq().map((function(o,i){return n(t.call(r,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return fm(this,cm(this,e,!0))},fromEntrySeq:function(){return new em(this)},get:function(e,t){return this.find((function(t,r){return Ip(r,e)}),void 0,t)},getIn:ty,groupBy:function(e,t){return function(e,t,r){var n=Jf(e),o=(ip(e)?Og():Jm()).asMutable();e.__iterate((function(i,s){o.update(t.call(r,i,s,e),(function(e){return(e=e||[]).push(n?[s,i]:i),e}))}));var i=mm(e);return o.map((function(t){return fm(e,i(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,jf)!==jf},hasIn:function(e){return ey(this,e,jf)!==jf},isSubset:function(e){return e="function"==typeof e.includes?e:Kf(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:Kf(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return Ip(t,e)}))},keySeq:function(){return this.toSeq().map(cy).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return lm(this,e)},maxBy:function(e,t){return lm(this,t,e)},min:function(e){return lm(this,e?dy(e):fy)},minBy:function(e,t){return lm(this,t?dy(t):fy,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return fm(this,sm(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(ly(e),t)},sortBy:function(e,t){return fm(this,um(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return fm(this,function(e,t,r){var n=gm(e);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var s=0;return e.__iterate((function(e,o,a){return t.call(r,e,o,a)&&++s&&n(e,o,i)})),s},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var s=e.__iterator(2,o),a=!0;return new cp((function(){if(!a)return{value:void 0,done:!0};var e=s.next();if(e.done)return e;var o=e.value,c=o[0],u=o[1];return t.call(r,u,c,i)?2===n?e:up(n,c,u,e):(a=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(ly(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=ip(e),r=Jf(e),n=t?1:0,o=e.__iterate(r?t?function(e,t){n=31*n+py(jp(e),jp(t))|0}:function(e,t){n=n+py(jp(e),jp(t))|0}:t?function(e){n=31*n+jp(e)|0}:function(e){n=n+jp(e)|0});return function(e,t){return t=Wp(t,3432918353),t=Wp(t<<15|t>>>-15,461845907),t=Wp(t<<13|t>>>-13,5),t=Wp((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Fp((t=Wp(t^t>>>13,3266489909))^t>>>16)}(o,n)}(this))}});var ny=Kf.prototype;ny["@@__IMMUTABLE_ITERABLE__@@"]=!0,ny[ap]=ny.values,ny.toJSON=ny.toArray,ny.__toStringMapper=km,ny.inspect=ny.toSource=function(){return this.toString()},ny.chain=ny.flatMap,ny.contains=ny.includes,Lg(Qf,{flip:function(){return fm(this,tm(this))},mapEntries:function(e,t){var r=this,n=0;return fm(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return fm(this,this.toSeq().flip().map((function(n,o){return e.call(t,n,o,r)})).flip())}});var oy=Qf.prototype;oy["@@__IMMUTABLE_KEYED__@@"]=!0,oy[ap]=ny.entries,oy.toJSON=ry,oy.__toStringMapper=function(e,t){return km(t)+": "+km(e)},Lg($f,{toKeyedSeq:function(){return new Kp(this,!1)},filter:function(e,t){return fm(this,om(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return fm(this,nm(this,!1))},slice:function(e,t){return fm(this,im(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=zf(e,e<0?this.count():this.size);var n=this.slice(0,e);return fm(this,1===r?n:n.concat(vm(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return fm(this,cm(this,e,!1))},get:function(e,t){return(e=Vf(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=Vf(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return fm(this,function(e,t){var r=gm(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var o=this,i=0;return e.__iterate((function(e){return(!i||!1!==r(t,i++,o))&&!1!==r(e,i++,o)}),n),i},r.__iteratorUncached=function(r,n){var o,i=e.__iterator(1,n),s=0;return new cp((function(){return(!o||s%2)&&(o=i.next()).done?o:s%2?up(r,s++,t):up(r,s++,o.value,o)}))},r}(this,e))},interleave:function(){var e=[this].concat(vm(arguments)),t=hm(this.toSeq(),vp.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),fm(this,r)},keySeq:function(){return $g(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return fm(this,sm(this,e,t,!1))},zip:function(){var e=[this].concat(vm(arguments));return fm(this,hm(this,hy,e))},zipAll:function(){var e=[this].concat(vm(arguments));return fm(this,hm(this,hy,e,!0))},zipWith:function(e){var t=vm(arguments);return t[0]=this,fm(this,hm(this,e,t))}});var iy=$f.prototype;iy["@@__IMMUTABLE_INDEXED__@@"]=!0,iy[op]=!0,Lg(ep,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var sy=ep.prototype;function ay(e,t,r,n,o,i){return xm(e.size),e.__iterate((function(e,i,s){o?(o=!1,r=e):r=t.call(n,r,e,i,s)}),i),r}function cy(e,t){return t}function uy(e,t){return[t,e]}function ly(e){return function(){return!e.apply(this,arguments)}}function dy(e){return function(){return-e.apply(this,arguments)}}function hy(){return vm(arguments)}function fy(e,t){return e<t?1:e>t?-1:0}function py(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}sy.has=ny.includes,sy.contains=sy.includes,sy.keys=sy.values,Lg(bp,oy),Lg(vp,iy),Lg(wp,sy);var my=function(e){function t(e){return null==e?vy():Zg(e)?e:vy().withMutations((function(t){var r=ep(e);xm(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(Qf(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(Yg);my.isOrderedSet=Zg;var gy,yy=my.prototype;function by(e,t){var r=Object.create(yy);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function vy(){return gy||(gy=by(Wg()))}yy[op]=!0,yy.zip=iy.zip,yy.zipWith=iy.zipWith,yy.zipAll=iy.zipAll,yy.__empty=vy,yy.__make=by;var wy=function(e,t){var r;!function(e){if(rp(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(np(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(i){var s=this;if(i instanceof n)return i;if(!(this instanceof n))return new n(i);if(!r){r=!0;var a=Object.keys(e),c=o._indices={};o._name=t,o._keys=a,o._defaultValues=e;for(var u=0;u<a.length;u++){var l=a[u];c[l]=u,o[l]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+Ay(this)+' with property "'+l+'" since that property name is part of the Record API.'):ky(o,l)}}return this.__ownerID=void 0,this._values=yg().withMutations((function(e){e.setSize(s._keys.length),Qf(i).forEach((function(t,r){e.set(s._indices[r],t===s._defaultValues[r]?void 0:t)}))})),this},o=n.prototype=Object.create(xy);return o.constructor=n,t&&(n.displayName=t),n};wy.prototype.toString=function(){for(var e,t=Ay(this)+" { ",r=this._keys,n=0,o=r.length;n!==o;n++)t+=(n?", ":"")+(e=r[n])+": "+km(this.get(e));return t+" }"},wy.prototype.equals=function(e){return this===e||rp(e)&&Ry(this).equals(Ry(e))},wy.prototype.hashCode=function(){return Ry(this).hashCode()},wy.prototype.has=function(e){return this._indices.hasOwnProperty(e)},wy.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._indices[e],n=this._values.get(r);return void 0===n?this._defaultValues[e]:n},wy.prototype.set=function(e,t){if(this.has(e)){var r=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(r!==this._values&&!this.__ownerID)return Ey(this,r)}return this},wy.prototype.remove=function(e){return this.set(e)},wy.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:Ey(this,e)},wy.prototype.wasAltered=function(){return this._values.wasAltered()},wy.prototype.toSeq=function(){return Ry(this)},wy.prototype.toJS=function(){return Hg(this)},wy.prototype.entries=function(){return this.__iterator(2)},wy.prototype.__iterator=function(e,t){return Ry(this).__iterator(e,t)},wy.prototype.__iterate=function(e,t){return Ry(this).__iterate(e,t)},wy.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?Ey(this,t,e):(this.__ownerID=e,this._values=t,this)},wy.isRecord=rp,wy.getDescriptiveName=Ay;var xy=wy.prototype;function Ey(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function Ay(e){return e.constructor.displayName||e.constructor.name||"Record"}function Ry(e){return _p(e._keys.map((function(t){return[t,e.get(t)]})))}function ky(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){wm(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch(e){}}xy["@@__IMMUTABLE_RECORD__@@"]=!0,xy.delete=xy.remove,xy.deleteIn=xy.removeIn=Om,xy.getIn=ty,xy.hasIn=ny.hasIn,xy.merge=Cm,xy.mergeWith=jm,xy.mergeIn=Zm,xy.mergeDeep=Vm,xy.mergeDeepWith=Pm,xy.mergeDeepIn=zm,xy.setIn=Tm,xy.update=Wm,xy.updateIn=Fm,xy.withMutations=Lm,xy.asMutable=Hm,xy.asImmutable=Ym,xy[ap]=xy.entries,xy.toJSON=xy.toObject=ny.toObject,xy.inspect=xy.toSource=function(){return this.toString()};var _y;function Sy(){const e=Cf(),[t,r]=n.useState(_y.Initial),[o,i]=n.useState(yg([])),s=n.useCallback((()=>ls(this,void 0,void 0,(function*(){try{r(_y.Loading);const t=(e=>({[ns.ARBITRUM_ONE]:"https://tokens.coingecko.com/arbitrum-one/all.json",[ns.AURORA]:"https://tokens.coingecko.com/aurora/all.json",[ns.BSC]:"https://tokens.coingecko.com/binance-smart-chain/all.json"}[e]||"https://tokens.coingecko.com/uniswap/all.json"))(e),n=yield I.default.get(t);n&&n.data&&n.data.tokens&&i(yg(n.data.tokens)),r(_y.Success)}catch(e){r(_y.Failed),console.error(e)}}))),[e]);return n.useEffect((()=>{e&&s()}),[e]),{cgTokenList:o,loading:t===_y.Loading,refetch:s}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(_y||(_y={}));var Ny=[{chainId:1,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:1,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1,address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/xZmadzpVOnpuq2jNG_5EGKeqMET0LU_gmfnp4VxkcxI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSHQwWXZKMGNnU0lGTFM0aHExTV9jOXVITV9fMHpXaHBKSGVOQU5neTBuby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkoxYzJSZk4ySTJOalJpWWpReVpDOWlkWE5rWHpkaU5qWTBZbUkwTW1RdWNHNW4ucG5n.webp"},{chainId:1,address:"0x6b175474e89094c44da98b954eedeac495271d0f",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/h2lbKBfBJ2LNSTNCuwjsBkshT4eXzDDmAV0lhWS0llA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUnVJNWt2eHBwalI4TTZsenFZZVAyTTB4eVFMUGJ0S1hONDdWVTN1dUszZy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpBNU5qUmpPVFUxT1M1d2JtYy5wbmc.webp"},{chainId:1,address:"0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:1,address:"0xdac17f958d2ee523a2206206994597c13d831ec7",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/mI69kq-S-tNT1W57qYizPd5r2WNFzpAq5y6NhOcrTkY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVEZhSVNLVVZIWThLTVhyTkVmZDRXRUJmMGJoSHRweHY3Q1hDT0dKbGY2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT0dVeFpEaG1PVEEyWlM1d2JtYy5wbmc.webp"},{chainId:4,address:"0x99cf6999fc481663fb10be55827f3584e3c25f3c",name:"LINE",decimals:18,symbol:"LINE",logoURI:""},{chainId:4,address:"0xeaa70c2a40820dF9D38149C84dd943CFcB562587",name:"DODO",decimals:18,symbol:"DODO",logoURI:""},{chainId:4,address:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:""},{chainId:4,address:"0xab0733588776B8881F7712f6AbCa98F510e6B63D",name:"USDC",decimals:6,symbol:"USDC",logoURI:""},{chainId:4,address:"0x0aDCBAE18580120667f7Ff6c6451A426B13c67B7",name:"USDT Token",decimals:6,symbol:"USDT",logoURI:""},{chainId:4,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:""},{chainId:5,symbol:"USDC",address:"0xC4106029d03c33731Ca01Ba59b5A6368c660E596",name:"USDC",decimals:6,logoURI:""},{chainId:5,symbol:"USDT",address:"0xed8a325D87D3b6edED04FB992A1482231647EE5e",name:"USDT Token",decimals:6,logoURI:""},{chainId:5,symbol:"WETH",address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",name:"Wrapped Ether",decimals:18,logoURI:""},{chainId:5,symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,logoURI:""},{chainId:56,address:"0xe9e7cea3dedca5984780bafc599bd69add087d56",name:"BUSD Token",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/BvxyffA5gsLB4bLmlOVkfu7AVami78-VcW_6_i8I6kc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vbC1Sa25meFB3ZXlCOGVYSWJ2b04wdHczLTlzckZOckxfRHdTTnRLSHVRRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZlluVnpaRjgyTXpsbFlqZzNZV0V4WDJKMWMyUmZOak01WldJNE4yRmhNVjlsT1dVMVlXRTBOemxtTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0x55d398326f99059ff775485246999027b3197955",name:"Tether USD",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/QOl7CvP_WSmTUOMthbxQsNKjDj0s5kSjup69dW_-UeA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTjdQU3RXV2ZGaGNTVzM1QlE2TEJIaF9keVROUEJqa1RLTXRwTll5cEhSWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZmRYTmtkRjh4TlRZME1XWmpaRFF3WDNWelpIUmZNVFUyTkRGbVkyUTBNRjlqWmpJMVpUYzVZVE5qTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:56,address:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",name:"BTCB Token",decimals:18,symbol:"BTCB",logoURI:"https://cmp.dodoex.io/fZG0z_RZ1U73_LuuC3RGrrZvNR-bgrCUjkwvaro-PCY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZ1NXN0RuYWNkMnc2YWxSQnFmcENqTHNDZWJhc2VtQTc0dDJlTEdDZjhfNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpJNVlXRmpZamxoTVM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3",name:"Dai Token",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/bhz9Vtma8hPb_-GnhwqQkhfTQ5PwKcR1Qbzn7aBKlfs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZW04OHB4YXNDdEg0Nl9BcjhVandzZWR2SFBFUUtjVWVkc0FmV2lvenB2Yy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWVRoaFptSmxaRFppWkM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:56,address:"0x2170ed0880ac9a755fd29b2688956bd959f933f8",name:"Ethereum Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:56,address:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",name:"Binance-Peg USD Coin",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:56,address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",name:"Wrapped BNB",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/-Pua5rc9k9iW4yuF5ajLVKzMkRhBq06D8HiEZ5gjezA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDZOWTdBTmdOYWdFOHpXYUMtX2IzYXVPOUxsTEp6QlpLTUR3VlM5eW9DQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT1dRellXTmtZMlEzTnk1d2JtYy5wbmc.webp"},{chainId:128,address:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f",name:"Wrapped HT",decimals:18,symbol:"WHT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x0298c2b32eae4da002a15f36fdf7615bea3da047",name:"Heco-Peg HUSD Token",decimals:8,symbol:"HUSD",logoURI:"https://cmp.dodoex.io/LiOyD0GGt0t4bk4xz3RWAxvqFPyYCqfM4z0AqneT3xM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVXRWWnNCVUxTREZNR002SUM0OGI0VV9UV05oYUU4MzFkdnh1Y1hkLTE2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTkRjM09WODFZbU0yWVdFek9EUTRMbkJ1WncucG5n.webp"},{chainId:128,address:"0x3d760a45d0887dfd89a2f5385a236b29cb46ed2a",name:"Heco-Peg DAIHECO Token",decimals:18,symbol:"DAI-HECO",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:128,address:"0x64ff637fb478863b7468bc97d30a5bf3a428a1fd",name:"Heco-Peg ETH Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:128,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"HT",decimals:18,symbol:"HT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x9362bbef4b8313a8aa9f0c9808b80577aa26b73b",name:"Heco-Peg USDCHECO Token",decimals:6,symbol:"USDC-HECO",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:128,address:"0xa71edc38d189767582c38a3145b5873052c3e47a",name:"Heco-Peg USDTHECO Token",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:137,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MATIC",decimals:18,symbol:"MATIC",logoURI:"https://cmp.dodoex.io/cQFrEB6yGIqMkh_6Pie8VR3kIStL58IS-y8FbroHVwA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2VNUUk2dkpoaXljeldrczJaWWdGdk8zSEoxSWFIa053LXZYeXFneER4US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekZmTWpkbE56TXlNRE13TWk4eFh6STNaVGN6TWpBek1ESXVjRzVuLnBuZw.webp"},{chainId:137,address:"0xe4bf2864ebec7b7fdf6eeca9bacae7cdfdaffe78",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/KEPetVp3nQkB6BZ_cb05trEfBbGxFEg92UnF8NZsEzM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE5wTlRseEJGbFRDalM1ZFh3SWJ3Mm1hZ3NPUFFkZ3Z1UEhuZDZrNWdyMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk4yUTBaamxtTldOaU15OUVUMFJQWHpka05HWTVaalZqWWpNdWNHNW4ucG5n.webp"},{chainId:137,address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/hdRkGay_hj0t1OzN5C3c30cmch26tJhHUSroffg7ciY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOHd3UndQOG9DTTdBcF9NOW11bGVOQWRqYjhBOXpvX2FYUE5pVTNBYUtzYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhnMlgwSXhOelUwTnpSZlJUZzVNRGswWDBNME5GOUVZVGs0WWprMU5GOUZaV1JsWDBGRFh6UTVOVEkzTVdRd1gwWmZiRzluYjE4MFpXSXdNVE0zTVRZeExuQnVady5wbmc.webp"},{chainId:137,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:137,address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/er3iAGv39hCC7F8AydW_AteD3hnZj9HI2XcAaruHeqA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE9WUWtzN3JQWU5OZWdmNTRuNC1Za1NGTFYyLXVGZmlJRFVYem85aVMzOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlFUQmlPRFk1T1RGak5qSXhPR0l6Tm1NeFpERTVYMFEwWVRKbE9WOUZZakJqWDBVek5qQTJaVjlDTkRoZmJHOW5iMTlpTmpGbE5EVmtNbVF6TG5CdVp3LnBuZw.webp"},{chainId:137,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/WeK6L9_RjWUfAsnMuOAdyXIZVE3JK_H3lZU5vk2m7Tg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTFJ0aEt6X2VrSXdmTEh6NnAycW5rSkRFeUk1RXZrODlXQ0J2VW43MUJLNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoa1gwRkRYekUzWDBZNU5UaGZSREpsWlRVeU0yRXlNakEyTWpBMk9UazBOVGszWDBNeE0xOUVPRE14WldNM1gyeHZaMjlmWXpCbU9XVTFaamxoTmk1d2JtYy5wbmc.webp"},{chainId:137,address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/_KjvB9pCVqbIIv_UnQvRWpjySBHiFnuHNSXUm_52UZM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDQ4OVYzTW1NMi1qaFJueEQ2Y3MyY1gydXdGS2tkRHpiRGZsbkZhTTJxOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhneU1qWXdYMFpCUTE4MVgwVTFOVFF5WVRjM00xOUJZVFEwWmw5Q1gwTm1aVjlFWmpkZlF6RTVNMkpqTWw5RE5UazVYMnh2WjI5Zk5HTmpORE0zTlRneFppNXdibWMucG5n.webp"},{chainId:137,address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",name:"Wrapped MATIC",decimals:18,symbol:"WMATIC",logoURI:"https://cmp.dodoex.io/HfZVSaAES3QRplSybW2uoKmYf6pVTRaxufn95_Qto_A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMERhZEZTUUVFX0d4YlBoMHY3Wk1Hb1FwaWtOQm1vaWFyZTFlaFdJbU44dy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjFoZEdsalgyVmlOekZtTkdFMU9XRXZiV0YwYVdOZlpXSTNNV1kwWVRVNVlTNTNaV0p3LndlYnA.webp"},{chainId:42161,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:42161,address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/6VmZGvbENd4TM1VK0rsYrfznRtG-GwxP-zCy2qyc9bM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWnJZUDB0ZHVTLUdDNE5FTThmRmV1RHhVWklPNUZpWnpqdkdBc0lfNlBQMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh5TW1GbU4yVTVOVFJpTDFkRlZFaGZhV052Ymw4eU1tRm1OMlU1TlRSaUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:42161,address:"0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/6U51l5aajoRrCaO6cpbrclQ2olWNDzuShggOCfoktCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8va3RkSlhwQ3dsQVZtZXNPb1dvQV95SG9IazBnV3UxUExienBKa1AxYnlJdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5tTmtPVEV4WXprNE15OUVUMFJQWHpaalpEa3hNV001T0RNdWNHNW4ucG5n.webp"},{chainId:42161,address:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",name:"USD Coin (Arb1)",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:42161,address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1285,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MOVR",decimals:18,symbol:"MOVR",logoURI:"https://cmp.dodoex.io/Clhd0YhBfsWh48Ej4taGHcJ7dfKiCbtdMgyhNU7QAJg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZlBFT3c5LVdpQWhDVDJteGRmQ2gtb2hnQU1aaXBvWnllUl9TcVNpa3R4NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMemt5T0RWZk4yWTVNREF5T1dNMU1pODVNamcxWHpkbU9UQXdNamxqTlRJdWQyVmljQS53ZWJw.webp"},{chainId:1285,address:"0x98878b06940ae243284ca214f92bb71a2b032b8a",name:"Wrapped MOVR",decimals:18,symbol:"WMOVR",logoURI:"https://cmp.dodoex.io/oXW0_VSLU29rbyQK3LtaHymbMfdv6F_ri20EeyMVBEU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDVYMDFLd21zZXFRNFB6SGxJdEdvN3dveHVaUkFVbmQ5bDhCNU5VQ2N6by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMGhmVG1OdmRWOUlNSGhmTkRBd2VEUXdNRjlrTlRBNFpHSmxNVE0yTDBoZlRtTnZkVjlJTUhoZk5EQXdlRFF3TUY5a05UQTRaR0psTVRNMkxtcHdady5qcGc.webp"},{chainId:1285,address:"0x5D9ab5522c64E1F6ef5e3627ECCc093f56167818",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/SKu1xTvsm3q0RZC9CdiGw0zkq9k1P2ygK4TMenBYNC8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQVMtWEpUX3pncF9MSlFxdFJiaE1Fd3lTZlNBMWp0MUhHbUFGYV9QQUdTdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWRYTmtYems0TjJNd1lUUmtNRGt1YW5Cbi5qcGc.webp"},{chainId:1285,address:"0x80A16016cC4A2E6a2CACA8a4a498b1699fF0f844",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0xE9460BD2FFB12b668fA32919C785C239f974D37C",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/onw4bpUWC5-GPBwFMHLE3BcRaQ1S_hqlUxW-8H3l5g0/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTi1ITXhGVWtxUU9fR3cxRFl1empZblgwejFzQ1pIMG1nMWRlOG5Qdmk2NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zll6SXdZVEl4WTJFNU5pOUVUMFJQWDJNeU1HRXlNV05oT1RZdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xB44a9B6905aF7c801311e8F4E76932ee959c663C",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/LyxjB8w94UjDhRuXa9xNlg7YcMuOC6akWBPCtgbq_Qw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vLXNSOWJzZTlrLTFIY1VUeUE3WE9KZWplQkRRS2ZtSFpRV2I3RE1iemlHMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkhSZk1UVTJOREZtWTJRME1DOTFjMlIwWHpFMU5qUXhabU5rTkRBdWMzWm4uc3Zn.webp"},{chainId:1285,address:"0x2bF9b864cdc97b08B6D79ad4663e71B8aB65c45c",name:"WBNB Token",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/HSdBZz6OV3HFUq1RqW8hdavA1cfhjWEfqP12BINZppw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUTAzVVlDM3hSN0J2SHo5UmgtcHZ0WWctRGdPNlF1b2xKUmE0QjBHaWlmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWJtSmZNalE0TmpZeFpHTXhaaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8",name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/6qiR9e_WPVs0u8U4DgdGMcaKFzJzypJqME5wUNe7XsY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMUMxeHZaUVJ4b0NlTW1sNXg0eUMzTGcySmhNXzYwcHpMMlk3elBwSGJFQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMnh2WjI5Zk4ySXpNMlU0TW1WbFlTOXNiMmR2WHpkaU16TmxPREpsWldFdWNHNW4ucG5n.webp"},{chainId:1285,address:"0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:66,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"OKT",decimals:18,symbol:"OKT",logoURI:"https://cmp.dodoex.io/pcltGNcIp7DP33nj3YxxBpuFEekNcOW3pwq9tjSrpY4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTzJHSDJYTndRancwbXMzQXNidG5xNzRkVEROVld3QWFOU1dXU2ZnU01QTS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTVOalF5T1RCZk1qQXlNakExTWpBd056STNORFl3TWpJdWMzWm4uc3Zn.webp"},{chainId:66,address:"0x382bB369d343125BfB2117af9c149795C6C65C50",name:"USDT",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:66,address:"0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:66,address:"0x54e4622DC504176b3BB432dCCAf504569699a7fF",name:"BTCK",decimals:18,symbol:"BTCK",logoURI:"https://cmp.dodoex.io/L3kcNUKg94qnX8OPFlEvHKqWybnJD8SA9HTne3PW-Rg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vNU1MQTB3Q3V6eEs4Q3ZMV0RqempuOVhzalBTWE1zbUpWZ0RRN1RPMG9FWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpVUTB0Zk1HWmlaRGRsTWpnNU5pOUNWRU5MWHpCbVltUTNaVEk0T1RZdWNHNW4ucG5n.webp"},{chainId:66,address:"0x332730a4F6E03D9C55829435f10360E13cfA41Ff",name:"BUSD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:66,address:"0x21cDE7E32a6CAF4742d00d44B07279e7596d26B9",name:"DAIK",decimals:18,symbol:"DAIK",logoURI:"https://cmp.dodoex.io/LOb-sXupURNN9HA0zBSfLfpZlx52N9qRSDUyzk3cg0A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vck5pZzMtWU5TOUl4T3ZHX19taTFRSU9WYTZsczdZNXViRVhGcTJJVGplby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJCU1V0Zk5ESTVNV1l4WlRoa1pTOUVRVWxMWHpReU9URm1NV1U0WkdVdWNHNW4ucG5n.webp"},{chainId:66,address:"0xEF71CA2EE68F45B9Ad6F72fbdb33d707b872315C",name:"ETHK",decimals:18,symbol:"ETHK",logoURI:"https://cmp.dodoex.io/IwBclhMMQLOo79RdRo6-HnUiXxshO_hSi02YK3L6MFI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcFBSd192aEx2MHh3WkRHU2k3eGYyYVJiQjlocVhfU2tacUdGc3RJR0pYRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFZVU0V0Zk1UQTVNamMzTW1VMU9DOUZWRWhMWHpFd09USTNOekpsTlRndWNHNW4ucG5n.webp"},{chainId:66,address:"0xc946DAf81b08146B1C7A8Da2A851Ddf2B3EAaf85",name:"USDC",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0xdCAC52E001f5bd413aa6ea83956438F29098166b",name:"USDK",decimals:18,symbol:"USDK",logoURI:"https://cmp.dodoex.io/X-_D75ZOpI-yC70WjdgC8wiqcssfRIALEv0eUfD3HiE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vd290dHEzaWdkTDVzQlhSR2VFZkhQLTNpZHhDZzV0V3VGQmE3YjNrNUZITS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkV0Zk56aGpZekV6TW1OaVpDOVZVMFJMWHpjNFkyTXhNekpqWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0x506f731F7656e2FB34b587B912808f2a7aB640BD",name:"WBTCK",decimals:18,symbol:"WBTCK",logoURI:"https://cmp.dodoex.io/7Gb1gYkvjWESf9ungWe4YKOrr5GY5UILmTwU_U95kCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOTQ4NWZpU2NmUzBNc2V1YVZXWXo2Z1RuNVVidXJvZkxmN1VGSWhMdndjTS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOTFgyVXlZamRpWVRJNU16TXZWMEpVUTB0ZlpUSmlOMkpoTWprek15NXdibWMucG5n.webp"},{chainId:288,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:288,address:"0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:288,address:"0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b",name:"Binance",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:288,address:"0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7",name:"Boba Token",decimals:18,symbol:"BOBA",logoURI:"https://cmp.dodoex.io/p7--p24wKrXpF7IGh6Q_RT6J0ZGS2_FURnXxeyMDvO4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQlVsWE9GWS1wUTIxbTJJOTdIRFN2VHlvMzR2MGJWQllYU1ByczFwaWNuYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpQUWtGZk16SmtZamczT1dJMk1TOUNUMEpCWHpNeVpHSTROemxpTmpFdWNHNW4ucG5n.webp"},{chainId:288,address:"0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:288,address:"0x572c5B5BF34f75FB62c39b9BFE9A75bb0bb47984",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/8CGANX_wy00isVg8PgA_A-IKbfIn55Yu9ZujzUukXlQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDJhLVNEOFJvWDlGaW9IUVNzSkh2WkZzNlBpbVlNTWxTZGhZalJmMXVVQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk1tRm1NMll4WkRZd055OUVUMFJQWHpKaFpqTm1NV1EyTURjdWNHNW4ucG5n.webp"},{chainId:288,address:"0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:288,address:"0xdc0486f8bf31DF57a952bcd3c1d3e166e3d9eC8b",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:288,address:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:1313161554,address:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79",name:"Aurora",decimals:18,symbol:"Aurora",logoURI:"https://cmp.dodoex.io/2C2jfpO2-VYuwlga3SdtP5I6eJNJXIYq3LvPU4aFuiU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcHFWVWlJOEQ4VU5iUEZYRElvUnA3cFhEZFc4dmx4dWEtTmxubmxlam1PMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkYxY205eVlWOHlOVEprWlRFeE56YzBMMkYxY205eVlWOHlOVEprWlRFeE56YzBMbmRsWW5BLndlYnA.webp"},{chainId:1313161554,address:"0xe3520349F477A5F6EB06107066048508498A291b",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1313161554,address:"0xe301eD8C7630C9678c39E4E45193D1e7Dfb914f7",name:"DODO Bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/SEcMDWMmtHb3GFW5l7fTKYurpTqALHdZI3D6qzad1rs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQXRNMzllUjhRQzhYTl8tem5HU0pSLS1lV0tPUW91V3p2ci0zQ014WlJTSS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekl3TUhneU1EQmZNVjh3WWpReFl6VTJZV1UxTHpJd01IZ3lNREJmTVY4d1lqUXhZelUyWVdVMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x4988a896b1227218e4A686fdE5EabdcAbd91571f",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1313161554,address:"0xF4eB217Ba2454613b15dBdea6e5f22276410e89e",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Avalanche",decimals:18,symbol:"AVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",name:"Wrapped AVAX",decimals:18,symbol:"WAVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98",name:"Binance USD",decimals:18,symbol:"BUSD.e",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",name:"Dai Stablecoin",decimals:18,symbol:"DAI.e",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:43114,address:"0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",name:"USD Coin",decimals:6,symbol:"USDC.e",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xc7198437980c041c805A1EDcbA50c1Ce5db95118",name:"Tether USD",decimals:6,symbol:"USDT.e ",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:43114,address:"0x50b7545627a5162F82A992c33b87aDc75187B218",name:"Wrapped BTC",decimals:8,symbol:"WBTC.e",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",name:"Wrapped Ether",decimals:18,symbol:"WETH.e",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:25,address:"0x66e428c3f67a68878562e79A0234c1F83c208770",name:"USDT",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/p_nSk7MW-bCcwp-tgtWC8az4e4Q0YMirg6rv6yVjC-I/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vODVNVlpTTllrTFlySWdlX2VQemNVOUpydkNKeFpDM2JhaGV0NnN5S0d5WS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTJPREl3TWpoZk1qQXlNakExTVRjd016STVNakV6TURjdWQyVmljQS53ZWJw.webp"},{chainId:25,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"CRO",decimals:1,symbol:"CRO",logoURI:"https://cmp.dodoex.io/HYsQIOyyuC6P1Ik_Rs5a6ws2CKMzJbajJewE77C0rf8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZzc2UURUMEIwbHJjc3VTSTlodTZTTnlqMEp3WWNtUEFRWV9qWDV0VVBhMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6YzRNRGc0TkRkZk1qQXlNakExTVRjd056UXdNekExTWpFdWNHNW4ucG5n.webp"},{chainId:10,address:"0x4200000000000000000000000000000000000006",name:"WETH",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/f9SbZq39ynUZS5ueKvAwzLmKUfcZvYpKDaysT3dkcvM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2NkVzJUWjladmRiX3BVSjZ3b2YzeHRvYk94YUw3bEV5RmhhemhJUFhlMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RXdNamd3TkRaZk1qQXlNakEwTWpJd01UQXpORGc1TURVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"DAI",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/04gwZiu2K_9fdb2zLwzsX1nONCbBWrZOvTyOoEFhx3g/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaDJCcmdhUmZxUzBLZDBEOVpZbEUteEtNMVdzeFFtRzBEWVpKOGJCaWN4US9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6SXlNRFUwTVRsZk1qQXlNakEwTWpJd01UQTBNak00TlRVdWFuQm4uanBn.webp"},{chainId:10,address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",name:"USDC",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/XbtxsPIscM6p5ClHbLO0JumFHA9U23eON8-MDh-Plkg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaG1nM3hRa1BUTUtkcUNFVnd0LXU4S2lwTW5od1JCdGhLYWxENW9vSWlTZy9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6UXlNRFEyTkRaZk1qQXlNakEwTWpJd01UQTFNekF4TmpVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/bcyoORJ04NyP1HhYUZ9RrTZ-MEOFeNnMcrr__JZ6Ruw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vV1lHaU9IVFVnVWs4Q3Z3WmNyN0hWX2w4SlNrQjRVQUh1UXpzaWd4U3Nmay9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6VTVPREk0T1Y4eU1ESXlNRFF5TWpBeU1qTTBNelk0TlM1d2JtYy5wbmc.webp"}];function My({tokenList:e,popularTokenList:t}){const o=c.useDispatch(),[i,s]=n.useState([]),{account:a}=l.useWeb3React(),u=Cf(),{cgTokenList:d}=Sy(),h=c.useSelector(Rs),f=n.useMemo((()=>(null==Ny?void 0:Ny.filter((e=>e.chainId===u)))||[]),[Ny,u]),p=n.useMemo((()=>(null==t?void 0:t.filter((e=>e.chainId===u)))||[]),[t,u]);!function({tokenList:e,addresses:t,blockNumber:r}){const{account:o}=l.useWeb3React(),i=c.useDispatch(),s=n.useMemo((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,JSON.stringify(t)]),{getContract:a,contractConfig:u,call:d}=Lc(),[h,f]=n.useState(),p=n.useMemo((()=>{if(!o||!s.length||!u)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=u,r=a(t,Hc);if(!r)return;let n={};const c=s.map((i=>(n[i]=!0,{callData:{data:r.interface.encodeFunctionData("isERC20",[i,o,e]),to:t},processor:e=>{const t=new Vc(Hc).decodeFunctionResult("isERC20",e),{balance:r,isOk:n}=t,o=parseInt(t.decimals),s=new k.default(10).pow(o),a=new k.default(t.allownance.toString()).div(s);return n?{address:i,decimals:o,symbol:t.symbol,name:t.name,balance:new k.default(r.toString()).div(s),allowance:a}:{address:i,balance:new k.default(0),allowance:new k.default(0)}}})));return i(_s(n)),c}),[o,a,JSON.stringify(s)]);n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){if(!p)return;const e=yield d(p),t={};e&&(e.forEach((e=>{e.address.toLocaleLowerCase()!=="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".toLocaleLowerCase()&&(t[e.address.toLocaleLowerCase()]={tokenBalances:e.balance,tokenAllowances:e.allowance})})),i(ks(t))),f(e);let r={};s.forEach((e=>{r[e]=!1})),i(_s(r))}))})()}),[p,r])}({addresses:n.useMemo((()=>{const e=i.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[i,t]),blockNumber:h}),n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){let t=[];if(r.isArray(e))t=e;else if(e===Jc.Coingecko||e===Jc.All){const e=f.concat(d.toArray());t=r.unionBy(p,e,(e=>e.address.toLowerCase()))}else t=r.unionBy(p,f,(e=>e.address.toLowerCase()));const n=u,i=t.filter((e=>e.chainId===n));s(i),o((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(i))}))})()}),[e,o,u,d,p,f]),n.useEffect((()=>{o(ks({}))}),[a,u]),n.useEffect((()=>{o((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(p))}),[p,o])}const Ty=e=>(null!=e?e:Es.getState()).token.tokenList,Oy=e=>(null!=e?e:Es.getState()).token.accountBalances,Iy=e=>(null!=e?e:Es.getState()).token.ethBalance||new k.default(NaN),Wy=e=>(null!=e?e:Es.getState()).token.defaultFromToken,Fy=e=>(null!=e?e:Es.getState()).token.defaultToToken,Cy=e=>(null!=e?e:Es.getState()).token.balanceLoadings;function jy(){const{account:e,chainId:t}=l.useWeb3React(),r=c.useSelector(Oy),o=c.useSelector(Iy),i=n.useMemo((()=>ss[t||1]),[t]),s=n.useCallback((t=>{var n;if(!e)return null;if(t.symbol===i.symbol&&ts(t.address,i.address))return!o||(null==o?void 0:o.isNaN())?null:o;const s=null===(n=r[t.address.toLocaleLowerCase()])||void 0===n?void 0:n.tokenBalances;return!s||(null==s?void 0:s.isNaN())?null:s}),[r,o,e]);return s}var Uy;function Dy(e,t,r,n=0){if(r&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return Uy.fully+n;const o=e.indexOf(t);return 0===o?Uy.prefix+n:o>0?Uy.other+n:Uy.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(Uy||(Uy={}));function By({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:o,showAddrs:i,side:s}){const[a,u]=n.useState(""),l=c.useSelector(Ty),d=Cf(),h=jy(),f=c.useSelector((e=>((e,t)=>(null!=t?t:Es.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)))(d,e))),p=n.useMemo((()=>(null==Ny?void 0:Ny.filter((e=>e.chainId===d)))||[]),[Ny,d]),m=n.useMemo((()=>new Set(o?o.map((e=>e.toLowerCase())):void 0)),[o]),g=n.useMemo((()=>i?new Set(i.map((e=>e.toLowerCase()))):void 0),[i]),y=n.useCallback((e=>e.filter((e=>{if(e.chainId!==d)return!1;let t=!0;return t=g?g.has(e.address.toLowerCase()):!m.has(e.address.toLowerCase()),t&&s&&(t=!e.side||e.side===s),t}))),[g,d,m]),b=n.useMemo((()=>y(f)),[f,y]),v=n.useCallback((t=>{if(null===t)return null;const n=[];a?t.forEach((e=>{const t=((e,t,{matchAddress:r}={})=>{if(!t)return 0;const n=t.toLocaleLowerCase();let o=0;r&&e.address.toLocaleLowerCase()===n&&(o=1),o||(o=Dy(e.symbol.toLocaleLowerCase(),n,!1,1));if(o)e.name.toLocaleLowerCase()===n&&(o=Uy.fully+1);else{let t=Dy(e.name.toLocaleLowerCase(),n,!1,10);t=t===Uy.fully+10?Uy.fully+1:t,o=t}return o})(e,a,{matchAddress:!0});t&&n.push({sort:t,token:e})})):t.forEach((e=>{n.push({sort:0,token:e})}));const o=[];return n.sort(((t,n)=>{const o=t.token,i=n.token;if(e){if(o.address===e.address)return-1;if(i.address===e.address)return 1}if(null==r?void 0:r.includes(o.address))return-1;if(null==r?void 0:r.includes(i.address))return 1;const s=h&&h(o)||new k.default(0),a=h&&h(i)||new k.default(0);if(!s.eq(a))return s.gt(a)?-1:1;if(t.sort!==n.sort)return t.sort>n.sort?1:-1;const c=b.map((e=>e.address));if(null==c?void 0:c.includes(o.address))return-1;if(null==c?void 0:c.includes(i.address))return 1;const u=p.map((e=>e.address));return(null==u?void 0:u.includes(o.address))?-1:(null==u?void 0:u.includes(i.address))?1:o.symbol.localeCompare(i.symbol)})).some((e=>!!(a&&o.length>21)||(o.push(e.token),!1))),o}),[a,h,r,e,b,p]),w=n.useCallback((e=>{const n=e.address.toLowerCase();t(e,!!(null==r?void 0:r.some((e=>e.toLowerCase()===n))))}),[t,r]),x=n.useMemo((()=>{const e=y(l);return v(e)||[]}),[l,y,v]);return{filter:a,setFilter:u,showTokenList:x,onSelectToken:w,popularTokenList:b}}function Vy({width:e=24,height:t=24,marginRight:r=8,url:o,zIndex:i,cross:s,address:a,token:u,sx:d}){const[h,f]=n.useState(!1),[p,m]=n.useState(""),[g,y]=n.useState(""),[b,v]=n.useState(!1),w=n.useCallback((()=>f(!0)),[]);let x=function(e){const t=c.useSelector(Ty),{chainId:r}=l.useWeb3React();return n.useMemo((()=>{if(!e)return;let n=t.find((({address:t,chainId:n})=>n===r&&t===e));return n||(n=t.find((({address:t})=>t===e))),n}),[e,t,r])}(a);u&&(x=u);const E=a||(null==x?void 0:x.address),A=null==x?void 0:x.symbol,R=null==A?void 0:A.charAt(0).toUpperCase(),k=n.useMemo((()=>{const e=null==x?void 0:x.logoURI;return o||e||""}),[o,x]);return n.useEffect((()=>{v(!1)}),[E,k]),n.useEffect((()=>{s&&(k?function(e,t){const r=new XMLHttpRequest;let n;r.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(r.response)},r.onerror=function(){t()};try{n=new URL(e)}catch(e){}finally{r.open("GET",n||e),r.responseType="blob",r.send()}}(k,(e=>{m(e)})):m(""))}),[k,s]),n.useEffect((()=>{try{let t=E;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const r=new O.default(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();y(`data:image/svg+xml;base64,${r}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[E,e]),ne.exports.jsxs(Er,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e,width:e,height:t,marginRight:r,zIndex:i},d||{}),style:{width:e,height:t},children:[!h&&ne.exports.jsx(Er,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:R}),ne.exports.jsx(Er,{component:"img",src:!(s?p:k)||b?g:s?p:k,onLoad:w,onError:e=>{const t=e.target;E&&g&&v(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]})}function Py({token:t,onClick:r}){var n,o;const s=vr();return ne.exports.jsxs(Er,{component:pn,sx:{display:"flex",alignItems:"center",color:s.palette.text.primary,typography:"h5",fontWeight:600},onClick:e=>{r&&r(e)},"data-testid":"swap-select-token-btn",children:[(null==t?void 0:t.address)?ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Vy,{url:null==t?void 0:t.logoURI,address:null!==(n=null==t?void 0:t.address)&&void 0!==n?n:"",marginRight:6}),ne.exports.jsx(Er,{children:null!==(o=null==t?void 0:t.symbol)&&void 0!==o?o:"-"})]}):ne.exports.jsx(e.Trans,{id:"SELECT TOKEN"}),ne.exports.jsx(Er,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:i.CaretUp})]})}function Zy({onClick:t,balance:r,decimals:n,address:o,showMaxBtn:i}){const{palette:s}=vr();return ne.exports.jsxs(Er,{sx:{display:"flex",typography:"body2",color:s.text.secondary},children:[ne.exports.jsx(e.Trans,{id:"Balance:"})," ",o?ci({input:r,decimals:Math.min(n||4,4)}):"-",i&&r&&r.gt(0)&&ne.exports.jsx(Er,{component:pn,sx:{ml:6,color:(null==r?void 0:r.gt(0))?s.primary.main:s.text.disabled,cursor:o&&t?"pointer":"unset"},onClick:()=>t&&t(r?r.toString():""),children:ne.exports.jsx(e.Trans,{id:"Max"})})]})}function zy({readOnly:e,sx:t,value:r,decimals:o,onChange:s,suffix:a,withClear:c,onFocus:u,placeholder:l}){const d=vr(),h=n.useMemo((()=>a||(c&&r&&s?ne.exports.jsx(Er,{component:pn,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s&&s("")},children:ne.exports.jsx(Er,{component:i.Error,sx:{width:12,color:"text.primary"}})}):void 0)),[s,a,d.palette.text.primary,r,c]);return ne.exports.jsxs(Er,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[ne.exports.jsx(kn,{fullWidth:!0,value:r,readOnly:e,placeholder:l||"0.00",onFocus:u,onChange:e=>{const t=e.target.value,r=0===t.length?"":di(t,o);s&&s(r)},sx:{width:"inherit",border:"none","& .MuiInput-input":{fontSize:24,border:"none",outline:"none",height:24,padding:0,color:"text.primary","&::placeholder":{fontSize:24,color:"text.disabled"}}}}),!e&&r&&h]})}function Ly({open:e,onClose:t,afterClose:r,title:n,rightSlot:o,canBack:s=!0,children:a,height:c,testId:u}){return ne.exports.jsxs(Er,{sx:{position:"absolute",top:e?0:"100%",transition:"top 300ms",zIndex:1,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:c},"data-testid":u,"data-active":e?"1":"0",children:[n?ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[ne.exports.jsx(Er,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&s&&ne.exports.jsx(Er,{component:i.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>r&&r()),300)}})]}):"",a]})}const Hy=e=>(null!=e?e:Es.getState()).globals;function Yy({token:e,disabled:t,onClick:r}){return ne.exports.jsxs(Er,{sx:Object.assign({display:"inline-flex",alignItems:"center",p:8,border:"solid 1px",typography:"body2",borderRadius:8},t?{borderColor:"transparent",backgroundColor:"border.disabled",cursor:"auto"}:{borderColor:"border.main",cursor:"pointer","&:hover":{backgroundColor:"hover.default"}}),onClick:()=>{t||r()},children:[ne.exports.jsx(Vy,{token:e}),e.symbol]})}function Xy({token:e,disabled:t,style:r,onClick:n}){const o=vr(),s=jy(),{account:a}=l.useWeb3React(),c=s(e),u=c?ai({input:c}):"";return ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",px:6,py:5,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:r,onClick:()=>{t||n()},"data-testid":"token-picker-item",children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(Vy,{token:e}),ne.exports.jsxs(Er,{children:[ne.exports.jsx(Er,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),a&&ne.exports.jsx(Er,{sx:{mt:4,textAlign:"left"},children:(null==c?void 0:c.gte(0))?u:ne.exports.jsx(Er,{component:i.Loading,width:18,sx:{"& path":{fill:o.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})]}),ne.exports.jsx(Er,{sx:{color:"text.secondary",textAlign:"right"},children:e.name})]})}function Jy({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:o,showAddrs:i,visible:s,side:a}){const{showTokenList:c,filter:u,setFilter:l,onSelectToken:d,popularTokenList:h}=By({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:o,showAddrs:i,side:a}),f=n.useRef(null),[p,m]=n.useState(0);n.useEffect((()=>{s&&f.current&&m(f.current.offsetHeight-34)}),[f,s]);const g=n.useCallback((({key:t,index:r,style:n})=>{const o=!!(null==h?void 0:h.length);if(0===r&&o)return ne.exports.jsx(Er,{sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},style:Object.assign(Object.assign({},n),{visibility:n.height?"visible":"hidden",height:n.height?n.height:"auto"}),children:h.map((t=>ne.exports.jsx(Yy,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>d(t)},t.address)))},t);const i=c[o?r-1:r];return ne.exports.jsx(Xy,{token:i,disabled:!!e&&e.address===i.address,style:n,onClick:()=>d(i)},t)}),[c,h,e]),y=n.useCallback((e=>{if(0===e&&(null==h?void 0:h.length)){return 74+51*Math.floor(h.length/3)}return 52}),[h]);return ne.exports.jsxs(Er,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[ne.exports.jsx(In,{fullWidth:!0,height:48,value:u,onChange:e=>l(e.target.value),clearValue:()=>l(""),placeholder:w.i18n._("Enter the token symbol or address")}),ne.exports.jsx(Er,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:f,children:ne.exports.jsx(x.VariableSizeList,{height:p,itemCount:c.length+((null==h?void 0:h.length)?1:0),itemSize:y,width:"100%",className:"token-list",children:g},h.length)})]})}function Gy({open:t,value:r,onClose:n,occupiedAddrs:o,onTokenChange:i,side:s}){const{height:a}=c.useSelector(Hy);return ne.exports.jsx(Ly,{height:a,open:t,onClose:n,title:ne.exports.jsx(e.Trans,{id:"Select a token"}),testId:"token-picker-wrapper",children:ne.exports.jsx(Jy,{value:r,visible:t,onChange:i,occupiedAddrs:o,side:s})})}function qy({sx:e,amt:t,token:r,readOnly:o,showMaxBtn:i,onMaxClick:s,fiatPriceTxt:a,occupiedAddrs:c,onInputFocus:u,onTokenClick:l,onInputChange:d,onTokenChange:h,side:f}){const p=vr(),m=jy(),[g,y]=n.useState(!1),b=r?m(r):null;return ne.exports.jsxs(Er,{sx:Object.assign({width:"100%",minHeight:133,padding:20,borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:p.palette.background.input},e),children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[ne.exports.jsx(Py,{token:r,onClick:()=>y(!0)}),ne.exports.jsx(Zy,{balance:b,onClick:s,showMaxBtn:i,address:null==r?void 0:r.address,decimals:null==r?void 0:r.decimals})]}),ne.exports.jsx(zy,{value:t,onFocus:u,onChange:d,readOnly:o,withClear:!0}),ne.exports.jsx(Er,{sx:{mt:4,typography:"body2",color:p.palette.text.secondary},children:a}),ne.exports.jsx(Gy,{value:r,open:g,side:f,occupiedAddrs:c,onClose:()=>{y(!1),l&&l()},onTokenChange:(e,t)=>{y(!1),setTimeout((()=>h(e,t)),300)}})]})}const Ky=(e,t)=>{const r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?1==i&&11!=s?"one":2==i&&12!=s?"two":3==i&&13!=s?"few":"other":1==e&&n?"one":"other"},Qy={"en-US":Ky,"zh-CN":(e,t)=>"other",pseudo:Ky};function $y({locale:t,children:r}){return n.useEffect((()=>{(()=>{ls(this,void 0,void 0,(function*(){yield function(e="en-US"){return ls(this,void 0,void 0,(function*(){w.i18n.loadLocaleData(e,{plurals:()=>Qy[e]});try{const r=yield(t=`./locales/${e}.js`,Promise.resolve().then((function(){return A(require(t))})));w.i18n.load(e,r.messages||r.default.messages)}catch(e){}var t;w.i18n.activate(e)}))}(t)}))})()}),[t]),ne.exports.jsx(e.I18nProvider,{i18n:w.i18n,children:r})}var eb,tb,rb;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(eb||(eb={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(tb||(tb={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(rb||(rb={}));var nb,ob=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],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:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],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:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(nb||(nb={}));const ib=(e,t)=>ls(void 0,void 0,void 0,(function*(){const{value:r,from:n,to:o,data:i}=e,s={from:n,to:o,value:r,data:i};r&&!/^0x0*$/.test(r)||delete s.value;try{return(yield t.estimateGas(s)).add(5e4)}catch(e){t.call(s).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null})),sb=(e,t)=>ls(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(w.i18n._("Transaction rejected.")):e}}));var ab,cb;!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(ab||(ab={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(cb||(cb={}));const ub=new k.default(2).pow(256).minus(1),lb=e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function db({onTxFail:e,onTxSubmit:t,onTxSuccess:r}={}){const{account:o,provider:i}=l.useWeb3React(),s=Cf(),[a,u]=n.useState(!1),[d,h]=n.useState(new Map),f=c.useDispatch(),[p,m]=n.useState(null),[g,y]=n.useState(""),[b,v]=n.useState(null),[x,E]=n.useState(!1),[A,R]=n.useState(),{updateBlockNumber:_}=Xc(),S=n.useCallback(((n,a,c,l=!1,d,p,g,b)=>ls(this,void 0,void 0,(function*(){if(y(""),m(""),!o||!i)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let x,A,S;R((()=>g)),u(!1);try{if(u(!0),a.opcode===ab.Approval)S=yield((e,t,r,n,o,i)=>ls(void 0,void 0,void 0,(function*(){const s=zc(e,ob,o,i).interface.encodeFunctionData("approve",[r,n.toFixed()]),a={from:t,to:e,data:s,value:`0x${new k.default("0").toString(16)}`,gasLimit:void 0},c=yield ib(a,o);return c&&(a.gasLimit=c),yield sb(a,o)})))(a.token.address,o,a.contract,a.amt||ub,i,o),x=S.hash,y(x);else{if(a.opcode!==ab.TX)throw new Error(`Op ${a.opcode} not implemented!`);if(""===a.to)throw new Error("Submission: malformed to");if(0===a.data.length)throw new Error("Submission: malformed data");if(0===a.data.indexOf("0x")&&a.data.length<=2)throw new Error("Submission: malformed data");if(A={value:a.value,data:a.data,to:a.to,gasLimit:a.gasLimit,from:o,chainId:s},!A.gasLimit)try{const e=yield ib(A,i);e&&(A.gasLimit=e)}catch(e){console.debug(e)}if(S=yield sb(A,i),x=S.hash,y(x),!x)throw new Error(`Unexpected tx: ${x}`)}}catch(t){if(u(!1),v({spec:a,brief:n,subtitle:c}),console.error(t),t.message){f(lb({contractStatus:gs.Failed}));const r={error:t.message,brief:n};p&&Object.assign(r,p),e&&e(t,p),m(function(e,t){var r;const n=null===(r=ss[e])||void 0===r?void 0:r.symbol,o=[{error:"insufficient",msg:w.i18n._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:n})},{error:["External Swap execution Failed","Return amount is not enough"],msg:w.i18n._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:w.i18n._("SafeERC20: low-level call failed. Please contact the DODO team.")},{error:["User denied","cancel","User rejected","user rejected"],msg:w.i18n._("User denied transaction signature.")},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:w.i18n._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:w.i18n._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:w.i18n._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:w.i18n._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:w.i18n._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:w.i18n._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:w.i18n._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:w.i18n._("Service update, please wait and try again")}];let i="";return o.some((e=>Array.isArray(e.error)?e.error.some((r=>t.indexOf(r)>-1&&(i=e.msg,!0))):t.indexOf(e.error)>-1&&(i=e.msg,!0))),i||t}(s,t.message))}return tb.Failed}v({spec:a,brief:n,subtitle:c}),E(!1),u(!1);const N=Object.assign(Object.assign(Object.assign(Object.assign({brief:n},a),A),{tx:x,subtitle:c}),p);f(lb({contractStatus:gs.Pending})),t&&t(x,N),d&&d();const M={brief:n,spec:a,tx:x,subtitle:c};if(h((e=>e.set(x,[M,eb.Running]))),l)return tb.Submitted;if(d&&d(),null==S?void 0:S.wait){const e=yield S.wait(1);if(E(!0),e.status===rb.Success)return"TX"===N.opcode&&f(lb({contractStatus:gs.TxSuccess})),"APPROVAL"===N.opcode&&f(lb({contractStatus:gs.ApproveSuccess})),b&&b(x),r&&r(x,N),yield _(),h((e=>e.set(x,[M,eb.Success]))),tb.Success}return yield _(),E(!0),h((e=>e.set(x,[M,eb.Failed]))),tb.Failed}))),[o,s,u,i,_]),N=n.useMemo((()=>({execute:S,requests:d,setShowing:v,waitingSubmit:a})),[S,d,v]),M=n.useCallback((()=>{v(null),A&&(A(),R(void 0))}),[A]);return{showing:b,showingDone:x,transactionTx:g,errorMessage:p,setErrorMessage:m,closeShowing:M,ctxVal:N,requests:d}}function hb(){const{requests:e}=pb(),t=[];return null==e||e.forEach((function([e,r]){r===eb.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const fb=n.createContext({execute:()=>Promise.resolve(tb.Canceled),requests:void 0,waitingSubmit:!1});function pb(){return n.useContext(fb)}var mb;function gb(){return gb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gb.apply(this,arguments)}var yb=function(e){return S.createElement("svg",gb({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),mb||(mb=S.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},S.createElement("g",{transform:"translate(18.000000, 291.000000)"},S.createElement("g",{transform:"translate(40.000000, 83.000000)"},S.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function bb({showingDone:e,errorMessage:t}){return t?ne.exports.jsx(Er,{component:i.ErrorWarn,sx:{width:64,height:64,color:"error.main"}}):e?ne.exports.jsx(Er,{component:i.DoneBorder,sx:{width:64,height:64,color:"success.main"}}):ne.exports.jsx(Er,{sx:{mx:"auto",border:e=>{var t;return`6px solid ${null===(t=e.palette)||void 0===t?void 0:t.background.input}`},borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:ne.exports.jsx(Er,{component:yb,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function vb({showingDone:e,showing:t}){return ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[ne.exports.jsx(Er,{sx:{mt:60},children:e?w.i18n._("{0} confirmed",{0:null==t?void 0:t.brief}):w.i18n._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?ne.exports.jsx(Er,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function wb({isStarted:t,isEnded:r,tx:o}){const[s,a]=n.useState(0),{chainId:c}=l.useWeb3React(),u=n.useMemo((()=>`https://${cs[c||1]}/tx/${o}`),[o,c]),d=n.useMemo((()=>{const e=Math.floor(s/60),t=s%60;return e?`${e}m ${t}s`:`${t}s`}),[s]),h=n.useRef();return n.useEffect((()=>(t&&(a(0),clearInterval(h.current),h.current=setInterval((()=>{a((e=>e+1))}),1e3)),()=>{clearInterval(h.current)})),[t]),n.useEffect((()=>{clearInterval(h.current)}),[r]),ne.exports.jsxs(Er,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsx(e.Trans,{id:"Transaction Time:"}),d]}),ne.exports.jsxs(On,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:u,target:"_blank",rel:"noopener noreferrer",children:[ne.exports.jsx(e.Trans,{id:"Tx"}),ne.exports.jsx(Er,{component:i.ArrowTopRightBorder,sx:{width:16,height:16,ml:6}})]})]})}function xb(t){var{children:r}=t,n=us(t,["children"]);const{ctxVal:o,showing:i,closeShowing:s,showingDone:a,errorMessage:u,transactionTx:l}=db(n),d=c.useDispatch();return ne.exports.jsxs(fb.Provider,{value:o,children:[r,ne.exports.jsx(Ly,{open:!!i,onClose:s,children:ne.exports.jsxs(Er,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsx(Er,{sx:{textAlign:"center",pt:60},children:ne.exports.jsx(bb,{showingDone:a,errorMessage:u})}),u?ne.exports.jsxs(Er,{sx:{textAlign:"center",mt:60},children:[ne.exports.jsx(Er,{children:ne.exports.jsx(e.Trans,{id:"Something went wrong."})}),ne.exports.jsx(Er,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:u})]}):ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(vb,{showingDone:a,showing:i}),ne.exports.jsx(wb,{isStarted:!!i,isEnded:a,tx:l})]})]}),ne.exports.jsx(ln,{fullWidth:!0,size:ln.Size.big,onClick:()=>{d(lb({contractStatus:gs.Initial})),s()},sx:{mt:20},children:u?ne.exports.jsx(e.Trans,{id:"Dismiss"}):ne.exports.jsx(e.Trans,{id:"Close"})})]})})]})}function Eb({token:e,fiatPrice:r}){return{marginAmount:n.useMemo((()=>{var n;const o=null!==(n=null==e?void 0:e.decimals)&&void 0!==n?n:6,i=((e,r,n)=>{const o=new t.BigNumber(e).times(new t.BigNumber(10).pow(r));return n?o:o.dp(0)})(null!=r?new k.default(500).div(r):new k.default(0),o);return(i.lt(new k.default(1).times(new k.default(10).pow(o-3)))?new k.default(0):i).toString(10)}),[null==e?void 0:e.decimals,r])}}function Ab({width:e,height:t,feeRate:r,rebateTo:o,colorMode:i,apikey:s,defaultChainId:a,defaultToToken:u,defaultFromToken:l}){const d=c.useDispatch();n.useEffect((()=>{i&&d((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(i))}),[i]),n.useEffect((()=>{var e;a&&d((e=a,t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[a]),n.useEffect((()=>{d(lb({height:t}))}),[t]),n.useEffect((()=>{d(lb({width:e}))}),[e]),n.useEffect((()=>{s&&d(lb({apikey:s}))}),[s]),n.useEffect((()=>{r&&d(lb({feeRate:r}))}),[r]),n.useEffect((()=>{o&&d(lb({rebateTo:o}))}),[o]),n.useEffect((()=>{l&&d((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(l))}),[l]),n.useEffect((()=>{u&&d((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(u))}),[u])}function Rb({refetch:e,interval:t}){let r;n.useEffect((()=>(e(),clearTimeout(r),r=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(r))),[e])}function kb({fromToken:e,toToken:t,chainId:r}){const[o,i]=n.useState(!1),{apikey:s}=c.useSelector(Hy),[a,u]=n.useState(""),[l,d]=n.useState(""),h=n.useCallback((()=>{if(!r||!e||!t)return;i(!0);const n=[e,t];I.default.post("https://api.dodoex.io/frontend-price-api/current/batch",{networks:n.map((()=>(e=>as[e]||as[ns.MAINNET])(r))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},{headers:{apikey:s}}).then((r=>{var n;i(!1);const o=null===(n=r.data)||void 0===n?void 0:n.data;o&&(u(o.find((t=>t.address===e.address)).price),d(o.find((e=>e.address===t.address)).price))})).catch((e=>{i(!1),console.error(e)}))}),[r,e,t,s]);return Rb({refetch:h}),{loading:o,refetch:h,toFiatPrice:l,fromFiatPrice:a}}const _b=e=>(null!=e?e:Es.getState()).settings.slippage,Sb=e=>(null!=e?e:Es.getState()).settings.ddl;var Nb;function Mb({toToken:e,fromToken:t,fromAmount:r,toAmount:o,marginAmount:i}){const{account:s,chainId:a,provider:u}=l.useWeb3React(),d=c.useSelector(As),h=n.useMemo((()=>a||d),[a,d]),f=c.useSelector(_b)||3,p=c.useSelector(Sb)||20,{feeRate:m,rebateTo:g,apikey:y,isReverseRouting:b}=c.useSelector(Hy),x=n.useMemo((()=>Math.floor(Date.now()/1e3)+60*p),[p]),[E,A]=n.useState(Nb.Initial),[R,k]=n.useState(null),[_,S]=n.useState(""),[N,M]=n.useState(null),[T,O]=n.useState(null),[W,F]=n.useState(null),[C,j]=n.useState(v.BigNumber.from(0)),[U,D]=n.useState(null),[B,V]=n.useState(null),[P,Z]=n.useState(""),[z,L]=n.useState(""),[H,Y]=n.useState(""),[X,J]=n.useState(0),G=n.useCallback((()=>ls(this,void 0,void 0,(function*(){if(!h||!t||!e)return;if(!b&&!r)return;if(b&&!o)return;A(Nb.Loading);const n={chainId:h,deadLine:x,apikey:y,slippage:f,source:"dodoV2AndMixWasm",toTokenAddress:e.address,toTokenDecimals:e.decimals,fromTokenAddress:t.address,fromTokenDecimals:t.decimals,userAddr:s||"0x0000000000000000000000000000000000000000"};b?n.toAmount=v.parseFixed(String(o||1),e.decimals).toString():n.fromAmount=v.parseFixed(String(r||1),t.decimals).toString(),g&&m&&(n.rebateTo=g,n.fee=m);try{const e=(yield I.default.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:n})).data.data;if((null==e?void 0:e.resAmount)?(A(Nb.Success),k(e.resAmount),F(e.priceImpact),D(e.resPricePerFromToken),V(e.resPricePerToToken),M(e.baseFeeAmount),O(e.additionalFeeAmount),Z(e.to),L(e.data),S(e.value),Y(e.useSource),J(e.duration)):A(Nb.Failed),!s||!u)return;const t=yield ib({from:s,to:e.to,value:e.value,data:e.data},u);t&&j(t)}catch(e){A(Nb.Failed),console.error(e)}}))),[x,s,h,e,m,f,g,t,u,r,o,y,b]);Rb({refetch:G});const q=n.useMemo((()=>{const e=b?o:r;return E!==Nb.Loading&&e?R:null}),[E,b,o,r,R]),K=function(){const{chainId:e,account:t}=l.useWeb3React(),r=pb(),o=n.useCallback((({to:e,data:n,useSource:o,duration:i,ddl:s,gasLimit:a,subtitle:c,value:u})=>{const l=60*s,d=u;o&&"weth"!==o.toLowerCase()&&a&&a.lt(3e4)&&console.debug("Warning: GasLimit less than the minimum!");const h={from:t,to:e,data:n,value:d,route:o,duration:i,ddlSecRel:l,gasLimit:a};r.execute(w.i18n._("Swap"),Object.assign({opcode:ab.TX},h),c)}),[t,e]);return o}(),Q=n.useCallback((e=>{t&&(b?R:r)&&K({to:P,data:z,useSource:H,duration:X,ddl:p,value:_,subtitle:e})}),[P,p,z,X,H,t,r,C,R,_,b]);return{status:E,refetch:G,priceImpact:W,executeSwap:Q,baseFeeAmount:N,resAmount:q,additionalFeeAmount:T,resPricePerToToken:B,resPricePerFromToken:U}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(Nb||(Nb={}));function Tb(e){My(e),Yc(),Xc();const{provider:t,connector:r}=l.useWeb3React();n.useEffect((()=>{const t=e.defaultChainId||1;(null==r?void 0:r.connectEagerly)?r.connectEagerly(t):r.activate(t)}),[r]),n.useEffect((()=>{const e=null==t?void 0:t.provider;e&&e.once&&e.once("chainChanged",(()=>{setTimeout((()=>{window.location.reload()}),200||100)}))}),[t]);const o=e.width||375,i=e.height||494;return Ab(Object.assign(Object.assign({},e),{width:o,height:i})),ne.exports.jsx(Er,{sx:{width:o,height:i,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:"dodo-widget-container",children:ne.exports.jsx(xb,{...e,children:e.children})})}function Ob(e){const t=function(e){for(var t=void 0===e?{}:e,n=t.mode,o=void 0===n?"light":n,i=t.lang,s=t.theme,a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];var u=Hr(o,s,i);return dr(u=a.reduce((function(e,t){return r.merge(e,t)}),u))}({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),o=n.useMemo((()=>e.defaultChainId||1),[e.defaultChainId]),i=Ff({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:o}),s=`${i.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${o}`;return ne.exports.jsx(c.Provider,{store:Es,children:ne.exports.jsx($y,{locale:e.locale,children:ne.exports.jsx(Dr,{theme:t,children:ne.exports.jsxs(l.Web3ReactProvider,{connectors:i,children:[ne.exports.jsx(Gr,{container:".dodo-widget-container"}),ne.exports.jsx(Tb,{...e})]},s)})})})}function Ib(e){const{width:t}=c.useSelector(Hy),r=n.useMemo((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return ne.exports.jsx(si,{container:document.querySelector(".dodo-widget-container"),maxWidth:r,...e})}function Wb({onClick:e}){const t=vr();return ne.exports.jsx(On,{sx:{width:"100%",position:"relative"},onClick:e,children:ne.exports.jsx(Er,{component:pn,sx:{width:36,height:36,borderRadius:"50%",backgroundColor:t.palette.background.input,border:`4px solid ${t.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)"},children:ne.exports.jsx(Er,{component:i.ArrowBack,sx:{width:18,color:"text.secondary"}})})})}function Fb({open:t,execute:r,onClose:o,toToken:s,fromToken:a,fromAmount:u,toAmount:l,priceImpact:d,clearFromAmt:h,clearToAmt:f,baseFeeAmount:p,curToFiatPrice:m,curFromFiatPrice:g,pricePerFromToken:y,additionalFeeAmount:b}){var v,w;const x=vr(),E=c.useSelector(_b),A=c.useDispatch(),{contractStatus:R}=c.useSelector(Hy),_=n.useMemo((()=>new k.default(d).gt(15)),[d]),[S,N]=n.useState(!1),[M,T]=n.useState(!1);return n.useEffect((()=>{R!==gs.Pending&&o(),R===gs.TxSuccess&&(f(),h())}),[R]),n.useEffect((()=>{N(!1)}),[m]),ne.exports.jsx(Ly,{open:t,onClose:()=>{A(lb({contractStatus:gs.Initial})),o()},title:ne.exports.jsx(e.Trans,{id:"Swap summary"}),children:ne.exports.jsxs(Er,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${x.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${x.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[ne.exports.jsx(Vy,{width:16,height:16,url:null==a?void 0:a.logoURI,address:null!==(v=null==a?void 0:a.address)&&void 0!==v?v:"",marginRight:6}),ne.exports.jsx(Er,{children:`${ci({input:u,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`})]}),ne.exports.jsx(Er,{sx:{mt:4,typography:"h6",color:x.palette.text.secondary},children:g?`$${ai({input:g,showDecimals:1})}`:"-"})]}),ne.exports.jsx(Er,{sx:{width:16,mx:16},component:i.DoubleRight}),ne.exports.jsxs(Er,{children:[ne.exports.jsxs(Er,{sx:{display:"flex"},children:[ne.exports.jsx(Vy,{width:16,height:16,marginRight:6,url:null==s?void 0:s.logoURI,address:null!==(w=null==s?void 0:s.address)&&void 0!==w?w:""}),ne.exports.jsx(Er,{children:`${ci({input:l,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsx(Er,{sx:{typography:"h6",mt:4,color:x.palette.text.secondary},children:m?`$${ai({input:m,showDecimals:1})}(${d}%)`:"-"})]})]}),ne.exports.jsx(Er,{sx:{mt:12,typography:"h6"},children:`1 ${null==a?void 0:a.symbol} = ${ci({input:new k.default(l).dividedBy(new k.default(u)),decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsxs(Er,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${x.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:x.palette.text.secondary},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(Er,{sx:{width:16,mr:7},component:i.DetailBorder}),ne.exports.jsx(e.Trans,{id:"Swap Detail"})]}),ne.exports.jsx(Er,{component:pn,children:ne.exports.jsx(Er,{onClick:()=>T(!M),sx:{width:10,color:"text.secondary",transform:M?"rotateX(0deg)":"rotateX(180deg)"},component:i.CaretUp})})]}),ne.exports.jsxs(Er,{sx:{mt:16,display:M?"initial":"none"},children:[ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Basic Fee"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Estimated service provider fees"}),ml:5})]}),ne.exports.jsx(Er,{children:`${ci({input:p,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Additional Fee"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),ne.exports.jsx(Er,{children:`${ci({input:b,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Price Impact"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),ne.exports.jsx(Er,{children:`${d}%`})]}),ne.exports.jsxs(Er,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Slippage"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),ne.exports.jsx(Er,{children:E})]})]})]}),ne.exports.jsx(Er,{sx:{flex:1}}),_&&ne.exports.jsxs(Er,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>N(!S),children:[ne.exports.jsx(Er,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:S?ne.exports.jsx(Er,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:ne.exports.jsx(Er,{component:i.Done,sx:{width:14,color:"#1a1a1b"}})}):ne.exports.jsx(Er,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${x.palette.text.secondary}`}})}),ne.exports.jsx(Er,{children:ne.exports.jsx(e.Trans,{components:{0:ne.exports.jsx(Er,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:d},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),ne.exports.jsx(ln,{isLoading:R==gs.Pending,disabled:_&&!S,fullWidth:!0,onClick:()=>{r(),A(lb({contractStatus:gs.Pending}))},children:R==gs.Pending?ne.exports.jsx(e.Trans,{id:"Confirming"}):ne.exports.jsx(e.Trans,{id:"Confirm swap"})})]})})}function Cb(e){var{sx:r,maxVal:n,decimals:o=2,onInputChange:i}=e,s=us(e,["sx","maxVal","decimals","onInputChange"]);return vr(),ne.exports.jsx(kn,{...s,onChange:e=>{const r=0===e.target.value.length?null:di(e.target.value,o),s=n&&r&&new t.BigNumber(r).gt(n)?n.toString():r;console.log("finalVal:",s),i&&i(s)}})}function jb({open:t,onClose:r}){const o=vr(),i=c.useDispatch(),s=c.useSelector(_b),a=c.useSelector(Sb),u=n.useMemo((()=>Number(s)>=50),[s]);return ne.exports.jsx(Ly,{open:t,onClose:r,title:ne.exports.jsx(e.Trans,{id:"Settings"}),children:ne.exports.jsxs(Er,{sx:{mx:20},children:[ne.exports.jsxs(Er,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{mb:16,display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Slippage Tolerance"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),ne.exports.jsxs(Er,{sx:{display:"flex",flexDirection:"column"},children:[ne.exports.jsx(Cb,{fullWidth:!0,maxVal:100,value:s,placeholder:3..toString(),onInputChange:e=>{i((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:ne.exports.jsx(Er,{sx:{color:"text.disabled"},children:"%"}),height:36}),u&&ne.exports.jsx(Er,{sx:{typography:"h6",mt:6,color:"error.main"},children:ne.exports.jsx(e.Trans,{id:"Maximum slippage do not exceed 50%"})})]})]}),ne.exports.jsxs(Er,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[ne.exports.jsxs(Er,{sx:{mb:16,display:"flex",alignItems:"center"},children:[ne.exports.jsx(e.Trans,{id:"Transaction Deadline"}),ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),ne.exports.jsx(Cb,{value:a,fullWidth:!0,height:36,placeholder:w.i18n._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{i((e=>t=>ls(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function Ub({toToken:t,fromToken:r,priceStatus:o,pricePerToToken:s,pricePerFromToken:a}){const[c,u]=n.useState("-"),[l,d]=n.useState(null),[h,f]=n.useState("-"),[p,m]=n.useState(null);n.useEffect((()=>{u(null==r?void 0:r.symbol),f(null==t?void 0:t.symbol),d(s),m(a)}),[r,t,s,a]);const g=n.useCallback((()=>{u(h),f(c),d(p),m(l)}),[c,l,h,p]);return ne.exports.jsx(Er,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[Nb.Initial]:"-",[Nb.Loading]:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Wn,{sx:{mr:5}}),ne.exports.jsx(e.Trans,{id:"Fetching best price..."})]}),[Nb.Failed]:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Er,{component:i.Warn,sx:{width:15,mr:5,color:"warning.main"}}),ne.exports.jsx(e.Trans,{id:"Quote not available"})]}),[Nb.Success]:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Er,{sx:{typography:"body2"},children:`1 ${c} = ${ai({input:p,showDecimals:4})} ${h}`}),ne.exports.jsx(Er,{component:pn,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:ne.exports.jsx(Er,{sx:{width:16,color:"text.secondary"},onClick:g,component:i.Switch})})]})}[o]})}function Db({open:t,onClose:r}){const n=c.useSelector(As);return ne.exports.jsx(Ly,{title:ne.exports.jsx(e.Trans,{id:"Connect to your wallet"}),open:t,onClose:r,children:ne.exports.jsx(Er,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(If).map((t=>ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center",flexDirection:"column",mt:20,p:20,backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:()=>{!function(e,t,r){var n;const o=Wf[e];if(!o)throw new Error(`Unknown wallet type: ${e}`);const[i]=o;null===(n=i.activate(t))||void 0===n||n.catch((e=>{4001!==e.code?r(e):i.connectEagerly?i.connectEagerly(t):i.activate(t)}))}(t.type,n,(e=>{console.error(e)}))},children:[ne.exports.jsx(Er,{component:t.icon,sx:{width:32,height:32}}),ne.exports.jsx(Er,{sx:{mt:8,typography:"caption"},children:t.name}),ne.exports.jsx(Er,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:ne.exports.jsx(e.Trans,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function Bb(){const{connector:t}=l.useWeb3React(),[r,o]=n.useState(!1);return ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(ln,{size:ln.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),o(!0)},"data-testid":"connect-wallet-btn",children:ne.exports.jsx(e.Trans,{id:"Connect to a wallet"})}),ne.exports.jsx(Db,{open:r,onClose:()=>o(!1)})]})}const Vb=({account:e,chainId:t,offset:r,contractAddress:o})=>{var i;const s=c.useSelector(As),a=n.useMemo((()=>{var e;return Ws[null!==(e=t)&&void 0!==e?e:s]}),[t]),{isETH:u}=n.useMemo((()=>rs(t)),[t]),{DODO_APPROVE:d}=a||{},h=null!==(i=null!=o?o:d)&&void 0!==i?i:null,f=function(e){const{account:t}=l.useWeb3React(),r=c.useSelector(As),o=c.useSelector(Oy),i=n.useMemo((()=>ss[r]),[r]),s=n.useCallback((r=>{var n;if(!t||!e)return null;if(r.symbol===i.symbol&&ts(r.address,i.address))return new k.default(ub);const s=null===(n=null==o?void 0:o[r.address.toLowerCase()])||void 0===n?void 0:n.tokenAllowances;return null!=s?s:null}),[t,e,i.symbol,i.address,o]);return s}(h),p=jy(),{runningRequests:m}=hb(),g=c.useSelector(Cy),y=n.useMemo((()=>{var e;return null===(e=ss[null!=t?t:s])||void 0===e?void 0:e.address}),[t]),b=n.useCallback(((t,n,o)=>{if(!t)return Gc.Loading;const i=!!(null==m?void 0:m.find((e=>e.spec.opcode===ab.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),s=null!=o?o:t?p(t):null,a=t?f(t):null,c=new k.default(null!=n?n:0);if(!e)return Gc.Unchecked;if(!s||c.minus(null!=r?r:0).gt(s))return Gc.Unchecked;if(c.isZero())return Gc.Unchecked;return t.address===y?Gc.Sufficient:i?Gc.Approving:a&&c.minus(null!=r?r:0).gt(a)?Gc.Insufficient:Gc.Sufficient}),[p,f,e,r,h,t,g,m,y]),v=n.useCallback((e=>{const t=e?f(e):null;return("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)}),[f]),x=pb(),E=c.useDispatch(),A=n.useCallback(((t,r)=>ls(void 0,void 0,void 0,(function*(){if(!h||!e||!t)return;const n=(e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t})(t),o=r?new k.default(0):void 0,i=r?w.i18n._("Reset"):w.i18n._("Approve");var s;(yield x.execute(`${i} ${n}`,{opcode:ab.Approval,token:t,contract:h,amt:o}))===tb.Success&&E((s=null!=o?o:ub,e=>ls(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:s})}))))}))),[h,e,t,x,E]),R=n.useCallback((e=>{const t=new k.default(0);if(!e)return t.toString();const r=p(e);if(!r)return t.toString();let n=r;const o=u?.1:.02;return y===(null==e?void 0:e.address)&&(n=r.gt(o)?r.minus(o):t),n.toString()}),[t,p,u]);return{getApprovalState:b,getPendingRest:v,getMaxBalance:R,submitApprove:A}};function Pb(){var t,o;const s=vr(),{isInflight:a}=hb(),{chainId:u,account:d}=l.useWeb3React(),h=c.useDispatch(),{isReverseRouting:f}=c.useSelector(Hy),p=c.useSelector(As),m=c.useSelector(Fy),g=c.useSelector(Wy),{isETH:y}=n.useMemo((()=>rs(u)),[u]),b=n.useMemo((()=>{var e;return null===(e=ss[null!=u?u:p])||void 0===e?void 0:e.address}),[u]),[v,w]=n.useState(""),[x,E]=n.useState(""),[A,R]=n.useState(""),[_,S]=n.useState(""),N=n.useMemo((()=>r.debounce((e=>R(e)),1e3)),[]),M=n.useMemo((()=>r.debounce((e=>S(e)),1e3)),[]),[T,O]=n.useState(null),[I,W]=n.useState(null),[F,C]=n.useState(!1),[j,U]=n.useState(!1),{toFiatPrice:D,fromFiatPrice:B}=kb({chainId:u,toToken:I,fromToken:T}),V=jy(),P=n.useMemo((()=>T?V(T):null),[T,V]);n.useMemo((()=>I?V(I):null),[I,V]);const{getApprovalState:Z,submitApprove:z,getPendingRest:L,getMaxBalance:H}=Vb({account:d,chainId:u}),Y=n.useMemo((()=>L(f?I:T)),[null==T?void 0:T.address,null==I?void 0:I.address,L,f]),{marginAmount:X}=Eb({token:f?I:T,fiatPrice:f?D:B}),{resAmount:J,priceImpact:G,executeSwap:q,baseFeeAmount:K,additionalFeeAmount:Q,resPricePerToToken:$,resPricePerFromToken:ee,status:te}=Mb({toToken:I,fromToken:T,marginAmount:X,fromAmount:A,toAmount:_}),re=n.useCallback((e=>{const t=e.toString();w(t),N(t)}),[w,N]),oe=n.useCallback((e=>{const t=e.toString();E(t),M(t)}),[E,M]),ie=c.useSelector(Ty),se=()=>{let e=null;T||g&&g.chainId===u||ie.some((t=>!(t.chainId!==u||t.side&&"from"!==t.side)&&(e=t,O(t),!0))),I||m&&m.chainId===u||ie.some((t=>!(t.chainId!==u||e&&e.address===t.address||t.side&&"to"!==t.side)&&(W(t),!0)))};n.useEffect((()=>{u&&(W(null),O(null),f?oe(""):re("")),g&&g.chainId===u&&(O(g),g.amount&&(h(lb({isReverseRouting:!1})),re(g.amount))),m&&m.chainId===u&&(W(m),m.amount&&g&&!g.amount&&(h(lb({isReverseRouting:!0})),oe(m.amount))),se()}),[m,g,u,re,oe]),n.useEffect((()=>{se()}),[ie]);const ae=n.useCallback((()=>{re(""),oe(""),O(I),W(T)}),[O,I,W,T,re,oe]),ce=n.useCallback((e=>f?oe(H(I)):re(H(T))),[re,oe,H,T,I,f]),ue=n.useMemo((()=>(100*Number(G)).toFixed(2)),[G]),le=n.useMemo((()=>{const e=f?J:A;return e&&B?new k.default(B).multipliedBy(e):null}),[B,A,f,J]),de=n.useMemo((()=>{const e=f?_:J;return e&&D?new k.default(D).multipliedBy(e):null}),[D,_,f,J]),he=n.useMemo((()=>ne.exports.jsxs(Er,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[ne.exports.jsx(Ib,{title:ne.exports.jsx(e.Trans,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),ne.exports.jsxs(Er,{sx:{display:"flex"},children:[ne.exports.jsx(e.Trans,{id:"Current price impact"}),ne.exports.jsxs(Er,{sx:{color:s.palette.error.main,ml:4},children:[ue,"%"]})]})]})),[ue]),fe=n.useMemo((()=>ne.exports.jsx(Ub,{toToken:I,fromToken:T,priceStatus:te,pricePerToToken:$,pricePerFromToken:ee})),[I,T,te,$,ee]),pe=n.useMemo((()=>!ns[u||1]),[u]),me=n.useMemo((()=>te===Nb.Loading?ne.exports.jsx(Er,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Wn,{sx:{mr:5}}),ne.exports.jsx(e.Trans,{id:"Fetching best price..."})]})}):pe?ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsx(Er,{component:i.Warn,sx:{mr:6,width:16,color:"warning.main"}}),ne.exports.jsx(e.Trans,{id:"Unsupported network - switch to trade"})]}):v&&new k.default(ue).gt(15)?he:fe),[te,fe,v,he,ue,pe]),ge=n.useMemo((()=>f?new k.default(x).gt(0)?ci({input:J,decimals:null==T?void 0:T.decimals}):"-":v),[v,x,J,T,f]),ye=n.useMemo((()=>f?x:new k.default(v).gt(0)?ci({input:J,decimals:null==I?void 0:I.decimals}):"-"),[v,x,J,I,f]),be=n.useMemo((()=>{const t=Z(T,f?J||0:A),r=t===Gc.Approving,n=t===Gc.Insufficient&&!Y,o=y?.1:.02,i=b===(null==T?void 0:T.address),s=new k.default(P||0);return d?a?ne.exports.jsx(ln,{fullWidth:!0,isLoading:!0,disabled:!0,children:ne.exports.jsx(e.Trans,{id:"Transaction Pending"})}):T&&I?n?ne.exports.jsx(ln,{fullWidth:!0,disabled:r,onClick:()=>z(T),children:r?ne.exports.jsx(e.Trans,{id:"Approving"}):ne.exports.jsx(e.Trans,{id:"Approve"})}):new k.default(f?_:A).gt(0)?te===Nb.Loading?ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:ne.exports.jsx(e.Trans,{id:"Fetching Price..."})}):J&&te!==Nb.Failed?s.lt(f?J:A)||i&&s.lte(o)?ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:ne.exports.jsx(e.Trans,{id:"Insufficient balance"})}):ne.exports.jsx(ln,{fullWidth:!0,onClick:()=>C(!0),"data-testid":"swap-review-btn",children:ne.exports.jsx(e.Trans,{id:"Review Swap"})}):ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,children:ne.exports.jsx(e.Trans,{id:"Quote not available"})}):ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:ne.exports.jsx(e.Trans,{id:"Enter an amount"})}):ne.exports.jsx(ln,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:ne.exports.jsx(e.Trans,{id:"Select Tokens"})}):ne.exports.jsx(Bb,{})}),[y,d,_,A,I,J,T,a,q,Y,z,te,P,Z,b,f]),ve=n.useMemo((()=>T&&I?ne.exports.jsxs(Er,{sx:{display:"flex",alignItems:"center"},children:[ne.exports.jsx(Vy,{token:T,sx:{width:16,height:16,mr:6}}),`${ci({input:f?J:A,decimals:null==T?void 0:T.decimals})} ${null==T?void 0:T.symbol}`,ne.exports.jsx(Er,{component:i.DoubleRight,sx:{width:12,height:12,mx:16}}),ne.exports.jsx(Vy,{token:I,sx:{width:16,height:16,mr:6}}),`${ci({input:f?_:J,decimals:null==I?void 0:I.decimals})} ${null==I?void 0:I.symbol}`]}):ne.exports.jsx(Er,{})),[T,I,A,_,J,f]);return ne.exports.jsxs(ne.exports.Fragment,{children:[ne.exports.jsxs(Er,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[ne.exports.jsx(e.Trans,{id:"Swap"}),ne.exports.jsx(Er,{component:pn,children:ne.exports.jsx(Er,{component:i.Setting,onClick:()=>U(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),ne.exports.jsxs(Er,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[ne.exports.jsxs(Er,{children:[ne.exports.jsx(qy,{sx:{mb:4},token:T,side:"from",amt:ge,onMaxClick:ce,onInputChange:re,onInputFocus:()=>{f&&re(""),h(lb({isReverseRouting:!1}))},showMaxBtn:!f&&!v,occupiedAddrs:[null!==(t=null==I?void 0:I.address)&&void 0!==t?t:""],fiatPriceTxt:le?`$${ai({input:le,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return ae();re(""),oe(""),O(e)},readOnly:f}),ne.exports.jsx(Wb,{onClick:ae}),ne.exports.jsx(qy,{token:I,side:"to",amt:ye,onInputChange:oe,onInputFocus:()=>{f||oe(""),h(lb({isReverseRouting:!0}))},occupiedAddrs:[null!==(o=null==T?void 0:T.address)&&void 0!==o?o:""],fiatPriceTxt:de?`$${ai({input:de,showDecimals:1})}(${ue}%)`:"-",onTokenChange:(e,t)=>{if(t)return ae();re(""),oe(""),W(e)},readOnly:!f}),ne.exports.jsx(Er,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:me})]}),be,ne.exports.jsxs(Er,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:s.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[ne.exports.jsx(Er,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:s.palette.text.disabled}},component:i.Dodo}),ne.exports.jsx(e.Trans,{id:"Powered by DODO protocol"})]})]}),ne.exports.jsx(Fb,{toToken:I,fromToken:T,fromAmount:f?J:A,toAmount:f?_:J,open:F,baseFeeAmount:K,priceImpact:ue,additionalFeeAmount:Q,curToFiatPrice:de,execute:()=>q(ve),clearFromAmt:()=>re(""),clearToAmt:()=>oe(""),curFromFiatPrice:le,pricePerFromToken:ee,onClose:()=>C(!1)}),ne.exports.jsx(jb,{open:j,onClose:()=>U(!1)})]})}var Zb,zb=T.default;if("production"===process.env.NODE_ENV)Zb=zb.createRoot,zb.hydrateRoot;else{var Lb=zb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Zb=function(e,t){Lb.usingClientEntryPoint=!0;try{return zb.createRoot(e,t)}finally{Lb.usingClientEntryPoint=!1}}}exports.InitSwapWidget=function(e){const t=document.getElementById("dodo-swap-widget");Zb(t).render(ne.exports.jsx(Ob,{...e,children:ne.exports.jsx(Pb,{})}))},exports.SwapWidget=function(e){return ne.exports.jsx(Ob,{...e,children:ne.exports.jsx(Pb,{})})};
|