@dhedge/trading-widget 3.6.1 → 3.7.0
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/README.md +11 -15
- package/core-kit/abi/index.d.ts +0 -1
- package/core-kit/const/config.d.ts +1 -4
- package/core-kit/const/contracts/arbitrum.d.ts +0 -1
- package/core-kit/const/contracts/base.d.ts +0 -1
- package/core-kit/const/flat-money.d.ts +1 -1
- package/core-kit/const/gmx.d.ts +4 -0
- package/core-kit/const/index.d.ts +1 -0
- package/core-kit/const/logger.d.ts +0 -1
- package/core-kit/const/synthetix.d.ts +0 -5
- package/core-kit/hooks/pool/index.d.ts +0 -2
- package/core-kit/hooks/pool/use-pool-dynamic-contract-data.d.ts +3 -4
- package/core-kit/hooks/pool/use-pool-fees.d.ts +2 -3
- package/core-kit/hooks/pool/use-pool-token-price.d.ts +2 -3
- package/core-kit/hooks/trading/index.d.ts +0 -2
- package/core-kit/types/index.d.ts +0 -1
- package/core-kit/types/trading-panel.types.d.ts +1 -1
- package/core-kit/utils/flat-money.d.ts +1 -1
- package/core-kit/utils/gmx.d.ts +7 -0
- package/core-kit/utils/index.d.ts +1 -1
- package/index.cjs +217 -1
- package/index.d.ts +6 -6
- package/index.js +41876 -240
- package/package.json +1 -3
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +0 -4
- package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts +0 -7
- package/trading-widget/hooks/index.d.ts +0 -1
- package/trading-widget/hooks/{use-leveraged-flat-money-withdrawal-checks.d.ts → use-leveraged-withdrawal-checks.d.ts} +1 -1
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +0 -4
- package/trading-widget/types/index.d.ts +0 -1
- package/core-kit/abi/synthetix-v3/i-trusted-multicall-forwarder.d.ts +0 -41
- package/core-kit/abi/synthetix-v3/ierc-7412.d.ts +0 -53
- package/core-kit/abi/synthetix-v3/index.d.ts +0 -5
- package/core-kit/abi/synthetix-v3/synthetix-v3-asset-guard.d.ts +0 -37
- package/core-kit/abi/synthetix-v3/synthetix-v3-contract-guard.d.ts +0 -45
- package/core-kit/abi/synthetix-v3/synthetix-v3-core.d.ts +0 -41
- package/core-kit/hooks/pool/synthetixV3/use-pool-token-price-mutable.d.ts +0 -8
- package/core-kit/hooks/pool/synthetixV3/use-synthetix-v3-asset-balance.d.ts +0 -8
- package/core-kit/hooks/pool/synthetixV3/use-total-funds-value-mutable.d.ts +0 -8
- package/core-kit/hooks/trading/synthetix-v3/use-available-withdraw-liquidity.d.ts +0 -47
- package/core-kit/hooks/trading/synthetix-v3/use-oracles-update-transaction-data.d.ts +0 -23
- package/core-kit/hooks/trading/synthetix-v3/use-send-oracles-update-transaction.d.ts +0 -4
- package/core-kit/hooks/trading/synthetix-v3/use-synthetix-v3-oracles-update.d.ts +0 -7
- package/core-kit/hooks/trading/synthetix-v3/use-withdraw-liquidity.d.ts +0 -5
- package/core-kit/types/synthetix-v3.types.d.ts +0 -15
- package/core-kit/utils/synthetix-v3/eip-7412.d.ts +0 -21
- package/core-kit/utils/synthetix-v3/parse-error.d.ts +0 -3
- package/core-kit/utils/synthetix-v3/pyth-adapter.d.ts +0 -13
- package/core-kit/utils/synthetix.d.ts +0 -2
- package/index-41d61fb0.js +0 -42941
- package/index-e30df6fa.cjs +0 -217
- package/pyth-adapter-dc7665b9.js +0 -5705
- package/pyth-adapter-f74cde23.cjs +0 -11
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/oracles-update-summary.d.ts +0 -2
- package/trading-widget/constants/synthetix-v3.d.ts +0 -2
- package/trading-widget/hooks/use-synthetix-withdrawal-window.d.ts +0 -4
- package/trading-widget/types/synthetix-v3.types.d.ts +0 -24
- package/trading-widget/utils/synthetix-v3.d.ts +0 -39
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var ui=Object.defineProperty;var ci=(e,t,a)=>t in e?ui(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var Z=(e,t,a)=>(ci(e,typeof t!="symbol"?t+"":t,a),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $e=require("./index-e30df6fa.cjs"),ut=require("viem");require("react");require("wagmi");require("@tanstack/react-query");var Rr={exports:{}};const li={},hi=Object.freeze(Object.defineProperty({__proto__:null,default:li},Symbol.toStringTag,{value:"Module"})),di=$e.getAugmentedNamespace(hi);Rr.exports;(function(e){(function(t,a){function s(E,r){if(!E)throw new Error(r||"Assertion failed")}function h(E,r){E.super_=r;var u=function(){};u.prototype=r.prototype,E.prototype=new u,E.prototype.constructor=E}function f(E,r,u){if(f.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((r==="le"||r==="be")&&(u=r,r=10),this._init(E||0,r||10,u||"be"))}typeof t=="object"?t.exports=f:a.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=di.Buffer}catch{}f.isBN=function(r){return r instanceof f?!0:r!==null&&typeof r=="object"&&r.constructor.wordSize===f.wordSize&&Array.isArray(r.words)},f.max=function(r,u){return r.cmp(u)>0?r:u},f.min=function(r,u){return r.cmp(u)<0?r:u},f.prototype._init=function(r,u,p){if(typeof r=="number")return this._initNumber(r,u,p);if(typeof r=="object")return this._initArray(r,u,p);u==="hex"&&(u=16),s(u===(u|0)&&u>=2&&u<=36),r=r.toString().replace(/\s+/g,"");var v=0;r[0]==="-"&&(v++,this.negative=1),v<r.length&&(u===16?this._parseHex(r,v,p):(this._parseBase(r,u,v),p==="le"&&this._initArray(this.toArray(),u,p)))},f.prototype._initNumber=function(r,u,p){r<0&&(this.negative=1,r=-r),r<67108864?(this.words=[r&67108863],this.length=1):r<4503599627370496?(this.words=[r&67108863,r/67108864&67108863],this.length=2):(s(r<9007199254740992),this.words=[r&67108863,r/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},f.prototype._initArray=function(r,u,p){if(s(typeof r.length=="number"),r.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(r.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var x,w,b=0;if(p==="be")for(v=r.length-1,x=0;v>=0;v-=3)w=r[v]|r[v-1]<<8|r[v-2]<<16,this.words[x]|=w<<b&67108863,this.words[x+1]=w>>>26-b&67108863,b+=24,b>=26&&(b-=26,x++);else if(p==="le")for(v=0,x=0;v<r.length;v+=3)w=r[v]|r[v+1]<<8|r[v+2]<<16,this.words[x]|=w<<b&67108863,this.words[x+1]=w>>>26-b&67108863,b+=24,b>=26&&(b-=26,x++);return this._strip()};function d(E,r){var u=E.charCodeAt(r);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;s(!1,"Invalid character in "+E)}function A(E,r,u){var p=d(E,u);return u-1>=r&&(p|=d(E,u-1)<<4),p}f.prototype._parseHex=function(r,u,p){this.length=Math.ceil((r.length-u)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var x=0,w=0,b;if(p==="be")for(v=r.length-1;v>=u;v-=2)b=A(r,u,v)<<x,this.words[w]|=b&67108863,x>=18?(x-=18,w+=1,this.words[w]|=b>>>26):x+=8;else{var l=r.length-u;for(v=l%2===0?u+1:u;v<r.length;v+=2)b=A(r,u,v)<<x,this.words[w]|=b&67108863,x>=18?(x-=18,w+=1,this.words[w]|=b>>>26):x+=8}this._strip()};function R(E,r,u,p){for(var v=0,x=0,w=Math.min(E.length,u),b=r;b<w;b++){var l=E.charCodeAt(b)-48;v*=p,l>=49?x=l-49+10:l>=17?x=l-17+10:x=l,s(l>=0&&x<p,"Invalid character"),v+=x}return v}f.prototype._parseBase=function(r,u,p){this.words=[0],this.length=1;for(var v=0,x=1;x<=67108863;x*=u)v++;v--,x=x/u|0;for(var w=r.length-p,b=w%v,l=Math.min(w,w-b)+p,i=0,y=p;y<l;y+=v)i=R(r,y,y+v,u),this.imuln(x),this.words[0]+i<67108864?this.words[0]+=i:this._iaddn(i);if(b!==0){var D=1;for(i=R(r,y,r.length,u),y=0;y<b;y++)D*=u;this.imuln(D),this.words[0]+i<67108864?this.words[0]+=i:this._iaddn(i)}this._strip()},f.prototype.copy=function(r){r.words=new Array(this.length);for(var u=0;u<this.length;u++)r.words[u]=this.words[u];r.length=this.length,r.negative=this.negative,r.red=this.red};function B(E,r){E.words=r.words,E.length=r.length,E.negative=r.negative,E.red=r.red}if(f.prototype._move=function(r){B(r,this)},f.prototype.clone=function(){var r=new f(null);return this.copy(r),r},f.prototype._expand=function(r){for(;this.length<r;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=S}catch{f.prototype.inspect=S}else f.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var I=["","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"],k=[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],T=[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];f.prototype.toString=function(r,u){r=r||10,u=u|0||1;var p;if(r===16||r==="hex"){p="";for(var v=0,x=0,w=0;w<this.length;w++){var b=this.words[w],l=((b<<v|x)&16777215).toString(16);x=b>>>24-v&16777215,v+=2,v>=26&&(v-=26,w--),x!==0||w!==this.length-1?p=I[6-l.length]+l+p:p=l+p}for(x!==0&&(p=x.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(r===(r|0)&&r>=2&&r<=36){var i=k[r],y=T[r];p="";var D=this.clone();for(D.negative=0;!D.isZero();){var O=D.modrn(y).toString(r);D=D.idivn(y),D.isZero()?p=O+p:p=I[i-O.length]+O+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var r=this.words[0];return this.length===2?r+=this.words[1]*67108864:this.length===3&&this.words[2]===1?r+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-r:r},f.prototype.toJSON=function(){return this.toString(16,2)},g&&(f.prototype.toBuffer=function(r,u){return this.toArrayLike(g,r,u)}),f.prototype.toArray=function(r,u){return this.toArrayLike(Array,r,u)};var N=function(r,u){return r.allocUnsafe?r.allocUnsafe(u):new r(u)};f.prototype.toArrayLike=function(r,u,p){this._strip();var v=this.byteLength(),x=p||Math.max(1,v);s(v<=x,"byte array longer than desired length"),s(x>0,"Requested array length <= 0");var w=N(r,x),b=u==="le"?"LE":"BE";return this["_toArrayLike"+b](w,v),w},f.prototype._toArrayLikeLE=function(r,u){for(var p=0,v=0,x=0,w=0;x<this.length;x++){var b=this.words[x]<<w|v;r[p++]=b&255,p<r.length&&(r[p++]=b>>8&255),p<r.length&&(r[p++]=b>>16&255),w===6?(p<r.length&&(r[p++]=b>>24&255),v=0,w=0):(v=b>>>24,w+=2)}if(p<r.length)for(r[p++]=v;p<r.length;)r[p++]=0},f.prototype._toArrayLikeBE=function(r,u){for(var p=r.length-1,v=0,x=0,w=0;x<this.length;x++){var b=this.words[x]<<w|v;r[p--]=b&255,p>=0&&(r[p--]=b>>8&255),p>=0&&(r[p--]=b>>16&255),w===6?(p>=0&&(r[p--]=b>>24&255),v=0,w=0):(v=b>>>24,w+=2)}if(p>=0)for(r[p--]=v;p>=0;)r[p--]=0},Math.clz32?f.prototype._countBits=function(r){return 32-Math.clz32(r)}:f.prototype._countBits=function(r){var u=r,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},f.prototype._zeroBits=function(r){if(r===0)return 26;var u=r,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},f.prototype.bitLength=function(){var r=this.words[this.length-1],u=this._countBits(r);return(this.length-1)*26+u};function P(E){for(var r=new Array(E.bitLength()),u=0;u<r.length;u++){var p=u/26|0,v=u%26;r[u]=E.words[p]>>>v&1}return r}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(r+=p,p!==26)break}return r},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(r){return this.negative!==0?this.abs().inotn(r).iaddn(1):this.clone()},f.prototype.fromTwos=function(r){return this.testn(r-1)?this.notn(r).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(r){for(;this.length<r.length;)this.words[this.length++]=0;for(var u=0;u<r.length;u++)this.words[u]=this.words[u]|r.words[u];return this._strip()},f.prototype.ior=function(r){return s((this.negative|r.negative)===0),this.iuor(r)},f.prototype.or=function(r){return this.length>r.length?this.clone().ior(r):r.clone().ior(this)},f.prototype.uor=function(r){return this.length>r.length?this.clone().iuor(r):r.clone().iuor(this)},f.prototype.iuand=function(r){var u;this.length>r.length?u=r:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&r.words[p];return this.length=u.length,this._strip()},f.prototype.iand=function(r){return s((this.negative|r.negative)===0),this.iuand(r)},f.prototype.and=function(r){return this.length>r.length?this.clone().iand(r):r.clone().iand(this)},f.prototype.uand=function(r){return this.length>r.length?this.clone().iuand(r):r.clone().iuand(this)},f.prototype.iuxor=function(r){var u,p;this.length>r.length?(u=this,p=r):(u=r,p=this);for(var v=0;v<p.length;v++)this.words[v]=u.words[v]^p.words[v];if(this!==u)for(;v<u.length;v++)this.words[v]=u.words[v];return this.length=u.length,this._strip()},f.prototype.ixor=function(r){return s((this.negative|r.negative)===0),this.iuxor(r)},f.prototype.xor=function(r){return this.length>r.length?this.clone().ixor(r):r.clone().ixor(this)},f.prototype.uxor=function(r){return this.length>r.length?this.clone().iuxor(r):r.clone().iuxor(this)},f.prototype.inotn=function(r){s(typeof r=="number"&&r>=0);var u=Math.ceil(r/26)|0,p=r%26;this._expand(u),p>0&&u--;for(var v=0;v<u;v++)this.words[v]=~this.words[v]&67108863;return p>0&&(this.words[v]=~this.words[v]&67108863>>26-p),this._strip()},f.prototype.notn=function(r){return this.clone().inotn(r)},f.prototype.setn=function(r,u){s(typeof r=="number"&&r>=0);var p=r/26|0,v=r%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<v:this.words[p]=this.words[p]&~(1<<v),this._strip()},f.prototype.iadd=function(r){var u;if(this.negative!==0&&r.negative===0)return this.negative=0,u=this.isub(r),this.negative^=1,this._normSign();if(this.negative===0&&r.negative!==0)return r.negative=0,u=this.isub(r),r.negative=1,u._normSign();var p,v;this.length>r.length?(p=this,v=r):(p=r,v=this);for(var x=0,w=0;w<v.length;w++)u=(p.words[w]|0)+(v.words[w]|0)+x,this.words[w]=u&67108863,x=u>>>26;for(;x!==0&&w<p.length;w++)u=(p.words[w]|0)+x,this.words[w]=u&67108863,x=u>>>26;if(this.length=p.length,x!==0)this.words[this.length]=x,this.length++;else if(p!==this)for(;w<p.length;w++)this.words[w]=p.words[w];return this},f.prototype.add=function(r){var u;return r.negative!==0&&this.negative===0?(r.negative=0,u=this.sub(r),r.negative^=1,u):r.negative===0&&this.negative!==0?(this.negative=0,u=r.sub(this),this.negative=1,u):this.length>r.length?this.clone().iadd(r):r.clone().iadd(this)},f.prototype.isub=function(r){if(r.negative!==0){r.negative=0;var u=this.iadd(r);return r.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(r),this.negative=1,this._normSign();var p=this.cmp(r);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,x;p>0?(v=this,x=r):(v=r,x=this);for(var w=0,b=0;b<x.length;b++)u=(v.words[b]|0)-(x.words[b]|0)+w,w=u>>26,this.words[b]=u&67108863;for(;w!==0&&b<v.length;b++)u=(v.words[b]|0)+w,w=u>>26,this.words[b]=u&67108863;if(w===0&&b<v.length&&v!==this)for(;b<v.length;b++)this.words[b]=v.words[b];return this.length=Math.max(this.length,b),v!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(r){return this.clone().isub(r)};function J(E,r,u){u.negative=r.negative^E.negative;var p=E.length+r.length|0;u.length=p,p=p-1|0;var v=E.words[0]|0,x=r.words[0]|0,w=v*x,b=w&67108863,l=w/67108864|0;u.words[0]=b;for(var i=1;i<p;i++){for(var y=l>>>26,D=l&67108863,O=Math.min(i,r.length-1),U=Math.max(0,i-E.length+1);U<=O;U++){var V=i-U|0;v=E.words[V]|0,x=r.words[U]|0,w=v*x+D,y+=w/67108864|0,D=w&67108863}u.words[i]=D|0,l=y|0}return l!==0?u.words[i]=l|0:u.length--,u._strip()}var X=function(r,u,p){var v=r.words,x=u.words,w=p.words,b=0,l,i,y,D=v[0]|0,O=D&8191,U=D>>>13,V=v[1]|0,H=V&8191,W=V>>>13,Ie=v[2]|0,ae=Ie&8191,oe=Ie>>>13,Ve=v[3]|0,ee=Ve&8191,fe=Ve>>>13,pt=v[4]|0,ne=pt&8191,ue=pt>>>13,mt=v[5]|0,se=mt&8191,te=mt>>>13,Ue=v[6]|0,ie=Ue&8191,ce=Ue>>>13,ze=v[7]|0,le=ze&8191,c=ze>>>13,n=v[8]|0,o=n&8191,m=n>>>13,_=v[9]|0,M=_&8191,C=_>>>13,z=x[0]|0,q=z&8191,j=z>>>13,re=x[1]|0,L=re&8191,he=re>>>13,Jr=x[2]|0,de=Jr&8191,pe=Jr>>>13,Gr=x[3]|0,me=Gr&8191,ye=Gr>>>13,Vr=x[4]|0,ge=Vr&8191,we=Vr>>>13,Kr=x[5]|0,ve=Kr&8191,be=Kr>>>13,Zr=x[6]|0,xe=Zr&8191,Ee=Zr>>>13,Yr=x[7]|0,_e=Yr&8191,Me=Yr>>>13,Xr=x[8]|0,Ae=Xr&8191,Be=Xr>>>13,Qr=x[9]|0,Ce=Qr&8191,Fe=Qr>>>13;p.negative=r.negative^u.negative,p.length=19,l=Math.imul(O,q),i=Math.imul(O,j),i=i+Math.imul(U,q)|0,y=Math.imul(U,j);var Ut=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,l=Math.imul(H,q),i=Math.imul(H,j),i=i+Math.imul(W,q)|0,y=Math.imul(W,j),l=l+Math.imul(O,L)|0,i=i+Math.imul(O,he)|0,i=i+Math.imul(U,L)|0,y=y+Math.imul(U,he)|0;var Nt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,l=Math.imul(ae,q),i=Math.imul(ae,j),i=i+Math.imul(oe,q)|0,y=Math.imul(oe,j),l=l+Math.imul(H,L)|0,i=i+Math.imul(H,he)|0,i=i+Math.imul(W,L)|0,y=y+Math.imul(W,he)|0,l=l+Math.imul(O,de)|0,i=i+Math.imul(O,pe)|0,i=i+Math.imul(U,de)|0,y=y+Math.imul(U,pe)|0;var kt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(ee,q),i=Math.imul(ee,j),i=i+Math.imul(fe,q)|0,y=Math.imul(fe,j),l=l+Math.imul(ae,L)|0,i=i+Math.imul(ae,he)|0,i=i+Math.imul(oe,L)|0,y=y+Math.imul(oe,he)|0,l=l+Math.imul(H,de)|0,i=i+Math.imul(H,pe)|0,i=i+Math.imul(W,de)|0,y=y+Math.imul(W,pe)|0,l=l+Math.imul(O,me)|0,i=i+Math.imul(O,ye)|0,i=i+Math.imul(U,me)|0,y=y+Math.imul(U,ye)|0;var Lt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l=Math.imul(ne,q),i=Math.imul(ne,j),i=i+Math.imul(ue,q)|0,y=Math.imul(ue,j),l=l+Math.imul(ee,L)|0,i=i+Math.imul(ee,he)|0,i=i+Math.imul(fe,L)|0,y=y+Math.imul(fe,he)|0,l=l+Math.imul(ae,de)|0,i=i+Math.imul(ae,pe)|0,i=i+Math.imul(oe,de)|0,y=y+Math.imul(oe,pe)|0,l=l+Math.imul(H,me)|0,i=i+Math.imul(H,ye)|0,i=i+Math.imul(W,me)|0,y=y+Math.imul(W,ye)|0,l=l+Math.imul(O,ge)|0,i=i+Math.imul(O,we)|0,i=i+Math.imul(U,ge)|0,y=y+Math.imul(U,we)|0;var jt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul(se,q),i=Math.imul(se,j),i=i+Math.imul(te,q)|0,y=Math.imul(te,j),l=l+Math.imul(ne,L)|0,i=i+Math.imul(ne,he)|0,i=i+Math.imul(ue,L)|0,y=y+Math.imul(ue,he)|0,l=l+Math.imul(ee,de)|0,i=i+Math.imul(ee,pe)|0,i=i+Math.imul(fe,de)|0,y=y+Math.imul(fe,pe)|0,l=l+Math.imul(ae,me)|0,i=i+Math.imul(ae,ye)|0,i=i+Math.imul(oe,me)|0,y=y+Math.imul(oe,ye)|0,l=l+Math.imul(H,ge)|0,i=i+Math.imul(H,we)|0,i=i+Math.imul(W,ge)|0,y=y+Math.imul(W,we)|0,l=l+Math.imul(O,ve)|0,i=i+Math.imul(O,be)|0,i=i+Math.imul(U,ve)|0,y=y+Math.imul(U,be)|0;var qt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(qt>>>26)|0,qt&=67108863,l=Math.imul(ie,q),i=Math.imul(ie,j),i=i+Math.imul(ce,q)|0,y=Math.imul(ce,j),l=l+Math.imul(se,L)|0,i=i+Math.imul(se,he)|0,i=i+Math.imul(te,L)|0,y=y+Math.imul(te,he)|0,l=l+Math.imul(ne,de)|0,i=i+Math.imul(ne,pe)|0,i=i+Math.imul(ue,de)|0,y=y+Math.imul(ue,pe)|0,l=l+Math.imul(ee,me)|0,i=i+Math.imul(ee,ye)|0,i=i+Math.imul(fe,me)|0,y=y+Math.imul(fe,ye)|0,l=l+Math.imul(ae,ge)|0,i=i+Math.imul(ae,we)|0,i=i+Math.imul(oe,ge)|0,y=y+Math.imul(oe,we)|0,l=l+Math.imul(H,ve)|0,i=i+Math.imul(H,be)|0,i=i+Math.imul(W,ve)|0,y=y+Math.imul(W,be)|0,l=l+Math.imul(O,xe)|0,i=i+Math.imul(O,Ee)|0,i=i+Math.imul(U,xe)|0,y=y+Math.imul(U,Ee)|0;var $t=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,l=Math.imul(le,q),i=Math.imul(le,j),i=i+Math.imul(c,q)|0,y=Math.imul(c,j),l=l+Math.imul(ie,L)|0,i=i+Math.imul(ie,he)|0,i=i+Math.imul(ce,L)|0,y=y+Math.imul(ce,he)|0,l=l+Math.imul(se,de)|0,i=i+Math.imul(se,pe)|0,i=i+Math.imul(te,de)|0,y=y+Math.imul(te,pe)|0,l=l+Math.imul(ne,me)|0,i=i+Math.imul(ne,ye)|0,i=i+Math.imul(ue,me)|0,y=y+Math.imul(ue,ye)|0,l=l+Math.imul(ee,ge)|0,i=i+Math.imul(ee,we)|0,i=i+Math.imul(fe,ge)|0,y=y+Math.imul(fe,we)|0,l=l+Math.imul(ae,ve)|0,i=i+Math.imul(ae,be)|0,i=i+Math.imul(oe,ve)|0,y=y+Math.imul(oe,be)|0,l=l+Math.imul(H,xe)|0,i=i+Math.imul(H,Ee)|0,i=i+Math.imul(W,xe)|0,y=y+Math.imul(W,Ee)|0,l=l+Math.imul(O,_e)|0,i=i+Math.imul(O,Me)|0,i=i+Math.imul(U,_e)|0,y=y+Math.imul(U,Me)|0;var zt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l=Math.imul(o,q),i=Math.imul(o,j),i=i+Math.imul(m,q)|0,y=Math.imul(m,j),l=l+Math.imul(le,L)|0,i=i+Math.imul(le,he)|0,i=i+Math.imul(c,L)|0,y=y+Math.imul(c,he)|0,l=l+Math.imul(ie,de)|0,i=i+Math.imul(ie,pe)|0,i=i+Math.imul(ce,de)|0,y=y+Math.imul(ce,pe)|0,l=l+Math.imul(se,me)|0,i=i+Math.imul(se,ye)|0,i=i+Math.imul(te,me)|0,y=y+Math.imul(te,ye)|0,l=l+Math.imul(ne,ge)|0,i=i+Math.imul(ne,we)|0,i=i+Math.imul(ue,ge)|0,y=y+Math.imul(ue,we)|0,l=l+Math.imul(ee,ve)|0,i=i+Math.imul(ee,be)|0,i=i+Math.imul(fe,ve)|0,y=y+Math.imul(fe,be)|0,l=l+Math.imul(ae,xe)|0,i=i+Math.imul(ae,Ee)|0,i=i+Math.imul(oe,xe)|0,y=y+Math.imul(oe,Ee)|0,l=l+Math.imul(H,_e)|0,i=i+Math.imul(H,Me)|0,i=i+Math.imul(W,_e)|0,y=y+Math.imul(W,Me)|0,l=l+Math.imul(O,Ae)|0,i=i+Math.imul(O,Be)|0,i=i+Math.imul(U,Ae)|0,y=y+Math.imul(U,Be)|0;var Ht=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,l=Math.imul(M,q),i=Math.imul(M,j),i=i+Math.imul(C,q)|0,y=Math.imul(C,j),l=l+Math.imul(o,L)|0,i=i+Math.imul(o,he)|0,i=i+Math.imul(m,L)|0,y=y+Math.imul(m,he)|0,l=l+Math.imul(le,de)|0,i=i+Math.imul(le,pe)|0,i=i+Math.imul(c,de)|0,y=y+Math.imul(c,pe)|0,l=l+Math.imul(ie,me)|0,i=i+Math.imul(ie,ye)|0,i=i+Math.imul(ce,me)|0,y=y+Math.imul(ce,ye)|0,l=l+Math.imul(se,ge)|0,i=i+Math.imul(se,we)|0,i=i+Math.imul(te,ge)|0,y=y+Math.imul(te,we)|0,l=l+Math.imul(ne,ve)|0,i=i+Math.imul(ne,be)|0,i=i+Math.imul(ue,ve)|0,y=y+Math.imul(ue,be)|0,l=l+Math.imul(ee,xe)|0,i=i+Math.imul(ee,Ee)|0,i=i+Math.imul(fe,xe)|0,y=y+Math.imul(fe,Ee)|0,l=l+Math.imul(ae,_e)|0,i=i+Math.imul(ae,Me)|0,i=i+Math.imul(oe,_e)|0,y=y+Math.imul(oe,Me)|0,l=l+Math.imul(H,Ae)|0,i=i+Math.imul(H,Be)|0,i=i+Math.imul(W,Ae)|0,y=y+Math.imul(W,Be)|0,l=l+Math.imul(O,Ce)|0,i=i+Math.imul(O,Fe)|0,i=i+Math.imul(U,Ce)|0,y=y+Math.imul(U,Fe)|0;var Wt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(M,L),i=Math.imul(M,he),i=i+Math.imul(C,L)|0,y=Math.imul(C,he),l=l+Math.imul(o,de)|0,i=i+Math.imul(o,pe)|0,i=i+Math.imul(m,de)|0,y=y+Math.imul(m,pe)|0,l=l+Math.imul(le,me)|0,i=i+Math.imul(le,ye)|0,i=i+Math.imul(c,me)|0,y=y+Math.imul(c,ye)|0,l=l+Math.imul(ie,ge)|0,i=i+Math.imul(ie,we)|0,i=i+Math.imul(ce,ge)|0,y=y+Math.imul(ce,we)|0,l=l+Math.imul(se,ve)|0,i=i+Math.imul(se,be)|0,i=i+Math.imul(te,ve)|0,y=y+Math.imul(te,be)|0,l=l+Math.imul(ne,xe)|0,i=i+Math.imul(ne,Ee)|0,i=i+Math.imul(ue,xe)|0,y=y+Math.imul(ue,Ee)|0,l=l+Math.imul(ee,_e)|0,i=i+Math.imul(ee,Me)|0,i=i+Math.imul(fe,_e)|0,y=y+Math.imul(fe,Me)|0,l=l+Math.imul(ae,Ae)|0,i=i+Math.imul(ae,Be)|0,i=i+Math.imul(oe,Ae)|0,y=y+Math.imul(oe,Be)|0,l=l+Math.imul(H,Ce)|0,i=i+Math.imul(H,Fe)|0,i=i+Math.imul(W,Ce)|0,y=y+Math.imul(W,Fe)|0;var Jt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(M,de),i=Math.imul(M,pe),i=i+Math.imul(C,de)|0,y=Math.imul(C,pe),l=l+Math.imul(o,me)|0,i=i+Math.imul(o,ye)|0,i=i+Math.imul(m,me)|0,y=y+Math.imul(m,ye)|0,l=l+Math.imul(le,ge)|0,i=i+Math.imul(le,we)|0,i=i+Math.imul(c,ge)|0,y=y+Math.imul(c,we)|0,l=l+Math.imul(ie,ve)|0,i=i+Math.imul(ie,be)|0,i=i+Math.imul(ce,ve)|0,y=y+Math.imul(ce,be)|0,l=l+Math.imul(se,xe)|0,i=i+Math.imul(se,Ee)|0,i=i+Math.imul(te,xe)|0,y=y+Math.imul(te,Ee)|0,l=l+Math.imul(ne,_e)|0,i=i+Math.imul(ne,Me)|0,i=i+Math.imul(ue,_e)|0,y=y+Math.imul(ue,Me)|0,l=l+Math.imul(ee,Ae)|0,i=i+Math.imul(ee,Be)|0,i=i+Math.imul(fe,Ae)|0,y=y+Math.imul(fe,Be)|0,l=l+Math.imul(ae,Ce)|0,i=i+Math.imul(ae,Fe)|0,i=i+Math.imul(oe,Ce)|0,y=y+Math.imul(oe,Fe)|0;var Gt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,l=Math.imul(M,me),i=Math.imul(M,ye),i=i+Math.imul(C,me)|0,y=Math.imul(C,ye),l=l+Math.imul(o,ge)|0,i=i+Math.imul(o,we)|0,i=i+Math.imul(m,ge)|0,y=y+Math.imul(m,we)|0,l=l+Math.imul(le,ve)|0,i=i+Math.imul(le,be)|0,i=i+Math.imul(c,ve)|0,y=y+Math.imul(c,be)|0,l=l+Math.imul(ie,xe)|0,i=i+Math.imul(ie,Ee)|0,i=i+Math.imul(ce,xe)|0,y=y+Math.imul(ce,Ee)|0,l=l+Math.imul(se,_e)|0,i=i+Math.imul(se,Me)|0,i=i+Math.imul(te,_e)|0,y=y+Math.imul(te,Me)|0,l=l+Math.imul(ne,Ae)|0,i=i+Math.imul(ne,Be)|0,i=i+Math.imul(ue,Ae)|0,y=y+Math.imul(ue,Be)|0,l=l+Math.imul(ee,Ce)|0,i=i+Math.imul(ee,Fe)|0,i=i+Math.imul(fe,Ce)|0,y=y+Math.imul(fe,Fe)|0;var Vt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(M,ge),i=Math.imul(M,we),i=i+Math.imul(C,ge)|0,y=Math.imul(C,we),l=l+Math.imul(o,ve)|0,i=i+Math.imul(o,be)|0,i=i+Math.imul(m,ve)|0,y=y+Math.imul(m,be)|0,l=l+Math.imul(le,xe)|0,i=i+Math.imul(le,Ee)|0,i=i+Math.imul(c,xe)|0,y=y+Math.imul(c,Ee)|0,l=l+Math.imul(ie,_e)|0,i=i+Math.imul(ie,Me)|0,i=i+Math.imul(ce,_e)|0,y=y+Math.imul(ce,Me)|0,l=l+Math.imul(se,Ae)|0,i=i+Math.imul(se,Be)|0,i=i+Math.imul(te,Ae)|0,y=y+Math.imul(te,Be)|0,l=l+Math.imul(ne,Ce)|0,i=i+Math.imul(ne,Fe)|0,i=i+Math.imul(ue,Ce)|0,y=y+Math.imul(ue,Fe)|0;var Kt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,l=Math.imul(M,ve),i=Math.imul(M,be),i=i+Math.imul(C,ve)|0,y=Math.imul(C,be),l=l+Math.imul(o,xe)|0,i=i+Math.imul(o,Ee)|0,i=i+Math.imul(m,xe)|0,y=y+Math.imul(m,Ee)|0,l=l+Math.imul(le,_e)|0,i=i+Math.imul(le,Me)|0,i=i+Math.imul(c,_e)|0,y=y+Math.imul(c,Me)|0,l=l+Math.imul(ie,Ae)|0,i=i+Math.imul(ie,Be)|0,i=i+Math.imul(ce,Ae)|0,y=y+Math.imul(ce,Be)|0,l=l+Math.imul(se,Ce)|0,i=i+Math.imul(se,Fe)|0,i=i+Math.imul(te,Ce)|0,y=y+Math.imul(te,Fe)|0;var Zt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,l=Math.imul(M,xe),i=Math.imul(M,Ee),i=i+Math.imul(C,xe)|0,y=Math.imul(C,Ee),l=l+Math.imul(o,_e)|0,i=i+Math.imul(o,Me)|0,i=i+Math.imul(m,_e)|0,y=y+Math.imul(m,Me)|0,l=l+Math.imul(le,Ae)|0,i=i+Math.imul(le,Be)|0,i=i+Math.imul(c,Ae)|0,y=y+Math.imul(c,Be)|0,l=l+Math.imul(ie,Ce)|0,i=i+Math.imul(ie,Fe)|0,i=i+Math.imul(ce,Ce)|0,y=y+Math.imul(ce,Fe)|0;var Yt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(M,_e),i=Math.imul(M,Me),i=i+Math.imul(C,_e)|0,y=Math.imul(C,Me),l=l+Math.imul(o,Ae)|0,i=i+Math.imul(o,Be)|0,i=i+Math.imul(m,Ae)|0,y=y+Math.imul(m,Be)|0,l=l+Math.imul(le,Ce)|0,i=i+Math.imul(le,Fe)|0,i=i+Math.imul(c,Ce)|0,y=y+Math.imul(c,Fe)|0;var Xt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(M,Ae),i=Math.imul(M,Be),i=i+Math.imul(C,Ae)|0,y=Math.imul(C,Be),l=l+Math.imul(o,Ce)|0,i=i+Math.imul(o,Fe)|0,i=i+Math.imul(m,Ce)|0,y=y+Math.imul(m,Fe)|0;var Qt=(b+l|0)+((i&8191)<<13)|0;b=(y+(i>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(M,Ce),i=Math.imul(M,Fe),i=i+Math.imul(C,Ce)|0,y=Math.imul(C,Fe);var er=(b+l|0)+((i&8191)<<13)|0;return b=(y+(i>>>13)|0)+(er>>>26)|0,er&=67108863,w[0]=Ut,w[1]=Nt,w[2]=kt,w[3]=Lt,w[4]=jt,w[5]=qt,w[6]=$t,w[7]=zt,w[8]=Ht,w[9]=Wt,w[10]=Jt,w[11]=Gt,w[12]=Vt,w[13]=Kt,w[14]=Zt,w[15]=Yt,w[16]=Xt,w[17]=Qt,w[18]=er,b!==0&&(w[19]=b,p.length++),p};Math.imul||(X=J);function G(E,r,u){u.negative=r.negative^E.negative,u.length=E.length+r.length;for(var p=0,v=0,x=0;x<u.length-1;x++){var w=v;v=0;for(var b=p&67108863,l=Math.min(x,r.length-1),i=Math.max(0,x-E.length+1);i<=l;i++){var y=x-i,D=E.words[y]|0,O=r.words[i]|0,U=D*O,V=U&67108863;w=w+(U/67108864|0)|0,V=V+b|0,b=V&67108863,w=w+(V>>>26)|0,v+=w>>>26,w&=67108863}u.words[x]=b,p=w,w=v}return p!==0?u.words[x]=p:u.length--,u._strip()}function De(E,r,u){return G(E,r,u)}f.prototype.mulTo=function(r,u){var p,v=this.length+r.length;return this.length===10&&r.length===10?p=X(this,r,u):v<63?p=J(this,r,u):v<1024?p=G(this,r,u):p=De(this,r,u),p},f.prototype.mul=function(r){var u=new f(null);return u.words=new Array(this.length+r.length),this.mulTo(r,u)},f.prototype.mulf=function(r){var u=new f(null);return u.words=new Array(this.length+r.length),De(this,r,u)},f.prototype.imul=function(r){return this.clone().mulTo(r,this)},f.prototype.imuln=function(r){var u=r<0;u&&(r=-r),s(typeof r=="number"),s(r<67108864);for(var p=0,v=0;v<this.length;v++){var x=(this.words[v]|0)*r,w=(x&67108863)+(p&67108863);p>>=26,p+=x/67108864|0,p+=w>>>26,this.words[v]=w&67108863}return p!==0&&(this.words[v]=p,this.length++),u?this.ineg():this},f.prototype.muln=function(r){return this.clone().imuln(r)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(r){var u=P(r);if(u.length===0)return new f(1);for(var p=this,v=0;v<u.length&&u[v]===0;v++,p=p.sqr());if(++v<u.length)for(var x=p.sqr();v<u.length;v++,x=x.sqr())u[v]!==0&&(p=p.mul(x));return p},f.prototype.iushln=function(r){s(typeof r=="number"&&r>=0);var u=r%26,p=(r-u)/26,v=67108863>>>26-u<<26-u,x;if(u!==0){var w=0;for(x=0;x<this.length;x++){var b=this.words[x]&v,l=(this.words[x]|0)-b<<u;this.words[x]=l|w,w=b>>>26-u}w&&(this.words[x]=w,this.length++)}if(p!==0){for(x=this.length-1;x>=0;x--)this.words[x+p]=this.words[x];for(x=0;x<p;x++)this.words[x]=0;this.length+=p}return this._strip()},f.prototype.ishln=function(r){return s(this.negative===0),this.iushln(r)},f.prototype.iushrn=function(r,u,p){s(typeof r=="number"&&r>=0);var v;u?v=(u-u%26)/26:v=0;var x=r%26,w=Math.min((r-x)/26,this.length),b=67108863^67108863>>>x<<x,l=p;if(v-=w,v=Math.max(0,v),l){for(var i=0;i<w;i++)l.words[i]=this.words[i];l.length=w}if(w!==0)if(this.length>w)for(this.length-=w,i=0;i<this.length;i++)this.words[i]=this.words[i+w];else this.words[0]=0,this.length=1;var y=0;for(i=this.length-1;i>=0&&(y!==0||i>=v);i--){var D=this.words[i]|0;this.words[i]=y<<26-x|D>>>x,y=D&b}return l&&y!==0&&(l.words[l.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(r,u,p){return s(this.negative===0),this.iushrn(r,u,p)},f.prototype.shln=function(r){return this.clone().ishln(r)},f.prototype.ushln=function(r){return this.clone().iushln(r)},f.prototype.shrn=function(r){return this.clone().ishrn(r)},f.prototype.ushrn=function(r){return this.clone().iushrn(r)},f.prototype.testn=function(r){s(typeof r=="number"&&r>=0);var u=r%26,p=(r-u)/26,v=1<<u;if(this.length<=p)return!1;var x=this.words[p];return!!(x&v)},f.prototype.imaskn=function(r){s(typeof r=="number"&&r>=0);var u=r%26,p=(r-u)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var v=67108863^67108863>>>u<<u;this.words[this.length-1]&=v}return this._strip()},f.prototype.maskn=function(r){return this.clone().imaskn(r)},f.prototype.iaddn=function(r){return s(typeof r=="number"),s(r<67108864),r<0?this.isubn(-r):this.negative!==0?this.length===1&&(this.words[0]|0)<=r?(this.words[0]=r-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(r),this.negative=1,this):this._iaddn(r)},f.prototype._iaddn=function(r){this.words[0]+=r;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},f.prototype.isubn=function(r){if(s(typeof r=="number"),s(r<67108864),r<0)return this.iaddn(-r);if(this.negative!==0)return this.negative=0,this.iaddn(r),this.negative=1,this;if(this.words[0]-=r,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},f.prototype.addn=function(r){return this.clone().iaddn(r)},f.prototype.subn=function(r){return this.clone().isubn(r)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(r,u,p){var v=r.length+p,x;this._expand(v);var w,b=0;for(x=0;x<r.length;x++){w=(this.words[x+p]|0)+b;var l=(r.words[x]|0)*u;w-=l&67108863,b=(w>>26)-(l/67108864|0),this.words[x+p]=w&67108863}for(;x<this.length-p;x++)w=(this.words[x+p]|0)+b,b=w>>26,this.words[x+p]=w&67108863;if(b===0)return this._strip();for(s(b===-1),b=0,x=0;x<this.length;x++)w=-(this.words[x]|0)+b,b=w>>26,this.words[x]=w&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(r,u){var p=this.length-r.length,v=this.clone(),x=r,w=x.words[x.length-1]|0,b=this._countBits(w);p=26-b,p!==0&&(x=x.ushln(p),v.iushln(p),w=x.words[x.length-1]|0);var l=v.length-x.length,i;if(u!=="mod"){i=new f(null),i.length=l+1,i.words=new Array(i.length);for(var y=0;y<i.length;y++)i.words[y]=0}var D=v.clone()._ishlnsubmul(x,1,l);D.negative===0&&(v=D,i&&(i.words[l]=1));for(var O=l-1;O>=0;O--){var U=(v.words[x.length+O]|0)*67108864+(v.words[x.length+O-1]|0);for(U=Math.min(U/w|0,67108863),v._ishlnsubmul(x,U,O);v.negative!==0;)U--,v.negative=0,v._ishlnsubmul(x,1,O),v.isZero()||(v.negative^=1);i&&(i.words[O]=U)}return i&&i._strip(),v._strip(),u!=="div"&&p!==0&&v.iushrn(p),{div:i||null,mod:v}},f.prototype.divmod=function(r,u,p){if(s(!r.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var v,x,w;return this.negative!==0&&r.negative===0?(w=this.neg().divmod(r,u),u!=="mod"&&(v=w.div.neg()),u!=="div"&&(x=w.mod.neg(),p&&x.negative!==0&&x.iadd(r)),{div:v,mod:x}):this.negative===0&&r.negative!==0?(w=this.divmod(r.neg(),u),u!=="mod"&&(v=w.div.neg()),{div:v,mod:w.mod}):this.negative&r.negative?(w=this.neg().divmod(r.neg(),u),u!=="div"&&(x=w.mod.neg(),p&&x.negative!==0&&x.isub(r)),{div:w.div,mod:x}):r.length>this.length||this.cmp(r)<0?{div:new f(0),mod:this}:r.length===1?u==="div"?{div:this.divn(r.words[0]),mod:null}:u==="mod"?{div:null,mod:new f(this.modrn(r.words[0]))}:{div:this.divn(r.words[0]),mod:new f(this.modrn(r.words[0]))}:this._wordDiv(r,u)},f.prototype.div=function(r){return this.divmod(r,"div",!1).div},f.prototype.mod=function(r){return this.divmod(r,"mod",!1).mod},f.prototype.umod=function(r){return this.divmod(r,"mod",!0).mod},f.prototype.divRound=function(r){var u=this.divmod(r);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(r):u.mod,v=r.ushrn(1),x=r.andln(1),w=p.cmp(v);return w<0||x===1&&w===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},f.prototype.modrn=function(r){var u=r<0;u&&(r=-r),s(r<=67108863);for(var p=(1<<26)%r,v=0,x=this.length-1;x>=0;x--)v=(p*v+(this.words[x]|0))%r;return u?-v:v},f.prototype.modn=function(r){return this.modrn(r)},f.prototype.idivn=function(r){var u=r<0;u&&(r=-r),s(r<=67108863);for(var p=0,v=this.length-1;v>=0;v--){var x=(this.words[v]|0)+p*67108864;this.words[v]=x/r|0,p=x%r}return this._strip(),u?this.ineg():this},f.prototype.divn=function(r){return this.clone().idivn(r)},f.prototype.egcd=function(r){s(r.negative===0),s(!r.isZero());var u=this,p=r.clone();u.negative!==0?u=u.umod(r):u=u.clone();for(var v=new f(1),x=new f(0),w=new f(0),b=new f(1),l=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++l;for(var i=p.clone(),y=u.clone();!u.isZero();){for(var D=0,O=1;!(u.words[0]&O)&&D<26;++D,O<<=1);if(D>0)for(u.iushrn(D);D-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(i),x.isub(y)),v.iushrn(1),x.iushrn(1);for(var U=0,V=1;!(p.words[0]&V)&&U<26;++U,V<<=1);if(U>0)for(p.iushrn(U);U-- >0;)(w.isOdd()||b.isOdd())&&(w.iadd(i),b.isub(y)),w.iushrn(1),b.iushrn(1);u.cmp(p)>=0?(u.isub(p),v.isub(w),x.isub(b)):(p.isub(u),w.isub(v),b.isub(x))}return{a:w,b,gcd:p.iushln(l)}},f.prototype._invmp=function(r){s(r.negative===0),s(!r.isZero());var u=this,p=r.clone();u.negative!==0?u=u.umod(r):u=u.clone();for(var v=new f(1),x=new f(0),w=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var b=0,l=1;!(u.words[0]&l)&&b<26;++b,l<<=1);if(b>0)for(u.iushrn(b);b-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);for(var i=0,y=1;!(p.words[0]&y)&&i<26;++i,y<<=1);if(i>0)for(p.iushrn(i);i-- >0;)x.isOdd()&&x.iadd(w),x.iushrn(1);u.cmp(p)>=0?(u.isub(p),v.isub(x)):(p.isub(u),x.isub(v))}var D;return u.cmpn(1)===0?D=v:D=x,D.cmpn(0)<0&&D.iadd(r),D},f.prototype.gcd=function(r){if(this.isZero())return r.abs();if(r.isZero())return this.abs();var u=this.clone(),p=r.clone();u.negative=0,p.negative=0;for(var v=0;u.isEven()&&p.isEven();v++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var x=u.cmp(p);if(x<0){var w=u;u=p,p=w}else if(x===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(v)},f.prototype.invm=function(r){return this.egcd(r).a.umod(r)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(r){return this.words[0]&r},f.prototype.bincn=function(r){s(typeof r=="number");var u=r%26,p=(r-u)/26,v=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=v,this;for(var x=v,w=p;x!==0&&w<this.length;w++){var b=this.words[w]|0;b+=x,x=b>>>26,b&=67108863,this.words[w]=b}return x!==0&&(this.words[w]=x,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(r){var u=r<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(r=-r),s(r<=67108863,"Number is too big");var v=this.words[0]|0;p=v===r?0:v<r?-1:1}return this.negative!==0?-p|0:p},f.prototype.cmp=function(r){if(this.negative!==0&&r.negative===0)return-1;if(this.negative===0&&r.negative!==0)return 1;var u=this.ucmp(r);return this.negative!==0?-u|0:u},f.prototype.ucmp=function(r){if(this.length>r.length)return 1;if(this.length<r.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var v=this.words[p]|0,x=r.words[p]|0;if(v!==x){v<x?u=-1:v>x&&(u=1);break}}return u},f.prototype.gtn=function(r){return this.cmpn(r)===1},f.prototype.gt=function(r){return this.cmp(r)===1},f.prototype.gten=function(r){return this.cmpn(r)>=0},f.prototype.gte=function(r){return this.cmp(r)>=0},f.prototype.ltn=function(r){return this.cmpn(r)===-1},f.prototype.lt=function(r){return this.cmp(r)===-1},f.prototype.lten=function(r){return this.cmpn(r)<=0},f.prototype.lte=function(r){return this.cmp(r)<=0},f.prototype.eqn=function(r){return this.cmpn(r)===0},f.prototype.eq=function(r){return this.cmp(r)===0},f.red=function(r){return new Q(r)},f.prototype.toRed=function(r){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),r.convertTo(this)._forceRed(r)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(r){return this.red=r,this},f.prototype.forceRed=function(r){return s(!this.red,"Already a number in reduction context"),this._forceRed(r)},f.prototype.redAdd=function(r){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,r)},f.prototype.redIAdd=function(r){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,r)},f.prototype.redSub=function(r){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,r)},f.prototype.redISub=function(r){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,r)},f.prototype.redShl=function(r){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,r)},f.prototype.redMul=function(r){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,r),this.red.mul(this,r)},f.prototype.redIMul=function(r){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,r),this.red.imul(this,r)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(r){return s(this.red&&!r.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,r)};var Y={k256:null,p224:null,p192:null,p25519:null};function K(E,r){this.name=E,this.p=new f(r,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}K.prototype._tmp=function(){var r=new f(null);return r.words=new Array(Math.ceil(this.n/13)),r},K.prototype.ireduce=function(r){var u=r,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var v=p<this.n?-1:u.ucmp(this.p);return v===0?(u.words[0]=0,u.length=1):v>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},K.prototype.split=function(r,u){r.iushrn(this.n,0,u)},K.prototype.imulK=function(r){return r.imul(this.k)};function Se(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}h(Se,K),Se.prototype.split=function(r,u){for(var p=4194303,v=Math.min(r.length,9),x=0;x<v;x++)u.words[x]=r.words[x];if(u.length=v,r.length<=9){r.words[0]=0,r.length=1;return}var w=r.words[9];for(u.words[u.length++]=w&p,x=10;x<r.length;x++){var b=r.words[x]|0;r.words[x-10]=(b&p)<<4|w>>>22,w=b}w>>>=22,r.words[x-10]=w,w===0&&r.length>10?r.length-=10:r.length-=9},Se.prototype.imulK=function(r){r.words[r.length]=0,r.words[r.length+1]=0,r.length+=2;for(var u=0,p=0;p<r.length;p++){var v=r.words[p]|0;u+=v*977,r.words[p]=u&67108863,u=v*64+(u/67108864|0)}return r.words[r.length-1]===0&&(r.length--,r.words[r.length-1]===0&&r.length--),r};function Oe(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}h(Oe,K);function Le(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}h(Le,K);function je(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}h(je,K),je.prototype.imulK=function(r){for(var u=0,p=0;p<r.length;p++){var v=(r.words[p]|0)*19+u,x=v&67108863;v>>>=26,r.words[p]=x,u=v}return u!==0&&(r.words[r.length++]=u),r},f._prime=function(r){if(Y[r])return Y[r];var u;if(r==="k256")u=new Se;else if(r==="p224")u=new Oe;else if(r==="p192")u=new Le;else if(r==="p25519")u=new je;else throw new Error("Unknown prime "+r);return Y[r]=u,u};function Q(E){if(typeof E=="string"){var r=f._prime(E);this.m=r.p,this.prime=r}else s(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}Q.prototype._verify1=function(r){s(r.negative===0,"red works only with positives"),s(r.red,"red works only with red numbers")},Q.prototype._verify2=function(r,u){s((r.negative|u.negative)===0,"red works only with positives"),s(r.red&&r.red===u.red,"red works only with red numbers")},Q.prototype.imod=function(r){return this.prime?this.prime.ireduce(r)._forceRed(this):(B(r,r.umod(this.m)._forceRed(this)),r)},Q.prototype.neg=function(r){return r.isZero()?r.clone():this.m.sub(r)._forceRed(this)},Q.prototype.add=function(r,u){this._verify2(r,u);var p=r.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},Q.prototype.iadd=function(r,u){this._verify2(r,u);var p=r.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},Q.prototype.sub=function(r,u){this._verify2(r,u);var p=r.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},Q.prototype.isub=function(r,u){this._verify2(r,u);var p=r.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},Q.prototype.shl=function(r,u){return this._verify1(r),this.imod(r.ushln(u))},Q.prototype.imul=function(r,u){return this._verify2(r,u),this.imod(r.imul(u))},Q.prototype.mul=function(r,u){return this._verify2(r,u),this.imod(r.mul(u))},Q.prototype.isqr=function(r){return this.imul(r,r.clone())},Q.prototype.sqr=function(r){return this.mul(r,r)},Q.prototype.sqrt=function(r){if(r.isZero())return r.clone();var u=this.m.andln(3);if(s(u%2===1),u===3){var p=this.m.add(new f(1)).iushrn(2);return this.pow(r,p)}for(var v=this.m.subn(1),x=0;!v.isZero()&&v.andln(1)===0;)x++,v.iushrn(1);s(!v.isZero());var w=new f(1).toRed(this),b=w.redNeg(),l=this.m.subn(1).iushrn(1),i=this.m.bitLength();for(i=new f(2*i*i).toRed(this);this.pow(i,l).cmp(b)!==0;)i.redIAdd(b);for(var y=this.pow(i,v),D=this.pow(r,v.addn(1).iushrn(1)),O=this.pow(r,v),U=x;O.cmp(w)!==0;){for(var V=O,H=0;V.cmp(w)!==0;H++)V=V.redSqr();s(H<U);var W=this.pow(y,new f(1).iushln(U-H-1));D=D.redMul(W),y=W.redSqr(),O=O.redMul(y),U=H}return D},Q.prototype.invm=function(r){var u=r._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},Q.prototype.pow=function(r,u){if(u.isZero())return new f(1).toRed(this);if(u.cmpn(1)===0)return r.clone();var p=4,v=new Array(1<<p);v[0]=new f(1).toRed(this),v[1]=r;for(var x=2;x<v.length;x++)v[x]=this.mul(v[x-1],r);var w=v[0],b=0,l=0,i=u.bitLength()%26;for(i===0&&(i=26),x=u.length-1;x>=0;x--){for(var y=u.words[x],D=i-1;D>=0;D--){var O=y>>D&1;if(w!==v[0]&&(w=this.sqr(w)),O===0&&b===0){l=0;continue}b<<=1,b|=O,l++,!(l!==p&&(x!==0||D!==0))&&(w=this.mul(w,v[b]),l=0,b=0)}i=26}return w},Q.prototype.convertTo=function(r){var u=r.umod(this.m);return u===r?u.clone():u},Q.prototype.convertFrom=function(r){var u=r.clone();return u.red=null,u},f.mont=function(r){return new Te(r)};function Te(E){Q.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}h(Te,Q),Te.prototype.convertTo=function(r){return this.imod(r.ushln(this.shift))},Te.prototype.convertFrom=function(r){var u=this.imod(r.mul(this.rinv));return u.red=null,u},Te.prototype.imul=function(r,u){if(r.isZero()||u.isZero())return r.words[0]=0,r.length=1,r;var p=r.imul(u),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=p.isub(v).iushrn(this.shift),w=x;return x.cmp(this.m)>=0?w=x.isub(this.m):x.cmpn(0)<0&&(w=x.iadd(this.m)),w._forceRed(this)},Te.prototype.mul=function(r,u){if(r.isZero()||u.isZero())return new f(0)._forceRed(this);var p=r.mul(u),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=p.isub(v).iushrn(this.shift),w=x;return x.cmp(this.m)>=0?w=x.isub(this.m):x.cmpn(0)<0&&(w=x.iadd(this.m)),w._forceRed(this)},Te.prototype.invm=function(r){var u=this.imod(r._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,$e.commonjsGlobal)})(Rr);var pi=Rr.exports,Cn={},_t={};_t.byteLength=gi;_t.toByteArray=vi;_t.fromByteArray=Ei;var Je=[],qe=[],mi=typeof Uint8Array<"u"?Uint8Array:Array,tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var rt=0,yi=tr.length;rt<yi;++rt)Je[rt]=tr[rt],qe[tr.charCodeAt(rt)]=rt;qe["-".charCodeAt(0)]=62;qe["_".charCodeAt(0)]=63;function Fn(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=e.indexOf("=");a===-1&&(a=t);var s=a===t?0:4-a%4;return[a,s]}function gi(e){var t=Fn(e),a=t[0],s=t[1];return(a+s)*3/4-s}function wi(e,t,a){return(t+a)*3/4-a}function vi(e){var t,a=Fn(e),s=a[0],h=a[1],f=new mi(wi(e,s,h)),g=0,d=h>0?s-4:s,A;for(A=0;A<d;A+=4)t=qe[e.charCodeAt(A)]<<18|qe[e.charCodeAt(A+1)]<<12|qe[e.charCodeAt(A+2)]<<6|qe[e.charCodeAt(A+3)],f[g++]=t>>16&255,f[g++]=t>>8&255,f[g++]=t&255;return h===2&&(t=qe[e.charCodeAt(A)]<<2|qe[e.charCodeAt(A+1)]>>4,f[g++]=t&255),h===1&&(t=qe[e.charCodeAt(A)]<<10|qe[e.charCodeAt(A+1)]<<4|qe[e.charCodeAt(A+2)]>>2,f[g++]=t>>8&255,f[g++]=t&255),f}function bi(e){return Je[e>>18&63]+Je[e>>12&63]+Je[e>>6&63]+Je[e&63]}function xi(e,t,a){for(var s,h=[],f=t;f<a;f+=3)s=(e[f]<<16&16711680)+(e[f+1]<<8&65280)+(e[f+2]&255),h.push(bi(s));return h.join("")}function Ei(e){for(var t,a=e.length,s=a%3,h=[],f=16383,g=0,d=a-s;g<d;g+=f)h.push(xi(e,g,g+f>d?d:g+f));return s===1?(t=e[a-1],h.push(Je[t>>2]+Je[t<<4&63]+"==")):s===2&&(t=(e[a-2]<<8)+e[a-1],h.push(Je[t>>10]+Je[t>>4&63]+Je[t<<2&63]+"=")),h.join("")}var Sr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Sr.read=function(e,t,a,s,h){var f,g,d=h*8-s-1,A=(1<<d)-1,R=A>>1,B=-7,S=a?h-1:0,I=a?-1:1,k=e[t+S];for(S+=I,f=k&(1<<-B)-1,k>>=-B,B+=d;B>0;f=f*256+e[t+S],S+=I,B-=8);for(g=f&(1<<-B)-1,f>>=-B,B+=s;B>0;g=g*256+e[t+S],S+=I,B-=8);if(f===0)f=1-R;else{if(f===A)return g?NaN:(k?-1:1)*(1/0);g=g+Math.pow(2,s),f=f-R}return(k?-1:1)*g*Math.pow(2,f-s)};Sr.write=function(e,t,a,s,h,f){var g,d,A,R=f*8-h-1,B=(1<<R)-1,S=B>>1,I=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=s?0:f-1,T=s?1:-1,N=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(d=isNaN(t)?1:0,g=B):(g=Math.floor(Math.log(t)/Math.LN2),t*(A=Math.pow(2,-g))<1&&(g--,A*=2),g+S>=1?t+=I/A:t+=I*Math.pow(2,1-S),t*A>=2&&(g++,A/=2),g+S>=B?(d=0,g=B):g+S>=1?(d=(t*A-1)*Math.pow(2,h),g=g+S):(d=t*Math.pow(2,S-1)*Math.pow(2,h),g=0));h>=8;e[a+k]=d&255,k+=T,d/=256,h-=8);for(g=g<<h|d,R+=h;R>0;e[a+k]=g&255,k+=T,g/=256,R-=8);e[a+k-T]|=N*128};/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/(function(e){const t=_t,a=Sr,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=d,e.SlowBuffer=X,e.INSPECT_MAX_BYTES=50;const h=2147483647;e.kMaxLength=h,d.TYPED_ARRAY_SUPPORT=f(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const c=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(c,n),c.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function g(c){if(c>h)throw new RangeError('The value "'+c+'" is invalid for option "size"');const n=new Uint8Array(c);return Object.setPrototypeOf(n,d.prototype),n}function d(c,n,o){if(typeof c=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(c)}return A(c,n,o)}d.poolSize=8192;function A(c,n,o){if(typeof c=="string")return I(c,n);if(ArrayBuffer.isView(c))return T(c);if(c==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c);if(Ue(c,ArrayBuffer)||c&&Ue(c.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ue(c,SharedArrayBuffer)||c&&Ue(c.buffer,SharedArrayBuffer)))return N(c,n,o);if(typeof c=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const m=c.valueOf&&c.valueOf();if(m!=null&&m!==c)return d.from(m,n,o);const _=P(c);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof c[Symbol.toPrimitive]=="function")return d.from(c[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c)}d.from=function(c,n,o){return A(c,n,o)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function R(c){if(typeof c!="number")throw new TypeError('"size" argument must be of type number');if(c<0)throw new RangeError('The value "'+c+'" is invalid for option "size"')}function B(c,n,o){return R(c),c<=0?g(c):n!==void 0?typeof o=="string"?g(c).fill(n,o):g(c).fill(n):g(c)}d.alloc=function(c,n,o){return B(c,n,o)};function S(c){return R(c),g(c<0?0:J(c)|0)}d.allocUnsafe=function(c){return S(c)},d.allocUnsafeSlow=function(c){return S(c)};function I(c,n){if((typeof n!="string"||n==="")&&(n="utf8"),!d.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const o=G(c,n)|0;let m=g(o);const _=m.write(c,n);return _!==o&&(m=m.slice(0,_)),m}function k(c){const n=c.length<0?0:J(c.length)|0,o=g(n);for(let m=0;m<n;m+=1)o[m]=c[m]&255;return o}function T(c){if(Ue(c,Uint8Array)){const n=new Uint8Array(c);return N(n.buffer,n.byteOffset,n.byteLength)}return k(c)}function N(c,n,o){if(n<0||c.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(c.byteLength<n+(o||0))throw new RangeError('"length" is outside of buffer bounds');let m;return n===void 0&&o===void 0?m=new Uint8Array(c):o===void 0?m=new Uint8Array(c,n):m=new Uint8Array(c,n,o),Object.setPrototypeOf(m,d.prototype),m}function P(c){if(d.isBuffer(c)){const n=J(c.length)|0,o=g(n);return o.length===0||c.copy(o,0,0,n),o}if(c.length!==void 0)return typeof c.length!="number"||ie(c.length)?g(0):k(c);if(c.type==="Buffer"&&Array.isArray(c.data))return k(c.data)}function J(c){if(c>=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return c|0}function X(c){return+c!=c&&(c=0),d.alloc(+c)}d.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==d.prototype},d.compare=function(n,o){if(Ue(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),Ue(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),!d.isBuffer(n)||!d.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===o)return 0;let m=n.length,_=o.length;for(let M=0,C=Math.min(m,_);M<C;++M)if(n[M]!==o[M]){m=n[M],_=o[M];break}return m<_?-1:_<m?1:0},d.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(n,o){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return d.alloc(0);let m;if(o===void 0)for(o=0,m=0;m<n.length;++m)o+=n[m].length;const _=d.allocUnsafe(o);let M=0;for(m=0;m<n.length;++m){let C=n[m];if(Ue(C,Uint8Array))M+C.length>_.length?(d.isBuffer(C)||(C=d.from(C)),C.copy(_,M)):Uint8Array.prototype.set.call(_,C,M);else if(d.isBuffer(C))C.copy(_,M);else throw new TypeError('"list" argument must be an Array of Buffers');M+=C.length}return _};function G(c,n){if(d.isBuffer(c))return c.length;if(ArrayBuffer.isView(c)||Ue(c,ArrayBuffer))return c.byteLength;if(typeof c!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof c);const o=c.length,m=arguments.length>2&&arguments[2]===!0;if(!m&&o===0)return 0;let _=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return ne(c).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return se(c).length;default:if(_)return m?-1:ne(c).length;n=(""+n).toLowerCase(),_=!0}}d.byteLength=G;function De(c,n,o){let m=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(c||(c="utf8");;)switch(c){case"hex":return w(this,n,o);case"utf8":case"utf-8":return r(this,n,o);case"ascii":return v(this,n,o);case"latin1":case"binary":return x(this,n,o);case"base64":return E(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,n,o);default:if(m)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase(),m=!0}}d.prototype._isBuffer=!0;function Y(c,n,o){const m=c[n];c[n]=c[o],c[o]=m}d.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let o=0;o<n;o+=2)Y(this,o,o+1);return this},d.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let o=0;o<n;o+=4)Y(this,o,o+3),Y(this,o+1,o+2);return this},d.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let o=0;o<n;o+=8)Y(this,o,o+7),Y(this,o+1,o+6),Y(this,o+2,o+5),Y(this,o+3,o+4);return this},d.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?r(this,0,n):De.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(n){if(!d.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:d.compare(this,n)===0},d.prototype.inspect=function(){let n="";const o=e.INSPECT_MAX_BYTES;return n=this.toString("hex",0,o).replace(/(.{2})/g,"$1 ").trim(),this.length>o&&(n+=" ... "),"<Buffer "+n+">"},s&&(d.prototype[s]=d.prototype.inspect),d.prototype.compare=function(n,o,m,_,M){if(Ue(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(o===void 0&&(o=0),m===void 0&&(m=n?n.length:0),_===void 0&&(_=0),M===void 0&&(M=this.length),o<0||m>n.length||_<0||M>this.length)throw new RangeError("out of range index");if(_>=M&&o>=m)return 0;if(_>=M)return-1;if(o>=m)return 1;if(o>>>=0,m>>>=0,_>>>=0,M>>>=0,this===n)return 0;let C=M-_,z=m-o;const q=Math.min(C,z),j=this.slice(_,M),re=n.slice(o,m);for(let L=0;L<q;++L)if(j[L]!==re[L]){C=j[L],z=re[L];break}return C<z?-1:z<C?1:0};function K(c,n,o,m,_){if(c.length===0)return-1;if(typeof o=="string"?(m=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,ie(o)&&(o=_?0:c.length-1),o<0&&(o=c.length+o),o>=c.length){if(_)return-1;o=c.length-1}else if(o<0)if(_)o=0;else return-1;if(typeof n=="string"&&(n=d.from(n,m)),d.isBuffer(n))return n.length===0?-1:Se(c,n,o,m,_);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(c,n,o):Uint8Array.prototype.lastIndexOf.call(c,n,o):Se(c,[n],o,m,_);throw new TypeError("val must be string, number or Buffer")}function Se(c,n,o,m,_){let M=1,C=c.length,z=n.length;if(m!==void 0&&(m=String(m).toLowerCase(),m==="ucs2"||m==="ucs-2"||m==="utf16le"||m==="utf-16le")){if(c.length<2||n.length<2)return-1;M=2,C/=2,z/=2,o/=2}function q(re,L){return M===1?re[L]:re.readUInt16BE(L*M)}let j;if(_){let re=-1;for(j=o;j<C;j++)if(q(c,j)===q(n,re===-1?0:j-re)){if(re===-1&&(re=j),j-re+1===z)return re*M}else re!==-1&&(j-=j-re),re=-1}else for(o+z>C&&(o=C-z),j=o;j>=0;j--){let re=!0;for(let L=0;L<z;L++)if(q(c,j+L)!==q(n,L)){re=!1;break}if(re)return j}return-1}d.prototype.includes=function(n,o,m){return this.indexOf(n,o,m)!==-1},d.prototype.indexOf=function(n,o,m){return K(this,n,o,m,!0)},d.prototype.lastIndexOf=function(n,o,m){return K(this,n,o,m,!1)};function Oe(c,n,o,m){o=Number(o)||0;const _=c.length-o;m?(m=Number(m),m>_&&(m=_)):m=_;const M=n.length;m>M/2&&(m=M/2);let C;for(C=0;C<m;++C){const z=parseInt(n.substr(C*2,2),16);if(ie(z))return C;c[o+C]=z}return C}function Le(c,n,o,m){return te(ne(n,c.length-o),c,o,m)}function je(c,n,o,m){return te(ue(n),c,o,m)}function Q(c,n,o,m){return te(se(n),c,o,m)}function Te(c,n,o,m){return te(mt(n,c.length-o),c,o,m)}d.prototype.write=function(n,o,m,_){if(o===void 0)_="utf8",m=this.length,o=0;else if(m===void 0&&typeof o=="string")_=o,m=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(m)?(m=m>>>0,_===void 0&&(_="utf8")):(_=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const M=this.length-o;if((m===void 0||m>M)&&(m=M),n.length>0&&(m<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let C=!1;for(;;)switch(_){case"hex":return Oe(this,n,o,m);case"utf8":case"utf-8":return Le(this,n,o,m);case"ascii":case"latin1":case"binary":return je(this,n,o,m);case"base64":return Q(this,n,o,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,n,o,m);default:if(C)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),C=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(c,n,o){return n===0&&o===c.length?t.fromByteArray(c):t.fromByteArray(c.slice(n,o))}function r(c,n,o){o=Math.min(c.length,o);const m=[];let _=n;for(;_<o;){const M=c[_];let C=null,z=M>239?4:M>223?3:M>191?2:1;if(_+z<=o){let q,j,re,L;switch(z){case 1:M<128&&(C=M);break;case 2:q=c[_+1],(q&192)===128&&(L=(M&31)<<6|q&63,L>127&&(C=L));break;case 3:q=c[_+1],j=c[_+2],(q&192)===128&&(j&192)===128&&(L=(M&15)<<12|(q&63)<<6|j&63,L>2047&&(L<55296||L>57343)&&(C=L));break;case 4:q=c[_+1],j=c[_+2],re=c[_+3],(q&192)===128&&(j&192)===128&&(re&192)===128&&(L=(M&15)<<18|(q&63)<<12|(j&63)<<6|re&63,L>65535&&L<1114112&&(C=L))}}C===null?(C=65533,z=1):C>65535&&(C-=65536,m.push(C>>>10&1023|55296),C=56320|C&1023),m.push(C),_+=z}return p(m)}const u=4096;function p(c){const n=c.length;if(n<=u)return String.fromCharCode.apply(String,c);let o="",m=0;for(;m<n;)o+=String.fromCharCode.apply(String,c.slice(m,m+=u));return o}function v(c,n,o){let m="";o=Math.min(c.length,o);for(let _=n;_<o;++_)m+=String.fromCharCode(c[_]&127);return m}function x(c,n,o){let m="";o=Math.min(c.length,o);for(let _=n;_<o;++_)m+=String.fromCharCode(c[_]);return m}function w(c,n,o){const m=c.length;(!n||n<0)&&(n=0),(!o||o<0||o>m)&&(o=m);let _="";for(let M=n;M<o;++M)_+=ce[c[M]];return _}function b(c,n,o){const m=c.slice(n,o);let _="";for(let M=0;M<m.length-1;M+=2)_+=String.fromCharCode(m[M]+m[M+1]*256);return _}d.prototype.slice=function(n,o){const m=this.length;n=~~n,o=o===void 0?m:~~o,n<0?(n+=m,n<0&&(n=0)):n>m&&(n=m),o<0?(o+=m,o<0&&(o=0)):o>m&&(o=m),o<n&&(o=n);const _=this.subarray(n,o);return Object.setPrototypeOf(_,d.prototype),_};function l(c,n,o){if(c%1!==0||c<0)throw new RangeError("offset is not uint");if(c+n>o)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(n,o,m){n=n>>>0,o=o>>>0,m||l(n,o,this.length);let _=this[n],M=1,C=0;for(;++C<o&&(M*=256);)_+=this[n+C]*M;return _},d.prototype.readUintBE=d.prototype.readUIntBE=function(n,o,m){n=n>>>0,o=o>>>0,m||l(n,o,this.length);let _=this[n+--o],M=1;for(;o>0&&(M*=256);)_+=this[n+--o]*M;return _},d.prototype.readUint8=d.prototype.readUInt8=function(n,o){return n=n>>>0,o||l(n,1,this.length),this[n]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(n,o){return n=n>>>0,o||l(n,2,this.length),this[n]|this[n+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(n,o){return n=n>>>0,o||l(n,2,this.length),this[n]<<8|this[n+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(n,o){return n=n>>>0,o||l(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(n,o){return n=n>>>0,o||l(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},d.prototype.readBigUInt64LE=ze(function(n){n=n>>>0,Ve(n,"offset");const o=this[n],m=this[n+7];(o===void 0||m===void 0)&&ee(n,this.length-8);const _=o+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,M=this[++n]+this[++n]*2**8+this[++n]*2**16+m*2**24;return BigInt(_)+(BigInt(M)<<BigInt(32))}),d.prototype.readBigUInt64BE=ze(function(n){n=n>>>0,Ve(n,"offset");const o=this[n],m=this[n+7];(o===void 0||m===void 0)&&ee(n,this.length-8);const _=o*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],M=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+m;return(BigInt(_)<<BigInt(32))+BigInt(M)}),d.prototype.readIntLE=function(n,o,m){n=n>>>0,o=o>>>0,m||l(n,o,this.length);let _=this[n],M=1,C=0;for(;++C<o&&(M*=256);)_+=this[n+C]*M;return M*=128,_>=M&&(_-=Math.pow(2,8*o)),_},d.prototype.readIntBE=function(n,o,m){n=n>>>0,o=o>>>0,m||l(n,o,this.length);let _=o,M=1,C=this[n+--_];for(;_>0&&(M*=256);)C+=this[n+--_]*M;return M*=128,C>=M&&(C-=Math.pow(2,8*o)),C},d.prototype.readInt8=function(n,o){return n=n>>>0,o||l(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},d.prototype.readInt16LE=function(n,o){n=n>>>0,o||l(n,2,this.length);const m=this[n]|this[n+1]<<8;return m&32768?m|4294901760:m},d.prototype.readInt16BE=function(n,o){n=n>>>0,o||l(n,2,this.length);const m=this[n+1]|this[n]<<8;return m&32768?m|4294901760:m},d.prototype.readInt32LE=function(n,o){return n=n>>>0,o||l(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},d.prototype.readInt32BE=function(n,o){return n=n>>>0,o||l(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},d.prototype.readBigInt64LE=ze(function(n){n=n>>>0,Ve(n,"offset");const o=this[n],m=this[n+7];(o===void 0||m===void 0)&&ee(n,this.length-8);const _=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(m<<24);return(BigInt(_)<<BigInt(32))+BigInt(o+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),d.prototype.readBigInt64BE=ze(function(n){n=n>>>0,Ve(n,"offset");const o=this[n],m=this[n+7];(o===void 0||m===void 0)&&ee(n,this.length-8);const _=(o<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(_)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+m)}),d.prototype.readFloatLE=function(n,o){return n=n>>>0,o||l(n,4,this.length),a.read(this,n,!0,23,4)},d.prototype.readFloatBE=function(n,o){return n=n>>>0,o||l(n,4,this.length),a.read(this,n,!1,23,4)},d.prototype.readDoubleLE=function(n,o){return n=n>>>0,o||l(n,8,this.length),a.read(this,n,!0,52,8)},d.prototype.readDoubleBE=function(n,o){return n=n>>>0,o||l(n,8,this.length),a.read(this,n,!1,52,8)};function i(c,n,o,m,_,M){if(!d.isBuffer(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>_||n<M)throw new RangeError('"value" argument is out of bounds');if(o+m>c.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(n,o,m,_){if(n=+n,o=o>>>0,m=m>>>0,!_){const z=Math.pow(2,8*m)-1;i(this,n,o,m,z,0)}let M=1,C=0;for(this[o]=n&255;++C<m&&(M*=256);)this[o+C]=n/M&255;return o+m},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(n,o,m,_){if(n=+n,o=o>>>0,m=m>>>0,!_){const z=Math.pow(2,8*m)-1;i(this,n,o,m,z,0)}let M=m-1,C=1;for(this[o+M]=n&255;--M>=0&&(C*=256);)this[o+M]=n/C&255;return o+m},d.prototype.writeUint8=d.prototype.writeUInt8=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,1,255,0),this[o]=n&255,o+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,2,65535,0),this[o]=n&255,this[o+1]=n>>>8,o+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,2,65535,0),this[o]=n>>>8,this[o+1]=n&255,o+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,4,4294967295,0),this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255,o+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,4,4294967295,0),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4};function y(c,n,o,m,_){oe(n,m,_,c,o,7);let M=Number(n&BigInt(4294967295));c[o++]=M,M=M>>8,c[o++]=M,M=M>>8,c[o++]=M,M=M>>8,c[o++]=M;let C=Number(n>>BigInt(32)&BigInt(4294967295));return c[o++]=C,C=C>>8,c[o++]=C,C=C>>8,c[o++]=C,C=C>>8,c[o++]=C,o}function D(c,n,o,m,_){oe(n,m,_,c,o,7);let M=Number(n&BigInt(4294967295));c[o+7]=M,M=M>>8,c[o+6]=M,M=M>>8,c[o+5]=M,M=M>>8,c[o+4]=M;let C=Number(n>>BigInt(32)&BigInt(4294967295));return c[o+3]=C,C=C>>8,c[o+2]=C,C=C>>8,c[o+1]=C,C=C>>8,c[o]=C,o+8}d.prototype.writeBigUInt64LE=ze(function(n,o=0){return y(this,n,o,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=ze(function(n,o=0){return D(this,n,o,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(n,o,m,_){if(n=+n,o=o>>>0,!_){const q=Math.pow(2,8*m-1);i(this,n,o,m,q-1,-q)}let M=0,C=1,z=0;for(this[o]=n&255;++M<m&&(C*=256);)n<0&&z===0&&this[o+M-1]!==0&&(z=1),this[o+M]=(n/C>>0)-z&255;return o+m},d.prototype.writeIntBE=function(n,o,m,_){if(n=+n,o=o>>>0,!_){const q=Math.pow(2,8*m-1);i(this,n,o,m,q-1,-q)}let M=m-1,C=1,z=0;for(this[o+M]=n&255;--M>=0&&(C*=256);)n<0&&z===0&&this[o+M+1]!==0&&(z=1),this[o+M]=(n/C>>0)-z&255;return o+m},d.prototype.writeInt8=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,1,127,-128),n<0&&(n=255+n+1),this[o]=n&255,o+1},d.prototype.writeInt16LE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,2,32767,-32768),this[o]=n&255,this[o+1]=n>>>8,o+2},d.prototype.writeInt16BE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,2,32767,-32768),this[o]=n>>>8,this[o+1]=n&255,o+2},d.prototype.writeInt32LE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,4,2147483647,-2147483648),this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24,o+4},d.prototype.writeInt32BE=function(n,o,m){return n=+n,o=o>>>0,m||i(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4},d.prototype.writeBigInt64LE=ze(function(n,o=0){return y(this,n,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=ze(function(n,o=0){return D(this,n,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function O(c,n,o,m,_,M){if(o+m>c.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function U(c,n,o,m,_){return n=+n,o=o>>>0,_||O(c,n,o,4),a.write(c,n,o,m,23,4),o+4}d.prototype.writeFloatLE=function(n,o,m){return U(this,n,o,!0,m)},d.prototype.writeFloatBE=function(n,o,m){return U(this,n,o,!1,m)};function V(c,n,o,m,_){return n=+n,o=o>>>0,_||O(c,n,o,8),a.write(c,n,o,m,52,8),o+8}d.prototype.writeDoubleLE=function(n,o,m){return V(this,n,o,!0,m)},d.prototype.writeDoubleBE=function(n,o,m){return V(this,n,o,!1,m)},d.prototype.copy=function(n,o,m,_){if(!d.isBuffer(n))throw new TypeError("argument should be a Buffer");if(m||(m=0),!_&&_!==0&&(_=this.length),o>=n.length&&(o=n.length),o||(o=0),_>0&&_<m&&(_=m),_===m||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),n.length-o<_-m&&(_=n.length-o+m);const M=_-m;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,m,_):Uint8Array.prototype.set.call(n,this.subarray(m,_),o),M},d.prototype.fill=function(n,o,m,_){if(typeof n=="string"){if(typeof o=="string"?(_=o,o=0,m=this.length):typeof m=="string"&&(_=m,m=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!d.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(n.length===1){const C=n.charCodeAt(0);(_==="utf8"&&C<128||_==="latin1")&&(n=C)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(o<0||this.length<o||this.length<m)throw new RangeError("Out of range index");if(m<=o)return this;o=o>>>0,m=m===void 0?this.length:m>>>0,n||(n=0);let M;if(typeof n=="number")for(M=o;M<m;++M)this[M]=n;else{const C=d.isBuffer(n)?n:d.from(n,_),z=C.length;if(z===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(M=0;M<m-o;++M)this[M+o]=C[M%z]}return this};const H={};function W(c,n,o){H[c]=class extends o{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${c}]`,this.stack,delete this.name}get code(){return c}set code(_){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_,writable:!0})}toString(){return`${this.name} [${c}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(c){return c?`${c} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(c,n){return`The "${c}" argument must be of type number. Received type ${typeof n}`},TypeError),W("ERR_OUT_OF_RANGE",function(c,n,o){let m=`The value of "${c}" is out of range.`,_=o;return Number.isInteger(o)&&Math.abs(o)>2**32?_=Ie(String(o)):typeof o=="bigint"&&(_=String(o),(o>BigInt(2)**BigInt(32)||o<-(BigInt(2)**BigInt(32)))&&(_=Ie(_)),_+="n"),m+=` It must be ${n}. Received ${_}`,m},RangeError);function Ie(c){let n="",o=c.length;const m=c[0]==="-"?1:0;for(;o>=m+4;o-=3)n=`_${c.slice(o-3,o)}${n}`;return`${c.slice(0,o)}${n}`}function ae(c,n,o){Ve(n,"offset"),(c[n]===void 0||c[n+o]===void 0)&&ee(n,c.length-(o+1))}function oe(c,n,o,m,_,M){if(c>o||c<n){const C=typeof n=="bigint"?"n":"";let z;throw M>3?n===0||n===BigInt(0)?z=`>= 0${C} and < 2${C} ** ${(M+1)*8}${C}`:z=`>= -(2${C} ** ${(M+1)*8-1}${C}) and < 2 ** ${(M+1)*8-1}${C}`:z=`>= ${n}${C} and <= ${o}${C}`,new H.ERR_OUT_OF_RANGE("value",z,c)}ae(m,_,M)}function Ve(c,n){if(typeof c!="number")throw new H.ERR_INVALID_ARG_TYPE(n,"number",c)}function ee(c,n,o){throw Math.floor(c)!==c?(Ve(c,o),new H.ERR_OUT_OF_RANGE(o||"offset","an integer",c)):n<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(o||"offset",`>= ${o?1:0} and <= ${n}`,c)}const fe=/[^+/0-9A-Za-z-_]/g;function pt(c){if(c=c.split("=")[0],c=c.trim().replace(fe,""),c.length<2)return"";for(;c.length%4!==0;)c=c+"=";return c}function ne(c,n){n=n||1/0;let o;const m=c.length;let _=null;const M=[];for(let C=0;C<m;++C){if(o=c.charCodeAt(C),o>55295&&o<57344){if(!_){if(o>56319){(n-=3)>-1&&M.push(239,191,189);continue}else if(C+1===m){(n-=3)>-1&&M.push(239,191,189);continue}_=o;continue}if(o<56320){(n-=3)>-1&&M.push(239,191,189),_=o;continue}o=(_-55296<<10|o-56320)+65536}else _&&(n-=3)>-1&&M.push(239,191,189);if(_=null,o<128){if((n-=1)<0)break;M.push(o)}else if(o<2048){if((n-=2)<0)break;M.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;M.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;M.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return M}function ue(c){const n=[];for(let o=0;o<c.length;++o)n.push(c.charCodeAt(o)&255);return n}function mt(c,n){let o,m,_;const M=[];for(let C=0;C<c.length&&!((n-=2)<0);++C)o=c.charCodeAt(C),m=o>>8,_=o%256,M.push(_),M.push(m);return M}function se(c){return t.toByteArray(pt(c))}function te(c,n,o,m){let _;for(_=0;_<m&&!(_+o>=n.length||_>=c.length);++_)n[_+o]=c[_];return _}function Ue(c,n){return c instanceof n||c!=null&&c.constructor!=null&&c.constructor.name!=null&&c.constructor.name===n.name}function ie(c){return c!==c}const ce=function(){const c="0123456789abcdef",n=new Array(256);for(let o=0;o<16;++o){const m=o*16;for(let _=0;_<16;++_)n[m+_]=c[o]+c[_]}return n}();function ze(c){return typeof BigInt>"u"?le:c}function le(){throw new Error("BigInt not supported")}})(Cn);var Rn={},Mt={},Dr={},At={},Tr={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Convert=void 0;class _i{static toPriceFeed(t){return rr(t,Ze("PriceFeed"))}static priceFeedToJson(t){return nr(t,Ze("PriceFeed"))}static toPrice(t){return rr(t,Ze("Price"))}static priceToJson(t){return nr(t,Ze("Price"))}static toPriceFeedMetadata(t){return rr(t,Ze("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return nr(t,Ze("PriceFeedMetadata"))}}Bt.Convert=_i;function Ke(e,t,a=""){throw Error(a?`Invalid value for key "${a}". Expected type ${JSON.stringify(e)} but got ${JSON.stringify(t)}`:`Invalid value ${JSON.stringify(t)} for type ${JSON.stringify(e)}`)}function Mi(e){if(e.jsonToJS===void 0){const t={};e.props.forEach(a=>t[a.json]={key:a.js,typ:a.typ}),e.jsonToJS=t}return e.jsonToJS}function Ai(e){if(e.jsToJSON===void 0){const t={};e.props.forEach(a=>t[a.js]={key:a.json,typ:a.typ}),e.jsToJSON=t}return e.jsToJSON}function ot(e,t,a,s=""){function h(B,S){return typeof B==typeof S?S:Ke(B,S,s)}function f(B,S){const I=B.length;for(let k=0;k<I;k++){const T=B[k];try{return ot(S,T,a)}catch{}}return Ke(B,S)}function g(B,S){return B.indexOf(S)!==-1?S:Ke(B,S)}function d(B,S){return Array.isArray(S)?S.map(I=>ot(I,B,a)):Ke("array",S)}function A(B){if(B===null)return null;const S=new Date(B);return isNaN(S.valueOf())?Ke("Date",B):S}function R(B,S,I){if(I===null||typeof I!="object"||Array.isArray(I))return Ke("object",I);const k={};return Object.getOwnPropertyNames(B).forEach(T=>{const N=B[T],P=Object.prototype.hasOwnProperty.call(I,T)?I[T]:void 0;k[N.key]=ot(P,N.typ,a,N.key)}),Object.getOwnPropertyNames(I).forEach(T=>{Object.prototype.hasOwnProperty.call(B,T)||(k[T]=ot(I[T],S,a,T))}),k}if(t==="any")return e;if(t===null)return e===null?e:Ke(t,e);if(t===!1)return Ke(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=Bi[t.ref];return Array.isArray(t)?g(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?f(t.unionMembers,e):t.hasOwnProperty("arrayItems")?d(t.arrayItems,e):t.hasOwnProperty("props")?R(a(t),t.additional,e):Ke(t,e):t===Date&&typeof e!="number"?A(e):h(t,e)}function rr(e,t){return ot(e,t,Mi)}function nr(e,t){return ot(e,t,Ai)}function Xe(...e){return{unionMembers:e}}function ir(e,t){return{props:e,additional:t}}function Ze(e){return{ref:e}}const Bi={PriceFeed:ir([{json:"ema_price",js:"ema_price",typ:Ze("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:Xe(void 0,Ze("PriceFeedMetadata"))},{json:"price",js:"price",typ:Ze("Price")},{json:"vaa",js:"vaa",typ:Xe(void 0,"")}],"any"),Price:ir([{json:"conf",js:"conf",typ:""},{json:"expo",js:"expo",typ:0},{json:"price",js:"price",typ:""},{json:"publish_time",js:"publish_time",typ:0}],"any"),PriceFeedMetadata:ir([{json:"attestation_time",js:"attestation_time",typ:Xe(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:Xe(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:Xe(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:Xe(void 0,0)},{json:"slot",js:"slot",typ:Xe(void 0,0)}],"any")};var Ge={},Ci=$e.commonjsGlobal&&$e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.parseAccumulatorUpdateData=Ge.sliceAccumulatorUpdateData=Ge.parsePriceFeedMessage=Ge.isAccumulatorUpdateData=void 0;const nt=Ci(pi),Fi="504e4155",Ri=1,Si=0,br=20,Di=0;function Pr(e){return e.toString("hex").slice(0,8)===Fi&&e[4]===Ri&&e[5]===Si}Ge.isAccumulatorUpdateData=Pr;function Ti(e){let t=0;if(e.readUInt8(t)!==Di)throw new Error("Not a price feed message");t+=1;const s=e.subarray(t,t+32);t+=32;const h=new nt.default(e.subarray(t,t+8),"be");t+=8;const f=new nt.default(e.subarray(t,t+8),"be");t+=8;const g=e.readInt32BE(t);t+=4;const d=new nt.default(e.subarray(t,t+8),"be");t+=8;const A=new nt.default(e.subarray(t,t+8),"be");t+=8;const R=new nt.default(e.subarray(t,t+8),"be");t+=8;const B=new nt.default(e.subarray(t,t+8),"be");return t+=8,{feedId:s,price:h,confidence:f,exponent:g,publishTime:d,prevPublishTime:A,emaPrice:R,emaConf:B}}Ge.parsePriceFeedMessage=Ti;function Pi(e,t,a){if(!Pr(e))throw new Error("Invalid accumulator message");let s=6;const h=e.readUint8(s);s+=1+h,s+=1;const f=e.readUint16BE(s);s+=2,s+=f;const g=s,d=[],A=e.readUInt8(s);s+=1;for(let B=0;B<A;B++){const S=s,I=e.readUint16BE(s);s+=2,s+=I;const k=e.readUInt8(s);s+=1,s+=br*k,d.push(e.subarray(S,s))}if(s!==e.length)throw new Error("Didn't reach the end of the message");const R=d.slice(t,a);return Buffer.concat([e.subarray(0,g),Buffer.from([R.length]),...d.slice(t,a)])}Ge.sliceAccumulatorUpdateData=Pi;function Oi(e){if(!Pr(e))throw new Error("Invalid accumulator message");let t=6;const a=e.readUint8(t);t+=1+a,t+=1;const s=e.readUint16BE(t);t+=2;const h=e.subarray(t,t+s);t+=s;const f=e.readUInt8(t),g=[];t+=1;for(let d=0;d<f;d++){const A=e.readUint16BE(t);t+=2;const R=e.subarray(t,t+A);t+=A;const B=e.readUInt8(t);t+=1;const S=[];for(let I=0;I<B;I++)S.push(Array.from(e.subarray(t,t+br))),t+=br;g.push({message:R,proof:S})}if(t!==e.length)throw new Error("Didn't reach the end of the message");return{vaa:h,updates:g}}Ge.parseAccumulatorUpdateData=Oi;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.PriceFeedMetadata=e.Price=e.parsePriceFeedMessage=e.parseAccumulatorUpdateData=e.sliceAccumulatorUpdateData=e.isAccumulatorUpdateData=void 0;const t=Bt;var a=Ge;Object.defineProperty(e,"isAccumulatorUpdateData",{enumerable:!0,get:function(){return a.isAccumulatorUpdateData}}),Object.defineProperty(e,"sliceAccumulatorUpdateData",{enumerable:!0,get:function(){return a.sliceAccumulatorUpdateData}}),Object.defineProperty(e,"parseAccumulatorUpdateData",{enumerable:!0,get:function(){return a.parseAccumulatorUpdateData}}),Object.defineProperty(e,"parsePriceFeedMessage",{enumerable:!0,get:function(){return a.parsePriceFeedMessage}});class s{constructor(d){Z(this,"conf");Z(this,"expo");Z(this,"price");Z(this,"publishTime");this.conf=d.conf,this.expo=d.expo,this.price=d.price,this.publishTime=d.publishTime}getPriceAsNumberUnchecked(){return Number(this.price)*10**this.expo}getConfAsNumberUnchecked(){return Number(this.conf)*10**this.expo}static fromJson(d){const A=t.Convert.toPrice(d);return new s({conf:A.conf,expo:A.expo,price:A.price,publishTime:A.publish_time})}toJson(){const d={conf:this.conf,expo:this.expo,price:this.price,publish_time:this.publishTime};return t.Convert.priceToJson(d)}}e.Price=s;class h{constructor(d){Z(this,"attestationTime");Z(this,"emitterChain");Z(this,"priceServiceReceiveTime");Z(this,"sequenceNumber");Z(this,"slot");Z(this,"prevPublishTime");this.attestationTime=d.attestationTime,this.emitterChain=d.emitterChain,this.priceServiceReceiveTime=d.receiveTime,this.sequenceNumber=d.sequenceNumber,this.slot=d.slot,this.prevPublishTime=d.prevPublishTime}static fromJson(d){if(d===void 0)return;const A=t.Convert.toPriceFeedMetadata(d);return new h({attestationTime:A.attestation_time,emitterChain:A.emitter_chain,receiveTime:A.price_service_receive_time,sequenceNumber:A.sequence_number,slot:A.slot,prevPublishTime:A.prev_publish_time})}toJson(){const d={attestation_time:this.attestationTime,emitter_chain:this.emitterChain,price_service_receive_time:this.priceServiceReceiveTime,sequence_number:this.sequenceNumber,slot:this.slot,prev_publish_time:this.prevPublishTime};return t.Convert.priceFeedMetadataToJson(d)}}e.PriceFeedMetadata=h;let f=class Sn{constructor(d){Z(this,"emaPrice");Z(this,"id");Z(this,"metadata");Z(this,"vaa");Z(this,"price");this.emaPrice=d.emaPrice,this.id=d.id,this.metadata=d.metadata,this.vaa=d.vaa,this.price=d.price}static fromJson(d){const A=t.Convert.toPriceFeed(d);return new Sn({emaPrice:s.fromJson(A.ema_price),id:A.id,metadata:h.fromJson(A.metadata),vaa:A.vaa,price:s.fromJson(A.price)})}toJson(){var A;const d={ema_price:this.emaPrice.toJson(),id:this.id,metadata:(A=this.metadata)==null?void 0:A.toJson(),price:this.price.toJson()};return t.Convert.priceFeedToJson(d)}getPriceUnchecked(){return this.price}getEmaPriceUnchecked(){return this.emaPrice}getPriceNoOlderThan(d){const A=this.getPriceUnchecked(),R=Math.floor(Date.now()/1e3);if(!(Math.abs(R-A.publishTime)>d))return A}getEmaPriceNoOlderThan(d){const A=this.getEmaPriceUnchecked(),R=Math.floor(Date.now()/1e3);if(!(Math.abs(R-A.publishTime)>d))return A}getMetadata(){return this.metadata}getVAA(){return this.vaa}};e.PriceFeed=f})(Tr);function Dn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ii}=Object.prototype,{getPrototypeOf:Or}=Object,Ct=(e=>t=>{const a=Ii.call(t);return e[a]||(e[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),We=e=>(e=e.toLowerCase(),t=>Ct(t)===e),Ft=e=>t=>typeof t===e,{isArray:at}=Array,lt=Ft("undefined");function Ui(e){return e!==null&&!lt(e)&&e.constructor!==null&&!lt(e.constructor)&&Ne(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tn=We("ArrayBuffer");function Ni(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Tn(e.buffer),t}const ki=Ft("string"),Ne=Ft("function"),Pn=Ft("number"),Rt=e=>e!==null&&typeof e=="object",Li=e=>e===!0||e===!1,yt=e=>{if(Ct(e)!=="object")return!1;const t=Or(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ji=We("Date"),qi=We("File"),$i=We("Blob"),zi=We("FileList"),Hi=e=>Rt(e)&&Ne(e.pipe),Wi=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ne(e.append)&&((t=Ct(e))==="formdata"||t==="object"&&Ne(e.toString)&&e.toString()==="[object FormData]"))},Ji=We("URLSearchParams"),[Gi,Vi,Ki,Zi]=["ReadableStream","Request","Response","Headers"].map(We),Yi=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ht(e,t,{allOwnKeys:a=!1}={}){if(e===null||typeof e>"u")return;let s,h;if(typeof e!="object"&&(e=[e]),at(e))for(s=0,h=e.length;s<h;s++)t.call(null,e[s],s,e);else{const f=a?Object.getOwnPropertyNames(e):Object.keys(e),g=f.length;let d;for(s=0;s<g;s++)d=f[s],t.call(null,e[d],d,e)}}function On(e,t){t=t.toLowerCase();const a=Object.keys(e);let s=a.length,h;for(;s-- >0;)if(h=a[s],t===h.toLowerCase())return h;return null}const Qe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:$e.commonjsGlobal)(),In=e=>!lt(e)&&e!==Qe;function xr(){const{caseless:e}=In(this)&&this||{},t={},a=(s,h)=>{const f=e&&On(t,h)||h;yt(t[f])&&yt(s)?t[f]=xr(t[f],s):yt(s)?t[f]=xr({},s):at(s)?t[f]=s.slice():t[f]=s};for(let s=0,h=arguments.length;s<h;s++)arguments[s]&&ht(arguments[s],a);return t}const Xi=(e,t,a,{allOwnKeys:s}={})=>(ht(t,(h,f)=>{a&&Ne(h)?e[f]=Dn(h,a):e[f]=h},{allOwnKeys:s}),e),Qi=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),eo=(e,t,a,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),a&&Object.assign(e.prototype,a)},to=(e,t,a,s)=>{let h,f,g;const d={};if(t=t||{},e==null)return t;do{for(h=Object.getOwnPropertyNames(e),f=h.length;f-- >0;)g=h[f],(!s||s(g,e,t))&&!d[g]&&(t[g]=e[g],d[g]=!0);e=a!==!1&&Or(e)}while(e&&(!a||a(e,t))&&e!==Object.prototype);return t},ro=(e,t,a)=>{e=String(e),(a===void 0||a>e.length)&&(a=e.length),a-=t.length;const s=e.indexOf(t,a);return s!==-1&&s===a},no=e=>{if(!e)return null;if(at(e))return e;let t=e.length;if(!Pn(t))return null;const a=new Array(t);for(;t-- >0;)a[t]=e[t];return a},io=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Or(Uint8Array)),oo=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let h;for(;(h=s.next())&&!h.done;){const f=h.value;t.call(e,f[0],f[1])}},so=(e,t)=>{let a;const s=[];for(;(a=e.exec(t))!==null;)s.push(a);return s},ao=We("HTMLFormElement"),fo=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,s,h){return s.toUpperCase()+h}),en=(({hasOwnProperty:e})=>(t,a)=>e.call(t,a))(Object.prototype),uo=We("RegExp"),Un=(e,t)=>{const a=Object.getOwnPropertyDescriptors(e),s={};ht(a,(h,f)=>{let g;(g=t(h,f,e))!==!1&&(s[f]=g||h)}),Object.defineProperties(e,s)},co=e=>{Un(e,(t,a)=>{if(Ne(e)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const s=e[a];if(Ne(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},lo=(e,t)=>{const a={},s=h=>{h.forEach(f=>{a[f]=!0})};return at(e)?s(e):s(String(e).split(t)),a},ho=()=>{},po=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,or="abcdefghijklmnopqrstuvwxyz",tn="0123456789",Nn={DIGIT:tn,ALPHA:or,ALPHA_DIGIT:or+or.toUpperCase()+tn},mo=(e=16,t=Nn.ALPHA_DIGIT)=>{let a="";const{length:s}=t;for(;e--;)a+=t[Math.random()*s|0];return a};function yo(e){return!!(e&&Ne(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const go=e=>{const t=new Array(10),a=(s,h)=>{if(Rt(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[h]=s;const f=at(s)?[]:{};return ht(s,(g,d)=>{const A=a(g,h+1);!lt(A)&&(f[d]=A)}),t[h]=void 0,f}}return s};return a(e,0)},wo=We("AsyncFunction"),vo=e=>e&&(Rt(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),kn=((e,t)=>e?setImmediate:t?((a,s)=>(Qe.addEventListener("message",({source:h,data:f})=>{h===Qe&&f===a&&s.length&&s.shift()()},!1),h=>{s.push(h),Qe.postMessage(a,"*")}))(`axios@${Math.random()}`,[]):a=>setTimeout(a))(typeof setImmediate=="function",Ne(Qe.postMessage)),bo=typeof queueMicrotask<"u"?queueMicrotask.bind(Qe):typeof process<"u"&&process.nextTick||kn;var F={isArray:at,isArrayBuffer:Tn,isBuffer:Ui,isFormData:Wi,isArrayBufferView:Ni,isString:ki,isNumber:Pn,isBoolean:Li,isObject:Rt,isPlainObject:yt,isReadableStream:Gi,isRequest:Vi,isResponse:Ki,isHeaders:Zi,isUndefined:lt,isDate:ji,isFile:qi,isBlob:$i,isRegExp:uo,isFunction:Ne,isStream:Hi,isURLSearchParams:Ji,isTypedArray:io,isFileList:zi,forEach:ht,merge:xr,extend:Xi,trim:Yi,stripBOM:Qi,inherits:eo,toFlatObject:to,kindOf:Ct,kindOfTest:We,endsWith:ro,toArray:no,forEachEntry:oo,matchAll:so,isHTMLForm:ao,hasOwnProperty:en,hasOwnProp:en,reduceDescriptors:Un,freezeMethods:co,toObjectSet:lo,toCamelCase:fo,noop:ho,toFiniteNumber:po,findKey:On,global:Qe,isContextDefined:In,ALPHABET:Nn,generateString:mo,isSpecCompliantForm:yo,toJSONObject:go,isAsyncFn:wo,isThenable:vo,setImmediate:kn,asap:bo};function $(e,t,a,s,h){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),a&&(this.config=a),s&&(this.request=s),h&&(this.response=h,this.status=h.status?h.status:null)}F.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.status}}});const Ln=$.prototype,jn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{jn[e]={value:e}});Object.defineProperties($,jn);Object.defineProperty(Ln,"isAxiosError",{value:!0});$.from=(e,t,a,s,h,f)=>{const g=Object.create(Ln);return F.toFlatObject(e,g,function(A){return A!==Error.prototype},d=>d!=="isAxiosError"),$.call(g,e.message,t,a,s,h),g.cause=e,g.name=e.name,f&&Object.assign(g,f),g};var xo=null;function Er(e){return F.isPlainObject(e)||F.isArray(e)}function qn(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function rn(e,t,a){return e?e.concat(t).map(function(h,f){return h=qn(h),!a&&f?"["+h+"]":h}).join(a?".":""):t}function Eo(e){return F.isArray(e)&&!e.some(Er)}const _o=F.toFlatObject(F,{},null,function(t){return/^is[A-Z]/.test(t)});function St(e,t,a){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,a=F.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(N,P){return!F.isUndefined(P[N])});const s=a.metaTokens,h=a.visitor||B,f=a.dots,g=a.indexes,A=(a.Blob||typeof Blob<"u"&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(h))throw new TypeError("visitor must be a function");function R(T){if(T===null)return"";if(F.isDate(T))return T.toISOString();if(!A&&F.isBlob(T))throw new $("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(T)||F.isTypedArray(T)?A&&typeof Blob=="function"?new Blob([T]):Buffer.from(T):T}function B(T,N,P){let J=T;if(T&&!P&&typeof T=="object"){if(F.endsWith(N,"{}"))N=s?N:N.slice(0,-2),T=JSON.stringify(T);else if(F.isArray(T)&&Eo(T)||(F.isFileList(T)||F.endsWith(N,"[]"))&&(J=F.toArray(T)))return N=qn(N),J.forEach(function(G,De){!(F.isUndefined(G)||G===null)&&t.append(g===!0?rn([N],De,f):g===null?N:N+"[]",R(G))}),!1}return Er(T)?!0:(t.append(rn(P,N,f),R(T)),!1)}const S=[],I=Object.assign(_o,{defaultVisitor:B,convertValue:R,isVisitable:Er});function k(T,N){if(!F.isUndefined(T)){if(S.indexOf(T)!==-1)throw Error("Circular reference detected in "+N.join("."));S.push(T),F.forEach(T,function(J,X){(!(F.isUndefined(J)||J===null)&&h.call(t,J,F.isString(X)?X.trim():X,N,I))===!0&&k(J,N?N.concat(X):[X])}),S.pop()}}if(!F.isObject(e))throw new TypeError("data must be an object");return k(e),t}function nn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ir(e,t){this._pairs=[],e&&St(e,this,t)}const $n=Ir.prototype;$n.append=function(t,a){this._pairs.push([t,a])};$n.toString=function(t){const a=t?function(s){return t.call(this,s,nn)}:nn;return this._pairs.map(function(h){return a(h[0])+"="+a(h[1])},"").join("&")};function Mo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function zn(e,t,a){if(!t)return e;const s=a&&a.encode||Mo,h=a&&a.serialize;let f;if(h?f=h(t,a):f=F.isURLSearchParams(t)?t.toString():new Ir(t,a).toString(s),f){const g=e.indexOf("#");g!==-1&&(e=e.slice(0,g)),e+=(e.indexOf("?")===-1?"?":"&")+f}return e}class Ao{constructor(){this.handlers=[]}use(t,a,s){return this.handlers.push({fulfilled:t,rejected:a,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){F.forEach(this.handlers,function(s){s!==null&&t(s)})}}var on=Ao,Hn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bo=typeof URLSearchParams<"u"?URLSearchParams:Ir,Co=typeof FormData<"u"?FormData:null,Fo=typeof Blob<"u"?Blob:null,Ro={isBrowser:!0,classes:{URLSearchParams:Bo,FormData:Co,Blob:Fo},protocols:["http","https","file","blob","url","data"]};const Ur=typeof window<"u"&&typeof document<"u",_r=typeof navigator=="object"&&navigator||void 0,So=Ur&&(!_r||["ReactNative","NativeScript","NS"].indexOf(_r.product)<0),Do=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),To=Ur&&window.location.href||"http://localhost";var Po=Object.freeze({__proto__:null,hasBrowserEnv:Ur,hasStandardBrowserWebWorkerEnv:Do,hasStandardBrowserEnv:So,navigator:_r,origin:To}),Pe={...Po,...Ro};function Oo(e,t){return St(e,new Pe.classes.URLSearchParams,Object.assign({visitor:function(a,s,h,f){return Pe.isNode&&F.isBuffer(a)?(this.append(s,a.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)}},t))}function Io(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Uo(e){const t={},a=Object.keys(e);let s;const h=a.length;let f;for(s=0;s<h;s++)f=a[s],t[f]=e[f];return t}function Wn(e){function t(a,s,h,f){let g=a[f++];if(g==="__proto__")return!0;const d=Number.isFinite(+g),A=f>=a.length;return g=!g&&F.isArray(h)?h.length:g,A?(F.hasOwnProp(h,g)?h[g]=[h[g],s]:h[g]=s,!d):((!h[g]||!F.isObject(h[g]))&&(h[g]=[]),t(a,s,h[g],f)&&F.isArray(h[g])&&(h[g]=Uo(h[g])),!d)}if(F.isFormData(e)&&F.isFunction(e.entries)){const a={};return F.forEachEntry(e,(s,h)=>{t(Io(s),h,a,0)}),a}return null}function No(e,t,a){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(a||JSON.stringify)(e)}const Nr={transitional:Hn,adapter:["xhr","http","fetch"],transformRequest:[function(t,a){const s=a.getContentType()||"",h=s.indexOf("application/json")>-1,f=F.isObject(t);if(f&&F.isHTMLForm(t)&&(t=new FormData(t)),F.isFormData(t))return h?JSON.stringify(Wn(t)):t;if(F.isArrayBuffer(t)||F.isBuffer(t)||F.isStream(t)||F.isFile(t)||F.isBlob(t)||F.isReadableStream(t))return t;if(F.isArrayBufferView(t))return t.buffer;if(F.isURLSearchParams(t))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(f){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Oo(t,this.formSerializer).toString();if((d=F.isFileList(t))||s.indexOf("multipart/form-data")>-1){const A=this.env&&this.env.FormData;return St(d?{"files[]":t}:t,A&&new A,this.formSerializer)}}return f||h?(a.setContentType("application/json",!1),No(t)):t}],transformResponse:[function(t){const a=this.transitional||Nr.transitional,s=a&&a.forcedJSONParsing,h=this.responseType==="json";if(F.isResponse(t)||F.isReadableStream(t))return t;if(t&&F.isString(t)&&(s&&!this.responseType||h)){const g=!(a&&a.silentJSONParsing)&&h;try{return JSON.parse(t)}catch(d){if(g)throw d.name==="SyntaxError"?$.from(d,$.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pe.classes.FormData,Blob:Pe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],e=>{Nr.headers[e]={}});var kr=Nr;const ko=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Lo=e=>{const t={};let a,s,h;return e&&e.split(`
|
|
7
|
-
`).forEach(function(g){h=g.indexOf(":"),a=g.substring(0,h).trim().toLowerCase(),s=g.substring(h+1).trim(),!(!a||t[a]&&ko[a])&&(a==="set-cookie"?t[a]?t[a].push(s):t[a]=[s]:t[a]=t[a]?t[a]+", "+s:s)}),t};const sn=Symbol("internals");function ct(e){return e&&String(e).trim().toLowerCase()}function gt(e){return e===!1||e==null?e:F.isArray(e)?e.map(gt):String(e)}function jo(e){const t=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=a.exec(e);)t[s[1]]=s[2];return t}const qo=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sr(e,t,a,s,h){if(F.isFunction(s))return s.call(this,t,a);if(h&&(t=a),!!F.isString(t)){if(F.isString(s))return t.indexOf(s)!==-1;if(F.isRegExp(s))return s.test(t)}}function $o(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,a,s)=>a.toUpperCase()+s)}function zo(e,t){const a=F.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+a,{value:function(h,f,g){return this[s].call(this,t,h,f,g)},configurable:!0})})}class Dt{constructor(t){t&&this.set(t)}set(t,a,s){const h=this;function f(d,A,R){const B=ct(A);if(!B)throw new Error("header name must be a non-empty string");const S=F.findKey(h,B);(!S||h[S]===void 0||R===!0||R===void 0&&h[S]!==!1)&&(h[S||A]=gt(d))}const g=(d,A)=>F.forEach(d,(R,B)=>f(R,B,A));if(F.isPlainObject(t)||t instanceof this.constructor)g(t,a);else if(F.isString(t)&&(t=t.trim())&&!qo(t))g(Lo(t),a);else if(F.isHeaders(t))for(const[d,A]of t.entries())f(A,d,s);else t!=null&&f(a,t,s);return this}get(t,a){if(t=ct(t),t){const s=F.findKey(this,t);if(s){const h=this[s];if(!a)return h;if(a===!0)return jo(h);if(F.isFunction(a))return a.call(this,h,s);if(F.isRegExp(a))return a.exec(h);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,a){if(t=ct(t),t){const s=F.findKey(this,t);return!!(s&&this[s]!==void 0&&(!a||sr(this,this[s],s,a)))}return!1}delete(t,a){const s=this;let h=!1;function f(g){if(g=ct(g),g){const d=F.findKey(s,g);d&&(!a||sr(s,s[d],d,a))&&(delete s[d],h=!0)}}return F.isArray(t)?t.forEach(f):f(t),h}clear(t){const a=Object.keys(this);let s=a.length,h=!1;for(;s--;){const f=a[s];(!t||sr(this,this[f],f,t,!0))&&(delete this[f],h=!0)}return h}normalize(t){const a=this,s={};return F.forEach(this,(h,f)=>{const g=F.findKey(s,f);if(g){a[g]=gt(h),delete a[f];return}const d=t?$o(f):String(f).trim();d!==f&&delete a[f],a[d]=gt(h),s[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const a=Object.create(null);return F.forEach(this,(s,h)=>{s!=null&&s!==!1&&(a[h]=t&&F.isArray(s)?s.join(", "):s)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,a])=>t+": "+a).join(`
|
|
8
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...a){const s=new this(t);return a.forEach(h=>s.set(h)),s}static accessor(t){const s=(this[sn]=this[sn]={accessors:{}}).accessors,h=this.prototype;function f(g){const d=ct(g);s[d]||(zo(h,g),s[d]=!0)}return F.isArray(t)?t.forEach(f):f(t),this}}Dt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(Dt.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[a]=s}}});F.freezeMethods(Dt);var He=Dt;function ar(e,t){const a=this||kr,s=t||a,h=He.from(s.headers);let f=s.data;return F.forEach(e,function(d){f=d.call(a,f,h.normalize(),t?t.status:void 0)}),h.normalize(),f}function Jn(e){return!!(e&&e.__CANCEL__)}function ft(e,t,a){$.call(this,e??"canceled",$.ERR_CANCELED,t,a),this.name="CanceledError"}F.inherits(ft,$,{__CANCEL__:!0});function Gn(e,t,a){const s=a.config.validateStatus;!a.status||!s||s(a.status)?e(a):t(new $("Request failed with status code "+a.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function Ho(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wo(e,t){e=e||10;const a=new Array(e),s=new Array(e);let h=0,f=0,g;return t=t!==void 0?t:1e3,function(A){const R=Date.now(),B=s[f];g||(g=R),a[h]=A,s[h]=R;let S=f,I=0;for(;S!==h;)I+=a[S++],S=S%e;if(h=(h+1)%e,h===f&&(f=(f+1)%e),R-g<t)return;const k=B&&R-B;return k?Math.round(I*1e3/k):void 0}}function Jo(e,t){let a=0,s=1e3/t,h,f;const g=(R,B=Date.now())=>{a=B,h=null,f&&(clearTimeout(f),f=null),e.apply(null,R)};return[(...R)=>{const B=Date.now(),S=B-a;S>=s?g(R,B):(h=R,f||(f=setTimeout(()=>{f=null,g(h)},s-S)))},()=>h&&g(h)]}const vt=(e,t,a=3)=>{let s=0;const h=Wo(50,250);return Jo(f=>{const g=f.loaded,d=f.lengthComputable?f.total:void 0,A=g-s,R=h(A),B=g<=d;s=g;const S={loaded:g,total:d,progress:d?g/d:void 0,bytes:A,rate:R||void 0,estimated:R&&d&&B?(d-g)/R:void 0,event:f,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(S)},a)},an=(e,t)=>{const a=e!=null;return[s=>t[0]({lengthComputable:a,total:e,loaded:s}),t[1]]},fn=e=>(...t)=>F.asap(()=>e(...t));var Go=Pe.hasStandardBrowserEnv?function(){const t=Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent),a=document.createElement("a");let s;function h(f){let g=f;return t&&(a.setAttribute("href",g),g=a.href),a.setAttribute("href",g),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return s=h(window.location.href),function(g){const d=F.isString(g)?h(g):g;return d.protocol===s.protocol&&d.host===s.host}}():function(){return function(){return!0}}(),Vo=Pe.hasStandardBrowserEnv?{write(e,t,a,s,h,f){const g=[e+"="+encodeURIComponent(t)];F.isNumber(a)&&g.push("expires="+new Date(a).toGMTString()),F.isString(s)&&g.push("path="+s),F.isString(h)&&g.push("domain="+h),f===!0&&g.push("secure"),document.cookie=g.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ko(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zo(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Vn(e,t){return e&&!Ko(t)?Zo(e,t):t}const un=e=>e instanceof He?{...e}:e;function et(e,t){t=t||{};const a={};function s(R,B,S){return F.isPlainObject(R)&&F.isPlainObject(B)?F.merge.call({caseless:S},R,B):F.isPlainObject(B)?F.merge({},B):F.isArray(B)?B.slice():B}function h(R,B,S){if(F.isUndefined(B)){if(!F.isUndefined(R))return s(void 0,R,S)}else return s(R,B,S)}function f(R,B){if(!F.isUndefined(B))return s(void 0,B)}function g(R,B){if(F.isUndefined(B)){if(!F.isUndefined(R))return s(void 0,R)}else return s(void 0,B)}function d(R,B,S){if(S in t)return s(R,B);if(S in e)return s(void 0,R)}const A={url:f,method:f,data:f,baseURL:g,transformRequest:g,transformResponse:g,paramsSerializer:g,timeout:g,timeoutMessage:g,withCredentials:g,withXSRFToken:g,adapter:g,responseType:g,xsrfCookieName:g,xsrfHeaderName:g,onUploadProgress:g,onDownloadProgress:g,decompress:g,maxContentLength:g,maxBodyLength:g,beforeRedirect:g,transport:g,httpAgent:g,httpsAgent:g,cancelToken:g,socketPath:g,responseEncoding:g,validateStatus:d,headers:(R,B)=>h(un(R),un(B),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),function(B){const S=A[B]||h,I=S(e[B],t[B],B);F.isUndefined(I)&&S!==d||(a[B]=I)}),a}var Kn=e=>{const t=et({},e);let{data:a,withXSRFToken:s,xsrfHeaderName:h,xsrfCookieName:f,headers:g,auth:d}=t;t.headers=g=He.from(g),t.url=zn(Vn(t.baseURL,t.url),e.params,e.paramsSerializer),d&&g.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let A;if(F.isFormData(a)){if(Pe.hasStandardBrowserEnv||Pe.hasStandardBrowserWebWorkerEnv)g.setContentType(void 0);else if((A=g.getContentType())!==!1){const[R,...B]=A?A.split(";").map(S=>S.trim()).filter(Boolean):[];g.setContentType([R||"multipart/form-data",...B].join("; "))}}if(Pe.hasStandardBrowserEnv&&(s&&F.isFunction(s)&&(s=s(t)),s||s!==!1&&Go(t.url))){const R=h&&f&&Vo.read(f);R&&g.set(h,R)}return t};const Yo=typeof XMLHttpRequest<"u";var Xo=Yo&&function(e){return new Promise(function(a,s){const h=Kn(e);let f=h.data;const g=He.from(h.headers).normalize();let{responseType:d,onUploadProgress:A,onDownloadProgress:R}=h,B,S,I,k,T;function N(){k&&k(),T&&T(),h.cancelToken&&h.cancelToken.unsubscribe(B),h.signal&&h.signal.removeEventListener("abort",B)}let P=new XMLHttpRequest;P.open(h.method.toUpperCase(),h.url,!0),P.timeout=h.timeout;function J(){if(!P)return;const G=He.from("getAllResponseHeaders"in P&&P.getAllResponseHeaders()),Y={data:!d||d==="text"||d==="json"?P.responseText:P.response,status:P.status,statusText:P.statusText,headers:G,config:e,request:P};Gn(function(Se){a(Se),N()},function(Se){s(Se),N()},Y),P=null}"onloadend"in P?P.onloadend=J:P.onreadystatechange=function(){!P||P.readyState!==4||P.status===0&&!(P.responseURL&&P.responseURL.indexOf("file:")===0)||setTimeout(J)},P.onabort=function(){P&&(s(new $("Request aborted",$.ECONNABORTED,e,P)),P=null)},P.onerror=function(){s(new $("Network Error",$.ERR_NETWORK,e,P)),P=null},P.ontimeout=function(){let De=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded";const Y=h.transitional||Hn;h.timeoutErrorMessage&&(De=h.timeoutErrorMessage),s(new $(De,Y.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,P)),P=null},f===void 0&&g.setContentType(null),"setRequestHeader"in P&&F.forEach(g.toJSON(),function(De,Y){P.setRequestHeader(Y,De)}),F.isUndefined(h.withCredentials)||(P.withCredentials=!!h.withCredentials),d&&d!=="json"&&(P.responseType=h.responseType),R&&([I,T]=vt(R,!0),P.addEventListener("progress",I)),A&&P.upload&&([S,k]=vt(A),P.upload.addEventListener("progress",S),P.upload.addEventListener("loadend",k)),(h.cancelToken||h.signal)&&(B=G=>{P&&(s(!G||G.type?new ft(null,e,P):G),P.abort(),P=null)},h.cancelToken&&h.cancelToken.subscribe(B),h.signal&&(h.signal.aborted?B():h.signal.addEventListener("abort",B)));const X=Ho(h.url);if(X&&Pe.protocols.indexOf(X)===-1){s(new $("Unsupported protocol "+X+":",$.ERR_BAD_REQUEST,e));return}P.send(f||null)})};const Qo=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[];if(t||a){let s=new AbortController,h;const f=function(R){if(!h){h=!0,d();const B=R instanceof Error?R:this.reason;s.abort(B instanceof $?B:new ft(B instanceof Error?B.message:B))}};let g=t&&setTimeout(()=>{g=null,f(new $(`timeout ${t} of ms exceeded`,$.ETIMEDOUT))},t);const d=()=>{e&&(g&&clearTimeout(g),g=null,e.forEach(R=>{R.unsubscribe?R.unsubscribe(f):R.removeEventListener("abort",f)}),e=null)};e.forEach(R=>R.addEventListener("abort",f));const{signal:A}=s;return A.unsubscribe=()=>F.asap(d),A}};var es=Qo;const ts=function*(e,t){let a=e.byteLength;if(!t||a<t){yield e;return}let s=0,h;for(;s<a;)h=s+t,yield e.slice(s,h),s=h},rs=async function*(e,t){for await(const a of ns(e))yield*ts(a,t)},ns=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:a,value:s}=await t.read();if(a)break;yield s}}finally{await t.cancel()}},cn=(e,t,a,s)=>{const h=rs(e,t);let f=0,g,d=A=>{g||(g=!0,s&&s(A))};return new ReadableStream({async pull(A){try{const{done:R,value:B}=await h.next();if(R){d(),A.close();return}let S=B.byteLength;if(a){let I=f+=S;a(I)}A.enqueue(new Uint8Array(B))}catch(R){throw d(R),R}},cancel(A){return d(A),h.return()}},{highWaterMark:2})},Tt=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Zn=Tt&&typeof ReadableStream=="function",is=Tt&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Yn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},os=Zn&&Yn(()=>{let e=!1;const t=new Request(Pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ln=64*1024,Mr=Zn&&Yn(()=>F.isReadableStream(new Response("").body)),bt={stream:Mr&&(e=>e.body)};Tt&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!bt[t]&&(bt[t]=F.isFunction(e[t])?a=>a[t]():(a,s)=>{throw new $(`Response type '${t}' is not supported`,$.ERR_NOT_SUPPORT,s)})})})(new Response);const ss=async e=>{if(e==null)return 0;if(F.isBlob(e))return e.size;if(F.isSpecCompliantForm(e))return(await new Request(Pe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(F.isArrayBufferView(e)||F.isArrayBuffer(e))return e.byteLength;if(F.isURLSearchParams(e)&&(e=e+""),F.isString(e))return(await is(e)).byteLength},as=async(e,t)=>{const a=F.toFiniteNumber(e.getContentLength());return a??ss(t)};var fs=Tt&&(async e=>{let{url:t,method:a,data:s,signal:h,cancelToken:f,timeout:g,onDownloadProgress:d,onUploadProgress:A,responseType:R,headers:B,withCredentials:S="same-origin",fetchOptions:I}=Kn(e);R=R?(R+"").toLowerCase():"text";let k=es([h,f&&f.toAbortSignal()],g),T;const N=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let P;try{if(A&&os&&a!=="get"&&a!=="head"&&(P=await as(B,s))!==0){let Y=new Request(t,{method:"POST",body:s,duplex:"half"}),K;if(F.isFormData(s)&&(K=Y.headers.get("content-type"))&&B.setContentType(K),Y.body){const[Se,Oe]=an(P,vt(fn(A)));s=cn(Y.body,ln,Se,Oe)}}F.isString(S)||(S=S?"include":"omit");const J="credentials"in Request.prototype;T=new Request(t,{...I,signal:k,method:a.toUpperCase(),headers:B.normalize().toJSON(),body:s,duplex:"half",credentials:J?S:void 0});let X=await fetch(T);const G=Mr&&(R==="stream"||R==="response");if(Mr&&(d||G&&N)){const Y={};["status","statusText","headers"].forEach(Le=>{Y[Le]=X[Le]});const K=F.toFiniteNumber(X.headers.get("content-length")),[Se,Oe]=d&&an(K,vt(fn(d),!0))||[];X=new Response(cn(X.body,ln,Se,()=>{Oe&&Oe(),N&&N()}),Y)}R=R||"text";let De=await bt[F.findKey(bt,R)||"text"](X,e);return!G&&N&&N(),await new Promise((Y,K)=>{Gn(Y,K,{data:De,headers:He.from(X.headers),status:X.status,statusText:X.statusText,config:e,request:T})})}catch(J){throw N&&N(),J&&J.name==="TypeError"&&/fetch/i.test(J.message)?Object.assign(new $("Network Error",$.ERR_NETWORK,e,T),{cause:J.cause||J}):$.from(J,J&&J.code,e,T)}});const Ar={http:xo,xhr:Xo,fetch:fs};F.forEach(Ar,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const hn=e=>`- ${e}`,us=e=>F.isFunction(e)||e===null||e===!1;var Xn={getAdapter:e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let a,s;const h={};for(let f=0;f<t;f++){a=e[f];let g;if(s=a,!us(a)&&(s=Ar[(g=String(a)).toLowerCase()],s===void 0))throw new $(`Unknown adapter '${g}'`);if(s)break;h[g||"#"+f]=s}if(!s){const f=Object.entries(h).map(([d,A])=>`adapter ${d} `+(A===!1?"is not supported by the environment":"is not available in the build"));let g=t?f.length>1?`since :
|
|
9
|
-
`+f.map(hn).join(`
|
|
10
|
-
`):" "+hn(f[0]):"as no adapter specified";throw new $("There is no suitable adapter to dispatch the request "+g,"ERR_NOT_SUPPORT")}return s},adapters:Ar};function fr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ft(null,e)}function dn(e){return fr(e),e.headers=He.from(e.headers),e.data=ar.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xn.getAdapter(e.adapter||kr.adapter)(e).then(function(s){return fr(e),s.data=ar.call(e,e.transformResponse,s),s.headers=He.from(s.headers),s},function(s){return Jn(s)||(fr(e),s&&s.response&&(s.response.data=ar.call(e,e.transformResponse,s.response),s.response.headers=He.from(s.response.headers))),Promise.reject(s)})}const Qn="1.7.7",Lr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Lr[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const pn={};Lr.transitional=function(t,a,s){function h(f,g){return"[Axios v"+Qn+"] Transitional option '"+f+"'"+g+(s?". "+s:"")}return(f,g,d)=>{if(t===!1)throw new $(h(g," has been removed"+(a?" in "+a:"")),$.ERR_DEPRECATED);return a&&!pn[g]&&(pn[g]=!0,console.warn(h(g," has been deprecated since v"+a+" and will be removed in the near future"))),t?t(f,g,d):!0}};function cs(e,t,a){if(typeof e!="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let h=s.length;for(;h-- >0;){const f=s[h],g=t[f];if(g){const d=e[f],A=d===void 0||g(d,f,e);if(A!==!0)throw new $("option "+f+" must be "+A,$.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new $("Unknown option "+f,$.ERR_BAD_OPTION)}}var Br={assertOptions:cs,validators:Lr};const Ye=Br.validators;class xt{constructor(t){this.defaults=t,this.interceptors={request:new on,response:new on}}async request(t,a){try{return await this._request(t,a)}catch(s){if(s instanceof Error){let h;Error.captureStackTrace?Error.captureStackTrace(h={}):h=new Error;const f=h.stack?h.stack.replace(/^.+\n/,""):"";try{s.stack?f&&!String(s.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
11
|
-
`+f):s.stack=f}catch{}}throw s}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=et(this.defaults,a);const{transitional:s,paramsSerializer:h,headers:f}=a;s!==void 0&&Br.assertOptions(s,{silentJSONParsing:Ye.transitional(Ye.boolean),forcedJSONParsing:Ye.transitional(Ye.boolean),clarifyTimeoutError:Ye.transitional(Ye.boolean)},!1),h!=null&&(F.isFunction(h)?a.paramsSerializer={serialize:h}:Br.assertOptions(h,{encode:Ye.function,serialize:Ye.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let g=f&&F.merge(f.common,f[a.method]);f&&F.forEach(["delete","get","head","post","put","patch","common"],T=>{delete f[T]}),a.headers=He.concat(g,f);const d=[];let A=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(a)===!1||(A=A&&N.synchronous,d.unshift(N.fulfilled,N.rejected))});const R=[];this.interceptors.response.forEach(function(N){R.push(N.fulfilled,N.rejected)});let B,S=0,I;if(!A){const T=[dn.bind(this),void 0];for(T.unshift.apply(T,d),T.push.apply(T,R),I=T.length,B=Promise.resolve(a);S<I;)B=B.then(T[S++],T[S++]);return B}I=d.length;let k=a;for(S=0;S<I;){const T=d[S++],N=d[S++];try{k=T(k)}catch(P){N.call(this,P);break}}try{B=dn.call(this,k)}catch(T){return Promise.reject(T)}for(S=0,I=R.length;S<I;)B=B.then(R[S++],R[S++]);return B}getUri(t){t=et(this.defaults,t);const a=Vn(t.baseURL,t.url);return zn(a,t.params,t.paramsSerializer)}}F.forEach(["delete","get","head","options"],function(t){xt.prototype[t]=function(a,s){return this.request(et(s||{},{method:t,url:a,data:(s||{}).data}))}});F.forEach(["post","put","patch"],function(t){function a(s){return function(f,g,d){return this.request(et(d||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:f,data:g}))}}xt.prototype[t]=a(),xt.prototype[t+"Form"]=a(!0)});var wt=xt;class jr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(f){a=f});const s=this;this.promise.then(h=>{if(!s._listeners)return;let f=s._listeners.length;for(;f-- >0;)s._listeners[f](h);s._listeners=null}),this.promise.then=h=>{let f;const g=new Promise(d=>{s.subscribe(d),f=d}).then(h);return g.cancel=function(){s.unsubscribe(f)},g},t(function(f,g,d){s.reason||(s.reason=new ft(f,g,d),a(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=s=>{t.abort(s)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new jr(function(h){t=h}),cancel:t}}}var ls=jr;function hs(e){return function(a){return e.apply(null,a)}}function ds(e){return F.isObject(e)&&e.isAxiosError===!0}const Cr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cr).forEach(([e,t])=>{Cr[t]=e});var ps=Cr;function ei(e){const t=new wt(e),a=Dn(wt.prototype.request,t);return F.extend(a,wt.prototype,t,{allOwnKeys:!0}),F.extend(a,t,null,{allOwnKeys:!0}),a.create=function(h){return ei(et(e,h))},a}const Re=ei(kr);Re.Axios=wt;Re.CanceledError=ft;Re.CancelToken=ls;Re.isCancel=Jn;Re.VERSION=Qn;Re.toFormData=St;Re.AxiosError=$;Re.Cancel=Re.CanceledError;Re.all=function(t){return Promise.all(t)};Re.spread=hs;Re.isAxiosError=ds;Re.mergeConfig=et;Re.AxiosHeaders=He;Re.formToJSON=e=>Wn(F.isHTMLForm(e)?new FormData(e):e);Re.getAdapter=Xn.getAdapter;Re.HttpStatusCode=ps;Re.default=Re;var ms=Re,qr={exports:{}},ke={},ti={exports:{}};(function(e){function t(a){return a&&a.__esModule?a:{default:a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ti);var ys=ti.exports,ur={exports:{}},cr={exports:{}},mn;function Pt(){return mn||(mn=1,function(e){function t(a){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},e.exports.__esModule=!0,e.exports.default=e.exports,t(a)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(cr)),cr.exports}var yn;function gs(){return yn||(yn=1,function(e){var t=Pt().default;function a(){e.exports=a=function(){return h},e.exports.__esModule=!0,e.exports.default=e.exports;var s,h={},f=Object.prototype,g=f.hasOwnProperty,d=Object.defineProperty||function(w,b,l){w[b]=l.value},A=typeof Symbol=="function"?Symbol:{},R=A.iterator||"@@iterator",B=A.asyncIterator||"@@asyncIterator",S=A.toStringTag||"@@toStringTag";function I(w,b,l){return Object.defineProperty(w,b,{value:l,enumerable:!0,configurable:!0,writable:!0}),w[b]}try{I({},"")}catch{I=function(l,i,y){return l[i]=y}}function k(w,b,l,i){var y=b&&b.prototype instanceof De?b:De,D=Object.create(y.prototype),O=new v(i||[]);return d(D,"_invoke",{value:E(w,l,O)}),D}function T(w,b,l){try{return{type:"normal",arg:w.call(b,l)}}catch(i){return{type:"throw",arg:i}}}h.wrap=k;var N="suspendedStart",P="suspendedYield",J="executing",X="completed",G={};function De(){}function Y(){}function K(){}var Se={};I(Se,R,function(){return this});var Oe=Object.getPrototypeOf,Le=Oe&&Oe(Oe(x([])));Le&&Le!==f&&g.call(Le,R)&&(Se=Le);var je=K.prototype=De.prototype=Object.create(Se);function Q(w){["next","throw","return"].forEach(function(b){I(w,b,function(l){return this._invoke(b,l)})})}function Te(w,b){function l(y,D,O,U){var V=T(w[y],w,D);if(V.type!=="throw"){var H=V.arg,W=H.value;return W&&t(W)=="object"&&g.call(W,"__await")?b.resolve(W.__await).then(function(Ie){l("next",Ie,O,U)},function(Ie){l("throw",Ie,O,U)}):b.resolve(W).then(function(Ie){H.value=Ie,O(H)},function(Ie){return l("throw",Ie,O,U)})}U(V.arg)}var i;d(this,"_invoke",{value:function(D,O){function U(){return new b(function(V,H){l(D,O,V,H)})}return i=i?i.then(U,U):U()}})}function E(w,b,l){var i=N;return function(y,D){if(i===J)throw Error("Generator is already running");if(i===X){if(y==="throw")throw D;return{value:s,done:!0}}for(l.method=y,l.arg=D;;){var O=l.delegate;if(O){var U=r(O,l);if(U){if(U===G)continue;return U}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(i===N)throw i=X,l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);i=J;var V=T(w,b,l);if(V.type==="normal"){if(i=l.done?X:P,V.arg===G)continue;return{value:V.arg,done:l.done}}V.type==="throw"&&(i=X,l.method="throw",l.arg=V.arg)}}}function r(w,b){var l=b.method,i=w.iterator[l];if(i===s)return b.delegate=null,l==="throw"&&w.iterator.return&&(b.method="return",b.arg=s,r(w,b),b.method==="throw")||l!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+l+"' method")),G;var y=T(i,w.iterator,b.arg);if(y.type==="throw")return b.method="throw",b.arg=y.arg,b.delegate=null,G;var D=y.arg;return D?D.done?(b[w.resultName]=D.value,b.next=w.nextLoc,b.method!=="return"&&(b.method="next",b.arg=s),b.delegate=null,G):D:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,G)}function u(w){var b={tryLoc:w[0]};1 in w&&(b.catchLoc=w[1]),2 in w&&(b.finallyLoc=w[2],b.afterLoc=w[3]),this.tryEntries.push(b)}function p(w){var b=w.completion||{};b.type="normal",delete b.arg,w.completion=b}function v(w){this.tryEntries=[{tryLoc:"root"}],w.forEach(u,this),this.reset(!0)}function x(w){if(w||w===""){var b=w[R];if(b)return b.call(w);if(typeof w.next=="function")return w;if(!isNaN(w.length)){var l=-1,i=function y(){for(;++l<w.length;)if(g.call(w,l))return y.value=w[l],y.done=!1,y;return y.value=s,y.done=!0,y};return i.next=i}}throw new TypeError(t(w)+" is not iterable")}return Y.prototype=K,d(je,"constructor",{value:K,configurable:!0}),d(K,"constructor",{value:Y,configurable:!0}),Y.displayName=I(K,S,"GeneratorFunction"),h.isGeneratorFunction=function(w){var b=typeof w=="function"&&w.constructor;return!!b&&(b===Y||(b.displayName||b.name)==="GeneratorFunction")},h.mark=function(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,K):(w.__proto__=K,I(w,S,"GeneratorFunction")),w.prototype=Object.create(je),w},h.awrap=function(w){return{__await:w}},Q(Te.prototype),I(Te.prototype,B,function(){return this}),h.AsyncIterator=Te,h.async=function(w,b,l,i,y){y===void 0&&(y=Promise);var D=new Te(k(w,b,l,i),y);return h.isGeneratorFunction(b)?D:D.next().then(function(O){return O.done?O.value:D.next()})},Q(je),I(je,S,"Generator"),I(je,R,function(){return this}),I(je,"toString",function(){return"[object Generator]"}),h.keys=function(w){var b=Object(w),l=[];for(var i in b)l.push(i);return l.reverse(),function y(){for(;l.length;){var D=l.pop();if(D in b)return y.value=D,y.done=!1,y}return y.done=!0,y}},h.values=x,v.prototype={constructor:v,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(p),!b)for(var l in this)l.charAt(0)==="t"&&g.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=s)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var l=this;function i(H,W){return O.type="throw",O.arg=b,l.next=H,W&&(l.method="next",l.arg=s),!!W}for(var y=this.tryEntries.length-1;y>=0;--y){var D=this.tryEntries[y],O=D.completion;if(D.tryLoc==="root")return i("end");if(D.tryLoc<=this.prev){var U=g.call(D,"catchLoc"),V=g.call(D,"finallyLoc");if(U&&V){if(this.prev<D.catchLoc)return i(D.catchLoc,!0);if(this.prev<D.finallyLoc)return i(D.finallyLoc)}else if(U){if(this.prev<D.catchLoc)return i(D.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return i(D.finallyLoc)}}}},abrupt:function(b,l){for(var i=this.tryEntries.length-1;i>=0;--i){var y=this.tryEntries[i];if(y.tryLoc<=this.prev&&g.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var D=y;break}}D&&(b==="break"||b==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var O=D?D.completion:{};return O.type=b,O.arg=l,D?(this.method="next",this.next=D.finallyLoc,G):this.complete(O)},complete:function(b,l){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&l&&(this.next=l),G},finish:function(b){for(var l=this.tryEntries.length-1;l>=0;--l){var i=this.tryEntries[l];if(i.finallyLoc===b)return this.complete(i.completion,i.afterLoc),p(i),G}},catch:function(b){for(var l=this.tryEntries.length-1;l>=0;--l){var i=this.tryEntries[l];if(i.tryLoc===b){var y=i.completion;if(y.type==="throw"){var D=y.arg;p(i)}return D}}throw Error("illegal catch attempt")},delegateYield:function(b,l,i){return this.delegate={iterator:x(b),resultName:l,nextLoc:i},this.method==="next"&&(this.arg=s),G}},h}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(ur)),ur.exports}var lr,gn;function ws(){if(gn)return lr;gn=1;var e=gs()();lr=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return lr}var hr={exports:{}},wn;function vs(){return wn||(wn=1,function(e){function t(s,h,f,g,d,A,R){try{var B=s[A](R),S=B.value}catch(I){return void f(I)}B.done?h(S):Promise.resolve(S).then(g,d)}function a(s){return function(){var h=this,f=arguments;return new Promise(function(g,d){var A=s.apply(h,f);function R(S){t(A,g,d,R,B,"next",S)}function B(S){t(A,g,d,R,B,"throw",S)}R(void 0)})}}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(hr)),hr.exports}var dr={exports:{}},pr={exports:{}},mr={exports:{}},vn;function bs(){return vn||(vn=1,function(e){var t=Pt().default;function a(s,h){if(t(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var g=f.call(s,h||"default");if(t(g)!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(s)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(mr)),mr.exports}var bn;function xs(){return bn||(bn=1,function(e){var t=Pt().default,a=bs();function s(h){var f=a(h,"string");return t(f)=="symbol"?f:f+""}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}(pr)),pr.exports}var xn;function Es(){return xn||(xn=1,function(e){var t=xs();function a(s,h,f){return(h=t(h))in s?Object.defineProperty(s,h,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[h]=f,s}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(dr)),dr.exports}var yr,En;function _s(){if(En)return yr;En=1;const e=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);return yr=t=>!e.has(t&&t.code),yr}var dt=ys;Object.defineProperty(ke,"__esModule",{value:!0});ke.isNetworkError=zr;ke.isRetryableError=Ot;ke.isSafeRequestError=ii;ke.isIdempotentRequestError=Hr;ke.isNetworkOrIdempotentRequestError=Wr;ke.exponentialDelay=oi;ke.default=tt;ke.DEFAULT_OPTIONS=ke.namespace=void 0;var Et=dt(ws()),Ms=dt(Pt()),ri=dt(vs()),As=dt(Es()),Bs=dt(_s());function _n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),a.push.apply(a,s)}return a}function gr(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?_n(Object(a),!0).forEach(function(s){(0,As.default)(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):_n(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}var $r="axios-retry";ke.namespace=$r;function zr(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,Bs.default)(e)}var ni=["get","head","options"],Cs=ni.concat(["put","delete"]);function Ot(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function ii(e){return e.config?Ot(e)&&ni.indexOf(e.config.method)!==-1:!1}function Hr(e){return e.config?Ot(e)&&Cs.indexOf(e.config.method)!==-1:!1}function Wr(e){return zr(e)||Hr(e)}function Fs(){return 0}function oi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,a=Math.pow(2,e)*t,s=a*.2*Math.random();return a+s}var si={retries:3,retryCondition:Wr,retryDelay:Fs,shouldResetTimeout:!1,onRetry:function(){}};ke.DEFAULT_OPTIONS=si;function Rs(e,t){return gr(gr(gr({},si),t),e[$r])}function Mn(e,t){var a=Rs(e,t);return a.retryCount=a.retryCount||0,e[$r]=a,a}function Ss(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}function Ds(e,t){return Fr.apply(this,arguments)}function Fr(){return Fr=(0,ri.default)(Et.default.mark(function e(t,a){var s,h,f,g;return Et.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(s=t.retries,h=t.retryCondition,f=t.retryCount<s&&h(a),(0,Ms.default)(f)!=="object"){A.next=13;break}return A.prev=3,A.next=6,f;case 6:return g=A.sent,A.abrupt("return",g!==!1);case 10:return A.prev=10,A.t0=A.catch(3),A.abrupt("return",!1);case 13:return A.abrupt("return",f);case 14:case"end":return A.stop()}},e,null,[[3,10]])})),Fr.apply(this,arguments)}function tt(e,t){var a=e.interceptors.request.use(function(h){var f=Mn(h,t);return f.lastRequestTime=Date.now(),h}),s=e.interceptors.response.use(null,function(){var h=(0,ri.default)(Et.default.mark(function f(g){var d,A,R,B,S,I,k,T;return Et.default.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(d=g.config,d){P.next=3;break}return P.abrupt("return",Promise.reject(g));case 3:return A=Mn(d,t),P.next=6,Ds(A,g);case 6:if(!P.sent){P.next=21;break}if(A.retryCount+=1,R=A.retryDelay,B=A.shouldResetTimeout,S=A.onRetry,I=R(A.retryCount,g),Ss(e,d),!(!B&&d.timeout&&A.lastRequestTime)){P.next=17;break}if(k=Date.now()-A.lastRequestTime,T=d.timeout-k-I,!(T<=0)){P.next=16;break}return P.abrupt("return",Promise.reject(g));case 16:d.timeout=T;case 17:return d.transformRequest=[function(J){return J}],P.next=20,S(A.retryCount,g,d);case 20:return P.abrupt("return",new Promise(function(J){return setTimeout(function(){return J(e(d))},I)}));case 21:return P.abrupt("return",Promise.reject(g));case 22:case"end":return P.stop()}},f)}));return function(f){return h.apply(this,arguments)}}());return{requestInterceptorId:a,responseInterceptorId:s}}tt.isNetworkError=zr;tt.isSafeRequestError=ii;tt.isIdempotentRequestError=Hr;tt.isNetworkOrIdempotentRequestError=Wr;tt.exponentialDelay=oi;tt.isRetryableError=Ot;const ai=ke.default;qr.exports=ai;qr.exports.default=ai;var Ts=qr.exports,It={},it=null;typeof WebSocket<"u"?it=WebSocket:typeof MozWebSocket<"u"?it=MozWebSocket:typeof $e.commonjsGlobal<"u"?it=$e.commonjsGlobal.WebSocket||$e.commonjsGlobal.MozWebSocket:typeof window<"u"?it=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(it=self.WebSocket||self.MozWebSocket);var Ps=it,Os=$e.commonjsGlobal&&$e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(It,"__esModule",{value:!0});It.ResilientWebSocket=void 0;const Is=Os(Ps),Us=3e4+3e3;class Ns{constructor(t,a){Z(this,"endpoint");Z(this,"wsClient");Z(this,"wsUserClosed");Z(this,"wsFailedAttempts");Z(this,"pingTimeout");Z(this,"logger");Z(this,"onError");Z(this,"onMessage");Z(this,"onReconnect");this.endpoint=t,this.logger=a,this.wsFailedAttempts=0,this.onError=s=>{var h;(h=this.logger)==null||h.error(s)},this.wsUserClosed=!0,this.onMessage=()=>{},this.onReconnect=()=>{}}async send(t){var a,s,h;(a=this.logger)==null||a.info(`Sending ${t}`),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0?(s=this.logger)==null||s.error("Couldn't connect to the websocket server. Error callback is called."):(h=this.wsClient)==null||h.send(t)}async startWebSocket(){var t;this.wsClient===void 0&&((t=this.logger)==null||t.info("Creating Web Socket client"),this.wsClient=new Is.default(this.endpoint),this.wsUserClosed=!1,this.wsClient.onopen=()=>{this.wsFailedAttempts=0,this.wsClient.on!==void 0&&this.heartbeat()},this.wsClient.onerror=a=>{this.onError(a.error)},this.wsClient.onmessage=a=>{this.onMessage(a.data)},this.wsClient.onclose=async()=>{var a,s;if(this.pingTimeout!==void 0&&clearInterval(this.pingTimeout),this.wsUserClosed===!1){this.wsFailedAttempts+=1,this.wsClient=void 0;const h=ks(this.wsFailedAttempts);(a=this.logger)==null||a.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${h}ms.`),await An(h),this.restartUnexpectedClosedWebsocket()}else(s=this.logger)==null||s.info("The connection has been closed successfully.")},this.wsClient.on!==void 0&&this.wsClient.on("ping",this.heartbeat.bind(this)))}heartbeat(){var t;(t=this.logger)==null||t.info("Heartbeat"),this.pingTimeout!==void 0&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var a,s;(a=this.logger)==null||a.warn("Connection timed out. Reconnecting..."),(s=this.wsClient)==null||s.terminate(),this.restartUnexpectedClosedWebsocket()},Us)}async waitForMaybeReadyWebSocket(){let t=0;for(;this.wsClient!==void 0&&this.wsClient.readyState!==this.wsClient.OPEN;)if(t>5e3){this.wsClient.close();return}else t+=10,await An(10)}async restartUnexpectedClosedWebsocket(){var t;if(this.wsUserClosed!==!0){if(await this.startWebSocket(),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0){(t=this.logger)==null||t.error("Couldn't reconnect to websocket. Error callback is called.");return}this.onReconnect()}}closeWebSocket(){if(this.wsClient!==void 0){const t=this.wsClient;this.wsClient=void 0,t.close()}this.wsUserClosed=!0}}It.ResilientWebSocket=Ns;async function An(e){return new Promise(t=>setTimeout(t,e))}function ks(e){return 2**e*100}var st={};Object.defineProperty(st,"__esModule",{value:!0});st.removeLeading0xIfExists=st.makeWebsocketUrl=void 0;function Ls(e){const t=new URL("ws",e),a=t.protocol==="https:";return t.protocol=a?"wss:":"ws:",t.toString()}st.makeWebsocketUrl=Ls;function js(e){return e.startsWith("0x")?e.substring(2):e}st.removeLeading0xIfExists=js;var fi=$e.commonjsGlobal&&$e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(At,"__esModule",{value:!0});At.PriceServiceConnection=void 0;const wr=Tr,qs=fi(ms),Bn=fi(Ts),$s=It,vr=st;class zs{constructor(t,a){Z(this,"httpClient");Z(this,"priceFeedCallbacks");Z(this,"wsClient");Z(this,"wsEndpoint");Z(this,"logger");Z(this,"priceFeedRequestConfig");Z(this,"onWsError");var s,h,f;this.httpClient=qs.default.create({baseURL:t,timeout:(a==null?void 0:a.timeout)||5e3}),(0,Bn.default)(this.httpClient,{retries:(a==null?void 0:a.httpRetries)||3,retryDelay:Bn.default.exponentialDelay}),this.priceFeedRequestConfig={binary:(s=a==null?void 0:a.priceFeedRequestConfig)==null?void 0:s.binary,verbose:((h=a==null?void 0:a.priceFeedRequestConfig)==null?void 0:h.verbose)??(a==null?void 0:a.verbose),allowOutOfOrder:(f=a==null?void 0:a.priceFeedRequestConfig)==null?void 0:f.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(a==null?void 0:a.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=g=>{this.logger.error(g),typeof process<"u"&&typeof process.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),process.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,vr.makeWebsocketUrl)(t)}async getLatestPriceFeeds(t){return t.length===0?[]:(await this.httpClient.get("/api/latest_price_feeds",{params:{ids:t,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}})).data.map(h=>wr.PriceFeed.fromJson(h))}async getLatestVaas(t){return(await this.httpClient.get("/api/latest_vaas",{params:{ids:t}})).data}async getVaa(t,a){const s=await this.httpClient.get("/api/get_vaa",{params:{id:t,publish_time:a}});return[s.data.vaa,s.data.publishTime]}async getPriceFeed(t,a){const s=await this.httpClient.get("/api/get_price_feed",{params:{id:t,publish_time:a,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}});return wr.PriceFeed.fromJson(s.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,a){var f;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(g=>(0,vr.removeLeading0xIfExists)(g));const s=[];for(const g of t)this.priceFeedCallbacks.has(g)||(this.priceFeedCallbacks.set(g,new Set),s.push(g)),this.priceFeedCallbacks.get(g).add(a);const h={ids:s,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((f=this.wsClient)==null?void 0:f.send(JSON.stringify(h)))}async unsubscribePriceFeedUpdates(t,a){var f;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(g=>(0,vr.removeLeading0xIfExists)(g));const s=[];for(const g of t)if(this.priceFeedCallbacks.has(g)){let d=!1;a===void 0?(this.priceFeedCallbacks.delete(g),d=!0):(this.priceFeedCallbacks.get(g).delete(a),this.priceFeedCallbacks.get(g).size===0&&(this.priceFeedCallbacks.delete(g),d=!0)),d&&s.push(g)}const h={ids:s,type:"unsubscribe"};await((f=this.wsClient)==null?void 0:f.send(JSON.stringify(h))),this.priceFeedCallbacks.size===0&&this.closeWebSocket()}async startWebSocket(){if(this.wsEndpoint===void 0)throw new Error("Websocket endpoint is undefined.");this.wsClient=new $s.ResilientWebSocket(this.wsEndpoint,this.logger),this.wsClient.onError=this.onWsError,this.wsClient.onReconnect=()=>{var t;if(this.priceFeedCallbacks.size>0){const a={ids:Array.from(this.priceFeedCallbacks.keys()),type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};this.logger.info("Resubscribing to existing price feeds."),(t=this.wsClient)==null||t.send(JSON.stringify(a))}},this.wsClient.onMessage=t=>{this.logger.info(`Received message ${t.toString()}`);let a;try{a=JSON.parse(t.toString())}catch(s){this.logger.error(`Error parsing message ${t.toString()} as JSON.`),this.logger.error(s),this.onWsError(s);return}if(a.type==="response")a.status==="error"&&(this.logger.error(`Error response from the websocket server ${a.error}.`),this.onWsError(new Error(a.error)));else if(a.type==="price_update"){let s;try{s=wr.PriceFeed.fromJson(a.price_feed)}catch(h){this.logger.error(`Error parsing price feeds from message ${t.toString()}.`),this.logger.error(h),this.onWsError(h);return}if(this.priceFeedCallbacks.has(s.id))for(const h of this.priceFeedCallbacks.get(s.id))h(s)}else this.logger.warn(`Ignoring unsupported server response ${t.toString()}.`)},await this.wsClient.startWebSocket()}closeWebSocket(){var t;(t=this.wsClient)==null||t.closeWebSocket(),this.wsClient=void 0,this.priceFeedCallbacks.clear()}}At.PriceServiceConnection=zs;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAccumulatorUpdateData=e.isAccumulatorUpdateData=e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=At;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var a=Tr;Object.defineProperty(e,"PriceFeedMetadata",{enumerable:!0,get:function(){return a.PriceFeedMetadata}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return a.PriceFeed}}),Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return a.Price}}),Object.defineProperty(e,"isAccumulatorUpdateData",{enumerable:!0,get:function(){return a.isAccumulatorUpdateData}}),Object.defineProperty(e,"parseAccumulatorUpdateData",{enumerable:!0,get:function(){return a.parseAccumulatorUpdateData}})})(Dr);Object.defineProperty(Mt,"__esModule",{value:!0});Mt.EvmPriceServiceConnection=void 0;const Hs=Dr,Ws=Cn;class Js extends Hs.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(s=>"0x"+Ws.Buffer.from(s,"base64").toString("hex"))}}Mt.EvmPriceServiceConnection=Js;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CONTRACT_ADDR=e.PriceFeed=e.Price=e.EvmPriceServiceConnection=void 0;var t=Mt;Object.defineProperty(e,"EvmPriceServiceConnection",{enumerable:!0,get:function(){return t.EvmPriceServiceConnection}});var a=Dr;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return a.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return a.PriceFeed}}),e.CONTRACT_ADDR={apechain_mainnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",arbitrum:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",astar_zkevm:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",aurora:"0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9",avalanche:"0x4305FB66699C3B2702D4d05CF36551390A4c69C6",blast:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",bnb:"0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",base:"0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",boba:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",bttc:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",canto:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",celo:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",chiliz:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",conflux_espace:"0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",core_dao:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",cronos:"0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B",cronos_zkevm_mainnet:"0x056f829183ec806a78c26c98961678c24fab71af",eos:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",evmos:"0x354bF866A4B006C9AF9d9e06d9364217A8616E12",ethereum:"0x4305FB66699C3B2702D4d05CF36551390A4c69C6",etherlink:"0x2880aB155794e7179c9eE2e38200202908C17B43",fantom:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",filecoin:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",flow_mainnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",gnosis:"0x2880aB155794e7179c9eE2e38200202908C17B43",gravity:"0x2880aB155794e7179c9eE2e38200202908C17B43",hedera:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",horizen_eon:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",idex_xchain_mainnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",injective_inevm:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",iota:"0x8D254a21b3C86D32F7179855531CE99164721933",kava:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",kcc:"0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B",klaytn:"0x2880aB155794e7179c9eE2e38200202908C17B43",lightlink:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",linea:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",manta:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mantle:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",merlin:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",meter:"0xbFe3f445653f2136b2FD1e6DdDb5676392E3AF16",mode:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",neon:"0x7f2dB085eFC3560AFF33865dD727225d91B4f9A5",opbnb:"0x2880aB155794e7179c9eE2e38200202908C17B43",optimism:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",parallel:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",polygon:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",polygon_zkevm:"0xC5E56d6b40F3e3B5fbfa266bCd35C37426537c65",polynomial:"0x2880aB155794e7179c9eE2e38200202908C17B43",ronin:"0x2880aB155794e7179c9eE2e38200202908C17B43",scroll:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",sei_evm_mainnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",shimmer:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",viction:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",wemix:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zetachain:"0x2880aB155794e7179c9eE2e38200202908C17B43",zkfair:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zksync_era:"0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834",abstract_testnet:"0x47F2A9BDAd52d65b66287253cf5ca0D2b763b486",apechain_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",arbitrum_blueberry:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",arbitrum_sepolia:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",astar_zkevm_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",astar_zkyoto_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",aurora_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",bnb_testnet:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",base_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",berachain_testnet_v2:"0x2880aB155794e7179c9eE2e38200202908C17B43",blackbird:"0x2880aB155794e7179c9eE2e38200202908C17B43",blast_s2_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",boba_goerli:"0x8D254a21b3C86D32F7179855531CE99164721933",boba_sepolia:"0x8D254a21b3C86D32F7179855531CE99164721933",bttc_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",cant_testnet:"0x26DD80569a8B23768A1d80869Ed7339e07595E85",celo_alfajores:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",chiado:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",chiliz_testnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",conflux_espace_testnet:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",core_dao_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",cronos_testnet:"0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",cronos_zkevm_testnet:"0x67DFF3D12dFDCeC9f85fd86f4cBDb0a111fF721A",dela_deperp_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",dela_mithreum_deperp_testnet:"0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",etherlink_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",eos_testnet:"0x0708325268dF9F66270F1401206434524814508b",evmos_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",fantom_sonic_testnet:"0x96124d1F6E44FfDf1fb5D6d74BB2DE1B7Fbe7376",fantom_testnet:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",filecoin_calibration:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",flow_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",fuji:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",hedera_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",idex_xchain_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",injective_inevm_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",kakarot_sepolia:"0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",kava_testnet:"0xfA25E653b44586dBbe27eE9d252192F0e4956683",kcc_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",kinto:"0x2880aB155794e7179c9eE2e38200202908C17B43",klaytn_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",lightlink_pegasus_testnet:"0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",linea_goerli:"0xdF21D137Aadc95588205586636710ca2890538d5",linea_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",manta_testnet:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",manta_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mantle_sepolia:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",merlin_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",meter_testnet:"0x5a71C07a0588074443545eE0c08fb0375564c3E4",mode_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",morph_holesky_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",morph_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",movement_evm_devnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",movement_evm_devnet_imola:"0x2880aB155794e7179c9eE2e38200202908C17B43",mumbai:"0xFC6bd9F9f0c6481c6Af3A7Eb46b296A5B85ed379",neon_devnet:"0x0708325268dF9F66270F1401206434524814508b",nighthawk:"0x2880aB155794e7179c9eE2e38200202908C17B43",olive_testnet:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",opbnb_testnet:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",optimism_celestia_raspberry:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",optimism_goerli:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",optimism_sepolia:"0x0708325268dF9F66270F1401206434524814508b",orange_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",parallel_testnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",polygon_amoy:"0x2880aB155794e7179c9eE2e38200202908C17B43",polygon_blackberry:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",polygon_zkevm_testnet:"0xFf255f800044225f54Af4510332Aa3D67CC77635",polynomial_testnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",reya_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",saigon:"0xEbe57e8045F2F230872523bbff7374986E45C486",sei_evm_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",scroll_sepolia:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",sepolia:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",shimmer_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",soneium_minato_testnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",taiko_hekla:"0x2880aB155794e7179c9eE2e38200202908C17B43",taiko_mainnet:"0x2880aB155794e7179c9eE2e38200202908C17B43",unichain_sepolia:"0x2880aB155794e7179c9eE2e38200202908C17B43",viction_testnet:"0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",wemix_testnet:"0x26DD80569a8B23768A1d80869Ed7339e07595E85",zetachain_testnet:"0x0708325268dF9F66270F1401206434524814508b",zkfair_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zksync_era_goerli:"0x8739d5024B5143278E2b15Bd9e7C26f6CEc658F1",zksync_era_sepolia:"0x056f829183Ec806A78c26C98961678c24faB71af",horizen_gobi_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729"}})(Rn);class Gs{constructor(t){this.connection=new Rn.EvmPriceServiceConnection(t)}getOracleId(){return"PYTH"}async fetchOffchainData(t,a,s){const h=[];let f=BigInt(86400),g=BigInt(0);const d=[];for(const A of s??[]){const[R]=ut.decodeAbiParameters([{name:"updateType",type:"uint8"}],A.query);if(R===1){const[,B,S]=ut.decodeAbiParameters([{name:"updateType",type:"uint8"},{name:"stalenessTolerance",type:"uint64"},{name:"priceIds",type:"bytes32[]"}],A.query);h.push(...S),f=B<f?B:f,g=g+(A.fee??BigInt(1))}else if(R===2){const[,B,S]=ut.decodeAbiParameters([{name:"updateType",type:"uint8"},{name:"requestedTime",type:"uint64"},{name:"priceIds",type:"bytes32"}],A.query),[I]=await this.connection.getVaa(S,Number(B.toString())),k="0x"+Buffer.from(I,"base64").toString("hex");d.push({arg:ut.encodeAbiParameters([{type:"uint8",name:"updateType"},{type:"uint64",name:"timestamp"},{type:"bytes32[]",name:"priceIds"},{type:"bytes[]",name:"updateData"}],[2,B,[S],[k]]),fee:A.fee??BigInt(1)})}else throw new Error(`update type ${R} not supported`)}if(h.length>0){const A=await this.connection.getPriceFeedsUpdateData(h);return[{arg:ut.encodeAbiParameters([{type:"uint8",name:"updateType"},{type:"uint64",name:"stalenessTolerance"},{type:"bytes32[]",name:"priceIds"},{type:"bytes[]",name:"updateData"}],[1,f,h,A]),fee:g},...d]}else return d}}exports.PythAdapter=Gs;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const SYNTHETIX_V3_PERIOD: {
|
|
2
|
-
readonly DELEGATION: "DELEGATION";
|
|
3
|
-
readonly UNDELEGATION: "UNDELEGATION";
|
|
4
|
-
readonly WAIT: "WAIT";
|
|
5
|
-
readonly WITHDRAWAL: "WITHDRAWAL";
|
|
6
|
-
};
|
|
7
|
-
export type SynthetixV3PeriodType = (typeof SYNTHETIX_V3_PERIOD)[keyof typeof SYNTHETIX_V3_PERIOD];
|
|
8
|
-
export interface DayParams {
|
|
9
|
-
dayOfWeek: number;
|
|
10
|
-
hour: number;
|
|
11
|
-
}
|
|
12
|
-
export interface WeekPeriod {
|
|
13
|
-
start: DayParams;
|
|
14
|
-
end: DayParams;
|
|
15
|
-
}
|
|
16
|
-
export interface PeriodConfig {
|
|
17
|
-
id: SynthetixV3PeriodType;
|
|
18
|
-
name: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
gradient: [string, string];
|
|
21
|
-
start: DayParams;
|
|
22
|
-
end: DayParams;
|
|
23
|
-
intraWeekRanges: WeekPeriod[];
|
|
24
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { SynthetixV3PeriodType } from 'trading-widget/types/synthetix-v3.types';
|
|
2
|
-
export declare const getDateRangeByPeriod: (period: SynthetixV3PeriodType) => {
|
|
3
|
-
from: Date;
|
|
4
|
-
to: Date;
|
|
5
|
-
intraWeekRanges: {
|
|
6
|
-
from: Date;
|
|
7
|
-
to: Date;
|
|
8
|
-
}[];
|
|
9
|
-
duration: {
|
|
10
|
-
percentage: number;
|
|
11
|
-
};
|
|
12
|
-
format: {
|
|
13
|
-
from: string;
|
|
14
|
-
to: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const getRangeData: () => {
|
|
18
|
-
from: Date;
|
|
19
|
-
to: Date;
|
|
20
|
-
intraWeekRanges: {
|
|
21
|
-
from: Date;
|
|
22
|
-
to: Date;
|
|
23
|
-
}[];
|
|
24
|
-
duration: {
|
|
25
|
-
percentage: number;
|
|
26
|
-
};
|
|
27
|
-
format: {
|
|
28
|
-
from: string;
|
|
29
|
-
to: string;
|
|
30
|
-
};
|
|
31
|
-
id: SynthetixV3PeriodType;
|
|
32
|
-
name: string;
|
|
33
|
-
description?: string | undefined;
|
|
34
|
-
gradient: [string, string];
|
|
35
|
-
start: import("trading-widget/types/synthetix-v3.types").DayParams;
|
|
36
|
-
end: import("trading-widget/types/synthetix-v3.types").DayParams;
|
|
37
|
-
}[];
|
|
38
|
-
export declare const getCurrentRangeIndex: () => number;
|
|
39
|
-
export declare const getWithdrawalWindowStart: () => string;
|