@wormhole-foundation/wormhole-connect 1.1.2-beta.0-development → 1.1.2-beta.2-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ccip-CE-u3hjx.js → ccip-ugcVXZ-r.js} +1 -1
- package/dist/assets/{evm-BLq4Ynos.js → evm-DQC4xykE.js} +4 -4
- package/dist/assets/{index-DMkMuW4J.js → index-B1SC-u2d.js} +1 -1
- package/dist/assets/{index-MMpK3g6r.js → index-ClGMzASA.js} +1 -1
- package/dist/assets/{index-DYAKGAkz.js → index-JHRLBcVB.js} +2 -2
- package/dist/assets/{index.es-Bc26J4DB.js → index.es-WG_H7rYm.js} +2 -2
- package/dist/main.js +48 -51
- package/dist/src/hooks/useGetTokenBalances.d.ts.map +1 -1
- package/dist/src/icons/Tokens/CELO.d.ts.map +1 -1
- package/dist/src/store/transferInput.d.ts +0 -1
- package/dist/src/store/transferInput.d.ts.map +1 -1
- package/dist/src/utils/amount.d.ts +4 -0
- package/dist/src/utils/amount.d.ts.map +1 -0
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/index.d.ts.map +1 -1
- package/lib/{algorand-B5akecmo.js → algorand-Bfhml9ow.js} +1 -1
- package/lib/{algorand-DhEHguU8.mjs → algorand-Cjxu_rGT.mjs} +3 -3
- package/lib/{aptos-CpbWqXlz.js → aptos-8LK4z3vn.js} +1 -1
- package/lib/{aptos-C44Jehb8.mjs → aptos-CCPjhoiH.mjs} +1 -1
- package/lib/{aptos-CCDRMaWb.mjs → aptos-DoD0ybSM.mjs} +3 -3
- package/lib/{aptos-CecS5KEb.js → aptos-kknI1DBa.js} +2 -2
- package/lib/{ccip-D1PJreY0.js → ccip-DFb-9M3G.js} +1 -1
- package/lib/{ccip-356EqlMD.mjs → ccip-DPB6Aeux.mjs} +1 -1
- package/lib/{cosmos-Cn2Wsc1e.js → cosmos-Bpf_4aPg.js} +1 -1
- package/lib/{cosmos-CqO6KI9l.mjs → cosmos-D8oxyfb-.mjs} +5 -5
- package/lib/{cosmwasm-BaxTB3uz.js → cosmwasm-B_Hk0_zg.js} +2 -2
- package/lib/{cosmwasm-CPLhyJUa.mjs → cosmwasm-C0n2vNoS.mjs} +6 -6
- package/lib/{events-DcVnNAVr.mjs → events-IweKXbqK.mjs} +1 -1
- package/lib/{events--5HQ-tqg.js → events-wwBkyeeC.js} +1 -1
- package/lib/{evm-CpluUYwM.js → evm-2R09kBJC.js} +1 -1
- package/lib/{evm-BJzw-uU0.mjs → evm-Bd2pCSsJ.mjs} +7 -7
- package/lib/{evm-18u1yu3s.mjs → evm-aPO4WIdi.mjs} +5 -5
- package/lib/{evm-hMhOEfQO.js → evm-fe0Am1O3.js} +4 -4
- package/lib/{index-CSxq_OT-.mjs → index--4VtoDDS.mjs} +4 -4
- package/lib/{index-BG8zY-OA.js → index-0GB3Vnvc.js} +1 -1
- package/lib/{index-9iOOmN3N.js → index-47xrPd7t.js} +1 -1
- package/lib/{index-CvjY28bX.mjs → index-56vFoolS.mjs} +1 -1
- package/lib/{index-COPDbEYS.js → index-B-m4JhhB.js} +6 -9
- package/lib/{index-C0BuB3OV.mjs → index-B18omPyI.mjs} +3 -3
- package/lib/{index-BjO12prV.mjs → index-BA62NbuM.mjs} +2 -2
- package/lib/{index-BEuF9TxN.js → index-BB5T29FD.js} +1 -1
- package/lib/{index-BTCXycYv.js → index-BDrktTYO.js} +1 -1
- package/lib/{index-CFhbh-Kj.js → index-BKRL-VZ-.js} +1 -1
- package/lib/{index-BwnJhXyB.mjs → index-BNvCSTJM.mjs} +2 -2
- package/lib/{index-BAzQP8qT.js → index-BWC_CLDn.js} +1 -1
- package/lib/{index-CEtHOyR8.mjs → index-Bf66m4uH.mjs} +2 -2
- package/lib/{index-DDg66HWP.js → index-Bm4h_tq9.js} +1 -1
- package/lib/{index-C51caWlO.js → index-Bw_OvbxM.js} +1 -1
- package/lib/{index-BQYIHhaJ.mjs → index-C4F1e3oi.mjs} +6 -6
- package/lib/{index-DJox32A6.mjs → index-C7YoUen_.mjs} +2 -2
- package/lib/{index-BgylOxM_.mjs → index-C9ML4MIb.mjs} +2 -2
- package/lib/{index-COwGTp3f.js → index-CCHGtHEs.js} +1 -1
- package/lib/{index-Ck1qa_qW.js → index-CDtHBUln.js} +1 -1
- package/lib/{index-CXHrbv72.mjs → index-CFvHFN54.mjs} +3 -3
- package/lib/{index-DSc8Fz4U.mjs → index-CHzy6dYb.mjs} +1 -1
- package/lib/{index-Dzv3ssXm.mjs → index-CJXTHi_P.mjs} +2 -2
- package/lib/{index-CjQXzo8p.mjs → index-CLOOv5Du.mjs} +3 -3
- package/lib/{index-CDvw534p.js → index-CLbtY-pt.js} +1 -1
- package/lib/{index-BW-v5019.mjs → index-CLwX1P1j.mjs} +3 -3
- package/lib/{index-D6tUolUd.js → index-CTVkfVib.js} +1 -1
- package/lib/{index-CVuuC71x.js → index-CgK6uLkd.js} +1 -1
- package/lib/{index-GUsAuwgF.js → index-Cz-8L-Qb.js} +1 -1
- package/lib/{index-Bg095l2M.mjs → index-D7M_-bS5.mjs} +2 -2
- package/lib/{index-CexKTLA-.mjs → index-DFhYR6id.mjs} +1 -1
- package/lib/{index-BUDCnG5D.mjs → index-DLDcbGAp.mjs} +2 -2
- package/lib/{index-BBserHK5.js → index-DNvjoXDi.js} +1 -1
- package/lib/{index-B25ySG_F.mjs → index-DOb7A68c.mjs} +4 -4
- package/lib/{index-BOD3FZpI.mjs → index-DQ8BRVa9.mjs} +2 -2
- package/lib/{index-uUzikh2-.js → index-DdPHRkXV.js} +1 -1
- package/lib/{index-BfK1GMNg.js → index-Dh_38iiq.js} +1 -1
- package/lib/{index-Bisn-QG_.js → index-DpzW5j0n.js} +1 -1
- package/lib/{index-BUlkHg7S.js → index-Du-JoS7B.js} +1 -1
- package/lib/{index-CS85YWnw.js → index-Mmq175PJ.js} +1 -1
- package/lib/{index-Cdz3m9zK.js → index-NyUOs86a.js} +1 -1
- package/lib/{index-BC8OEwi7.mjs → index-PezPPmQR.mjs} +66 -84
- package/lib/{index-0SReU4B0.mjs → index-TvJJirn8.mjs} +2 -2
- package/lib/{index-B3RPDMyF.mjs → index-eOaDp35h.mjs} +1 -1
- package/lib/{index-BZ0_iTvc.mjs → index-hgDL5OvS.mjs} +1 -1
- package/lib/{index-6E4lxCFK.js → index-xf8W0MMN.js} +1 -1
- package/lib/{index.es-ADRrRLZe.js → index.es-QOrf6vQ0.js} +2 -2
- package/lib/{index.es-DtN-n4tF.mjs → index.es-rchXXbeY.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{keccak-DRlmJq7e.js → keccak-BdDlOEQS.js} +1 -1
- package/lib/{keccak-CUQI4Qmr.mjs → keccak-DKGShrRL.mjs} +1 -1
- package/lib/{libsodium-wrappers-CjL0uEYl.js → libsodium-wrappers-BadAASPQ.js} +1 -1
- package/lib/{libsodium-wrappers-CjurMXAA.mjs → libsodium-wrappers-C2r7sgV4.mjs} +1 -1
- package/lib/{pako.esm-BKtKGYce.mjs → pako.esm-BUTjWIY2.mjs} +2 -2
- package/lib/{pako.esm-B32OATTo.js → pako.esm-DAaoySH_.js} +1 -1
- package/lib/{pbkdf2-BddVwFYF.js → pbkdf2-DDUd1MIo.js} +1 -1
- package/lib/{pbkdf2-BQVU9yJ5.mjs → pbkdf2-DpLdYPlz.mjs} +1 -1
- package/lib/{sei-D1BMoXXx.mjs → sei-BJXcObS8.mjs} +3 -3
- package/lib/{sei-Mf2fbrtH.js → sei-C-M5R_lN.js} +1 -1
- package/lib/{signer-BzJfR0s9.mjs → signer-D72l6J0o.mjs} +1 -1
- package/lib/{signer-Bn45plah.js → signer-nQpU_826.js} +1 -1
- package/lib/{solana-XyyQsjkH.mjs → solana-B7ycHhCW.mjs} +5 -5
- package/lib/{solana-1zE7Ke5_.mjs → solana-Cwzan1t4.mjs} +4 -4
- package/lib/{solana-WevFA0nH.js → solana-D6OY2B-1.js} +1 -1
- package/lib/solana-DEJ3zHI-.js +1 -0
- package/lib/{solanaEmbed.esm-1oxYiyoQ.mjs → solanaEmbed.esm-D9U4HFlG.mjs} +3 -3
- package/lib/{solanaEmbed.esm-95hDJ3L3.js → solanaEmbed.esm-DPWnM67X.js} +1 -1
- package/lib/src/hooks/useGetTokenBalances.d.ts.map +1 -1
- package/lib/src/icons/Tokens/CELO.d.ts.map +1 -1
- package/lib/src/store/transferInput.d.ts +0 -1
- package/lib/src/store/transferInput.d.ts.map +1 -1
- package/lib/src/utils/amount.d.ts +4 -0
- package/lib/src/utils/amount.d.ts.map +1 -0
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/index.d.ts.map +1 -1
- package/lib/{sui-HQt5WjBV.js → sui-826u9KP_.js} +2 -2
- package/lib/{sui-DeYVi1EQ.mjs → sui-CV8X52Ot.mjs} +4 -4
- package/lib/{sui-DZX7xKra.js → sui-DUASPIkT.js} +1 -1
- package/lib/{sui-DfO-5iUS.mjs → sui-sBQX8Jtb.mjs} +1 -1
- package/lib/{unsignedTransaction-C9lNMe9C.js → unsignedTransaction-BXkK1pqs.js} +1 -1
- package/lib/{unsignedTransaction-CDYPDQhc.mjs → unsignedTransaction-DkG4Acpk.mjs} +2 -2
- package/package.json +1 -1
- package/lib/solana-D1ZjaIA3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ge=require("./events
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ge=require("./events-wwBkyeeC.js"),J=require("./index-B-m4JhhB.js"),T=require("./index-Du-JoS7B.js"),I=require("./index-CTVkfVib.js");var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.getLocalStorage=ne.getLocalStorageOrThrow=ne.getCrypto=ne.getCryptoOrThrow=ne.getLocation=ne.getLocationOrThrow=ne.getNavigator=ne.getNavigatorOrThrow=ne.getDocument=ne.getDocumentOrThrow=ne.getFromWindowOrThrow=ne.getFromWindow=void 0;function or(o){let t;return typeof window<"u"&&typeof window[o]<"u"&&(t=window[o]),t}ne.getFromWindow=or;function $r(o){const t=or(o);if(!t)throw new Error(`${o} is not defined in Window`);return t}ne.getFromWindowOrThrow=$r;function ew(){return $r("document")}ne.getDocumentOrThrow=ew;function tw(){return or("document")}ne.getDocument=tw;function rw(){return $r("navigator")}ne.getNavigatorOrThrow=rw;function iw(){return or("navigator")}ne.getNavigator=iw;function sw(){return $r("location")}ne.getLocationOrThrow=sw;function nw(){return or("location")}ne.getLocation=nw;function ow(){return $r("crypto")}ne.getCryptoOrThrow=ow;function aw(){return or("crypto")}ne.getCrypto=aw;function cw(){return $r("localStorage")}ne.getLocalStorageOrThrow=cw;function uw(){return or("localStorage")}ne.getLocalStorage=uw;var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.getWindowMetadata=void 0;const pu=ne;function hw(){let o,t;try{o=pu.getDocumentOrThrow(),t=pu.getLocationOrThrow()}catch{return null}function r(){const O=o.getElementsByTagName("link"),N=[];for(let q=0;q<O.length;q++){const D=O[q],B=D.getAttribute("rel");if(B&&B.toLowerCase().indexOf("icon")>-1){const F=D.getAttribute("href");if(F)if(F.toLowerCase().indexOf("https:")===-1&&F.toLowerCase().indexOf("http:")===-1&&F.indexOf("//")!==0){let G=t.protocol+"//"+t.host;if(F.indexOf("/")===0)G+=F;else{const de=t.pathname.split("/");de.pop();const Z=de.join("/");G+=Z+"/"+F}N.push(G)}else if(F.indexOf("//")===0){const G=t.protocol+F;N.push(G)}else N.push(F)}}return N}function s(...O){const N=o.getElementsByTagName("meta");for(let q=0;q<N.length;q++){const D=N[q],B=["itemprop","property","name"].map(F=>D.getAttribute(F)).filter(F=>F?O.includes(F):!1);if(B.length&&B){const F=D.getAttribute("content");if(F)return F}}return""}function a(){let O=s("name","og:site_name","og:title","twitter:title");return O||(O=o.title),O}function u(){return s("description","og:description","twitter:description","keywords")}const l=a(),g=u(),w=t.origin,b=r();return{description:g,url:w,icons:b,name:l}}bo.getWindowMetadata=hw;function lw(o,t=[]){const r=[];return Object.keys(o).forEach(s=>{if(t.length&&!t.includes(s))return;const a=o[s];r.push(...a.accounts)}),r}const pw={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function dw(o,t){const{message:r,code:s}=pw[o];return{message:r,code:s}}function co(o,t){return!!Array.isArray(o)}var Ar={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -43,4 +43,4 @@ __p += '`),Y&&(R+=`' +
|
|
|
43
43
|
function print() { __p += __j.call(arguments, '') }
|
|
44
44
|
`:`;
|
|
45
45
|
`)+R+`return __p
|
|
46
|
-
}`;var V=uu(function(){return ee(d,j+"return "+R).apply(r,f)});if(V.source=R,Un(V))throw V;return V}function am(e){return te(e).toLowerCase()}function cm(e){return te(e).toUpperCase()}function um(e,i,n){if(e=te(e),e&&(n||i===r))return ma(e);if(!e||!(i=Ve(i)))return e;var c=at(e),h=at(i),d=wa(c,h),f=_a(c,h)+1;return kt(c,d,f).join("")}function hm(e,i,n){if(e=te(e),e&&(n||i===r))return e.slice(0,Ea(e)+1);if(!e||!(i=Ve(i)))return e;var c=at(e),h=_a(c,at(i))+1;return kt(c,0,h).join("")}function lm(e,i,n){if(e=te(e),e&&(n||i===r))return e.replace(qs,"");if(!e||!(i=Ve(i)))return e;var c=at(e),h=wa(c,at(i));return kt(c,h).join("")}function pm(e,i){var n=sl,c=nl;if(le(i)){var h="separator"in i?i.separator:h;n="length"in i?H(i.length):n,c="omission"in i?Ve(i.omission):c}e=te(e);var d=e.length;if(fr(e)){var f=at(e);d=f.length}if(n>=d)return e;var y=n-gr(c);if(y<1)return c;var m=f?kt(f,0,y).join(""):e.slice(0,y);if(h===r)return m+c;if(f&&(y+=m.length-y),Mn(h)){if(e.slice(y).search(h)){var P,S=m;for(h.global||(h=en(h.source,te(Lo.exec(h))+"g")),h.lastIndex=0;P=h.exec(S);)var R=P.index;m=m.slice(0,R===r?y:R)}}else if(e.indexOf(Ve(h),y)!=y){var A=m.lastIndexOf(h);A>-1&&(m=m.slice(0,A))}return m+c}function dm(e){return e=te(e),e&&Il.test(e)?e.replace(qo,kp):e}var fm=Er(function(e,i,n){return e+(n?" ":"")+i.toUpperCase()}),zn=hc("toUpperCase");function cu(e,i,n){return e=te(e),i=n?r:i,i===r?jp(e)?Vp(e):Rp(e):e.match(i)||[]}var uu=K(function(e,i){try{return ze(e,r,i)}catch(n){return Un(n)?n:new k(n)}}),gm=It(function(e,i){return Ye(i,function(n){n=yt(n),bt(e,n,jn(e[n],e))}),e});function ym(e){var i=e==null?0:e.length,n=U();return e=i?ue(e,function(c){if(typeof c[1]!="function")throw new Ze(l);return[n(c[0]),c[1]]}):[],K(function(c){for(var h=-1;++h<i;){var d=e[h];if(ze(d[0],this,c))return ze(d[1],this,c)}})}function vm(e){return kd(et(e,O))}function Hn(e){return function(){return e}}function mm(e,i){return e==null||e!==e?i:e}var wm=pc(),_m=pc(!0);function Ue(e){return e}function Vn(e){return za(typeof e=="function"?e:et(e,O))}function bm(e){return Va(et(e,O))}function Em(e,i){return Ba(e,et(i,O))}var Im=K(function(e,i){return function(n){return Yr(n,e,i)}}),Pm=K(function(e,i){return function(n){return Yr(e,n,i)}});function Bn(e,i,n){var c=be(i),h=Ki(i,c);n==null&&!(le(i)&&(h.length||!c.length))&&(n=i,i=e,e=this,h=Ki(i,be(i)));var d=!(le(n)&&"chain"in n)||!!n.chain,f=St(e);return Ye(h,function(y){var m=i[y];e[y]=m,f&&(e.prototype[y]=function(){var P=this.__chain__;if(d||P){var S=e(this.__wrapped__),R=S.__actions__=Fe(this.__actions__);return R.push({func:m,args:arguments,thisArg:e}),S.__chain__=P,S}return m.apply(e,Ft([this.value()],arguments))})}),e}function Sm(){return Ie._===this&&(Ie._=Qp),this}function Kn(){}function Om(e){return e=H(e),K(function(i){return Ka(i,e)})}var Rm=In(ue),Nm=In(da),Cm=In(Ws);function hu(e){return $n(e)?Js(yt(e)):nf(e)}function $m(e){return function(i){return e==null?r:Xt(e,i)}}var Am=fc(),Tm=fc(!0);function Wn(){return[]}function Jn(){return!1}function xm(){return{}}function Dm(){return""}function Fm(){return!0}function jm(e,i){if(e=H(e),e<1||e>xt)return[];var n=dt,c=Oe(e,dt);i=U(i),e-=dt;for(var h=Ys(c,i);++n<e;)i(n);return h}function qm(e){return z(e)?ue(e,yt):Be(e)?[e]:Fe($c(te(e)))}function Um(e){var i=++Jp;return te(e)+i}var Mm=Zi(function(e,i){return e+i},0),Lm=Pn("ceil"),km=Zi(function(e,i){return e/i},1),zm=Pn("floor");function Hm(e){return e&&e.length?Bi(e,Ue,un):r}function Vm(e,i){return e&&e.length?Bi(e,U(i,2),un):r}function Bm(e){return ya(e,Ue)}function Km(e,i){return ya(e,U(i,2))}function Wm(e){return e&&e.length?Bi(e,Ue,dn):r}function Jm(e,i){return e&&e.length?Bi(e,U(i,2),dn):r}var Gm=Zi(function(e,i){return e*i},1),Qm=Pn("round"),Ym=Zi(function(e,i){return e-i},0);function Zm(e){return e&&e.length?Qs(e,Ue):0}function Xm(e,i){return e&&e.length?Qs(e,U(i,2)):0}return p.after=by,p.ary=kc,p.assign=cv,p.assignIn=tu,p.assignInWith=ls,p.assignWith=uv,p.at=hv,p.before=zc,p.bind=jn,p.bindAll=gm,p.bindKey=Hc,p.castArray=xy,p.chain=Uc,p.chunk=zf,p.compact=Hf,p.concat=Vf,p.cond=ym,p.conforms=vm,p.constant=Hn,p.countBy=Zg,p.create=lv,p.curry=Vc,p.curryRight=Bc,p.debounce=Kc,p.defaults=pv,p.defaultsDeep=dv,p.defer=Ey,p.delay=Iy,p.difference=Bf,p.differenceBy=Kf,p.differenceWith=Wf,p.drop=Jf,p.dropRight=Gf,p.dropRightWhile=Qf,p.dropWhile=Yf,p.fill=Zf,p.filter=ey,p.flatMap=iy,p.flatMapDeep=sy,p.flatMapDepth=ny,p.flatten=Dc,p.flattenDeep=Xf,p.flattenDepth=eg,p.flip=Py,p.flow=wm,p.flowRight=_m,p.fromPairs=tg,p.functions=_v,p.functionsIn=bv,p.groupBy=oy,p.initial=ig,p.intersection=sg,p.intersectionBy=ng,p.intersectionWith=og,p.invert=Iv,p.invertBy=Pv,p.invokeMap=cy,p.iteratee=Vn,p.keyBy=uy,p.keys=be,p.keysIn=qe,p.map=ns,p.mapKeys=Ov,p.mapValues=Rv,p.matches=bm,p.matchesProperty=Em,p.memoize=as,p.merge=Nv,p.mergeWith=ru,p.method=Im,p.methodOf=Pm,p.mixin=Bn,p.negate=cs,p.nthArg=Om,p.omit=Cv,p.omitBy=$v,p.once=Sy,p.orderBy=hy,p.over=Rm,p.overArgs=Oy,p.overEvery=Nm,p.overSome=Cm,p.partial=qn,p.partialRight=Wc,p.partition=ly,p.pick=Av,p.pickBy=iu,p.property=hu,p.propertyOf=$m,p.pull=hg,p.pullAll=jc,p.pullAllBy=lg,p.pullAllWith=pg,p.pullAt=dg,p.range=Am,p.rangeRight=Tm,p.rearg=Ry,p.reject=fy,p.remove=fg,p.rest=Ny,p.reverse=Dn,p.sampleSize=yy,p.set=xv,p.setWith=Dv,p.shuffle=vy,p.slice=gg,p.sortBy=_y,p.sortedUniq=Eg,p.sortedUniqBy=Ig,p.split=im,p.spread=Cy,p.tail=Pg,p.take=Sg,p.takeRight=Og,p.takeRightWhile=Rg,p.takeWhile=Ng,p.tap=Hg,p.throttle=$y,p.thru=ss,p.toArray=Zc,p.toPairs=su,p.toPairsIn=nu,p.toPath=qm,p.toPlainObject=eu,p.transform=Fv,p.unary=Ay,p.union=Cg,p.unionBy=$g,p.unionWith=Ag,p.uniq=Tg,p.uniqBy=xg,p.uniqWith=Dg,p.unset=jv,p.unzip=Fn,p.unzipWith=qc,p.update=qv,p.updateWith=Uv,p.values=Sr,p.valuesIn=Mv,p.without=Fg,p.words=cu,p.wrap=Ty,p.xor=jg,p.xorBy=qg,p.xorWith=Ug,p.zip=Mg,p.zipObject=Lg,p.zipObjectDeep=kg,p.zipWith=zg,p.entries=su,p.entriesIn=nu,p.extend=tu,p.extendWith=ls,Bn(p,p),p.add=Mm,p.attempt=uu,p.camelCase=Hv,p.capitalize=ou,p.ceil=Lm,p.clamp=Lv,p.clone=Dy,p.cloneDeep=jy,p.cloneDeepWith=qy,p.cloneWith=Fy,p.conformsTo=Uy,p.deburr=au,p.defaultTo=mm,p.divide=km,p.endsWith=Vv,p.eq=ut,p.escape=Bv,p.escapeRegExp=Kv,p.every=Xg,p.find=ty,p.findIndex=Tc,p.findKey=fv,p.findLast=ry,p.findLastIndex=xc,p.findLastKey=gv,p.floor=zm,p.forEach=Mc,p.forEachRight=Lc,p.forIn=yv,p.forInRight=vv,p.forOwn=mv,p.forOwnRight=wv,p.get=Ln,p.gt=My,p.gte=Ly,p.has=Ev,p.hasIn=kn,p.head=Fc,p.identity=Ue,p.includes=ay,p.indexOf=rg,p.inRange=kv,p.invoke=Sv,p.isArguments=rr,p.isArray=z,p.isArrayBuffer=ky,p.isArrayLike=je,p.isArrayLikeObject=ge,p.isBoolean=zy,p.isBuffer=zt,p.isDate=Hy,p.isElement=Vy,p.isEmpty=By,p.isEqual=Ky,p.isEqualWith=Wy,p.isError=Un,p.isFinite=Jy,p.isFunction=St,p.isInteger=Jc,p.isLength=us,p.isMap=Gc,p.isMatch=Gy,p.isMatchWith=Qy,p.isNaN=Yy,p.isNative=Zy,p.isNil=ev,p.isNull=Xy,p.isNumber=Qc,p.isObject=le,p.isObjectLike=pe,p.isPlainObject=ii,p.isRegExp=Mn,p.isSafeInteger=tv,p.isSet=Yc,p.isString=hs,p.isSymbol=Be,p.isTypedArray=Pr,p.isUndefined=rv,p.isWeakMap=iv,p.isWeakSet=sv,p.join=ag,p.kebabCase=Wv,p.last=rt,p.lastIndexOf=cg,p.lowerCase=Jv,p.lowerFirst=Gv,p.lt=nv,p.lte=ov,p.max=Hm,p.maxBy=Vm,p.mean=Bm,p.meanBy=Km,p.min=Wm,p.minBy=Jm,p.stubArray=Wn,p.stubFalse=Jn,p.stubObject=xm,p.stubString=Dm,p.stubTrue=Fm,p.multiply=Gm,p.nth=ug,p.noConflict=Sm,p.noop=Kn,p.now=os,p.pad=Qv,p.padEnd=Yv,p.padStart=Zv,p.parseInt=Xv,p.random=zv,p.reduce=py,p.reduceRight=dy,p.repeat=em,p.replace=tm,p.result=Tv,p.round=Qm,p.runInContext=v,p.sample=gy,p.size=my,p.snakeCase=rm,p.some=wy,p.sortedIndex=yg,p.sortedIndexBy=vg,p.sortedIndexOf=mg,p.sortedLastIndex=wg,p.sortedLastIndexBy=_g,p.sortedLastIndexOf=bg,p.startCase=sm,p.startsWith=nm,p.subtract=Ym,p.sum=Zm,p.sumBy=Xm,p.template=om,p.times=jm,p.toFinite=Ot,p.toInteger=H,p.toLength=Xc,p.toLower=am,p.toNumber=it,p.toSafeInteger=av,p.toString=te,p.toUpper=cm,p.trim=um,p.trimEnd=hm,p.trimStart=lm,p.truncate=pm,p.unescape=dm,p.uniqueId=Um,p.upperCase=fm,p.upperFirst=zn,p.each=Mc,p.eachRight=Lc,p.first=Fc,Bn(p,function(){var e={};return ft(p,function(i,n){re.call(p.prototype,n)||(e[n]=i)}),e}(),{chain:!1}),p.VERSION=s,Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),Ye(["drop","take"],function(e,i){Q.prototype[e]=function(n){n=n===r?1:_e(H(n),0);var c=this.__filtered__&&!i?new Q(this):this.clone();return c.__filtered__?c.__takeCount__=Oe(n,c.__takeCount__):c.__views__.push({size:Oe(n,dt),type:e+(c.__dir__<0?"Right":"")}),c},Q.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Ye(["filter","map","takeWhile"],function(e,i){var n=i+1,c=n==Do||n==ul;Q.prototype[e]=function(h){var d=this.clone();return d.__iteratees__.push({iteratee:U(h,3),type:n}),d.__filtered__=d.__filtered__||c,d}}),Ye(["head","last"],function(e,i){var n="take"+(i?"Right":"");Q.prototype[e]=function(){return this[n](1).value()[0]}}),Ye(["initial","tail"],function(e,i){var n="drop"+(i?"":"Right");Q.prototype[e]=function(){return this.__filtered__?new Q(this):this[n](1)}}),Q.prototype.compact=function(){return this.filter(Ue)},Q.prototype.find=function(e){return this.filter(e).head()},Q.prototype.findLast=function(e){return this.reverse().find(e)},Q.prototype.invokeMap=K(function(e,i){return typeof e=="function"?new Q(this):this.map(function(n){return Yr(n,e,i)})}),Q.prototype.reject=function(e){return this.filter(cs(U(e)))},Q.prototype.slice=function(e,i){e=H(e);var n=this;return n.__filtered__&&(e>0||i<0)?new Q(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==r&&(i=H(i),n=i<0?n.dropRight(-i):n.take(i-e)),n)},Q.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Q.prototype.toArray=function(){return this.take(dt)},ft(Q.prototype,function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),h=p[c?"take"+(i=="last"?"Right":""):i],d=c||/^find/.test(i);h&&(p.prototype[i]=function(){var f=this.__wrapped__,y=c?[1]:arguments,m=f instanceof Q,P=y[0],S=m||z(f),R=function(W){var Y=h.apply(p,Ft([W],y));return c&&A?Y[0]:Y};S&&n&&typeof P=="function"&&P.length!=1&&(m=S=!1);var A=this.__chain__,j=!!this.__actions__.length,M=d&&!A,V=m&&!j;if(!d&&S){f=V?f:new Q(this);var L=e.apply(f,y);return L.__actions__.push({func:ss,args:[R],thisArg:r}),new Xe(L,A)}return M&&V?e.apply(this,y):(L=this.thru(R),M?c?L.value()[0]:L.value():L)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(e){var i=$i[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var h=arguments;if(c&&!this.__chain__){var d=this.value();return i.apply(z(d)?d:[],h)}return this[n](function(f){return i.apply(z(f)?f:[],h)})}}),ft(Q.prototype,function(e,i){var n=p[i];if(n){var c=n.name+"";re.call(wr,c)||(wr[c]=[]),wr[c].push({name:i,func:n})}}),wr[Yi(r,G).name]=[{name:"wrapper",func:r}],Q.prototype.clone=pd,Q.prototype.reverse=dd,Q.prototype.value=fd,p.prototype.at=Vg,p.prototype.chain=Bg,p.prototype.commit=Kg,p.prototype.next=Wg,p.prototype.plant=Gg,p.prototype.reverse=Qg,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Yg,p.prototype.first=p.prototype.head,Vr&&(p.prototype[Vr]=Jg),p},yr=Bp();Jt?((Jt.exports=yr)._=yr,Hs._=yr):Ie._=yr}).call(hi)})(_o,_o.exports);var YE=Object.defineProperty,ZE=Object.defineProperties,XE=Object.getOwnPropertyDescriptors,ph=Object.getOwnPropertySymbols,eI=Object.prototype.hasOwnProperty,tI=Object.prototype.propertyIsEnumerable,dh=(o,t,r)=>t in o?YE(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,fs=(o,t)=>{for(var r in t||(t={}))eI.call(t,r)&&dh(o,r,t[r]);if(ph)for(var r of ph(t))tI.call(t,r)&&dh(o,r,t[r]);return o},rI=(o,t)=>ZE(o,XE(t));function Bt(o,t,r){var s;const a=R0(o);return((s=t.rpcMap)==null?void 0:s[a.reference])||`${QE}?chainId=${a.namespace}:${a.reference}&projectId=${r}`}function ur(o){return o.includes(":")?o.split(":")[1]:o}function el(o){return o.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function iI(o,t){const r=Object.keys(t.namespaces).filter(a=>a.includes(o));if(!r.length)return[];const s=[];return r.forEach(a=>{const u=t.namespaces[a].accounts;s.push(...u)}),s}function sI(o={},t={}){const r=fh(o),s=fh(t);return _o.exports.merge(r,s)}function fh(o){var t,r,s,a;const u={};if(!Cr(o))return u;for(const[l,g]of Object.entries(o)){const w=No(l)?[l]:g.chains,b=g.methods||[],C=g.events||[],O=g.rpcMap||{},N=li(l);u[N]=rI(fs(fs({},u[N]),g),{chains:Yn(w,(t=u[N])==null?void 0:t.chains),methods:Yn(b,(r=u[N])==null?void 0:r.methods),events:Yn(C,(s=u[N])==null?void 0:s.events),rpcMap:fs(fs({},O),(a=u[N])==null?void 0:a.rpcMap)})}return u}function nI(o){return o.includes(":")?o.split(":")[2]:o}function oI(o){const t={};for(const[r,s]of Object.entries(o)){const a=s.methods||[],u=s.events||[],l=s.accounts||[],g=No(r)?[r]:s.chains?s.chains:el(s.accounts);t[r]={chains:g,methods:a,events:u,accounts:l}}return t}function so(o){return typeof o=="number"?o:o.includes("0x")?parseInt(o,16):o.includes(":")?Number(o.split(":")[1]):Number(o)}const tl={},he=o=>tl[o],no=(o,t)=>{tl[o]=t};class aI{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class cI{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const s=r||Bt(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=parseInt(ur(r));t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,s;let a=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";a=a.startsWith("0x")?a:`0x${a}`;const u=parseInt(a,16);if(this.isChainApproved(u))this.setDefaultChain(`${u}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:a}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${u}`);else throw new Error(`Failed to switch to chain 'eip155:${u}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class uI{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class hI{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class lI{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const s=this.getCardanoRPCUrl(r),a=ur(r);t[a]=this.createHttpProvider(a,s)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||this.getCardanoRPCUrl(t);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class pI{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class dI{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class fI{constructor(t){this.name="near",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const s=r||Bt(`${this.name}:${t}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;t[r]=this.createHttpProvider(r,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace);return typeof s>"u"?void 0:new $t(new Kt(s,he("disableProviderPing")))}}var gI=Object.defineProperty,yI=Object.defineProperties,vI=Object.getOwnPropertyDescriptors,gh=Object.getOwnPropertySymbols,mI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,yh=(o,t,r)=>t in o?gI(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,gs=(o,t)=>{for(var r in t||(t={}))mI.call(t,r)&&yh(o,r,t[r]);if(gh)for(var r of gh(t))wI.call(t,r)&&yh(o,r,t[r]);return o},oo=(o,t)=>yI(o,vI(t));class xo{constructor(t){this.events=new Ge.es,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:I.qt(I.k({level:(t==null?void 0:t.logger)||hh})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const r=new xo(t);return await r.initialize(),r}async request(t,r){const[s,a]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:gs({},t),chainId:`${s}:${a}`,topic:this.session.topic})}sendAsync(t,r,s){const a=new Date().getTime();this.request(t,s).then(u=>r(null,I.formatJsonRpcResult(a,u))).catch(u=>r(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:ve("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:a}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await a().then(u=>{this.session=u,this.namespaces||(this.namespaces=oI(u.namespaces),this.persist("namespaces",this.namespaces))}).catch(u=>{if(u.message!==Zh)throw u;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[s,a]=this.validateChain(t);this.getProvider(s).setDefaultChain(a,r)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(nr(r)){for(const s of r)t.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await jE.init({logger:this.providerOpts.logger||hh,relayUrl:this.providerOpts.relayUrl||WE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(r=>li(r)))];no("client",this.client),no("events",this.events),no("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const s=iI(r,this.session),a=el(s),u=sI(this.namespaces,this.optionalNamespaces),l=oo(gs({},u[r]),{accounts:s,chains:a});switch(r){case"eip155":this.rpcProviders[r]=new cI({namespace:l});break;case"solana":this.rpcProviders[r]=new uI({namespace:l});break;case"cosmos":this.rpcProviders[r]=new hI({namespace:l});break;case"polkadot":this.rpcProviders[r]=new aI({namespace:l});break;case"cip34":this.rpcProviders[r]=new lI({namespace:l});break;case"elrond":this.rpcProviders[r]=new pI({namespace:l});break;case"multiversx":this.rpcProviders[r]=new dI({namespace:l});break;case"near":this.rpcProviders[r]=new fI({namespace:l});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:s}=r;if(s.name==="accountsChanged"){const a=s.data;a&&nr(a)&&this.events.emit("accountsChanged",a.map(nI))}else if(s.name==="chainChanged"){const a=r.chainId,u=r.event.data,l=li(a),g=so(a)!==so(u)?`${l}:${so(u)}`:a;this.onChainChanged(g)}else this.events.emit(s.name,s.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var s;const{namespaces:a}=r,u=(s=this.client)==null?void 0:s.session.get(t);this.session=oo(gs({},u),{namespaces:a}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",oo(gs({},ve("USER_DISCONNECTED")),{data:t.topic}))}),this.on(At.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:s,sessionProperties:a}=t;r&&Object.keys(r).length&&(this.namespaces=r),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=a,this.persist("namespaces",r),this.persist("optionalNamespaces",s)}validateChain(t){const[r,s]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,s];if(r&&!Object.keys(this.namespaces||{}).map(l=>li(l)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&s)return[r,s];const a=li(Object.keys(this.namespaces)[0]),u=this.rpcProviders[a].getDefaultChain();return[a,u]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){var s;if(!this.namespaces)return;const[a,u]=this.validateChain(t);r||this.getProvider(a).setDefaultChain(u),((s=this.namespaces[a])!=null?s:this.namespaces[`${a}:${u}`]).defaultChain=u,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",u)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,r){this.client.core.storage.setItem(`${lh}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${lh}/${t}`)}}const _I=xo,bI="wc",EI="ethereum_provider",II=`${bI}@2:${EI}:`,PI="https://rpc.walletconnect.com/v1/",_s=["eth_sendTransaction","personal_sign"],rl=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],bs=["chainChanged","accountsChanged"],il=["chainChanged","accountsChanged","message","disconnect","connect"];var SI=Object.defineProperty,OI=Object.defineProperties,RI=Object.getOwnPropertyDescriptors,vh=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,mh=(o,t,r)=>t in o?SI(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,di=(o,t)=>{for(var r in t||(t={}))NI.call(t,r)&&mh(o,r,t[r]);if(vh)for(var r of vh(t))CI.call(t,r)&&mh(o,r,t[r]);return o},wh=(o,t)=>OI(o,RI(t));function Es(o){return Number(o[0].split(":")[1])}function ao(o){return`0x${o.toString(16)}`}function $I(o){const{chains:t,optionalChains:r,methods:s,optionalMethods:a,events:u,optionalEvents:l,rpcMap:g}=o;if(!co(t))throw new Error("Invalid chains");const w={chains:t,methods:s||_s,events:u||bs,rpcMap:di({},t.length?{[Es(t)]:g[Es(t)]}:{})},b=u==null?void 0:u.filter(q=>!bs.includes(q)),C=s==null?void 0:s.filter(q=>!_s.includes(q));if(!r&&!l&&!a&&!(b!=null&&b.length)&&!(C!=null&&C.length))return{required:t.length?w:void 0};const O=(b==null?void 0:b.length)&&(C==null?void 0:C.length)||!r,N={chains:[...new Set(O?w.chains.concat(r||[]):r)],methods:[...new Set(w.methods.concat(a!=null&&a.length?a:rl))],events:[...new Set(w.events.concat(l!=null&&l.length?l:il))],rpcMap:g};return{required:t.length?w:void 0,optional:r.length?N:void 0}}class Os{constructor(){this.events=new Ge.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=II,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new Os;return await r.initialize(t),r}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,r){this.signer.sendAsync(t,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:s}=$I(this.rpc);try{const a=await new Promise(async(l,g)=>{var w;this.rpc.showQrModal&&((w=this.modal)==null||w.subscribeModal(b=>{!b.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),g(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(wh(di({namespaces:di({},r&&{[this.namespace]:r})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(b=>{l(b)}).catch(b=>{g(new Error(b.message))})});if(!a)return;const u=lw(a.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:u),this.setAccounts(u),this.events.emit("connect",{chainId:ao(this.chainId)})}catch(a){throw this.signer.logger.error(a),a}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:r}=t,{event:s}=r;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",ao(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",wh(di({},dw("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,s;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(s=this.modal)==null||s.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",ao(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,s,a]=t.split(":");return{chainId:`${r}:${s}`,address:a}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,s;const a=(r=t==null?void 0:t.chains)!=null?r:[],u=(s=t==null?void 0:t.optionalChains)!=null?s:[],l=a.concat(u);if(!l.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const g=a.length?(t==null?void 0:t.methods)||_s:[],w=a.length?(t==null?void 0:t.events)||bs:[],b=(t==null?void 0:t.optionalMethods)||[],C=(t==null?void 0:t.optionalEvents)||[],O=(t==null?void 0:t.rpcMap)||this.buildRpcMap(l,t.projectId),N=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:a==null?void 0:a.map(q=>this.formatChainId(q)),optionalChains:u.map(q=>this.formatChainId(q)),methods:g,events:w,optionalMethods:b,optionalEvents:C,rpcMap:O,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:N,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const s={};return t.forEach(a=>{s[a]=this.getRpcUrl(a,r)}),s}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?Es(this.rpc.chains):Es(this.rpc.optionalChains),this.signer=await _I.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:s}=await Promise.resolve().then(()=>require("./index-BEuF9TxN.js")).then(a=>a.index);r=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(di({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:s,rpcMap:a}=t;r&&co(r)&&(this.rpc.chains=r.map(u=>this.formatChainId(u)),r.forEach(u=>{this.rpc.rpcMap[u]=(a==null?void 0:a[u])||this.getRpcUrl(u)})),s&&co(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(u=>this.formatChainId(u)),s.forEach(u=>{this.rpc.rpcMap[u]=(a==null?void 0:a[u])||this.getRpcUrl(u)}))}getRpcUrl(t,r){var s;return((s=this.rpc.rpcMap)==null?void 0:s[t])||`${PI}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}}const AI=Os;exports.EthereumProvider=AI;exports.OPTIONAL_EVENTS=il;exports.OPTIONAL_METHODS=rl;exports.REQUIRED_EVENTS=bs;exports.REQUIRED_METHODS=_s;exports.default=Os;
|
|
46
|
+
}`;var V=uu(function(){return ee(d,j+"return "+R).apply(r,f)});if(V.source=R,Un(V))throw V;return V}function am(e){return te(e).toLowerCase()}function cm(e){return te(e).toUpperCase()}function um(e,i,n){if(e=te(e),e&&(n||i===r))return ma(e);if(!e||!(i=Ve(i)))return e;var c=at(e),h=at(i),d=wa(c,h),f=_a(c,h)+1;return kt(c,d,f).join("")}function hm(e,i,n){if(e=te(e),e&&(n||i===r))return e.slice(0,Ea(e)+1);if(!e||!(i=Ve(i)))return e;var c=at(e),h=_a(c,at(i))+1;return kt(c,0,h).join("")}function lm(e,i,n){if(e=te(e),e&&(n||i===r))return e.replace(qs,"");if(!e||!(i=Ve(i)))return e;var c=at(e),h=wa(c,at(i));return kt(c,h).join("")}function pm(e,i){var n=sl,c=nl;if(le(i)){var h="separator"in i?i.separator:h;n="length"in i?H(i.length):n,c="omission"in i?Ve(i.omission):c}e=te(e);var d=e.length;if(fr(e)){var f=at(e);d=f.length}if(n>=d)return e;var y=n-gr(c);if(y<1)return c;var m=f?kt(f,0,y).join(""):e.slice(0,y);if(h===r)return m+c;if(f&&(y+=m.length-y),Mn(h)){if(e.slice(y).search(h)){var P,S=m;for(h.global||(h=en(h.source,te(Lo.exec(h))+"g")),h.lastIndex=0;P=h.exec(S);)var R=P.index;m=m.slice(0,R===r?y:R)}}else if(e.indexOf(Ve(h),y)!=y){var A=m.lastIndexOf(h);A>-1&&(m=m.slice(0,A))}return m+c}function dm(e){return e=te(e),e&&Il.test(e)?e.replace(qo,kp):e}var fm=Er(function(e,i,n){return e+(n?" ":"")+i.toUpperCase()}),zn=hc("toUpperCase");function cu(e,i,n){return e=te(e),i=n?r:i,i===r?jp(e)?Vp(e):Rp(e):e.match(i)||[]}var uu=K(function(e,i){try{return ze(e,r,i)}catch(n){return Un(n)?n:new k(n)}}),gm=It(function(e,i){return Ye(i,function(n){n=yt(n),bt(e,n,jn(e[n],e))}),e});function ym(e){var i=e==null?0:e.length,n=U();return e=i?ue(e,function(c){if(typeof c[1]!="function")throw new Ze(l);return[n(c[0]),c[1]]}):[],K(function(c){for(var h=-1;++h<i;){var d=e[h];if(ze(d[0],this,c))return ze(d[1],this,c)}})}function vm(e){return kd(et(e,O))}function Hn(e){return function(){return e}}function mm(e,i){return e==null||e!==e?i:e}var wm=pc(),_m=pc(!0);function Ue(e){return e}function Vn(e){return za(typeof e=="function"?e:et(e,O))}function bm(e){return Va(et(e,O))}function Em(e,i){return Ba(e,et(i,O))}var Im=K(function(e,i){return function(n){return Yr(n,e,i)}}),Pm=K(function(e,i){return function(n){return Yr(e,n,i)}});function Bn(e,i,n){var c=be(i),h=Ki(i,c);n==null&&!(le(i)&&(h.length||!c.length))&&(n=i,i=e,e=this,h=Ki(i,be(i)));var d=!(le(n)&&"chain"in n)||!!n.chain,f=St(e);return Ye(h,function(y){var m=i[y];e[y]=m,f&&(e.prototype[y]=function(){var P=this.__chain__;if(d||P){var S=e(this.__wrapped__),R=S.__actions__=Fe(this.__actions__);return R.push({func:m,args:arguments,thisArg:e}),S.__chain__=P,S}return m.apply(e,Ft([this.value()],arguments))})}),e}function Sm(){return Ie._===this&&(Ie._=Qp),this}function Kn(){}function Om(e){return e=H(e),K(function(i){return Ka(i,e)})}var Rm=In(ue),Nm=In(da),Cm=In(Ws);function hu(e){return $n(e)?Js(yt(e)):nf(e)}function $m(e){return function(i){return e==null?r:Xt(e,i)}}var Am=fc(),Tm=fc(!0);function Wn(){return[]}function Jn(){return!1}function xm(){return{}}function Dm(){return""}function Fm(){return!0}function jm(e,i){if(e=H(e),e<1||e>xt)return[];var n=dt,c=Oe(e,dt);i=U(i),e-=dt;for(var h=Ys(c,i);++n<e;)i(n);return h}function qm(e){return z(e)?ue(e,yt):Be(e)?[e]:Fe($c(te(e)))}function Um(e){var i=++Jp;return te(e)+i}var Mm=Zi(function(e,i){return e+i},0),Lm=Pn("ceil"),km=Zi(function(e,i){return e/i},1),zm=Pn("floor");function Hm(e){return e&&e.length?Bi(e,Ue,un):r}function Vm(e,i){return e&&e.length?Bi(e,U(i,2),un):r}function Bm(e){return ya(e,Ue)}function Km(e,i){return ya(e,U(i,2))}function Wm(e){return e&&e.length?Bi(e,Ue,dn):r}function Jm(e,i){return e&&e.length?Bi(e,U(i,2),dn):r}var Gm=Zi(function(e,i){return e*i},1),Qm=Pn("round"),Ym=Zi(function(e,i){return e-i},0);function Zm(e){return e&&e.length?Qs(e,Ue):0}function Xm(e,i){return e&&e.length?Qs(e,U(i,2)):0}return p.after=by,p.ary=kc,p.assign=cv,p.assignIn=tu,p.assignInWith=ls,p.assignWith=uv,p.at=hv,p.before=zc,p.bind=jn,p.bindAll=gm,p.bindKey=Hc,p.castArray=xy,p.chain=Uc,p.chunk=zf,p.compact=Hf,p.concat=Vf,p.cond=ym,p.conforms=vm,p.constant=Hn,p.countBy=Zg,p.create=lv,p.curry=Vc,p.curryRight=Bc,p.debounce=Kc,p.defaults=pv,p.defaultsDeep=dv,p.defer=Ey,p.delay=Iy,p.difference=Bf,p.differenceBy=Kf,p.differenceWith=Wf,p.drop=Jf,p.dropRight=Gf,p.dropRightWhile=Qf,p.dropWhile=Yf,p.fill=Zf,p.filter=ey,p.flatMap=iy,p.flatMapDeep=sy,p.flatMapDepth=ny,p.flatten=Dc,p.flattenDeep=Xf,p.flattenDepth=eg,p.flip=Py,p.flow=wm,p.flowRight=_m,p.fromPairs=tg,p.functions=_v,p.functionsIn=bv,p.groupBy=oy,p.initial=ig,p.intersection=sg,p.intersectionBy=ng,p.intersectionWith=og,p.invert=Iv,p.invertBy=Pv,p.invokeMap=cy,p.iteratee=Vn,p.keyBy=uy,p.keys=be,p.keysIn=qe,p.map=ns,p.mapKeys=Ov,p.mapValues=Rv,p.matches=bm,p.matchesProperty=Em,p.memoize=as,p.merge=Nv,p.mergeWith=ru,p.method=Im,p.methodOf=Pm,p.mixin=Bn,p.negate=cs,p.nthArg=Om,p.omit=Cv,p.omitBy=$v,p.once=Sy,p.orderBy=hy,p.over=Rm,p.overArgs=Oy,p.overEvery=Nm,p.overSome=Cm,p.partial=qn,p.partialRight=Wc,p.partition=ly,p.pick=Av,p.pickBy=iu,p.property=hu,p.propertyOf=$m,p.pull=hg,p.pullAll=jc,p.pullAllBy=lg,p.pullAllWith=pg,p.pullAt=dg,p.range=Am,p.rangeRight=Tm,p.rearg=Ry,p.reject=fy,p.remove=fg,p.rest=Ny,p.reverse=Dn,p.sampleSize=yy,p.set=xv,p.setWith=Dv,p.shuffle=vy,p.slice=gg,p.sortBy=_y,p.sortedUniq=Eg,p.sortedUniqBy=Ig,p.split=im,p.spread=Cy,p.tail=Pg,p.take=Sg,p.takeRight=Og,p.takeRightWhile=Rg,p.takeWhile=Ng,p.tap=Hg,p.throttle=$y,p.thru=ss,p.toArray=Zc,p.toPairs=su,p.toPairsIn=nu,p.toPath=qm,p.toPlainObject=eu,p.transform=Fv,p.unary=Ay,p.union=Cg,p.unionBy=$g,p.unionWith=Ag,p.uniq=Tg,p.uniqBy=xg,p.uniqWith=Dg,p.unset=jv,p.unzip=Fn,p.unzipWith=qc,p.update=qv,p.updateWith=Uv,p.values=Sr,p.valuesIn=Mv,p.without=Fg,p.words=cu,p.wrap=Ty,p.xor=jg,p.xorBy=qg,p.xorWith=Ug,p.zip=Mg,p.zipObject=Lg,p.zipObjectDeep=kg,p.zipWith=zg,p.entries=su,p.entriesIn=nu,p.extend=tu,p.extendWith=ls,Bn(p,p),p.add=Mm,p.attempt=uu,p.camelCase=Hv,p.capitalize=ou,p.ceil=Lm,p.clamp=Lv,p.clone=Dy,p.cloneDeep=jy,p.cloneDeepWith=qy,p.cloneWith=Fy,p.conformsTo=Uy,p.deburr=au,p.defaultTo=mm,p.divide=km,p.endsWith=Vv,p.eq=ut,p.escape=Bv,p.escapeRegExp=Kv,p.every=Xg,p.find=ty,p.findIndex=Tc,p.findKey=fv,p.findLast=ry,p.findLastIndex=xc,p.findLastKey=gv,p.floor=zm,p.forEach=Mc,p.forEachRight=Lc,p.forIn=yv,p.forInRight=vv,p.forOwn=mv,p.forOwnRight=wv,p.get=Ln,p.gt=My,p.gte=Ly,p.has=Ev,p.hasIn=kn,p.head=Fc,p.identity=Ue,p.includes=ay,p.indexOf=rg,p.inRange=kv,p.invoke=Sv,p.isArguments=rr,p.isArray=z,p.isArrayBuffer=ky,p.isArrayLike=je,p.isArrayLikeObject=ge,p.isBoolean=zy,p.isBuffer=zt,p.isDate=Hy,p.isElement=Vy,p.isEmpty=By,p.isEqual=Ky,p.isEqualWith=Wy,p.isError=Un,p.isFinite=Jy,p.isFunction=St,p.isInteger=Jc,p.isLength=us,p.isMap=Gc,p.isMatch=Gy,p.isMatchWith=Qy,p.isNaN=Yy,p.isNative=Zy,p.isNil=ev,p.isNull=Xy,p.isNumber=Qc,p.isObject=le,p.isObjectLike=pe,p.isPlainObject=ii,p.isRegExp=Mn,p.isSafeInteger=tv,p.isSet=Yc,p.isString=hs,p.isSymbol=Be,p.isTypedArray=Pr,p.isUndefined=rv,p.isWeakMap=iv,p.isWeakSet=sv,p.join=ag,p.kebabCase=Wv,p.last=rt,p.lastIndexOf=cg,p.lowerCase=Jv,p.lowerFirst=Gv,p.lt=nv,p.lte=ov,p.max=Hm,p.maxBy=Vm,p.mean=Bm,p.meanBy=Km,p.min=Wm,p.minBy=Jm,p.stubArray=Wn,p.stubFalse=Jn,p.stubObject=xm,p.stubString=Dm,p.stubTrue=Fm,p.multiply=Gm,p.nth=ug,p.noConflict=Sm,p.noop=Kn,p.now=os,p.pad=Qv,p.padEnd=Yv,p.padStart=Zv,p.parseInt=Xv,p.random=zv,p.reduce=py,p.reduceRight=dy,p.repeat=em,p.replace=tm,p.result=Tv,p.round=Qm,p.runInContext=v,p.sample=gy,p.size=my,p.snakeCase=rm,p.some=wy,p.sortedIndex=yg,p.sortedIndexBy=vg,p.sortedIndexOf=mg,p.sortedLastIndex=wg,p.sortedLastIndexBy=_g,p.sortedLastIndexOf=bg,p.startCase=sm,p.startsWith=nm,p.subtract=Ym,p.sum=Zm,p.sumBy=Xm,p.template=om,p.times=jm,p.toFinite=Ot,p.toInteger=H,p.toLength=Xc,p.toLower=am,p.toNumber=it,p.toSafeInteger=av,p.toString=te,p.toUpper=cm,p.trim=um,p.trimEnd=hm,p.trimStart=lm,p.truncate=pm,p.unescape=dm,p.uniqueId=Um,p.upperCase=fm,p.upperFirst=zn,p.each=Mc,p.eachRight=Lc,p.first=Fc,Bn(p,function(){var e={};return ft(p,function(i,n){re.call(p.prototype,n)||(e[n]=i)}),e}(),{chain:!1}),p.VERSION=s,Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),Ye(["drop","take"],function(e,i){Q.prototype[e]=function(n){n=n===r?1:_e(H(n),0);var c=this.__filtered__&&!i?new Q(this):this.clone();return c.__filtered__?c.__takeCount__=Oe(n,c.__takeCount__):c.__views__.push({size:Oe(n,dt),type:e+(c.__dir__<0?"Right":"")}),c},Q.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Ye(["filter","map","takeWhile"],function(e,i){var n=i+1,c=n==Do||n==ul;Q.prototype[e]=function(h){var d=this.clone();return d.__iteratees__.push({iteratee:U(h,3),type:n}),d.__filtered__=d.__filtered__||c,d}}),Ye(["head","last"],function(e,i){var n="take"+(i?"Right":"");Q.prototype[e]=function(){return this[n](1).value()[0]}}),Ye(["initial","tail"],function(e,i){var n="drop"+(i?"":"Right");Q.prototype[e]=function(){return this.__filtered__?new Q(this):this[n](1)}}),Q.prototype.compact=function(){return this.filter(Ue)},Q.prototype.find=function(e){return this.filter(e).head()},Q.prototype.findLast=function(e){return this.reverse().find(e)},Q.prototype.invokeMap=K(function(e,i){return typeof e=="function"?new Q(this):this.map(function(n){return Yr(n,e,i)})}),Q.prototype.reject=function(e){return this.filter(cs(U(e)))},Q.prototype.slice=function(e,i){e=H(e);var n=this;return n.__filtered__&&(e>0||i<0)?new Q(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==r&&(i=H(i),n=i<0?n.dropRight(-i):n.take(i-e)),n)},Q.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Q.prototype.toArray=function(){return this.take(dt)},ft(Q.prototype,function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),h=p[c?"take"+(i=="last"?"Right":""):i],d=c||/^find/.test(i);h&&(p.prototype[i]=function(){var f=this.__wrapped__,y=c?[1]:arguments,m=f instanceof Q,P=y[0],S=m||z(f),R=function(W){var Y=h.apply(p,Ft([W],y));return c&&A?Y[0]:Y};S&&n&&typeof P=="function"&&P.length!=1&&(m=S=!1);var A=this.__chain__,j=!!this.__actions__.length,M=d&&!A,V=m&&!j;if(!d&&S){f=V?f:new Q(this);var L=e.apply(f,y);return L.__actions__.push({func:ss,args:[R],thisArg:r}),new Xe(L,A)}return M&&V?e.apply(this,y):(L=this.thru(R),M?c?L.value()[0]:L.value():L)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(e){var i=$i[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var h=arguments;if(c&&!this.__chain__){var d=this.value();return i.apply(z(d)?d:[],h)}return this[n](function(f){return i.apply(z(f)?f:[],h)})}}),ft(Q.prototype,function(e,i){var n=p[i];if(n){var c=n.name+"";re.call(wr,c)||(wr[c]=[]),wr[c].push({name:i,func:n})}}),wr[Yi(r,G).name]=[{name:"wrapper",func:r}],Q.prototype.clone=pd,Q.prototype.reverse=dd,Q.prototype.value=fd,p.prototype.at=Vg,p.prototype.chain=Bg,p.prototype.commit=Kg,p.prototype.next=Wg,p.prototype.plant=Gg,p.prototype.reverse=Qg,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Yg,p.prototype.first=p.prototype.head,Vr&&(p.prototype[Vr]=Jg),p},yr=Bp();Jt?((Jt.exports=yr)._=yr,Hs._=yr):Ie._=yr}).call(hi)})(_o,_o.exports);var YE=Object.defineProperty,ZE=Object.defineProperties,XE=Object.getOwnPropertyDescriptors,ph=Object.getOwnPropertySymbols,eI=Object.prototype.hasOwnProperty,tI=Object.prototype.propertyIsEnumerable,dh=(o,t,r)=>t in o?YE(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,fs=(o,t)=>{for(var r in t||(t={}))eI.call(t,r)&&dh(o,r,t[r]);if(ph)for(var r of ph(t))tI.call(t,r)&&dh(o,r,t[r]);return o},rI=(o,t)=>ZE(o,XE(t));function Bt(o,t,r){var s;const a=R0(o);return((s=t.rpcMap)==null?void 0:s[a.reference])||`${QE}?chainId=${a.namespace}:${a.reference}&projectId=${r}`}function ur(o){return o.includes(":")?o.split(":")[1]:o}function el(o){return o.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function iI(o,t){const r=Object.keys(t.namespaces).filter(a=>a.includes(o));if(!r.length)return[];const s=[];return r.forEach(a=>{const u=t.namespaces[a].accounts;s.push(...u)}),s}function sI(o={},t={}){const r=fh(o),s=fh(t);return _o.exports.merge(r,s)}function fh(o){var t,r,s,a;const u={};if(!Cr(o))return u;for(const[l,g]of Object.entries(o)){const w=No(l)?[l]:g.chains,b=g.methods||[],C=g.events||[],O=g.rpcMap||{},N=li(l);u[N]=rI(fs(fs({},u[N]),g),{chains:Yn(w,(t=u[N])==null?void 0:t.chains),methods:Yn(b,(r=u[N])==null?void 0:r.methods),events:Yn(C,(s=u[N])==null?void 0:s.events),rpcMap:fs(fs({},O),(a=u[N])==null?void 0:a.rpcMap)})}return u}function nI(o){return o.includes(":")?o.split(":")[2]:o}function oI(o){const t={};for(const[r,s]of Object.entries(o)){const a=s.methods||[],u=s.events||[],l=s.accounts||[],g=No(r)?[r]:s.chains?s.chains:el(s.accounts);t[r]={chains:g,methods:a,events:u,accounts:l}}return t}function so(o){return typeof o=="number"?o:o.includes("0x")?parseInt(o,16):o.includes(":")?Number(o.split(":")[1]):Number(o)}const tl={},he=o=>tl[o],no=(o,t)=>{tl[o]=t};class aI{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class cI{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const s=r||Bt(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=parseInt(ur(r));t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,s;let a=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";a=a.startsWith("0x")?a:`0x${a}`;const u=parseInt(a,16);if(this.isChainApproved(u))this.setDefaultChain(`${u}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:a}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${u}`);else throw new Error(`Failed to switch to chain 'eip155:${u}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class uI{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class hI{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class lI{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const s=this.getCardanoRPCUrl(r),a=ur(r);t[a]=this.createHttpProvider(a,s)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||this.getCardanoRPCUrl(t);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class pI{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class dI{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const a=ur(r);t[a]=this.createHttpProvider(a,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new $t(new Kt(s,he("disableProviderPing")))}}class fI{constructor(t){this.name="near",this.namespace=t.namespace,this.events=he("events"),this.client=he("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const s=r||Bt(`${this.name}:${t}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(At.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;t[r]=this.createHttpProvider(r,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Bt(t,this.namespace);return typeof s>"u"?void 0:new $t(new Kt(s,he("disableProviderPing")))}}var gI=Object.defineProperty,yI=Object.defineProperties,vI=Object.getOwnPropertyDescriptors,gh=Object.getOwnPropertySymbols,mI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,yh=(o,t,r)=>t in o?gI(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,gs=(o,t)=>{for(var r in t||(t={}))mI.call(t,r)&&yh(o,r,t[r]);if(gh)for(var r of gh(t))wI.call(t,r)&&yh(o,r,t[r]);return o},oo=(o,t)=>yI(o,vI(t));class xo{constructor(t){this.events=new Ge.es,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:I.qt(I.k({level:(t==null?void 0:t.logger)||hh})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const r=new xo(t);return await r.initialize(),r}async request(t,r){const[s,a]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:gs({},t),chainId:`${s}:${a}`,topic:this.session.topic})}sendAsync(t,r,s){const a=new Date().getTime();this.request(t,s).then(u=>r(null,I.formatJsonRpcResult(a,u))).catch(u=>r(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:ve("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:a}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await a().then(u=>{this.session=u,this.namespaces||(this.namespaces=oI(u.namespaces),this.persist("namespaces",this.namespaces))}).catch(u=>{if(u.message!==Zh)throw u;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[s,a]=this.validateChain(t);this.getProvider(s).setDefaultChain(a,r)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(nr(r)){for(const s of r)t.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await jE.init({logger:this.providerOpts.logger||hh,relayUrl:this.providerOpts.relayUrl||WE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(r=>li(r)))];no("client",this.client),no("events",this.events),no("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const s=iI(r,this.session),a=el(s),u=sI(this.namespaces,this.optionalNamespaces),l=oo(gs({},u[r]),{accounts:s,chains:a});switch(r){case"eip155":this.rpcProviders[r]=new cI({namespace:l});break;case"solana":this.rpcProviders[r]=new uI({namespace:l});break;case"cosmos":this.rpcProviders[r]=new hI({namespace:l});break;case"polkadot":this.rpcProviders[r]=new aI({namespace:l});break;case"cip34":this.rpcProviders[r]=new lI({namespace:l});break;case"elrond":this.rpcProviders[r]=new pI({namespace:l});break;case"multiversx":this.rpcProviders[r]=new dI({namespace:l});break;case"near":this.rpcProviders[r]=new fI({namespace:l});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:s}=r;if(s.name==="accountsChanged"){const a=s.data;a&&nr(a)&&this.events.emit("accountsChanged",a.map(nI))}else if(s.name==="chainChanged"){const a=r.chainId,u=r.event.data,l=li(a),g=so(a)!==so(u)?`${l}:${so(u)}`:a;this.onChainChanged(g)}else this.events.emit(s.name,s.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var s;const{namespaces:a}=r,u=(s=this.client)==null?void 0:s.session.get(t);this.session=oo(gs({},u),{namespaces:a}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",oo(gs({},ve("USER_DISCONNECTED")),{data:t.topic}))}),this.on(At.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:s,sessionProperties:a}=t;r&&Object.keys(r).length&&(this.namespaces=r),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=a,this.persist("namespaces",r),this.persist("optionalNamespaces",s)}validateChain(t){const[r,s]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,s];if(r&&!Object.keys(this.namespaces||{}).map(l=>li(l)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&s)return[r,s];const a=li(Object.keys(this.namespaces)[0]),u=this.rpcProviders[a].getDefaultChain();return[a,u]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){var s;if(!this.namespaces)return;const[a,u]=this.validateChain(t);r||this.getProvider(a).setDefaultChain(u),((s=this.namespaces[a])!=null?s:this.namespaces[`${a}:${u}`]).defaultChain=u,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",u)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,r){this.client.core.storage.setItem(`${lh}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${lh}/${t}`)}}const _I=xo,bI="wc",EI="ethereum_provider",II=`${bI}@2:${EI}:`,PI="https://rpc.walletconnect.com/v1/",_s=["eth_sendTransaction","personal_sign"],rl=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],bs=["chainChanged","accountsChanged"],il=["chainChanged","accountsChanged","message","disconnect","connect"];var SI=Object.defineProperty,OI=Object.defineProperties,RI=Object.getOwnPropertyDescriptors,vh=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,mh=(o,t,r)=>t in o?SI(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,di=(o,t)=>{for(var r in t||(t={}))NI.call(t,r)&&mh(o,r,t[r]);if(vh)for(var r of vh(t))CI.call(t,r)&&mh(o,r,t[r]);return o},wh=(o,t)=>OI(o,RI(t));function Es(o){return Number(o[0].split(":")[1])}function ao(o){return`0x${o.toString(16)}`}function $I(o){const{chains:t,optionalChains:r,methods:s,optionalMethods:a,events:u,optionalEvents:l,rpcMap:g}=o;if(!co(t))throw new Error("Invalid chains");const w={chains:t,methods:s||_s,events:u||bs,rpcMap:di({},t.length?{[Es(t)]:g[Es(t)]}:{})},b=u==null?void 0:u.filter(q=>!bs.includes(q)),C=s==null?void 0:s.filter(q=>!_s.includes(q));if(!r&&!l&&!a&&!(b!=null&&b.length)&&!(C!=null&&C.length))return{required:t.length?w:void 0};const O=(b==null?void 0:b.length)&&(C==null?void 0:C.length)||!r,N={chains:[...new Set(O?w.chains.concat(r||[]):r)],methods:[...new Set(w.methods.concat(a!=null&&a.length?a:rl))],events:[...new Set(w.events.concat(l!=null&&l.length?l:il))],rpcMap:g};return{required:t.length?w:void 0,optional:r.length?N:void 0}}class Os{constructor(){this.events=new Ge.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=II,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new Os;return await r.initialize(t),r}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,r){this.signer.sendAsync(t,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:s}=$I(this.rpc);try{const a=await new Promise(async(l,g)=>{var w;this.rpc.showQrModal&&((w=this.modal)==null||w.subscribeModal(b=>{!b.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),g(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(wh(di({namespaces:di({},r&&{[this.namespace]:r})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(b=>{l(b)}).catch(b=>{g(new Error(b.message))})});if(!a)return;const u=lw(a.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:u),this.setAccounts(u),this.events.emit("connect",{chainId:ao(this.chainId)})}catch(a){throw this.signer.logger.error(a),a}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:r}=t,{event:s}=r;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",ao(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",wh(di({},dw("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,s;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(s=this.modal)==null||s.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",ao(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,s,a]=t.split(":");return{chainId:`${r}:${s}`,address:a}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,s;const a=(r=t==null?void 0:t.chains)!=null?r:[],u=(s=t==null?void 0:t.optionalChains)!=null?s:[],l=a.concat(u);if(!l.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const g=a.length?(t==null?void 0:t.methods)||_s:[],w=a.length?(t==null?void 0:t.events)||bs:[],b=(t==null?void 0:t.optionalMethods)||[],C=(t==null?void 0:t.optionalEvents)||[],O=(t==null?void 0:t.rpcMap)||this.buildRpcMap(l,t.projectId),N=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:a==null?void 0:a.map(q=>this.formatChainId(q)),optionalChains:u.map(q=>this.formatChainId(q)),methods:g,events:w,optionalMethods:b,optionalEvents:C,rpcMap:O,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:N,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const s={};return t.forEach(a=>{s[a]=this.getRpcUrl(a,r)}),s}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?Es(this.rpc.chains):Es(this.rpc.optionalChains),this.signer=await _I.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:s}=await Promise.resolve().then(()=>require("./index-BB5T29FD.js")).then(a=>a.index);r=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(di({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:s,rpcMap:a}=t;r&&co(r)&&(this.rpc.chains=r.map(u=>this.formatChainId(u)),r.forEach(u=>{this.rpc.rpcMap[u]=(a==null?void 0:a[u])||this.getRpcUrl(u)})),s&&co(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(u=>this.formatChainId(u)),s.forEach(u=>{this.rpc.rpcMap[u]=(a==null?void 0:a[u])||this.getRpcUrl(u)}))}getRpcUrl(t,r){var s;return((s=this.rpc.rpcMap)==null?void 0:s[t])||`${PI}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}}const AI=Os;exports.EthereumProvider=AI;exports.OPTIONAL_EVENTS=il;exports.OPTIONAL_METHODS=rl;exports.REQUIRED_EVENTS=bs;exports.REQUIRED_METHODS=_s;exports.default=Os;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as bt, a as To } from "./events-
|
|
2
|
-
import { a1 as xo, aR as Iw, h as ee, ac as Pw, du as $u } from "./index-
|
|
3
|
-
import { c as F, s as Do, x as kh, r as zh, H as Sw, a as Hh, q as Ss } from "./index-
|
|
4
|
-
import { I as lr, f as ft, t as nt, c as Cu, C as Ow, r as Rw, a as Dr, g as Vh, i as _t, b as $s, d as Nw, E as ke, y as Qe, q as Cs, k as As, h as $w, e as Au, j as Cw, s as Aw, l as Tw, m as Fo, n as Ts, o as qo, p as Wt, u as xw, v as Tu, w as Dw } from "./index-
|
|
1
|
+
import { e as bt, a as To } from "./events-IweKXbqK.mjs";
|
|
2
|
+
import { a1 as xo, aR as Iw, h as ee, ac as Pw, du as $u } from "./index-PezPPmQR.mjs";
|
|
3
|
+
import { c as F, s as Do, x as kh, r as zh, H as Sw, a as Hh, q as Ss } from "./index-eOaDp35h.mjs";
|
|
4
|
+
import { I as lr, f as ft, t as nt, c as Cu, C as Ow, r as Rw, a as Dr, g as Vh, i as _t, b as $s, d as Nw, E as ke, y as Qe, q as Cs, k as As, h as $w, e as Au, j as Cw, s as Aw, l as Tw, m as Fo, n as Ts, o as qo, p as Wt, u as xw, v as Tu, w as Dw } from "./index-CLwX1P1j.mjs";
|
|
5
5
|
var se = {};
|
|
6
6
|
Object.defineProperty(se, "__esModule", { value: !0 });
|
|
7
7
|
se.getLocalStorage = se.getLocalStorageOrThrow = se.getCrypto = se.getCryptoOrThrow = se.getLocation = se.getLocationOrThrow = se.getNavigator = se.getNavigatorOrThrow = se.getDocument = se.getDocumentOrThrow = se.getFromWindowOrThrow = se.getFromWindow = void 0;
|
|
@@ -7730,7 +7730,7 @@ class Jo {
|
|
|
7730
7730
|
if (this.rpc = this.getRpcConfig(t), this.chainId = this.rpc.chains.length ? Ns(this.rpc.chains) : Ns(this.rpc.optionalChains), this.signer = await tP.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t.disableProviderPing, relayUrl: t.relayUrl, storageOptions: t.storageOptions }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) {
|
|
7731
7731
|
let r;
|
|
7732
7732
|
try {
|
|
7733
|
-
const { WalletConnectModal: s } = await import("./index-
|
|
7733
|
+
const { WalletConnectModal: s } = await import("./index-Bf66m4uH.mjs").then((a) => a.i);
|
|
7734
7734
|
r = s;
|
|
7735
7735
|
} catch {
|
|
7736
7736
|
throw new Error("To use QR modal, please install @walletconnect/modal package");
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index-B-m4JhhB.js");exports.AutomaticCCTPRoute=t.AutomaticCCTPRoute;exports.AutomaticPorticoRoute=t.AutomaticPorticoRoute;exports.AutomaticTokenBridgeRoute=t.AutomaticTokenBridgeRoute;exports.CCTPRoute=t.CCTPRoute;exports.DEFAULT_ROUTES=t.DEFAULT_ROUTES;exports.MAINNET=t.MAINNET;exports.MayanRoute=t.MayanRoute;exports.MayanRouteMCTP=t.MayanRouteMCTP;exports.MayanRouteSWIFT=t.MayanRouteSWIFT;exports.MayanRouteWH=t.MayanRouteWH;exports.TESTNET=t.TESTNET;exports.TokenBridgeRoute=t.TokenBridgeRoute;exports.buildConfig=t.buildConfig;exports.default=t.WormholeConnect;exports.nttAutomaticRoute=t.nttAutomaticRoute;exports.nttManualRoute=t.nttManualRoute;exports.nttRoutes=t.nttRoutes;exports.wormholeConnectHosted=t.wormholeConnectHosted;
|
package/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dQ as o, dS as d, dO as e, dR as s, dK as u, dH as R, dT as n, dV as T, dW as i, dU as M, dI as C, dP as c, dJ as m, dG as r, dM as A, dN as E, dL as P, dX as l } from "./index-
|
|
1
|
+
import { dQ as o, dS as d, dO as e, dR as s, dK as u, dH as R, dT as n, dV as T, dW as i, dU as M, dI as C, dP as c, dJ as m, dG as r, dM as A, dN as E, dL as P, dX as l } from "./index-PezPPmQR.mjs";
|
|
2
2
|
export {
|
|
3
3
|
o as AutomaticCCTPRoute,
|
|
4
4
|
d as AutomaticPorticoRoute,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const x=require("./index-COPDbEYS.js"),we=require("./index-pIqiKD22.js");var Nr={},_n={exports:{}},Dr={};(function(t){t.fetch=f(x.commonjsGlobal.fetch)&&f(x.commonjsGlobal.ReadableStream),t.writableStream=f(x.commonjsGlobal.WritableStream),t.abortController=f(x.commonjsGlobal.AbortController);var e;function n(){if(e!==void 0)return e;if(x.commonjsGlobal.XMLHttpRequest){e=new x.commonjsGlobal.XMLHttpRequest;try{e.open("GET",x.commonjsGlobal.XDomainRequest?"/":"https://example.com")}catch{e=null}}else e=null;return e}function o(l){var y=n();if(!y)return!1;try{return y.responseType=l,y.responseType===l}catch{}return!1}t.arraybuffer=t.fetch||o("arraybuffer"),t.msstream=!t.fetch&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||(n()?f(n().overrideMimeType):!1);function f(l){return typeof l=="function"}e=null})(Dr);var Et={},vr={exports:{}};(function(t,e){e=t.exports=x.require_stream_readable(),e.Stream=e,e.Readable=e,e.Writable=x.require_stream_writable(),e.Duplex=x.require_stream_duplex(),e.Transform=x.require_stream_transform(),e.PassThrough=x.require_stream_passthrough(),e.finished=x.requireEndOfStream(),e.pipeline=x.requirePipeline()})(vr,vr.exports);var Fr=vr.exports,Vr=Dr,uo=x.requireInherits_browser(),Pn=Fr,ut=Et.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Cr=Et.IncomingMessage=function(t,e,n,o){var f=this;if(Pn.Readable.call(f),f._mode=n,f.headers={},f.rawHeaders=[],f.trailers={},f.rawTrailers=[],f.on("end",function(){x.dist.process.nextTick(function(){f.emit("close")})}),n==="fetch"){let R=function(){y.read().then(function(I){if(!f._destroyed){if(o(I.done),I.done){f.push(null);return}f.push(x.dist.Buffer.from(I.value)),R()}}).catch(function(I){o(!0),f._destroyed||f.emit("error",I)})};if(f._fetchResponse=e,f.url=e.url,f.statusCode=e.status,f.statusMessage=e.statusText,e.headers.forEach(function(I,v){f.headers[v.toLowerCase()]=I,f.rawHeaders.push(v,I)}),Vr.writableStream){var l=new WritableStream({write:function(I){return o(!1),new Promise(function(v,F){f._destroyed?F():f.push(x.dist.Buffer.from(I))?v():f._resumeFetch=v})},close:function(){o(!0),f._destroyed||f.push(null)},abort:function(I){o(!0),f._destroyed||f.emit("error",I)}});try{e.body.pipeTo(l).catch(function(I){o(!0),f._destroyed||f.emit("error",I)});return}catch{}}var y=e.body.getReader();R()}else{f._xhr=t,f._pos=0,f.url=t.responseURL,f.statusCode=t.status,f.statusMessage=t.statusText;var b=t.getAllResponseHeaders().split(/\r?\n/);if(b.forEach(function(R){var I=R.match(/^([^:]+):\s*(.*)/);if(I){var v=I[1].toLowerCase();v==="set-cookie"?(f.headers[v]===void 0&&(f.headers[v]=[]),f.headers[v].push(I[2])):f.headers[v]!==void 0?f.headers[v]+=", "+I[2]:f.headers[v]=I[2],f.rawHeaders.push(I[1],I[2])}}),f._charset="x-user-defined",!Vr.overrideMimeType){var m=f.rawHeaders["mime-type"];if(m){var q=m.match(/;\s*charset=([^;])(;|$)/);q&&(f._charset=q[1].toLowerCase())}f._charset||(f._charset="utf-8")}}};uo(Cr,Pn.Readable);Cr.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())};Cr.prototype._onXHRProgress=function(t){var e=this,n=e._xhr,o=null;switch(e._mode){case"text":if(o=n.responseText,o.length>e._pos){var f=o.substr(e._pos);if(e._charset==="x-user-defined"){for(var l=x.dist.Buffer.alloc(f.length),y=0;y<f.length;y++)l[y]=f.charCodeAt(y)&255;e.push(l)}else e.push(f,e._charset);e._pos=o.length}break;case"arraybuffer":if(n.readyState!==ut.DONE||!n.response)break;o=n.response,e.push(x.dist.Buffer.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=n.response,n.readyState!==ut.LOADING||!o)break;e.push(x.dist.Buffer.from(new Uint8Array(o)));break;case"ms-stream":if(o=n.response,n.readyState!==ut.LOADING)break;var b=new x.commonjsGlobal.MSStreamReader;b.onprogress=function(){b.result.byteLength>e._pos&&(e.push(x.dist.Buffer.from(new Uint8Array(b.result.slice(e._pos)))),e._pos=b.result.byteLength)},b.onload=function(){t(!0),e.push(null)},b.readAsArrayBuffer(o);break}e._xhr.readyState===ut.DONE&&e._mode!=="ms-stream"&&(t(!0),e.push(null))};var Qe=Dr,so=x.requireInherits_browser(),In=Et,Mr=Fr,lo=In.IncomingMessage,Kr=In.readyStates;function po(t,e){return Qe.fetch&&e?"fetch":Qe.mozchunkedarraybuffer?"moz-chunked-arraybuffer":Qe.msstream?"ms-stream":Qe.arraybuffer&&t?"arraybuffer":"text"}var Ae=_n.exports=function(t){var e=this;Mr.Writable.call(e),e._opts=t,e._body=[],e._headers={},t.auth&&e.setHeader("Authorization","Basic "+x.dist.Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(f){e.setHeader(f,t.headers[f])});var n,o=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!Qe.abortController)o=!1,n=!0;else if(t.mode==="prefer-streaming")n=!1;else if(t.mode==="allow-wrong-content-type")n=!Qe.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")n=!0;else throw new Error("Invalid value for opts.mode");e._mode=po(n,o),e._fetchTimer=null,e._socketTimeout=null,e._socketTimer=null,e.on("finish",function(){e._onFinish()})};so(Ae,Mr.Writable);Ae.prototype.setHeader=function(t,e){var n=this,o=t.toLowerCase();yo.indexOf(o)===-1&&(n._headers[o]={name:t,value:e})};Ae.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null};Ae.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]};Ae.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&e.timeout!==0&&t.setTimeout(e.timeout);var n=t._headers,o=null;e.method!=="GET"&&e.method!=="HEAD"&&(o=new Blob(t._body,{type:(n["content-type"]||{}).value||""}));var f=[];if(Object.keys(n).forEach(function(m){var q=n[m].name,R=n[m].value;Array.isArray(R)?R.forEach(function(I){f.push([q,I])}):f.push([q,R])}),t._mode==="fetch"){var l=null;if(Qe.abortController){var y=new AbortController;l=y.signal,t._fetchAbortController=y,"requestTimeout"in e&&e.requestTimeout!==0&&(t._fetchTimer=x.commonjsGlobal.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}x.commonjsGlobal.fetch(t._opts.url,{method:t._opts.method,headers:f,body:o||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:l}).then(function(m){t._fetchResponse=m,t._resetTimers(!1),t._connect()},function(m){t._resetTimers(!0),t._destroyed||t.emit("error",m)})}else{var b=t._xhr=new x.commonjsGlobal.XMLHttpRequest;try{b.open(t._opts.method,t._opts.url,!0)}catch(m){x.dist.process.nextTick(function(){t.emit("error",m)});return}"responseType"in b&&(b.responseType=t._mode),"withCredentials"in b&&(b.withCredentials=!!e.withCredentials),t._mode==="text"&&"overrideMimeType"in b&&b.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(b.timeout=e.requestTimeout,b.ontimeout=function(){t.emit("requestTimeout")}),f.forEach(function(m){b.setRequestHeader(m[0],m[1])}),t._response=null,b.onreadystatechange=function(){switch(b.readyState){case Kr.LOADING:case Kr.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(b.onprogress=function(){t._onXHRProgress()}),b.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{b.send(o)}catch(m){x.dist.process.nextTick(function(){t.emit("error",m)});return}}}};function ho(t){try{var e=t.status;return e!==null&&e!==0}catch{return!1}}Ae.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),!(!ho(t._xhr)||t._destroyed)&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))};Ae.prototype._connect=function(){var t=this;t._destroyed||(t._response=new lo(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))};Ae.prototype._write=function(t,e,n){var o=this;o._body.push(t),n()};Ae.prototype._resetTimers=function(t){var e=this;x.commonjsGlobal.clearTimeout(e._socketTimer),e._socketTimer=null,t?(x.commonjsGlobal.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=x.commonjsGlobal.setTimeout(function(){e.emit("timeout")},e._socketTimeout))};Ae.prototype.abort=Ae.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)};Ae.prototype.end=function(t,e,n){var o=this;typeof t=="function"&&(n=t,t=void 0),Mr.Writable.prototype.end.call(o,t,e,n)};Ae.prototype.setTimeout=function(t,e){var n=this;e&&n.once("timeout",e),n._socketTimeout=t,n._resetTimers(!1)};Ae.prototype.flushHeaders=function(){};Ae.prototype.setNoDelay=function(){};Ae.prototype.setSocketKeepAlive=function(){};var yo=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],mo=_n.exports,go=bo,vo=Object.prototype.hasOwnProperty;function bo(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var o in n)vo.call(n,o)&&(t[o]=n[o])}return t}var wo={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},br={exports:{}},gt={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */gt.exports;(function(t,e){(function(n){var o=e&&!e.nodeType&&e,f=t&&!t.nodeType&&t,l=typeof x.commonjsGlobal=="object"&&x.commonjsGlobal;(l.global===l||l.window===l||l.self===l)&&(n=l);var y,b=2147483647,m=36,q=1,R=26,I=38,v=700,F=72,z=128,re="-",te=/^xn--/,Q=/[^\x20-\x7E]/,j=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=m-q,M=Math.floor,V=String.fromCharCode,L;function Z(d){throw new RangeError(w[d])}function k(d,T){for(var a=d.length,p=[];a--;)p[a]=T(d[a]);return p}function ne(d,T){var a=d.split("@"),p="";a.length>1&&(p=a[0]+"@",d=a[1]),d=d.replace(j,".");var i=d.split("."),c=k(i,T).join(".");return p+c}function ae(d){for(var T=[],a=0,p=d.length,i,c;a<p;)i=d.charCodeAt(a++),i>=55296&&i<=56319&&a<p?(c=d.charCodeAt(a++),(c&64512)==56320?T.push(((i&1023)<<10)+(c&1023)+65536):(T.push(i),a--)):T.push(i);return T}function W(d){return k(d,function(T){var a="";return T>65535&&(T-=65536,a+=V(T>>>10&1023|55296),T=56320|T&1023),a+=V(T),a}).join("")}function ee(d){return d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:m}function fe(d,T){return d+22+75*(d<26)-((T!=0)<<5)}function ue(d,T,a){var p=0;for(d=a?M(d/v):d>>1,d+=M(d/T);d>C*R>>1;p+=m)d=M(d/C);return M(p+(C+1)*d/(d+I))}function ce(d){var T=[],a=d.length,p,i=0,c=z,u=F,S,g,O,P,U,K,Y,oe,ye;for(S=d.lastIndexOf(re),S<0&&(S=0),g=0;g<S;++g)d.charCodeAt(g)>=128&&Z("not-basic"),T.push(d.charCodeAt(g));for(O=S>0?S+1:0;O<a;){for(P=i,U=1,K=m;O>=a&&Z("invalid-input"),Y=ee(d.charCodeAt(O++)),(Y>=m||Y>M((b-i)/U))&&Z("overflow"),i+=Y*U,oe=K<=u?q:K>=u+R?R:K-u,!(Y<oe);K+=m)ye=m-oe,U>M(b/ye)&&Z("overflow"),U*=ye;p=T.length+1,u=ue(i-P,p,P==0),M(i/p)>b-c&&Z("overflow"),c+=M(i/p),i%=p,T.splice(i++,0,c)}return W(T)}function me(d){var T,a,p,i,c,u,S,g,O,P,U,K=[],Y,oe,ye,Ee;for(d=ae(d),Y=d.length,T=z,a=0,c=F,u=0;u<Y;++u)U=d[u],U<128&&K.push(V(U));for(p=i=K.length,i&&K.push(re);p<Y;){for(S=b,u=0;u<Y;++u)U=d[u],U>=T&&U<S&&(S=U);for(oe=p+1,S-T>M((b-a)/oe)&&Z("overflow"),a+=(S-T)*oe,T=S,u=0;u<Y;++u)if(U=d[u],U<T&&++a>b&&Z("overflow"),U==T){for(g=a,O=m;P=O<=c?q:O>=c+R?R:O-c,!(g<P);O+=m)Ee=g-P,ye=m-P,K.push(V(fe(P+Ee%ye,0))),g=M(Ee/ye);K.push(V(fe(g,0))),c=ue(a,oe,p==i),a=0,++p}++a,++T}return K.join("")}function he(d){return ne(d,function(T){return te.test(T)?ce(T.slice(4).toLowerCase()):T})}function A(d){return ne(d,function(T){return Q.test(T)?"xn--"+me(T):T})}if(y={version:"1.4.1",ucs2:{decode:ae,encode:W},decode:ce,encode:me,toASCII:A,toUnicode:he},o&&f)if(t.exports==o)f.exports=y;else for(L in y)y.hasOwnProperty(L)&&(o[L]=y[L]);else n.punycode=y})(x.commonjsGlobal)})(gt,gt.exports);var qn=gt.exports,Nn={exports:{}},So=we.getIntrinsic,Qr=we.defineDataProperty,Oo=we.hasPropertyDescriptors_1(),Xr=we.gopd,Yr=we.type,Eo=So("%Math.floor%"),Ao=function(e,n){if(typeof e!="function")throw new Yr("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||Eo(n)!==n)throw new Yr("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],f=!0,l=!0;if("length"in e&&Xr){var y=Xr(e,"length");y&&!y.configurable&&(f=!1),y&&!y.writable&&(l=!1)}return(f||l||!o)&&(Oo?Qr(e,"length",n,!0,!0):Qr(e,"length",n)),e};(function(t){var e=we.functionBind,n=we.getIntrinsic,o=Ao,f=we.type,l=n("%Function.prototype.apply%"),y=n("%Function.prototype.call%"),b=n("%Reflect.apply%",!0)||e.call(y,l),m=we.esDefineProperty,q=n("%Math.max%");t.exports=function(v){if(typeof v!="function")throw new f("a function is required");var F=b(e,y,arguments);return o(F,1+q(0,v.length-(arguments.length-1)),!0)};var R=function(){return b(e,l,arguments)};m?m(t.exports,"apply",{value:R}):t.exports.apply=R})(Nn);var At=Nn.exports,Dn=we.getIntrinsic,Fn=At,To=Fn(Dn("String.prototype.indexOf")),ct=function(e,n){var o=Dn(e,!!n);return typeof o=="function"&&To(e,".prototype.")>-1?Fn(o):o},$r=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&$r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,vt=$r&&Kt&&typeof Kt.get=="function"?Kt.get:null,Jr=$r&&Map.prototype.forEach,Br=typeof Set=="function"&&Set.prototype,Qt=Object.getOwnPropertyDescriptor&&Br?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,bt=Br&&Qt&&typeof Qt.get=="function"?Qt.get:null,Zr=Br&&Set.prototype.forEach,Ro=typeof WeakMap=="function"&&WeakMap.prototype,it=Ro?WeakMap.prototype.has:null,jo=typeof WeakSet=="function"&&WeakSet.prototype,at=jo?WeakSet.prototype.has:null,_o=typeof WeakRef=="function"&&WeakRef.prototype,en=_o?WeakRef.prototype.deref:null,Po=Boolean.prototype.valueOf,Io=Object.prototype.toString,qo=Function.prototype.toString,No=String.prototype.match,Lr=String.prototype.slice,ke=String.prototype.replace,Do=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,Cn=RegExp.prototype.test,rn=Array.prototype.concat,Be=Array.prototype.join,Fo=Array.prototype.slice,nn=Math.floor,wr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Xt=Object.getOwnPropertySymbols,Sr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Te=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Je||!0)?Symbol.toStringTag:null,Mn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function an(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Cn.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var o=t<0?-nn(-t):nn(t);if(o!==t){var f=String(o),l=Lr.call(e,f.length+1);return ke.call(f,n,"$&_")+"."+ke.call(ke.call(l,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ke.call(e,n,"$&_")}var Or=x.require$$2,fn=Or.custom,cn=Bn(fn)?fn:null,Co=function t(e,n,o,f){var l=n||{};if(xe(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(xe(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=xe(l,"customInspect")?l.customInspect:!0;if(typeof y!="boolean"&&y!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(xe(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(xe(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=l.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Un(e,l);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var m=String(e);return b?an(e,m):m}if(typeof e=="bigint"){var q=String(e)+"n";return b?an(e,q):q}var R=typeof l.depth>"u"?5:l.depth;if(typeof o>"u"&&(o=0),o>=R&&R>0&&typeof e=="object")return Er(e)?"[Array]":"[Object]";var I=Zo(l,o);if(typeof f>"u")f=[];else if(Ln(f,e)>=0)return"[Circular]";function v(ee,fe,ue){if(fe&&(f=Fo.call(f),f.push(fe)),ue){var ce={depth:l.depth};return xe(l,"quoteStyle")&&(ce.quoteStyle=l.quoteStyle),t(ee,ce,o+1,f)}return t(ee,l,o+1,f)}if(typeof e=="function"&&!un(e)){var F=zo(e),z=st(e,v);return"[Function"+(F?": "+F:" (anonymous)")+"]"+(z.length>0?" { "+Be.call(z,", ")+" }":"")}if(Bn(e)){var re=Je?ke.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sr.call(e);return typeof e=="object"&&!Je?ot(re):re}if(Xo(e)){for(var te="<"+tn.call(String(e.nodeName)),Q=e.attributes||[],j=0;j<Q.length;j++)te+=" "+Q[j].name+"="+$n(Mo(Q[j].value),"double",l);return te+=">",e.childNodes&&e.childNodes.length&&(te+="..."),te+="</"+tn.call(String(e.nodeName))+">",te}if(Er(e)){if(e.length===0)return"[]";var w=st(e,v);return I&&!Jo(w)?"["+Ar(w,I)+"]":"[ "+Be.call(w,", ")+" ]"}if(Bo(e)){var C=st(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!Mn.call(e,"cause")?"{ ["+String(e)+"] "+Be.call(rn.call("[cause]: "+v(e.cause),C),", ")+" }":C.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Be.call(C,", ")+" }"}if(typeof e=="object"&&y){if(cn&&typeof e[cn]=="function"&&Or)return Or(e,{depth:R-o});if(y!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ho(e)){var M=[];return Jr&&Jr.call(e,function(ee,fe){M.push(v(fe,e,!0)+" => "+v(ee,e))}),sn("Map",vt.call(e),M,I)}if(Ko(e)){var V=[];return Zr&&Zr.call(e,function(ee){V.push(v(ee,e))}),sn("Set",bt.call(e),V,I)}if(Wo(e))return Yt("WeakMap");if(Qo(e))return Yt("WeakSet");if(Vo(e))return Yt("WeakRef");if(Uo(e))return ot(v(Number(e)));if(ko(e))return ot(v(wr.call(e)));if(xo(e))return ot(Po.call(e));if(Lo(e))return ot(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof x.commonjsGlobal<"u"&&e===x.commonjsGlobal)return"{ [object globalThis] }";if(!$o(e)&&!un(e)){var L=st(e,v),Z=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",ne=!Z&&Te&&Object(e)===e&&Te in e?Lr.call(Ge(e),8,-1):k?"Object":"",ae=Z||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",W=ae+(ne||k?"["+Be.call(rn.call([],ne||[],k||[]),": ")+"] ":"");return L.length===0?W+"{}":I?W+"{"+Ar(L,I)+"}":W+"{ "+Be.call(L,", ")+" }"}return String(e)};function $n(t,e,n){var o=(n.quoteStyle||e)==="double"?'"':"'";return o+t+o}function Mo(t){return ke.call(String(t),/"/g,""")}function Er(t){return Ge(t)==="[object Array]"&&(!Te||!(typeof t=="object"&&Te in t))}function $o(t){return Ge(t)==="[object Date]"&&(!Te||!(typeof t=="object"&&Te in t))}function un(t){return Ge(t)==="[object RegExp]"&&(!Te||!(typeof t=="object"&&Te in t))}function Bo(t){return Ge(t)==="[object Error]"&&(!Te||!(typeof t=="object"&&Te in t))}function Lo(t){return Ge(t)==="[object String]"&&(!Te||!(typeof t=="object"&&Te in t))}function Uo(t){return Ge(t)==="[object Number]"&&(!Te||!(typeof t=="object"&&Te in t))}function xo(t){return Ge(t)==="[object Boolean]"&&(!Te||!(typeof t=="object"&&Te in t))}function Bn(t){if(Je)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Sr)return!1;try{return Sr.call(t),!0}catch{}return!1}function ko(t){if(!t||typeof t!="object"||!wr)return!1;try{return wr.call(t),!0}catch{}return!1}var Go=Object.prototype.hasOwnProperty||function(t){return t in this};function xe(t,e){return Go.call(t,e)}function Ge(t){return Io.call(t)}function zo(t){if(t.name)return t.name;var e=No.call(qo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Ln(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,o=t.length;n<o;n++)if(t[n]===e)return n;return-1}function Ho(t){if(!vt||!t||typeof t!="object")return!1;try{vt.call(t);try{bt.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Wo(t){if(!it||!t||typeof t!="object")return!1;try{it.call(t,it);try{at.call(t,at)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Vo(t){if(!en||!t||typeof t!="object")return!1;try{return en.call(t),!0}catch{}return!1}function Ko(t){if(!bt||!t||typeof t!="object")return!1;try{bt.call(t);try{vt.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Qo(t){if(!at||!t||typeof t!="object")return!1;try{at.call(t,at);try{it.call(t,it)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Xo(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Un(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return Un(Lr.call(t,0,e.maxStringLength),e)+o}var f=ke.call(ke.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Yo);return $n(f,"single",e)}function Yo(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Do.call(e.toString(16))}function ot(t){return"Object("+t+")"}function Yt(t){return t+" { ? }"}function sn(t,e,n,o){var f=o?Ar(n,o):Be.call(n,", ");return t+" ("+e+") {"+f+"}"}function Jo(t){for(var e=0;e<t.length;e++)if(Ln(t[e],`
|
|
1
|
+
"use strict";const x=require("./index-B-m4JhhB.js"),we=require("./index-pIqiKD22.js");var Nr={},_n={exports:{}},Dr={};(function(t){t.fetch=f(x.commonjsGlobal.fetch)&&f(x.commonjsGlobal.ReadableStream),t.writableStream=f(x.commonjsGlobal.WritableStream),t.abortController=f(x.commonjsGlobal.AbortController);var e;function n(){if(e!==void 0)return e;if(x.commonjsGlobal.XMLHttpRequest){e=new x.commonjsGlobal.XMLHttpRequest;try{e.open("GET",x.commonjsGlobal.XDomainRequest?"/":"https://example.com")}catch{e=null}}else e=null;return e}function o(l){var y=n();if(!y)return!1;try{return y.responseType=l,y.responseType===l}catch{}return!1}t.arraybuffer=t.fetch||o("arraybuffer"),t.msstream=!t.fetch&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||(n()?f(n().overrideMimeType):!1);function f(l){return typeof l=="function"}e=null})(Dr);var Et={},vr={exports:{}};(function(t,e){e=t.exports=x.require_stream_readable(),e.Stream=e,e.Readable=e,e.Writable=x.require_stream_writable(),e.Duplex=x.require_stream_duplex(),e.Transform=x.require_stream_transform(),e.PassThrough=x.require_stream_passthrough(),e.finished=x.requireEndOfStream(),e.pipeline=x.requirePipeline()})(vr,vr.exports);var Fr=vr.exports,Vr=Dr,uo=x.requireInherits_browser(),Pn=Fr,ut=Et.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Cr=Et.IncomingMessage=function(t,e,n,o){var f=this;if(Pn.Readable.call(f),f._mode=n,f.headers={},f.rawHeaders=[],f.trailers={},f.rawTrailers=[],f.on("end",function(){x.dist.process.nextTick(function(){f.emit("close")})}),n==="fetch"){let R=function(){y.read().then(function(I){if(!f._destroyed){if(o(I.done),I.done){f.push(null);return}f.push(x.dist.Buffer.from(I.value)),R()}}).catch(function(I){o(!0),f._destroyed||f.emit("error",I)})};if(f._fetchResponse=e,f.url=e.url,f.statusCode=e.status,f.statusMessage=e.statusText,e.headers.forEach(function(I,v){f.headers[v.toLowerCase()]=I,f.rawHeaders.push(v,I)}),Vr.writableStream){var l=new WritableStream({write:function(I){return o(!1),new Promise(function(v,F){f._destroyed?F():f.push(x.dist.Buffer.from(I))?v():f._resumeFetch=v})},close:function(){o(!0),f._destroyed||f.push(null)},abort:function(I){o(!0),f._destroyed||f.emit("error",I)}});try{e.body.pipeTo(l).catch(function(I){o(!0),f._destroyed||f.emit("error",I)});return}catch{}}var y=e.body.getReader();R()}else{f._xhr=t,f._pos=0,f.url=t.responseURL,f.statusCode=t.status,f.statusMessage=t.statusText;var b=t.getAllResponseHeaders().split(/\r?\n/);if(b.forEach(function(R){var I=R.match(/^([^:]+):\s*(.*)/);if(I){var v=I[1].toLowerCase();v==="set-cookie"?(f.headers[v]===void 0&&(f.headers[v]=[]),f.headers[v].push(I[2])):f.headers[v]!==void 0?f.headers[v]+=", "+I[2]:f.headers[v]=I[2],f.rawHeaders.push(I[1],I[2])}}),f._charset="x-user-defined",!Vr.overrideMimeType){var m=f.rawHeaders["mime-type"];if(m){var q=m.match(/;\s*charset=([^;])(;|$)/);q&&(f._charset=q[1].toLowerCase())}f._charset||(f._charset="utf-8")}}};uo(Cr,Pn.Readable);Cr.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())};Cr.prototype._onXHRProgress=function(t){var e=this,n=e._xhr,o=null;switch(e._mode){case"text":if(o=n.responseText,o.length>e._pos){var f=o.substr(e._pos);if(e._charset==="x-user-defined"){for(var l=x.dist.Buffer.alloc(f.length),y=0;y<f.length;y++)l[y]=f.charCodeAt(y)&255;e.push(l)}else e.push(f,e._charset);e._pos=o.length}break;case"arraybuffer":if(n.readyState!==ut.DONE||!n.response)break;o=n.response,e.push(x.dist.Buffer.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=n.response,n.readyState!==ut.LOADING||!o)break;e.push(x.dist.Buffer.from(new Uint8Array(o)));break;case"ms-stream":if(o=n.response,n.readyState!==ut.LOADING)break;var b=new x.commonjsGlobal.MSStreamReader;b.onprogress=function(){b.result.byteLength>e._pos&&(e.push(x.dist.Buffer.from(new Uint8Array(b.result.slice(e._pos)))),e._pos=b.result.byteLength)},b.onload=function(){t(!0),e.push(null)},b.readAsArrayBuffer(o);break}e._xhr.readyState===ut.DONE&&e._mode!=="ms-stream"&&(t(!0),e.push(null))};var Qe=Dr,so=x.requireInherits_browser(),In=Et,Mr=Fr,lo=In.IncomingMessage,Kr=In.readyStates;function po(t,e){return Qe.fetch&&e?"fetch":Qe.mozchunkedarraybuffer?"moz-chunked-arraybuffer":Qe.msstream?"ms-stream":Qe.arraybuffer&&t?"arraybuffer":"text"}var Ae=_n.exports=function(t){var e=this;Mr.Writable.call(e),e._opts=t,e._body=[],e._headers={},t.auth&&e.setHeader("Authorization","Basic "+x.dist.Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(f){e.setHeader(f,t.headers[f])});var n,o=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!Qe.abortController)o=!1,n=!0;else if(t.mode==="prefer-streaming")n=!1;else if(t.mode==="allow-wrong-content-type")n=!Qe.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")n=!0;else throw new Error("Invalid value for opts.mode");e._mode=po(n,o),e._fetchTimer=null,e._socketTimeout=null,e._socketTimer=null,e.on("finish",function(){e._onFinish()})};so(Ae,Mr.Writable);Ae.prototype.setHeader=function(t,e){var n=this,o=t.toLowerCase();yo.indexOf(o)===-1&&(n._headers[o]={name:t,value:e})};Ae.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null};Ae.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]};Ae.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&e.timeout!==0&&t.setTimeout(e.timeout);var n=t._headers,o=null;e.method!=="GET"&&e.method!=="HEAD"&&(o=new Blob(t._body,{type:(n["content-type"]||{}).value||""}));var f=[];if(Object.keys(n).forEach(function(m){var q=n[m].name,R=n[m].value;Array.isArray(R)?R.forEach(function(I){f.push([q,I])}):f.push([q,R])}),t._mode==="fetch"){var l=null;if(Qe.abortController){var y=new AbortController;l=y.signal,t._fetchAbortController=y,"requestTimeout"in e&&e.requestTimeout!==0&&(t._fetchTimer=x.commonjsGlobal.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}x.commonjsGlobal.fetch(t._opts.url,{method:t._opts.method,headers:f,body:o||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:l}).then(function(m){t._fetchResponse=m,t._resetTimers(!1),t._connect()},function(m){t._resetTimers(!0),t._destroyed||t.emit("error",m)})}else{var b=t._xhr=new x.commonjsGlobal.XMLHttpRequest;try{b.open(t._opts.method,t._opts.url,!0)}catch(m){x.dist.process.nextTick(function(){t.emit("error",m)});return}"responseType"in b&&(b.responseType=t._mode),"withCredentials"in b&&(b.withCredentials=!!e.withCredentials),t._mode==="text"&&"overrideMimeType"in b&&b.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(b.timeout=e.requestTimeout,b.ontimeout=function(){t.emit("requestTimeout")}),f.forEach(function(m){b.setRequestHeader(m[0],m[1])}),t._response=null,b.onreadystatechange=function(){switch(b.readyState){case Kr.LOADING:case Kr.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(b.onprogress=function(){t._onXHRProgress()}),b.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{b.send(o)}catch(m){x.dist.process.nextTick(function(){t.emit("error",m)});return}}}};function ho(t){try{var e=t.status;return e!==null&&e!==0}catch{return!1}}Ae.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),!(!ho(t._xhr)||t._destroyed)&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))};Ae.prototype._connect=function(){var t=this;t._destroyed||(t._response=new lo(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))};Ae.prototype._write=function(t,e,n){var o=this;o._body.push(t),n()};Ae.prototype._resetTimers=function(t){var e=this;x.commonjsGlobal.clearTimeout(e._socketTimer),e._socketTimer=null,t?(x.commonjsGlobal.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=x.commonjsGlobal.setTimeout(function(){e.emit("timeout")},e._socketTimeout))};Ae.prototype.abort=Ae.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)};Ae.prototype.end=function(t,e,n){var o=this;typeof t=="function"&&(n=t,t=void 0),Mr.Writable.prototype.end.call(o,t,e,n)};Ae.prototype.setTimeout=function(t,e){var n=this;e&&n.once("timeout",e),n._socketTimeout=t,n._resetTimers(!1)};Ae.prototype.flushHeaders=function(){};Ae.prototype.setNoDelay=function(){};Ae.prototype.setSocketKeepAlive=function(){};var yo=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],mo=_n.exports,go=bo,vo=Object.prototype.hasOwnProperty;function bo(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var o in n)vo.call(n,o)&&(t[o]=n[o])}return t}var wo={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},br={exports:{}},gt={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */gt.exports;(function(t,e){(function(n){var o=e&&!e.nodeType&&e,f=t&&!t.nodeType&&t,l=typeof x.commonjsGlobal=="object"&&x.commonjsGlobal;(l.global===l||l.window===l||l.self===l)&&(n=l);var y,b=2147483647,m=36,q=1,R=26,I=38,v=700,F=72,z=128,re="-",te=/^xn--/,Q=/[^\x20-\x7E]/,j=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=m-q,M=Math.floor,V=String.fromCharCode,L;function Z(d){throw new RangeError(w[d])}function k(d,T){for(var a=d.length,p=[];a--;)p[a]=T(d[a]);return p}function ne(d,T){var a=d.split("@"),p="";a.length>1&&(p=a[0]+"@",d=a[1]),d=d.replace(j,".");var i=d.split("."),c=k(i,T).join(".");return p+c}function ae(d){for(var T=[],a=0,p=d.length,i,c;a<p;)i=d.charCodeAt(a++),i>=55296&&i<=56319&&a<p?(c=d.charCodeAt(a++),(c&64512)==56320?T.push(((i&1023)<<10)+(c&1023)+65536):(T.push(i),a--)):T.push(i);return T}function W(d){return k(d,function(T){var a="";return T>65535&&(T-=65536,a+=V(T>>>10&1023|55296),T=56320|T&1023),a+=V(T),a}).join("")}function ee(d){return d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:m}function fe(d,T){return d+22+75*(d<26)-((T!=0)<<5)}function ue(d,T,a){var p=0;for(d=a?M(d/v):d>>1,d+=M(d/T);d>C*R>>1;p+=m)d=M(d/C);return M(p+(C+1)*d/(d+I))}function ce(d){var T=[],a=d.length,p,i=0,c=z,u=F,S,g,O,P,U,K,Y,oe,ye;for(S=d.lastIndexOf(re),S<0&&(S=0),g=0;g<S;++g)d.charCodeAt(g)>=128&&Z("not-basic"),T.push(d.charCodeAt(g));for(O=S>0?S+1:0;O<a;){for(P=i,U=1,K=m;O>=a&&Z("invalid-input"),Y=ee(d.charCodeAt(O++)),(Y>=m||Y>M((b-i)/U))&&Z("overflow"),i+=Y*U,oe=K<=u?q:K>=u+R?R:K-u,!(Y<oe);K+=m)ye=m-oe,U>M(b/ye)&&Z("overflow"),U*=ye;p=T.length+1,u=ue(i-P,p,P==0),M(i/p)>b-c&&Z("overflow"),c+=M(i/p),i%=p,T.splice(i++,0,c)}return W(T)}function me(d){var T,a,p,i,c,u,S,g,O,P,U,K=[],Y,oe,ye,Ee;for(d=ae(d),Y=d.length,T=z,a=0,c=F,u=0;u<Y;++u)U=d[u],U<128&&K.push(V(U));for(p=i=K.length,i&&K.push(re);p<Y;){for(S=b,u=0;u<Y;++u)U=d[u],U>=T&&U<S&&(S=U);for(oe=p+1,S-T>M((b-a)/oe)&&Z("overflow"),a+=(S-T)*oe,T=S,u=0;u<Y;++u)if(U=d[u],U<T&&++a>b&&Z("overflow"),U==T){for(g=a,O=m;P=O<=c?q:O>=c+R?R:O-c,!(g<P);O+=m)Ee=g-P,ye=m-P,K.push(V(fe(P+Ee%ye,0))),g=M(Ee/ye);K.push(V(fe(g,0))),c=ue(a,oe,p==i),a=0,++p}++a,++T}return K.join("")}function he(d){return ne(d,function(T){return te.test(T)?ce(T.slice(4).toLowerCase()):T})}function A(d){return ne(d,function(T){return Q.test(T)?"xn--"+me(T):T})}if(y={version:"1.4.1",ucs2:{decode:ae,encode:W},decode:ce,encode:me,toASCII:A,toUnicode:he},o&&f)if(t.exports==o)f.exports=y;else for(L in y)y.hasOwnProperty(L)&&(o[L]=y[L]);else n.punycode=y})(x.commonjsGlobal)})(gt,gt.exports);var qn=gt.exports,Nn={exports:{}},So=we.getIntrinsic,Qr=we.defineDataProperty,Oo=we.hasPropertyDescriptors_1(),Xr=we.gopd,Yr=we.type,Eo=So("%Math.floor%"),Ao=function(e,n){if(typeof e!="function")throw new Yr("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||Eo(n)!==n)throw new Yr("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],f=!0,l=!0;if("length"in e&&Xr){var y=Xr(e,"length");y&&!y.configurable&&(f=!1),y&&!y.writable&&(l=!1)}return(f||l||!o)&&(Oo?Qr(e,"length",n,!0,!0):Qr(e,"length",n)),e};(function(t){var e=we.functionBind,n=we.getIntrinsic,o=Ao,f=we.type,l=n("%Function.prototype.apply%"),y=n("%Function.prototype.call%"),b=n("%Reflect.apply%",!0)||e.call(y,l),m=we.esDefineProperty,q=n("%Math.max%");t.exports=function(v){if(typeof v!="function")throw new f("a function is required");var F=b(e,y,arguments);return o(F,1+q(0,v.length-(arguments.length-1)),!0)};var R=function(){return b(e,l,arguments)};m?m(t.exports,"apply",{value:R}):t.exports.apply=R})(Nn);var At=Nn.exports,Dn=we.getIntrinsic,Fn=At,To=Fn(Dn("String.prototype.indexOf")),ct=function(e,n){var o=Dn(e,!!n);return typeof o=="function"&&To(e,".prototype.")>-1?Fn(o):o},$r=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&$r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,vt=$r&&Kt&&typeof Kt.get=="function"?Kt.get:null,Jr=$r&&Map.prototype.forEach,Br=typeof Set=="function"&&Set.prototype,Qt=Object.getOwnPropertyDescriptor&&Br?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,bt=Br&&Qt&&typeof Qt.get=="function"?Qt.get:null,Zr=Br&&Set.prototype.forEach,Ro=typeof WeakMap=="function"&&WeakMap.prototype,it=Ro?WeakMap.prototype.has:null,jo=typeof WeakSet=="function"&&WeakSet.prototype,at=jo?WeakSet.prototype.has:null,_o=typeof WeakRef=="function"&&WeakRef.prototype,en=_o?WeakRef.prototype.deref:null,Po=Boolean.prototype.valueOf,Io=Object.prototype.toString,qo=Function.prototype.toString,No=String.prototype.match,Lr=String.prototype.slice,ke=String.prototype.replace,Do=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,Cn=RegExp.prototype.test,rn=Array.prototype.concat,Be=Array.prototype.join,Fo=Array.prototype.slice,nn=Math.floor,wr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Xt=Object.getOwnPropertySymbols,Sr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Te=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Je||!0)?Symbol.toStringTag:null,Mn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function an(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Cn.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var o=t<0?-nn(-t):nn(t);if(o!==t){var f=String(o),l=Lr.call(e,f.length+1);return ke.call(f,n,"$&_")+"."+ke.call(ke.call(l,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ke.call(e,n,"$&_")}var Or=x.require$$2,fn=Or.custom,cn=Bn(fn)?fn:null,Co=function t(e,n,o,f){var l=n||{};if(xe(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(xe(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=xe(l,"customInspect")?l.customInspect:!0;if(typeof y!="boolean"&&y!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(xe(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(xe(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=l.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Un(e,l);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var m=String(e);return b?an(e,m):m}if(typeof e=="bigint"){var q=String(e)+"n";return b?an(e,q):q}var R=typeof l.depth>"u"?5:l.depth;if(typeof o>"u"&&(o=0),o>=R&&R>0&&typeof e=="object")return Er(e)?"[Array]":"[Object]";var I=Zo(l,o);if(typeof f>"u")f=[];else if(Ln(f,e)>=0)return"[Circular]";function v(ee,fe,ue){if(fe&&(f=Fo.call(f),f.push(fe)),ue){var ce={depth:l.depth};return xe(l,"quoteStyle")&&(ce.quoteStyle=l.quoteStyle),t(ee,ce,o+1,f)}return t(ee,l,o+1,f)}if(typeof e=="function"&&!un(e)){var F=zo(e),z=st(e,v);return"[Function"+(F?": "+F:" (anonymous)")+"]"+(z.length>0?" { "+Be.call(z,", ")+" }":"")}if(Bn(e)){var re=Je?ke.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sr.call(e);return typeof e=="object"&&!Je?ot(re):re}if(Xo(e)){for(var te="<"+tn.call(String(e.nodeName)),Q=e.attributes||[],j=0;j<Q.length;j++)te+=" "+Q[j].name+"="+$n(Mo(Q[j].value),"double",l);return te+=">",e.childNodes&&e.childNodes.length&&(te+="..."),te+="</"+tn.call(String(e.nodeName))+">",te}if(Er(e)){if(e.length===0)return"[]";var w=st(e,v);return I&&!Jo(w)?"["+Ar(w,I)+"]":"[ "+Be.call(w,", ")+" ]"}if(Bo(e)){var C=st(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!Mn.call(e,"cause")?"{ ["+String(e)+"] "+Be.call(rn.call("[cause]: "+v(e.cause),C),", ")+" }":C.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Be.call(C,", ")+" }"}if(typeof e=="object"&&y){if(cn&&typeof e[cn]=="function"&&Or)return Or(e,{depth:R-o});if(y!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ho(e)){var M=[];return Jr&&Jr.call(e,function(ee,fe){M.push(v(fe,e,!0)+" => "+v(ee,e))}),sn("Map",vt.call(e),M,I)}if(Ko(e)){var V=[];return Zr&&Zr.call(e,function(ee){V.push(v(ee,e))}),sn("Set",bt.call(e),V,I)}if(Wo(e))return Yt("WeakMap");if(Qo(e))return Yt("WeakSet");if(Vo(e))return Yt("WeakRef");if(Uo(e))return ot(v(Number(e)));if(ko(e))return ot(v(wr.call(e)));if(xo(e))return ot(Po.call(e));if(Lo(e))return ot(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof x.commonjsGlobal<"u"&&e===x.commonjsGlobal)return"{ [object globalThis] }";if(!$o(e)&&!un(e)){var L=st(e,v),Z=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",ne=!Z&&Te&&Object(e)===e&&Te in e?Lr.call(Ge(e),8,-1):k?"Object":"",ae=Z||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",W=ae+(ne||k?"["+Be.call(rn.call([],ne||[],k||[]),": ")+"] ":"");return L.length===0?W+"{}":I?W+"{"+Ar(L,I)+"}":W+"{ "+Be.call(L,", ")+" }"}return String(e)};function $n(t,e,n){var o=(n.quoteStyle||e)==="double"?'"':"'";return o+t+o}function Mo(t){return ke.call(String(t),/"/g,""")}function Er(t){return Ge(t)==="[object Array]"&&(!Te||!(typeof t=="object"&&Te in t))}function $o(t){return Ge(t)==="[object Date]"&&(!Te||!(typeof t=="object"&&Te in t))}function un(t){return Ge(t)==="[object RegExp]"&&(!Te||!(typeof t=="object"&&Te in t))}function Bo(t){return Ge(t)==="[object Error]"&&(!Te||!(typeof t=="object"&&Te in t))}function Lo(t){return Ge(t)==="[object String]"&&(!Te||!(typeof t=="object"&&Te in t))}function Uo(t){return Ge(t)==="[object Number]"&&(!Te||!(typeof t=="object"&&Te in t))}function xo(t){return Ge(t)==="[object Boolean]"&&(!Te||!(typeof t=="object"&&Te in t))}function Bn(t){if(Je)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Sr)return!1;try{return Sr.call(t),!0}catch{}return!1}function ko(t){if(!t||typeof t!="object"||!wr)return!1;try{return wr.call(t),!0}catch{}return!1}var Go=Object.prototype.hasOwnProperty||function(t){return t in this};function xe(t,e){return Go.call(t,e)}function Ge(t){return Io.call(t)}function zo(t){if(t.name)return t.name;var e=No.call(qo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Ln(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,o=t.length;n<o;n++)if(t[n]===e)return n;return-1}function Ho(t){if(!vt||!t||typeof t!="object")return!1;try{vt.call(t);try{bt.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Wo(t){if(!it||!t||typeof t!="object")return!1;try{it.call(t,it);try{at.call(t,at)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Vo(t){if(!en||!t||typeof t!="object")return!1;try{return en.call(t),!0}catch{}return!1}function Ko(t){if(!bt||!t||typeof t!="object")return!1;try{bt.call(t);try{vt.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Qo(t){if(!at||!t||typeof t!="object")return!1;try{at.call(t,at);try{it.call(t,it)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Xo(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Un(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return Un(Lr.call(t,0,e.maxStringLength),e)+o}var f=ke.call(ke.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Yo);return $n(f,"single",e)}function Yo(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Do.call(e.toString(16))}function ot(t){return"Object("+t+")"}function Yt(t){return t+" { ? }"}function sn(t,e,n,o){var f=o?Ar(n,o):Be.call(n,", ");return t+" ("+e+") {"+f+"}"}function Jo(t){for(var e=0;e<t.length;e++)if(Ln(t[e],`
|
|
2
2
|
`)>=0)return!1;return!0}function Zo(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=Be.call(Array(t.indent+1)," ");else return null;return{base:n,prev:Be.call(Array(e+1),n)}}function Ar(t,e){if(t.length===0)return"";var n=`
|
|
3
3
|
`+e.prev+e.base;return n+Be.call(t,","+n)+`
|
|
4
4
|
`+e.prev}function st(t,e){var n=Er(t),o=[];if(n){o.length=t.length;for(var f=0;f<t.length;f++)o[f]=xe(t,f)?e(t[f],t):""}var l=typeof Xt=="function"?Xt(t):[],y;if(Je){y={};for(var b=0;b<l.length;b++)y["$"+l[b]]=l[b]}for(var m in t)xe(t,m)&&(n&&String(Number(m))===m&&m<t.length||Je&&y["$"+m]instanceof Symbol||(Cn.call(/[^\w$]/,m)?o.push(e(m,t)+": "+e(t[m],t)):o.push(m+": "+e(t[m],t))));if(typeof Xt=="function")for(var q=0;q<l.length;q++)Mn.call(t,l[q])&&o.push("["+e(l[q])+"]: "+e(t[l[q]],t));return o}var xn=we.getIntrinsic,et=ct,ei=Co,ti=we.type,lt=xn("%WeakMap%",!0),pt=xn("%Map%",!0),ri=et("WeakMap.prototype.get",!0),ni=et("WeakMap.prototype.set",!0),oi=et("WeakMap.prototype.has",!0),ii=et("Map.prototype.get",!0),ai=et("Map.prototype.set",!0),fi=et("Map.prototype.has",!0),Ur=function(t,e){for(var n=t,o;(o=n.next)!==null;n=o)if(o.key===e)return n.next=o.next,o.next=t.next,t.next=o,o},ci=function(t,e){var n=Ur(t,e);return n&&n.value},ui=function(t,e,n){var o=Ur(t,e);o?o.value=n:t.next={key:e,next:t.next,value:n}},si=function(t,e){return!!Ur(t,e)},li=function(){var e,n,o,f={assert:function(l){if(!f.has(l))throw new ti("Side channel does not contain "+ei(l))},get:function(l){if(lt&&l&&(typeof l=="object"||typeof l=="function")){if(e)return ri(e,l)}else if(pt){if(n)return ii(n,l)}else if(o)return ci(o,l)},has:function(l){if(lt&&l&&(typeof l=="object"||typeof l=="function")){if(e)return oi(e,l)}else if(pt){if(n)return fi(n,l)}else if(o)return si(o,l);return!1},set:function(l,y){lt&&l&&(typeof l=="object"||typeof l=="function")?(e||(e=new lt),ni(e,l,y)):pt?(n||(n=new pt),ai(n,l,y)):(o||(o={key:{},next:null}),ui(o,l,y))}};return f},pi=String.prototype.replace,hi=/%20/g,Jt={RFC1738:"RFC1738",RFC3986:"RFC3986"},xr={default:Jt.RFC3986,formatters:{RFC1738:function(t){return pi.call(t,hi,"+")},RFC3986:function(t){return String(t)}},RFC1738:Jt.RFC1738,RFC3986:Jt.RFC3986},yi=xr,Zt=Object.prototype.hasOwnProperty,Ke=Array.isArray,Me=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),di=function(e){for(;e.length>1;){var n=e.pop(),o=n.obj[n.prop];if(Ke(o)){for(var f=[],l=0;l<o.length;++l)typeof o[l]<"u"&&f.push(o[l]);n.obj[n.prop]=f}}},kn=function(e,n){for(var o=n&&n.plainObjects?Object.create(null):{},f=0;f<e.length;++f)typeof e[f]<"u"&&(o[f]=e[f]);return o},mi=function t(e,n,o){if(!n)return e;if(typeof n!="object"){if(Ke(e))e.push(n);else if(e&&typeof e=="object")(o&&(o.plainObjects||o.allowPrototypes)||!Zt.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var f=e;return Ke(e)&&!Ke(n)&&(f=kn(e,o)),Ke(e)&&Ke(n)?(n.forEach(function(l,y){if(Zt.call(e,y)){var b=e[y];b&&typeof b=="object"&&l&&typeof l=="object"?e[y]=t(b,l,o):e.push(l)}else e[y]=l}),e):Object.keys(n).reduce(function(l,y){var b=n[y];return Zt.call(l,y)?l[y]=t(l[y],b,o):l[y]=b,l},f)},gi=function(e,n){return Object.keys(n).reduce(function(o,f){return o[f]=n[f],o},e)},vi=function(t,e,n){var o=t.replace(/\+/g," ");if(n==="iso-8859-1")return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch{return o}},er=1024,bi=function(e,n,o,f,l){if(e.length===0)return e;var y=e;if(typeof e=="symbol"?y=Symbol.prototype.toString.call(e):typeof e!="string"&&(y=String(e)),o==="iso-8859-1")return escape(y).replace(/%u[0-9a-f]{4}/gi,function(F){return"%26%23"+parseInt(F.slice(2),16)+"%3B"});for(var b="",m=0;m<y.length;m+=er){for(var q=y.length>=er?y.slice(m,m+er):y,R=[],I=0;I<q.length;++I){var v=q.charCodeAt(I);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||l===yi.RFC1738&&(v===40||v===41)){R[R.length]=q.charAt(I);continue}if(v<128){R[R.length]=Me[v];continue}if(v<2048){R[R.length]=Me[192|v>>6]+Me[128|v&63];continue}if(v<55296||v>=57344){R[R.length]=Me[224|v>>12]+Me[128|v>>6&63]+Me[128|v&63];continue}I+=1,v=65536+((v&1023)<<10|q.charCodeAt(I)&1023),R[R.length]=Me[240|v>>18]+Me[128|v>>12&63]+Me[128|v>>6&63]+Me[128|v&63]}b+=R.join("")}return b},wi=function(e){for(var n=[{obj:{o:e},prop:"o"}],o=[],f=0;f<n.length;++f)for(var l=n[f],y=l.obj[l.prop],b=Object.keys(y),m=0;m<b.length;++m){var q=b[m],R=y[q];typeof R=="object"&&R!==null&&o.indexOf(R)===-1&&(n.push({obj:y,prop:q}),o.push(R))}return di(n),e},Si=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Oi=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Ei=function(e,n){return[].concat(e,n)},Ai=function(e,n){if(Ke(e)){for(var o=[],f=0;f<e.length;f+=1)o.push(n(e[f]));return o}return n(e)},Gn={arrayToObject:kn,assign:gi,combine:Ei,compact:wi,decode:vi,encode:bi,isBuffer:Oi,isRegExp:Si,maybeMap:Ai,merge:mi},zn=li,ht=Gn,ft=xr,Ti=Object.prototype.hasOwnProperty,Hn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},$e=Array.isArray,Ri=Array.prototype.push,Wn=function(t,e){Ri.apply(t,$e(e)?e:[e])},ji=Date.prototype.toISOString,ln=ft.default,Oe={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:ht.encode,encodeValuesOnly:!1,format:ln,formatter:ft.formatters[ln],indices:!1,serializeDate:function(e){return ji.call(e)},skipNulls:!1,strictNullHandling:!1},_i=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},tr={},Pi=function t(e,n,o,f,l,y,b,m,q,R,I,v,F,z,re,te,Q,j){for(var w=e,C=j,M=0,V=!1;(C=C.get(tr))!==void 0&&!V;){var L=C.get(e);if(M+=1,typeof L<"u"){if(L===M)throw new RangeError("Cyclic object value");V=!0}typeof C.get(tr)>"u"&&(M=0)}if(typeof R=="function"?w=R(n,w):w instanceof Date?w=F(w):o==="comma"&&$e(w)&&(w=ht.maybeMap(w,function(d){return d instanceof Date?F(d):d})),w===null){if(y)return q&&!te?q(n,Oe.encoder,Q,"key",z):n;w=""}if(_i(w)||ht.isBuffer(w)){if(q){var Z=te?n:q(n,Oe.encoder,Q,"key",z);return[re(Z)+"="+re(q(w,Oe.encoder,Q,"value",z))]}return[re(n)+"="+re(String(w))]}var k=[];if(typeof w>"u")return k;var ne;if(o==="comma"&&$e(w))te&&q&&(w=ht.maybeMap(w,q)),ne=[{value:w.length>0?w.join(",")||null:void 0}];else if($e(R))ne=R;else{var ae=Object.keys(w);ne=I?ae.sort(I):ae}var W=m?n.replace(/\./g,"%2E"):n,ee=f&&$e(w)&&w.length===1?W+"[]":W;if(l&&$e(w)&&w.length===0)return ee+"[]";for(var fe=0;fe<ne.length;++fe){var ue=ne[fe],ce=typeof ue=="object"&&typeof ue.value<"u"?ue.value:w[ue];if(!(b&&ce===null)){var me=v&&m?ue.replace(/\./g,"%2E"):ue,he=$e(w)?typeof o=="function"?o(ee,me):ee:ee+(v?"."+me:"["+me+"]");j.set(e,M);var A=zn();A.set(tr,j),Wn(k,t(ce,he,o,f,l,y,b,m,o==="comma"&&te&&$e(w)?null:q,R,I,v,F,z,re,te,Q,A))}}return k},Ii=function(e){if(!e)return Oe;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||Oe.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var o=ft.default;if(typeof e.format<"u"){if(!Ti.call(ft.formatters,e.format))throw new TypeError("Unknown format option provided.");o=e.format}var f=ft.formatters[o],l=Oe.filter;(typeof e.filter=="function"||$e(e.filter))&&(l=e.filter);var y;if(e.arrayFormat in Hn?y=e.arrayFormat:"indices"in e?y=e.indices?"indices":"repeat":y=Oe.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var b=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:Oe.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Oe.addQueryPrefix,allowDots:b,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Oe.allowEmptyArrays,arrayFormat:y,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Oe.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Oe.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Oe.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Oe.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Oe.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Oe.encodeValuesOnly,filter:l,format:o,formatter:f,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Oe.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Oe.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Oe.strictNullHandling}},qi=function(t,e){var n=t,o=Ii(e),f,l;typeof o.filter=="function"?(l=o.filter,n=l("",n)):$e(o.filter)&&(l=o.filter,f=l);var y=[];if(typeof n!="object"||n===null)return"";var b=Hn[o.arrayFormat],m=b==="comma"&&o.commaRoundTrip;f||(f=Object.keys(n)),o.sort&&f.sort(o.sort);for(var q=zn(),R=0;R<f.length;++R){var I=f[R];o.skipNulls&&n[I]===null||Wn(y,Pi(n[I],I,b,m,o.allowEmptyArrays,o.strictNullHandling,o.skipNulls,o.encodeDotInKeys,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,q))}var v=y.join(o.delimiter),F=o.addQueryPrefix===!0?"?":"";return o.charsetSentinel&&(o.charset==="iso-8859-1"?F+="utf8=%26%2310003%3B&":F+="utf8=%E2%9C%93&"),v.length>0?F+v:""},Ze=Gn,Tr=Object.prototype.hasOwnProperty,Ni=Array.isArray,ge={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Ze.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},Di=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},Vn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Fi="utf8=%26%2310003%3B",Ci="utf8=%E2%9C%93",Mi=function(e,n){var o={__proto__:null},f=n.ignoreQueryPrefix?e.replace(/^\?/,""):e;f=f.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var l=n.parameterLimit===1/0?void 0:n.parameterLimit,y=f.split(n.delimiter,l),b=-1,m,q=n.charset;if(n.charsetSentinel)for(m=0;m<y.length;++m)y[m].indexOf("utf8=")===0&&(y[m]===Ci?q="utf-8":y[m]===Fi&&(q="iso-8859-1"),b=m,m=y.length);for(m=0;m<y.length;++m)if(m!==b){var R=y[m],I=R.indexOf("]="),v=I===-1?R.indexOf("="):I+1,F,z;v===-1?(F=n.decoder(R,ge.decoder,q,"key"),z=n.strictNullHandling?null:""):(F=n.decoder(R.slice(0,v),ge.decoder,q,"key"),z=Ze.maybeMap(Vn(R.slice(v+1),n),function(te){return n.decoder(te,ge.decoder,q,"value")})),z&&n.interpretNumericEntities&&q==="iso-8859-1"&&(z=Di(z)),R.indexOf("[]=")>-1&&(z=Ni(z)?[z]:z);var re=Tr.call(o,F);re&&n.duplicates==="combine"?o[F]=Ze.combine(o[F],z):(!re||n.duplicates==="last")&&(o[F]=z)}return o},$i=function(t,e,n,o){for(var f=o?e:Vn(e,n),l=t.length-1;l>=0;--l){var y,b=t[l];if(b==="[]"&&n.parseArrays)y=n.allowEmptyArrays&&(f===""||n.strictNullHandling&&f===null)?[]:[].concat(f);else{y=n.plainObjects?Object.create(null):{};var m=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,q=n.decodeDotInKeys?m.replace(/%2E/g,"."):m,R=parseInt(q,10);!n.parseArrays&&q===""?y={0:f}:!isNaN(R)&&b!==q&&String(R)===q&&R>=0&&n.parseArrays&&R<=n.arrayLimit?(y=[],y[R]=f):q!=="__proto__"&&(y[q]=f)}f=y}return f},Bi=function(e,n,o,f){if(e){var l=o.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,y=/(\[[^[\]]*])/,b=/(\[[^[\]]*])/g,m=o.depth>0&&y.exec(l),q=m?l.slice(0,m.index):l,R=[];if(q){if(!o.plainObjects&&Tr.call(Object.prototype,q)&&!o.allowPrototypes)return;R.push(q)}for(var I=0;o.depth>0&&(m=b.exec(l))!==null&&I<o.depth;){if(I+=1,!o.plainObjects&&Tr.call(Object.prototype,m[1].slice(1,-1))&&!o.allowPrototypes)return;R.push(m[1])}if(m){if(o.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+o.depth+" and strictDepth is true");R.push("["+l.slice(m.index)+"]")}return $i(R,n,o,f)}},Li=function(e){if(!e)return ge;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?ge.charset:e.charset,o=typeof e.duplicates>"u"?ge.duplicates:e.duplicates;if(o!=="combine"&&o!=="first"&&o!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var f=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ge.allowDots:!!e.allowDots;return{allowDots:f,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ge.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ge.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ge.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ge.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ge.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ge.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ge.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ge.decoder,delimiter:typeof e.delimiter=="string"||Ze.isRegExp(e.delimiter)?e.delimiter:ge.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ge.depth,duplicates:o,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ge.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ge.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ge.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ge.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ge.strictNullHandling}},Ui=function(t,e){var n=Li(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var o=typeof t=="string"?Mi(t,n):t,f=n.plainObjects?Object.create(null):{},l=Object.keys(o),y=0;y<l.length;++y){var b=l[y],m=Bi(b,o[b],n,typeof t=="string");f=Ze.merge(f,m,n)}return n.allowSparse===!0?f:Ze.compact(f)},xi=qi,ki=Ui,Gi=xr,zi={formats:Gi,parse:ki,stringify:xi};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=qn,o=zi;function f(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var l=f(n),y=f(o),b=l.default;function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var q=/^([a-z0-9.+-]+:)/i,R=/:[0-9]*$/,I=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,v=["<",">",'"',"`"," ","\r",`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X as ve, dv as yo, dw as mo, dx as go, dy as vo, dz as bo, dA as wo, dB as So, aO as Dr, h as ue, aT as Oo } from "./index-
|
|
1
|
+
import { X as ve, dv as yo, dw as mo, dx as go, dy as vo, dz as bo, dA as wo, dB as So, aO as Dr, h as ue, aT as Oo } from "./index-PezPPmQR.mjs";
|
|
2
2
|
import { a as Et, b as Eo, h as Ao, g as jn, t as Fr, f as To, e as Ro, s as In, o as _o, d as At } from "./index-D9OmEohP.mjs";
|
|
3
3
|
var qn = {}, Nn = { exports: {} }, Cr = {};
|
|
4
4
|
(function(t) {
|