@1money/protocol-ts-sdk 1.1.2 → 2.0.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/.claude/settings.local.json +2 -1
- package/README.md +216 -134
- package/es/__integration__/helpers.d.ts +0 -7
- package/es/api/checkpoints/types.d.ts +0 -1
- package/es/api/index.js +17 -10
- package/es/api/tokens/index.d.ts +7 -1
- package/es/api/tokens/types.d.ts +21 -6
- package/es/api/transactions/index.d.ts +4 -3
- package/es/api/transactions/types.d.ts +14 -5
- package/es/client/index.js +4 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +481 -22
- package/es/signing/builders/index.d.ts +11 -0
- package/es/signing/builders/payment.d.ts +3 -0
- package/es/signing/builders/tokenAuthority.d.ts +3 -0
- package/es/signing/builders/tokenBridgeAndMint.d.ts +3 -0
- package/es/signing/builders/tokenBurn.d.ts +3 -0
- package/es/signing/builders/tokenBurnAndBridge.d.ts +3 -0
- package/es/signing/builders/tokenClawback.d.ts +3 -0
- package/es/signing/builders/tokenIssue.d.ts +3 -0
- package/es/signing/builders/tokenManageList.d.ts +3 -0
- package/es/signing/builders/tokenMetadata.d.ts +3 -0
- package/es/signing/builders/tokenMint.d.ts +3 -0
- package/es/signing/builders/tokenPause.d.ts +3 -0
- package/es/signing/builders/validate.d.ts +18 -0
- package/es/signing/core.d.ts +27 -0
- package/es/signing/index.d.ts +18 -0
- package/es/signing/signer.d.ts +3 -0
- package/es/utils/encode.d.ts +11 -0
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.js +90 -10
- package/es/utils/interface.d.ts +27 -0
- package/es/utils/sign.d.ts +6 -1
- package/lib/__integration__/helpers.d.ts +0 -7
- package/lib/api/checkpoints/types.d.ts +0 -1
- package/lib/api/index.js +17 -10
- package/lib/api/tokens/index.d.ts +7 -1
- package/lib/api/tokens/types.d.ts +21 -6
- package/lib/api/transactions/index.d.ts +4 -3
- package/lib/api/transactions/types.d.ts +14 -5
- package/lib/client/index.js +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +469 -21
- package/lib/signing/builders/index.d.ts +11 -0
- package/lib/signing/builders/payment.d.ts +3 -0
- package/lib/signing/builders/tokenAuthority.d.ts +3 -0
- package/lib/signing/builders/tokenBridgeAndMint.d.ts +3 -0
- package/lib/signing/builders/tokenBurn.d.ts +3 -0
- package/lib/signing/builders/tokenBurnAndBridge.d.ts +3 -0
- package/lib/signing/builders/tokenClawback.d.ts +3 -0
- package/lib/signing/builders/tokenIssue.d.ts +3 -0
- package/lib/signing/builders/tokenManageList.d.ts +3 -0
- package/lib/signing/builders/tokenMetadata.d.ts +3 -0
- package/lib/signing/builders/tokenMint.d.ts +3 -0
- package/lib/signing/builders/tokenPause.d.ts +3 -0
- package/lib/signing/builders/validate.d.ts +18 -0
- package/lib/signing/core.d.ts +27 -0
- package/lib/signing/index.d.ts +18 -0
- package/lib/signing/signer.d.ts +3 -0
- package/lib/utils/encode.d.ts +11 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +90 -10
- package/lib/utils/interface.d.ts +27 -0
- package/lib/utils/sign.d.ts +6 -1
- package/package.json +2 -2
- package/umd/1money-protocol-ts-sdk.min.js +3 -2
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
!function(t
|
|
2
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class X extends N{constructor(t,e,n,r=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=o,_(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){j||k(this.state32),function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,o=(e+2)%10,i=n[o],s=n[o+1],a=V(i,s,1)^n[r],u=K(i,s,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=u}let e=t[2],o=t[3];for(let n=0;n<24;n++){const r=$[n],i=V(e,o,r),s=K(e,o,r),a=I[n];e=t[a],o=t[a+1],t[a]=i,t[a+1]=s}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=W[r],t[1]^=J[r]}n.fill(0)}(this.state32,this.rounds),j||k(this.state32),this.posOut=0,this.pos=0}update(t){x(this);const{blockLen:e,state:n}=this,r=(t=L(t)).length;for(let o=0;o<r;){const i=Math.min(e-this.pos,r-o);for(let e=0;e<i;e++)n[this.pos++]^=t[o++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,128&e&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){x(this,!1),T(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,o=t.length;r<o;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,o-r);t.set(e.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return _(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,e){T(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:o,enableXOF:i}=this;return t||(t=new X(e,n,r,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=r,t.enableXOF=i,t.destroyed=this.destroyed,t}}const G=((t,e,n)=>function(t){const e=e=>t().update(L(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}((()=>new X(e,t,n))))(1,136,32);function Z(t,e){return function(t,e={}){return"number"==typeof t||"bigint"==typeof t?m(t,e):"string"==typeof t?w(t,e):"boolean"==typeof t?g(t,e):y(t,e)}(G(n(t,{strict:!1})?E(t):t))}function Q(t){if("object"!=typeof t)return(typeof t).toLowerCase();const e=Object.prototype.toString.call(t);return e.slice(8,e.length-1).toLowerCase()}class tt extends Error{constructor(t,e,n){super(e??t.code),this.type=t,void 0!==n&&(this.stack=n)}getMetadata(){return this.type}toObject(){return{type:this.getMetadata(),message:this.message??"",stack:this.stack??"",className:this.constructor.name}}}function et(t,e){return new tt({code:"ETHEREUMJS_DEFAULT_ERROR_CODE"},t,e)}function nt(t,e){if(t<56)return Uint8Array.from([t+e]);const n=at(t),r=at(e+55+n.length/2);return Uint8Array.from(it(r+n))}Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));const rt={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function ot(t){return t>=rt._0&&t<=rt._9?t-rt._0:t>=rt._A&&t<=rt._F?t-(rt._A-10):t>=rt._a&&t<=rt._f?t-(rt._a-10):void 0}function it(t){if("0x"===t.slice(0,2)&&(t=t.slice(0,2)),"string"!=typeof t)throw et("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw et("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=ot(t.charCodeAt(o)),i=ot(t.charCodeAt(o+1));if(void 0===n||void 0===i){throw et('hex string expected, got non-hex character "'+(t[o]+t[o+1])+'" at index '+o)}r[e]=16*n+i}return r}function st(...t){if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}function at(t){if(t<0)throw et("Invalid integer as argument, must be unsigned!");const e=t.toString(16);return e.length%2?`0${e}`:e}function ut(t){return t.length>=2&&"0"===t[0]&&"x"===t[1]}function ct(t){if(t instanceof Uint8Array)return t;if("string"==typeof t)return ut(t)?it((n="string"!=typeof(r=t)?r:ut(r)?r.slice(2):r).length%2?`0${n}`:n):(e=t,(new TextEncoder).encode(e));var e,n,r;if("number"==typeof t||"bigint"==typeof t)return t?it(at(t)):Uint8Array.from([]);if(null==t)return Uint8Array.from([]);throw et("toBytes: received unsupported type "+typeof t)}function lt(t){if(Array.isArray(t)){const e=[];let n=0;for(let r=0;r<t.length;r++){const o=lt(t[r]);e.push(o),n+=o.length}return st(nt(n,192),...e)}const e=ct(t);return 1===e.length&&e[0]<128?e:st(nt(e.length,128),e)}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const{p:ft,n:ht,Gx:dt,Gy:pt,b:gt}={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},yt=32,mt=64,bt=(t="")=>{throw new Error(t)},wt=t=>"bigint"==typeof t,vt=t=>"string"==typeof t,Et=(t,e)=>!(t=>t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name)(t)||"number"==typeof e&&e>0&&t.length!==e?bt("Uint8Array expected"):t,At=t=>new Uint8Array(t),Ot=(t,e)=>t.toString(16).padStart(e,"0"),St=t=>Array.from(Et(t)).map((t=>Ot(t,2))).join(""),Rt=48,_t=57,Tt=65,xt=70,Ut=97,Pt=102,Ct=t=>t>=Rt&&t<=_t?t-Rt:t>=Tt&&t<=xt?t-(Tt-10):t>=Ut&&t<=Pt?t-(Ut-10):void 0,Bt=t=>{const e="hex invalid";if(!vt(t))return bt(e);const n=t.length,r=n/2;if(n%2)return bt(e);const o=At(r);for(let n=0,i=0;n<r;n++,i+=2){const r=Ct(t.charCodeAt(i)),s=Ct(t.charCodeAt(i+1));if(void 0===r||void 0===s)return bt(e);o[n]=16*r+s}return o},jt=(t,e)=>{return Et(vt(t)?Bt(t):(n=Et(t),Uint8Array.from(n)),e);var n},kt=()=>globalThis?.crypto,Lt=(...t)=>{const e=At(t.reduce(((t,e)=>t+Et(e).length),0));let n=0;return t.forEach((t=>{e.set(t,n),n+=t.length})),e},Nt=(t=yt)=>kt().getRandomValues(At(t)),It=BigInt,$t=(t,e,n,r="bad number: out of range")=>wt(t)&&e<=t&&t<n?t:bt(r),zt=(t,e=ft)=>{const n=t%e;return n>=0n?n:e+n},Ft=t=>zt(t,ht),Mt=(t,e)=>{(0n===t||e<=0n)&&bt("no inverse n="+t+" mod="+e);let n=zt(t,e),r=e,o=0n,i=1n;for(;0n!==n;){const t=r%n,e=o-i*(r/n);r=n,n=t,o=i,i=e}return 1n===r?zt(o,e):bt("no inverse")},Dt=t=>t instanceof Xt?t:bt("Point expected"),qt=t=>zt(zt(t*t)*t+gt),Ht=t=>$t(t,0n,ft),Yt=t=>$t(t,1n,ft),Wt=t=>$t(t,1n,ht),Jt=t=>0n===(1n&t),Vt=t=>Uint8Array.of(t),Kt=t=>Vt(Jt(t)?2:3);class Xt{static BASE;static ZERO;px;py;pz;constructor(t,e,n){this.px=Ht(t),this.py=Yt(e),this.pz=Ht(n),Object.freeze(this)}static fromBytes(t){let e;Et(t);const n=t[0],r=t.subarray(1),o=te(r,0,yt),i=t.length;if(33===i&&[2,3].includes(n)){let t=(t=>{const e=qt(Yt(t));let n=1n;for(let t=e,r=(ft+1n)/4n;r>0n;r>>=1n)1n&r&&(n=n*t%ft),t=t*t%ft;return zt(n*n)===e?n:bt("sqrt invalid")})(o);const r=Jt(t);Jt(It(n))!==r&&(t=zt(-t)),e=new Xt(o,t,1n)}return 65===i&&4===n&&(e=new Xt(o,te(r,yt,mt),1n)),e?e.assertValidity():bt("bad point: not on curve")}equals(t){const{px:e,py:n,pz:r}=this,{px:o,py:i,pz:s}=Dt(t),a=zt(e*s),u=zt(o*r),c=zt(n*s),l=zt(i*r);return a===u&&c===l}is0(){return this.equals(Zt)}negate(){return new Xt(this.px,zt(-this.py),this.pz)}double(){return this.add(this)}add(t){const{px:e,py:n,pz:r}=this,{px:o,py:i,pz:s}=Dt(t);let a=0n,u=0n,c=0n;const l=zt(3n*gt);let f=zt(e*o),h=zt(n*i),d=zt(r*s),p=zt(e+n),g=zt(o+i);p=zt(p*g),g=zt(f+h),p=zt(p-g),g=zt(e+r);let y=zt(o+s);return g=zt(g*y),y=zt(f+d),g=zt(g-y),y=zt(n+r),a=zt(i+s),y=zt(y*a),a=zt(h+d),y=zt(y-a),c=zt(0n*g),a=zt(l*d),c=zt(a+c),a=zt(h-c),c=zt(h+c),u=zt(a*c),h=zt(f+f),h=zt(h+f),d=zt(0n*d),g=zt(l*g),h=zt(h+d),d=zt(f-d),d=zt(0n*d),g=zt(g+d),f=zt(h*g),u=zt(u+f),f=zt(y*g),a=zt(p*a),a=zt(a-f),f=zt(p*h),c=zt(y*c),c=zt(c+f),new Xt(a,u,c)}multiply(t,e=!0){if(!e&&0n===t)return Zt;if(Wt(t),1n===t)return this;if(this.equals(Gt))return ge(t).p;let n=Zt,r=Gt;for(let o=this;t>0n;o=o.double(),t>>=1n)1n&t?n=n.add(o):e&&(r=r.add(o));return n}toAffine(){const{px:t,py:e,pz:n}=this;if(this.equals(Zt))return{x:0n,y:0n};if(1n===n)return{x:t,y:e};const r=Mt(n,ft);return 1n!==zt(n*r)&&bt("inverse invalid"),{x:zt(t*r),y:zt(e*r)}}assertValidity(){const{x:t,y:e}=this.toAffine();return Yt(t),Yt(e),zt(e*e)===qt(t)?this:bt("bad point: not on curve")}toBytes(t=!0){const{x:e,y:n}=this.assertValidity().toAffine(),r=ne(e);return t?Lt(Kt(n),r):Lt(Vt(4),r,ne(n))}static fromAffine(t){const{x:e,y:n}=t;return 0n===e&&0n===n?Zt:new Xt(e,n,1n)}toHex(t){return St(this.toBytes(t))}static fromPrivateKey(t){return Gt.multiply(re(t))}static fromHex(t){return Xt.fromBytes(jt(t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(t){return this.toBytes(t)}}const Gt=new Xt(dt,pt,1n),Zt=new Xt(0n,1n,0n);Xt.BASE=Gt,Xt.ZERO=Zt;const Qt=t=>It("0x"+(St(t)||"0")),te=(t,e,n)=>Qt(t.subarray(e,n)),ee=2n**256n,ne=t=>Bt(Ot($t(t,0n,ee),mt)),re=t=>{const e=wt(t)?t:Qt(jt(t,yt));return $t(e,1n,ht,"private key invalid 3")},oe=t=>t>ht>>1n;class ie{r;s;recovery;constructor(t,e,n){this.r=Wt(t),this.s=Wt(e),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(t){Et(t,mt);const e=te(t,0,yt),n=te(t,yt,mt);return new ie(e,n)}toBytes(){const{r:t,s:e}=this;return Lt(ne(t),ne(e))}addRecoveryBit(t){return new ie(this.r,this.s,t)}hasHighS(){return oe(this.s)}toCompactRawBytes(){return this.toBytes()}toCompactHex(){return St(this.toBytes())}recoverPublicKey(t){return le(this,t)}static fromCompact(t){return ie.fromBytes(jt(t,mt))}assertValidity(){return this}normalizeS(){const{r:t,s:e,recovery:n}=this;return oe(e)?new ie(t,Ft(-e),n):this}}const se=t=>{const e=8*t.length-256;e>1024&&bt("msg invalid");const n=Qt(t);return e>0?n>>It(e):n},ae=t=>Ft(se(Et(t))),ue={lowS:!0},ce=async(t,e,n=ue)=>{const{seed:r,k2sig:o}=((t,e,n=ue)=>{["der","recovered","canonical"].some((t=>t in n))&&bt("option not supported");let{lowS:r,extraEntropy:o}=n;null==r&&(r=!0);const i=ne,s=ae(jt(t)),a=i(s),u=re(e),c=[i(u),a];o&&c.push(!0===o?Nt(yt):jt(o));const l=s;return{seed:Lt(...c),k2sig:t=>{const e=se(t);if(!(1n<=e&&e<ht))return;const n=Gt.multiply(e).toAffine(),o=Ft(n.x);if(0n===o)return;const i=Mt(e,ht),s=Ft(i*Ft(l+Ft(u*o)));if(0n===s)return;let a=s,c=(n.x===o?0:2)|Number(1n&n.y);return r&&oe(s)&&(a=Ft(-s),c^=1),new ie(o,a,c)}}})(t,e,n),i=await(()=>{let t=At(yt),e=At(yt),n=0;const r=At(0),o=()=>{t.fill(1),e.fill(0),n=0};{const i=(...n)=>fe.hmacSha256Async(e,t,...n),s=async(n=r)=>{e=await i(Vt(0),n),t=await i(),0!==n.length&&(e=await i(Vt(1),n),t=await i())},a=async()=>(n++>=1e3&&bt("drbg: tried 1000 values"),t=await i(),t);return async(t,e)=>{let n;for(o(),await s(t);!(n=e(await a()));)await s();return o(),n}}})()(r,o);return i},le=(t,e)=>{const{r:n,s:r,recovery:o}=t;[0,1,2,3].includes(o)||bt("recovery id invalid");const i=ae(jt(e,yt)),s=2===o||3===o?n+ht:n;Yt(s);const a=Kt(It(o)),u=Lt(a,ne(s)),c=Xt.fromBytes(u),l=Mt(s,ht);return((t,e,n)=>Gt.multiply(e,!1).add(t.multiply(n,!1)).assertValidity())(c,Ft(-i*l),Ft(r*l))},fe={hexToBytes:Bt,bytesToHex:St,concatBytes:Lt,bytesToNumberBE:Qt,numberToBytesBE:ne,mod:zt,invert:Mt,hmacSha256Async:async(t,...e)=>{const n=kt()?.subtle??bt("crypto.subtle must be defined"),r="HMAC",o=await n.importKey("raw",t,{name:r,hash:{name:"SHA-256"}},!1,["sign"]);return At(await n.sign(r,o,Lt(...e)))},hmacSha256Sync:void 0,hashToPrivateKey:t=>{((t=jt(t)).length<40||t.length>1024)&&bt("expected 40-1024b");const e=zt(Qt(t),ht-1n);return ne(e+1n)},randomBytes:Nt},he=Math.ceil(32)+1;let de;const pe=(t,e)=>{const n=e.negate();return t?n:e},ge=t=>{const e=de||(de=(()=>{const t=[];let e=Gt,n=e;for(let r=0;r<he;r++){n=e,t.push(n);for(let r=1;r<128;r++)n=n.add(e),t.push(n);e=n.double()}return t})());let n=Zt,r=Gt;const o=It(255),i=It(8);for(let s=0;s<he;s++){let a=Number(t&o);t>>=i,a>128&&(a-=256,t+=1n);const u=128*s,c=u,l=u+Math.abs(a)-1,f=s%2!=0,h=a<0;0===a?r=r.add(pe(f,e[c])):n=n.add(pe(h,e[l]))}return{p:n,f:r}};function ye(t){if("array"===Q(t)){return lt(t.map((t=>"string"===Q(t)?/^0x[0-9a-fA-F]+$/.test(t)?S(t):/^\d+$/.test(t)?"0"===t?new Uint8Array([]):S(m(BigInt(t))):(new TextEncoder).encode(t):"number"===Q(t)||"bigint"===Q(t)?0===t||t===BigInt(0)?new Uint8Array([]):S(m(t)):"boolean"===Q(t)?t?Uint8Array.from([1]):new Uint8Array([]):t)))}return"boolean"===Q(t)?lt(t?Uint8Array.from([1]):new Uint8Array([])):lt(t)}var me="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function be(){throw new Error("setTimeout has not been defined")}function we(){throw new Error("clearTimeout has not been defined")}var ve=be,Ee=we;function Ae(t){if(ve===setTimeout)return setTimeout(t,0);if((ve===be||!ve)&&setTimeout)return ve=setTimeout,setTimeout(t,0);try{return ve(t,0)}catch(e){try{return ve.call(null,t,0)}catch(e){return ve.call(this,t,0)}}}"function"==typeof me.setTimeout&&(ve=setTimeout),"function"==typeof me.clearTimeout&&(Ee=clearTimeout);var Oe,Se=[],Re=!1,_e=-1;function Te(){Re&&Oe&&(Re=!1,Oe.length?Se=Oe.concat(Se):_e=-1,Se.length&&xe())}function xe(){if(!Re){var t=Ae(Te);Re=!0;for(var e=Se.length;e;){for(Oe=Se,Se=[];++_e<e;)Oe&&Oe[_e].run();_e=-1,e=Se.length}Oe=null,Re=!1,function(t){if(Ee===clearTimeout)return clearTimeout(t);if((Ee===we||!Ee)&&clearTimeout)return Ee=clearTimeout,clearTimeout(t);try{return Ee(t)}catch(e){try{return Ee.call(null,t)}catch(e){return Ee.call(this,t)}}}(t)}}function Ue(t,e){this.fun=t,this.array=e}Ue.prototype.run=function(){this.fun.apply(null,this.array)};var Pe=me.performance||{};Pe.now||Pe.mozNow||Pe.msNow||Pe.oNow||Pe.webkitNow;var Ce={nextTick:function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Se.push(new Ue(t,e)),1!==Se.length||Re||Ae(xe)}};function Be(t,e){return function(){return t.apply(e,arguments)}}const{toString:je}=Object.prototype,{getPrototypeOf:ke}=Object,{iterator:Le,toStringTag:Ne}=Symbol,Ie=($e=Object.create(null),t=>{const e=je.call(t);return $e[e]||($e[e]=e.slice(8,-1).toLowerCase())});var $e;const ze=t=>(t=t.toLowerCase(),e=>Ie(e)===t),Fe=t=>e=>typeof e===t,{isArray:Me}=Array,De=Fe("undefined");function qe(t){return null!==t&&!De(t)&&null!==t.constructor&&!De(t.constructor)&&We(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const He=ze("ArrayBuffer");const Ye=Fe("string"),We=Fe("function"),Je=Fe("number"),Ve=t=>null!==t&&"object"==typeof t,Ke=t=>{if("object"!==Ie(t))return!1;const e=ke(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Ne in t||Le in t)},Xe=ze("Date"),Ge=ze("File"),Ze=ze("Blob"),Qe=ze("FileList"),tn=ze("URLSearchParams"),[en,nn,rn,on]=["ReadableStream","Request","Response","Headers"].map(ze);function sn(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),Me(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(qe(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let s;for(r=0;r<i;r++)s=o[r],e.call(null,t[s],s,t)}}function an(t,e){if(qe(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const un="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:me,cn=t=>!De(t)&&t!==un;const ln=(fn="undefined"!=typeof Uint8Array&&ke(Uint8Array),t=>fn&&t instanceof fn);var fn;const hn=ze("HTMLFormElement"),dn=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),pn=ze("RegExp"),gn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};sn(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)};const yn=ze("AsyncFunction"),mn=(bn="function"==typeof setImmediate,wn=We(un.postMessage),bn?setImmediate:wn?(vn=`axios@${Math.random()}`,En=[],un.addEventListener("message",(({source:t,data:e})=>{t===un&&e===vn&&En.length&&En.shift()()}),!1),t=>{En.push(t),un.postMessage(vn,"*")}):t=>setTimeout(t));var bn,wn,vn,En;const An="undefined"!=typeof queueMicrotask?queueMicrotask.bind(un):Ce.nextTick||mn;var On={isArray:Me,isArrayBuffer:He,isBuffer:qe,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||We(t.append)&&("formdata"===(e=Ie(t))||"object"===e&&We(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&He(t.buffer),e},isString:Ye,isNumber:Je,isBoolean:t=>!0===t||!1===t,isObject:Ve,isPlainObject:Ke,isEmptyObject:t=>{if(!Ve(t)||qe(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:en,isRequest:nn,isResponse:rn,isHeaders:on,isUndefined:De,isDate:Xe,isFile:Ge,isBlob:Ze,isRegExp:pn,isFunction:We,isStream:t=>Ve(t)&&We(t.pipe),isURLSearchParams:tn,isTypedArray:ln,isFileList:Qe,forEach:sn,merge:function t(){const{caseless:e,skipUndefined:n}=cn(this)&&this||{},r={},o=(o,i)=>{const s=e&&an(r,i)||i;Ke(r[s])&&Ke(o)?r[s]=t(r[s],o):Ke(o)?r[s]=t({},o):Me(o)?r[s]=o.slice():n&&De(o)||(r[s]=o)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&sn(arguments[t],o);return r},extend:(t,e,n,{allOwnKeys:r}={})=>(sn(e,((e,r)=>{n&&We(e)?t[r]=Be(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],r&&!r(s,t,e)||a[s]||(e[s]=t[s],a[s]=!0);t=!1!==n&&ke(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:Ie,kindOfTest:ze,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(Me(t))return t;let e=t.length;if(!Je(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Le]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:hn,hasOwnProperty:dn,hasOwnProp:dn,reduceDescriptors:gn,freezeMethods:t=>{gn(t,((e,n)=>{if(We(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];We(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return Me(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:an,global:un,isContextDefined:cn,isSpecCompliantForm:function(t){return!!(t&&We(t.append)&&"FormData"===t[Ne]&&t[Le])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(Ve(t)){if(e.indexOf(t)>=0)return;if(qe(t))return t;if(!("toJSON"in t)){e[r]=t;const o=Me(t)?[]:{};return sn(t,((t,e)=>{const i=n(t,r+1);!De(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:yn,isThenable:t=>t&&(Ve(t)||We(t))&&We(t.then)&&We(t.catch),setImmediate:mn,asap:An,isIterable:t=>null!=t&&We(t[Le])},Sn=[],Rn=[],_n="undefined"!=typeof Uint8Array?Uint8Array:Array,Tn=!1;function xn(){Tn=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)Sn[e]=t[e],Rn[t.charCodeAt(e)]=e;Rn["-".charCodeAt(0)]=62,Rn["_".charCodeAt(0)]=63}function Un(t,e,n){for(var r,o,i=[],s=e;s<n;s+=3)r=(t[s]<<16)+(t[s+1]<<8)+t[s+2],i.push(Sn[(o=r)>>18&63]+Sn[o>>12&63]+Sn[o>>6&63]+Sn[63&o]);return i.join("")}function Pn(t){var e;Tn||xn();for(var n=t.length,r=n%3,o="",i=[],s=16383,a=0,u=n-r;a<u;a+=s)i.push(Un(t,a,a+s>u?u:a+s));return 1===r?(e=t[n-1],o+=Sn[e>>2],o+=Sn[e<<4&63],o+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],o+=Sn[e>>10],o+=Sn[e>>4&63],o+=Sn[e<<2&63],o+="="),i.push(o),i.join("")}function Cn(t,e,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?o-1:0,h=n?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-l)-1,d>>=-l,l+=a;l>0;i=256*i+t[e+f],f+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),i-=c}return(d?-1:1)*s*Math.pow(2,i-r)}function Bn(t,e,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[n+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+d]=255&s,d+=p,s/=256,c-=8);t[n+d-p]|=128*g}var jn={}.toString,kn=Array.isArray||function(t){return"[object Array]"==jn.call(t)};function Ln(){return In.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Nn(t,e){if(Ln()<e)throw new RangeError("Invalid typed array length");return In.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=In.prototype:(null===t&&(t=new In(e)),t.length=e),t}function In(t,e,n){if(!(In.TYPED_ARRAY_SUPPORT||this instanceof In))return new In(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return Fn(this,t)}return $n(this,t,e,n)}function $n(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);In.TYPED_ARRAY_SUPPORT?(t=e).__proto__=In.prototype:t=Mn(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!In.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Hn(e,n);t=Nn(t,r);var o=t.write(e,n);o!==r&&(t=t.slice(0,o));return t}(t,e,n):function(t,e){if(qn(e)){var n=0|Dn(e.length);return 0===(t=Nn(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?Nn(t,0):Mn(t,e);if("Buffer"===e.type&&kn(e.data))return Mn(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function zn(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Fn(t,e){if(zn(e),t=Nn(t,e<0?0:0|Dn(e)),!In.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function Mn(t,e){var n=e.length<0?0:0|Dn(e.length);t=Nn(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function Dn(t){if(t>=Ln())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ln().toString(16)+" bytes");return 0|t}function qn(t){return!(null==t||!t._isBuffer)}function Hn(t,e){if(qn(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return mr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return br(t).length;default:if(r)return mr(t).length;e=(""+e).toLowerCase(),r=!0}}function Yn(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return sr(this,e,n);case"utf8":case"utf-8":return nr(this,e,n);case"ascii":return or(this,e,n);case"latin1":case"binary":return ir(this,e,n);case"base64":return er(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ar(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function Wn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Jn(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=In.from(e,r)),qn(e))return 0===e.length?-1:Vn(t,e,n,r,o);if("number"==typeof e)return e&=255,In.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):Vn(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Vn(t,e,n,r,o){var i,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=n;i<a;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(n+u>a&&(n=a-u),i=n;i>=0;i--){for(var f=!0,h=0;h<u;h++)if(c(t,i+h)!==c(e,h)){f=!1;break}if(f)return i}return-1}function Kn(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function Xn(t,e,n,r){return wr(mr(e,t.length-n),t,n,r)}function Gn(t,e,n,r){return wr(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function Zn(t,e,n,r){return Gn(t,e,n,r)}function Qn(t,e,n,r){return wr(br(e),t,n,r)}function tr(t,e,n,r){return wr(function(t,e){for(var n,r,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=(n=t.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function er(t,e,n){return 0===e&&n===t.length?Pn(t):Pn(t.slice(e,n))}function nr(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,s,a,u,c=t[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}return function(t){var e=t.length;if(e<=rr)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=rr));return n}(r)}In.TYPED_ARRAY_SUPPORT=void 0===me.TYPED_ARRAY_SUPPORT||me.TYPED_ARRAY_SUPPORT,Ln(),In.poolSize=8192,In._augment=function(t){return t.__proto__=In.prototype,t},In.from=function(t,e,n){return $n(null,t,e,n)},In.TYPED_ARRAY_SUPPORT&&(In.prototype.__proto__=Uint8Array.prototype,In.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&In[Symbol.species]),In.alloc=function(t,e,n){return function(t,e,n,r){return zn(e),e<=0?Nn(t,e):void 0!==n?"string"==typeof r?Nn(t,e).fill(n,r):Nn(t,e).fill(n):Nn(t,e)}(null,t,e,n)},In.allocUnsafe=function(t){return Fn(null,t)},In.allocUnsafeSlow=function(t){return Fn(null,t)},In.isBuffer=function(t){return null!=t&&(!!t._isBuffer||vr(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&vr(t.slice(0,0))}(t))},In.compare=function(t,e){if(!qn(t)||!qn(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},In.isEncoding=function(t){switch(String(t).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}},In.concat=function(t,e){if(!kn(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return In.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=In.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var i=t[n];if(!qn(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},In.byteLength=Hn,In.prototype._isBuffer=!0,In.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Wn(this,e,e+1);return this},In.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Wn(this,e,e+3),Wn(this,e+1,e+2);return this},In.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Wn(this,e,e+7),Wn(this,e+1,e+6),Wn(this,e+2,e+5),Wn(this,e+3,e+4);return this},In.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?nr(this,0,t):Yn.apply(this,arguments)},In.prototype.equals=function(t){if(!qn(t))throw new TypeError("Argument must be a Buffer");return this===t||0===In.compare(this,t)},In.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},In.prototype.compare=function(t,e,n,r,o){if(!qn(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(i,s),u=this.slice(r,o),c=t.slice(e,n),l=0;l<a;++l)if(u[l]!==c[l]){i=u[l],s=c[l];break}return i<s?-1:s<i?1:0},In.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},In.prototype.indexOf=function(t,e,n){return Jn(this,t,e,n,!0)},In.prototype.lastIndexOf=function(t,e,n){return Jn(this,t,e,n,!1)},In.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return Kn(this,t,e,n);case"utf8":case"utf-8":return Xn(this,t,e,n);case"ascii":return Gn(this,t,e,n);case"latin1":case"binary":return Zn(this,t,e,n);case"base64":return Qn(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tr(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},In.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var rr=4096;function or(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function ir(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function sr(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=yr(t[i]);return o}function ar(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function ur(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function cr(t,e,n,r,o,i){if(!qn(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function lr(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function fr(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=e>>>8*(r?o:3-o)&255}function hr(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function dr(t,e,n,r,o){return o||hr(t,0,n,4),Bn(t,e,n,r,23,4),n+4}function pr(t,e,n,r,o){return o||hr(t,0,n,8),Bn(t,e,n,r,52,8),n+8}In.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),In.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=In.prototype;else{var o=e-t;n=new In(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},In.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||ur(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},In.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||ur(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},In.prototype.readUInt8=function(t,e){return e||ur(t,1,this.length),this[t]},In.prototype.readUInt16LE=function(t,e){return e||ur(t,2,this.length),this[t]|this[t+1]<<8},In.prototype.readUInt16BE=function(t,e){return e||ur(t,2,this.length),this[t]<<8|this[t+1]},In.prototype.readUInt32LE=function(t,e){return e||ur(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},In.prototype.readUInt32BE=function(t,e){return e||ur(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},In.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||ur(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},In.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||ur(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},In.prototype.readInt8=function(t,e){return e||ur(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},In.prototype.readInt16LE=function(t,e){e||ur(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},In.prototype.readInt16BE=function(t,e){e||ur(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},In.prototype.readInt32LE=function(t,e){return e||ur(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},In.prototype.readInt32BE=function(t,e){return e||ur(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},In.prototype.readFloatLE=function(t,e){return e||ur(t,4,this.length),Cn(this,t,!0,23,4)},In.prototype.readFloatBE=function(t,e){return e||ur(t,4,this.length),Cn(this,t,!1,23,4)},In.prototype.readDoubleLE=function(t,e){return e||ur(t,8,this.length),Cn(this,t,!0,52,8)},In.prototype.readDoubleBE=function(t,e){return e||ur(t,8,this.length),Cn(this,t,!1,52,8)},In.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||cr(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},In.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||cr(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},In.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,1,255,0),In.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},In.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,2,65535,0),In.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):lr(this,t,e,!0),e+2},In.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,2,65535,0),In.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):lr(this,t,e,!1),e+2},In.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,4,4294967295,0),In.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):fr(this,t,e,!0),e+4},In.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,4,4294967295,0),In.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):fr(this,t,e,!1),e+4},In.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);cr(this,t,e,n,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+n},In.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);cr(this,t,e,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+n},In.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,1,127,-128),In.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},In.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,2,32767,-32768),In.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):lr(this,t,e,!0),e+2},In.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,2,32767,-32768),In.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):lr(this,t,e,!1),e+2},In.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,4,2147483647,-2147483648),In.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):fr(this,t,e,!0),e+4},In.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||cr(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),In.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):fr(this,t,e,!1),e+4},In.prototype.writeFloatLE=function(t,e,n){return dr(this,t,e,!0,n)},In.prototype.writeFloatBE=function(t,e,n){return dr(this,t,e,!1,n)},In.prototype.writeDoubleLE=function(t,e,n){return pr(this,t,e,!0,n)},In.prototype.writeDoubleBE=function(t,e,n){return pr(this,t,e,!1,n)},In.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,i=r-n;if(this===t&&n<e&&e<r)for(o=i-1;o>=0;--o)t[o+e]=this[o+n];else if(i<1e3||!In.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},In.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!In.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var s=qn(t)?t:mr(new In(t,r).toString()),a=s.length;for(i=0;i<n-e;++i)this[i+e]=s[i%a]}return this};var gr=/[^+\/0-9A-Za-z-_]/g;function yr(t){return t<16?"0"+t.toString(16):t.toString(16)}function mr(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function br(t){return function(t){var e,n,r,o,i,s;Tn||xn();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===t[a-2]?2:"="===t[a-1]?1:0,s=new _n(3*a/4-i),r=i>0?a-4:a;var u=0;for(e=0,n=0;e<r;e+=4,n+=3)o=Rn[t.charCodeAt(e)]<<18|Rn[t.charCodeAt(e+1)]<<12|Rn[t.charCodeAt(e+2)]<<6|Rn[t.charCodeAt(e+3)],s[u++]=o>>16&255,s[u++]=o>>8&255,s[u++]=255&o;return 2===i?(o=Rn[t.charCodeAt(e)]<<2|Rn[t.charCodeAt(e+1)]>>4,s[u++]=255&o):1===i&&(o=Rn[t.charCodeAt(e)]<<10|Rn[t.charCodeAt(e+1)]<<4|Rn[t.charCodeAt(e+2)]>>2,s[u++]=o>>8&255,s[u++]=255&o),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(gr,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function wr(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function vr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function Er(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}On.inherits(Er,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:On.toJSONObject(this.config),code:this.code,status:this.status}}});const Ar=Er.prototype,Or={};["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((t=>{Or[t]={value:t}})),Object.defineProperties(Er,Or),Object.defineProperty(Ar,"isAxiosError",{value:!0}),Er.from=(t,e,n,r,o,i)=>{const s=Object.create(Ar);On.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t));const a=t&&t.message?t.message:"Error",u=null==e&&t?t.code:e;return Er.call(s,a,u,n,r,o),t&&null==s.cause&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",i&&Object.assign(s,i),s};function Sr(t){return On.isPlainObject(t)||On.isArray(t)}function Rr(t){return On.endsWith(t,"[]")?t.slice(0,-2):t}function _r(t,e,n){return t?t.concat(e).map((function(t,e){return t=Rr(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const Tr=On.toFlatObject(On,{},null,(function(t){return/^is[A-Z]/.test(t)}));function xr(t,e,n){if(!On.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=On.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!On.isUndefined(e[t])}))).metaTokens,o=n.visitor||c,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&On.isSpecCompliantForm(e);if(!On.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(On.isDate(t))return t.toISOString();if(On.isBoolean(t))return t.toString();if(!a&&On.isBlob(t))throw new Er("Blob is not supported. Use a Buffer instead.");return On.isArrayBuffer(t)||On.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):In.from(t):t}function c(t,n,o){let a=t;if(t&&!o&&"object"==typeof t)if(On.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(On.isArray(t)&&function(t){return On.isArray(t)&&!t.some(Sr)}(t)||(On.isFileList(t)||On.endsWith(n,"[]"))&&(a=On.toArray(t)))return n=Rr(n),a.forEach((function(t,r){!On.isUndefined(t)&&null!==t&&e.append(!0===s?_r([n],r,i):null===s?n:n+"[]",u(t))})),!1;return!!Sr(t)||(e.append(_r(o,n,i),u(t)),!1)}const l=[],f=Object.assign(Tr,{defaultVisitor:c,convertValue:u,isVisitable:Sr});if(!On.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!On.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),On.forEach(n,(function(n,i){!0===(!(On.isUndefined(n)||null===n)&&o.call(e,n,On.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e}function Ur(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Pr(t,e){this._pairs=[],t&&xr(t,this,e)}const Cr=Pr.prototype;function Br(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jr(t,e,n){if(!e)return t;const r=n&&n.encode||Br;On.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(e,n):On.isURLSearchParams(e)?e.toString():new Pr(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}Cr.append=function(t,e){this._pairs.push([t,e])},Cr.toString=function(t){const e=t?function(e){return t.call(this,e,Ur)}:Ur;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};class kr{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){On.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}var Lr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Pr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ir="undefined"!=typeof window&&"undefined"!=typeof document,$r="object"==typeof navigator&&navigator||void 0,zr=Ir&&(!$r||["ReactNative","NativeScript","NS"].indexOf($r.product)<0),Fr="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Mr=Ir&&window.location.href||"http://localhost";var Dr={...Object.freeze({__proto__:null,hasBrowserEnv:Ir,hasStandardBrowserEnv:zr,hasStandardBrowserWebWorkerEnv:Fr,navigator:$r,origin:Mr}),...Nr};function qr(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=t.length;if(i=!i&&On.isArray(r)?r.length:i,a)return On.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&On.isObject(r[i])||(r[i]=[]);return e(t,n,r[i],o)&&On.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!s}if(On.isFormData(t)&&On.isFunction(t.entries)){const n={};return On.forEachEntry(t,((t,r)=>{e(function(t){return On.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const Hr={transitional:Lr,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=On.isObject(t);o&&On.isHTMLForm(t)&&(t=new FormData(t));if(On.isFormData(t))return r?JSON.stringify(qr(t)):t;if(On.isArrayBuffer(t)||On.isBuffer(t)||On.isStream(t)||On.isFile(t)||On.isBlob(t)||On.isReadableStream(t))return t;if(On.isArrayBufferView(t))return t.buffer;if(On.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return xr(t,new Dr.classes.URLSearchParams,{visitor:function(t,e,n,r){return Dr.isNode&&On.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((i=On.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return xr(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t,e,n){if(On.isString(t))try{return(e||JSON.parse)(t),On.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Hr.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(On.isResponse(t)||On.isReadableStream(t))return t;if(t&&On.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(t){if(n){if("SyntaxError"===t.name)throw Er.from(t,Er.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};On.forEach(["delete","get","head","post","put","patch"],(t=>{Hr.headers[t]={}}));const Yr=On.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"]);const Wr=Symbol("internals");function Jr(t){return t&&String(t).trim().toLowerCase()}function Vr(t){return!1===t||null==t?t:On.isArray(t)?t.map(Vr):String(t)}function Kr(t,e,n,r,o){return On.isFunction(r)?r.call(this,e,n):(o&&(e=n),On.isString(e)?On.isString(r)?-1!==e.indexOf(r):On.isRegExp(r)?r.test(e):void 0:void 0)}let Xr=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Jr(e);if(!o)throw new Error("header name must be a non-empty string");const i=On.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=Vr(t))}const i=(t,e)=>On.forEach(t,((t,n)=>o(t,n,e)));if(On.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(On.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Yr[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(On.isObject(t)&&On.isIterable(t)){let n,r,o={};for(const e of t){if(!On.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[r=e[0]]=(n=o[r])?On.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}i(o,e)}else null!=t&&o(e,t,n);return this}get(t,e){if(t=Jr(t)){const n=On.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(On.isFunction(e))return e.call(this,t,n);if(On.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Jr(t)){const n=On.findKey(this,t);return!(!n||void 0===this[n]||e&&!Kr(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=Jr(t)){const o=On.findKey(n,t);!o||e&&!Kr(0,n[o],o,e)||(delete n[o],r=!0)}}return On.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Kr(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return On.forEach(this,((r,o)=>{const i=On.findKey(n,o);if(i)return e[i]=Vr(r),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete e[o],e[s]=Vr(r),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return On.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&On.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[Wr]=this[Wr]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Jr(t);e[r]||(!function(t,e){const n=On.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return On.isArray(t)?t.forEach(r):r(t),this}};function Gr(t,e){const n=this||Hr,r=e||n,o=Xr.from(r.headers);let i=r.data;return On.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Zr(t){return!(!t||!t.__CANCEL__)}function Qr(t,e,n){Er.call(this,null==t?"canceled":t,Er.ERR_CANCELED,e,n),this.name="CanceledError"}function to(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Er("Request failed with status code "+n.status,[Er.ERR_BAD_REQUEST,Er.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Xr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),On.reduceDescriptors(Xr.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),On.freezeMethods(Xr),On.inherits(Qr,Er,{__CANCEL__:!0});const eo=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=r[s];o||(o=u),n[i]=a,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o<e)return;const h=c&&u-c;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(t,e){let n,r,o=0,i=1e3/e;const s=(e,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-o;a>=i?s(t,e):(n=t,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,u=o(a);r=i;t({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&i<=s?(s-i)/u:void 0,event:n,lengthComputable:null!=s,[e?"download":"upload"]:!0})}),n)},no=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},ro=t=>(...e)=>On.asap((()=>t(...e)));var oo=Dr.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Dr.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,io=Dr.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];On.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),On.isString(r)&&s.push("path="+r),On.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function so(t,e,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const ao=t=>t instanceof Xr?{...t}:t;function uo(t,e){e=e||{};const n={};function r(t,e,n,r){return On.isPlainObject(t)&&On.isPlainObject(e)?On.merge.call({caseless:r},t,e):On.isPlainObject(e)?On.merge({},e):On.isArray(e)?e.slice():e}function o(t,e,n,o){return On.isUndefined(e)?On.isUndefined(t)?void 0:r(void 0,t,0,o):r(t,e,0,o)}function i(t,e){if(!On.isUndefined(e))return r(void 0,e)}function s(t,e){return On.isUndefined(e)?On.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e,n)=>o(ao(t),ao(e),0,!0)};return On.forEach(Object.keys({...t,...e}),(function(r){const i=u[r]||o,s=i(t[r],e[r],r);On.isUndefined(s)&&i!==a||(n[r]=s)})),n}var co=t=>{const e=uo({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;if(e.headers=s=Xr.from(s),e.url=jr(so(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),On.isFormData(n))if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(On.isFunction(n.getHeaders)){const t=n.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach((([t,n])=>{e.includes(t.toLowerCase())&&s.set(t,n)}))}if(Dr.hasStandardBrowserEnv&&(r&&On.isFunction(r)&&(r=r(e)),r||!1!==r&&oo(e.url))){const t=o&&i&&io.read(i);t&&s.set(o,t)}return e};var lo="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=co(t);let o=r.data;const i=Xr.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:h,onDownloadProgress:d}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const r=Xr.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());to((function(t){e(t),p()}),(function(t){n(t),p()}),{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:t,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new Er("Request aborted",Er.ECONNABORTED,t,g)),g=null)},g.onerror=function(e){const r=new Er(e&&e.message?e.message:"Network Error",Er.ERR_NETWORK,t,g);r.event=e||null,n(r),g=null},g.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Lr;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new Er(e,o.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,t,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&On.forEach(i.toJSON(),(function(t,e){g.setRequestHeader(e,t)})),On.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),d&&([u,l]=eo(d,!0),g.addEventListener("progress",u)),h&&g.upload&&([a,c]=eo(h),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=e=>{g&&(n(!e||e.type?new Qr(null,t,g):e),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);m&&-1===Dr.protocols.indexOf(m)?n(new Er("Unsupported protocol "+m+":",Er.ERR_BAD_REQUEST,t)):g.send(o||null)}))};const fo=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,s();const e=t instanceof Error?t:this.reason;r.abort(e instanceof Er?e:new Qr(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new Er(`timeout ${e} of ms exceeded`,Er.ETIMEDOUT))}),e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>On.asap(s),a}},ho=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},po=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},go=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of po(t))yield*ho(n,e)}(t,e);let i,s=0,a=t=>{i||(i=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return a(),void t.close();let i=r.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:t=>(a(t),o.return())},{highWaterMark:2})},{isFunction:yo}=On,mo=(({Request:t,Response:e})=>({Request:t,Response:e}))(On.global),{ReadableStream:bo,TextEncoder:wo}=On.global,vo=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Eo=t=>{t=On.merge.call({skipUndefined:!0},mo,t);const{fetch:e,Request:n,Response:r}=t,o=e?yo(e):"function"==typeof fetch,i=yo(n),s=yo(r);if(!o)return!1;const a=o&&yo(bo),u=o&&("function"==typeof wo?(t=>e=>t.encode(e))(new wo):async t=>new Uint8Array(await new n(t).arrayBuffer())),c=i&&a&&vo((()=>{let t=!1;const e=new n(Dr.origin,{body:new bo,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),l=s&&a&&vo((()=>On.isReadableStream(new r("").body))),f={stream:l&&(t=>t.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!f[t]&&(f[t]=(e,n)=>{let r=e&&e[t];if(r)return r.call(e);throw new Er(`Response type '${t}' is not supported`,Er.ERR_NOT_SUPPORT,n)})}));const h=async(t,e)=>{const r=On.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(On.isBlob(t))return t.size;if(On.isSpecCompliantForm(t)){const e=new n(Dr.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return On.isArrayBufferView(t)||On.isArrayBuffer(t)?t.byteLength:(On.isURLSearchParams(t)&&(t+=""),On.isString(t)?(await u(t)).byteLength:void 0)})(e):r};return async t=>{let{url:o,method:s,data:a,signal:u,cancelToken:d,timeout:p,onDownloadProgress:g,onUploadProgress:y,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=co(t),E=e||fetch;m=m?(m+"").toLowerCase():"text";let A=fo([u,d&&d.toAbortSignal()],p),O=null;const S=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let R;try{if(y&&c&&"get"!==s&&"head"!==s&&0!==(R=await h(b,a))){let t,e=new n(o,{method:"POST",body:a,duplex:"half"});if(On.isFormData(a)&&(t=e.headers.get("content-type"))&&b.setContentType(t),e.body){const[t,n]=no(R,eo(ro(y)));a=go(e.body,65536,t,n)}}On.isString(w)||(w=w?"include":"omit");const e=i&&"credentials"in n.prototype,u={...v,signal:A,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:e?w:void 0};O=i&&new n(o,u);let d=await(i?E(O,v):E(o,u));const p=l&&("stream"===m||"response"===m);if(l&&(g||p&&S)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=d[e]}));const e=On.toFiniteNumber(d.headers.get("content-length")),[n,o]=g&&no(e,eo(ro(g),!0))||[];d=new r(go(d.body,65536,n,(()=>{o&&o(),S&&S()})),t)}m=m||"text";let _=await f[On.findKey(f,m)||"text"](d,t);return!p&&S&&S(),await new Promise(((e,n)=>{to(e,n,{data:_,headers:Xr.from(d.headers),status:d.status,statusText:d.statusText,config:t,request:O})}))}catch(e){if(S&&S(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new Er("Network Error",Er.ERR_NETWORK,t,O),{cause:e.cause||e});throw Er.from(e,e&&e.code,t,O)}}},Ao=new Map,Oo=t=>{let e=t?t.env:{};const{fetch:n,Request:r,Response:o}=e,i=[r,o,n];let s,a,u=i.length,c=Ao;for(;u--;)s=i[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:Eo(e)),c=a;return a};Oo();const So={http:null,xhr:lo,fetch:{get:Oo}};On.forEach(So,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ro=t=>`- ${t}`,_o=t=>On.isFunction(t)||null===t||!1===t;var To=(t,e)=>{t=On.isArray(t)?t:[t];const{length:n}=t;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=t[s],o=r,!_o(r)&&(o=So[(n=String(r)).toLowerCase()],void 0===o))throw new Er(`Unknown adapter '${n}'`);if(o&&(On.isFunction(o)||(o=o.get(e))))break;i[n||"#"+s]=o}if(!o){const t=Object.entries(i).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new Er("There is no suitable adapter to dispatch the request "+(n?t.length>1?"since :\n"+t.map(Ro).join("\n"):" "+Ro(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function xo(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Qr(null,t)}function Uo(t){xo(t),t.headers=Xr.from(t.headers),t.data=Gr.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return To(t.adapter||Hr.adapter,t)(t).then((function(e){return xo(t),e.data=Gr.call(t,t.transformResponse,e),e.headers=Xr.from(e.headers),e}),(function(e){return Zr(e)||(xo(t),e&&e.response&&(e.response.data=Gr.call(t,t.transformResponse,e.response),e.response.headers=Xr.from(e.response.headers))),Promise.reject(e)}))}const Po="1.12.2",Co={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Co[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Bo={};Co.transitional=function(t,e,n){function r(t,e){return"[Axios v"+Po+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new Er(r(o," has been removed"+(e?" in "+e:"")),Er.ERR_DEPRECATED);return e&&!Bo[o]&&(Bo[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,i)}},Co.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};var jo={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Er("options must be an object",Er.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const e=t[i],n=void 0===e||s(e,i,t);if(!0!==n)throw new Er("option "+i+" must be "+n,Er.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Er("Unknown option "+i,Er.ERR_BAD_OPTION)}},validators:Co};const ko=jo.validators;let Lo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new kr,response:new kr}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=uo(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&jo.assertOptions(n,{silentJSONParsing:ko.transitional(ko.boolean),forcedJSONParsing:ko.transitional(ko.boolean),clarifyTimeoutError:ko.transitional(ko.boolean)},!1),null!=r&&(On.isFunction(r)?e.paramsSerializer={serialize:r}:jo.assertOptions(r,{encode:ko.function,serialize:ko.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),jo.assertOptions(e,{baseUrl:ko.spelling("baseURL"),withXsrfToken:ko.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&On.merge(o.common,o[e.method]);o&&On.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Xr.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,f=0;if(!a){const t=[Uo.bind(this),void 0];for(t.unshift(...s),t.push(...u),l=t.length,c=Promise.resolve(e);f<l;)c=c.then(t[f++],t[f++]);return c}l=s.length;let h=e;for(;f<l;){const t=s[f++],e=s[f++];try{h=t(h)}catch(t){e.call(this,t);break}}try{c=Uo.call(this,h)}catch(t){return Promise.reject(t)}for(f=0,l=u.length;f<l;)c=c.then(u[f++],u[f++]);return c}getUri(t){return jr(so((t=uo(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};On.forEach(["delete","get","head","options"],(function(t){Lo.prototype[t]=function(e,n){return this.request(uo(n||{},{method:t,url:e,data:(n||{}).data}))}})),On.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(uo(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Lo.prototype[t]=e(),Lo.prototype[t+"Form"]=e(!0)}));const No={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(No).forEach((([t,e])=>{No[e]=t}));const Io=function t(e){const n=new Lo(e),r=Be(Lo.prototype.request,n);return On.extend(r,Lo.prototype,n,{allOwnKeys:!0}),On.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(uo(e,n))},r}(Hr);Io.Axios=Lo,Io.CanceledError=Qr,Io.CancelToken=class t{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Qr(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let e;return{token:new t((function(t){e=t})),cancel:e}}},Io.isCancel=Zr,Io.VERSION=Po,Io.toFormData=xr,Io.AxiosError=Er,Io.Cancel=Io.CanceledError,Io.all=function(t){return Promise.all(t)},Io.spread=function(t){return function(e){return t.apply(null,e)}},Io.isAxiosError=function(t){return On.isObject(t)&&!0===t.isAxiosError},Io.mergeConfig=uo,Io.AxiosHeaders=Xr,Io.formToJSON=t=>qr(On.isHTMLForm(t)?new FormData(t):t),Io.getAdapter=To,Io.HttpStatusCode=No,Io.default=Io;const{Axios:$o,AxiosError:zo,CanceledError:Fo,isCancel:Mo,CancelToken:Do,VERSION:qo,all:Ho,Cancel:Yo,isAxiosError:Wo,spread:Jo,toFormData:Vo,AxiosHeaders:Ko,HttpStatusCode:Xo,formToJSON:Go,getAdapter:Zo,mergeConfig:Qo}=Io;class ti{constructor(){this.promiseWrapper=new Promise(((t,e)=>{this._resolve=t,this._reject=e})),this._restScope=["success","failure","error","login","timeout"];for(let t=0;t<this._restScope.length;t++){const e=this._restScope[t];e&&(this.promiseWrapper[e]=t=>{"function"==typeof t&&(this[`_${e}`]=t);const n=this.promiseWrapper;delete n[e];const r=this._restScope.slice();return r.splice(r.indexOf(e),1),r.every((t=>!!t&&!n[t]))&&delete n.rest,n})}this.promiseWrapper.rest=(t,e)=>{"function"==typeof t&&(this._rest=t);const n=this.promiseWrapper;if(delete n.rest,this._restScope=e||this._restScope,0===this._restScope.length)console.warn('[1Money client]: The ".rest(cb, scope)" scope is empty and will never be triggered!');else{let t=0;this._restScope.forEach((e=>{e&&(n[e]?delete n[e]:t++)})),t===this._restScope.length&&console.warn(`[1Money client]: The "${this._restScope.join(", ")}" had been called and the "rest" will never be triggered!`)}return n}}}const ei=new class{constructor(t){this._config=t||{},this.axios=Io,this.parseError=this.parseError.bind(this),this.setting=this.setting.bind(this),this.request=this.request.bind(this)}parseError(t){var e,n,r,o,i,s,a,u,c;"string"==typeof t&&(t=new Error(t)),(!t||"object"!==Q(t)&&"error"!==Q(t))&&(t=new Error("Unknown error occurred"));const l=null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"Error",f=null!==(o=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:null===(r=null==t?void 0:t.toString)||void 0===r?void 0:r.call(t))&&void 0!==o?o:"Unknown error",h=null!==(i=null==t?void 0:t.stack)&&void 0!==i?i:"",d=null!==(a=null===(s=null==t?void 0:t.response)||void 0===s?void 0:s.status)&&void 0!==a?a:500,p=null!==(c=null===(u=null==t?void 0:t.response)||void 0===u?void 0:u.data)&&void 0!==c?c:void 0;return"number"!=typeof d||d<100||d>599?{name:"InvalidStatusError",message:"Invalid HTTP status code",stack:h,status:500,data:p}:{name:l,message:f,stack:h,status:d,data:p}}setting(t){if(!t)return console.warn("[1Money client]: setting method required correct parameters!");this._config=Object.assign(Object.assign({},this._config),t)}request(t){t.withCredentials="boolean"!=typeof t.withCredentials||t.withCredentials,t.headers=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),t.method?this.axios.defaults.headers[t.method]:{}),t.headers),t.headers.Accept=t.headers.Accept||"*/*",t.headers["X-Requested-With"]=t.headers["X-Requested-With"]||"XMLHttpRequest",t.headers["X-Content-Type-Options"]=t.headers["X-Content-Type-Options"]||"nosniff";const{onSuccess:n,onFailure:r,onLogin:o,onError:i,onTimeout:s,isSuccess:a,isLogin:u,timeout:c}=this._config,{onSuccess:l,onFailure:f,onLogin:h,onError:d,onTimeout:p,isSuccess:g,isLogin:y,timeout:m}=t,b={success:null!=g?g:a,login:null!=y?y:u},w=new ti;return Promise.resolve().then((()=>{var a,u,g,y,v,E,A,O,S,R,_,T,x,U,P,C,B,j,k,L;const N={success:null!==(y=null!==(g=null!==(u=null!==(a=w._success)&&void 0!==a?a:~w._restScope.indexOf("success")?w._rest:void 0)&&void 0!==u?u:l)&&void 0!==g?g:n)&&void 0!==y?y:(t,e)=>t,failure:null!==(O=null!==(A=null!==(E=null!==(v=w._failure)&&void 0!==v?v:~w._restScope.indexOf("failure")?w._rest:void 0)&&void 0!==E?E:f)&&void 0!==A?A:r)&&void 0!==O?O:(t,e)=>t,error:null!==(T=null!==(_=null!==(R=null!==(S=w._error)&&void 0!==S?S:~w._restScope.indexOf("error")?w._rest:void 0)&&void 0!==R?R:d)&&void 0!==_?_:i)&&void 0!==T?T:(t,e)=>t,login:null!==(C=null!==(P=null!==(U=null!==(x=w._login)&&void 0!==x?x:~w._restScope.indexOf("login")?w._rest:void 0)&&void 0!==U?U:h)&&void 0!==P?P:o)&&void 0!==C?C:(t,e)=>t,timeout:null!==(L=null!==(k=null!==(j=null!==(B=w._timeout)&&void 0!==B?B:~w._restScope.indexOf("timeout")?w._rest:void 0)&&void 0!==j?j:p)&&void 0!==k?k:s)&&void 0!==L?L:(t,e)=>t},I=(w._success||w._rest&&w._restScope.indexOf("success"),w._failure||w._rest&&w._restScope.indexOf("failure"),w._login||w._rest&&w._restScope.indexOf("login"),!!(w._error||w._rest&&~w._restScope.indexOf("error")||d||i)),$=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")||p||s),z=!!(w._success||w._rest&&~w._restScope.indexOf("success")),F=!!(w._failure||w._rest&&~w._restScope.indexOf("failure")),M=!!(w._login||w._rest&&~w._restScope.indexOf("login")),D=!!(w._error||w._rest&&~w._restScope.indexOf("error")),q=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")),H=(t,n)=>e(this,void 0,void 0,(function*(){try{let e=this.parseError(t);const r=yield Promise.resolve(N.error(e,n));D&&(e=r),I?w._resolve(e):w._reject(e)}catch(t){w._reject(this.parseError(t))}}));let Y=null,W=!1;const J=null!=m?m:c,V=()=>{null!==Y&&(clearTimeout(Y),Y=null)};J&&(Y=setTimeout((()=>e(this,void 0,void 0,(function*(){var e,n;try{W=!0,V();let n=this.parseError("timeout");const r=yield Promise.resolve(N.timeout(n,null!==(e=t.headers)&&void 0!==e?e:{}));q&&(n=r),$?w._resolve(n):w._reject(n)}catch(e){H(e,null!==(n=t.headers)&&void 0!==n?n:{})}}))),J)),this.axios(t).then((t=>e(this,void 0,void 0,(function*(){var e,n;if(W)return;V();const{status:r,data:o,headers:i}=t;try{const t=null===(e=b.success)||void 0===e?void 0:e.call(b,o,r,i),s=null===(n=b.login)||void 0===n?void 0:n.call(b,o,r,i);let a=o;if(s){const t=yield Promise.resolve(N.login(o,i));M&&(a=t)}else if(t){const t=yield Promise.resolve(N.success(o,i));z&&(a=t)}else{const t=yield Promise.resolve(N.failure(o,i));F&&(a=t)}w._resolve(a)}catch(t){H(t,i)}})))).catch((t=>e(this,void 0,void 0,(function*(){var e,n,r,o,i,s,a,u,c,l,f,h,d,p,g,y,m,v;if(W)return;V();const E=null!==(n=null===(e=t.response)||void 0===e?void 0:e.data)&&void 0!==n?n:{};console.error(`[1Money client]: Error(${null!==(r=t.status)&&void 0!==r?r:500}, ${null!==(o=t.code)&&void 0!==o?o:"UNKNOWN"}), Message: ${t.message}, Config: ${null===(i=t.config)||void 0===i?void 0:i.method}, ${null!==(a=null===(s=t.config)||void 0===s?void 0:s.baseURL)&&void 0!==a?a:""}, ${null!==(c=null===(u=t.config)||void 0===u?void 0:u.url)&&void 0!==c?c:""}, ${JSON.stringify(null!==(f=null===(l=t.config)||void 0===l?void 0:l.headers)&&void 0!==f?f:{})}, Request: ${JSON.stringify(null!==(d=null===(h=t.config)||void 0===h?void 0:h.data)&&void 0!==d?d:{})}, Response: ${JSON.stringify(E)};`);const A=null!==(g=null===(p=t.response)||void 0===p?void 0:p.status)&&void 0!==g?g:500,O=null!==(m=null===(y=t.response)||void 0===y?void 0:y.headers)&&void 0!==m?m:{};try{let e=E;(null===(v=b.login)||void 0===v?void 0:v.call(b,E,A,O))?(e=yield Promise.resolve(N.login(e,O)),w._resolve(e)):H(t,O)}catch(t){H(t,O)}}))))})),w.promiseWrapper}}({isSuccess:(t,e)=>200===e&&0==t.code,isLogin:(t,e)=>401===e||401==t.code,timeout:1e4});function ni(t,e){return ei.request(Object.assign(Object.assign({},e),{method:"get",url:t}))}function ri(t,e,n){return ei.request(Object.assign(Object.assign({},n),{method:"post",url:t,data:e,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))}function oi(t){const{baseURL:e,headers:n}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["baseURL","headers"]);ei.axios.defaults.baseURL=e||("undefined"!=typeof window?location.origin:void 0),n&&(ei.axios.defaults.headers.common=Object.assign(Object.assign({},ei.axios.defaults.headers.common),n)),ei.setting(r)}var ii={get:ni,post:ri,postForm:function(t,e,n){return ei.request(Object.assign(Object.assign({},n),{method:"post",url:t,data:e,headers:Object.assign({"Content-Type":"multipart/form-data"},null==n?void 0:n.headers)}))},del:function(t,e,n){return ei.request(Object.assign(Object.assign({},n),{method:"delete",url:t,data:e,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},put:function(t,e,n){return ei.request(Object.assign(Object.assign({},n),{method:"put",url:t,data:e,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},patch:function(t,e,n){return ei.request(Object.assign(Object.assign({},n),{method:"patch",url:t,data:e,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},setInitConfig:oi,axiosStatic:ei.axios};const si="https://api.1money.network",ai="v1",ui=`/${ai}/accounts`,ci={getNonce:t=>ni(`${ui}/nonce?address=${t}`,{withCredentials:!1}),getBbNonce:t=>ni(`${ui}/bbnonce?address=${t}`,{withCredentials:!1}),getTokenAccount:(t,e)=>ni(`${ui}/token_account?address=${t}&token=${e}`,{withCredentials:!1})},li=`/${ai}/checkpoints`,fi={getNumber:()=>ni(`${li}/number`,{withCredentials:!1}),getByHash:(t,e=!1)=>ni(`${li}/by_hash?hash=${t}&full=${e}`,{withCredentials:!1}),getByNumber:(t,e=!1)=>ni(`${li}/by_number?number=${t}&full=${e}`,{withCredentials:!1}),getReceiptsByNumber:t=>ni(`${li}/receipts/by_number?number=${t}`,{withCredentials:!1})},hi=`/${ai}/tokens`,di={getTokenMetadata:t=>ni(`${hi}/token_metadata?token=${t}`,{withCredentials:!1}),manageBlacklist:t=>ri(`${hi}/manage_blacklist`,t,{withCredentials:!1}),manageWhitelist:t=>ri(`${hi}/manage_whitelist`,t,{withCredentials:!1}),burnToken:t=>ri(`${hi}/burn`,t,{withCredentials:!1}),grantAuthority:t=>ri(`${hi}/grant_authority`,t,{withCredentials:!1}),issueToken:t=>ri(`${hi}/issue`,t,{withCredentials:!1}),mintToken:t=>ri(`${hi}/mint`,t,{withCredentials:!1}),pauseToken:t=>ri(`${hi}/pause`,t,{withCredentials:!1}),updateMetadata:t=>ri(`${hi}/update_metadata`,t,{withCredentials:!1}),bridgeAndMint:t=>ri(`${hi}/bridge_and_mint`,t,{withCredentials:!1}),burnAndBridge:t=>ri(`${hi}/burn_and_bridge`,t,{withCredentials:!1})},pi=`/${ai}/transactions`,gi={getByHash:t=>ni(`${pi}/by_hash?hash=${t}`,{withCredentials:!1}),getReceiptByHash:t=>ni(`${pi}/receipt/by_hash?hash=${t}`,{withCredentials:!1}),getFinalizedByHash:t=>ni(`${pi}/finalized/by_hash?hash=${t}`,{withCredentials:!1}),estimateFee:(t,e,n)=>{let r=`${pi}/estimate_fee?from=${t}&value=${e}`;return n&&(r+=`&token=${n}`),ni(r,{withCredentials:!1})},payment:t=>ri(`${pi}/payment`,t,{withCredentials:!1})},yi=`/${ai}/chains`,mi={getChainId:()=>ni(`${yi}/chain_id`,{withCredentials:!1})};var bi,wi,vi,Ei;function Ai(t){const e=(null==t?void 0:t.network)||"mainnet";let n=si;switch(e){case"mainnet":n=si;break;case"testnet":n="https://api.testnet.1money.network";break;case"local":n="http://localhost:18555"}return oi({baseURL:n,isSuccess:(t,e)=>200===e,timeout:(null==t?void 0:t.timeout)||1e4}),{accounts:ci,checkpoints:fi,tokens:di,transactions:gi,chain:mi}}!function(t){t.MasterMint="MasterMintBurn",t.MintBurnTokens="MintBurnTokens",t.Pause="Pause",t.ManageList="ManageList",t.UpdateMetadata="UpdateMetadata",t.Bridge="Bridge"}(bi||(bi={})),function(t){t.Grant="Grant",t.Revoke="Revoke"}(wi||(wi={})),function(t){t.Add="Add",t.Remove="Remove"}(vi||(vi={})),function(t){t.Pause="Pause",t.Unpause="Unpause"}(Ei||(Ei={}));var Oi={api:Ai,client:ii};t._typeof=Q,t.api=Ai,t.calcTxHash=function(t,e){const n=ye(t),r=lt("boolean"==typeof e.v?e.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(e.v)),o=lt(S(e.r)),i=lt(S(e.s)),s=new Uint8Array(r.length+o.length+i.length);s.set(r,0),s.set(o,r.length),s.set(i,r.length+o.length);const a=function(t){if(t<56)return Uint8Array.from([192+t]);{const e=[];let n=t;for(;n>0;)e.unshift(255&n),n>>=8;return Uint8Array.from([247+e.length,...e])}}(n.length+s.length),u=new Uint8Array(a.length+n.length+s.length);return u.set(a,0),u.set(n,a.length),u.set(s,a.length+n.length),Z(u)},t.client=ii,t.default=Oi,t.deriveTokenAddress=function(t,e){const n=t.startsWith("0x")?S(t):R(t),r=e.startsWith("0x")?S(e):R(e),o=new Uint8Array(n.length+r.length);return o.set(n,0),o.set(r,n.length),y(S(Z(o)).slice(12))},t.encodePayload=ye,t.safePromiseAll=function(t){return t&&t.length?Promise.all(t):Promise.resolve([])},t.safePromiseLine=function(t){return e(this,void 0,void 0,(function*(){if(!t||!t.length)return[];const e=[];for(let n=0;n<t.length;n++)try{e.push(yield t[n](n))}catch(t){}return e}))},t.signMessage=function(t,n){return e(this,void 0,void 0,(function*(){const e=S(Z(ye(t))),r=S(n),o=yield ce(e,r,{lowS:!0}),i=o.toCompactRawBytes(),s=i.subarray(0,32),a=i.subarray(32,64);return{r:y(s),s:y(a),v:o.recovery}}))},t.toHex=function(t){const e=Q(t);try{switch(e){case"boolean":return g(t);case"number":case"bigint":return m(t);case"string":if(/^-?\d+$/.test(t))try{return m(BigInt(t))}catch(e){return m(+t)}return w(t);case"uint8array":case"uint16array":case"uint32array":case"int8array":case"int16array":case"int32array":case"arraybuffer":return y(t);case"array":return 0===t.length?"0x":t.every((t=>"number"==typeof t))?y(Uint8Array.from(t)):y(R(JSON.stringify(t)));default:return y(R(JSON.stringify(t)))}}catch(t){return console.error("[1Money toHex]: ",t),"0x"}},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).$1money={})}(this,(function(e){"use strict";function t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function n(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function r(e){return n(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}"function"==typeof SuppressedError&&SuppressedError;const i="2.30.0";let o=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,s=`viem@${i}`;class a extends Error{constructor(e,t={}){const n=t.cause instanceof a?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof a&&t.cause.docsPath||t.docsPath,u=o?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...u?[`Docs: ${u}`]:[],...n?[`Details: ${n}`]:[],...s?[`Version: ${s}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=i}walk(e){return u(this,e)}}function u(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?u(e.cause,t):t?null:e}class c extends a{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function l(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new c({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new c({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}class f extends a{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class h extends a{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function d(e,{size:t}){if(r(e)>t)throw new h({givenSize:r(e),maxSize:t})}const p=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function g(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(d(n,{size:t.size}),l(n,{size:t.size})):n}function y(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=p[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(d(r,{size:t.size}),l(r,{dir:"right",size:t.size})):r}function m(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&i>o||i<s){const t="bigint"==typeof e?"n":"";throw new f({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16)}`;return r?l(a,{size:r}):a}const b=new TextEncoder;function w(e,t={}){return y(b.encode(e),t)}const v=new TextEncoder;function E(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=m(e,t);return _(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return d(n,{size:t.size}),l(n,{size:t.size});return n}(e,t):n(e)?_(e,t):S(e,t)}const A={zero:48,nine:57,A:65,F:70,a:97,f:102};function O(e){return e>=A.zero&&e<=A.nine?e-A.zero:e>=A.A&&e<=A.F?e-(A.A-10):e>=A.a&&e<=A.f?e-(A.a-10):void 0}function _(e,t={}){let n=e;t.size&&(d(n,{size:t.size}),n=l(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,o=new Uint8Array(i);for(let e=0,t=0;e<i;e++){const n=O(r.charCodeAt(t++)),i=O(r.charCodeAt(t++));if(void 0===n||void 0===i)throw new a(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);o[e]=16*n+i}return o}function S(e,t={}){const n=v.encode(e);return"number"==typeof t.size?(d(n,{size:t.size}),l(n,{dir:"right",size:t.size})):n}function R(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function x(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function T(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const k=BigInt(2**32-1),U=BigInt(32);function B(e,t=!1){return t?{h:Number(e&k),l:Number(e>>U&k)}:{h:0|Number(e>>U&k),l:0|Number(e&k)}}function P(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=B(e[i],t);[n[i],r[i]]=[o,s]}return[n,r]}const C=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function j(e){for(let n=0;n<e.length;n++)e[n]=(t=e[n])<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;var t}function L(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),x(e),e}"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex;class N{clone(){return this._cloneInto()}}const F=[],$=[],I=[],M=BigInt(0),z=BigInt(1),D=BigInt(2),q=BigInt(7),H=BigInt(256),Y=BigInt(113);for(let e=0,t=z,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],F.push(2*(5*r+n)),$.push((e+1)*(e+2)/2%64);let i=M;for(let e=0;e<7;e++)t=(t<<z^(t>>q)*Y)%H,t&D&&(i^=z<<(z<<BigInt(e))-z);I.push(i)}const[K,W]=P(I,!0),J=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),V=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)
|
|
2
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class X extends N{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,R(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){C||j(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,o=n[i],s=n[i+1],a=J(o,s,1)^n[r],u=V(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=$[n],o=J(t,i,r),s=V(t,i,r),a=F[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=K[r],e[1]^=W[r]}n.fill(0)}(this.state32,this.rounds),C||j(this.state32),this.posOut=0,this.pos=0}update(e){T(this);const{blockLen:t,state:n}=this,r=(e=L(e)).length;for(let i=0;i<r;){const o=Math.min(t-this.pos,r-i);for(let t=0;t<o;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){T(this,!1),x(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return R(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){x(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new X(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const G=((e,t,n)=>function(e){const t=t=>e().update(L(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}((()=>new X(t,e,n))))(1,136,32);function Z(e,t){const r=t||"hex",i=G(n(e,{strict:!1})?E(e):e);return"bytes"===r?i:function(e,t={}){return"number"==typeof e||"bigint"==typeof e?m(e,t):"string"==typeof e?w(e,t):"boolean"==typeof e?g(e,t):y(e,t)}(i)}class Q extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const ee=new Q(8192);const te=/^0x[a-fA-F0-9]{40}$/,ne=new Q(8192);function re(e,t){const{strict:n=!0}={},r=`${e}.${n}`;if(ne.has(r))return ne.get(r);const i=!(!te.test(e)||e.toLowerCase()!==e&&n&&function(e,t){if(ee.has(`${e}.${t}`))return ee.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Z(S(n),"bytes"),i=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());const o=`0x${i.join("")}`;return ee.set(`${e}.${t}`,o),o}(e)!==e);return ne.set(r,i),i}class ie extends Error{constructor(e,t,n){super(t??e.code),this.type=e,void 0!==n&&(this.stack=n)}getMetadata(){return this.type}toObject(){return{type:this.getMetadata(),message:this.message??"",stack:this.stack??"",className:this.constructor.name}}}function oe(e,t){return new ie({code:"ETHEREUMJS_DEFAULT_ERROR_CODE"},e,t)}function se(e){if(0===e[0])throw oe("invalid RLP: extra zeros");return function(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw oe("Invalid byte sequence");return t}(function(e){let t="";for(let n=0;n<e.length;n++)t+=le[e[n]];return t}(e))}function ae(e,t){if(e<56)return Uint8Array.from([e+t]);const n=ge(e),r=ge(t+55+n.length/2);return Uint8Array.from(de(r+n))}function ue(e,t,n){if(n>e.length)throw oe("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function ce(e){let t,n,r,i,o;const s=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.subarray(1)};if(a<=183){if(t=a-127,r=128===a?Uint8Array.from([]):ue(e,1,t),2===t&&r[0]<128)throw oe("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:e.subarray(t)}}if(a<=191){if(n=a-182,e.length-1<n)throw oe("invalid RLP: not enough bytes for string length");if(t=se(ue(e,1,n)),t<=55)throw oe("invalid RLP: expected string length to be greater than 55");return r=ue(e,n,t+n),{data:r,remainder:e.subarray(t+n)}}if(a<=247){for(t=a-191,i=ue(e,1,t);i.length;)o=ce(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(t)}}{if(n=a-246,t=se(ue(e,1,n)),t<56)throw oe("invalid RLP: encoded list too short");const r=n+t;if(r>e.length)throw oe("invalid RLP: total length is larger than the data");for(i=ue(e,n,r);i.length;)o=ce(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(r)}}}const le=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const fe={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function he(e){return e>=fe._0&&e<=fe._9?e-fe._0:e>=fe._A&&e<=fe._F?e-(fe._A-10):e>=fe._a&&e<=fe._f?e-(fe._a-10):void 0}function de(e){if("0x"===e.slice(0,2)&&(e=e.slice(0,2)),"string"!=typeof e)throw oe("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw oe("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=he(e.charCodeAt(i)),o=he(e.charCodeAt(i+1));if(void 0===n||void 0===o){throw oe('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i)}r[t]=16*n+o}return r}function pe(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}function ge(e){if(e<0)throw oe("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function ye(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function me(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return ye(e)?de((n="string"!=typeof(r=e)?r:ye(r)?r.slice(2):r).length%2?`0${n}`:n):(t=e,(new TextEncoder).encode(t));var t,n,r;if("number"==typeof e||"bigint"==typeof e)return e?de(ge(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw oe("toBytes: received unsupported type "+typeof e)}function be(e){if(Array.isArray(e)){const t=[];let n=0;for(let r=0;r<e.length;r++){const i=be(e[r]);t.push(i),n+=i.length}return pe(ae(n,192),...t)}const t=me(e);return 1===t.length&&t[0]<128?t:pe(ae(t.length,128),t)}function we(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const n=ce(me(e));if(t)return{data:n.data,remainder:n.remainder.slice()};if(0!==n.remainder.length)throw oe("invalid RLP: remainder must be zero");return n.data}const ve=/^0x[0-9a-fA-F]{40}$/,Ee=/^0x([0-9a-fA-F]{2})*$/;function Ae(e){if(null==e)return new Uint8Array([]);switch(e.kind){case"string":return(new TextEncoder).encode(e.value);case"uint":{if("string"==typeof e.value&&!/^\d+$/.test(e.value))throw new Error(`[1Money SDK]: Invalid uint string: ${e.value}`);const t="bigint"==typeof e.value?e.value:BigInt(e.value);return t===BigInt(0)?new Uint8Array([]):_(m(t))}case"bool":return e.value?Uint8Array.from([1]):new Uint8Array([]);case"bytes":return e.value;case"list":return e.value.map((e=>Ae(e)));case"address":case"hex":if(!Ee.test(e.value))throw new Error(`[1Money SDK]: Invalid hex value: ${e.value}`);if("address"===e.kind&&!ve.test(e.value))throw new Error(`[1Money SDK]: Invalid address value: ${e.value}`);return"0x"===e.value?new Uint8Array([]):_(e.value)}}const Oe={address:e=>({kind:"address",value:e}),hex:e=>({kind:"hex",value:e}),string:e=>({kind:"string",value:e}),uint:e=>({kind:"uint",value:e}),bool:e=>({kind:"bool",value:e}),bytes:e=>({kind:"bytes",value:e}),list:e=>({kind:"list",value:e})};function _e(e){return be(Ae(e))}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
|
|
3
|
+
const{p:Se,n:Re,Gx:xe,Gy:Te,b:ke}={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},Ue=32,Be=64,Pe=(e="")=>{throw new Error(e)},Ce=e=>"bigint"==typeof e,je=e=>"string"==typeof e,Le=(e,t)=>!(e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name)(e)||"number"==typeof t&&t>0&&e.length!==t?Pe("Uint8Array expected"):e,Ne=e=>new Uint8Array(e),Fe=(e,t)=>e.toString(16).padStart(t,"0"),$e=e=>Array.from(Le(e)).map((e=>Fe(e,2))).join(""),Ie=48,Me=57,ze=65,De=70,qe=97,He=102,Ye=e=>e>=Ie&&e<=Me?e-Ie:e>=ze&&e<=De?e-(ze-10):e>=qe&&e<=He?e-(qe-10):void 0,Ke=e=>{const t="hex invalid";if(!je(e))return Pe(t);const n=e.length,r=n/2;if(n%2)return Pe(t);const i=Ne(r);for(let n=0,o=0;n<r;n++,o+=2){const r=Ye(e.charCodeAt(o)),s=Ye(e.charCodeAt(o+1));if(void 0===r||void 0===s)return Pe(t);i[n]=16*r+s}return i},We=(e,t)=>{return Le(je(e)?Ke(e):(n=Le(e),Uint8Array.from(n)),t);var n},Je=()=>globalThis?.crypto,Ve=(...e)=>{const t=Ne(e.reduce(((e,t)=>e+Le(t).length),0));let n=0;return e.forEach((e=>{t.set(e,n),n+=e.length})),t},Xe=(e=Ue)=>Je().getRandomValues(Ne(e)),Ge=BigInt,Ze=(e,t,n,r="bad number: out of range")=>Ce(e)&&t<=e&&e<n?e:Pe(r),Qe=(e,t=Se)=>{const n=e%t;return n>=0n?n:t+n},et=e=>Qe(e,Re),tt=(e,t)=>{(0n===e||t<=0n)&&Pe("no inverse n="+e+" mod="+t);let n=Qe(e,t),r=t,i=0n,o=1n;for(;0n!==n;){const e=r%n,t=i-o*(r/n);r=n,n=e,i=o,o=t}return 1n===r?Qe(i,t):Pe("no inverse")},nt=e=>e instanceof lt?e:Pe("Point expected"),rt=e=>Qe(Qe(e*e)*e+ke),it=e=>Ze(e,0n,Se),ot=e=>Ze(e,1n,Se),st=e=>Ze(e,1n,Re),at=e=>0n===(1n&e),ut=e=>Uint8Array.of(e),ct=e=>ut(at(e)?2:3);class lt{static BASE;static ZERO;px;py;pz;constructor(e,t,n){this.px=it(e),this.py=ot(t),this.pz=it(n),Object.freeze(this)}static fromBytes(e){let t;Le(e);const n=e[0],r=e.subarray(1),i=pt(r,0,Ue),o=e.length;if(33===o&&[2,3].includes(n)){let e=(e=>{const t=rt(ot(e));let n=1n;for(let e=t,r=(Se+1n)/4n;r>0n;r>>=1n)1n&r&&(n=n*e%Se),e=e*e%Se;return Qe(n*n)===t?n:Pe("sqrt invalid")})(i);const r=at(e);at(Ge(n))!==r&&(e=Qe(-e)),t=new lt(i,e,1n)}return 65===o&&4===n&&(t=new lt(i,pt(r,Ue,Be),1n)),t?t.assertValidity():Pe("bad point: not on curve")}equals(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=nt(e),a=Qe(t*s),u=Qe(i*r),c=Qe(n*s),l=Qe(o*r);return a===u&&c===l}is0(){return this.equals(ht)}negate(){return new lt(this.px,Qe(-this.py),this.pz)}double(){return this.add(this)}add(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=nt(e);let a=0n,u=0n,c=0n;const l=Qe(3n*ke);let f=Qe(t*i),h=Qe(n*o),d=Qe(r*s),p=Qe(t+n),g=Qe(i+o);p=Qe(p*g),g=Qe(f+h),p=Qe(p-g),g=Qe(t+r);let y=Qe(i+s);return g=Qe(g*y),y=Qe(f+d),g=Qe(g-y),y=Qe(n+r),a=Qe(o+s),y=Qe(y*a),a=Qe(h+d),y=Qe(y-a),c=Qe(0n*g),a=Qe(l*d),c=Qe(a+c),a=Qe(h-c),c=Qe(h+c),u=Qe(a*c),h=Qe(f+f),h=Qe(h+f),d=Qe(0n*d),g=Qe(l*g),h=Qe(h+d),d=Qe(f-d),d=Qe(0n*d),g=Qe(g+d),f=Qe(h*g),u=Qe(u+f),f=Qe(y*g),a=Qe(p*a),a=Qe(a-f),f=Qe(p*h),c=Qe(y*c),c=Qe(c+f),new lt(a,u,c)}multiply(e,t=!0){if(!t&&0n===e)return ht;if(st(e),1n===e)return this;if(this.equals(ft))return kt(e).p;let n=ht,r=ft;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}toAffine(){const{px:e,py:t,pz:n}=this;if(this.equals(ht))return{x:0n,y:0n};if(1n===n)return{x:e,y:t};const r=tt(n,Se);return 1n!==Qe(n*r)&&Pe("inverse invalid"),{x:Qe(e*r),y:Qe(t*r)}}assertValidity(){const{x:e,y:t}=this.toAffine();return ot(e),ot(t),Qe(t*t)===rt(e)?this:Pe("bad point: not on curve")}toBytes(e=!0){const{x:t,y:n}=this.assertValidity().toAffine(),r=yt(t);return e?Ve(ct(n),r):Ve(ut(4),r,yt(n))}static fromAffine(e){const{x:t,y:n}=e;return 0n===t&&0n===n?ht:new lt(t,n,1n)}toHex(e){return $e(this.toBytes(e))}static fromPrivateKey(e){return ft.multiply(mt(e))}static fromHex(e){return lt.fromBytes(We(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(e){return this.toBytes(e)}}const ft=new lt(xe,Te,1n),ht=new lt(0n,1n,0n);lt.BASE=ft,lt.ZERO=ht;const dt=e=>Ge("0x"+($e(e)||"0")),pt=(e,t,n)=>dt(e.subarray(t,n)),gt=2n**256n,yt=e=>Ke(Fe(Ze(e,0n,gt),Be)),mt=e=>{const t=Ce(e)?e:dt(We(e,Ue));return Ze(t,1n,Re,"private key invalid 3")},bt=e=>e>Re>>1n;class wt{r;s;recovery;constructor(e,t,n){this.r=st(e),this.s=st(t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e){Le(e,Be);const t=pt(e,0,Ue),n=pt(e,Ue,Be);return new wt(t,n)}toBytes(){const{r:e,s:t}=this;return Ve(yt(e),yt(t))}addRecoveryBit(e){return new wt(this.r,this.s,e)}hasHighS(){return bt(this.s)}toCompactRawBytes(){return this.toBytes()}toCompactHex(){return $e(this.toBytes())}recoverPublicKey(e){return _t(this,e)}static fromCompact(e){return wt.fromBytes(We(e,Be))}assertValidity(){return this}normalizeS(){const{r:e,s:t,recovery:n}=this;return bt(t)?new wt(e,et(-t),n):this}}const vt=e=>{const t=8*e.length-256;t>1024&&Pe("msg invalid");const n=dt(e);return t>0?n>>Ge(t):n},Et=e=>et(vt(Le(e))),At={lowS:!0},Ot=async(e,t,n=At)=>{const{seed:r,k2sig:i}=((e,t,n=At)=>{["der","recovered","canonical"].some((e=>e in n))&&Pe("option not supported");let{lowS:r,extraEntropy:i}=n;null==r&&(r=!0);const o=yt,s=Et(We(e)),a=o(s),u=mt(t),c=[o(u),a];i&&c.push(!0===i?Xe(Ue):We(i));const l=s;return{seed:Ve(...c),k2sig:e=>{const t=vt(e);if(!(1n<=t&&t<Re))return;const n=ft.multiply(t).toAffine(),i=et(n.x);if(0n===i)return;const o=tt(t,Re),s=et(o*et(l+et(u*i)));if(0n===s)return;let a=s,c=(n.x===i?0:2)|Number(1n&n.y);return r&&bt(s)&&(a=et(-s),c^=1),new wt(i,a,c)}}})(e,t,n),o=await(()=>{let e=Ne(Ue),t=Ne(Ue),n=0;const r=Ne(0),i=()=>{e.fill(1),t.fill(0),n=0};{const o=(...n)=>St.hmacSha256Async(t,e,...n),s=async(n=r)=>{t=await o(ut(0),n),e=await o(),0!==n.length&&(t=await o(ut(1),n),e=await o())},a=async()=>(n++>=1e3&&Pe("drbg: tried 1000 values"),e=await o(),e);return async(e,t)=>{let n;for(i(),await s(e);!(n=t(await a()));)await s();return i(),n}}})()(r,i);return o},_t=(e,t)=>{const{r:n,s:r,recovery:i}=e;[0,1,2,3].includes(i)||Pe("recovery id invalid");const o=Et(We(t,Ue)),s=2===i||3===i?n+Re:n;ot(s);const a=ct(Ge(i)),u=Ve(a,yt(s)),c=lt.fromBytes(u),l=tt(s,Re);return((e,t,n)=>ft.multiply(t,!1).add(e.multiply(n,!1)).assertValidity())(c,et(-o*l),et(r*l))},St={hexToBytes:Ke,bytesToHex:$e,concatBytes:Ve,bytesToNumberBE:dt,numberToBytesBE:yt,mod:Qe,invert:tt,hmacSha256Async:async(e,...t)=>{const n=Je()?.subtle??Pe("crypto.subtle must be defined"),r="HMAC",i=await n.importKey("raw",e,{name:r,hash:{name:"SHA-256"}},!1,["sign"]);return Ne(await n.sign(r,i,Ve(...t)))},hmacSha256Sync:void 0,hashToPrivateKey:e=>{((e=We(e)).length<40||e.length>1024)&&Pe("expected 40-1024b");const t=Qe(dt(e),Re-1n);return yt(t+1n)},randomBytes:Xe},Rt=Math.ceil(32)+1;let xt;const Tt=(e,t)=>{const n=t.negate();return e?n:t},kt=e=>{const t=xt||(xt=(()=>{const e=[];let t=ft,n=t;for(let r=0;r<Rt;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})());let n=ht,r=ft;const i=Ge(255),o=Ge(8);for(let s=0;s<Rt;s++){let a=Number(e&i);e>>=o,a>128&&(a-=256,e+=1n);const u=128*s,c=u,l=u+Math.abs(a)-1,f=s%2!=0,h=a<0;0===a?r=r.add(Tt(f,t[c])):n=n.add(Tt(h,t[l]))}return{p:n,f:r}};function Ut(e){if("object"!=typeof e)return(typeof e).toLowerCase();const t=Object.prototype.toString.call(e);return t.slice(8,t.length-1).toLowerCase()}function Bt(e){if("array"===Ut(e)){return be(e.map((e=>"string"===Ut(e)?/^0x([0-9a-fA-F]{2})*$/.test(e)?"0x"===e?new Uint8Array([]):_(e):/^\d+$/.test(e)?"0"===e?new Uint8Array([]):_(m(BigInt(e))):(new TextEncoder).encode(e):"number"===Ut(e)||"bigint"===Ut(e)?0===e||e===BigInt(0)?new Uint8Array([]):_(m(e)):"boolean"===Ut(e)?e?Uint8Array.from([1]):new Uint8Array([]):e)))}return"boolean"===Ut(e)?be(e?Uint8Array.from([1]):new Uint8Array([])):be(e)}var Pt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Ct(){throw new Error("setTimeout has not been defined")}function jt(){throw new Error("clearTimeout has not been defined")}var Lt=Ct,Nt=jt;function Ft(e){if(Lt===setTimeout)return setTimeout(e,0);if((Lt===Ct||!Lt)&&setTimeout)return Lt=setTimeout,setTimeout(e,0);try{return Lt(e,0)}catch(t){try{return Lt.call(null,e,0)}catch(t){return Lt.call(this,e,0)}}}"function"==typeof Pt.setTimeout&&(Lt=setTimeout),"function"==typeof Pt.clearTimeout&&(Nt=clearTimeout);var $t,It=[],Mt=!1,zt=-1;function Dt(){Mt&&$t&&(Mt=!1,$t.length?It=$t.concat(It):zt=-1,It.length&&qt())}function qt(){if(!Mt){var e=Ft(Dt);Mt=!0;for(var t=It.length;t;){for($t=It,It=[];++zt<t;)$t&&$t[zt].run();zt=-1,t=It.length}$t=null,Mt=!1,function(e){if(Nt===clearTimeout)return clearTimeout(e);if((Nt===jt||!Nt)&&clearTimeout)return Nt=clearTimeout,clearTimeout(e);try{return Nt(e)}catch(t){try{return Nt.call(null,e)}catch(t){return Nt.call(this,e)}}}(e)}}function Ht(e,t){this.fun=e,this.array=t}Ht.prototype.run=function(){this.fun.apply(null,this.array)};var Yt=Pt.performance||{};Yt.now||Yt.mozNow||Yt.msNow||Yt.oNow||Yt.webkitNow;var Kt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];It.push(new Ht(e,t)),1!==It.length||Mt||Ft(qt)}};function Wt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Jt}=Object.prototype,{getPrototypeOf:Vt}=Object,{iterator:Xt,toStringTag:Gt}=Symbol,Zt=(Qt=Object.create(null),e=>{const t=Jt.call(e);return Qt[t]||(Qt[t]=t.slice(8,-1).toLowerCase())});var Qt;const en=e=>(e=e.toLowerCase(),t=>Zt(t)===e),tn=e=>t=>typeof t===e,{isArray:nn}=Array,rn=tn("undefined");function on(e){return null!==e&&!rn(e)&&null!==e.constructor&&!rn(e.constructor)&&un(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const sn=en("ArrayBuffer");const an=tn("string"),un=tn("function"),cn=tn("number"),ln=e=>null!==e&&"object"==typeof e,fn=e=>{if("object"!==Zt(e))return!1;const t=Vt(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Gt in e||Xt in e)},hn=en("Date"),dn=en("File"),pn=en("Blob"),gn=en("FileList"),yn=en("URLSearchParams"),[mn,bn,wn,vn]=["ReadableStream","Request","Response","Headers"].map(en);function En(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),nn(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(on(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function An(e,t){if(on(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const On="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Pt,_n=e=>!rn(e)&&e!==On;const Sn=(Rn="undefined"!=typeof Uint8Array&&Vt(Uint8Array),e=>Rn&&e instanceof Rn);var Rn;const xn=en("HTMLFormElement"),Tn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),kn=en("RegExp"),Un=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};En(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)};const Bn=en("AsyncFunction"),Pn=(Cn="function"==typeof setImmediate,jn=un(On.postMessage),Cn?setImmediate:jn?(Ln=`axios@${Math.random()}`,Nn=[],On.addEventListener("message",(({source:e,data:t})=>{e===On&&t===Ln&&Nn.length&&Nn.shift()()}),!1),e=>{Nn.push(e),On.postMessage(Ln,"*")}):e=>setTimeout(e));var Cn,jn,Ln,Nn;const Fn="undefined"!=typeof queueMicrotask?queueMicrotask.bind(On):Kt.nextTick||Pn;var $n={isArray:nn,isArrayBuffer:sn,isBuffer:on,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||un(e.append)&&("formdata"===(t=Zt(e))||"object"===t&&un(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sn(e.buffer),t},isString:an,isNumber:cn,isBoolean:e=>!0===e||!1===e,isObject:ln,isPlainObject:fn,isEmptyObject:e=>{if(!ln(e)||on(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:mn,isRequest:bn,isResponse:wn,isHeaders:vn,isUndefined:rn,isDate:hn,isFile:dn,isBlob:pn,isRegExp:kn,isFunction:un,isStream:e=>ln(e)&&un(e.pipe),isURLSearchParams:yn,isTypedArray:Sn,isFileList:gn,forEach:En,merge:function e(){const{caseless:t,skipUndefined:n}=_n(this)&&this||{},r={},i=(i,o)=>{const s=t&&An(r,o)||o;fn(r[s])&&fn(i)?r[s]=e(r[s],i):fn(i)?r[s]=e({},i):nn(i)?r[s]=i.slice():n&&rn(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&En(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(En(t,((t,r)=>{n&&un(t)?e[r]=Wt(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Vt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Zt,kindOfTest:en,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(nn(e))return e;let t=e.length;if(!cn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Xt]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:xn,hasOwnProperty:Tn,hasOwnProp:Tn,reduceDescriptors:Un,freezeMethods:e=>{Un(e,((t,n)=>{if(un(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];un(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return nn(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:An,global:On,isContextDefined:_n,isSpecCompliantForm:function(e){return!!(e&&un(e.append)&&"FormData"===e[Gt]&&e[Xt])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ln(e)){if(t.indexOf(e)>=0)return;if(on(e))return e;if(!("toJSON"in e)){t[r]=e;const i=nn(e)?[]:{};return En(e,((e,t)=>{const o=n(e,r+1);!rn(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:Bn,isThenable:e=>e&&(ln(e)||un(e))&&un(e.then)&&un(e.catch),setImmediate:Pn,asap:Fn,isIterable:e=>null!=e&&un(e[Xt])},In=[],Mn=[],zn="undefined"!=typeof Uint8Array?Uint8Array:Array,Dn=!1;function qn(){Dn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)In[t]=e[t],Mn[e.charCodeAt(t)]=t;Mn["-".charCodeAt(0)]=62,Mn["_".charCodeAt(0)]=63}function Hn(e,t,n){for(var r,i,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(In[(i=r)>>18&63]+In[i>>12&63]+In[i>>6&63]+In[63&i]);return o.join("")}function Yn(e){var t;Dn||qn();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(Hn(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=In[t>>2],i+=In[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=In[t>>10],i+=In[t>>4&63],i+=In[t<<2&63],i+="="),o.push(i),o.join("")}function Kn(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)}function Wn(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+d]=255&s,d+=p,s/=256,c-=8);e[n+d-p]|=128*g}var Jn={}.toString,Vn=Array.isArray||function(e){return"[object Array]"==Jn.call(e)};function Xn(){return Zn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Gn(e,t){if(Xn()<t)throw new RangeError("Invalid typed array length");return Zn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Zn.prototype:(null===e&&(e=new Zn(t)),e.length=t),e}function Zn(e,t,n){if(!(Zn.TYPED_ARRAY_SUPPORT||this instanceof Zn))return new Zn(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return tr(this,e)}return Qn(this,e,t,n)}function Qn(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Zn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Zn.prototype:e=nr(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Zn.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|or(t,n);e=Gn(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(ir(t)){var n=0|rr(t.length);return 0===(e=Gn(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Gn(e,0):nr(e,t);if("Buffer"===t.type&&Vn(t.data))return nr(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function er(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function tr(e,t){if(er(t),e=Gn(e,t<0?0:0|rr(t)),!Zn.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function nr(e,t){var n=t.length<0?0:0|rr(t.length);e=Gn(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function rr(e){if(e>=Xn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Xn().toString(16)+" bytes");return 0|e}function ir(e){return!(null==e||!e._isBuffer)}function or(e,t){if(ir(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Pr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Cr(e).length;default:if(r)return Pr(e).length;t=(""+t).toLowerCase(),r=!0}}function sr(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Er(this,t,n);case"utf8":case"utf-8":return mr(this,t,n);case"ascii":return wr(this,t,n);case"latin1":case"binary":return vr(this,t,n);case"base64":return yr(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ar(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function ar(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function ur(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Zn.from(t,r)),ir(t))return 0===t.length?-1:cr(e,t,n,r,i);if("number"==typeof t)return t&=255,Zn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):cr(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function cr(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function lr(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function fr(e,t,n,r){return jr(Pr(t,e.length-n),e,n,r)}function hr(e,t,n,r){return jr(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function dr(e,t,n,r){return hr(e,t,n,r)}function pr(e,t,n,r){return jr(Cr(t),e,n,r)}function gr(e,t,n,r){return jr(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function yr(e,t,n){return 0===t&&n===e.length?Yn(e):Yn(e.slice(t,n))}function mr(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=br)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=br));return n}(r)}Zn.TYPED_ARRAY_SUPPORT=void 0===Pt.TYPED_ARRAY_SUPPORT||Pt.TYPED_ARRAY_SUPPORT,Xn(),Zn.poolSize=8192,Zn._augment=function(e){return e.__proto__=Zn.prototype,e},Zn.from=function(e,t,n){return Qn(null,e,t,n)},Zn.TYPED_ARRAY_SUPPORT&&(Zn.prototype.__proto__=Uint8Array.prototype,Zn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Zn[Symbol.species]),Zn.alloc=function(e,t,n){return function(e,t,n,r){return er(t),t<=0?Gn(e,t):void 0!==n?"string"==typeof r?Gn(e,t).fill(n,r):Gn(e,t).fill(n):Gn(e,t)}(null,e,t,n)},Zn.allocUnsafe=function(e){return tr(null,e)},Zn.allocUnsafeSlow=function(e){return tr(null,e)},Zn.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Lr(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Lr(e.slice(0,0))}(e))},Zn.compare=function(e,t){if(!ir(e)||!ir(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},Zn.isEncoding=function(e){switch(String(e).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}},Zn.concat=function(e,t){if(!Vn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Zn.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Zn.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!ir(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Zn.byteLength=or,Zn.prototype._isBuffer=!0,Zn.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)ar(this,t,t+1);return this},Zn.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)ar(this,t,t+3),ar(this,t+1,t+2);return this},Zn.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)ar(this,t,t+7),ar(this,t+1,t+6),ar(this,t+2,t+5),ar(this,t+3,t+4);return this},Zn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?mr(this,0,e):sr.apply(this,arguments)},Zn.prototype.equals=function(e){if(!ir(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Zn.compare(this,e)},Zn.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Zn.prototype.compare=function(e,t,n,r,i){if(!ir(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},Zn.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Zn.prototype.indexOf=function(e,t,n){return ur(this,e,t,n,!0)},Zn.prototype.lastIndexOf=function(e,t,n){return ur(this,e,t,n,!1)},Zn.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return lr(this,e,t,n);case"utf8":case"utf-8":return fr(this,e,t,n);case"ascii":return hr(this,e,t,n);case"latin1":case"binary":return dr(this,e,t,n);case"base64":return pr(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Zn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var br=4096;function wr(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function vr(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Er(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=Br(e[o]);return i}function Ar(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Or(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function _r(e,t,n,r,i,o){if(!ir(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Sr(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Rr(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function xr(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Tr(e,t,n,r,i){return i||xr(e,0,n,4),Wn(e,t,n,r,23,4),n+4}function kr(e,t,n,r,i){return i||xr(e,0,n,8),Wn(e,t,n,r,52,8),n+8}Zn.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Zn.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Zn.prototype;else{var i=t-e;n=new Zn(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},Zn.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Or(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},Zn.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Or(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},Zn.prototype.readUInt8=function(e,t){return t||Or(e,1,this.length),this[e]},Zn.prototype.readUInt16LE=function(e,t){return t||Or(e,2,this.length),this[e]|this[e+1]<<8},Zn.prototype.readUInt16BE=function(e,t){return t||Or(e,2,this.length),this[e]<<8|this[e+1]},Zn.prototype.readUInt32LE=function(e,t){return t||Or(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Zn.prototype.readUInt32BE=function(e,t){return t||Or(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Zn.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Or(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Zn.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Or(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Zn.prototype.readInt8=function(e,t){return t||Or(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Zn.prototype.readInt16LE=function(e,t){t||Or(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Zn.prototype.readInt16BE=function(e,t){t||Or(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Zn.prototype.readInt32LE=function(e,t){return t||Or(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Zn.prototype.readInt32BE=function(e,t){return t||Or(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Zn.prototype.readFloatLE=function(e,t){return t||Or(e,4,this.length),Kn(this,e,!0,23,4)},Zn.prototype.readFloatBE=function(e,t){return t||Or(e,4,this.length),Kn(this,e,!1,23,4)},Zn.prototype.readDoubleLE=function(e,t){return t||Or(e,8,this.length),Kn(this,e,!0,52,8)},Zn.prototype.readDoubleBE=function(e,t){return t||Or(e,8,this.length),Kn(this,e,!1,52,8)},Zn.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||_r(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},Zn.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||_r(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Zn.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,1,255,0),Zn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Zn.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,2,65535,0),Zn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Sr(this,e,t,!0),t+2},Zn.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,2,65535,0),Zn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Sr(this,e,t,!1),t+2},Zn.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,4,4294967295,0),Zn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Rr(this,e,t,!0),t+4},Zn.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,4,4294967295,0),Zn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Rr(this,e,t,!1),t+4},Zn.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);_r(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Zn.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);_r(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Zn.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,1,127,-128),Zn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Zn.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,2,32767,-32768),Zn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Sr(this,e,t,!0),t+2},Zn.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,2,32767,-32768),Zn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Sr(this,e,t,!1),t+2},Zn.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,4,2147483647,-2147483648),Zn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Rr(this,e,t,!0),t+4},Zn.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||_r(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Zn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Rr(this,e,t,!1),t+4},Zn.prototype.writeFloatLE=function(e,t,n){return Tr(this,e,t,!0,n)},Zn.prototype.writeFloatBE=function(e,t,n){return Tr(this,e,t,!1,n)},Zn.prototype.writeDoubleLE=function(e,t,n){return kr(this,e,t,!0,n)},Zn.prototype.writeDoubleBE=function(e,t,n){return kr(this,e,t,!1,n)},Zn.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!Zn.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},Zn.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Zn.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=ir(e)?e:Pr(new Zn(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Ur=/[^+\/0-9A-Za-z-_]/g;function Br(e){return e<16?"0"+e.toString(16):e.toString(16)}function Pr(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Cr(e){return function(e){var t,n,r,i,o,s;Dn||qn();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new zn(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=Mn[e.charCodeAt(t)]<<18|Mn[e.charCodeAt(t+1)]<<12|Mn[e.charCodeAt(t+2)]<<6|Mn[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=Mn[e.charCodeAt(t)]<<2|Mn[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=Mn[e.charCodeAt(t)]<<10|Mn[e.charCodeAt(t+1)]<<4|Mn[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Ur,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function jr(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Lr(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Nr(e,t,n,r,i){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),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}$n.inherits(Nr,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:$n.toJSONObject(this.config),code:this.code,status:this.status}}});const Fr=Nr.prototype,$r={};["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=>{$r[e]={value:e}})),Object.defineProperties(Nr,$r),Object.defineProperty(Fr,"isAxiosError",{value:!0}),Nr.from=(e,t,n,r,i,o)=>{const s=Object.create(Fr);$n.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",u=null==t&&e?e.code:t;return Nr.call(s,a,u,n,r,i),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function Ir(e){return $n.isPlainObject(e)||$n.isArray(e)}function Mr(e){return $n.endsWith(e,"[]")?e.slice(0,-2):e}function zr(e,t,n){return e?e.concat(t).map((function(e,t){return e=Mr(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Dr=$n.toFlatObject($n,{},null,(function(e){return/^is[A-Z]/.test(e)}));function qr(e,t,n){if(!$n.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=$n.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$n.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&$n.isSpecCompliantForm(t);if(!$n.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if($n.isDate(e))return e.toISOString();if($n.isBoolean(e))return e.toString();if(!a&&$n.isBlob(e))throw new Nr("Blob is not supported. Use a Buffer instead.");return $n.isArrayBuffer(e)||$n.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Zn.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if($n.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($n.isArray(e)&&function(e){return $n.isArray(e)&&!e.some(Ir)}(e)||($n.isFileList(e)||$n.endsWith(n,"[]"))&&(a=$n.toArray(e)))return n=Mr(n),a.forEach((function(e,r){!$n.isUndefined(e)&&null!==e&&t.append(!0===s?zr([n],r,o):null===s?n:n+"[]",u(e))})),!1;return!!Ir(e)||(t.append(zr(i,n,o),u(e)),!1)}const l=[],f=Object.assign(Dr,{defaultVisitor:c,convertValue:u,isVisitable:Ir});if(!$n.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!$n.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),$n.forEach(n,(function(n,o){!0===(!($n.isUndefined(n)||null===n)&&i.call(t,n,$n.isString(o)?o.trim():o,r,f))&&e(n,r?r.concat(o):[o])})),l.pop()}}(e),t}function Hr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Yr(e,t){this._pairs=[],e&&qr(e,this,t)}const Kr=Yr.prototype;function Wr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Jr(e,t,n){if(!t)return e;const r=n&&n.encode||Wr;$n.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):$n.isURLSearchParams(t)?t.toString():new Yr(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Kr.append=function(e,t){this._pairs.push([e,t])},Kr.toString=function(e){const t=e?function(t){return e.call(this,t,Hr)}:Hr;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Vr{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$n.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Xr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Yr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Zr="undefined"!=typeof window&&"undefined"!=typeof document,Qr="object"==typeof navigator&&navigator||void 0,ei=Zr&&(!Qr||["ReactNative","NativeScript","NS"].indexOf(Qr.product)<0),ti="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ni=Zr&&window.location.href||"http://localhost";var ri={...Object.freeze({__proto__:null,hasBrowserEnv:Zr,hasStandardBrowserEnv:ei,hasStandardBrowserWebWorkerEnv:ti,navigator:Qr,origin:ni}),...Gr};function ii(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&$n.isArray(r)?r.length:o,a)return $n.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s;r[o]&&$n.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&$n.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if($n.isFormData(e)&&$n.isFunction(e.entries)){const n={};return $n.forEachEntry(e,((e,r)=>{t(function(e){return $n.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const oi={transitional:Xr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=$n.isObject(e);i&&$n.isHTMLForm(e)&&(e=new FormData(e));if($n.isFormData(e))return r?JSON.stringify(ii(e)):e;if($n.isArrayBuffer(e)||$n.isBuffer(e)||$n.isStream(e)||$n.isFile(e)||$n.isBlob(e)||$n.isReadableStream(e))return e;if($n.isArrayBufferView(e))return e.buffer;if($n.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return qr(e,new ri.classes.URLSearchParams,{visitor:function(e,t,n,r){return ri.isNode&&$n.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=$n.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return qr(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if($n.isString(e))try{return(t||JSON.parse)(e),$n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||oi.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if($n.isResponse(e)||$n.isReadableStream(e))return e;if(e&&$n.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Nr.from(e,Nr.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ri.classes.FormData,Blob:ri.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$n.forEach(["delete","get","head","post","put","patch"],(e=>{oi.headers[e]={}}));const si=$n.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"]);const ai=Symbol("internals");function ui(e){return e&&String(e).trim().toLowerCase()}function ci(e){return!1===e||null==e?e:$n.isArray(e)?e.map(ci):String(e)}function li(e,t,n,r,i){return $n.isFunction(r)?r.call(this,t,n):(i&&(t=n),$n.isString(t)?$n.isString(r)?-1!==t.indexOf(r):$n.isRegExp(r)?r.test(t):void 0:void 0)}let fi=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=ui(t);if(!i)throw new Error("header name must be a non-empty string");const o=$n.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ci(e))}const o=(e,t)=>$n.forEach(e,((e,n)=>i(e,n,t)));if($n.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if($n.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&si[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if($n.isObject(e)&&$n.isIterable(e)){let n,r,i={};for(const t of e){if(!$n.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?$n.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=ui(e)){const n=$n.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if($n.isFunction(t))return t.call(this,e,n);if($n.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ui(e)){const n=$n.findKey(this,e);return!(!n||void 0===this[n]||t&&!li(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=ui(e)){const i=$n.findKey(n,e);!i||t&&!li(0,n[i],i,t)||(delete n[i],r=!0)}}return $n.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!li(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return $n.forEach(this,((r,i)=>{const o=$n.findKey(n,i);if(o)return t[o]=ci(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();s!==i&&delete t[i],t[s]=ci(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $n.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&$n.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ai]=this[ai]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ui(e);t[r]||(!function(e,t){const n=$n.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return $n.isArray(e)?e.forEach(r):r(e),this}};function hi(e,t){const n=this||oi,r=t||n,i=fi.from(r.headers);let o=r.data;return $n.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function di(e){return!(!e||!e.__CANCEL__)}function pi(e,t,n){Nr.call(this,null==e?"canceled":e,Nr.ERR_CANCELED,t,n),this.name="CanceledError"}function gi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Nr("Request failed with status code "+n.status,[Nr.ERR_BAD_REQUEST,Nr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}fi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$n.reduceDescriptors(fi.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),$n.freezeMethods(fi),$n.inherits(pi,Nr,{__CANCEL__:!0});const yi=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let l=s,f=0;for(;l!==o;)f+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;const h=c&&u-c;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),o-a)))},()=>n&&s(n)]}((n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-r,u=i(a);r=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&o<=s?(s-o)/u:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},mi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bi=e=>(...t)=>$n.asap((()=>e(...t)));var wi=ri.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ri.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ri.origin),ri.navigator&&/(msie|trident)/i.test(ri.navigator.userAgent)):()=>!0,vi=ri.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];$n.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),$n.isString(r)&&s.push("path="+r),$n.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.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:()=>null,remove(){}};function Ei(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ai=e=>e instanceof fi?{...e}:e;function Oi(e,t){t=t||{};const n={};function r(e,t,n,r){return $n.isPlainObject(e)&&$n.isPlainObject(t)?$n.merge.call({caseless:r},e,t):$n.isPlainObject(t)?$n.merge({},t):$n.isArray(t)?t.slice():t}function i(e,t,n,i){return $n.isUndefined(t)?$n.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!$n.isUndefined(t))return r(void 0,t)}function s(e,t){return $n.isUndefined(t)?$n.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(Ai(e),Ai(t),0,!0)};return $n.forEach(Object.keys({...e,...t}),(function(r){const o=u[r]||i,s=o(e[r],t[r],r);$n.isUndefined(s)&&o!==a||(n[r]=s)})),n}var _i=e=>{const t=Oi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=fi.from(s),t.url=Jr(Ei(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$n.isFormData(n))if(ri.hasStandardBrowserEnv||ri.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if($n.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)}))}if(ri.hasStandardBrowserEnv&&(r&&$n.isFunction(r)&&(r=r(t)),r||!1!==r&&wi(t.url))){const e=i&&o&&vi.read(o);e&&s.set(i,e)}return t};var Si="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=_i(e);let i=r.data;const o=fi.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:h,onDownloadProgress:d}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const r=fi.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());gi((function(e){t(e),p()}),(function(e){n(e),p()}),{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new Nr("Request aborted",Nr.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new Nr(t&&t.message?t.message:"Network Error",Nr.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Xr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Nr(t,i.clarifyTimeoutError?Nr.ETIMEDOUT:Nr.ECONNABORTED,e,g)),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&$n.forEach(o.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),$n.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),d&&([u,l]=yi(d,!0),g.addEventListener("progress",u)),h&&g.upload&&([a,c]=yi(h),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new pi(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===ri.protocols.indexOf(m)?n(new Nr("Unsupported protocol "+m+":",Nr.ERR_BAD_REQUEST,e)):g.send(i||null)}))};const Ri=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Nr?t:new pi(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new Nr(`timeout ${t} of ms exceeded`,Nr.ETIMEDOUT))}),t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:a}=r;return a.unsubscribe=()=>$n.asap(s),a}},xi=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Ti=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ki=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Ti(e))yield*xi(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},{isFunction:Ui}=$n,Bi=(({Request:e,Response:t})=>({Request:e,Response:t}))($n.global),{ReadableStream:Pi,TextEncoder:Ci}=$n.global,ji=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Li=e=>{e=$n.merge.call({skipUndefined:!0},Bi,e);const{fetch:t,Request:n,Response:r}=e,i=t?Ui(t):"function"==typeof fetch,o=Ui(n),s=Ui(r);if(!i)return!1;const a=i&&Ui(Pi),u=i&&("function"==typeof Ci?(e=>t=>e.encode(t))(new Ci):async e=>new Uint8Array(await new n(e).arrayBuffer())),c=o&&a&&ji((()=>{let e=!1;const t=new n(ri.origin,{body:new Pi,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),l=s&&a&&ji((()=>$n.isReadableStream(new r("").body))),f={stream:l&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Nr(`Response type '${e}' is not supported`,Nr.ERR_NOT_SUPPORT,n)})}));const h=async(e,t)=>{const r=$n.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($n.isBlob(e))return e.size;if($n.isSpecCompliantForm(e)){const t=new n(ri.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $n.isArrayBufferView(e)||$n.isArrayBuffer(e)?e.byteLength:($n.isURLSearchParams(e)&&(e+=""),$n.isString(e)?(await u(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:a,signal:u,cancelToken:d,timeout:p,onDownloadProgress:g,onUploadProgress:y,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=_i(e),E=t||fetch;m=m?(m+"").toLowerCase():"text";let A=Ri([u,d&&d.toAbortSignal()],p),O=null;const _=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let S;try{if(y&&c&&"get"!==s&&"head"!==s&&0!==(S=await h(b,a))){let e,t=new n(i,{method:"POST",body:a,duplex:"half"});if($n.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=mi(S,yi(bi(y)));a=ki(t.body,65536,e,n)}}$n.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype,u={...v,signal:A,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};O=o&&new n(i,u);let d=await(o?E(O,v):E(i,u));const p=l&&("stream"===m||"response"===m);if(l&&(g||p&&_)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=d[t]}));const t=$n.toFiniteNumber(d.headers.get("content-length")),[n,i]=g&&mi(t,yi(bi(g),!0))||[];d=new r(ki(d.body,65536,n,(()=>{i&&i(),_&&_()})),e)}m=m||"text";let R=await f[$n.findKey(f,m)||"text"](d,e);return!p&&_&&_(),await new Promise(((t,n)=>{gi(t,n,{data:R,headers:fi.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:O})}))}catch(t){if(_&&_(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Nr("Network Error",Nr.ERR_NETWORK,e,O),{cause:t.cause||t});throw Nr.from(t,t&&t.code,e,O)}}},Ni=new Map,Fi=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s,a,u=o.length,c=Ni;for(;u--;)s=o[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:Li(t)),c=a;return a};Fi();const $i={http:null,xhr:Si,fetch:{get:Fi}};$n.forEach($i,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ii=e=>`- ${e}`,Mi=e=>$n.isFunction(e)||null===e||!1===e;var zi=(e,t)=>{e=$n.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!Mi(r)&&(i=$i[(n=String(r)).toLowerCase()],void 0===i))throw new Nr(`Unknown adapter '${n}'`);if(i&&($n.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Nr("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ii).join("\n"):" "+Ii(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function Di(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pi(null,e)}function qi(e){Di(e),e.headers=fi.from(e.headers),e.data=hi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return zi(e.adapter||oi.adapter,e)(e).then((function(t){return Di(e),t.data=hi.call(e,e.transformResponse,t),t.headers=fi.from(t.headers),t}),(function(t){return di(t)||(Di(e),t&&t.response&&(t.response.data=hi.call(e,e.transformResponse,t.response),t.response.headers=fi.from(t.response.headers))),Promise.reject(t)}))}const Hi="1.12.2",Yi={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Yi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ki={};Yi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Hi+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new Nr(r(i," has been removed"+(t?" in "+t:"")),Nr.ERR_DEPRECATED);return t&&!Ki[i]&&(Ki[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Yi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Wi={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Nr("options must be an object",Nr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new Nr("option "+o+" must be "+n,Nr.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Nr("Unknown option "+o,Nr.ERR_BAD_OPTION)}},validators:Yi};const Ji=Wi.validators;let Vi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Vr,response:new Vr}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Oi(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Wi.assertOptions(n,{silentJSONParsing:Ji.transitional(Ji.boolean),forcedJSONParsing:Ji.transitional(Ji.boolean),clarifyTimeoutError:Ji.transitional(Ji.boolean)},!1),null!=r&&($n.isFunction(r)?t.paramsSerializer={serialize:r}:Wi.assertOptions(r,{encode:Ji.function,serialize:Ji.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Wi.assertOptions(t,{baseUrl:Ji.spelling("baseURL"),withXsrfToken:Ji.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&$n.merge(i.common,i[t.method]);i&&$n.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=fi.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[qi.bind(this),void 0];for(e.unshift(...s),e.push(...u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let h=t;for(;f<l;){const e=s[f++],t=s[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{c=qi.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,l=u.length;f<l;)c=c.then(u[f++],u[f++]);return c}getUri(e){return Jr(Ei((e=Oi(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$n.forEach(["delete","get","head","options"],(function(e){Vi.prototype[e]=function(t,n){return this.request(Oi(n||{},{method:e,url:t,data:(n||{}).data}))}})),$n.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Oi(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Vi.prototype[e]=t(),Vi.prototype[e+"Form"]=t(!0)}));const Xi={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(Xi).forEach((([e,t])=>{Xi[t]=e}));const Gi=function e(t){const n=new Vi(t),r=Wt(Vi.prototype.request,n);return $n.extend(r,Vi.prototype,n,{allOwnKeys:!0}),$n.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Oi(t,n))},r}(oi);Gi.Axios=Vi,Gi.CanceledError=pi,Gi.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new pi(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},Gi.isCancel=di,Gi.VERSION=Hi,Gi.toFormData=qr,Gi.AxiosError=Nr,Gi.Cancel=Gi.CanceledError,Gi.all=function(e){return Promise.all(e)},Gi.spread=function(e){return function(t){return e.apply(null,t)}},Gi.isAxiosError=function(e){return $n.isObject(e)&&!0===e.isAxiosError},Gi.mergeConfig=Oi,Gi.AxiosHeaders=fi,Gi.formToJSON=e=>ii($n.isHTMLForm(e)?new FormData(e):e),Gi.getAdapter=zi,Gi.HttpStatusCode=Xi,Gi.default=Gi;const{Axios:Zi,AxiosError:Qi,CanceledError:eo,isCancel:to,CancelToken:no,VERSION:ro,all:io,Cancel:oo,isAxiosError:so,spread:ao,toFormData:uo,AxiosHeaders:co,HttpStatusCode:lo,formToJSON:fo,getAdapter:ho,mergeConfig:po}=Gi;class go{constructor(){this.promiseWrapper=new Promise(((e,t)=>{this._resolve=e,this._reject=t})),this._restScope=["success","failure","error","login","timeout"];for(let e=0;e<this._restScope.length;e++){const t=this._restScope[e];t&&(this.promiseWrapper[t]=e=>{"function"==typeof e&&(this[`_${t}`]=e);const n=this.promiseWrapper;delete n[t];const r=this._restScope.slice();return r.splice(r.indexOf(t),1),r.every((e=>!!e&&!n[e]))&&delete n.rest,n})}this.promiseWrapper.rest=(e,t)=>{"function"==typeof e&&(this._rest=e);const n=this.promiseWrapper;if(delete n.rest,this._restScope=t||this._restScope,0===this._restScope.length)console.warn('[1Money SDK]: The ".rest(cb, scope)" scope is empty and will never be triggered!');else{let e=0;this._restScope.forEach((t=>{t&&(n[t]?delete n[t]:e++)})),e===this._restScope.length&&console.warn(`[1Money SDK]: The "${this._restScope.join(", ")}" had been called and the "rest" will never be triggered!`)}return n}}}const yo=new class{constructor(e){this._config=e||{},this.axios=Gi,this.parseError=this.parseError.bind(this),this.setting=this.setting.bind(this),this.request=this.request.bind(this)}parseError(e){var t,n,r,i,o,s,a,u,c;"string"==typeof e&&(e=new Error(e)),(!e||"object"!==Ut(e)&&"error"!==Ut(e))&&(e=new Error("Unknown error occurred"));const l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"Error",f=null!==(i=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==i?i:"Unknown error",h=null!==(o=null==e?void 0:e.stack)&&void 0!==o?o:"",d=null!==(a=null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status)&&void 0!==a?a:500,p=null!==(c=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)&&void 0!==c?c:void 0;return"number"!=typeof d||d<100||d>599?{name:"InvalidStatusError",message:"Invalid HTTP status code",stack:h,status:500,data:p}:{name:l,message:f,stack:h,status:d,data:p}}setting(e){if(!e)return console.warn("[1Money SDK]: setting method required correct parameters!");this._config=Object.assign(Object.assign({},this._config),e)}request(e){e.withCredentials="boolean"!=typeof e.withCredentials||e.withCredentials,e.headers=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),e.method?this.axios.defaults.headers[e.method]:{}),e.headers),e.headers.Accept=e.headers.Accept||"*/*",e.headers["X-Requested-With"]=e.headers["X-Requested-With"]||"XMLHttpRequest",e.headers["X-Content-Type-Options"]=e.headers["X-Content-Type-Options"]||"nosniff";const{onSuccess:n,onFailure:r,onLogin:i,onError:o,onTimeout:s,isSuccess:a,isLogin:u,timeout:c}=this._config,{onSuccess:l,onFailure:f,onLogin:h,onError:d,onTimeout:p,isSuccess:g,isLogin:y,timeout:m}=e,b={success:null!=g?g:a,login:null!=y?y:u},w=new go;return Promise.resolve().then((()=>{var a,u,g,y,v,E,A,O,_,S,R,x,T,k,U,B,P,C,j,L;const N={success:null!==(y=null!==(g=null!==(u=null!==(a=w._success)&&void 0!==a?a:~w._restScope.indexOf("success")?w._rest:void 0)&&void 0!==u?u:l)&&void 0!==g?g:n)&&void 0!==y?y:(e,t)=>e,failure:null!==(O=null!==(A=null!==(E=null!==(v=w._failure)&&void 0!==v?v:~w._restScope.indexOf("failure")?w._rest:void 0)&&void 0!==E?E:f)&&void 0!==A?A:r)&&void 0!==O?O:(e,t)=>e,error:null!==(x=null!==(R=null!==(S=null!==(_=w._error)&&void 0!==_?_:~w._restScope.indexOf("error")?w._rest:void 0)&&void 0!==S?S:d)&&void 0!==R?R:o)&&void 0!==x?x:(e,t)=>e,login:null!==(B=null!==(U=null!==(k=null!==(T=w._login)&&void 0!==T?T:~w._restScope.indexOf("login")?w._rest:void 0)&&void 0!==k?k:h)&&void 0!==U?U:i)&&void 0!==B?B:(e,t)=>e,timeout:null!==(L=null!==(j=null!==(C=null!==(P=w._timeout)&&void 0!==P?P:~w._restScope.indexOf("timeout")?w._rest:void 0)&&void 0!==C?C:p)&&void 0!==j?j:s)&&void 0!==L?L:(e,t)=>e},F=(w._success||w._rest&&w._restScope.indexOf("success"),w._failure||w._rest&&w._restScope.indexOf("failure"),w._login||w._rest&&w._restScope.indexOf("login"),!!(w._error||w._rest&&~w._restScope.indexOf("error")||d||o)),$=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")||p||s),I=!!(w._success||w._rest&&~w._restScope.indexOf("success")),M=!!(w._failure||w._rest&&~w._restScope.indexOf("failure")),z=!!(w._login||w._rest&&~w._restScope.indexOf("login")),D=!!(w._error||w._rest&&~w._restScope.indexOf("error")),q=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")),H=(e,n)=>t(this,void 0,void 0,(function*(){try{let t=this.parseError(e);const r=yield Promise.resolve(N.error(t,n));D&&(t=r),F?w._resolve(t):w._reject(t)}catch(e){w._reject(this.parseError(e))}}));let Y=null,K=!1;const W=null!=m?m:c,J=()=>{null!==Y&&(clearTimeout(Y),Y=null)};W&&(Y=setTimeout((()=>t(this,void 0,void 0,(function*(){var t,n;try{K=!0,J();let n=this.parseError("timeout");const r=yield Promise.resolve(N.timeout(n,null!==(t=e.headers)&&void 0!==t?t:{}));q&&(n=r),$?w._resolve(n):w._reject(n)}catch(t){H(t,null!==(n=e.headers)&&void 0!==n?n:{})}}))),W)),this.axios(e).then((e=>t(this,void 0,void 0,(function*(){var t,n;if(K)return;J();const{status:r,data:i,headers:o}=e;try{const e=null===(t=b.success)||void 0===t?void 0:t.call(b,i,r,o),s=null===(n=b.login)||void 0===n?void 0:n.call(b,i,r,o);let a=i;if(s){const e=yield Promise.resolve(N.login(i,o));z&&(a=e)}else if(e){const e=yield Promise.resolve(N.success(i,o));I&&(a=e)}else{const e=yield Promise.resolve(N.failure(i,o));M&&(a=e)}w._resolve(a)}catch(e){H(e,o)}})))).catch((e=>t(this,void 0,void 0,(function*(){var t,n,r,i,o,s,a,u,c,l,f,h,d,p,g,y,m,v;if(K)return;J();const E=null!==(n=null===(t=e.response)||void 0===t?void 0:t.data)&&void 0!==n?n:{};console.error(`[1Money SDK]: Error(${null!==(r=e.status)&&void 0!==r?r:500}, ${null!==(i=e.code)&&void 0!==i?i:"UNKNOWN"}), Message: ${e.message}, Config: ${null===(o=e.config)||void 0===o?void 0:o.method}, ${null!==(a=null===(s=e.config)||void 0===s?void 0:s.baseURL)&&void 0!==a?a:""}, ${null!==(c=null===(u=e.config)||void 0===u?void 0:u.url)&&void 0!==c?c:""}, ${JSON.stringify(null!==(f=null===(l=e.config)||void 0===l?void 0:l.headers)&&void 0!==f?f:{})}, Request: ${JSON.stringify(null!==(d=null===(h=e.config)||void 0===h?void 0:h.data)&&void 0!==d?d:{})}, Response: ${JSON.stringify(E)};`);const A=null!==(g=null===(p=e.response)||void 0===p?void 0:p.status)&&void 0!==g?g:500,O=null!==(m=null===(y=e.response)||void 0===y?void 0:y.headers)&&void 0!==m?m:{};try{let t=E;(null===(v=b.login)||void 0===v?void 0:v.call(b,E,A,O))?(t=yield Promise.resolve(N.login(t,O)),w._resolve(t)):H(e,O)}catch(e){H(e,O)}}))))})),w.promiseWrapper}}({isSuccess:(e,t)=>200===t&&0==e.code,isLogin:(e,t)=>401===t||401==e.code,timeout:1e4});function mo(e,t){return yo.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}function bo(e,t,n){return yo.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))}function wo(e){const{baseURL:t,headers:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["baseURL","headers"]);yo.axios.defaults.baseURL=t||("undefined"!=typeof window?location.origin:void 0),n&&(yo.axios.defaults.headers.common=Object.assign(Object.assign({},yo.axios.defaults.headers.common),n)),yo.setting(r)}var vo={get:mo,post:bo,postForm:function(e,t,n){return yo.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"multipart/form-data"},null==n?void 0:n.headers)}))},del:function(e,t,n){return yo.request(Object.assign(Object.assign({},n),{method:"delete",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},put:function(e,t,n){return yo.request(Object.assign(Object.assign({},n),{method:"put",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},patch:function(e,t,n){return yo.request(Object.assign(Object.assign({},n),{method:"patch",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},setInitConfig:wo,axiosStatic:yo.axios};const Eo="https://api.1money.network",Ao="v1",Oo=`/${Ao}/accounts`,_o={getNonce:e=>mo(`${Oo}/nonce?address=${e}`,{withCredentials:!1}),getBbNonce:e=>mo(`${Oo}/bbnonce?address=${e}`,{withCredentials:!1}),getTokenAccount:(e,t)=>mo(`${Oo}/token_account?address=${e}&token=${t}`,{withCredentials:!1})},So=`/${Ao}/checkpoints`,Ro={getNumber:()=>mo(`${So}/number`,{withCredentials:!1}),getByHash:(e,t=!1)=>mo(`${So}/by_hash?hash=${e}&full=${t}`,{withCredentials:!1}),getByNumber:(e,t=!1)=>mo(`${So}/by_number?number=${e}&full=${t}`,{withCredentials:!1}),getReceiptsByNumber:e=>mo(`${So}/receipts/by_number?number=${e}`,{withCredentials:!1})},xo=`/${Ao}/tokens`,To={getTokenMetadata:e=>mo(`${xo}/token_metadata?token=${e}`,{withCredentials:!1}),manageBlacklist:e=>bo(`${xo}/manage_blacklist`,e,{withCredentials:!1}),manageWhitelist:e=>bo(`${xo}/manage_whitelist`,e,{withCredentials:!1}),burnToken:e=>bo(`${xo}/burn`,e,{withCredentials:!1}),grantAuthority:e=>bo(`${xo}/grant_authority`,e,{withCredentials:!1}),issueToken:e=>bo(`${xo}/issue`,e,{withCredentials:!1}),mintToken:e=>bo(`${xo}/mint`,e,{withCredentials:!1}),pauseToken:e=>bo(`${xo}/pause`,e,{withCredentials:!1}),updateMetadata:e=>bo(`${xo}/update_metadata`,e,{withCredentials:!1}),bridgeAndMint:e=>bo(`${xo}/bridge_and_mint`,e,{withCredentials:!1}),burnAndBridge:e=>bo(`${xo}/burn_and_bridge`,e,{withCredentials:!1}),clawbackToken:e=>bo(`${xo}/clawback`,e,{withCredentials:!1})},ko=`/${Ao}/transactions`,Uo={getByHash:e=>mo(`${ko}/by_hash?hash=${e}`,{withCredentials:!1}),getReceiptByHash:e=>mo(`${ko}/receipt/by_hash?hash=${e}`,{withCredentials:!1}),getFinalizedByHash:e=>mo(`${ko}/finalized/by_hash?hash=${e}`,{withCredentials:!1}),estimateFee:(e,t,n,r)=>mo(`${ko}/estimate_fee?from=${e}&value=${n}&to=${t}&token=${r}`,{withCredentials:!1}),payment:e=>bo(`${ko}/payment`,e,{withCredentials:!1})},Bo=`/${Ao}/chains`,Po={getChainId:()=>mo(`${Bo}/chain_id`,{withCredentials:!1})};var Co,jo,Lo,No;function Fo(e){const t=(null==e?void 0:e.network)||"mainnet";let n=Eo;switch(t){case"mainnet":n=Eo;break;case"testnet":n="https://api.testnet.1money.network";break;case"local":n="http://localhost:18555"}return wo({baseURL:n,isSuccess:(e,t)=>200===t,timeout:(null==e?void 0:e.timeout)||1e4}),{accounts:_o,checkpoints:Ro,tokens:To,transactions:Uo,chain:Po}}!function(e){e.MasterMint="MasterMintBurn",e.MintBurnTokens="MintBurnTokens",e.Pause="Pause",e.ManageList="ManageList",e.UpdateMetadata="UpdateMetadata",e.Bridge="Bridge",e.Clawback="Clawback"}(Co||(Co={})),function(e){e.Grant="Grant",e.Revoke="Revoke"}(jo||(jo={})),function(e){e.Add="Add",e.Remove="Remove"}(Lo||(Lo={})),function(e){e.Pause="Pause",e.Unpause="Unpause"}(No||(No={}));const $o=BigInt("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0");function Io(e,t){return Z(be([we(e),"boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v),_(t.r),_(t.s)]))}function Mo(e){const n=Z(e.rlpBytes),r=t=>(function(e){if(BigInt(e.s)>$o)throw new Error("[1Money SDK]: Invalid signature - high S value detected (potential malleability)")}(t),{kind:e.kind,unsigned:e.unsigned,signatureHash:n,txHash:Io(e.rlpBytes,t),signature:t,toRequest:()=>e.toRequest(e.unsigned,t)});return{kind:e.kind,unsigned:e.unsigned,rlpBytes:e.rlpBytes,signatureHash:n,attachSignature:r,sign:e=>t(this,void 0,void 0,(function*(){return r(yield e.signDigest(n))}))}}const zo=/^\d+$/;function Do(e,t){throw new Error(`[1Money SDK]: Invalid ${e}: ${String(t)}`)}function qo(e,t){(!Number.isSafeInteger(t)||t<=0)&&Do(e,t)}function Ho(e,t){(!Number.isSafeInteger(t)||t<0)&&Do(e,t)}function Yo(e,t){zo.test(t)||Do(e,t)}function Ko(e,t){re(t)||Do(e,t)}function Wo(e){qo("chain_id",e.chain_id),Ho("nonce",e.nonce)}function Jo(e){Ko("recipient",e.recipient),Yo("value",e.value),Ko("token",e.token)}function Vo(e){Yo("value",e.value),Ko("token",e.token)}function Xo(e){Wo(e),Jo(e);return Mo({kind:"payment",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Go(e){var t,n;Wo(e),Ko("authority_address",e.authority_address),Ko("token",e.token),t="value",void 0!==(n=e.value)&&Yo(t,n);const r=[Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.action),Oe.string(e.authority_type),Oe.address(e.authority_address),Oe.address(e.token)];void 0!==e.value&&r.push(Oe.uint(e.value));return Mo({kind:"tokenAuthority",unsigned:e,rlpBytes:_e(Oe.list(r)),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Zo(e){Wo(e),Jo(e),qo("source_chain_id",e.source_chain_id);return Mo({kind:"tokenBridgeAndMint",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token),Oe.uint(e.source_chain_id),Oe.string(e.source_tx_hash),Oe.string(e.bridge_metadata)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Qo(e){Wo(e),Vo(e);return Mo({kind:"tokenBurn",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.uint(e.value),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function es(e){Wo(e),Ko("sender",e.sender),Vo(e),qo("destination_chain_id",e.destination_chain_id),Ko("destination_address",e.destination_address),Yo("escrow_fee",e.escrow_fee);return Mo({kind:"tokenBurnAndBridge",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.sender),Oe.uint(e.value),Oe.address(e.token),Oe.uint(e.destination_chain_id),Oe.string(e.destination_address),Oe.uint(e.escrow_fee),Oe.string(e.bridge_metadata),Oe.hex(e.bridge_param)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ts(e){Wo(e),Jo(e),Ko("from",e.from);return Mo({kind:"tokenClawback",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.token),Oe.address(e.from),Oe.address(e.recipient),Oe.uint(e.value)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ns(e){var t;Wo(e),Ho("decimals",e.decimals),Ko("master_authority",e.master_authority);const n=null===(t=e.clawback_enabled)||void 0===t||t,r=Object.assign(Object.assign({},e),{clawback_enabled:n});return Mo({kind:"tokenIssue",unsigned:r,rlpBytes:_e(Oe.list([Oe.uint(r.chain_id),Oe.uint(r.nonce),Oe.string(r.symbol),Oe.string(r.name),Oe.uint(r.decimals),Oe.address(r.master_authority),Oe.bool(r.is_private),Oe.bool(n)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function rs(e){Wo(e),Ko("address",e.address),Ko("token",e.token);return Mo({kind:"tokenManageList",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.action),Oe.address(e.address),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function is(e){Wo(e),Ko("token",e.token);const t=e.additional_metadata.map((e=>Oe.list([Oe.string(e.key),Oe.string(e.value)])));return Mo({kind:"tokenMetadata",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.name),Oe.string(e.uri),Oe.address(e.token),Oe.list(t)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function os(e){Wo(e),Jo(e);return Mo({kind:"tokenMint",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ss(e){Wo(e),Ko("token",e.token);return Mo({kind:"tokenPause",unsigned:e,rlpBytes:_e(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.action),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}const as=/^0x[0-9a-fA-F]{64}$/;const us={payment:Xo,tokenManageList:rs,tokenBurn:Qo,tokenAuthority:Go,tokenIssue:ns,tokenMint:os,tokenPause:ss,tokenMetadata:is,tokenBridgeAndMint:Zo,tokenBurnAndBridge:es,tokenClawback:ts};var cs={api:Fo,client:vo};e.TransactionBuilder=us,e._typeof=Ut,e.api=Fo,e.calcSignedTxHash=Io,e.calcTxHash=function(e,t){const n=Bt(e),r=be("boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v)),i=be(_(t.r)),o=be(_(t.s)),s=new Uint8Array(r.length+i.length+o.length);s.set(r,0),s.set(i,r.length),s.set(o,r.length+i.length);const a=function(e){if(e<56)return Uint8Array.from([192+e]);{const t=[];let n=e;for(;n>0;)t.unshift(255&n),n>>=8;return Uint8Array.from([247+t.length,...t])}}(n.length+s.length),u=new Uint8Array(a.length+n.length+s.length);return u.set(a,0),u.set(n,a.length),u.set(s,a.length+n.length),Z(u)},e.client=vo,e.createPreparedTx=Mo,e.createPrivateKeySigner=function(e){const n=_(e);return{signDigest:e=>t(this,void 0,void 0,(function*(){if(!as.test(e))throw new Error(`[1Money SDK]: Invalid digest: ${e}`);const t=yield Ot(_(e),n,{lowS:!0}),r=t.toCompactRawBytes(),i=r.subarray(0,32),o=r.subarray(32,64);return{r:y(i),s:y(o),v:t.recovery}}))}},e.default=cs,e.deriveTokenAddress=function(e,t){const n=e.startsWith("0x")?_(e):S(e),r=t.startsWith("0x")?_(t):S(t),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),y(_(Z(i)).slice(12))},e.encodePayload=Bt,e.encodeRlpPayload=_e,e.preparePaymentTx=Xo,e.prepareTokenAuthorityTx=Go,e.prepareTokenBridgeAndMintTx=Zo,e.prepareTokenBurnAndBridgeTx=es,e.prepareTokenBurnTx=Qo,e.prepareTokenClawbackTx=ts,e.prepareTokenIssueTx=ns,e.prepareTokenManageListTx=rs,e.prepareTokenMetadataTx=is,e.prepareTokenMintTx=os,e.prepareTokenPauseTx=ss,e.rlpValue=Oe,e.safePromiseAll=function(e){return e&&e.length?Promise.all(e):Promise.resolve([])},e.safePromiseLine=function(e){return t(this,void 0,void 0,(function*(){if(!e||!e.length)return[];const t=[];for(let n=0;n<e.length;n++)try{t.push(yield e[n](n))}catch(e){}return t}))},e.signMessage=function(e,n){return t(this,void 0,void 0,(function*(){const t=_(Z(Bt(e))),r=_(n),i=yield Ot(t,r,{lowS:!0}),o=i.toCompactRawBytes(),s=o.subarray(0,32),a=o.subarray(32,64);return{r:y(s),s:y(a),v:i.recovery}}))},e.toHex=function(e){const t=Ut(e);try{switch(t){case"boolean":return g(e);case"number":case"bigint":return m(e);case"string":if(/^-?\d+$/.test(e))try{return m(BigInt(e))}catch(t){return m(+e)}return w(e);case"uint8array":case"uint16array":case"uint32array":case"int8array":case"int16array":case"int32array":case"arraybuffer":return y(e);case"array":return 0===e.length?"0x":e.every((e=>"number"==typeof e))?y(Uint8Array.from(e)):y(S(JSON.stringify(e)));default:return y(S(JSON.stringify(e)))}}catch(e){return console.error("[1Money SDK]: toHex error:",e),"0x"}},Object.defineProperty(e,"__esModule",{value:!0})}));
|