@wormhole-foundation/wormhole-connect 4.0.0-beta.0-development → 4.0.0-beta.1-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/{aptos-CIKjhZ5R.js → aptos-CaGPw7HM.js} +2 -2
- package/dist/assets/create-54a95t1x.js +1 -0
- package/dist/assets/{evm-Ky_mCHhS.js → evm-Bv0RsFka.js} +2 -2
- package/dist/assets/{index-DW7sWcdW.js → index-B5JfIVKE.js} +1 -1
- package/dist/assets/{index-DHLr3HmO.js → index-BCD-VOiF.js} +1 -1
- package/dist/assets/index-BwhO0jGm.js +1 -0
- package/dist/assets/{index-DpM61P6H.js → index-CMULoTsT.js} +1 -1
- package/dist/assets/{index-DZpeOp3V.js → index-CO4HXUmy.js} +1 -1
- package/dist/assets/{index-Bg3NWSHL.js → index-COw2RtBx.js} +1 -1
- package/dist/assets/{index-DRk-Cj0P.js → index-ClrVAZUa.js} +1 -1
- package/dist/assets/{index-D7RgFG0F.js → index-CzQeh-hT.js} +1 -1
- package/dist/assets/{index-Csghphw2.js → index-DC4mZtDw.js} +1 -1
- package/dist/assets/{index-Cqs_fFht.js → index-DI-xN_q3.js} +1 -1
- package/dist/assets/{index-DVbfoP0w.js → index-DRsHBjoG.js} +1 -1
- package/dist/assets/{index-CdAFGcxx.js → index-DXcQbQ8r.js} +1 -1
- package/dist/assets/{index-DJ52h-dV.js → index-DxHhcWFS.js} +1 -1
- package/dist/assets/{index-g9iLhWvp.js → index-GKTf0CV7.js} +1 -1
- package/dist/assets/{index-DuR9wYhp.js → index-aoYIFErC.js} +1 -1
- package/dist/assets/{index-DfNgilHG.js → index-jixjwN_L.js} +1 -1
- package/dist/assets/{solana-jYIeIu4B.js → solana-DpD0VkQS.js} +2 -2
- package/dist/assets/{sui-B96bqBVv.js → sui-7K04yY2U.js} +2 -2
- package/dist/main.js +75 -75
- package/dist/src/components/TokenBalance.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/contexts/wallet/WalletProvider.d.ts.map +1 -1
- package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
- package/dist/src/hooks/useTokenListWithSearch.d.ts +1 -4
- package/dist/src/hooks/useTokenListWithSearch.d.ts.map +1 -1
- package/dist/src/routes/operator.d.ts.map +1 -1
- package/dist/src/routes/sdkv2/route.d.ts +2 -2
- package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
- package/dist/src/telemetry/types.d.ts +1 -0
- package/dist/src/telemetry/types.d.ts.map +1 -1
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/utils/wrappedNativeTokens.d.ts +12 -0
- package/dist/src/utils/wrappedNativeTokens.d.ts.map +1 -0
- package/dist/src/views/Terms.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts +2 -4
- package/dist/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts.map +1 -1
- package/lib/{account-D0Q4K1CI.js → account-24z6tDMM.js} +1 -1
- package/lib/{account-BdDruAAr.mjs → account-BcnWVXmg.mjs} +1 -1
- package/lib/{address-fSXS9iww.mjs → address-BX2fIOro.mjs} +1 -1
- package/lib/{address-BO6rj6uK.js → address-Bc-5yO4D.js} +1 -1
- package/lib/{aptos-B1VSCmD9.mjs → aptos-5b4F4UXd.mjs} +4 -4
- package/lib/{aptos-DG7QN21P.js → aptos-B_Yz-0gh.js} +1 -1
- package/lib/{aptos-BnKScTtI.mjs → aptos-DO_Sexq-.mjs} +7 -7
- package/lib/{aptos-B3C7cnvM.js → aptos-DffuIzI0.js} +2 -2
- package/lib/{basic-BRYkcAmD.mjs → basic-BclwqsOq.mjs} +4 -4
- package/lib/{basic-CN2jAqvS.js → basic-BdiYk8Hf.js} +1 -1
- package/lib/{basic-DufHOLGA.js → basic-CuO6iz8a.js} +1 -1
- package/lib/{basic-Cw13RoYq.mjs → basic-HasHL_DG.mjs} +4 -4
- package/lib/{blake2b-CT6EW399.mjs → blake2b-CVpPk5O9.mjs} +1 -1
- package/lib/{blake2b-B_Q_lTGN.js → blake2b-DXExLbRg.js} +1 -1
- package/lib/{browser-ponyfill-CnfcLhK-.mjs → browser-ponyfill-DeOApqpH.mjs} +1 -1
- package/lib/{browser-ponyfill-DbGoEOBo.js → browser-ponyfill-VhIu9z_I.js} +1 -1
- package/lib/{chain-BCKkYvDb.js → chain-BxNUWKZE.js} +1 -1
- package/lib/{chain-_dXKRkCE.mjs → chain-CvZsIsLh.mjs} +1 -1
- package/lib/{chunk-KJH4KKG6-RA0hChr8.mjs → chunk-KJH4KKG6-BgebMATq.mjs} +2 -2
- package/lib/{chunk-KJH4KKG6-BXBLZwfY.js → chunk-KJH4KKG6-DNlN4p21.js} +1 -1
- package/lib/{constants-QsbOfMbk.mjs → constants-DnbaS3cF.mjs} +3 -3
- package/lib/constants-abC7FLXq.js +1 -0
- package/lib/{contract-MkLF5rqi.js → contract-CTycrpaK.js} +1 -1
- package/lib/{contract-C_4H8x77.mjs → contract-KYuIk_vR.mjs} +1 -1
- package/lib/{core-Cpb3gtg_.js → core-COM78LTW.js} +3 -3
- package/lib/{core-ntLR7o2S.mjs → core-DT_3gIqi.mjs} +6 -6
- package/lib/{create-naslyPfU.mjs → create-BvzkkBPW.mjs} +1 -1
- package/lib/{create-CfgTxAS-.js → create-CGZYy2vu.js} +1 -1
- package/lib/{evm-C6xp3v8Z.mjs → evm-CUR4-a7F.mjs} +9 -9
- package/lib/{evm-B3G2Vkzg.js → evm-CoLwXequ.js} +2 -2
- package/lib/{evm-B20n3mf_.mjs → evm-DoVrPE_X.mjs} +7 -7
- package/lib/{evm-aSG_vFbw.js → evm-Dv-WYu07.js} +2 -2
- package/lib/executor.js +1 -1
- package/lib/executor.mjs +815 -572
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{index-DSmKiYkD.mjs → index-B1KwS33G.mjs} +5 -5
- package/lib/{index-vhQ5Q8ov.mjs → index-B2sVzSwb.mjs} +52 -97
- package/lib/{index-Bz7ogqhR.mjs → index-B3idKQJG.mjs} +1 -1
- package/lib/index-B7Afz_5P.js +1 -0
- package/lib/{index-Dq7WWqFe.js → index-B7HBnPLP.js} +1 -1
- package/lib/{index-DQX74QAE.js → index-BFBwRlid.js} +1 -1
- package/lib/{index-C6XNAQ4w.js → index-BZZZ8OeS.js} +1 -1
- package/lib/{index-C3LC73WN.js → index-BaYN-RHF.js} +1 -1
- package/lib/{index-BTUx12aa.js → index-Bhwzpq1T.js} +1 -1
- package/lib/{index-MsaML_Ju.mjs → index-Bicx897u.mjs} +2 -2
- package/lib/{index-Dajw3Alx.mjs → index-BlWksu-f.mjs} +1 -1
- package/lib/{index-DS8bl8fA.mjs → index-Bn0hkKKz.mjs} +4 -4
- package/lib/{index-BojkMsXD.js → index-BoKTcLq-.js} +1 -1
- package/lib/{index-BRYq_Nt2.mjs → index-Bp4ojxz6.mjs} +4 -4
- package/lib/{index-Cnznwcdb.js → index-BqabgGIh.js} +1 -1
- package/lib/{index-DxYgNWMY.mjs → index-BtEjOWoP.mjs} +3 -3
- package/lib/{index-BJcbyvof.js → index-C8HxYDNY.js} +1 -1
- package/lib/{index-Bhd_YhUf.js → index-C9Bk-rKp.js} +1 -1
- package/lib/{index-YAL4zolc.js → index-C9uGqcwH.js} +1 -1
- package/lib/{index-BQvEIlB2.mjs → index-CBGUPQXa.mjs} +3 -3
- package/lib/{index-IHxtA-NL.js → index-CGpn3INM.js} +1 -1
- package/lib/{index-BRyW-hBN.mjs → index-CTpINVAG.mjs} +2 -2
- package/lib/{index-bNUantLb.js → index-CjjP3Qp5.js} +1 -1
- package/lib/{index-CU73EUQW.js → index-CkGYgQTz.js} +1 -1
- package/lib/{index-DqzqJgVc.mjs → index-CkvxfaqA.mjs} +3 -3
- package/lib/{index-DfDB5FLw.js → index-ClMpLrxa.js} +1 -1
- package/lib/{index-B7VNYedX.mjs → index-CtU_hkYp.mjs} +4 -4
- package/lib/{index-DMOY218i.js → index-CzRVzbTC.js} +1 -1
- package/lib/{index-B4S4sz6p.mjs → index-Czxl_5Tr.mjs} +5 -5
- package/lib/{index-D0XQIiQn.js → index-D6qJDbzm.js} +1 -1
- package/lib/{index-D-H8WyKb.mjs → index-DGzoIr_I.mjs} +1 -1
- package/lib/{index-BD0gcmCp.mjs → index-DPpi4Don.mjs} +5 -5
- package/lib/{index-7_BfcP8x.mjs → index-DZaOh3F9.mjs} +2105 -2021
- package/lib/{index-QlIJYJce.js → index-DaY7_eQ6.js} +66 -66
- package/lib/{index-C3L-xKvN.mjs → index-DlmQ0_RF.mjs} +4839 -4850
- package/lib/{index-D5ENAOm3.js → index-DmsirrTI.js} +1 -1
- package/lib/{index-DnO0ZdKy.mjs → index-DpN0dULN.mjs} +1 -1
- package/lib/{index-BNuKzxGJ.js → index-DydXCN0v.js} +1 -1
- package/lib/{index-CSMunRpZ.mjs → index-NKV6j8zE.mjs} +3 -3
- package/lib/{index-BIYx5IBr.mjs → index-OlMuNft9.mjs} +3 -3
- package/lib/{index-tztRp3yJ.js → index-P9DbJOzh.js} +1 -1
- package/lib/{index-D1y-l93C.js → index-UbeUI3Ir.js} +1 -1
- package/lib/{index-BZYEbYGY.mjs → index-ZGgSxaDf.mjs} +3 -3
- package/lib/{index-DFpSbD7R.mjs → index-_e8uUnEK.mjs} +5 -5
- package/lib/{index-Cb9lswnP.js → index-cCBQV2Yv.js} +8 -8
- package/lib/{index-B9ybSY9R.mjs → index-cggXdVJu.mjs} +5 -5
- package/lib/{index.es-C476iHvN.mjs → index.es-5ecqX8B9.mjs} +4 -4
- package/lib/{index.es-CU6nhwJO.js → index.es-LBG64XJ6.js} +1 -1
- package/lib/{index.es-CkGpObng.js → index.es-owVcNlof.js} +3 -3
- package/lib/{index.es-CtiAoQ78.mjs → index.es-zNH_KzcH.mjs} +3 -3
- package/lib/index.js +1 -1
- package/lib/index.mjs +5 -5
- package/lib/mayan.js +1 -1
- package/lib/mayan.mjs +11 -11
- package/lib/{mint-zy6P38iu.js → mint-B4t2SvV6.js} +1 -1
- package/lib/{mint-DyoU9X22.mjs → mint-BGuU5y5m.mjs} +1 -1
- package/lib/ntt.js +1 -1
- package/lib/ntt.mjs +14 -12
- package/lib/{platform-x3ZBJ0YM.js → platform-Bkbg7A9d.js} +1 -1
- package/lib/{platform-BqpAMtgx.mjs → platform-C5gJAqtZ.mjs} +3 -3
- package/lib/{platform-BhspUaMJ.js → platform-C6QB7aIN.js} +1 -1
- package/lib/{platform-DQfpyXSV.mjs → platform-DBNvSsue.mjs} +4 -4
- package/lib/{platform-BHAZvZ_O.mjs → platform-DtB8gGMl.mjs} +4 -4
- package/lib/{platform-4nANkJAM.js → platform-qdbxkhTI.js} +1 -1
- package/lib/{provider-jsonrpc-DIXcAw4Q.mjs → provider-jsonrpc-BIIDy-Aw.mjs} +2 -2
- package/lib/{provider-jsonrpc-BCKoIijx.js → provider-jsonrpc-DHzam3ud.js} +1 -1
- package/lib/{secp256k1-CaaRyr2C.mjs → secp256k1-BF6Vm50D.mjs} +1 -1
- package/lib/{secp256k1-C60XBS-e.js → secp256k1-Bb6lbAjK.js} +1 -1
- package/lib/{secp256k1-UnRv5Suy.mjs → secp256k1-BfK5OWRP.mjs} +1 -1
- package/lib/{secp256k1-BWFGSbjt.mjs → secp256k1-CqT-a-I8.mjs} +1 -1
- package/lib/{secp256k1-CFt7TfEF.js → secp256k1-DRTQ6WrU.js} +1 -1
- package/lib/{secp256k1-BIiWvuxu.js → secp256k1-D_GNj8sK.js} +1 -1
- package/lib/{signer-DhO2iGae.mjs → signer-BH3gAHuj.mjs} +2 -2
- package/lib/{signer-BFY1Ytf6.js → signer-MBixef_P.js} +1 -1
- package/lib/{solana-CQk4ocg8.mjs → solana-C1puc64V.mjs} +11 -11
- package/lib/solana-C8xK8qJY.mjs +18 -0
- package/lib/solana-CRSliekb.js +1 -0
- package/lib/{solana-Cp49k9--.js → solana-CtBdJ6Wt.js} +4 -4
- package/lib/{solanaEmbed.esm-Cwa6cl_R.js → solanaEmbed.esm-BpIKVhXq.js} +1 -1
- package/lib/{solanaEmbed.esm-DBOqO9Ii.mjs → solanaEmbed.esm-NdE_DQuw.mjs} +3 -3
- package/lib/src/components/TokenBalance.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/contexts/wallet/WalletProvider.d.ts.map +1 -1
- package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
- package/lib/src/hooks/useTokenListWithSearch.d.ts +1 -4
- package/lib/src/hooks/useTokenListWithSearch.d.ts.map +1 -1
- package/lib/src/routes/operator.d.ts.map +1 -1
- package/lib/src/routes/sdkv2/route.d.ts +2 -2
- package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
- package/lib/src/telemetry/types.d.ts +1 -0
- package/lib/src/telemetry/types.d.ts.map +1 -1
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/utils/wrappedNativeTokens.d.ts +12 -0
- package/lib/src/utils/wrappedNativeTokens.d.ts.map +1 -0
- package/lib/src/views/Terms.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts +2 -4
- package/lib/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts.map +1 -1
- package/lib/{sui-C2a1eehP.mjs → sui-BW7tMLZs.mjs} +4 -4
- package/lib/{sui-9gsoM56W.js → sui-DdujB9Bc.js} +1 -1
- package/lib/{sui-Cr98JBgS.js → sui-QcDjGW68.js} +1 -1
- package/lib/{sui-B4RvzEXx.mjs → sui-euceXgYf.mjs} +7 -7
- package/lib/{tokens-BbFKf6Hv.mjs → tokens-DI-tPIbd.mjs} +3 -3
- package/lib/{tokens-LVHsSbYG.js → tokens-DJos2DwM.js} +1 -1
- package/lib/{transfer-DZ-wNocj.js → transfer-BinEH6ml.js} +1 -1
- package/lib/{transfer-BV1ou1GP.mjs → transfer-DTvv5m_5.mjs} +2 -2
- package/lib/{units-BqUlbZ46.mjs → units-CVEv4txp.mjs} +2 -2
- package/lib/{units-D-oRQjOa.js → units-DtldPRXy.js} +1 -1
- package/lib/{unsignedTransaction-BmxD6VsY.mjs → unsignedTransaction-CVE7GUdC.mjs} +3 -3
- package/lib/{unsignedTransaction-CiPKh85X.js → unsignedTransaction-DL3WyIkF.js} +1 -1
- package/lib/{w3m-modal-3qLkbPfi.mjs → w3m-modal-B2VF8j7W.mjs} +2 -2
- package/lib/{w3m-modal-D4-nrnEK.mjs → w3m-modal-C32eQxEe.mjs} +2 -2
- package/lib/{w3m-modal-CoTG8Zu4.js → w3m-modal-DSY2qJYP.js} +1 -1
- package/lib/{w3m-modal-xqVExHU-.js → w3m-modal-DgqSQLqZ.js} +1 -1
- package/lib/{web3-C1wK6wIV.js → web3-BKaP497Y.js} +1 -1
- package/lib/{web3-BkEb7AgB.mjs → web3-BifDBsFp.mjs} +8 -4
- package/package.json +49 -44
- package/dist/assets/create-q7V6muDT.js +0 -1
- package/dist/assets/index-B59bCuJJ.js +0 -1
- package/lib/constants-BR_zyzqY.js +0 -1
- package/lib/index-CXsUtRJQ.js +0 -1
- package/lib/solana-Dv_mUYcl.mjs +0 -18
- package/lib/solana-g3YsP966.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const be=require("./web3-C1wK6wIV.js"),tr=require("./index-Cb9lswnP.js"),ea=require("./index.es-CU6nhwJO.js");require("./index-BxM99sFL.js");var ta=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,nn=Math.ceil,Ge=Math.floor,je="[BigNumber Error] ",vi=je+"Number primitive has more than 15 significant digits: ",Qe=1e14,pe=14,on=9007199254740991,sn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],pt=1e7,Ce=1e9;function $o(r){var e,t,n,i=c.prototype={constructor:c,toString:null,valueOf:null},s=new c(1),o=20,l=4,d=-7,w=21,N=-1e7,O=1e7,I=!1,k=1,B=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",u=!0;function c(a,m){var f,g,_,h,C,p,A,P,E=this;if(!(E instanceof c))return new c(a,m);if(m==null){if(a&&a._isBigNumber===!0){E.s=a.s,!a.c||a.e>O?E.c=E.e=null:a.e<N?E.c=[E.e=0]:(E.e=a.e,E.c=a.c.slice());return}if((p=typeof a=="number")&&a*0==0){if(E.s=1/a<0?(a=-a,-1):1,a===~~a){for(h=0,C=a;C>=10;C/=10,h++);h>O?E.c=E.e=null:(E.e=h,E.c=[a]);return}P=String(a)}else{if(!ta.test(P=String(a)))return n(E,P,p);E.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(h=P.indexOf("."))>-1&&(P=P.replace(".","")),(C=P.search(/e/i))>0?(h<0&&(h=C),h+=+P.slice(C+1),P=P.substring(0,C)):h<0&&(h=P.length)}else{if(Ie(m,2,b.length,"Base"),m==10&&u)return E=new c(a),J(E,o+E.e+1,l);if(P=String(a),p=typeof a=="number"){if(a*0!=0)return n(E,P,p,m);if(E.s=1/a<0?(P=P.slice(1),-1):1,c.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(vi+a)}else E.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(f=b.slice(0,m),h=C=0,A=P.length;C<A;C++)if(f.indexOf(g=P.charAt(C))<0){if(g=="."){if(C>h){h=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,C=-1,h=0;continue}return n(E,String(a),p,m)}p=!1,P=t(P,m,10,E.s),(h=P.indexOf("."))>-1?P=P.replace(".",""):h=P.length}for(C=0;P.charCodeAt(C)===48;C++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(C,++A)){if(A-=C,p&&c.DEBUG&&A>15&&(a>on||a!==Ge(a)))throw Error(vi+E.s*a);if((h=h-C-1)>O)E.c=E.e=null;else if(h<N)E.c=[E.e=0];else{if(E.e=h,E.c=[],C=(h+1)%pe,h<0&&(C+=pe),C<A){for(C&&E.c.push(+P.slice(0,C)),A-=pe;C<A;)E.c.push(+P.slice(C,C+=pe));C=pe-(P=P.slice(C)).length}else C-=A;for(;C--;P+="0");E.c.push(+P)}}else E.c=[E.e=0]}c.clone=$o,c.ROUND_UP=0,c.ROUND_DOWN=1,c.ROUND_CEIL=2,c.ROUND_FLOOR=3,c.ROUND_HALF_UP=4,c.ROUND_HALF_DOWN=5,c.ROUND_HALF_EVEN=6,c.ROUND_HALF_CEIL=7,c.ROUND_HALF_FLOOR=8,c.EUCLID=9,c.config=c.set=function(a){var m,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(m="DECIMAL_PLACES")&&(f=a[m],Ie(f,0,Ce,m),o=f),a.hasOwnProperty(m="ROUNDING_MODE")&&(f=a[m],Ie(f,0,8,m),l=f),a.hasOwnProperty(m="EXPONENTIAL_AT")&&(f=a[m],f&&f.pop?(Ie(f[0],-Ce,0,m),Ie(f[1],0,Ce,m),d=f[0],w=f[1]):(Ie(f,-Ce,Ce,m),d=-(w=f<0?-f:f))),a.hasOwnProperty(m="RANGE"))if(f=a[m],f&&f.pop)Ie(f[0],-Ce,-1,m),Ie(f[1],1,Ce,m),N=f[0],O=f[1];else if(Ie(f,-Ce,Ce,m),f)N=-(O=f<0?-f:f);else throw Error(je+m+" cannot be zero: "+f);if(a.hasOwnProperty(m="CRYPTO"))if(f=a[m],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))I=f;else throw I=!f,Error(je+"crypto unavailable");else I=f;else throw Error(je+m+" not true or false: "+f);if(a.hasOwnProperty(m="MODULO_MODE")&&(f=a[m],Ie(f,0,9,m),k=f),a.hasOwnProperty(m="POW_PRECISION")&&(f=a[m],Ie(f,0,Ce,m),B=f),a.hasOwnProperty(m="FORMAT"))if(f=a[m],typeof f=="object")y=f;else throw Error(je+m+" not an object: "+f);if(a.hasOwnProperty(m="ALPHABET"))if(f=a[m],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))u=f.slice(0,10)=="0123456789",b=f;else throw Error(je+m+" invalid: "+f)}else throw Error(je+"Object expected: "+a);return{DECIMAL_PLACES:o,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,w],RANGE:[N,O],CRYPTO:I,MODULO_MODE:k,POW_PRECISION:B,FORMAT:y,ALPHABET:b}},c.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!c.DEBUG)return!0;var m,f,g=a.c,_=a.e,h=a.s;e:if({}.toString.call(g)=="[object Array]"){if((h===1||h===-1)&&_>=-Ce&&_<=Ce&&_===Ge(_)){if(g[0]===0){if(_===0&&g.length===1)return!0;break e}if(m=(_+1)%pe,m<1&&(m+=pe),String(g[0]).length==m){for(m=0;m<g.length;m++)if(f=g[m],f<0||f>=Qe||f!==Ge(f))break e;if(f!==0)return!0}}}else if(g===null&&_===null&&(h===null||h===1||h===-1))return!0;throw Error(je+"Invalid BigNumber: "+a)},c.maximum=c.max=function(){return G(arguments,-1)},c.minimum=c.min=function(){return G(arguments,1)},c.random=(function(){var a=9007199254740992,m=Math.random()*a&2097151?function(){return Ge(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var g,_,h,C,p,A=0,P=[],E=new c(s);if(f==null?f=o:Ie(f,0,Ce),C=nn(f/pe),I)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(C*=2));A<C;)p=g[A]*131072+(g[A+1]>>>11),p>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),g[A]=_[0],g[A+1]=_[1]):(P.push(p%1e14),A+=2);A=C/2}else if(crypto.randomBytes){for(g=crypto.randomBytes(C*=7);A<C;)p=(g[A]&31)*281474976710656+g[A+1]*1099511627776+g[A+2]*4294967296+g[A+3]*16777216+(g[A+4]<<16)+(g[A+5]<<8)+g[A+6],p>=9e15?crypto.randomBytes(7).copy(g,A):(P.push(p%1e14),A+=7);A=C/7}else throw I=!1,Error(je+"crypto unavailable");if(!I)for(;A<C;)p=m(),p<9e15&&(P[A++]=p%1e14);for(C=P[--A],f%=pe,C&&f&&(p=sn[pe-f],P[A]=Ge(C/p)*p);P[A]===0;P.pop(),A--);if(A<0)P=[h=0];else{for(h=-1;P[0]===0;P.splice(0,1),h-=pe);for(A=1,p=P[0];p>=10;p/=10,A++);A<pe&&(h-=pe-A)}return E.e=h,E.c=P,E}})(),c.sum=function(){for(var a=1,m=arguments,f=new c(m[0]);a<m.length;)f=f.plus(m[a++]);return f},t=(function(){var a="0123456789";function m(f,g,_,h){for(var C,p=[0],A,P=0,E=f.length;P<E;){for(A=p.length;A--;p[A]*=g);for(p[0]+=h.indexOf(f.charAt(P++)),C=0;C<p.length;C++)p[C]>_-1&&(p[C+1]==null&&(p[C+1]=0),p[C+1]+=p[C]/_|0,p[C]%=_)}return p.reverse()}return function(f,g,_,h,C){var p,A,P,E,M,S,j,K,W=f.indexOf("."),ee=o,Q=l;for(W>=0&&(E=B,B=0,f=f.replace(".",""),K=new c(g),S=K.pow(f.length-W),B=E,K.c=m(at(He(S.c),S.e,"0"),10,_,a),K.e=K.c.length),j=m(f,g,_,C?(p=b,a):(p=a,b)),P=E=j.length;j[--E]==0;j.pop());if(!j[0])return p.charAt(0);if(W<0?--P:(S.c=j,S.e=P,S.s=h,S=e(S,K,ee,Q,_),j=S.c,M=S.r,P=S.e),A=P+ee+1,W=j[A],E=_/2,M=M||A<0||j[A+1]!=null,M=Q<4?(W!=null||M)&&(Q==0||Q==(S.s<0?3:2)):W>E||W==E&&(Q==4||M||Q==6&&j[A-1]&1||Q==(S.s<0?8:7)),A<1||!j[0])f=M?at(p.charAt(1),-ee,p.charAt(0)):p.charAt(0);else{if(j.length=A,M)for(--_;++j[--A]>_;)j[A]=0,A||(++P,j=[1].concat(j));for(E=j.length;!j[--E];);for(W=0,f="";W<=E;f+=p.charAt(j[W++]));f=at(f,P,p.charAt(0))}return f}})(),e=(function(){function a(g,_,h){var C,p,A,P,E=0,M=g.length,S=_%pt,j=_/pt|0;for(g=g.slice();M--;)A=g[M]%pt,P=g[M]/pt|0,C=j*A+P*S,p=S*A+C%pt*pt+E,E=(p/h|0)+(C/pt|0)+j*P,g[M]=p%h;return E&&(g=[E].concat(g)),g}function m(g,_,h,C){var p,A;if(h!=C)A=h>C?1:-1;else for(p=A=0;p<h;p++)if(g[p]!=_[p]){A=g[p]>_[p]?1:-1;break}return A}function f(g,_,h,C){for(var p=0;h--;)g[h]-=p,p=g[h]<_[h]?1:0,g[h]=p*C+g[h]-_[h];for(;!g[0]&&g.length>1;g.splice(0,1));}return function(g,_,h,C,p){var A,P,E,M,S,j,K,W,ee,Q,le,ue,z,V,oe,ce,fe,L=g.s==_.s?1:-1,D=g.c,F=_.c;if(!D||!D[0]||!F||!F[0])return new c(!g.s||!_.s||(D?F&&D[0]==F[0]:!F)?NaN:D&&D[0]==0||!F?L*0:L/0);for(W=new c(L),ee=W.c=[],P=g.e-_.e,L=h+P+1,p||(p=Qe,P=Ve(g.e/pe)-Ve(_.e/pe),L=L/pe|0),E=0;F[E]==(D[E]||0);E++);if(F[E]>(D[E]||0)&&P--,L<0)ee.push(1),M=!0;else{for(V=D.length,ce=F.length,E=0,L+=2,S=Ge(p/(F[0]+1)),S>1&&(F=a(F,S,p),D=a(D,S,p),ce=F.length,V=D.length),z=ce,Q=D.slice(0,ce),le=Q.length;le<ce;Q[le++]=0);fe=F.slice(),fe=[0].concat(fe),oe=F[0],F[1]>=p/2&&oe++;do{if(S=0,A=m(F,Q,ce,le),A<0){if(ue=Q[0],ce!=le&&(ue=ue*p+(Q[1]||0)),S=Ge(ue/oe),S>1)for(S>=p&&(S=p-1),j=a(F,S,p),K=j.length,le=Q.length;m(j,Q,K,le)==1;)S--,f(j,ce<K?fe:F,K,p),K=j.length,A=1;else S==0&&(A=S=1),j=F.slice(),K=j.length;if(K<le&&(j=[0].concat(j)),f(Q,j,le,p),le=Q.length,A==-1)for(;m(F,Q,ce,le)<1;)S++,f(Q,ce<le?fe:F,le,p),le=Q.length}else A===0&&(S++,Q=[0]);ee[E++]=S,Q[0]?Q[le++]=D[z]||0:(Q=[D[z]],le=1)}while((z++<V||Q[0]!=null)&&L--);M=Q[0]!=null,ee[0]||ee.splice(0,1)}if(p==Qe){for(E=1,L=ee[0];L>=10;L/=10,E++);J(W,h+(W.e=E+P*pe-1)+1,C,M)}else W.e=P,W.r=+M;return W}})();function v(a,m,f,g){var _,h,C,p,A;if(f==null?f=l:Ie(f,0,8),!a.c)return a.toString();if(_=a.c[0],C=a.e,m==null)A=He(a.c),A=g==1||g==2&&(C<=d||C>=w)?Er(A,C):at(A,C,"0");else if(a=J(new c(a),m,f),h=a.e,A=He(a.c),p=A.length,g==1||g==2&&(m<=h||h<=d)){for(;p<m;A+="0",p++);A=Er(A,h)}else if(m-=C+(g===2&&h>C),A=at(A,h,"0"),h+1>p){if(--m>0)for(A+=".";m--;A+="0");}else if(m+=h-p,m>0)for(h+1==p&&(A+=".");m--;A+="0");return a.s<0&&_?"-"+A:A}function G(a,m){for(var f,g,_=1,h=new c(a[0]);_<a.length;_++)g=new c(a[_]),(!g.s||(f=At(h,g))===m||f===0&&h.s===m)&&(h=g);return h}function $(a,m,f){for(var g=1,_=m.length;!m[--_];m.pop());for(_=m[0];_>=10;_/=10,g++);return(f=g+f*pe-1)>O?a.c=a.e=null:f<N?a.c=[a.e=0]:(a.e=f,a.c=m),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,f=/^\.([^.]+)$/,g=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(h,C,p,A){var P,E=p?C:C.replace(_,"");if(g.test(E))h.s=isNaN(E)?null:E<0?-1:1;else{if(!p&&(E=E.replace(a,function(M,S,j){return P=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!A||A==P?S:M}),A&&(P=A,E=E.replace(m,"$1").replace(f,"0.$1")),C!=E))return new c(E,P);if(c.DEBUG)throw Error(je+"Not a"+(A?" base "+A:"")+" number: "+C);h.s=null}h.c=h.e=null}})();function J(a,m,f,g){var _,h,C,p,A,P,E,M=a.c,S=sn;if(M){e:{for(_=1,p=M[0];p>=10;p/=10,_++);if(h=m-_,h<0)h+=pe,C=m,A=M[P=0],E=Ge(A/S[_-C-1]%10);else if(P=nn((h+1)/pe),P>=M.length)if(g){for(;M.length<=P;M.push(0));A=E=0,_=1,h%=pe,C=h-pe+1}else break e;else{for(A=p=M[P],_=1;p>=10;p/=10,_++);h%=pe,C=h-pe+_,E=C<0?0:Ge(A/S[_-C-1]%10)}if(g=g||m<0||M[P+1]!=null||(C<0?A:A%S[_-C-1]),g=f<4?(E||g)&&(f==0||f==(a.s<0?3:2)):E>5||E==5&&(f==4||g||f==6&&(h>0?C>0?A/S[_-C]:0:M[P-1])%10&1||f==(a.s<0?8:7)),m<1||!M[0])return M.length=0,g?(m-=a.e+1,M[0]=S[(pe-m%pe)%pe],a.e=-m||0):M[0]=a.e=0,a;if(h==0?(M.length=P,p=1,P--):(M.length=P+1,p=S[pe-h],M[P]=C>0?Ge(A/S[_-C]%S[C])*p:0),g)for(;;)if(P==0){for(h=1,C=M[0];C>=10;C/=10,h++);for(C=M[0]+=p,p=1;C>=10;C/=10,p++);h!=p&&(a.e++,M[0]==Qe&&(M[0]=1));break}else{if(M[P]+=p,M[P]!=Qe)break;M[P--]=0,p=1}for(h=M.length;M[--h]===0;M.pop());}a.e>O?a.c=a.e=null:a.e<N&&(a.c=[a.e=0])}return a}function X(a){var m,f=a.e;return f===null?a.toString():(m=He(a.c),m=f<=d||f>=w?Er(m,f):at(m,f,"0"),a.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var a=new c(this);return a.s<0&&(a.s=1),a},i.comparedTo=function(a,m){return At(this,new c(a,m))},i.decimalPlaces=i.dp=function(a,m){var f,g,_,h=this;if(a!=null)return Ie(a,0,Ce),m==null?m=l:Ie(m,0,8),J(new c(h),a+h.e+1,m);if(!(f=h.c))return null;if(g=((_=f.length-1)-Ve(this.e/pe))*pe,_=f[_])for(;_%10==0;_/=10,g--);return g<0&&(g=0),g},i.dividedBy=i.div=function(a,m){return e(this,new c(a,m),o,l)},i.dividedToIntegerBy=i.idiv=function(a,m){return e(this,new c(a,m),0,1)},i.exponentiatedBy=i.pow=function(a,m){var f,g,_,h,C,p,A,P,E,M=this;if(a=new c(a),a.c&&!a.isInteger())throw Error(je+"Exponent not an integer: "+X(a));if(m!=null&&(m=new c(m)),p=a.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!a.c||!a.c[0])return E=new c(Math.pow(+X(M),p?a.s*(2-mr(a)):+X(a))),m?E.mod(m):E;if(A=a.s<0,m){if(m.c?!m.c[0]:!m.s)return new c(NaN);g=!A&&M.isInteger()&&m.isInteger(),g&&(M=M.mod(m))}else{if(a.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||p&&M.c[1]>=24e7:M.c[0]<8e13||p&&M.c[0]<=9999975e7)))return h=M.s<0&&mr(a)?-0:0,M.e>-1&&(h=1/h),new c(A?1/h:h);B&&(h=nn(B/pe+2))}for(p?(f=new c(.5),A&&(a.s=1),P=mr(a)):(_=Math.abs(+X(a)),P=_%2),E=new c(s);;){if(P){if(E=E.times(M),!E.c)break;h?E.c.length>h&&(E.c.length=h):g&&(E=E.mod(m))}if(_){if(_=Ge(_/2),_===0)break;P=_%2}else if(a=a.times(f),J(a,a.e+1,1),a.e>14)P=mr(a);else{if(_=+X(a),_===0)break;P=_%2}M=M.times(M),h?M.c&&M.c.length>h&&(M.c.length=h):g&&(M=M.mod(m))}return g?E:(A&&(E=s.div(E)),m?E.mod(m):h?J(E,B,l,C):E)},i.integerValue=function(a){var m=new c(this);return a==null?a=l:Ie(a,0,8),J(m,m.e+1,a)},i.isEqualTo=i.eq=function(a,m){return At(this,new c(a,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(a,m){return At(this,new c(a,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(a,m){return(m=At(this,new c(a,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Ve(this.e/pe)>this.c.length-2},i.isLessThan=i.lt=function(a,m){return At(this,new c(a,m))<0},i.isLessThanOrEqualTo=i.lte=function(a,m){return(m=At(this,new c(a,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(a,m){var f,g,_,h,C=this,p=C.s;if(a=new c(a,m),m=a.s,!p||!m)return new c(NaN);if(p!=m)return a.s=-m,C.plus(a);var A=C.e/pe,P=a.e/pe,E=C.c,M=a.c;if(!A||!P){if(!E||!M)return E?(a.s=-m,a):new c(M?C:NaN);if(!E[0]||!M[0])return M[0]?(a.s=-m,a):new c(E[0]?C:l==3?-0:0)}if(A=Ve(A),P=Ve(P),E=E.slice(),p=A-P){for((h=p<0)?(p=-p,_=E):(P=A,_=M),_.reverse(),m=p;m--;_.push(0));_.reverse()}else for(g=(h=(p=E.length)<(m=M.length))?p:m,p=m=0;m<g;m++)if(E[m]!=M[m]){h=E[m]<M[m];break}if(h&&(_=E,E=M,M=_,a.s=-a.s),m=(g=M.length)-(f=E.length),m>0)for(;m--;E[f++]=0);for(m=Qe-1;g>p;){if(E[--g]<M[g]){for(f=g;f&&!E[--f];E[f]=m);--E[f],E[g]+=Qe}E[g]-=M[g]}for(;E[0]==0;E.splice(0,1),--P);return E[0]?$(a,E,P):(a.s=l==3?-1:1,a.c=[a.e=0],a)},i.modulo=i.mod=function(a,m){var f,g,_=this;return a=new c(a,m),!_.c||!a.s||a.c&&!a.c[0]?new c(NaN):!a.c||_.c&&!_.c[0]?new c(_):(k==9?(g=a.s,a.s=1,f=e(_,a,0,3),a.s=g,f.s*=g):f=e(_,a,0,k),a=_.minus(f.times(a)),!a.c[0]&&k==1&&(a.s=_.s),a)},i.multipliedBy=i.times=function(a,m){var f,g,_,h,C,p,A,P,E,M,S,j,K,W,ee,Q=this,le=Q.c,ue=(a=new c(a,m)).c;if(!le||!ue||!le[0]||!ue[0])return!Q.s||!a.s||le&&!le[0]&&!ue||ue&&!ue[0]&&!le?a.c=a.e=a.s=null:(a.s*=Q.s,!le||!ue?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(g=Ve(Q.e/pe)+Ve(a.e/pe),a.s*=Q.s,A=le.length,M=ue.length,A<M&&(K=le,le=ue,ue=K,_=A,A=M,M=_),_=A+M,K=[];_--;K.push(0));for(W=Qe,ee=pt,_=M;--_>=0;){for(f=0,S=ue[_]%ee,j=ue[_]/ee|0,C=A,h=_+C;h>_;)P=le[--C]%ee,E=le[C]/ee|0,p=j*P+E*S,P=S*P+p%ee*ee+K[h]+f,f=(P/W|0)+(p/ee|0)+j*E,K[h--]=P%W;K[h]=f}return f?++g:K.splice(0,1),$(a,K,g)},i.negated=function(){var a=new c(this);return a.s=-a.s||null,a},i.plus=function(a,m){var f,g=this,_=g.s;if(a=new c(a,m),m=a.s,!_||!m)return new c(NaN);if(_!=m)return a.s=-m,g.minus(a);var h=g.e/pe,C=a.e/pe,p=g.c,A=a.c;if(!h||!C){if(!p||!A)return new c(_/0);if(!p[0]||!A[0])return A[0]?a:new c(p[0]?g:_*0)}if(h=Ve(h),C=Ve(C),p=p.slice(),_=h-C){for(_>0?(C=h,f=A):(_=-_,f=p),f.reverse();_--;f.push(0));f.reverse()}for(_=p.length,m=A.length,_-m<0&&(f=A,A=p,p=f,m=_),_=0;m;)_=(p[--m]=p[m]+A[m]+_)/Qe|0,p[m]=Qe===p[m]?0:p[m]%Qe;return _&&(p=[_].concat(p),++C),$(a,p,C)},i.precision=i.sd=function(a,m){var f,g,_,h=this;if(a!=null&&a!==!!a)return Ie(a,1,Ce),m==null?m=l:Ie(m,0,8),J(new c(h),a,m);if(!(f=h.c))return null;if(_=f.length-1,g=_*pe+1,_=f[_]){for(;_%10==0;_/=10,g--);for(_=f[0];_>=10;_/=10,g++);}return a&&h.e+1>g&&(g=h.e+1),g},i.shiftedBy=function(a){return Ie(a,-on,on),this.times("1e"+a)},i.squareRoot=i.sqrt=function(){var a,m,f,g,_,h=this,C=h.c,p=h.s,A=h.e,P=o+4,E=new c("0.5");if(p!==1||!C||!C[0])return new c(!p||p<0&&(!C||C[0])?NaN:C?h:1/0);if(p=Math.sqrt(+X(h)),p==0||p==1/0?(m=He(C),(m.length+A)%2==0&&(m+="0"),p=Math.sqrt(+m),A=Ve((A+1)/2)-(A<0||A%2),p==1/0?m="5e"+A:(m=p.toExponential(),m=m.slice(0,m.indexOf("e")+1)+A),f=new c(m)):f=new c(p+""),f.c[0]){for(A=f.e,p=A+P,p<3&&(p=0);;)if(_=f,f=E.times(_.plus(e(h,_,P,1))),He(_.c).slice(0,p)===(m=He(f.c)).slice(0,p))if(f.e<A&&--p,m=m.slice(p-3,p+1),m=="9999"||!g&&m=="4999"){if(!g&&(J(_,_.e+o+2,0),_.times(_).eq(h))){f=_;break}P+=4,p+=4,g=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(J(f,f.e+o+2,1),a=!f.times(f).eq(h));break}}return J(f,f.e+o+1,l,a)},i.toExponential=function(a,m){return a!=null&&(Ie(a,0,Ce),a++),v(this,a,m,1)},i.toFixed=function(a,m){return a!=null&&(Ie(a,0,Ce),a=a+this.e+1),v(this,a,m)},i.toFormat=function(a,m,f){var g,_=this;if(f==null)a!=null&&m&&typeof m=="object"?(f=m,m=null):a&&typeof a=="object"?(f=a,a=m=null):f=y;else if(typeof f!="object")throw Error(je+"Argument not an object: "+f);if(g=_.toFixed(a,m),_.c){var h,C=g.split("."),p=+f.groupSize,A=+f.secondaryGroupSize,P=f.groupSeparator||"",E=C[0],M=C[1],S=_.s<0,j=S?E.slice(1):E,K=j.length;if(A&&(h=p,p=A,A=h,K-=h),p>0&&K>0){for(h=K%p||p,E=j.substr(0,h);h<K;h+=p)E+=P+j.substr(h,p);A>0&&(E+=P+j.slice(h)),S&&(E="-"+E)}g=M?E+(f.decimalSeparator||"")+((A=+f.fractionGroupSize)?M.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):M):E}return(f.prefix||"")+g+(f.suffix||"")},i.toFraction=function(a){var m,f,g,_,h,C,p,A,P,E,M,S,j=this,K=j.c;if(a!=null&&(p=new c(a),!p.isInteger()&&(p.c||p.s!==1)||p.lt(s)))throw Error(je+"Argument "+(p.isInteger()?"out of range: ":"not an integer: ")+X(p));if(!K)return new c(j);for(m=new c(s),P=f=new c(s),g=A=new c(s),S=He(K),h=m.e=S.length-j.e-1,m.c[0]=sn[(C=h%pe)<0?pe+C:C],a=!a||p.comparedTo(m)>0?h>0?m:P:p,C=O,O=1/0,p=new c(S),A.c[0]=0;E=e(p,m,0,1),_=f.plus(E.times(g)),_.comparedTo(a)!=1;)f=g,g=_,P=A.plus(E.times(_=P)),A=_,m=p.minus(E.times(_=m)),p=_;return _=e(a.minus(f),g,0,1),A=A.plus(_.times(P)),f=f.plus(_.times(g)),A.s=P.s=j.s,h=h*2,M=e(P,g,h,l).minus(j).abs().comparedTo(e(A,f,h,l).minus(j).abs())<1?[P,g]:[A,f],O=C,M},i.toNumber=function(){return+X(this)},i.toPrecision=function(a,m){return a!=null&&Ie(a,1,Ce),v(this,a,m,2)},i.toString=function(a){var m,f=this,g=f.s,_=f.e;return _===null?g?(m="Infinity",g<0&&(m="-"+m)):m="NaN":(a==null?m=_<=d||_>=w?Er(He(f.c),_):at(He(f.c),_,"0"):a===10&&u?(f=J(new c(f),o+_+1,l),m=at(He(f.c),f.e,"0")):(Ie(a,2,b.length,"Base"),m=t(at(He(f.c),_,"0"),10,a,g,!0)),g<0&&f.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return X(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,r!=null&&c.set(r),c}function Ve(r){var e=r|0;return r>0||r===e?e:e-1}function He(r){for(var e,t,n=1,i=r.length,s=r[0]+"";n<i;){for(e=r[n++]+"",t=pe-e.length;t--;e="0"+e);s+=e}for(i=s.length;s.charCodeAt(--i)===48;);return s.slice(0,i+1||1)}function At(r,e){var t,n,i=r.c,s=e.c,o=r.s,l=e.s,d=r.e,w=e.e;if(!o||!l)return null;if(t=i&&!i[0],n=s&&!s[0],t||n)return t?n?0:-l:o;if(o!=l)return o;if(t=o<0,n=d==w,!i||!s)return n?0:!i^t?1:-1;if(!n)return d>w^t?1:-1;for(l=(d=i.length)<(w=s.length)?d:w,o=0;o<l;o++)if(i[o]!=s[o])return i[o]>s[o]^t?1:-1;return d==w?0:d>w^t?1:-1}function Ie(r,e,t,n){if(r<e||r>t||r!==Ge(r))throw Error(je+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function mr(r){var e=r.c.length-1;return Ve(r.e/pe)==e&&r.c[e]%2!=0}function Er(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function at(r,e,t){var n,i;if(e<0){for(i=t+".";++e;i+=t);r=i+r}else if(n=r.length,++e>n){for(i=t,e-=n;--e;i+=t);r+=i}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}$o();var an={},Rt={},ln,Ai;function Ho(){if(Ai)return ln;Ai=1,ln=s,s.default=s,s.stable=w,s.stableStringify=w;var r="[...]",e="[Circular]",t=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(I,k,B,y){typeof y>"u"&&(y=i()),l(I,"",0,[],void 0,0,y);var b;try{n.length===0?b=JSON.stringify(I,k,B):b=JSON.stringify(I,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var u=t.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return b}function o(I,k,B,y){var b=Object.getOwnPropertyDescriptor(y,B);b.get!==void 0?b.configurable?(Object.defineProperty(y,B,{value:I}),t.push([y,B,k,b])):n.push([k,B,I]):(y[B]=I,t.push([y,B,k]))}function l(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)l(I[v],v,v,y,I,u,c);else{var G=Object.keys(I);for(v=0;v<G.length;v++){var $=G[v];l(I[$],$,v,y,I,u,c)}}y.pop()}}function d(I,k){return I<k?-1:I>k?1:0}function w(I,k,B,y){typeof y>"u"&&(y=i());var b=N(I,"",0,[],void 0,0,y)||I,u;try{n.length===0?u=JSON.stringify(b,k,B):u=JSON.stringify(b,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var c=t.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return u}function N(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}try{if(typeof I.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)N(I[v],v,v,y,I,u,c);else{var G={},$=Object.keys(I).sort(d);for(v=0;v<$.length;v++){var J=$[v];N(I[J],J,v,y,I,u,c),G[J]=I[J]}if(typeof b<"u")t.push([b,k,I]),b[k]=G;else return G}y.pop()}}function O(I){return I=typeof I<"u"?I:function(k,B){return B},function(k,B){if(n.length>0)for(var y=0;y<n.length;y++){var b=n[y];if(b[1]===k&&b[0]===B){B=b[2],n.splice(y,1);break}}return I.call(this,k,B)}}return ln}var Ri;function ei(){if(Ri)return Rt;Ri=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.EthereumProviderError=Rt.EthereumRpcError=void 0;const r=Ho();class e extends Error{constructor(o,l,d){if(!Number.isInteger(o))throw new Error('"code" must be an integer.');if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string.');super(l),this.code=o,d!==void 0&&(this.data=d)}serialize(){const o={code:this.code,message:this.message};return this.data!==void 0&&(o.data=this.data),this.stack&&(o.stack=this.stack),o}toString(){return r.default(this.serialize(),i,2)}}Rt.EthereumRpcError=e;class t extends e{constructor(o,l,d){if(!n(o))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(o,l,d)}}Rt.EthereumProviderError=t;function n(s){return Number.isInteger(s)&&s>=1e3&&s<=4999}function i(s,o){if(o!=="[Circular]")return o}return Rt}var un={},It={},Ii;function ti(){return Ii||(Ii=1,Object.defineProperty(It,"__esModule",{value:!0}),It.errorValues=It.errorCodes=void 0,It.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},It.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}),It}var Ti;function zo(){return Ti||(Ti=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ti(),t=ei(),n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(I,k=i){if(Number.isInteger(I)){const B=I.toString();if(O(e.errorValues,B))return e.errorValues[B].message;if(w(I))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return k}r.getMessageFromCode=o;function l(I){if(!Number.isInteger(I))return!1;const k=I.toString();return!!(e.errorValues[k]||w(I))}r.isValidCode=l;function d(I,{fallbackError:k=s,shouldIncludeStack:B=!1}={}){var y,b;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(I instanceof t.EthereumRpcError)return I.serialize();const u={};if(I&&typeof I=="object"&&!Array.isArray(I)&&O(I,"code")&&l(I.code)){const v=I;u.code=v.code,v.message&&typeof v.message=="string"?(u.message=v.message,O(v,"data")&&(u.data=v.data)):(u.message=o(u.code),u.data={originalError:N(I)})}else{u.code=k.code;const v=(y=I)===null||y===void 0?void 0:y.message;u.message=v&&typeof v=="string"?v:k.message,u.data={originalError:N(I)}}const c=(b=I)===null||b===void 0?void 0:b.stack;return B&&I&&c&&typeof c=="string"&&(u.stack=c),u}r.serializeError=d;function w(I){return I>=-32099&&I<=-32e3}function N(I){return I&&typeof I=="object"&&!Array.isArray(I)?Object.assign({},I):I}function O(I,k){return Object.prototype.hasOwnProperty.call(I,k)}})(un)),un}var Vt={},xi;function ra(){if(xi)return Vt;xi=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.ethErrors=void 0;const r=ei(),e=zo(),t=ti();Vt.ethErrors={rpc:{parse:o=>n(t.errorCodes.rpc.parse,o),invalidRequest:o=>n(t.errorCodes.rpc.invalidRequest,o),invalidParams:o=>n(t.errorCodes.rpc.invalidParams,o),methodNotFound:o=>n(t.errorCodes.rpc.methodNotFound,o),internal:o=>n(t.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:l}=o;if(!Number.isInteger(l)||l>-32005||l<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(l,o)},invalidInput:o=>n(t.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>n(t.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>n(t.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>n(t.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>n(t.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>n(t.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>i(t.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>i(t.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>i(t.errorCodes.provider.unsupportedMethod,o),disconnected:o=>i(t.errorCodes.provider.disconnected,o),chainDisconnected:o=>i(t.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:l,message:d,data:w}=o;if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(l,d,w)}}};function n(o,l){const[d,w]=s(l);return new r.EthereumRpcError(o,d||e.getMessageFromCode(o),w)}function i(o,l){const[d,w]=s(l);return new r.EthereumProviderError(o,d||e.getMessageFromCode(o),w)}function s(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:l,data:d}=o;if(l&&typeof l!="string")throw new Error("Must specify string message.");return[l||void 0,d]}}return[]}return Vt}var Oi;function na(){return Oi||(Oi=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const e=ei();Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const t=zo();Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const n=ra();Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ti();Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(an)),an}function Xt(r){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(r)}function ia(r,e){if(Xt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Xt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function oa(r){var e=ia(r,"string");return Xt(e)=="symbol"?e:e+""}function ge(r,e,t){return(e=oa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ni(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ye(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ni(Object(t),!0).forEach(function(n){ge(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ni(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var fn={exports:{}},cn={exports:{}},dn,Ci;function Te(){if(Ci)return dn;Ci=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let i=0;i<t.length;i++)n+=` ${t[i].stack}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const be=require("./web3-BKaP497Y.js"),tr=require("./index-cCBQV2Yv.js"),ea=require("./index.es-LBG64XJ6.js");require("./index-BxM99sFL.js");var ta=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,nn=Math.ceil,Ge=Math.floor,je="[BigNumber Error] ",vi=je+"Number primitive has more than 15 significant digits: ",Qe=1e14,pe=14,on=9007199254740991,sn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],pt=1e7,Ce=1e9;function $o(r){var e,t,n,i=c.prototype={constructor:c,toString:null,valueOf:null},s=new c(1),o=20,l=4,d=-7,w=21,N=-1e7,O=1e7,I=!1,k=1,B=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",u=!0;function c(a,m){var f,g,_,h,C,p,A,P,E=this;if(!(E instanceof c))return new c(a,m);if(m==null){if(a&&a._isBigNumber===!0){E.s=a.s,!a.c||a.e>O?E.c=E.e=null:a.e<N?E.c=[E.e=0]:(E.e=a.e,E.c=a.c.slice());return}if((p=typeof a=="number")&&a*0==0){if(E.s=1/a<0?(a=-a,-1):1,a===~~a){for(h=0,C=a;C>=10;C/=10,h++);h>O?E.c=E.e=null:(E.e=h,E.c=[a]);return}P=String(a)}else{if(!ta.test(P=String(a)))return n(E,P,p);E.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(h=P.indexOf("."))>-1&&(P=P.replace(".","")),(C=P.search(/e/i))>0?(h<0&&(h=C),h+=+P.slice(C+1),P=P.substring(0,C)):h<0&&(h=P.length)}else{if(Ie(m,2,b.length,"Base"),m==10&&u)return E=new c(a),J(E,o+E.e+1,l);if(P=String(a),p=typeof a=="number"){if(a*0!=0)return n(E,P,p,m);if(E.s=1/a<0?(P=P.slice(1),-1):1,c.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(vi+a)}else E.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(f=b.slice(0,m),h=C=0,A=P.length;C<A;C++)if(f.indexOf(g=P.charAt(C))<0){if(g=="."){if(C>h){h=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,C=-1,h=0;continue}return n(E,String(a),p,m)}p=!1,P=t(P,m,10,E.s),(h=P.indexOf("."))>-1?P=P.replace(".",""):h=P.length}for(C=0;P.charCodeAt(C)===48;C++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(C,++A)){if(A-=C,p&&c.DEBUG&&A>15&&(a>on||a!==Ge(a)))throw Error(vi+E.s*a);if((h=h-C-1)>O)E.c=E.e=null;else if(h<N)E.c=[E.e=0];else{if(E.e=h,E.c=[],C=(h+1)%pe,h<0&&(C+=pe),C<A){for(C&&E.c.push(+P.slice(0,C)),A-=pe;C<A;)E.c.push(+P.slice(C,C+=pe));C=pe-(P=P.slice(C)).length}else C-=A;for(;C--;P+="0");E.c.push(+P)}}else E.c=[E.e=0]}c.clone=$o,c.ROUND_UP=0,c.ROUND_DOWN=1,c.ROUND_CEIL=2,c.ROUND_FLOOR=3,c.ROUND_HALF_UP=4,c.ROUND_HALF_DOWN=5,c.ROUND_HALF_EVEN=6,c.ROUND_HALF_CEIL=7,c.ROUND_HALF_FLOOR=8,c.EUCLID=9,c.config=c.set=function(a){var m,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(m="DECIMAL_PLACES")&&(f=a[m],Ie(f,0,Ce,m),o=f),a.hasOwnProperty(m="ROUNDING_MODE")&&(f=a[m],Ie(f,0,8,m),l=f),a.hasOwnProperty(m="EXPONENTIAL_AT")&&(f=a[m],f&&f.pop?(Ie(f[0],-Ce,0,m),Ie(f[1],0,Ce,m),d=f[0],w=f[1]):(Ie(f,-Ce,Ce,m),d=-(w=f<0?-f:f))),a.hasOwnProperty(m="RANGE"))if(f=a[m],f&&f.pop)Ie(f[0],-Ce,-1,m),Ie(f[1],1,Ce,m),N=f[0],O=f[1];else if(Ie(f,-Ce,Ce,m),f)N=-(O=f<0?-f:f);else throw Error(je+m+" cannot be zero: "+f);if(a.hasOwnProperty(m="CRYPTO"))if(f=a[m],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))I=f;else throw I=!f,Error(je+"crypto unavailable");else I=f;else throw Error(je+m+" not true or false: "+f);if(a.hasOwnProperty(m="MODULO_MODE")&&(f=a[m],Ie(f,0,9,m),k=f),a.hasOwnProperty(m="POW_PRECISION")&&(f=a[m],Ie(f,0,Ce,m),B=f),a.hasOwnProperty(m="FORMAT"))if(f=a[m],typeof f=="object")y=f;else throw Error(je+m+" not an object: "+f);if(a.hasOwnProperty(m="ALPHABET"))if(f=a[m],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))u=f.slice(0,10)=="0123456789",b=f;else throw Error(je+m+" invalid: "+f)}else throw Error(je+"Object expected: "+a);return{DECIMAL_PLACES:o,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,w],RANGE:[N,O],CRYPTO:I,MODULO_MODE:k,POW_PRECISION:B,FORMAT:y,ALPHABET:b}},c.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!c.DEBUG)return!0;var m,f,g=a.c,_=a.e,h=a.s;e:if({}.toString.call(g)=="[object Array]"){if((h===1||h===-1)&&_>=-Ce&&_<=Ce&&_===Ge(_)){if(g[0]===0){if(_===0&&g.length===1)return!0;break e}if(m=(_+1)%pe,m<1&&(m+=pe),String(g[0]).length==m){for(m=0;m<g.length;m++)if(f=g[m],f<0||f>=Qe||f!==Ge(f))break e;if(f!==0)return!0}}}else if(g===null&&_===null&&(h===null||h===1||h===-1))return!0;throw Error(je+"Invalid BigNumber: "+a)},c.maximum=c.max=function(){return G(arguments,-1)},c.minimum=c.min=function(){return G(arguments,1)},c.random=(function(){var a=9007199254740992,m=Math.random()*a&2097151?function(){return Ge(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var g,_,h,C,p,A=0,P=[],E=new c(s);if(f==null?f=o:Ie(f,0,Ce),C=nn(f/pe),I)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(C*=2));A<C;)p=g[A]*131072+(g[A+1]>>>11),p>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),g[A]=_[0],g[A+1]=_[1]):(P.push(p%1e14),A+=2);A=C/2}else if(crypto.randomBytes){for(g=crypto.randomBytes(C*=7);A<C;)p=(g[A]&31)*281474976710656+g[A+1]*1099511627776+g[A+2]*4294967296+g[A+3]*16777216+(g[A+4]<<16)+(g[A+5]<<8)+g[A+6],p>=9e15?crypto.randomBytes(7).copy(g,A):(P.push(p%1e14),A+=7);A=C/7}else throw I=!1,Error(je+"crypto unavailable");if(!I)for(;A<C;)p=m(),p<9e15&&(P[A++]=p%1e14);for(C=P[--A],f%=pe,C&&f&&(p=sn[pe-f],P[A]=Ge(C/p)*p);P[A]===0;P.pop(),A--);if(A<0)P=[h=0];else{for(h=-1;P[0]===0;P.splice(0,1),h-=pe);for(A=1,p=P[0];p>=10;p/=10,A++);A<pe&&(h-=pe-A)}return E.e=h,E.c=P,E}})(),c.sum=function(){for(var a=1,m=arguments,f=new c(m[0]);a<m.length;)f=f.plus(m[a++]);return f},t=(function(){var a="0123456789";function m(f,g,_,h){for(var C,p=[0],A,P=0,E=f.length;P<E;){for(A=p.length;A--;p[A]*=g);for(p[0]+=h.indexOf(f.charAt(P++)),C=0;C<p.length;C++)p[C]>_-1&&(p[C+1]==null&&(p[C+1]=0),p[C+1]+=p[C]/_|0,p[C]%=_)}return p.reverse()}return function(f,g,_,h,C){var p,A,P,E,M,S,j,K,W=f.indexOf("."),ee=o,Q=l;for(W>=0&&(E=B,B=0,f=f.replace(".",""),K=new c(g),S=K.pow(f.length-W),B=E,K.c=m(at(He(S.c),S.e,"0"),10,_,a),K.e=K.c.length),j=m(f,g,_,C?(p=b,a):(p=a,b)),P=E=j.length;j[--E]==0;j.pop());if(!j[0])return p.charAt(0);if(W<0?--P:(S.c=j,S.e=P,S.s=h,S=e(S,K,ee,Q,_),j=S.c,M=S.r,P=S.e),A=P+ee+1,W=j[A],E=_/2,M=M||A<0||j[A+1]!=null,M=Q<4?(W!=null||M)&&(Q==0||Q==(S.s<0?3:2)):W>E||W==E&&(Q==4||M||Q==6&&j[A-1]&1||Q==(S.s<0?8:7)),A<1||!j[0])f=M?at(p.charAt(1),-ee,p.charAt(0)):p.charAt(0);else{if(j.length=A,M)for(--_;++j[--A]>_;)j[A]=0,A||(++P,j=[1].concat(j));for(E=j.length;!j[--E];);for(W=0,f="";W<=E;f+=p.charAt(j[W++]));f=at(f,P,p.charAt(0))}return f}})(),e=(function(){function a(g,_,h){var C,p,A,P,E=0,M=g.length,S=_%pt,j=_/pt|0;for(g=g.slice();M--;)A=g[M]%pt,P=g[M]/pt|0,C=j*A+P*S,p=S*A+C%pt*pt+E,E=(p/h|0)+(C/pt|0)+j*P,g[M]=p%h;return E&&(g=[E].concat(g)),g}function m(g,_,h,C){var p,A;if(h!=C)A=h>C?1:-1;else for(p=A=0;p<h;p++)if(g[p]!=_[p]){A=g[p]>_[p]?1:-1;break}return A}function f(g,_,h,C){for(var p=0;h--;)g[h]-=p,p=g[h]<_[h]?1:0,g[h]=p*C+g[h]-_[h];for(;!g[0]&&g.length>1;g.splice(0,1));}return function(g,_,h,C,p){var A,P,E,M,S,j,K,W,ee,Q,le,ue,z,V,oe,ce,fe,L=g.s==_.s?1:-1,D=g.c,F=_.c;if(!D||!D[0]||!F||!F[0])return new c(!g.s||!_.s||(D?F&&D[0]==F[0]:!F)?NaN:D&&D[0]==0||!F?L*0:L/0);for(W=new c(L),ee=W.c=[],P=g.e-_.e,L=h+P+1,p||(p=Qe,P=Ve(g.e/pe)-Ve(_.e/pe),L=L/pe|0),E=0;F[E]==(D[E]||0);E++);if(F[E]>(D[E]||0)&&P--,L<0)ee.push(1),M=!0;else{for(V=D.length,ce=F.length,E=0,L+=2,S=Ge(p/(F[0]+1)),S>1&&(F=a(F,S,p),D=a(D,S,p),ce=F.length,V=D.length),z=ce,Q=D.slice(0,ce),le=Q.length;le<ce;Q[le++]=0);fe=F.slice(),fe=[0].concat(fe),oe=F[0],F[1]>=p/2&&oe++;do{if(S=0,A=m(F,Q,ce,le),A<0){if(ue=Q[0],ce!=le&&(ue=ue*p+(Q[1]||0)),S=Ge(ue/oe),S>1)for(S>=p&&(S=p-1),j=a(F,S,p),K=j.length,le=Q.length;m(j,Q,K,le)==1;)S--,f(j,ce<K?fe:F,K,p),K=j.length,A=1;else S==0&&(A=S=1),j=F.slice(),K=j.length;if(K<le&&(j=[0].concat(j)),f(Q,j,le,p),le=Q.length,A==-1)for(;m(F,Q,ce,le)<1;)S++,f(Q,ce<le?fe:F,le,p),le=Q.length}else A===0&&(S++,Q=[0]);ee[E++]=S,Q[0]?Q[le++]=D[z]||0:(Q=[D[z]],le=1)}while((z++<V||Q[0]!=null)&&L--);M=Q[0]!=null,ee[0]||ee.splice(0,1)}if(p==Qe){for(E=1,L=ee[0];L>=10;L/=10,E++);J(W,h+(W.e=E+P*pe-1)+1,C,M)}else W.e=P,W.r=+M;return W}})();function v(a,m,f,g){var _,h,C,p,A;if(f==null?f=l:Ie(f,0,8),!a.c)return a.toString();if(_=a.c[0],C=a.e,m==null)A=He(a.c),A=g==1||g==2&&(C<=d||C>=w)?Er(A,C):at(A,C,"0");else if(a=J(new c(a),m,f),h=a.e,A=He(a.c),p=A.length,g==1||g==2&&(m<=h||h<=d)){for(;p<m;A+="0",p++);A=Er(A,h)}else if(m-=C+(g===2&&h>C),A=at(A,h,"0"),h+1>p){if(--m>0)for(A+=".";m--;A+="0");}else if(m+=h-p,m>0)for(h+1==p&&(A+=".");m--;A+="0");return a.s<0&&_?"-"+A:A}function G(a,m){for(var f,g,_=1,h=new c(a[0]);_<a.length;_++)g=new c(a[_]),(!g.s||(f=At(h,g))===m||f===0&&h.s===m)&&(h=g);return h}function $(a,m,f){for(var g=1,_=m.length;!m[--_];m.pop());for(_=m[0];_>=10;_/=10,g++);return(f=g+f*pe-1)>O?a.c=a.e=null:f<N?a.c=[a.e=0]:(a.e=f,a.c=m),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,f=/^\.([^.]+)$/,g=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(h,C,p,A){var P,E=p?C:C.replace(_,"");if(g.test(E))h.s=isNaN(E)?null:E<0?-1:1;else{if(!p&&(E=E.replace(a,function(M,S,j){return P=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!A||A==P?S:M}),A&&(P=A,E=E.replace(m,"$1").replace(f,"0.$1")),C!=E))return new c(E,P);if(c.DEBUG)throw Error(je+"Not a"+(A?" base "+A:"")+" number: "+C);h.s=null}h.c=h.e=null}})();function J(a,m,f,g){var _,h,C,p,A,P,E,M=a.c,S=sn;if(M){e:{for(_=1,p=M[0];p>=10;p/=10,_++);if(h=m-_,h<0)h+=pe,C=m,A=M[P=0],E=Ge(A/S[_-C-1]%10);else if(P=nn((h+1)/pe),P>=M.length)if(g){for(;M.length<=P;M.push(0));A=E=0,_=1,h%=pe,C=h-pe+1}else break e;else{for(A=p=M[P],_=1;p>=10;p/=10,_++);h%=pe,C=h-pe+_,E=C<0?0:Ge(A/S[_-C-1]%10)}if(g=g||m<0||M[P+1]!=null||(C<0?A:A%S[_-C-1]),g=f<4?(E||g)&&(f==0||f==(a.s<0?3:2)):E>5||E==5&&(f==4||g||f==6&&(h>0?C>0?A/S[_-C]:0:M[P-1])%10&1||f==(a.s<0?8:7)),m<1||!M[0])return M.length=0,g?(m-=a.e+1,M[0]=S[(pe-m%pe)%pe],a.e=-m||0):M[0]=a.e=0,a;if(h==0?(M.length=P,p=1,P--):(M.length=P+1,p=S[pe-h],M[P]=C>0?Ge(A/S[_-C]%S[C])*p:0),g)for(;;)if(P==0){for(h=1,C=M[0];C>=10;C/=10,h++);for(C=M[0]+=p,p=1;C>=10;C/=10,p++);h!=p&&(a.e++,M[0]==Qe&&(M[0]=1));break}else{if(M[P]+=p,M[P]!=Qe)break;M[P--]=0,p=1}for(h=M.length;M[--h]===0;M.pop());}a.e>O?a.c=a.e=null:a.e<N&&(a.c=[a.e=0])}return a}function X(a){var m,f=a.e;return f===null?a.toString():(m=He(a.c),m=f<=d||f>=w?Er(m,f):at(m,f,"0"),a.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var a=new c(this);return a.s<0&&(a.s=1),a},i.comparedTo=function(a,m){return At(this,new c(a,m))},i.decimalPlaces=i.dp=function(a,m){var f,g,_,h=this;if(a!=null)return Ie(a,0,Ce),m==null?m=l:Ie(m,0,8),J(new c(h),a+h.e+1,m);if(!(f=h.c))return null;if(g=((_=f.length-1)-Ve(this.e/pe))*pe,_=f[_])for(;_%10==0;_/=10,g--);return g<0&&(g=0),g},i.dividedBy=i.div=function(a,m){return e(this,new c(a,m),o,l)},i.dividedToIntegerBy=i.idiv=function(a,m){return e(this,new c(a,m),0,1)},i.exponentiatedBy=i.pow=function(a,m){var f,g,_,h,C,p,A,P,E,M=this;if(a=new c(a),a.c&&!a.isInteger())throw Error(je+"Exponent not an integer: "+X(a));if(m!=null&&(m=new c(m)),p=a.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!a.c||!a.c[0])return E=new c(Math.pow(+X(M),p?a.s*(2-mr(a)):+X(a))),m?E.mod(m):E;if(A=a.s<0,m){if(m.c?!m.c[0]:!m.s)return new c(NaN);g=!A&&M.isInteger()&&m.isInteger(),g&&(M=M.mod(m))}else{if(a.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||p&&M.c[1]>=24e7:M.c[0]<8e13||p&&M.c[0]<=9999975e7)))return h=M.s<0&&mr(a)?-0:0,M.e>-1&&(h=1/h),new c(A?1/h:h);B&&(h=nn(B/pe+2))}for(p?(f=new c(.5),A&&(a.s=1),P=mr(a)):(_=Math.abs(+X(a)),P=_%2),E=new c(s);;){if(P){if(E=E.times(M),!E.c)break;h?E.c.length>h&&(E.c.length=h):g&&(E=E.mod(m))}if(_){if(_=Ge(_/2),_===0)break;P=_%2}else if(a=a.times(f),J(a,a.e+1,1),a.e>14)P=mr(a);else{if(_=+X(a),_===0)break;P=_%2}M=M.times(M),h?M.c&&M.c.length>h&&(M.c.length=h):g&&(M=M.mod(m))}return g?E:(A&&(E=s.div(E)),m?E.mod(m):h?J(E,B,l,C):E)},i.integerValue=function(a){var m=new c(this);return a==null?a=l:Ie(a,0,8),J(m,m.e+1,a)},i.isEqualTo=i.eq=function(a,m){return At(this,new c(a,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(a,m){return At(this,new c(a,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(a,m){return(m=At(this,new c(a,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Ve(this.e/pe)>this.c.length-2},i.isLessThan=i.lt=function(a,m){return At(this,new c(a,m))<0},i.isLessThanOrEqualTo=i.lte=function(a,m){return(m=At(this,new c(a,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(a,m){var f,g,_,h,C=this,p=C.s;if(a=new c(a,m),m=a.s,!p||!m)return new c(NaN);if(p!=m)return a.s=-m,C.plus(a);var A=C.e/pe,P=a.e/pe,E=C.c,M=a.c;if(!A||!P){if(!E||!M)return E?(a.s=-m,a):new c(M?C:NaN);if(!E[0]||!M[0])return M[0]?(a.s=-m,a):new c(E[0]?C:l==3?-0:0)}if(A=Ve(A),P=Ve(P),E=E.slice(),p=A-P){for((h=p<0)?(p=-p,_=E):(P=A,_=M),_.reverse(),m=p;m--;_.push(0));_.reverse()}else for(g=(h=(p=E.length)<(m=M.length))?p:m,p=m=0;m<g;m++)if(E[m]!=M[m]){h=E[m]<M[m];break}if(h&&(_=E,E=M,M=_,a.s=-a.s),m=(g=M.length)-(f=E.length),m>0)for(;m--;E[f++]=0);for(m=Qe-1;g>p;){if(E[--g]<M[g]){for(f=g;f&&!E[--f];E[f]=m);--E[f],E[g]+=Qe}E[g]-=M[g]}for(;E[0]==0;E.splice(0,1),--P);return E[0]?$(a,E,P):(a.s=l==3?-1:1,a.c=[a.e=0],a)},i.modulo=i.mod=function(a,m){var f,g,_=this;return a=new c(a,m),!_.c||!a.s||a.c&&!a.c[0]?new c(NaN):!a.c||_.c&&!_.c[0]?new c(_):(k==9?(g=a.s,a.s=1,f=e(_,a,0,3),a.s=g,f.s*=g):f=e(_,a,0,k),a=_.minus(f.times(a)),!a.c[0]&&k==1&&(a.s=_.s),a)},i.multipliedBy=i.times=function(a,m){var f,g,_,h,C,p,A,P,E,M,S,j,K,W,ee,Q=this,le=Q.c,ue=(a=new c(a,m)).c;if(!le||!ue||!le[0]||!ue[0])return!Q.s||!a.s||le&&!le[0]&&!ue||ue&&!ue[0]&&!le?a.c=a.e=a.s=null:(a.s*=Q.s,!le||!ue?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(g=Ve(Q.e/pe)+Ve(a.e/pe),a.s*=Q.s,A=le.length,M=ue.length,A<M&&(K=le,le=ue,ue=K,_=A,A=M,M=_),_=A+M,K=[];_--;K.push(0));for(W=Qe,ee=pt,_=M;--_>=0;){for(f=0,S=ue[_]%ee,j=ue[_]/ee|0,C=A,h=_+C;h>_;)P=le[--C]%ee,E=le[C]/ee|0,p=j*P+E*S,P=S*P+p%ee*ee+K[h]+f,f=(P/W|0)+(p/ee|0)+j*E,K[h--]=P%W;K[h]=f}return f?++g:K.splice(0,1),$(a,K,g)},i.negated=function(){var a=new c(this);return a.s=-a.s||null,a},i.plus=function(a,m){var f,g=this,_=g.s;if(a=new c(a,m),m=a.s,!_||!m)return new c(NaN);if(_!=m)return a.s=-m,g.minus(a);var h=g.e/pe,C=a.e/pe,p=g.c,A=a.c;if(!h||!C){if(!p||!A)return new c(_/0);if(!p[0]||!A[0])return A[0]?a:new c(p[0]?g:_*0)}if(h=Ve(h),C=Ve(C),p=p.slice(),_=h-C){for(_>0?(C=h,f=A):(_=-_,f=p),f.reverse();_--;f.push(0));f.reverse()}for(_=p.length,m=A.length,_-m<0&&(f=A,A=p,p=f,m=_),_=0;m;)_=(p[--m]=p[m]+A[m]+_)/Qe|0,p[m]=Qe===p[m]?0:p[m]%Qe;return _&&(p=[_].concat(p),++C),$(a,p,C)},i.precision=i.sd=function(a,m){var f,g,_,h=this;if(a!=null&&a!==!!a)return Ie(a,1,Ce),m==null?m=l:Ie(m,0,8),J(new c(h),a,m);if(!(f=h.c))return null;if(_=f.length-1,g=_*pe+1,_=f[_]){for(;_%10==0;_/=10,g--);for(_=f[0];_>=10;_/=10,g++);}return a&&h.e+1>g&&(g=h.e+1),g},i.shiftedBy=function(a){return Ie(a,-on,on),this.times("1e"+a)},i.squareRoot=i.sqrt=function(){var a,m,f,g,_,h=this,C=h.c,p=h.s,A=h.e,P=o+4,E=new c("0.5");if(p!==1||!C||!C[0])return new c(!p||p<0&&(!C||C[0])?NaN:C?h:1/0);if(p=Math.sqrt(+X(h)),p==0||p==1/0?(m=He(C),(m.length+A)%2==0&&(m+="0"),p=Math.sqrt(+m),A=Ve((A+1)/2)-(A<0||A%2),p==1/0?m="5e"+A:(m=p.toExponential(),m=m.slice(0,m.indexOf("e")+1)+A),f=new c(m)):f=new c(p+""),f.c[0]){for(A=f.e,p=A+P,p<3&&(p=0);;)if(_=f,f=E.times(_.plus(e(h,_,P,1))),He(_.c).slice(0,p)===(m=He(f.c)).slice(0,p))if(f.e<A&&--p,m=m.slice(p-3,p+1),m=="9999"||!g&&m=="4999"){if(!g&&(J(_,_.e+o+2,0),_.times(_).eq(h))){f=_;break}P+=4,p+=4,g=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(J(f,f.e+o+2,1),a=!f.times(f).eq(h));break}}return J(f,f.e+o+1,l,a)},i.toExponential=function(a,m){return a!=null&&(Ie(a,0,Ce),a++),v(this,a,m,1)},i.toFixed=function(a,m){return a!=null&&(Ie(a,0,Ce),a=a+this.e+1),v(this,a,m)},i.toFormat=function(a,m,f){var g,_=this;if(f==null)a!=null&&m&&typeof m=="object"?(f=m,m=null):a&&typeof a=="object"?(f=a,a=m=null):f=y;else if(typeof f!="object")throw Error(je+"Argument not an object: "+f);if(g=_.toFixed(a,m),_.c){var h,C=g.split("."),p=+f.groupSize,A=+f.secondaryGroupSize,P=f.groupSeparator||"",E=C[0],M=C[1],S=_.s<0,j=S?E.slice(1):E,K=j.length;if(A&&(h=p,p=A,A=h,K-=h),p>0&&K>0){for(h=K%p||p,E=j.substr(0,h);h<K;h+=p)E+=P+j.substr(h,p);A>0&&(E+=P+j.slice(h)),S&&(E="-"+E)}g=M?E+(f.decimalSeparator||"")+((A=+f.fractionGroupSize)?M.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):M):E}return(f.prefix||"")+g+(f.suffix||"")},i.toFraction=function(a){var m,f,g,_,h,C,p,A,P,E,M,S,j=this,K=j.c;if(a!=null&&(p=new c(a),!p.isInteger()&&(p.c||p.s!==1)||p.lt(s)))throw Error(je+"Argument "+(p.isInteger()?"out of range: ":"not an integer: ")+X(p));if(!K)return new c(j);for(m=new c(s),P=f=new c(s),g=A=new c(s),S=He(K),h=m.e=S.length-j.e-1,m.c[0]=sn[(C=h%pe)<0?pe+C:C],a=!a||p.comparedTo(m)>0?h>0?m:P:p,C=O,O=1/0,p=new c(S),A.c[0]=0;E=e(p,m,0,1),_=f.plus(E.times(g)),_.comparedTo(a)!=1;)f=g,g=_,P=A.plus(E.times(_=P)),A=_,m=p.minus(E.times(_=m)),p=_;return _=e(a.minus(f),g,0,1),A=A.plus(_.times(P)),f=f.plus(_.times(g)),A.s=P.s=j.s,h=h*2,M=e(P,g,h,l).minus(j).abs().comparedTo(e(A,f,h,l).minus(j).abs())<1?[P,g]:[A,f],O=C,M},i.toNumber=function(){return+X(this)},i.toPrecision=function(a,m){return a!=null&&Ie(a,1,Ce),v(this,a,m,2)},i.toString=function(a){var m,f=this,g=f.s,_=f.e;return _===null?g?(m="Infinity",g<0&&(m="-"+m)):m="NaN":(a==null?m=_<=d||_>=w?Er(He(f.c),_):at(He(f.c),_,"0"):a===10&&u?(f=J(new c(f),o+_+1,l),m=at(He(f.c),f.e,"0")):(Ie(a,2,b.length,"Base"),m=t(at(He(f.c),_,"0"),10,a,g,!0)),g<0&&f.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return X(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,r!=null&&c.set(r),c}function Ve(r){var e=r|0;return r>0||r===e?e:e-1}function He(r){for(var e,t,n=1,i=r.length,s=r[0]+"";n<i;){for(e=r[n++]+"",t=pe-e.length;t--;e="0"+e);s+=e}for(i=s.length;s.charCodeAt(--i)===48;);return s.slice(0,i+1||1)}function At(r,e){var t,n,i=r.c,s=e.c,o=r.s,l=e.s,d=r.e,w=e.e;if(!o||!l)return null;if(t=i&&!i[0],n=s&&!s[0],t||n)return t?n?0:-l:o;if(o!=l)return o;if(t=o<0,n=d==w,!i||!s)return n?0:!i^t?1:-1;if(!n)return d>w^t?1:-1;for(l=(d=i.length)<(w=s.length)?d:w,o=0;o<l;o++)if(i[o]!=s[o])return i[o]>s[o]^t?1:-1;return d==w?0:d>w^t?1:-1}function Ie(r,e,t,n){if(r<e||r>t||r!==Ge(r))throw Error(je+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function mr(r){var e=r.c.length-1;return Ve(r.e/pe)==e&&r.c[e]%2!=0}function Er(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function at(r,e,t){var n,i;if(e<0){for(i=t+".";++e;i+=t);r=i+r}else if(n=r.length,++e>n){for(i=t,e-=n;--e;i+=t);r+=i}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}$o();var an={},Rt={},ln,Ai;function Ho(){if(Ai)return ln;Ai=1,ln=s,s.default=s,s.stable=w,s.stableStringify=w;var r="[...]",e="[Circular]",t=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(I,k,B,y){typeof y>"u"&&(y=i()),l(I,"",0,[],void 0,0,y);var b;try{n.length===0?b=JSON.stringify(I,k,B):b=JSON.stringify(I,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var u=t.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return b}function o(I,k,B,y){var b=Object.getOwnPropertyDescriptor(y,B);b.get!==void 0?b.configurable?(Object.defineProperty(y,B,{value:I}),t.push([y,B,k,b])):n.push([k,B,I]):(y[B]=I,t.push([y,B,k]))}function l(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)l(I[v],v,v,y,I,u,c);else{var G=Object.keys(I);for(v=0;v<G.length;v++){var $=G[v];l(I[$],$,v,y,I,u,c)}}y.pop()}}function d(I,k){return I<k?-1:I>k?1:0}function w(I,k,B,y){typeof y>"u"&&(y=i());var b=N(I,"",0,[],void 0,0,y)||I,u;try{n.length===0?u=JSON.stringify(b,k,B):u=JSON.stringify(b,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var c=t.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return u}function N(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}try{if(typeof I.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)N(I[v],v,v,y,I,u,c);else{var G={},$=Object.keys(I).sort(d);for(v=0;v<$.length;v++){var J=$[v];N(I[J],J,v,y,I,u,c),G[J]=I[J]}if(typeof b<"u")t.push([b,k,I]),b[k]=G;else return G}y.pop()}}function O(I){return I=typeof I<"u"?I:function(k,B){return B},function(k,B){if(n.length>0)for(var y=0;y<n.length;y++){var b=n[y];if(b[1]===k&&b[0]===B){B=b[2],n.splice(y,1);break}}return I.call(this,k,B)}}return ln}var Ri;function ei(){if(Ri)return Rt;Ri=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.EthereumProviderError=Rt.EthereumRpcError=void 0;const r=Ho();class e extends Error{constructor(o,l,d){if(!Number.isInteger(o))throw new Error('"code" must be an integer.');if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string.');super(l),this.code=o,d!==void 0&&(this.data=d)}serialize(){const o={code:this.code,message:this.message};return this.data!==void 0&&(o.data=this.data),this.stack&&(o.stack=this.stack),o}toString(){return r.default(this.serialize(),i,2)}}Rt.EthereumRpcError=e;class t extends e{constructor(o,l,d){if(!n(o))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(o,l,d)}}Rt.EthereumProviderError=t;function n(s){return Number.isInteger(s)&&s>=1e3&&s<=4999}function i(s,o){if(o!=="[Circular]")return o}return Rt}var un={},It={},Ii;function ti(){return Ii||(Ii=1,Object.defineProperty(It,"__esModule",{value:!0}),It.errorValues=It.errorCodes=void 0,It.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},It.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}),It}var Ti;function zo(){return Ti||(Ti=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ti(),t=ei(),n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(I,k=i){if(Number.isInteger(I)){const B=I.toString();if(O(e.errorValues,B))return e.errorValues[B].message;if(w(I))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return k}r.getMessageFromCode=o;function l(I){if(!Number.isInteger(I))return!1;const k=I.toString();return!!(e.errorValues[k]||w(I))}r.isValidCode=l;function d(I,{fallbackError:k=s,shouldIncludeStack:B=!1}={}){var y,b;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(I instanceof t.EthereumRpcError)return I.serialize();const u={};if(I&&typeof I=="object"&&!Array.isArray(I)&&O(I,"code")&&l(I.code)){const v=I;u.code=v.code,v.message&&typeof v.message=="string"?(u.message=v.message,O(v,"data")&&(u.data=v.data)):(u.message=o(u.code),u.data={originalError:N(I)})}else{u.code=k.code;const v=(y=I)===null||y===void 0?void 0:y.message;u.message=v&&typeof v=="string"?v:k.message,u.data={originalError:N(I)}}const c=(b=I)===null||b===void 0?void 0:b.stack;return B&&I&&c&&typeof c=="string"&&(u.stack=c),u}r.serializeError=d;function w(I){return I>=-32099&&I<=-32e3}function N(I){return I&&typeof I=="object"&&!Array.isArray(I)?Object.assign({},I):I}function O(I,k){return Object.prototype.hasOwnProperty.call(I,k)}})(un)),un}var Vt={},xi;function ra(){if(xi)return Vt;xi=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.ethErrors=void 0;const r=ei(),e=zo(),t=ti();Vt.ethErrors={rpc:{parse:o=>n(t.errorCodes.rpc.parse,o),invalidRequest:o=>n(t.errorCodes.rpc.invalidRequest,o),invalidParams:o=>n(t.errorCodes.rpc.invalidParams,o),methodNotFound:o=>n(t.errorCodes.rpc.methodNotFound,o),internal:o=>n(t.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:l}=o;if(!Number.isInteger(l)||l>-32005||l<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(l,o)},invalidInput:o=>n(t.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>n(t.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>n(t.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>n(t.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>n(t.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>n(t.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>i(t.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>i(t.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>i(t.errorCodes.provider.unsupportedMethod,o),disconnected:o=>i(t.errorCodes.provider.disconnected,o),chainDisconnected:o=>i(t.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:l,message:d,data:w}=o;if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(l,d,w)}}};function n(o,l){const[d,w]=s(l);return new r.EthereumRpcError(o,d||e.getMessageFromCode(o),w)}function i(o,l){const[d,w]=s(l);return new r.EthereumProviderError(o,d||e.getMessageFromCode(o),w)}function s(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:l,data:d}=o;if(l&&typeof l!="string")throw new Error("Must specify string message.");return[l||void 0,d]}}return[]}return Vt}var Oi;function na(){return Oi||(Oi=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const e=ei();Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const t=zo();Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const n=ra();Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ti();Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(an)),an}function Xt(r){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(r)}function ia(r,e){if(Xt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Xt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function oa(r){var e=ia(r,"string");return Xt(e)=="symbol"?e:e+""}function ge(r,e,t){return(e=oa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ni(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ye(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ni(Object(t),!0).forEach(function(n){ge(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ni(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var fn={exports:{}},cn={exports:{}},dn,Ci;function Te(){if(Ci)return dn;Ci=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let i=0;i<t.length;i++)n+=` ${t[i].stack}
|
|
2
2
|
`;super(n),this.name="AggregateError",this.errors=t}}return dn={AggregateError:r,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},dn}var hn={exports:{}},gn,Pi;function Go(){return Pi||(Pi=1,gn={format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,n]){const i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}),gn}var pn,Li;function qe(){if(Li)return pn;Li=1;const{format:r,inspect:e}=Go(),{AggregateError:t}=Te(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",d={};function w(b,u){if(!b)throw new d.ERR_INTERNAL_ASSERTION(u)}function N(b){let u="",c=b.length;const v=b[0]==="-"?1:0;for(;c>=v+4;c-=3)u=`_${b.slice(c-3,c)}${u}`;return`${b.slice(0,c)}${u}`}function O(b,u,c){if(typeof u=="function")return w(u.length<=c.length,`Code: ${b}; The provided arguments length (${c.length}) does not match the required ones (${u.length}).`),u(...c);const v=(u.match(/%[dfijoOs]/g)||[]).length;return w(v===c.length,`Code: ${b}; The provided arguments length (${c.length}) does not match the required ones (${v}).`),c.length===0?u:r(u,...c)}function I(b,u,c){c||(c=Error);class v extends c{constructor(...$){super(O(b,u,$))}toString(){return`${this.name} [${b}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:c.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${b}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=b,v.prototype[i]=!0,d[b]=v}function k(b){const u=l+b.name;return Object.defineProperty(b,"name",{value:u}),b}function B(b,u){if(b&&u&&b!==u){if(Array.isArray(u.errors))return u.errors.push(b),u;const c=new n([u,b],u.message);return c.code=u.code,c}return b||u}class y extends Error{constructor(u="The operation was aborted",c=void 0){if(c!==void 0&&typeof c!="object")throw new d.ERR_INVALID_ARG_TYPE("options","Object",c);super(u,c),this.code="ABORT_ERR",this.name="AbortError"}}return I("ERR_ASSERTION","%s",Error),I("ERR_INVALID_ARG_TYPE",(b,u,c)=>{w(typeof b=="string","'name' must be a string"),Array.isArray(u)||(u=[u]);let v="The ";b.endsWith(" argument")?v+=`${b} `:v+=`"${b}" ${b.includes(".")?"property":"argument"} `,v+="must be ";const G=[],$=[],J=[];for(const a of u)w(typeof a=="string","All expected entries have to be of type string"),s.includes(a)?G.push(a.toLowerCase()):o.test(a)?$.push(a):(w(a!=="object",'The value "object" should be written as "Object"'),J.push(a));if($.length>0){const a=G.indexOf("object");a!==-1&&(G.splice(G,a,1),$.push("Object"))}if(G.length>0){switch(G.length){case 1:v+=`of type ${G[0]}`;break;case 2:v+=`one of type ${G[0]} or ${G[1]}`;break;default:{const a=G.pop();v+=`one of type ${G.join(", ")}, or ${a}`}}($.length>0||J.length>0)&&(v+=" or ")}if($.length>0){switch($.length){case 1:v+=`an instance of ${$[0]}`;break;case 2:v+=`an instance of ${$[0]} or ${$[1]}`;break;default:{const a=$.pop();v+=`an instance of ${$.join(", ")}, or ${a}`}}J.length>0&&(v+=" or ")}switch(J.length){case 0:break;case 1:J[0].toLowerCase()!==J[0]&&(v+="an "),v+=`${J[0]}`;break;case 2:v+=`one of ${J[0]} or ${J[1]}`;break;default:{const a=J.pop();v+=`one of ${J.join(", ")}, or ${a}`}}if(c==null)v+=`. Received ${c}`;else if(typeof c=="function"&&c.name)v+=`. Received function ${c.name}`;else if(typeof c=="object"){var X;if((X=c.constructor)!==null&&X!==void 0&&X.name)v+=`. Received an instance of ${c.constructor.name}`;else{const a=e(c,{depth:-1});v+=`. Received ${a}`}}else{let a=e(c,{colors:!1});a.length>25&&(a=`${a.slice(0,25)}...`),v+=`. Received type ${typeof c} (${a})`}return v},TypeError),I("ERR_INVALID_ARG_VALUE",(b,u,c="is invalid")=>{let v=e(u);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${b.includes(".")?"property":"argument"} '${b}' ${c}. Received ${v}`},TypeError),I("ERR_INVALID_RETURN_VALUE",(b,u,c)=>{var v;const G=c!=null&&(v=c.constructor)!==null&&v!==void 0&&v.name?`instance of ${c.constructor.name}`:`type ${typeof c}`;return`Expected ${b} to be returned from the "${u}" function but got ${G}.`},TypeError),I("ERR_MISSING_ARGS",(...b)=>{w(b.length>0,"At least one arg needs to be specified");let u;const c=b.length;switch(b=(Array.isArray(b)?b:[b]).map(v=>`"${v}"`).join(" or "),c){case 1:u+=`The ${b[0]} argument`;break;case 2:u+=`The ${b[0]} and ${b[1]} arguments`;break;default:{const v=b.pop();u+=`The ${b.join(", ")}, and ${v} arguments`}break}return`${u} must be specified`},TypeError),I("ERR_OUT_OF_RANGE",(b,u,c)=>{w(u,'Missing "range" argument');let v;if(Number.isInteger(c)&&Math.abs(c)>2**32)v=N(String(c));else if(typeof c=="bigint"){v=String(c);const G=BigInt(2)**BigInt(32);(c>G||c<-G)&&(v=N(v)),v+="n"}else v=e(c);return`The value of "${b}" is out of range. It must be ${u}. Received ${v}`},RangeError),I("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),I("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),I("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),I("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),I("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),I("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),I("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),I("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),I("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),I("ERR_STREAM_WRITE_AFTER_END","write after end",Error),I("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),pn={AbortError:y,aggregateTwoErrors:k(B),hideStackFrames:k,codes:d},pn}var Kt={exports:{}},Bi;function Qt(){if(Bi)return Kt.exports;Bi=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Kt.exports=r,Kt.exports.AbortSignal=e,Kt.exports.default=r,Kt.exports}var Mi;function Fe(){return Mi||(Mi=1,(function(r){const e=be.requireDist(),{format:t,inspect:n}=Go(),{codes:{ERR_INVALID_ARG_TYPE:i}}=qe(),{kResistStopPropagation:s,AggregateError:o,SymbolDispose:l}=Te(),d=globalThis.AbortSignal||Qt().AbortSignal,w=globalThis.AbortController||Qt().AbortController,N=Object.getPrototypeOf(async function(){}).constructor,O=globalThis.Blob||e.Blob,I=typeof O<"u"?function(b){return b instanceof O}:function(b){return!1},k=(y,b)=>{if(y!==void 0&&(y===null||typeof y!="object"||!("aborted"in y)))throw new i(b,"AbortSignal",y)},B=(y,b)=>{if(typeof y!="function")throw new i(b,"Function",y)};r.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(y){let b=!1;return function(...u){b||(b=!0,y.apply(this,u))}},createDeferredPromise:function(){let y,b;return{promise:new Promise((c,v)=>{y=c,b=v}),resolve:y,reject:b}},promisify(y){return new Promise((b,u)=>{y((c,...v)=>c?u(c):b(...v))})},debuglog(){return function(){}},format:t,inspect:n,types:{isAsyncFunction(y){return y instanceof N},isArrayBufferView(y){return ArrayBuffer.isView(y)}},isBlob:I,deprecate(y,b){return y},addAbortListener:tr.requireEvents().addAbortListener||function(b,u){if(b===void 0)throw new i("signal","AbortSignal",b);k(b,"signal"),B(u,"listener");let c;return b.aborted?queueMicrotask(()=>u()):(b.addEventListener("abort",u,{__proto__:null,once:!0,[s]:!0}),c=()=>{b.removeEventListener("abort",u)}),{__proto__:null,[l](){var v;(v=c)===null||v===void 0||v()}}},AbortSignalAny:d.any||function(b){if(b.length===1)return b[0];const u=new w,c=()=>u.abort();return b.forEach(v=>{k(v,"signals"),v.addEventListener("abort",c,{once:!0})}),u.signal.addEventListener("abort",()=>{b.forEach(v=>v.removeEventListener("abort",c))},{once:!0}),u.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(hn)),hn.exports}var Sr={},wn,Di;function rr(){if(Di)return wn;Di=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:l,NumberParseInt:d,ObjectPrototypeHasOwnProperty:w,RegExpPrototypeExec:N,String:O,StringPrototypeToUpperCase:I,StringPrototypeTrim:k}=Te(),{hideStackFrames:B,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:b,ERR_INVALID_ARG_VALUE:u,ERR_OUT_OF_RANGE:c,ERR_UNKNOWN_SIGNAL:v}}=qe(),{normalizeEncoding:G}=Fe(),{isAsyncFunction:$,isArrayBufferView:J}=Fe().types,X={};function a(q){return q===(q|0)}function m(q){return q===q>>>0}const f=/^[0-7]+$/,g="must be a 32-bit unsigned integer or an octal string";function _(q,Z,re){if(typeof q>"u"&&(q=re),typeof q=="string"){if(N(f,q)===null)throw new u(Z,q,g);q=d(q,8)}return p(q,Z),q}const h=B((q,Z,re=l,Y=o)=>{if(typeof q!="number")throw new b(Z,"number",q);if(!i(q))throw new c(Z,"an integer",q);if(q<re||q>Y)throw new c(Z,`>= ${re} && <= ${Y}`,q)}),C=B((q,Z,re=-2147483648,Y=2147483647)=>{if(typeof q!="number")throw new b(Z,"number",q);if(!i(q))throw new c(Z,"an integer",q);if(q<re||q>Y)throw new c(Z,`>= ${re} && <= ${Y}`,q)}),p=B((q,Z,re=!1)=>{if(typeof q!="number")throw new b(Z,"number",q);if(!i(q))throw new c(Z,"an integer",q);const Y=re?1:0,we=4294967295;if(q<Y||q>we)throw new c(Z,`>= ${Y} && <= ${we}`,q)});function A(q,Z){if(typeof q!="string")throw new b(Z,"string",q)}function P(q,Z,re=void 0,Y){if(typeof q!="number")throw new b(Z,"number",q);if(re!=null&&q<re||Y!=null&&q>Y||(re!=null||Y!=null)&&s(q))throw new c(Z,`${re!=null?`>= ${re}`:""}${re!=null&&Y!=null?" && ":""}${Y!=null?`<= ${Y}`:""}`,q)}const E=B((q,Z,re)=>{if(!e(re,q)){const we="must be one of: "+t(n(re,Le=>typeof Le=="string"?`'${Le}'`:O(Le)),", ");throw new u(Z,q,we)}});function M(q,Z){if(typeof q!="boolean")throw new b(Z,"boolean",q)}function S(q,Z,re){return q==null||!w(q,Z)?re:q[Z]}const j=B((q,Z,re=null)=>{const Y=S(re,"allowArray",!1),we=S(re,"allowFunction",!1);if(!S(re,"nullable",!1)&&q===null||!Y&&r(q)||typeof q!="object"&&(!we||typeof q!="function"))throw new b(Z,"Object",q)}),K=B((q,Z)=>{if(q!=null&&typeof q!="object"&&typeof q!="function")throw new b(Z,"a dictionary",q)}),W=B((q,Z,re=0)=>{if(!r(q))throw new b(Z,"Array",q);if(q.length<re){const Y=`must be longer than ${re}`;throw new u(Z,q,Y)}});function ee(q,Z){W(q,Z);for(let re=0;re<q.length;re++)A(q[re],`${Z}[${re}]`)}function Q(q,Z){W(q,Z);for(let re=0;re<q.length;re++)M(q[re],`${Z}[${re}]`)}function le(q,Z){W(q,Z);for(let re=0;re<q.length;re++){const Y=q[re],we=`${Z}[${re}]`;if(Y==null)throw new b(we,"AbortSignal",Y);ce(Y,we)}}function ue(q,Z="signal"){if(A(q,Z),X[q]===void 0)throw X[I(q)]!==void 0?new v(q+" (signals must use all capital letters)"):new v(q)}const z=B((q,Z="buffer")=>{if(!J(q))throw new b(Z,["Buffer","TypedArray","DataView"],q)});function V(q,Z){const re=G(Z),Y=q.length;if(re==="hex"&&Y%2!==0)throw new u("encoding",Z,`is invalid for data of length ${Y}`)}function oe(q,Z="Port",re=!0){if(typeof q!="number"&&typeof q!="string"||typeof q=="string"&&k(q).length===0||+q!==+q>>>0||q>65535||q===0&&!re)throw new y(Z,q,re);return q|0}const ce=B((q,Z)=>{if(q!==void 0&&(q===null||typeof q!="object"||!("aborted"in q)))throw new b(Z,"AbortSignal",q)}),fe=B((q,Z)=>{if(typeof q!="function")throw new b(Z,"Function",q)}),L=B((q,Z)=>{if(typeof q!="function"||$(q))throw new b(Z,"Function",q)}),D=B((q,Z)=>{if(q!==void 0)throw new b(Z,"undefined",q)});function F(q,Z,re){if(!e(re,q))throw new b(Z,`('${t(re,"|")}')`,q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function se(q,Z){if(typeof q>"u"||!N(ne,q))throw new u(Z,q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ie(q){if(typeof q=="string")return se(q,"hints"),q;if(r(q)){const Z=q.length;let re="";if(Z===0)return re;for(let Y=0;Y<Z;Y++){const we=q[Y];se(we,"hints"),re+=we,Y!==Z-1&&(re+=", ")}return re}throw new u("hints",q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return wn={isInt32:a,isUint32:m,parseFileMode:_,validateArray:W,validateStringArray:ee,validateBooleanArray:Q,validateAbortSignalArray:le,validateBoolean:M,validateBuffer:z,validateDictionary:K,validateEncoding:V,validateFunction:fe,validateInt32:C,validateInteger:h,validateNumber:P,validateObject:j,validateOneOf:E,validatePlainFunction:L,validatePort:oe,validateSignalName:ue,validateString:A,validateUint32:p,validateUndefined:D,validateUnion:F,validateAbortSignal:ce,validateLinkHeaderValue:ie},wn}var vr={exports:{}},bn={exports:{}},qi;function Pt(){if(qi)return bn.exports;qi=1;var r=bn.exports={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function s(y){if(e===setTimeout)return setTimeout(y,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(y,0);try{return e(y,0)}catch{try{return e.call(null,y,0)}catch{return e.call(this,y,0)}}}function o(y){if(t===clearTimeout)return clearTimeout(y);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(y);try{return t(y)}catch{try{return t.call(null,y)}catch{return t.call(this,y)}}}var l=[],d=!1,w,N=-1;function O(){!d||!w||(d=!1,w.length?l=w.concat(l):N=-1,l.length&&I())}function I(){if(!d){var y=s(O);d=!0;for(var b=l.length;b;){for(w=l,l=[];++N<b;)w&&w[N].run();N=-1,b=l.length}w=null,d=!1,o(y)}}r.nextTick=function(y){var b=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)b[u-1]=arguments[u];l.push(new k(y,b)),l.length===1&&!d&&s(I)};function k(y,b){this.fun=y,this.array=b}k.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function B(){}return r.on=B,r.addListener=B,r.once=B,r.off=B,r.removeListener=B,r.removeAllListeners=B,r.emit=B,r.prependListener=B,r.prependOnceListener=B,r.listeners=function(y){return[]},r.binding=function(y){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(y){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},bn.exports}var yn,ki;function ht(){if(ki)return yn;ki=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Te(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),s=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),l=t("nodejs.stream.disturbed"),d=t("nodejs.webstream.isClosedPromise"),w=t("nodejs.webstream.controllerErrorFunction");function N(S,j=!1){var K;return!!(S&&typeof S.pipe=="function"&&typeof S.on=="function"&&(!j||typeof S.pause=="function"&&typeof S.resume=="function")&&(!S._writableState||((K=S._readableState)===null||K===void 0?void 0:K.readable)!==!1)&&(!S._writableState||S._readableState))}function O(S){var j;return!!(S&&typeof S.write=="function"&&typeof S.on=="function"&&(!S._readableState||((j=S._writableState)===null||j===void 0?void 0:j.writable)!==!1))}function I(S){return!!(S&&typeof S.pipe=="function"&&S._readableState&&typeof S.on=="function"&&typeof S.write=="function")}function k(S){return S&&(S._readableState||S._writableState||typeof S.write=="function"&&typeof S.on=="function"||typeof S.pipe=="function"&&typeof S.on=="function")}function B(S){return!!(S&&!k(S)&&typeof S.pipeThrough=="function"&&typeof S.getReader=="function"&&typeof S.cancel=="function")}function y(S){return!!(S&&!k(S)&&typeof S.getWriter=="function"&&typeof S.abort=="function")}function b(S){return!!(S&&!k(S)&&typeof S.readable=="object"&&typeof S.writable=="object")}function u(S){return B(S)||y(S)||b(S)}function c(S,j){return S==null?!1:j===!0?typeof S[r]=="function":j===!1?typeof S[e]=="function":typeof S[r]=="function"||typeof S[e]=="function"}function v(S){if(!k(S))return null;const j=S._writableState,K=S._readableState,W=j||K;return!!(S.destroyed||S[n]||W!=null&&W.destroyed)}function G(S){if(!O(S))return null;if(S.writableEnded===!0)return!0;const j=S._writableState;return j!=null&&j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function $(S,j){if(!O(S))return null;if(S.writableFinished===!0)return!0;const K=S._writableState;return K!=null&&K.errored?!1:typeof K?.finished!="boolean"?null:!!(K.finished||j===!1&&K.ended===!0&&K.length===0)}function J(S){if(!N(S))return null;if(S.readableEnded===!0)return!0;const j=S._readableState;return!j||j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function X(S,j){if(!N(S))return null;const K=S._readableState;return K!=null&&K.errored?!1:typeof K?.endEmitted!="boolean"?null:!!(K.endEmitted||j===!1&&K.ended===!0&&K.length===0)}function a(S){return S&&S[s]!=null?S[s]:typeof S?.readable!="boolean"?null:v(S)?!1:N(S)&&S.readable&&!X(S)}function m(S){return S&&S[o]!=null?S[o]:typeof S?.writable!="boolean"?null:v(S)?!1:O(S)&&S.writable&&!G(S)}function f(S,j){return k(S)?v(S)?!0:!(j?.readable!==!1&&a(S)||j?.writable!==!1&&m(S)):null}function g(S){var j,K;return k(S)?S.writableErrored?S.writableErrored:(j=(K=S._writableState)===null||K===void 0?void 0:K.errored)!==null&&j!==void 0?j:null:null}function _(S){var j,K;return k(S)?S.readableErrored?S.readableErrored:(j=(K=S._readableState)===null||K===void 0?void 0:K.errored)!==null&&j!==void 0?j:null:null}function h(S){if(!k(S))return null;if(typeof S.closed=="boolean")return S.closed;const j=S._writableState,K=S._readableState;return typeof j?.closed=="boolean"||typeof K?.closed=="boolean"?j?.closed||K?.closed:typeof S._closed=="boolean"&&C(S)?S._closed:null}function C(S){return typeof S._closed=="boolean"&&typeof S._defaultKeepAlive=="boolean"&&typeof S._removedConnection=="boolean"&&typeof S._removedContLen=="boolean"}function p(S){return typeof S._sent100=="boolean"&&C(S)}function A(S){var j;return typeof S._consuming=="boolean"&&typeof S._dumped=="boolean"&&((j=S.req)===null||j===void 0?void 0:j.upgradeOrConnect)===void 0}function P(S){if(!k(S))return null;const j=S._writableState,K=S._readableState,W=j||K;return!W&&p(S)||!!(W&&W.autoDestroy&&W.emitClose&&W.closed===!1)}function E(S){var j;return!!(S&&((j=S[l])!==null&&j!==void 0?j:S.readableDidRead||S.readableAborted))}function M(S){var j,K,W,ee,Q,le,ue,z,V,oe;return!!(S&&((j=(K=(W=(ee=(Q=(le=S[i])!==null&&le!==void 0?le:S.readableErrored)!==null&&Q!==void 0?Q:S.writableErrored)!==null&&ee!==void 0?ee:(ue=S._readableState)===null||ue===void 0?void 0:ue.errorEmitted)!==null&&W!==void 0?W:(z=S._writableState)===null||z===void 0?void 0:z.errorEmitted)!==null&&K!==void 0?K:(V=S._readableState)===null||V===void 0?void 0:V.errored)!==null&&j!==void 0?j:!((oe=S._writableState)===null||oe===void 0)&&oe.errored))}return yn={isDestroyed:v,kIsDestroyed:n,isDisturbed:E,kIsDisturbed:l,isErrored:M,kIsErrored:i,isReadable:a,kIsReadable:s,kIsClosedPromise:d,kControllerErrorFunction:w,kIsWritable:o,isClosed:h,isDuplexNodeStream:I,isFinished:f,isIterable:c,isReadableNodeStream:N,isReadableStream:B,isReadableEnded:J,isReadableFinished:X,isReadableErrored:_,isNodeStream:k,isWebStream:u,isWritable:m,isWritableNodeStream:O,isWritableStream:y,isWritableEnded:G,isWritableFinished:$,isWritableErrored:g,isServerRequest:A,isServerResponse:p,willEmitClose:P,isTransformStream:b},yn}var Ui;function mt(){if(Ui)return vr.exports;Ui=1;const r=Pt(),{AbortError:e,codes:t}=qe(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:s,once:o}=Fe(),{validateAbortSignal:l,validateFunction:d,validateObject:w,validateBoolean:N}=rr(),{Promise:O,PromisePrototypeThen:I,SymbolDispose:k}=Te(),{isClosed:B,isReadable:y,isReadableNodeStream:b,isReadableStream:u,isReadableFinished:c,isReadableErrored:v,isWritable:G,isWritableNodeStream:$,isWritableStream:J,isWritableFinished:X,isWritableErrored:a,isNodeStream:m,willEmitClose:f,kIsClosedPromise:g}=ht();let _;function h(E){return E.setHeader&&typeof E.abort=="function"}const C=()=>{};function p(E,M,S){var j,K;if(arguments.length===2?(S=M,M=s):M==null?M=s:w(M,"options"),d(S,"callback"),l(M.signal,"options.signal"),S=o(S),u(E)||J(E))return A(E,M,S);if(!m(E))throw new n("stream",["ReadableStream","WritableStream","Stream"],E);const W=(j=M.readable)!==null&&j!==void 0?j:b(E),ee=(K=M.writable)!==null&&K!==void 0?K:$(E),Q=E._writableState,le=E._readableState,ue=()=>{E.writable||oe()};let z=f(E)&&b(E)===W&&$(E)===ee,V=X(E,!1);const oe=()=>{V=!0,E.destroyed&&(z=!1),!(z&&(!E.readable||W))&&(!W||ce)&&S.call(E)};let ce=c(E,!1);const fe=()=>{ce=!0,E.destroyed&&(z=!1),!(z&&(!E.writable||ee))&&(!ee||V)&&S.call(E)},L=q=>{S.call(E,q)};let D=B(E);const F=()=>{D=!0;const q=a(E)||v(E);if(q&&typeof q!="boolean")return S.call(E,q);if(W&&!ce&&b(E,!0)&&!c(E,!1))return S.call(E,new i);if(ee&&!V&&!X(E,!1))return S.call(E,new i);S.call(E)},ne=()=>{D=!0;const q=a(E)||v(E);if(q&&typeof q!="boolean")return S.call(E,q);S.call(E)},se=()=>{E.req.on("finish",oe)};h(E)?(E.on("complete",oe),z||E.on("abort",F),E.req?se():E.on("request",se)):ee&&!Q&&(E.on("end",ue),E.on("close",ue)),!z&&typeof E.aborted=="boolean"&&E.on("aborted",F),E.on("end",fe),E.on("finish",oe),M.error!==!1&&E.on("error",L),E.on("close",F),D?r.nextTick(F):Q!=null&&Q.errorEmitted||le!=null&&le.errorEmitted?z||r.nextTick(ne):(!W&&(!z||y(E))&&(V||G(E)===!1)||!ee&&(!z||G(E))&&(ce||y(E)===!1)||le&&E.req&&E.aborted)&&r.nextTick(ne);const ie=()=>{S=C,E.removeListener("aborted",F),E.removeListener("complete",oe),E.removeListener("abort",F),E.removeListener("request",se),E.req&&E.req.removeListener("finish",oe),E.removeListener("end",ue),E.removeListener("close",ue),E.removeListener("finish",oe),E.removeListener("end",fe),E.removeListener("error",L),E.removeListener("close",F)};if(M.signal&&!D){const q=()=>{const Z=S;ie(),Z.call(E,new e(void 0,{cause:M.signal.reason}))};if(M.signal.aborted)r.nextTick(q);else{_=_||Fe().addAbortListener;const Z=_(M.signal,q),re=S;S=o((...Y)=>{Z[k](),re.apply(E,Y)})}}return ie}function A(E,M,S){let j=!1,K=C;if(M.signal)if(K=()=>{j=!0,S.call(E,new e(void 0,{cause:M.signal.reason}))},M.signal.aborted)r.nextTick(K);else{_=_||Fe().addAbortListener;const ee=_(M.signal,K),Q=S;S=o((...le)=>{ee[k](),Q.apply(E,le)})}const W=(...ee)=>{j||r.nextTick(()=>S.apply(E,ee))};return I(E[g].promise,W,W),C}function P(E,M){var S;let j=!1;return M===null&&(M=s),(S=M)!==null&&S!==void 0&&S.cleanup&&(N(M.cleanup,"cleanup"),j=M.cleanup),new O((K,W)=>{const ee=p(E,M,Q=>{j&&ee(),Q?W(Q):K()})})}return vr.exports=p,vr.exports.finished=P,vr.exports}var _n,ji;function Ut(){if(ji)return _n;ji=1;const r=Pt(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=qe(),{Symbol:i}=Te(),{kIsDestroyed:s,isDestroyed:o,isFinished:l,isServerRequest:d}=ht(),w=i("kDestroy"),N=i("kConstruct");function O(f,g,_){f&&(f.stack,g&&!g.errored&&(g.errored=f),_&&!_.errored&&(_.errored=f))}function I(f,g){const _=this._readableState,h=this._writableState,C=h||_;return h!=null&&h.destroyed||_!=null&&_.destroyed?(typeof g=="function"&&g(),this):(O(f,h,_),h&&(h.destroyed=!0),_&&(_.destroyed=!0),C.constructed?k(this,f,g):this.once(w,function(p){k(this,e(p,f),g)}),this)}function k(f,g,_){let h=!1;function C(p){if(h)return;h=!0;const A=f._readableState,P=f._writableState;O(p,P,A),P&&(P.closed=!0),A&&(A.closed=!0),typeof _=="function"&&_(p),p?r.nextTick(B,f,p):r.nextTick(y,f)}try{f._destroy(g||null,C)}catch(p){C(p)}}function B(f,g){b(f,g),y(f)}function y(f){const g=f._readableState,_=f._writableState;_&&(_.closeEmitted=!0),g&&(g.closeEmitted=!0),(_!=null&&_.emitClose||g!=null&&g.emitClose)&&f.emit("close")}function b(f,g){const _=f._readableState,h=f._writableState;h!=null&&h.errorEmitted||_!=null&&_.errorEmitted||(h&&(h.errorEmitted=!0),_&&(_.errorEmitted=!0),f.emit("error",g))}function u(){const f=this._readableState,g=this._writableState;f&&(f.constructed=!0,f.closed=!1,f.closeEmitted=!1,f.destroyed=!1,f.errored=null,f.errorEmitted=!1,f.reading=!1,f.ended=f.readable===!1,f.endEmitted=f.readable===!1),g&&(g.constructed=!0,g.destroyed=!1,g.closed=!1,g.closeEmitted=!1,g.errored=null,g.errorEmitted=!1,g.finalCalled=!1,g.prefinished=!1,g.ended=g.writable===!1,g.ending=g.writable===!1,g.finished=g.writable===!1)}function c(f,g,_){const h=f._readableState,C=f._writableState;if(C!=null&&C.destroyed||h!=null&&h.destroyed)return this;h!=null&&h.autoDestroy||C!=null&&C.autoDestroy?f.destroy(g):g&&(g.stack,C&&!C.errored&&(C.errored=g),h&&!h.errored&&(h.errored=g),_?r.nextTick(b,f,g):b(f,g))}function v(f,g){if(typeof f._construct!="function")return;const _=f._readableState,h=f._writableState;_&&(_.constructed=!1),h&&(h.constructed=!1),f.once(N,g),!(f.listenerCount(N)>1)&&r.nextTick(G,f)}function G(f){let g=!1;function _(h){if(g){c(f,h??new t);return}g=!0;const C=f._readableState,p=f._writableState,A=p||C;C&&(C.constructed=!0),p&&(p.constructed=!0),A.destroyed?f.emit(w,h):h?c(f,h,!0):r.nextTick($,f)}try{f._construct(h=>{r.nextTick(_,h)})}catch(h){r.nextTick(_,h)}}function $(f){f.emit(N)}function J(f){return f?.setHeader&&typeof f.abort=="function"}function X(f){f.emit("close")}function a(f,g){f.emit("error",g),r.nextTick(X,f)}function m(f,g){!f||o(f)||(!g&&!l(f)&&(g=new n),d(f)?(f.socket=null,f.destroy(g)):J(f)?f.abort():J(f.req)?f.req.abort():typeof f.destroy=="function"?f.destroy(g):typeof f.close=="function"?f.close():g?r.nextTick(a,f,g):r.nextTick(X,f),f.destroyed||(f[s]=!0))}return _n={construct:v,destroyer:m,destroy:I,undestroy:u,errorOrDestroy:c},_n}var mn,Wi;function ri(){if(Wi)return mn;Wi=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Te(),{EventEmitter:t}=tr.requireEvents();function n(s){t.call(this,s)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(s,o){const l=this;function d(y){s.writable&&s.write(y)===!1&&l.pause&&l.pause()}l.on("data",d);function w(){l.readable&&l.resume&&l.resume()}s.on("drain",w),!s._isStdio&&(!o||o.end!==!1)&&(l.on("end",O),l.on("close",I));let N=!1;function O(){N||(N=!0,s.end())}function I(){N||(N=!0,typeof s.destroy=="function"&&s.destroy())}function k(y){B(),t.listenerCount(this,"error")===0&&this.emit("error",y)}i(l,"error",k),i(s,"error",k);function B(){l.removeListener("data",d),s.removeListener("drain",w),l.removeListener("end",O),l.removeListener("close",I),l.removeListener("error",k),s.removeListener("error",k),l.removeListener("end",B),l.removeListener("close",B),s.removeListener("close",B)}return l.on("end",B),l.on("close",B),s.on("close",B),s.emit("pipe",l),s};function i(s,o,l){if(typeof s.prependListener=="function")return s.prependListener(o,l);!s._events||!s._events[o]?s.on(o,l):r(s._events[o])?s._events[o].unshift(l):s._events[o]=[l,s._events[o]]}return mn={Stream:n,prependListener:i},mn}var En={exports:{}},Fi;function Br(){return Fi||(Fi=1,(function(r){const{SymbolDispose:e}=Te(),{AbortError:t,codes:n}=qe(),{isNodeStream:i,isWebStream:s,kControllerErrorFunction:o}=ht(),l=mt(),{ERR_INVALID_ARG_TYPE:d}=n;let w;const N=(O,I)=>{if(typeof O!="object"||!("aborted"in O))throw new d(I,"AbortSignal",O)};r.exports.addAbortSignal=function(I,k){if(N(I,"signal"),!i(k)&&!s(k))throw new d("stream",["ReadableStream","WritableStream","Stream"],k);return r.exports.addAbortSignalNoValidate(I,k)},r.exports.addAbortSignalNoValidate=function(O,I){if(typeof O!="object"||!("aborted"in O))return I;const k=i(I)?()=>{I.destroy(new t(void 0,{cause:O.reason}))}:()=>{I[o](new t(void 0,{cause:O.reason}))};if(O.aborted)k();else{w=w||Fe().addAbortListener;const B=w(O,k);l(I,B[e])}return I}})(En)),En.exports}var Sn,$i;function sa(){if($i)return Sn;$i=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Te(),{Buffer:i}=be.requireDist(),{inspect:s}=Fe();return Sn=class{constructor(){this.head=null,this.tail=null,this.length=0}push(l){const d={data:l,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length}unshift(l){const d={data:l,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}shift(){if(this.length===0)return;const l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}clear(){this.head=this.tail=null,this.length=0}join(l){if(this.length===0)return"";let d=this.head,w=""+d.data;for(;(d=d.next)!==null;)w+=l+d.data;return w}concat(l){if(this.length===0)return i.alloc(0);const d=i.allocUnsafe(l>>>0);let w=this.head,N=0;for(;w;)t(d,w.data,N),N+=w.data.length,w=w.next;return d}consume(l,d){const w=this.head.data;if(l<w.length){const N=w.slice(0,l);return this.head.data=w.slice(l),N}return l===w.length?this.shift():d?this._getString(l):this._getBuffer(l)}first(){return this.head.data}*[e](){for(let l=this.head;l;l=l.next)yield l.data}_getString(l){let d="",w=this.head,N=0;do{const O=w.data;if(l>O.length)d+=O,l-=O.length;else{l===O.length?(d+=O,++N,w.next?this.head=w.next:this.head=this.tail=null):(d+=r(O,0,l),this.head=w,w.data=r(O,l));break}++N}while((w=w.next)!==null);return this.length-=N,d}_getBuffer(l){const d=i.allocUnsafe(l),w=l;let N=this.head,O=0;do{const I=N.data;if(l>I.length)t(d,I,w-l),l-=I.length;else{l===I.length?(t(d,I,w-l),++O,N.next?this.head=N.next:this.head=this.tail=null):(t(d,new n(I.buffer,I.byteOffset,l),w-l),this.head=N,N.data=I.slice(l));break}++O}while((N=N.next)!==null);return this.length-=O,d}[Symbol.for("nodejs.util.inspect.custom")](l,d){return s(this,{...d,depth:0,customInspect:!1})}},Sn}var vn,Hi;function Mr(){if(Hi)return vn;Hi=1;const{MathFloor:r,NumberIsInteger:e}=Te(),{validateInteger:t}=rr(),{ERR_INVALID_ARG_VALUE:n}=qe().codes;let i=16*1024,s=16;function o(N,O,I){return N.highWaterMark!=null?N.highWaterMark:O?N[I]:null}function l(N){return N?s:i}function d(N,O){t(O,"value",0),N?s=O:i=O}function w(N,O,I,k){const B=o(O,k,I);if(B!=null){if(!e(B)||B<0){const y=k?`options.${I}`:"options.highWaterMark";throw new n(y,B)}return r(B)}return l(N.objectMode)}return vn={getHighWaterMark:w,getDefaultHighWaterMark:l,setDefaultHighWaterMark:d},vn}var An={},zi;function aa(){if(zi)return An;zi=1;var r=be.requireSafeBuffer().Buffer,e=r.isEncoding||function(u){switch(u=""+u,u&&u.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(u){if(!u)return"utf8";for(var c;;)switch(u){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return u;default:if(c)return;u=(""+u).toLowerCase(),c=!0}}function n(u){var c=t(u);if(typeof c!="string"&&(r.isEncoding===e||!e(u)))throw new Error("Unknown encoding: "+u);return c||u}An.StringDecoder=i;function i(u){this.encoding=n(u);var c;switch(this.encoding){case"utf16le":this.text=O,this.end=I,c=4;break;case"utf8":this.fillLast=d,c=4;break;case"base64":this.text=k,this.end=B,c=3;break;default:this.write=y,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(c)}i.prototype.write=function(u){if(u.length===0)return"";var c,v;if(this.lastNeed){if(c=this.fillLast(u),c===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<u.length?c?c+this.text(u,v):this.text(u,v):c||""},i.prototype.end=N,i.prototype.text=w,i.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length};function s(u){return u<=127?0:u>>5===6?2:u>>4===14?3:u>>3===30?4:u>>6===2?-1:-2}function o(u,c,v){var G=c.length-1;if(G<v)return 0;var $=s(c[G]);return $>=0?($>0&&(u.lastNeed=$-1),$):--G<v||$===-2?0:($=s(c[G]),$>=0?($>0&&(u.lastNeed=$-2),$):--G<v||$===-2?0:($=s(c[G]),$>=0?($>0&&($===2?$=0:u.lastNeed=$-3),$):0))}function l(u,c,v){if((c[0]&192)!==128)return u.lastNeed=0,"�";if(u.lastNeed>1&&c.length>1){if((c[1]&192)!==128)return u.lastNeed=1,"�";if(u.lastNeed>2&&c.length>2&&(c[2]&192)!==128)return u.lastNeed=2,"�"}}function d(u){var c=this.lastTotal-this.lastNeed,v=l(this,u);if(v!==void 0)return v;if(this.lastNeed<=u.length)return u.copy(this.lastChar,c,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,c,0,u.length),this.lastNeed-=u.length}function w(u,c){var v=o(this,u,c);if(!this.lastNeed)return u.toString("utf8",c);this.lastTotal=v;var G=u.length-(v-this.lastNeed);return u.copy(this.lastChar,0,G),u.toString("utf8",c,G)}function N(u){var c=u&&u.length?this.write(u):"";return this.lastNeed?c+"�":c}function O(u,c){if((u.length-c)%2===0){var v=u.toString("utf16le",c);if(v){var G=v.charCodeAt(v.length-1);if(G>=55296&&G<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",c,u.length-1)}function I(u){var c=u&&u.length?this.write(u):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return c+this.lastChar.toString("utf16le",0,v)}return c}function k(u,c){var v=(u.length-c)%3;return v===0?u.toString("base64",c):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",c,u.length-v))}function B(u){var c=u&&u.length?this.write(u):"";return this.lastNeed?c+this.lastChar.toString("base64",0,3-this.lastNeed):c}function y(u){return u.toString(this.encoding)}function b(u){return u&&u.length?this.write(u):""}return An}var Rn,Gi;function Vo(){if(Gi)return Rn;Gi=1;const r=Pt(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Te(),{Buffer:i}=be.requireDist(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=qe().codes;function l(d,w,N){let O;if(typeof w=="string"||w instanceof i)return new d({objectMode:!0,...N,read(){this.push(w),this.push(null)}});let I;if(w&&w[t])I=!0,O=w[t]();else if(w&&w[n])I=!1,O=w[n]();else throw new s("iterable",["Iterable"],w);const k=new d({objectMode:!0,highWaterMark:1,...N});let B=!1;k._read=function(){B||(B=!0,b())},k._destroy=function(u,c){e(y(u),()=>r.nextTick(c,u),v=>r.nextTick(c,v||u))};async function y(u){const c=u!=null,v=typeof O.throw=="function";if(c&&v){const{value:G,done:$}=await O.throw(u);if(await G,$)return}if(typeof O.return=="function"){const{value:G}=await O.return();await G}}async function b(){for(;;){try{const{value:u,done:c}=I?await O.next():O.next();if(c)k.push(null);else{const v=u&&typeof u.then=="function"?await u:u;if(v===null)throw B=!1,new o;if(k.push(v))continue;B=!1}}catch(u){k.destroy(u)}break}}return k}return Rn=l,Rn}var In,Vi;function Dr(){if(Vi)return In;Vi=1;const r=Pt(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:l,Promise:d,SafeSet:w,SymbolAsyncDispose:N,SymbolAsyncIterator:O,Symbol:I}=Te();In=Y,Y.ReadableState=re;const{EventEmitter:k}=tr.requireEvents(),{Stream:B,prependListener:y}=ri(),{Buffer:b}=be.requireDist(),{addAbortSignal:u}=Br(),c=mt();let v=Fe().debuglog("stream",R=>{v=R});const G=sa(),$=Ut(),{getHighWaterMark:J,getDefaultHighWaterMark:X}=Mr(),{aggregateTwoErrors:a,codes:{ERR_INVALID_ARG_TYPE:m,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_OUT_OF_RANGE:g,ERR_STREAM_PUSH_AFTER_EOF:_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:h},AbortError:C}=qe(),{validateObject:p}=rr(),A=I("kPaused"),{StringDecoder:P}=aa(),E=Vo();l(Y.prototype,B.prototype),l(Y,B);const M=()=>{},{errorOrDestroy:S}=$,j=1,K=2,W=4,ee=8,Q=16,le=32,ue=64,z=128,V=256,oe=512,ce=1024,fe=2048,L=4096,D=8192,F=16384,ne=32768,se=65536,ie=1<<17,q=1<<18;function Z(R){return{enumerable:!1,get(){return(this.state&R)!==0},set(x){x?this.state|=R:this.state&=~R}}}s(re.prototype,{objectMode:Z(j),ended:Z(K),endEmitted:Z(W),reading:Z(ee),constructed:Z(Q),sync:Z(le),needReadable:Z(ue),emittedReadable:Z(z),readableListening:Z(V),resumeScheduled:Z(oe),errorEmitted:Z(ce),emitClose:Z(fe),autoDestroy:Z(L),destroyed:Z(D),closed:Z(F),closeEmitted:Z(ne),multiAwaitDrain:Z(se),readingMore:Z(ie),dataEmitted:Z(q)});function re(R,x,te){typeof te!="boolean"&&(te=x instanceof dt()),this.state=fe|L|Q|le,R&&R.objectMode&&(this.state|=j),te&&R&&R.readableObjectMode&&(this.state|=j),this.highWaterMark=R?J(this,R,"readableHighWaterMark",te):X(!1),this.buffer=new G,this.length=0,this.pipes=[],this.flowing=null,this[A]=null,R&&R.emitClose===!1&&(this.state&=~fe),R&&R.autoDestroy===!1&&(this.state&=~L),this.errored=null,this.defaultEncoding=R&&R.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,R&&R.encoding&&(this.decoder=new P(R.encoding),this.encoding=R.encoding)}function Y(R){if(!(this instanceof Y))return new Y(R);const x=this instanceof dt();this._readableState=new re(R,this,x),R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.construct=="function"&&(this._construct=R.construct),R.signal&&!x&&u(R.signal,this)),B.call(this,R),$.construct(this,()=>{this._readableState.needReadable&&Me(this,this._readableState)})}Y.prototype.destroy=$.destroy,Y.prototype._undestroy=$.undestroy,Y.prototype._destroy=function(R,x){x(R)},Y.prototype[k.captureRejectionSymbol]=function(R){this.destroy(R)},Y.prototype[N]=function(){let R;return this.destroyed||(R=this.readableEnded?null:new C,this.destroy(R)),new d((x,te)=>c(this,ae=>ae&&ae!==R?te(ae):x(null)))},Y.prototype.push=function(R,x){return we(this,R,x,!1)},Y.prototype.unshift=function(R,x){return we(this,R,x,!0)};function we(R,x,te,ae){v("readableAddChunk",x);const de=R._readableState;let Ne;if((de.state&j)===0&&(typeof x=="string"?(te=te||de.defaultEncoding,de.encoding!==te&&(ae&&de.encoding?x=b.from(x,te).toString(de.encoding):(x=b.from(x,te),te=""))):x instanceof b?te="":B._isUint8Array(x)?(x=B._uint8ArrayToBuffer(x),te=""):x!=null&&(Ne=new m("chunk",["string","Buffer","Uint8Array"],x))),Ne)S(R,Ne);else if(x===null)de.state&=~ee,Be(R,de);else if((de.state&j)!==0||x&&x.length>0)if(ae)if((de.state&W)!==0)S(R,new h);else{if(de.destroyed||de.errored)return!1;Le(R,de,x,!0)}else if(de.ended)S(R,new _);else{if(de.destroyed||de.errored)return!1;de.state&=~ee,de.decoder&&!te?(x=de.decoder.write(x),de.objectMode||x.length!==0?Le(R,de,x,!1):Me(R,de)):Le(R,de,x,!1)}else ae||(de.state&=~ee,Me(R,de));return!de.ended&&(de.length<de.highWaterMark||de.length===0)}function Le(R,x,te,ae){x.flowing&&x.length===0&&!x.sync&&R.listenerCount("data")>0?((x.state&se)!==0?x.awaitDrainWriters.clear():x.awaitDrainWriters=null,x.dataEmitted=!0,R.emit("data",te)):(x.length+=x.objectMode?1:te.length,ae?x.buffer.unshift(te):x.buffer.push(te),(x.state&ue)!==0&&Je(R)),Me(R,x)}Y.prototype.isPaused=function(){const R=this._readableState;return R[A]===!0||R.flowing===!1},Y.prototype.setEncoding=function(R){const x=new P(R);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;const te=this._readableState.buffer;let ae="";for(const de of te)ae+=x.write(de);return te.clear(),ae!==""&&te.push(ae),this._readableState.length=ae.length,this};const _e=1073741824;function De(R){if(R>_e)throw new g("size","<= 1GiB",R);return R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++,R}function Oe(R,x){return R<=0||x.length===0&&x.ended?0:(x.state&j)!==0?1:n(R)?x.flowing&&x.length?x.buffer.first().length:x.length:R<=x.length?R:x.ended?x.length:0}Y.prototype.read=function(R){v("read",R),R===void 0?R=NaN:t(R)||(R=i(R,10));const x=this._readableState,te=R;if(R>x.highWaterMark&&(x.highWaterMark=De(R)),R!==0&&(x.state&=~z),R===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return v("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Wt(this):Je(this),null;if(R=Oe(R,x),R===0&&x.ended)return x.length===0&&Wt(this),null;let ae=(x.state&ue)!==0;if(v("need readable",ae),(x.length===0||x.length-R<x.highWaterMark)&&(ae=!0,v("length less than watermark",ae)),x.ended||x.reading||x.destroyed||x.errored||!x.constructed)ae=!1,v("reading, ended or constructing",ae);else if(ae){v("do read"),x.state|=ee|le,x.length===0&&(x.state|=ue);try{this._read(x.highWaterMark)}catch(Ne){S(this,Ne)}x.state&=~le,x.reading||(R=Oe(te,x))}let de;return R>0?de=gt(R,x):de=null,de===null?(x.needReadable=x.length<=x.highWaterMark,R=0):(x.length-=R,x.multiAwaitDrain?x.awaitDrainWriters.clear():x.awaitDrainWriters=null),x.length===0&&(x.ended||(x.needReadable=!0),te!==R&&x.ended&&Wt(this)),de!==null&&!x.errorEmitted&&!x.closeEmitted&&(x.dataEmitted=!0,this.emit("data",de)),de};function Be(R,x){if(v("onEofChunk"),!x.ended){if(x.decoder){const te=x.decoder.end();te&&te.length&&(x.buffer.push(te),x.length+=x.objectMode?1:te.length)}x.ended=!0,x.sync?Je(R):(x.needReadable=!1,x.emittedReadable=!0,Et(R))}}function Je(R){const x=R._readableState;v("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(v("emitReadable",x.flowing),x.emittedReadable=!0,r.nextTick(Et,R))}function Et(R){const x=R._readableState;v("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&!x.errored&&(x.length||x.ended)&&(R.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,jt(R)}function Me(R,x){!x.readingMore&&x.constructed&&(x.readingMore=!0,r.nextTick(ar,R,x))}function ar(R,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){const te=x.length;if(v("maybeReadMore read 0"),R.read(0),te===x.length)break}x.readingMore=!1}Y.prototype._read=function(R){throw new f("_read()")},Y.prototype.pipe=function(R,x){const te=this,ae=this._readableState;ae.pipes.length===1&&(ae.multiAwaitDrain||(ae.multiAwaitDrain=!0,ae.awaitDrainWriters=new w(ae.awaitDrainWriters?[ae.awaitDrainWriters]:[]))),ae.pipes.push(R),v("pipe count=%d opts=%j",ae.pipes.length,x);const Ne=(!x||x.end!==!1)&&R!==r.stdout&&R!==r.stderr?dr:St;ae.endEmitted?r.nextTick(Ne):te.once("end",Ne),R.on("unpipe",ke);function ke(st,Ze){v("onunpipe"),st===te&&Ze&&Ze.hasUnpiped===!1&&(Ze.hasUnpiped=!0,Gr())}function dr(){v("onend"),R.end()}let Ue,hr=!1;function Gr(){v("cleanup"),R.removeListener("close",tt),R.removeListener("finish",Ht),Ue&&R.removeListener("drain",Ue),R.removeListener("error",$t),R.removeListener("unpipe",ke),te.removeListener("end",dr),te.removeListener("end",St),te.removeListener("data",pr),hr=!0,Ue&&ae.awaitDrainWriters&&(!R._writableState||R._writableState.needDrain)&&Ue()}function gr(){hr||(ae.pipes.length===1&&ae.pipes[0]===R?(v("false write response, pause",0),ae.awaitDrainWriters=R,ae.multiAwaitDrain=!1):ae.pipes.length>1&&ae.pipes.includes(R)&&(v("false write response, pause",ae.awaitDrainWriters.size),ae.awaitDrainWriters.add(R)),te.pause()),Ue||(Ue=$r(te,R),R.on("drain",Ue))}te.on("data",pr);function pr(st){v("ondata");const Ze=R.write(st);v("dest.write",Ze),Ze===!1&&gr()}function $t(st){if(v("onerror",st),St(),R.removeListener("error",$t),R.listenerCount("error")===0){const Ze=R._writableState||R._readableState;Ze&&!Ze.errorEmitted?S(R,st):R.emit("error",st)}}y(R,"error",$t);function tt(){R.removeListener("finish",Ht),St()}R.once("close",tt);function Ht(){v("onfinish"),R.removeListener("close",tt),St()}R.once("finish",Ht);function St(){v("unpipe"),te.unpipe(R)}return R.emit("pipe",te),R.writableNeedDrain===!0?gr():ae.flowing||(v("pipe resume"),te.resume()),R};function $r(R,x){return function(){const ae=R._readableState;ae.awaitDrainWriters===x?(v("pipeOnDrain",1),ae.awaitDrainWriters=null):ae.multiAwaitDrain&&(v("pipeOnDrain",ae.awaitDrainWriters.size),ae.awaitDrainWriters.delete(x)),(!ae.awaitDrainWriters||ae.awaitDrainWriters.size===0)&&R.listenerCount("data")&&R.resume()}}Y.prototype.unpipe=function(R){const x=this._readableState,te={hasUnpiped:!1};if(x.pipes.length===0)return this;if(!R){const de=x.pipes;x.pipes=[],this.pause();for(let Ne=0;Ne<de.length;Ne++)de[Ne].emit("unpipe",this,{hasUnpiped:!1});return this}const ae=e(x.pipes,R);return ae===-1?this:(x.pipes.splice(ae,1),x.pipes.length===0&&this.pause(),R.emit("unpipe",this,te),this)},Y.prototype.on=function(R,x){const te=B.prototype.on.call(this,R,x),ae=this._readableState;return R==="data"?(ae.readableListening=this.listenerCount("readable")>0,ae.flowing!==!1&&this.resume()):R==="readable"&&!ae.endEmitted&&!ae.readableListening&&(ae.readableListening=ae.needReadable=!0,ae.flowing=!1,ae.emittedReadable=!1,v("on readable",ae.length,ae.reading),ae.length?Je(this):ae.reading||r.nextTick(it,this)),te},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(R,x){const te=B.prototype.removeListener.call(this,R,x);return R==="readable"&&r.nextTick(lr,this),te},Y.prototype.off=Y.prototype.removeListener,Y.prototype.removeAllListeners=function(R){const x=B.prototype.removeAllListeners.apply(this,arguments);return(R==="readable"||R===void 0)&&r.nextTick(lr,this),x};function lr(R){const x=R._readableState;x.readableListening=R.listenerCount("readable")>0,x.resumeScheduled&&x[A]===!1?x.flowing=!0:R.listenerCount("data")>0?R.resume():x.readableListening||(x.flowing=null)}function it(R){v("readable nexttick read 0"),R.read(0)}Y.prototype.resume=function(){const R=this._readableState;return R.flowing||(v("resume"),R.flowing=!R.readableListening,Lt(this,R)),R[A]=!1,this};function Lt(R,x){x.resumeScheduled||(x.resumeScheduled=!0,r.nextTick(Hr,R,x))}function Hr(R,x){v("resume",x.reading),x.reading||R.read(0),x.resumeScheduled=!1,R.emit("resume"),jt(R),x.flowing&&!x.reading&&R.read(0)}Y.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[A]=!0,this};function jt(R){const x=R._readableState;for(v("flow",x.flowing);x.flowing&&R.read()!==null;);}Y.prototype.wrap=function(R){let x=!1;R.on("data",ae=>{!this.push(ae)&&R.pause&&(x=!0,R.pause())}),R.on("end",()=>{this.push(null)}),R.on("error",ae=>{S(this,ae)}),R.on("close",()=>{this.destroy()}),R.on("destroy",()=>{this.destroy()}),this._read=()=>{x&&R.resume&&(x=!1,R.resume())};const te=o(R);for(let ae=1;ae<te.length;ae++){const de=te[ae];this[de]===void 0&&typeof R[de]=="function"&&(this[de]=R[de].bind(R))}return this},Y.prototype[O]=function(){return ur(this)},Y.prototype.iterator=function(R){return R!==void 0&&p(R,"options"),ur(this,R)};function ur(R,x){typeof R.read!="function"&&(R=Y.wrap(R,{objectMode:!0}));const te=fr(R,x);return te.stream=R,te}async function*fr(R,x){let te=M;function ae(ke){this===R?(te(),te=M):te=ke}R.on("readable",ae);let de;const Ne=c(R,{writable:!1},ke=>{de=ke?a(de,ke):null,te(),te=M});try{for(;;){const ke=R.destroyed?null:R.read();if(ke!==null)yield ke;else{if(de)throw de;if(de===null)return;await new d(ae)}}}catch(ke){throw de=a(de,ke),de}finally{(de||x?.destroyOnReturn!==!1)&&(de===void 0||R._readableState.autoDestroy)?$.destroyer(R,null):(R.off("readable",ae),Ne())}}s(Y.prototype,{readable:{__proto__:null,get(){const R=this._readableState;return!!R&&R.readable!==!1&&!R.destroyed&&!R.errorEmitted&&!R.endEmitted},set(R){this._readableState&&(this._readableState.readable=!!R)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(R){this._readableState&&(this._readableState.destroyed=R)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(re.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[A]!==!1},set(R){this[A]=!!R}}}),Y._fromList=gt;function gt(R,x){if(x.length===0)return null;let te;return x.objectMode?te=x.buffer.shift():!R||R>=x.length?(x.decoder?te=x.buffer.join(""):x.buffer.length===1?te=x.buffer.first():te=x.buffer.concat(x.length),x.buffer.clear()):te=x.buffer.consume(R,x.decoder),te}function Wt(R){const x=R._readableState;v("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,r.nextTick(ot,x,R))}function ot(R,x){if(v("endReadableNT",R.endEmitted,R.length),!R.errored&&!R.closeEmitted&&!R.endEmitted&&R.length===0){if(R.endEmitted=!0,x.emit("end"),x.writable&&x.allowHalfOpen===!1)r.nextTick(zr,x);else if(R.autoDestroy){const te=x._writableState;(!te||te.autoDestroy&&(te.finished||te.writable===!1))&&x.destroy()}}}function zr(R){R.writable&&!R.writableEnded&&!R.destroyed&&R.end()}Y.from=function(R,x){return E(Y,R,x)};let Ft;function cr(){return Ft===void 0&&(Ft={}),Ft}return Y.fromWeb=function(R,x){return cr().newStreamReadableFromReadableStream(R,x)},Y.toWeb=function(R,x){return cr().newReadableStreamFromStreamReadable(R,x)},Y.wrap=function(R,x){var te,ae;return new Y({objectMode:(te=(ae=R.readableObjectMode)!==null&&ae!==void 0?ae:R.objectMode)!==null&&te!==void 0?te:!0,...x,destroy(de,Ne){$.destroyer(R,de),Ne(de)}}).wrap(R)},In}var Tn,Ki;function ni(){if(Ki)return Tn;Ki=1;const r=Pt(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:l,Symbol:d,SymbolHasInstance:w}=Te();Tn=p,p.WritableState=h;const{EventEmitter:N}=tr.requireEvents(),O=ri().Stream,{Buffer:I}=be.requireDist(),k=Ut(),{addAbortSignal:B}=Br(),{getHighWaterMark:y,getDefaultHighWaterMark:b}=Mr(),{ERR_INVALID_ARG_TYPE:u,ERR_METHOD_NOT_IMPLEMENTED:c,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:G,ERR_STREAM_DESTROYED:$,ERR_STREAM_ALREADY_FINISHED:J,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:a,ERR_UNKNOWN_ENCODING:m}=qe().codes,{errorOrDestroy:f}=k;o(p.prototype,O.prototype),o(p,O);function g(){}const _=d("kOnFinished");function h(L,D,F){typeof F!="boolean"&&(F=D instanceof dt()),this.objectMode=!!(L&&L.objectMode),F&&(this.objectMode=this.objectMode||!!(L&&L.writableObjectMode)),this.highWaterMark=L?y(this,L,"writableHighWaterMark",F):b(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(L&&L.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=L&&L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=S.bind(void 0,D),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,C(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!L||L.emitClose!==!1,this.autoDestroy=!L||L.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[_]=[]}function C(L){L.buffered=[],L.bufferedIndex=0,L.allBuffers=!0,L.allNoop=!0}h.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(h.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function p(L){const D=this instanceof dt();if(!D&&!n(p,this))return new p(L);this._writableState=new h(L,this,D),L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final),typeof L.construct=="function"&&(this._construct=L.construct),L.signal&&B(L.signal,this)),O.call(this,L),k.construct(this,()=>{const F=this._writableState;F.writing||ee(this,F),z(this,F)})}i(p,w,{__proto__:null,value:function(L){return n(this,L)?!0:this!==p?!1:L&&L._writableState instanceof h}}),p.prototype.pipe=function(){f(this,new G)};function A(L,D,F,ne){const se=L._writableState;if(typeof F=="function")ne=F,F=se.defaultEncoding;else{if(!F)F=se.defaultEncoding;else if(F!=="buffer"&&!I.isEncoding(F))throw new m(F);typeof ne!="function"&&(ne=g)}if(D===null)throw new X;if(!se.objectMode)if(typeof D=="string")se.decodeStrings!==!1&&(D=I.from(D,F),F="buffer");else if(D instanceof I)F="buffer";else if(O._isUint8Array(D))D=O._uint8ArrayToBuffer(D),F="buffer";else throw new u("chunk",["string","Buffer","Uint8Array"],D);let ie;return se.ending?ie=new a:se.destroyed&&(ie=new $("write")),ie?(r.nextTick(ne,ie),f(L,ie,!0),ie):(se.pendingcb++,P(L,se,D,F,ne))}p.prototype.write=function(L,D,F){return A(this,L,D,F)===!0},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){const L=this._writableState;L.corked&&(L.corked--,L.writing||ee(this,L))},p.prototype.setDefaultEncoding=function(D){if(typeof D=="string"&&(D=l(D)),!I.isEncoding(D))throw new m(D);return this._writableState.defaultEncoding=D,this};function P(L,D,F,ne,se){const ie=D.objectMode?1:F.length;D.length+=ie;const q=D.length<D.highWaterMark;return q||(D.needDrain=!0),D.writing||D.corked||D.errored||!D.constructed?(D.buffered.push({chunk:F,encoding:ne,callback:se}),D.allBuffers&&ne!=="buffer"&&(D.allBuffers=!1),D.allNoop&&se!==g&&(D.allNoop=!1)):(D.writelen=ie,D.writecb=se,D.writing=!0,D.sync=!0,L._write(F,ne,D.onwrite),D.sync=!1),q&&!D.errored&&!D.destroyed}function E(L,D,F,ne,se,ie,q){D.writelen=ne,D.writecb=q,D.writing=!0,D.sync=!0,D.destroyed?D.onwrite(new $("write")):F?L._writev(se,D.onwrite):L._write(se,ie,D.onwrite),D.sync=!1}function M(L,D,F,ne){--D.pendingcb,ne(F),W(D),f(L,F)}function S(L,D){const F=L._writableState,ne=F.sync,se=F.writecb;if(typeof se!="function"){f(L,new v);return}F.writing=!1,F.writecb=null,F.length-=F.writelen,F.writelen=0,D?(D.stack,F.errored||(F.errored=D),L._readableState&&!L._readableState.errored&&(L._readableState.errored=D),ne?r.nextTick(M,L,F,D,se):M(L,F,D,se)):(F.buffered.length>F.bufferedIndex&&ee(L,F),ne?F.afterWriteTickInfo!==null&&F.afterWriteTickInfo.cb===se?F.afterWriteTickInfo.count++:(F.afterWriteTickInfo={count:1,cb:se,stream:L,state:F},r.nextTick(j,F.afterWriteTickInfo)):K(L,F,1,se))}function j({stream:L,state:D,count:F,cb:ne}){return D.afterWriteTickInfo=null,K(L,D,F,ne)}function K(L,D,F,ne){for(!D.ending&&!L.destroyed&&D.length===0&&D.needDrain&&(D.needDrain=!1,L.emit("drain"));F-- >0;)D.pendingcb--,ne();D.destroyed&&W(D),z(L,D)}function W(L){if(L.writing)return;for(let se=L.bufferedIndex;se<L.buffered.length;++se){var D;const{chunk:ie,callback:q}=L.buffered[se],Z=L.objectMode?1:ie.length;L.length-=Z,q((D=L.errored)!==null&&D!==void 0?D:new $("write"))}const F=L[_].splice(0);for(let se=0;se<F.length;se++){var ne;F[se]((ne=L.errored)!==null&&ne!==void 0?ne:new $("end"))}C(L)}function ee(L,D){if(D.corked||D.bufferProcessing||D.destroyed||!D.constructed)return;const{buffered:F,bufferedIndex:ne,objectMode:se}=D,ie=F.length-ne;if(!ie)return;let q=ne;if(D.bufferProcessing=!0,ie>1&&L._writev){D.pendingcb-=ie-1;const Z=D.allNoop?g:Y=>{for(let we=q;we<F.length;++we)F[we].callback(Y)},re=D.allNoop&&q===0?F:e(F,q);re.allBuffers=D.allBuffers,E(L,D,!0,D.length,re,"",Z),C(D)}else{do{const{chunk:Z,encoding:re,callback:Y}=F[q];F[q++]=null;const we=se?1:Z.length;E(L,D,!1,we,Z,re,Y)}while(q<F.length&&!D.writing);q===F.length?C(D):q>256?(F.splice(0,q),D.bufferedIndex=0):D.bufferedIndex=q}D.bufferProcessing=!1}p.prototype._write=function(L,D,F){if(this._writev)this._writev([{chunk:L,encoding:D}],F);else throw new c("_write()")},p.prototype._writev=null,p.prototype.end=function(L,D,F){const ne=this._writableState;typeof L=="function"?(F=L,L=null,D=null):typeof D=="function"&&(F=D,D=null);let se;if(L!=null){const ie=A(this,L,D);ie instanceof t&&(se=ie)}return ne.corked&&(ne.corked=1,this.uncork()),se||(!ne.errored&&!ne.ending?(ne.ending=!0,z(this,ne,!0),ne.ended=!0):ne.finished?se=new J("end"):ne.destroyed&&(se=new $("end"))),typeof F=="function"&&(se||ne.finished?r.nextTick(F,se):ne[_].push(F)),this};function Q(L){return L.ending&&!L.destroyed&&L.constructed&&L.length===0&&!L.errored&&L.buffered.length===0&&!L.finished&&!L.writing&&!L.errorEmitted&&!L.closeEmitted}function le(L,D){let F=!1;function ne(se){if(F){f(L,se??v());return}if(F=!0,D.pendingcb--,se){const ie=D[_].splice(0);for(let q=0;q<ie.length;q++)ie[q](se);f(L,se,D.sync)}else Q(D)&&(D.prefinished=!0,L.emit("prefinish"),D.pendingcb++,r.nextTick(V,L,D))}D.sync=!0,D.pendingcb++;try{L._final(ne)}catch(se){ne(se)}D.sync=!1}function ue(L,D){!D.prefinished&&!D.finalCalled&&(typeof L._final=="function"&&!D.destroyed?(D.finalCalled=!0,le(L,D)):(D.prefinished=!0,L.emit("prefinish")))}function z(L,D,F){Q(D)&&(ue(L,D),D.pendingcb===0&&(F?(D.pendingcb++,r.nextTick((ne,se)=>{Q(se)?V(ne,se):se.pendingcb--},L,D)):Q(D)&&(D.pendingcb++,V(L,D))))}function V(L,D){D.pendingcb--,D.finished=!0;const F=D[_].splice(0);for(let ne=0;ne<F.length;ne++)F[ne]();if(L.emit("finish"),D.autoDestroy){const ne=L._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&L.destroy()}}s(p.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(L){this._writableState&&(this._writableState.destroyed=L)}},writable:{__proto__:null,get(){const L=this._writableState;return!!L&&L.writable!==!1&&!L.destroyed&&!L.errored&&!L.ending&&!L.ended},set(L){this._writableState&&(this._writableState.writable=!!L)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const L=this._writableState;return L?!L.destroyed&&!L.ending&&L.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const oe=k.destroy;p.prototype.destroy=function(L,D){const F=this._writableState;return!F.destroyed&&(F.bufferedIndex<F.buffered.length||F[_].length)&&r.nextTick(W,F),oe.call(this,L,D),this},p.prototype._undestroy=k.undestroy,p.prototype._destroy=function(L,D){D(L)},p.prototype[N.captureRejectionSymbol]=function(L){this.destroy(L)};let ce;function fe(){return ce===void 0&&(ce={}),ce}return p.fromWeb=function(L,D){return fe().newStreamWritableFromWritableStream(L,D)},p.toWeb=function(L){return fe().newWritableStreamFromStreamWritable(L)},Tn}var xn,Yi;function la(){if(Yi)return xn;Yi=1;const r=Pt(),e=be.requireDist(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:l,isDuplexNodeStream:d,isReadableStream:w,isWritableStream:N}=ht(),O=mt(),{AbortError:I,codes:{ERR_INVALID_ARG_TYPE:k,ERR_INVALID_RETURN_VALUE:B}}=qe(),{destroyer:y}=Ut(),b=dt(),u=Dr(),c=ni(),{createDeferredPromise:v}=Fe(),G=Vo(),$=globalThis.Blob||e.Blob,J=typeof $<"u"?function(h){return h instanceof $}:function(h){return!1},X=globalThis.AbortController||Qt().AbortController,{FunctionPrototypeCall:a}=Te();class m extends b{constructor(h){super(h),h?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}xn=function _(h,C){if(d(h))return h;if(o(h))return g({readable:h});if(l(h))return g({writable:h});if(s(h))return g({writable:!1,readable:!1});if(w(h))return g({readable:u.fromWeb(h)});if(N(h))return g({writable:c.fromWeb(h)});if(typeof h=="function"){const{value:A,write:P,final:E,destroy:M}=f(h);if(i(A))return G(m,A,{objectMode:!0,write:P,final:E,destroy:M});const S=A?.then;if(typeof S=="function"){let j;const K=a(S,A,W=>{if(W!=null)throw new B("nully","body",W)},W=>{y(j,W)});return j=new m({objectMode:!0,readable:!1,write:P,final(W){E(async()=>{try{await K,r.nextTick(W,null)}catch(ee){r.nextTick(W,ee)}})},destroy:M})}throw new B("Iterable, AsyncIterable or AsyncFunction",C,A)}if(J(h))return _(h.arrayBuffer());if(i(h))return G(m,h,{objectMode:!0,writable:!1});if(w(h?.readable)&&N(h?.writable))return m.fromWeb(h);if(typeof h?.writable=="object"||typeof h?.readable=="object"){const A=h!=null&&h.readable?o(h?.readable)?h?.readable:_(h.readable):void 0,P=h!=null&&h.writable?l(h?.writable)?h?.writable:_(h.writable):void 0;return g({readable:A,writable:P})}const p=h?.then;if(typeof p=="function"){let A;return a(p,h,P=>{P!=null&&A.push(P),A.push(null)},P=>{y(A,P)}),A=new m({objectMode:!0,writable:!1,read(){}})}throw new k(C,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],h)};function f(_){let{promise:h,resolve:C}=v();const p=new X,A=p.signal;return{value:_((async function*(){for(;;){const E=h;h=null;const{chunk:M,done:S,cb:j}=await E;if(r.nextTick(j),S)return;if(A.aborted)throw new I(void 0,{cause:A.reason});({promise:h,resolve:C}=v()),yield M}})(),{signal:A}),write(E,M,S){const j=C;C=null,j({chunk:E,done:!1,cb:S})},final(E){const M=C;C=null,M({done:!0,cb:E})},destroy(E,M){p.abort(),M(E)}}}function g(_){const h=_.readable&&typeof _.readable.read!="function"?u.wrap(_.readable):_.readable,C=_.writable;let p=!!t(h),A=!!n(C),P,E,M,S,j;function K(W){const ee=S;S=null,ee?ee(W):W&&j.destroy(W)}return j=new m({readableObjectMode:!!(h!=null&&h.readableObjectMode),writableObjectMode:!!(C!=null&&C.writableObjectMode),readable:p,writable:A}),A&&(O(C,W=>{A=!1,W&&y(h,W),K(W)}),j._write=function(W,ee,Q){C.write(W,ee)?Q():P=Q},j._final=function(W){C.end(),E=W},C.on("drain",function(){if(P){const W=P;P=null,W()}}),C.on("finish",function(){if(E){const W=E;E=null,W()}})),p&&(O(h,W=>{p=!1,W&&y(h,W),K(W)}),h.on("readable",function(){if(M){const W=M;M=null,W()}}),h.on("end",function(){j.push(null)}),j._read=function(){for(;;){const W=h.read();if(W===null){M=j._read;return}if(!j.push(W))return}}),j._destroy=function(W,ee){!W&&S!==null&&(W=new I),M=null,P=null,E=null,S===null?ee(W):(S=ee,y(C,W),y(h,W))},j}return xn}var On,Ji;function dt(){if(Ji)return On;Ji=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Te();On=o;const i=Dr(),s=ni();n(o.prototype,i.prototype),n(o,i);{const N=t(s.prototype);for(let O=0;O<N.length;O++){const I=N[O];o.prototype[I]||(o.prototype[I]=s.prototype[I])}}function o(N){if(!(this instanceof o))return new o(N);i.call(this,N),s.call(this,N),N?(this.allowHalfOpen=N.allowHalfOpen!==!1,N.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),N.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(o.prototype,{writable:{__proto__:null,...e(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(s.prototype,"writableLength")},writableFinished:{__proto__:null,...e(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(N){this._readableState&&this._writableState&&(this._readableState.destroyed=N,this._writableState.destroyed=N)}}});let l;function d(){return l===void 0&&(l={}),l}o.fromWeb=function(N,O){return d().newStreamDuplexFromReadableWritablePair(N,O)},o.toWeb=function(N){return d().newReadableWritablePairFromDuplex(N)};let w;return o.from=function(N){return w||(w=la()),w(N,"body")},On}var Nn,Zi;function Ko(){if(Zi)return Nn;Zi=1;const{ObjectSetPrototypeOf:r,Symbol:e}=Te();Nn=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=qe().codes,n=dt(),{getHighWaterMark:i}=Mr();r(o.prototype,n.prototype),r(o,n);const s=e("kCallback");function o(w){if(!(this instanceof o))return new o(w);const N=w?i(this,w,"readableHighWaterMark",!0):null;N===0&&(w={...w,highWaterMark:null,readableHighWaterMark:N,writableHighWaterMark:w.writableHighWaterMark||0}),n.call(this,w),this._readableState.sync=!1,this[s]=null,w&&(typeof w.transform=="function"&&(this._transform=w.transform),typeof w.flush=="function"&&(this._flush=w.flush)),this.on("prefinish",d)}function l(w){typeof this._flush=="function"&&!this.destroyed?this._flush((N,O)=>{if(N){w?w(N):this.destroy(N);return}O!=null&&this.push(O),this.push(null),w&&w()}):(this.push(null),w&&w())}function d(){this._final!==l&&l.call(this)}return o.prototype._final=l,o.prototype._transform=function(w,N,O){throw new t("_transform()")},o.prototype._write=function(w,N,O){const I=this._readableState,k=this._writableState,B=I.length;this._transform(w,N,(y,b)=>{if(y){O(y);return}b!=null&&this.push(b),k.ended||B===I.length||I.length<I.highWaterMark?O():this[s]=O})},o.prototype._read=function(){if(this[s]){const w=this[s];this[s]=null,w()}},Nn}var Cn,Xi;function Yo(){if(Xi)return Cn;Xi=1;const{ObjectSetPrototypeOf:r}=Te();Cn=t;const e=Ko();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,s){s(null,n)},Cn}var Pn,Qi;function ii(){if(Qi)return Pn;Qi=1;const r=Pt(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=Te(),s=mt(),{once:o}=Fe(),l=Ut(),d=dt(),{aggregateTwoErrors:w,codes:{ERR_INVALID_ARG_TYPE:N,ERR_INVALID_RETURN_VALUE:O,ERR_MISSING_ARGS:I,ERR_STREAM_DESTROYED:k,ERR_STREAM_PREMATURE_CLOSE:B},AbortError:y}=qe(),{validateFunction:b,validateAbortSignal:u}=rr(),{isIterable:c,isReadable:v,isReadableNodeStream:G,isNodeStream:$,isTransformStream:J,isWebStream:X,isReadableStream:a,isReadableFinished:m}=ht(),f=globalThis.AbortController||Qt().AbortController;let g,_,h;function C(W,ee,Q){let le=!1;W.on("close",()=>{le=!0});const ue=s(W,{readable:ee,writable:Q},z=>{le=!z});return{destroy:z=>{le||(le=!0,l.destroyer(W,z||new k("pipe")))},cleanup:ue}}function p(W){return b(W[W.length-1],"streams[stream.length - 1]"),W.pop()}function A(W){if(c(W))return W;if(G(W))return P(W);throw new N("val",["Readable","Iterable","AsyncIterable"],W)}async function*P(W){_||(_=Dr()),yield*_.prototype[n].call(W)}async function E(W,ee,Q,{end:le}){let ue,z=null;const V=fe=>{if(fe&&(ue=fe),z){const L=z;z=null,L()}},oe=()=>new t((fe,L)=>{ue?L(ue):z=()=>{ue?L(ue):fe()}});ee.on("drain",V);const ce=s(ee,{readable:!1},V);try{ee.writableNeedDrain&&await oe();for await(const fe of W)ee.write(fe)||await oe();le&&(ee.end(),await oe()),Q()}catch(fe){Q(ue!==fe?w(ue,fe):fe)}finally{ce(),ee.off("drain",V)}}async function M(W,ee,Q,{end:le}){J(ee)&&(ee=ee.writable);const ue=ee.getWriter();try{for await(const z of W)await ue.ready,ue.write(z).catch(()=>{});await ue.ready,le&&await ue.close(),Q()}catch(z){try{await ue.abort(z),Q(z)}catch(V){Q(V)}}}function S(...W){return j(W,o(p(W)))}function j(W,ee,Q){if(W.length===1&&e(W[0])&&(W=W[0]),W.length<2)throw new I("streams");const le=new f,ue=le.signal,z=Q?.signal,V=[];u(z,"options.signal");function oe(){se(new y)}h=h||Fe().addAbortListener;let ce;z&&(ce=h(z,oe));let fe,L;const D=[];let F=0;function ne(re){se(re,--F===0)}function se(re,Y){var we;if(re&&(!fe||fe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(fe=re),!(!fe&&!Y)){for(;D.length;)D.shift()(fe);(we=ce)===null||we===void 0||we[i](),le.abort(),Y&&(fe||V.forEach(Le=>Le()),r.nextTick(ee,fe,L))}}let ie;for(let re=0;re<W.length;re++){const Y=W[re],we=re<W.length-1,Le=re>0,_e=we||Q?.end!==!1,De=re===W.length-1;if($(Y)){let Oe=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(Be)};if(_e){const{destroy:Be,cleanup:Je}=C(Y,we,Le);D.push(Be),v(Y)&&De&&V.push(Je)}Y.on("error",Oe),v(Y)&&De&&V.push(()=>{Y.removeListener("error",Oe)})}if(re===0)if(typeof Y=="function"){if(ie=Y({signal:ue}),!c(ie))throw new O("Iterable, AsyncIterable or Stream","source",ie)}else c(Y)||G(Y)||J(Y)?ie=Y:ie=d.from(Y);else if(typeof Y=="function"){if(J(ie)){var q;ie=A((q=ie)===null||q===void 0?void 0:q.readable)}else ie=A(ie);if(ie=Y(ie,{signal:ue}),we){if(!c(ie,!0))throw new O("AsyncIterable",`transform[${re-1}]`,ie)}else{var Z;g||(g=Yo());const Oe=new g({objectMode:!0}),Be=(Z=ie)===null||Z===void 0?void 0:Z.then;if(typeof Be=="function")F++,Be.call(ie,Me=>{L=Me,Me!=null&&Oe.write(Me),_e&&Oe.end(),r.nextTick(ne)},Me=>{Oe.destroy(Me),r.nextTick(ne,Me)});else if(c(ie,!0))F++,E(ie,Oe,ne,{end:_e});else if(a(ie)||J(ie)){const Me=ie.readable||ie;F++,E(Me,Oe,ne,{end:_e})}else throw new O("AsyncIterable or Promise","destination",ie);ie=Oe;const{destroy:Je,cleanup:Et}=C(ie,!1,!0);D.push(Je),De&&V.push(Et)}}else if($(Y)){if(G(ie)){F+=2;const Oe=K(ie,Y,ne,{end:_e});v(Y)&&De&&V.push(Oe)}else if(J(ie)||a(ie)){const Oe=ie.readable||ie;F++,E(Oe,Y,ne,{end:_e})}else if(c(ie))F++,E(ie,Y,ne,{end:_e});else throw new N("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ie);ie=Y}else if(X(Y)){if(G(ie))F++,M(A(ie),Y,ne,{end:_e});else if(a(ie)||c(ie))F++,M(ie,Y,ne,{end:_e});else if(J(ie))F++,M(ie.readable,Y,ne,{end:_e});else throw new N("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ie);ie=Y}else ie=d.from(Y)}return(ue!=null&&ue.aborted||z!=null&&z.aborted)&&r.nextTick(oe),ie}function K(W,ee,Q,{end:le}){let ue=!1;if(ee.on("close",()=>{ue||Q(new B)}),W.pipe(ee,{end:!1}),le){let z=function(){ue=!0,ee.end()};m(W)?r.nextTick(z):W.once("end",z)}else Q();return s(W,{readable:!0,writable:!1},z=>{const V=W._readableState;z&&z.code==="ERR_STREAM_PREMATURE_CLOSE"&&V&&V.ended&&!V.errored&&!V.errorEmitted?W.once("end",Q).once("error",Q):Q(z)}),s(ee,{readable:!1,writable:!0},Q)}return Pn={pipelineImpl:j,pipeline:S},Pn}var Ln,eo;function Jo(){if(eo)return Ln;eo=1;const{pipeline:r}=ii(),e=dt(),{destroyer:t}=Ut(),{isNodeStream:n,isReadable:i,isWritable:s,isWebStream:o,isTransformStream:l,isWritableStream:d,isReadableStream:w}=ht(),{AbortError:N,codes:{ERR_INVALID_ARG_VALUE:O,ERR_MISSING_ARGS:I}}=qe(),k=mt();return Ln=function(...y){if(y.length===0)throw new I("streams");if(y.length===1)return e.from(y[0]);const b=[...y];if(typeof y[0]=="function"&&(y[0]=e.from(y[0])),typeof y[y.length-1]=="function"){const g=y.length-1;y[g]=e.from(y[g])}for(let g=0;g<y.length;++g)if(!(!n(y[g])&&!o(y[g]))){if(g<y.length-1&&!(i(y[g])||w(y[g])||l(y[g])))throw new O(`streams[${g}]`,b[g],"must be readable");if(g>0&&!(s(y[g])||d(y[g])||l(y[g])))throw new O(`streams[${g}]`,b[g],"must be writable")}let u,c,v,G,$;function J(g){const _=G;G=null,_?_(g):g?$.destroy(g):!f&&!m&&$.destroy()}const X=y[0],a=r(y,J),m=!!(s(X)||d(X)||l(X)),f=!!(i(a)||w(a)||l(a));if($=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(a!=null&&a.readableObjectMode),writable:m,readable:f}),m){if(n(X))$._write=function(_,h,C){X.write(_,h)?C():u=C},$._final=function(_){X.end(),c=_},X.on("drain",function(){if(u){const _=u;u=null,_()}});else if(o(X)){const h=(l(X)?X.writable:X).getWriter();$._write=async function(C,p,A){try{await h.ready,h.write(C).catch(()=>{}),A()}catch(P){A(P)}},$._final=async function(C){try{await h.ready,h.close().catch(()=>{}),c=C}catch(p){C(p)}}}const g=l(a)?a.readable:a;k(g,()=>{if(c){const _=c;c=null,_()}})}if(f){if(n(a))a.on("readable",function(){if(v){const g=v;v=null,g()}}),a.on("end",function(){$.push(null)}),$._read=function(){for(;;){const g=a.read();if(g===null){v=$._read;return}if(!$.push(g))return}};else if(o(a)){const _=(l(a)?a.readable:a).getReader();$._read=async function(){for(;;)try{const{value:h,done:C}=await _.read();if(!$.push(h))return;if(C){$.push(null);return}}catch{return}}}}return $._destroy=function(g,_){!g&&G!==null&&(g=new N),v=null,u=null,c=null,G===null?_(g):(G=_,n(a)&&t(a,g))},$},Ln}var to;function ua(){if(to)return Sr;to=1;const r=globalThis.AbortController||Qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:s}=qe(),{validateAbortSignal:o,validateInteger:l,validateObject:d}=rr(),w=Te().Symbol("kWeak"),N=Te().Symbol("kResistStopPropagation"),{finished:O}=mt(),I=Jo(),{addAbortSignalNoValidate:k}=Br(),{isWritable:B,isNodeStream:y}=ht(),{deprecate:b}=Fe(),{ArrayPrototypePush:u,Boolean:c,MathFloor:v,Number:G,NumberIsNaN:$,Promise:J,PromiseReject:X,PromiseResolve:a,PromisePrototypeThen:m,Symbol:f}=Te(),g=f("kEmpty"),_=f("kEof");function h(z,V){if(V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal"),y(z)&&!B(z))throw new e("stream",z,"must be writable");const oe=I(this,z);return V!=null&&V.signal&&k(V.signal,oe),oe}function C(z,V){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal");let oe=1;V?.concurrency!=null&&(oe=v(V.concurrency));let ce=oe-1;return V?.highWaterMark!=null&&(ce=v(V.highWaterMark)),l(oe,"options.concurrency",1),l(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const L=Fe().AbortSignalAny([V?.signal].filter(c)),D=this,F=[],ne={signal:L};let se,ie,q=!1,Z=0;function re(){q=!0,Y()}function Y(){Z-=1,we()}function we(){ie&&!q&&Z<oe&&F.length<ce&&(ie(),ie=null)}async function Le(){try{for await(let _e of D){if(q)return;if(L.aborted)throw new s;try{if(_e=z(_e,ne),_e===g)continue;_e=a(_e)}catch(De){_e=X(De)}Z+=1,m(_e,Y,re),F.push(_e),se&&(se(),se=null),!q&&(F.length>=ce||Z>=oe)&&await new J(De=>{ie=De})}F.push(_)}catch(_e){const De=X(_e);m(De,Y,re),F.push(De)}finally{q=!0,se&&(se(),se=null)}}Le();try{for(;;){for(;F.length>0;){const _e=await F[0];if(_e===_)return;if(L.aborted)throw new s;_e!==g&&(yield _e),F.shift(),we()}await new J(_e=>{se=_e})}}finally{q=!0,ie&&(ie(),ie=null)}}).call(this)}function p(z=void 0){return z!=null&&d(z,"options"),z?.signal!=null&&o(z.signal,"options.signal"),(async function*(){let oe=0;for await(const fe of this){var ce;if(z!=null&&(ce=z.signal)!==null&&ce!==void 0&&ce.aborted)throw new s({cause:z.signal.reason});yield[oe++,fe]}}).call(this)}async function A(z,V=void 0){for await(const oe of S.call(this,z,V))return!0;return!1}async function P(z,V=void 0){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);return!await A.call(this,async(...oe)=>!await z(...oe),V)}async function E(z,V){for await(const oe of S.call(this,z,V))return oe}async function M(z,V){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);async function oe(ce,fe){return await z(ce,fe),g}for await(const ce of C.call(this,oe,V));}function S(z,V){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);async function oe(ce,fe){return await z(ce,fe)?ce:g}return C.call(this,oe,V)}class j extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function K(z,V,oe){var ce;if(typeof z!="function")throw new t("reducer",["Function","AsyncFunction"],z);oe!=null&&d(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let fe=arguments.length>1;if(oe!=null&&(ce=oe.signal)!==null&&ce!==void 0&&ce.aborted){const se=new s(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await O(this.destroy(se)),se}const L=new r,D=L.signal;if(oe!=null&&oe.signal){const se={once:!0,[w]:this,[N]:!0};oe.signal.addEventListener("abort",()=>L.abort(),se)}let F=!1;try{for await(const se of this){var ne;if(F=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new s;fe?V=await z(V,se,{signal:D}):(V=se,fe=!0)}if(!F&&!fe)throw new j}finally{L.abort()}return V}async function W(z){z!=null&&d(z,"options"),z?.signal!=null&&o(z.signal,"options.signal");const V=[];for await(const ce of this){var oe;if(z!=null&&(oe=z.signal)!==null&&oe!==void 0&&oe.aborted)throw new s(void 0,{cause:z.signal.reason});u(V,ce)}return V}function ee(z,V){const oe=C.call(this,z,V);return(async function*(){for await(const fe of oe)yield*fe}).call(this)}function Q(z){if(z=G(z),$(z))return 0;if(z<0)throw new i("number",">= 0",z);return z}function le(z,V=void 0){return V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal"),z=Q(z),(async function*(){var ce;if(V!=null&&(ce=V.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const L of this){var fe;if(V!=null&&(fe=V.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;z--<=0&&(yield L)}}).call(this)}function ue(z,V=void 0){return V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal"),z=Q(z),(async function*(){var ce;if(V!=null&&(ce=V.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const L of this){var fe;if(V!=null&&(fe=V.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;if(z-- >0&&(yield L),z<=0)return}}).call(this)}return Sr.streamReturningOperators={asIndexedPairs:b(p,"readable.asIndexedPairs will be removed in a future version."),drop:le,filter:S,flatMap:ee,map:C,take:ue,compose:h},Sr.promiseReturningOperators={every:P,forEach:M,reduce:K,toArray:W,some:A,find:E},Sr}var Bn,ro;function Zo(){if(ro)return Bn;ro=1;const{ArrayPrototypePop:r,Promise:e}=Te(),{isIterable:t,isNodeStream:n,isWebStream:i}=ht(),{pipelineImpl:s}=ii(),{finished:o}=mt();Xo();function l(...d){return new e((w,N)=>{let O,I;const k=d[d.length-1];if(k&&typeof k=="object"&&!n(k)&&!t(k)&&!i(k)){const B=r(d);O=B.signal,I=B.end}s(d,(B,y)=>{B?N(B):w(y)},{signal:O,end:I})})}return Bn={finished:o,pipeline:l},Bn}var no;function Xo(){if(no)return cn.exports;no=1;const{Buffer:r}=be.requireDist(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Te(),{promisify:{custom:i}}=Fe(),{streamReturningOperators:s,promiseReturningOperators:o}=ua(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=qe(),d=Jo(),{setDefaultHighWaterMark:w,getDefaultHighWaterMark:N}=Mr(),{pipeline:O}=ii(),{destroyer:I}=Ut(),k=mt(),B=Zo(),y=ht(),b=cn.exports=ri().Stream;b.isDestroyed=y.isDestroyed,b.isDisturbed=y.isDisturbed,b.isErrored=y.isErrored,b.isReadable=y.isReadable,b.isWritable=y.isWritable,b.Readable=Dr();for(const c of t(s)){let G=function(...$){if(new.target)throw l();return b.Readable.from(n(v,this,$))};const v=s[c];e(G,"name",{__proto__:null,value:v.name}),e(G,"length",{__proto__:null,value:v.length}),e(b.Readable.prototype,c,{__proto__:null,value:G,enumerable:!1,configurable:!0,writable:!0})}for(const c of t(o)){let G=function(...$){if(new.target)throw l();return n(v,this,$)};const v=o[c];e(G,"name",{__proto__:null,value:v.name}),e(G,"length",{__proto__:null,value:v.length}),e(b.Readable.prototype,c,{__proto__:null,value:G,enumerable:!1,configurable:!0,writable:!0})}b.Writable=ni(),b.Duplex=dt(),b.Transform=Ko(),b.PassThrough=Yo(),b.pipeline=O;const{addAbortSignal:u}=Br();return b.addAbortSignal=u,b.finished=k,b.destroy=I,b.compose=d,b.setDefaultHighWaterMark=w,b.getDefaultHighWaterMark=N,e(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return B}}),e(O,i,{__proto__:null,enumerable:!0,get(){return B.pipeline}}),e(k,i,{__proto__:null,enumerable:!0,get(){return B.finished}}),b.Stream=b,b._isUint8Array=function(v){return v instanceof Uint8Array},b._uint8ArrayToBuffer=function(v){return r.from(v.buffer,v.byteOffset,v.byteLength)},cn.exports}var io;function fa(){return io||(io=1,(function(r){const e=Xo(),t=Zo(),n=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=n,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(fn)),fn.exports}var qr=fa(),ca=Ho();const da=be.getDefaultExportFromCjs(ca);var Ar={exports:{}},Mn,oo;function ha(){if(oo)return Mn;oo=1,Mn=r;function r(e,t){if(e&&t)return r(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){n[i]=e[i]}),n;function n(){for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];var o=e.apply(this,i),l=i[i.length-1];return typeof o=="function"&&o!==l&&Object.keys(l).forEach(function(d){o[d]=l[d]}),o}}return Mn}var so;function oi(){if(so)return Ar.exports;so=1;var r=ha();Ar.exports=r(e),Ar.exports.strict=r(t),e.proto=e(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return e(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return t(this)},configurable:!0})});function e(n){var i=function(){return i.called?i.value:(i.called=!0,i.value=n.apply(this,arguments))};return i.called=!1,i}function t(n){var i=function(){if(i.called)throw new Error(i.onceError);return i.called=!0,i.value=n.apply(this,arguments)},s=n.name||"Function wrapped with `once`";return i.onceError=s+" shouldn't be called more than once",i.called=!1,i}return Ar.exports}var Dn,ao;function Qo(){if(ao)return Dn;ao=1;var r=oi(),e=function(){},t=be.commonjsGlobal.Bare?queueMicrotask:be.process$1.nextTick.bind(be.process$1),n=function(o){return o.setHeader&&typeof o.abort=="function"},i=function(o){return o.stdio&&Array.isArray(o.stdio)&&o.stdio.length===3},s=function(o,l,d){if(typeof l=="function")return s(o,null,l);l||(l={}),d=r(d||e);var w=o._writableState,N=o._readableState,O=l.readable||l.readable!==!1&&o.readable,I=l.writable||l.writable!==!1&&o.writable,k=!1,B=function(){o.writable||y()},y=function(){I=!1,O||d.call(o)},b=function(){O=!1,I||d.call(o)},u=function(J){d.call(o,J?new Error("exited with error code: "+J):null)},c=function(J){d.call(o,J)},v=function(){t(G)},G=function(){if(!k){if(O&&!(N&&N.ended&&!N.destroyed))return d.call(o,new Error("premature close"));if(I&&!(w&&w.ended&&!w.destroyed))return d.call(o,new Error("premature close"))}},$=function(){o.req.on("finish",y)};return n(o)?(o.on("complete",y),o.on("abort",v),o.req?$():o.on("request",$)):I&&!w&&(o.on("end",B),o.on("close",B)),i(o)&&o.on("exit",u),o.on("end",b),o.on("finish",y),l.error!==!1&&o.on("error",c),o.on("close",v),function(){k=!0,o.removeListener("complete",y),o.removeListener("abort",v),o.removeListener("request",$),o.req&&o.req.removeListener("finish",y),o.removeListener("end",B),o.removeListener("close",B),o.removeListener("finish",y),o.removeListener("exit",u),o.removeListener("end",b),o.removeListener("error",c),o.removeListener("close",v)}};return Dn=s,Dn}var ga=Qo();const lo=be.getDefaultExportFromCjs(ga);var pa=oi();const wa=be.getDefaultExportFromCjs(pa);var qn,uo;function ba(){if(uo)return qn;uo=1;var r=oi(),e=Qo(),t;try{t=tr.require$$2}catch{}var n=function(){},i=typeof be.process$1>"u"?!1:/^v?\.0/.test(be.process$1.version),s=function(I){return typeof I=="function"},o=function(I){return!i||!t?!1:(I instanceof(t.ReadStream||n)||I instanceof(t.WriteStream||n))&&s(I.close)},l=function(I){return I.setHeader&&s(I.abort)},d=function(I,k,B,y){y=r(y);var b=!1;I.on("close",function(){b=!0}),e(I,{readable:k,writable:B},function(c){if(c)return y(c);b=!0,y()});var u=!1;return function(c){if(!b&&!u){if(u=!0,o(I))return I.close(n);if(l(I))return I.abort();if(s(I.destroy))return I.destroy();y(c||new Error("stream was destroyed"))}}},w=function(I){I()},N=function(I,k){return I.pipe(k)},O=function(){var I=Array.prototype.slice.call(arguments),k=s(I[I.length-1]||n)&&I.pop()||n;if(Array.isArray(I[0])&&(I=I[0]),I.length<2)throw new Error("pump requires two streams per minimum");var B,y=I.map(function(b,u){var c=u<I.length-1,v=u>0;return d(b,c,v,function(G){B||(B=G),G&&y.forEach(w),!c&&(y.forEach(w),k(B))})});return I.reduce(N)};return qn=O,qn}var ya=ba();const fo=be.getDefaultExportFromCjs(ya);function Rr(){}const co="SYN",kn="ACK",ho="BRK";class go extends qr.Duplex{constructor(e){let{name:t,target:n,targetWindow:i=window,targetOrigin:s="*"}=e;if(super({objectMode:!0}),ge(this,"_init",void 0),ge(this,"_haveSyn",void 0),ge(this,"_name",void 0),ge(this,"_target",void 0),ge(this,"_targetWindow",void 0),ge(this,"_targetOrigin",void 0),ge(this,"_onMessage",void 0),ge(this,"_synIntervalId",void 0),!t||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=t,this._target=n,this._targetWindow=i,this._targetOrigin=s,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(ho,null,Rr),this._haveSyn=!1,this._init=!1}_handShake(){this._write(co,null,Rr),this.cork()}_onData(e){if(!this._init)e===co?(this._haveSyn=!0,this._write(kn,null,Rr)):e===kn&&(this._init=!0,this._haveSyn||this._write(kn,null,Rr),this.uncork());else if(e===ho)this._break();else try{this.push(e)}catch(t){this.emit("error",t)}}_postMessage(e){const t=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:e},t)}onMessage(e){const t=e.data;this._targetOrigin!=="*"&&e.origin!==this._targetOrigin||e.source!==this._targetWindow||typeof t!="object"||t.target!==this._name||!t.data||this._onData(t.data)}_read(){}_write(e,t,n){this._postMessage(e),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}const _a={rpc:{internal:-32603}},po={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},wo=_a.rpc.internal,ma="Unspecified error message. This is a bug, please report it.";function es(r){return Number.isInteger(r)}function bo(r){return typeof r=="string"&&r.length>0}function yo(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function ts(r){const e=r;return!(!e||!es(e.code)||!bo(e.message)||e.stack&&!bo(e.stack))}function Ea(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ma;if(es(r)){const t=r.toString();if(Object.hasOwn(po,t))return po[t].message}return e}const Sa={code:wo,message:Ea(wo)};function Gn(r){try{JSON.parse(JSON.stringify(r,(e,t)=>{if(e==="__proto__"||e==="constructor")throw new Error("Not valid json");if(typeof t=="function"||typeof t=="symbol")throw new Error("Not valid json");return t}),(e,t)=>{if(!(e==="__proto__"||e==="constructor"))return t})}catch{return!1}return!0}function _o(r){return Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Gn(n)&&(e[t]=n),e},{})}function va(r){return Array.isArray(r)?r.map(e=>Gn(e)?e:yo(e)?_o(e):null):yo(r)?_o(r):Gn(r)?r:null}function Aa(r,e){if(r&&typeof r=="object"&&"serialize"in r&&typeof r.serialize=="function")return r.serialize();if(ts(r))return r;const t=va(r);return Ye(Ye({},e),{},{data:{cause:t}})}function mo(r){let{fallbackError:e=Sa,shouldIncludeStack:t=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ts(e))throw new Error("Must provide fallback error with integer number code and string message.");const n=Aa(r,e);return t||delete n.stack,n}function Eo(r,e,t){try{Reflect.apply(r,e,t)}catch(n){setTimeout(()=>{throw n})}}function Ra(r){const e=r.length,t=new Array(e);for(let n=0;n<e;n+=1)t[n]=r[n];return t}class kr extends ea.eventsExports.EventEmitter{emit(e){let t=e==="error";const n=this._events;if(n!==void 0)t=t&&n.error===void 0;else if(!t)return!1;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(t){let d;if(s.length>0&&([d]=s),d instanceof Error)throw d;const w=new Error(`Unhandled error.${d?` (${d.message})`:""}`);throw w.context=d,w}const l=n[e];if(l===void 0)return!1;if(typeof l=="function")Eo(l,this,s);else{const d=l.length,w=Ra(l);for(let N=0;N<d;N+=1)Eo(w[N],this,s)}return!0}}class Yt extends Error{constructor(e){let{code:t,message:n,data:i}=e;if(!Number.isInteger(t))throw new Error("code must be an integer");if(!n||typeof n!="string")throw new Error("message must be string");super(n),ge(this,"code",void 0),ge(this,"data",void 0),this.code=t,i!==void 0&&(this.data=i)}toString(){return da({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Vn=function(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(n,i)=>{n||i.error?e(n||i.error):!t||Array.isArray(i)?r(i):r(i.result)}};function Ia(){const r={};function e(){return!1}const t=new kr;function n(d){const w=r[d.id];if(!w)throw new Error(`StreamMiddleware - Unknown response id "${d.id}"`);delete r[d.id],Object.assign(w.res,d),setTimeout(w.end)}function i(d){t.emit("notification",d)}function s(d,w,N){let O;try{!d.id?i(d):n(d)}catch(I){O=I}N(O)}const o=new qr.Duplex({objectMode:!0,read:e,write:s});return{events:t,middleware:(d,w,N,O)=>{o.push(d),r[d.id]={req:d,res:w,next:N,end:O}},stream:o}}function Ta(){return(r,e,t,n)=>{const i=r.id,s=Math.random().toString(36).slice(2);r.id=s,e.id=s,t(o=>{r.id=i,e.id=i,o()})}}class ut extends kr{constructor(){super(),ge(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,n){const i=[];let s=null,o=!1;for(const l of n)if([s,o]=await ut._runMiddleware(e,t,l,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,t,n,i){return new Promise(s=>{const o=d=>{const w=d||t.error;w&&(typeof w=="object"&&Object.keys(w).includes("stack")===!1&&(w.stack="Stack trace is not available."),t.error=mo(w,{shouldIncludeStack:!0,fallbackError:{message:w?.message||w?.toString(),code:w?.code||-32603,stack:w?.stack||"Stack trace is not available.",data:w?.data||w?.message||w?.toString()}})),s([w,!0])},l=d=>{t.error?o(t.error):(d&&(typeof d!="function"&&o(new Yt({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),i.push(d)),s([null,!1]))};try{n(e,t,l,o)}catch(d){o(d)}})}static async _runReturnHandlers(e){for(const t of e)await new Promise((n,i)=>{t(s=>s?i(s):n())})}static _checkForCompletion(e,t,n){if(!("result"in t)&&!("error"in t))throw new Yt({code:-32603,message:"Response has no error or result for request"});if(!n)throw new Yt({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&typeof t!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,n,i)=>{try{const[s,o,l]=await ut._runAllMiddleware(e,t,this._middleware);return o?(await ut._runReturnHandlers(l),i(s)):n(async d=>{try{await ut._runReturnHandlers(l)}catch(w){return d(w)}return d()})}catch(s){return i(s)}}}async _handleBatch(e,t){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,n):n}catch(n){if(t)return t(n);throw n}}_promiseHandle(e){return new Promise((t,n)=>{this._handle(e,(i,s)=>{i&&s===void 0?n(i):t(s)}).catch(n)})}async _handle(e,t){if(!e||Array.isArray(e)||typeof e!="object"){const k=new Yt({code:-32603,message:"request must be plain object"});return t(k,{id:void 0,jsonrpc:"2.0",error:k})}if(typeof e.method!="string"){const k=new Yt({code:-32603,message:"method must be string"});return t(k,{id:e.id,jsonrpc:"2.0",error:k})}const n=Ye({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(k){s=k}if(s&&(delete i.result,!i.error)){var o,l,d,w,N,O,I;typeof s=="object"&&Object.keys(s).includes("stack")===!1&&(s.stack="Stack trace is not available."),i.error=mo(s,{shouldIncludeStack:!0,fallbackError:{message:((o=s)===null||o===void 0?void 0:o.message)||((l=s)===null||l===void 0?void 0:l.toString()),code:((d=s)===null||d===void 0?void 0:d.code)||-32603,stack:((w=s)===null||w===void 0?void 0:w.stack)||"Stack trace is not available.",data:((N=s)===null||N===void 0?void 0:N.data)||((O=s)===null||O===void 0?void 0:O.message)||((I=s)===null||I===void 0?void 0:I.toString())}})}return t(s,i)}async _processRequest(e,t){const[n,i,s]=await ut._runAllMiddleware(e,t,this._middleware);if(ut._checkForCompletion(e,t,i),await ut._runReturnHandlers(s),n)throw n}}class xa extends qr.Duplex{constructor(e){let{parent:t,name:n}=e;super({objectMode:!0}),ge(this,"_parent",void 0),ge(this,"_name",void 0),this._parent=t,this._name=n}_read(){}_write(e,t,n){this._parent.push({name:this._name,data:e}),n()}}const So=Symbol("IGNORE_SUBSTREAM");class Oa extends qr.Duplex{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(Ye(Ye({},e),{},{objectMode:!0})),ge(this,"_substreams",void 0),ge(this,"getStream",void 0),this._substreams={}}createStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new xa({parent:this,name:e});return this._substreams[e]=t,Na(this,n=>t.destroy(n||void 0)),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=So}_read(){}_write(e,t,n){const{name:i,data:s}=e;if(!i)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();const o=this._substreams[i];return o?(o!==So&&o.push(s),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${i}"`),n())}}function Na(r,e){const t=wa(e);lo(r,{readable:!1},t),lo(r,{writable:!1},t)}var Jt={exports:{}};Jt.exports;var vo;function Ca(){return vo||(vo=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",i=800,s=16,o=9007199254740991,l="[object Arguments]",d="[object Array]",w="[object AsyncFunction]",N="[object Boolean]",O="[object Date]",I="[object Error]",k="[object Function]",B="[object GeneratorFunction]",y="[object Map]",b="[object Number]",u="[object Null]",c="[object Object]",v="[object Proxy]",G="[object RegExp]",$="[object Set]",J="[object String]",X="[object Undefined]",a="[object WeakMap]",m="[object ArrayBuffer]",f="[object DataView]",g="[object Float32Array]",_="[object Float64Array]",h="[object Int8Array]",C="[object Int16Array]",p="[object Int32Array]",A="[object Uint8Array]",P="[object Uint8ClampedArray]",E="[object Uint16Array]",M="[object Uint32Array]",S=/[\\^$.*+?()[\]{}|]/g,j=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,W={};W[g]=W[_]=W[h]=W[C]=W[p]=W[A]=W[P]=W[E]=W[M]=!0,W[l]=W[d]=W[m]=W[N]=W[f]=W[O]=W[I]=W[k]=W[y]=W[b]=W[c]=W[G]=W[$]=W[J]=W[a]=!1;var ee=typeof be.commonjsGlobal=="object"&&be.commonjsGlobal&&be.commonjsGlobal.Object===Object&&be.commonjsGlobal,Q=typeof self=="object"&&self&&self.Object===Object&&self,le=ee||Q||Function("return this")(),ue=e&&!e.nodeType&&e,z=ue&&!0&&r&&!r.nodeType&&r,V=z&&z.exports===ue,oe=V&&ee.process,ce=(function(){try{var T=z&&z.require&&z.require("util").types;return T||oe&&oe.binding&&oe.binding("util")}catch{}})(),fe=ce&&ce.isTypedArray;function L(T,U,H){switch(H.length){case 0:return T.call(U);case 1:return T.call(U,H[0]);case 2:return T.call(U,H[0],H[1]);case 3:return T.call(U,H[0],H[1],H[2])}return T.apply(U,H)}function D(T,U){for(var H=-1,he=Array(T);++H<T;)he[H]=U(H);return he}function F(T){return function(U){return T(U)}}function ne(T,U){return T?.[U]}function se(T,U){return function(H){return T(U(H))}}var ie=Array.prototype,q=Function.prototype,Z=Object.prototype,re=le["__core-js_shared__"],Y=q.toString,we=Z.hasOwnProperty,Le=(function(){var T=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""})(),_e=Z.toString,De=Y.call(Object),Oe=RegExp("^"+Y.call(we).replace(S,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=V?le.Buffer:void 0,Je=le.Symbol,Et=le.Uint8Array;Be&&Be.allocUnsafe;var Me=se(Object.getPrototypeOf,Object),ar=Object.create,$r=Z.propertyIsEnumerable,lr=ie.splice,it=Je?Je.toStringTag:void 0,Lt=(function(){try{var T=Yr(Object,"defineProperty");return T({},"",{}),T}catch{}})(),Hr=Be?Be.isBuffer:void 0,jt=Math.max,ur=Date.now,fr=Yr(le,"Map"),gt=Yr(Object,"create"),Wt=(function(){function T(){}return function(U){if(!vt(U))return{};if(ar)return ar(U);T.prototype=U;var H=new T;return T.prototype=void 0,H}})();function ot(T){var U=-1,H=T==null?0:T.length;for(this.clear();++U<H;){var he=T[U];this.set(he[0],he[1])}}function zr(){this.__data__=gt?gt(null):{},this.size=0}function Ft(T){var U=this.has(T)&&delete this.__data__[T];return this.size-=U?1:0,U}function cr(T){var U=this.__data__;if(gt){var H=U[T];return H===n?void 0:H}return we.call(U,T)?U[T]:void 0}function R(T){var U=this.__data__;return gt?U[T]!==void 0:we.call(U,T)}function x(T,U){var H=this.__data__;return this.size+=this.has(T)?0:1,H[T]=gt&&U===void 0?n:U,this}ot.prototype.clear=zr,ot.prototype.delete=Ft,ot.prototype.get=cr,ot.prototype.has=R,ot.prototype.set=x;function te(T){var U=-1,H=T==null?0:T.length;for(this.clear();++U<H;){var he=T[U];this.set(he[0],he[1])}}function ae(){this.__data__=[],this.size=0}function de(T){var U=this.__data__,H=wr(U,T);if(H<0)return!1;var he=U.length-1;return H==he?U.pop():lr.call(U,H,1),--this.size,!0}function Ne(T){var U=this.__data__,H=wr(U,T);return H<0?void 0:U[H][1]}function ke(T){return wr(this.__data__,T)>-1}function dr(T,U){var H=this.__data__,he=wr(H,T);return he<0?(++this.size,H.push([T,U])):H[he][1]=U,this}te.prototype.clear=ae,te.prototype.delete=de,te.prototype.get=Ne,te.prototype.has=ke,te.prototype.set=dr;function Ue(T){var U=-1,H=T==null?0:T.length;for(this.clear();++U<H;){var he=T[U];this.set(he[0],he[1])}}function hr(){this.size=0,this.__data__={hash:new ot,map:new(fr||te),string:new ot}}function Gr(T){var U=yr(this,T).delete(T);return this.size-=U?1:0,U}function gr(T){return yr(this,T).get(T)}function pr(T){return yr(this,T).has(T)}function $t(T,U){var H=yr(this,T),he=H.size;return H.set(T,U),this.size+=H.size==he?0:1,this}Ue.prototype.clear=hr,Ue.prototype.delete=Gr,Ue.prototype.get=gr,Ue.prototype.has=pr,Ue.prototype.set=$t;function tt(T){var U=this.__data__=new te(T);this.size=U.size}function Ht(){this.__data__=new te,this.size=0}function St(T){var U=this.__data__,H=U.delete(T);return this.size=U.size,H}function st(T){return this.__data__.get(T)}function Ze(T){return this.__data__.has(T)}function ms(T,U){var H=this.__data__;if(H instanceof te){var he=H.__data__;if(!fr||he.length<t-1)return he.push([T,U]),this.size=++H.size,this;H=this.__data__=new Ue(he)}return H.set(T,U),this.size=H.size,this}tt.prototype.clear=Ht,tt.prototype.delete=St,tt.prototype.get=st,tt.prototype.has=Ze,tt.prototype.set=ms;function Es(T,U){var H=Xr(T),he=!H&&Zr(T),ye=!H&&!he&&bi(T),Ee=!H&&!he&&!ye&&_i(T),Ae=H||he||ye||Ee,me=Ae?D(T.length,String):[],Re=me.length;for(var Xe in T)Ae&&(Xe=="length"||ye&&(Xe=="offset"||Xe=="parent")||Ee&&(Xe=="buffer"||Xe=="byteLength"||Xe=="byteOffset")||pi(Xe,Re))||me.push(Xe);return me}function Vr(T,U,H){(H!==void 0&&!_r(T[U],H)||H===void 0&&!(U in T))&&Kr(T,U,H)}function Ss(T,U,H){var he=T[U];(!(we.call(T,U)&&_r(he,H))||H===void 0&&!(U in T))&&Kr(T,U,H)}function wr(T,U){for(var H=T.length;H--;)if(_r(T[H][0],U))return H;return-1}function Kr(T,U,H){U=="__proto__"&&Lt?Lt(T,U,{configurable:!0,enumerable:!0,value:H,writable:!0}):T[U]=H}var vs=Ds();function br(T){return T==null?T===void 0?X:u:it&&it in Object(T)?qs(T):$s(T)}function hi(T){return zt(T)&&br(T)==l}function As(T){if(!vt(T)||Ws(T))return!1;var U=en(T)?Oe:j;return U.test(Vs(T))}function Rs(T){return zt(T)&&yi(T.length)&&!!W[br(T)]}function Is(T){if(!vt(T))return Fs(T);var U=wi(T),H=[];for(var he in T)he=="constructor"&&(U||!we.call(T,he))||H.push(he);return H}function gi(T,U,H,he,ye){T!==U&&vs(U,function(Ee,Ae){if(ye||(ye=new tt),vt(Ee))Ts(T,U,Ae,H,gi,he,ye);else{var me=he?he(Jr(T,Ae),Ee,Ae+"",T,U,ye):void 0;me===void 0&&(me=Ee),Vr(T,Ae,me)}},mi)}function Ts(T,U,H,he,ye,Ee,Ae){var me=Jr(T,H),Re=Jr(U,H),Xe=Ae.get(Re);if(Xe){Vr(T,H,Xe);return}var $e=Ee?Ee(me,Re,H+"",T,U,Ae):void 0,Gt=$e===void 0;if(Gt){var tn=Xr(Re),rn=!tn&&bi(Re),Si=!tn&&!rn&&_i(Re);$e=Re,tn||rn||Si?Xr(me)?$e=me:Ks(me)?$e=Ls(me):rn?(Gt=!1,$e=Ns(Re)):Si?(Gt=!1,$e=Ps(Re)):$e=[]:Ys(Re)||Zr(Re)?($e=me,Zr(me)?$e=Js(me):(!vt(me)||en(me))&&($e=ks(Re))):Gt=!1}Gt&&(Ae.set(Re,$e),ye($e,Re,he,Ee,Ae),Ae.delete(Re)),Vr(T,H,$e)}function xs(T,U){return zs(Hs(T,U,Ei),T+"")}var Os=Lt?function(T,U){return Lt(T,"toString",{configurable:!0,enumerable:!1,value:Xs(U),writable:!0})}:Ei;function Ns(T,U){return T.slice()}function Cs(T){var U=new T.constructor(T.byteLength);return new Et(U).set(new Et(T)),U}function Ps(T,U){var H=Cs(T.buffer);return new T.constructor(H,T.byteOffset,T.length)}function Ls(T,U){var H=-1,he=T.length;for(U||(U=Array(he));++H<he;)U[H]=T[H];return U}function Bs(T,U,H,he){var ye=!H;H||(H={});for(var Ee=-1,Ae=U.length;++Ee<Ae;){var me=U[Ee],Re=void 0;Re===void 0&&(Re=T[me]),ye?Kr(H,me,Re):Ss(H,me,Re)}return H}function Ms(T){return xs(function(U,H){var he=-1,ye=H.length,Ee=ye>1?H[ye-1]:void 0,Ae=ye>2?H[2]:void 0;for(Ee=T.length>3&&typeof Ee=="function"?(ye--,Ee):void 0,Ae&&Us(H[0],H[1],Ae)&&(Ee=ye<3?void 0:Ee,ye=1),U=Object(U);++he<ye;){var me=H[he];me&&T(U,me,he,Ee)}return U})}function Ds(T){return function(U,H,he){for(var ye=-1,Ee=Object(U),Ae=he(U),me=Ae.length;me--;){var Re=Ae[++ye];if(H(Ee[Re],Re,Ee)===!1)break}return U}}function yr(T,U){var H=T.__data__;return js(U)?H[typeof U=="string"?"string":"hash"]:H.map}function Yr(T,U){var H=ne(T,U);return As(H)?H:void 0}function qs(T){var U=we.call(T,it),H=T[it];try{T[it]=void 0;var he=!0}catch{}var ye=_e.call(T);return he&&(U?T[it]=H:delete T[it]),ye}function ks(T){return typeof T.constructor=="function"&&!wi(T)?Wt(Me(T)):{}}function pi(T,U){var H=typeof T;return U=U??o,!!U&&(H=="number"||H!="symbol"&&K.test(T))&&T>-1&&T%1==0&&T<U}function Us(T,U,H){if(!vt(H))return!1;var he=typeof U;return(he=="number"?Qr(H)&&pi(U,H.length):he=="string"&&U in H)?_r(H[U],T):!1}function js(T){var U=typeof T;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?T!=="__proto__":T===null}function Ws(T){return!!Le&&Le in T}function wi(T){var U=T&&T.constructor,H=typeof U=="function"&&U.prototype||Z;return T===H}function Fs(T){var U=[];if(T!=null)for(var H in Object(T))U.push(H);return U}function $s(T){return _e.call(T)}function Hs(T,U,H){return U=jt(U===void 0?T.length-1:U,0),function(){for(var he=arguments,ye=-1,Ee=jt(he.length-U,0),Ae=Array(Ee);++ye<Ee;)Ae[ye]=he[U+ye];ye=-1;for(var me=Array(U+1);++ye<U;)me[ye]=he[ye];return me[U]=H(Ae),L(T,this,me)}}function Jr(T,U){if(!(U==="constructor"&&typeof T[U]=="function")&&U!="__proto__")return T[U]}var zs=Gs(Os);function Gs(T){var U=0,H=0;return function(){var he=ur(),ye=s-(he-H);if(H=he,ye>0){if(++U>=i)return arguments[0]}else U=0;return T.apply(void 0,arguments)}}function Vs(T){if(T!=null){try{return Y.call(T)}catch{}try{return T+""}catch{}}return""}function _r(T,U){return T===U||T!==T&&U!==U}var Zr=hi((function(){return arguments})())?hi:function(T){return zt(T)&&we.call(T,"callee")&&!$r.call(T,"callee")},Xr=Array.isArray;function Qr(T){return T!=null&&yi(T.length)&&!en(T)}function Ks(T){return zt(T)&&Qr(T)}var bi=Hr||Qs;function en(T){if(!vt(T))return!1;var U=br(T);return U==k||U==B||U==w||U==v}function yi(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=o}function vt(T){var U=typeof T;return T!=null&&(U=="object"||U=="function")}function zt(T){return T!=null&&typeof T=="object"}function Ys(T){if(!zt(T)||br(T)!=c)return!1;var U=Me(T);if(U===null)return!0;var H=we.call(U,"constructor")&&U.constructor;return typeof H=="function"&&H instanceof H&&Y.call(H)==De}var _i=fe?F(fe):Rs;function Js(T){return Bs(T,mi(T))}function mi(T){return Qr(T)?Es(T):Is(T)}var Zs=Ms(function(T,U,H){gi(T,U,H)});function Xs(T){return function(){return T}}function Ei(T){return T}function Qs(){return!1}r.exports=Zs})(Jt,Jt.exports)),Jt.exports}Ca();var Cr={exports:{}},Pa=Cr.exports,Ao;function La(){return Ao||(Ao=1,(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(Pa,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function l(y,b){var u=y[b];if(typeof u.bind=="function")return u.bind(y);try{return Function.prototype.bind.call(u,y)}catch{return function(){return Function.prototype.apply.apply(u,[y,arguments])}}}function d(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function w(y){return y==="debug"&&(y="log"),typeof console===t?!1:y==="trace"&&n?d:console[y]!==void 0?l(console,y):console.log!==void 0?l(console,"log"):e}function N(){for(var y=this.getLevel(),b=0;b<i.length;b++){var u=i[b];this[u]=b<y?e:this.methodFactory(u,y,this.name)}if(this.log=this.debug,typeof console===t&&y<this.levels.SILENT)return"No console available for logging"}function O(y){return function(){typeof console!==t&&(N.call(this),this[y].apply(this,arguments))}}function I(y,b,u){return w(y)||O.apply(this,arguments)}function k(y,b){var u=this,c,v,G,$="loglevel";typeof y=="string"?$+=":"+y:typeof y=="symbol"&&($=void 0);function J(g){var _=(i[g]||"silent").toUpperCase();if(!(typeof window===t||!$)){try{window.localStorage[$]=_;return}catch{}try{window.document.cookie=encodeURIComponent($)+"="+_+";"}catch{}}}function X(){var g;if(!(typeof window===t||!$)){try{g=window.localStorage[$]}catch{}if(typeof g===t)try{var _=window.document.cookie,h=encodeURIComponent($),C=_.indexOf(h+"=");C!==-1&&(g=/^([^;]+)/.exec(_.slice(C+h.length+1))[1])}catch{}return u.levels[g]===void 0&&(g=void 0),g}}function a(){if(!(typeof window===t||!$)){try{window.localStorage.removeItem($)}catch{}try{window.document.cookie=encodeURIComponent($)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function m(g){var _=g;if(typeof _=="string"&&u.levels[_.toUpperCase()]!==void 0&&(_=u.levels[_.toUpperCase()]),typeof _=="number"&&_>=0&&_<=u.levels.SILENT)return _;throw new TypeError("log.setLevel() called with invalid level: "+g)}u.name=y,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=b||I,u.getLevel=function(){return G??v??c},u.setLevel=function(g,_){return G=m(g),_!==!1&&J(G),N.call(u)},u.setDefaultLevel=function(g){v=m(g),X()||u.setLevel(g,!1)},u.resetLevel=function(){G=null,a(),N.call(u)},u.enableAll=function(g){u.setLevel(u.levels.TRACE,g)},u.disableAll=function(g){u.setLevel(u.levels.SILENT,g)},u.rebuild=function(){if(o!==u&&(c=m(o.getLevel())),N.call(u),o===u)for(var g in s)s[g].rebuild()},c=m(o?o.getLevel():"WARN");var f=X();f!=null&&(G=m(f)),N.call(u)}o=new k,o.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var u=s[b];return u||(u=s[b]=new k(b,o.methodFactory)),u};var B=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=B),o},o.getLoggers=function(){return s},o.default=o,o})})(Cr)),Cr.exports}var rs=La();const Pr=be.getDefaultExportFromCjs(rs),Ba=Pr.getLogger("http-helpers");Ba.setLevel(rs.levels.INFO);function Ro(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}function Ma(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function Ur(r,...e){if(!Ma(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}function Da(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ro(r.outputLen),Ro(r.blockLen)}function Lr(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function qa(r,e){Ur(r);const t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const Un=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jn=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),rt=(r,e)=>r<<32-e|r>>>e;new Uint8Array(new Uint32Array([287454020]).buffer)[0];function ka(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function si(r){return typeof r=="string"&&(r=ka(r)),Ur(r),r}function Ua(...r){let e=0;for(let n=0;n<r.length;n++){const i=r[n];Ur(i),e+=i.length}const t=new Uint8Array(e);for(let n=0,i=0;n<r.length;n++){const s=r[n];t.set(s,i),i+=s.length}return t}class ns{clone(){return this._cloneInto()}}function ja(r){const e=n=>r().update(si(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function Wa(r=32){if(Un&&typeof Un.getRandomValues=="function")return Un.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Fa(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),l=Number(t&s),d=n?4:0,w=n?0:4;r.setUint32(e+d,o,n),r.setUint32(e+w,l,n)}const $a=(r,e,t)=>r&e^~r&t,Ha=(r,e,t)=>r&e^r&t^e&t;class za extends ns{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=jn(this.buffer)}update(e){Lr(this);const{view:t,buffer:n,blockLen:i}=this;e=si(e);const s=e.length;for(let o=0;o<s;){const l=Math.min(i-this.pos,s-o);if(l===i){const d=jn(e);for(;i<=s-o;o+=i)this.process(d,o);continue}n.set(e.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Lr(this),qa(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let O=o;O<i;O++)t[O]=0;Fa(n,i-8,BigInt(this.length*8),s),this.process(n,0);const l=jn(e),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const w=d/4,N=this.get();if(w>N.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O<w;O++)l.setUint32(4*O,N[O],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:i,finished:s,destroyed:o,pos:l}=this;return e.length=i,e.pos=l,e.finished=s,e.destroyed=o,i%t&&e.buffer.set(n),e}}const Ga=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),wt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bt=new Uint32Array(64);class Va extends za{constructor(){super(64,32,8,!1),this.A=wt[0]|0,this.B=wt[1]|0,this.C=wt[2]|0,this.D=wt[3]|0,this.E=wt[4]|0,this.F=wt[5]|0,this.G=wt[6]|0,this.H=wt[7]|0}get(){const{A:e,B:t,C:n,D:i,E:s,F:o,G:l,H:d}=this;return[e,t,n,i,s,o,l,d]}set(e,t,n,i,s,o,l,d){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=l|0,this.H=d|0}process(e,t){for(let O=0;O<16;O++,t+=4)bt[O]=e.getUint32(t,!1);for(let O=16;O<64;O++){const I=bt[O-15],k=bt[O-2],B=rt(I,7)^rt(I,18)^I>>>3,y=rt(k,17)^rt(k,19)^k>>>10;bt[O]=y+bt[O-7]+B+bt[O-16]|0}let{A:n,B:i,C:s,D:o,E:l,F:d,G:w,H:N}=this;for(let O=0;O<64;O++){const I=rt(l,6)^rt(l,11)^rt(l,25),k=N+I+$a(l,d,w)+Ga[O]+bt[O]|0,y=(rt(n,2)^rt(n,13)^rt(n,22))+Ha(n,i,s)|0;N=w,w=d,d=l,l=o+k|0,o=s,s=i,i=n,n=k+y|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,l=l+this.E|0,d=d+this.F|0,w=w+this.G|0,N=N+this.H|0,this.set(n,i,s,o,l,d,w,N)}roundClean(){bt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ka=ja(()=>new Va);class is extends ns{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Da(e);const n=si(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Lr(this),this.iHash.update(e),this}digestInto(e){Lr(this),Ur(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:l}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=l,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const os=(r,e,t)=>new is(r,e).update(t).digest();os.create=(r,e)=>new is(r,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ss=BigInt(0),jr=BigInt(1),Ya=BigInt(2);function Nt(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function nr(r){if(!Nt(r))throw new Error("Uint8Array expected")}const Ja=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Dt(r){nr(r);let e="";for(let t=0;t<r.length;t++)e+=Ja[r[t]];return e}function as(r){const e=r.toString(16);return e.length&1?`0${e}`:e}function ai(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}const lt={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Io(r){if(r>=lt._0&&r<=lt._9)return r-lt._0;if(r>=lt._A&&r<=lt._F)return r-(lt._A-10);if(r>=lt._a&&r<=lt._f)return r-(lt._a-10)}function qt(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(t);for(let i=0,s=0;i<t;i++,s+=2){const o=Io(r.charCodeAt(s)),l=Io(r.charCodeAt(s+1));if(o===void 0||l===void 0){const d=r[s]+r[s+1];throw new Error('hex string expected, got non-hex character "'+d+'" at index '+s)}n[i]=o*16+l}return n}function Ot(r){return ai(Dt(r))}function li(r){return nr(r),ai(Dt(Uint8Array.from(r).reverse()))}function kt(r,e){return qt(r.toString(16).padStart(e*2,"0"))}function ui(r,e){return kt(r,e).reverse()}function Za(r){return qt(as(r))}function et(r,e,t){let n;if(typeof e=="string")try{n=qt(e)}catch(s){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${s}`)}else if(Nt(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function er(...r){let e=0;for(let n=0;n<r.length;n++){const i=r[n];nr(i),e+=i.length}const t=new Uint8Array(e);for(let n=0,i=0;n<r.length;n++){const s=r[n];t.set(s,i),i+=s.length}return t}function Xa(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function Qa(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function el(r){let e;for(e=0;r>ss;r>>=jr,e+=1);return e}function tl(r,e){return r>>BigInt(e)&jr}function rl(r,e,t){return r|(t?jr:ss)<<BigInt(e)}const fi=r=>(Ya<<BigInt(r-1))-jr,Wn=r=>new Uint8Array(r),To=r=>Uint8Array.from(r);function ls(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=Wn(r),i=Wn(r),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},l=(...O)=>t(i,n,...O),d=(O=Wn())=>{i=l(To([0]),O),n=l(),O.length!==0&&(i=l(To([1]),O),n=l())},w=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let O=0;const I=[];for(;O<e;){n=l();const k=n.slice();I.push(k),O+=n.length}return er(...I)};return(O,I)=>{o(),d(O);let k;for(;!(k=I(w()));)d();return o(),k}}const nl={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||Nt(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function ir(r,e,t={}){const n=(i,s,o)=>{const l=nl[s];if(typeof l!="function")throw new Error(`Invalid validator "${s}", expected function`);const d=r[i];if(!(o&&d===void 0)&&!l(d,r))throw new Error(`Invalid param ${String(i)}=${d} (${typeof d}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(t))n(i,s,!0);return r}const il=Object.freeze(Object.defineProperty({__proto__:null,abytes:nr,bitGet:tl,bitLen:el,bitMask:fi,bitSet:rl,bytesToHex:Dt,bytesToNumberBE:Ot,bytesToNumberLE:li,concatBytes:er,createHmacDrbg:ls,ensureBytes:et,equalBytes:Xa,hexToBytes:qt,hexToNumber:ai,isBytes:Nt,numberToBytesBE:kt,numberToBytesLE:ui,numberToHexUnpadded:as,numberToVarBytesBE:Za,utf8ToBytes:Qa,validateObject:ir},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pe=BigInt(0),xe=BigInt(1),Tt=BigInt(2),ol=BigInt(3),Kn=BigInt(4),xo=BigInt(5),Oo=BigInt(8);BigInt(9);BigInt(16);function We(r,e){const t=r%e;return t>=Pe?t:e+t}function sl(r,e,t){if(t<=Pe||e<Pe)throw new Error("Expected power/modulo > 0");if(t===xe)return Pe;let n=xe;for(;e>Pe;)e&xe&&(n=n*r%t),r=r*r%t,e>>=xe;return n}function ze(r,e,t){let n=r;for(;e-- >Pe;)n*=n,n%=t;return n}function Yn(r,e){if(r===Pe||e<=Pe)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=We(r,e),n=e,i=Pe,s=xe;for(;t!==Pe;){const l=n/t,d=n%t,w=i-s*l;n=t,t=d,i=s,s=w}if(n!==xe)throw new Error("invert: does not exist");return We(i,e)}function al(r){const e=(r-xe)/Tt;let t,n,i;for(t=r-xe,n=0;t%Tt===Pe;t/=Tt,n++);for(i=Tt;i<r&&sl(i,e,r)!==r-xe;i++);if(n===1){const o=(r+xe)/Kn;return function(d,w){const N=d.pow(w,o);if(!d.eql(d.sqr(N),w))throw new Error("Cannot find square root");return N}}const s=(t+xe)/Tt;return function(l,d){if(l.pow(d,e)===l.neg(l.ONE))throw new Error("Cannot find square root");let w=n,N=l.pow(l.mul(l.ONE,i),t),O=l.pow(d,s),I=l.pow(d,t);for(;!l.eql(I,l.ONE);){if(l.eql(I,l.ZERO))return l.ZERO;let k=1;for(let y=l.sqr(I);k<w&&!l.eql(y,l.ONE);k++)y=l.sqr(y);const B=l.pow(N,xe<<BigInt(w-k-1));N=l.sqr(B),O=l.mul(O,B),I=l.mul(I,N),w=k}return O}}function ll(r){if(r%Kn===ol){const e=(r+xe)/Kn;return function(n,i){const s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(r%Oo===xo){const e=(r-xo)/Oo;return function(n,i){const s=n.mul(i,Tt),o=n.pow(s,e),l=n.mul(i,o),d=n.mul(n.mul(l,Tt),o),w=n.mul(l,n.sub(d,n.ONE));if(!n.eql(n.sqr(w),i))throw new Error("Cannot find square root");return w}}return al(r)}const ul=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function fl(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=ul.reduce((n,i)=>(n[i]="function",n),e);return ir(r,t)}function cl(r,e,t){if(t<Pe)throw new Error("Expected power > 0");if(t===Pe)return r.ONE;if(t===xe)return e;let n=r.ONE,i=e;for(;t>Pe;)t&xe&&(n=r.mul(n,i)),i=r.sqr(i),t>>=xe;return n}function dl(r,e){const t=new Array(e.length),n=e.reduce((s,o,l)=>r.is0(o)?s:(t[l]=s,r.mul(s,o)),r.ONE),i=r.inv(n);return e.reduceRight((s,o,l)=>r.is0(o)?s:(t[l]=r.mul(s,t[l]),r.mul(s,o)),i),t}function us(r,e){const t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function hl(r,e,t=!1,n={}){if(r<=Pe)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:i,nByteLength:s}=us(r,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=ll(r),l=Object.freeze({ORDER:r,BITS:i,BYTES:s,MASK:fi(i),ZERO:Pe,ONE:xe,create:d=>We(d,r),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return Pe<=d&&d<r},is0:d=>d===Pe,isOdd:d=>(d&xe)===xe,neg:d=>We(-d,r),eql:(d,w)=>d===w,sqr:d=>We(d*d,r),add:(d,w)=>We(d+w,r),sub:(d,w)=>We(d-w,r),mul:(d,w)=>We(d*w,r),pow:(d,w)=>cl(l,d,w),div:(d,w)=>We(d*Yn(w,r),r),sqrN:d=>d*d,addN:(d,w)=>d+w,subN:(d,w)=>d-w,mulN:(d,w)=>d*w,inv:d=>Yn(d,r),sqrt:n.sqrt||(d=>o(l,d)),invertBatch:d=>dl(l,d),cmov:(d,w,N)=>N?w:d,toBytes:d=>t?ui(d,s):kt(d,s),fromBytes:d=>{if(d.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${d.length}`);return t?li(d):Ot(d)}});return Object.freeze(l)}function fs(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function cs(r){const e=fs(r);return e+Math.ceil(e/2)}function gl(r,e,t=!1){const n=r.length,i=fs(e),s=cs(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=t?Ot(r):li(r),l=We(o,e-xe)+xe;return t?ui(l,i):kt(l,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pl=BigInt(0),Fn=BigInt(1);function wl(r,e){const t=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:t,unsafeLadder(i,s){let o=r.ZERO,l=i;for(;s>pl;)s&Fn&&(o=o.add(l)),l=l.double(),s>>=Fn;return o},precomputeWindow(i,s){const{windows:o,windowSize:l}=n(s),d=[];let w=i,N=w;for(let O=0;O<o;O++){N=w,d.push(N);for(let I=1;I<l;I++)N=N.add(w),d.push(N);w=N.double()}return d},wNAF(i,s,o){const{windows:l,windowSize:d}=n(i);let w=r.ZERO,N=r.BASE;const O=BigInt(2**i-1),I=2**i,k=BigInt(i);for(let B=0;B<l;B++){const y=B*d;let b=Number(o&O);o>>=k,b>d&&(b-=I,o+=Fn);const u=y,c=y+Math.abs(b)-1,v=B%2!==0,G=b<0;b===0?N=N.add(t(v,s[u])):w=w.add(t(G,s[c]))}return{p:w,f:N}},wNAFCached(i,s,o,l){const d=i._WINDOW_SIZE||1;let w=s.get(i);return w||(w=this.precomputeWindow(i,d),d!==1&&s.set(i,l(w))),this.wNAF(d,w,o)}}}function ds(r){return fl(r.Fp),ir(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...us(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function bl(r){const e=ds(r);ir(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:yl,hexToBytes:_l}=il,xt={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=xt;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:yl(n),l:r.subarray(t+2)}},toSig(r){const{Err:e}=xt,t=typeof r=="string"?_l(r):r;nr(t);let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=xt._parseInt(t.subarray(2)),{d:o,l}=xt._parseInt(s);if(l.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(r){const e=w=>Number.parseInt(w[0],16)&8?"00"+w:w,t=w=>{const N=w.toString(16);return N.length&1?`0${N}`:N},n=e(t(r.s)),i=e(t(r.r)),s=n.length/2,o=i.length/2,l=t(s),d=t(o);return`30${t(o+s+4)}02${d}${i}02${l}${n}`}},ft=BigInt(0),Ke=BigInt(1);BigInt(2);const No=BigInt(3);BigInt(4);function ml(r){const e=bl(r),{Fp:t}=e,n=e.toBytes||((B,y,b)=>{const u=y.toAffine();return er(Uint8Array.from([4]),t.toBytes(u.x),t.toBytes(u.y))}),i=e.fromBytes||(B=>{const y=B.subarray(1),b=t.fromBytes(y.subarray(0,t.BYTES)),u=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:b,y:u}});function s(B){const{a:y,b}=e,u=t.sqr(B),c=t.mul(u,B);return t.add(t.add(c,t.mul(B,y)),b)}if(!t.eql(t.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(B){return typeof B=="bigint"&&ft<B&&B<e.n}function l(B){if(!o(B))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function d(B){const{allowedPrivateKeyLengths:y,nByteLength:b,wrapPrivateKey:u,n:c}=e;if(y&&typeof B!="bigint"){if(Nt(B)&&(B=Dt(B)),typeof B!="string"||!y.includes(B.length))throw new Error("Invalid key");B=B.padStart(b*2,"0")}let v;try{v=typeof B=="bigint"?B:Ot(et("private key",B,b))}catch{throw new Error(`private key must be ${b} bytes, hex or bigint, not ${typeof B}`)}return u&&(v=We(v,c)),l(v),v}const w=new Map;function N(B){if(!(B instanceof O))throw new Error("ProjectivePoint expected")}class O{constructor(y,b,u){if(this.px=y,this.py=b,this.pz=u,y==null||!t.isValid(y))throw new Error("x required");if(b==null||!t.isValid(b))throw new Error("y required");if(u==null||!t.isValid(u))throw new Error("z required")}static fromAffine(y){const{x:b,y:u}=y||{};if(!y||!t.isValid(b)||!t.isValid(u))throw new Error("invalid affine point");if(y instanceof O)throw new Error("projective point not allowed");const c=v=>t.eql(v,t.ZERO);return c(b)&&c(u)?O.ZERO:new O(b,u,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const b=t.invertBatch(y.map(u=>u.pz));return y.map((u,c)=>u.toAffine(b[c])).map(O.fromAffine)}static fromHex(y){const b=O.fromAffine(i(et("pointHex",y)));return b.assertValidity(),b}static fromPrivateKey(y){return O.BASE.multiply(d(y))}_setWindowSize(y){this._WINDOW_SIZE=y,w.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:y,y:b}=this.toAffine();if(!t.isValid(y)||!t.isValid(b))throw new Error("bad point: x or y not FE");const u=t.sqr(b),c=s(y);if(!t.eql(u,c))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y}=this.toAffine();if(t.isOdd)return!t.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(y){N(y);const{px:b,py:u,pz:c}=this,{px:v,py:G,pz:$}=y,J=t.eql(t.mul(b,$),t.mul(v,c)),X=t.eql(t.mul(u,$),t.mul(G,c));return J&&X}negate(){return new O(this.px,t.neg(this.py),this.pz)}double(){const{a:y,b}=e,u=t.mul(b,No),{px:c,py:v,pz:G}=this;let $=t.ZERO,J=t.ZERO,X=t.ZERO,a=t.mul(c,c),m=t.mul(v,v),f=t.mul(G,G),g=t.mul(c,v);return g=t.add(g,g),X=t.mul(c,G),X=t.add(X,X),$=t.mul(y,X),J=t.mul(u,f),J=t.add($,J),$=t.sub(m,J),J=t.add(m,J),J=t.mul($,J),$=t.mul(g,$),X=t.mul(u,X),f=t.mul(y,f),g=t.sub(a,f),g=t.mul(y,g),g=t.add(g,X),X=t.add(a,a),a=t.add(X,a),a=t.add(a,f),a=t.mul(a,g),J=t.add(J,a),f=t.mul(v,G),f=t.add(f,f),a=t.mul(f,g),$=t.sub($,a),X=t.mul(f,m),X=t.add(X,X),X=t.add(X,X),new O($,J,X)}add(y){N(y);const{px:b,py:u,pz:c}=this,{px:v,py:G,pz:$}=y;let J=t.ZERO,X=t.ZERO,a=t.ZERO;const m=e.a,f=t.mul(e.b,No);let g=t.mul(b,v),_=t.mul(u,G),h=t.mul(c,$),C=t.add(b,u),p=t.add(v,G);C=t.mul(C,p),p=t.add(g,_),C=t.sub(C,p),p=t.add(b,c);let A=t.add(v,$);return p=t.mul(p,A),A=t.add(g,h),p=t.sub(p,A),A=t.add(u,c),J=t.add(G,$),A=t.mul(A,J),J=t.add(_,h),A=t.sub(A,J),a=t.mul(m,p),J=t.mul(f,h),a=t.add(J,a),J=t.sub(_,a),a=t.add(_,a),X=t.mul(J,a),_=t.add(g,g),_=t.add(_,g),h=t.mul(m,h),p=t.mul(f,p),_=t.add(_,h),h=t.sub(g,h),h=t.mul(m,h),p=t.add(p,h),g=t.mul(_,p),X=t.add(X,g),g=t.mul(A,p),J=t.mul(C,J),J=t.sub(J,g),g=t.mul(C,_),a=t.mul(A,a),a=t.add(a,g),new O(J,X,a)}subtract(y){return this.add(y.negate())}is0(){return this.equals(O.ZERO)}wNAF(y){return k.wNAFCached(this,w,y,b=>{const u=t.invertBatch(b.map(c=>c.pz));return b.map((c,v)=>c.toAffine(u[v])).map(O.fromAffine)})}multiplyUnsafe(y){const b=O.ZERO;if(y===ft)return b;if(l(y),y===Ke)return this;const{endo:u}=e;if(!u)return k.unsafeLadder(this,y);let{k1neg:c,k1:v,k2neg:G,k2:$}=u.splitScalar(y),J=b,X=b,a=this;for(;v>ft||$>ft;)v&Ke&&(J=J.add(a)),$&Ke&&(X=X.add(a)),a=a.double(),v>>=Ke,$>>=Ke;return c&&(J=J.negate()),G&&(X=X.negate()),X=new O(t.mul(X.px,u.beta),X.py,X.pz),J.add(X)}multiply(y){l(y);let b=y,u,c;const{endo:v}=e;if(v){const{k1neg:G,k1:$,k2neg:J,k2:X}=v.splitScalar(b);let{p:a,f:m}=this.wNAF($),{p:f,f:g}=this.wNAF(X);a=k.constTimeNegate(G,a),f=k.constTimeNegate(J,f),f=new O(t.mul(f.px,v.beta),f.py,f.pz),u=a.add(f),c=m.add(g)}else{const{p:G,f:$}=this.wNAF(b);u=G,c=$}return O.normalizeZ([u,c])[0]}multiplyAndAddUnsafe(y,b,u){const c=O.BASE,v=($,J)=>J===ft||J===Ke||!$.equals(c)?$.multiplyUnsafe(J):$.multiply(J),G=v(this,b).add(v(y,u));return G.is0()?void 0:G}toAffine(y){const{px:b,py:u,pz:c}=this,v=this.is0();y==null&&(y=v?t.ONE:t.inv(c));const G=t.mul(b,y),$=t.mul(u,y),J=t.mul(c,y);if(v)return{x:t.ZERO,y:t.ZERO};if(!t.eql(J,t.ONE))throw new Error("invZ was invalid");return{x:G,y:$}}isTorsionFree(){const{h:y,isTorsionFree:b}=e;if(y===Ke)return!0;if(b)return b(O,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:b}=e;return y===Ke?this:b?b(O,this):this.multiplyUnsafe(e.h)}toRawBytes(y=!0){return this.assertValidity(),n(O,this,y)}toHex(y=!0){return Dt(this.toRawBytes(y))}}O.BASE=new O(e.Gx,e.Gy,t.ONE),O.ZERO=new O(t.ZERO,t.ONE,t.ZERO);const I=e.nBitLength,k=wl(O,e.endo?Math.ceil(I/2):I);return{CURVE:e,ProjectivePoint:O,normPrivateKeyToScalar:d,weierstrassEquation:s,isWithinCurveOrder:o}}function El(r){const e=ds(r);return ir(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Sl(r){const e=El(r),{Fp:t,n}=e,i=t.BYTES+1,s=2*t.BYTES+1;function o(p){return ft<p&&p<t.ORDER}function l(p){return We(p,n)}function d(p){return Yn(p,n)}const{ProjectivePoint:w,normPrivateKeyToScalar:N,weierstrassEquation:O,isWithinCurveOrder:I}=ml({...e,toBytes(p,A,P){const E=A.toAffine(),M=t.toBytes(E.x),S=er;return P?S(Uint8Array.from([A.hasEvenY()?2:3]),M):S(Uint8Array.from([4]),M,t.toBytes(E.y))},fromBytes(p){const A=p.length,P=p[0],E=p.subarray(1);if(A===i&&(P===2||P===3)){const M=Ot(E);if(!o(M))throw new Error("Point is not on curve");const S=O(M);let j;try{j=t.sqrt(S)}catch(ee){const Q=ee instanceof Error?": "+ee.message:"";throw new Error("Point is not on curve"+Q)}const K=(j&Ke)===Ke;return(P&1)===1!==K&&(j=t.neg(j)),{x:M,y:j}}else if(A===s&&P===4){const M=t.fromBytes(E.subarray(0,t.BYTES)),S=t.fromBytes(E.subarray(t.BYTES,2*t.BYTES));return{x:M,y:S}}else throw new Error(`Point of length ${A} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),k=p=>Dt(kt(p,e.nByteLength));function B(p){const A=n>>Ke;return p>A}function y(p){return B(p)?l(-p):p}const b=(p,A,P)=>Ot(p.slice(A,P));class u{constructor(A,P,E){this.r=A,this.s=P,this.recovery=E,this.assertValidity()}static fromCompact(A){const P=e.nByteLength;return A=et("compactSignature",A,P*2),new u(b(A,0,P),b(A,P,2*P))}static fromDER(A){const{r:P,s:E}=xt.toSig(et("DER",A));return new u(P,E)}assertValidity(){if(!I(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!I(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(A){return new u(this.r,this.s,A)}recoverPublicKey(A){const{r:P,s:E,recovery:M}=this,S=X(et("msgHash",A));if(M==null||![0,1,2,3].includes(M))throw new Error("recovery id invalid");const j=M===2||M===3?P+e.n:P;if(j>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=(M&1)===0?"02":"03",W=w.fromHex(K+k(j)),ee=d(j),Q=l(-S*ee),le=l(E*ee),ue=w.BASE.multiplyAndAddUnsafe(W,Q,le);if(!ue)throw new Error("point at infinify");return ue.assertValidity(),ue}hasHighS(){return B(this.s)}normalizeS(){return this.hasHighS()?new u(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return qt(this.toDERHex())}toDERHex(){return xt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return qt(this.toCompactHex())}toCompactHex(){return k(this.r)+k(this.s)}}const c={isValidPrivateKey(p){try{return N(p),!0}catch{return!1}},normPrivateKeyToScalar:N,randomPrivateKey:()=>{const p=cs(e.n);return gl(e.randomBytes(p),e.n)},precompute(p=8,A=w.BASE){return A._setWindowSize(p),A.multiply(BigInt(3)),A}};function v(p,A=!0){return w.fromPrivateKey(p).toRawBytes(A)}function G(p){const A=Nt(p),P=typeof p=="string",E=(A||P)&&p.length;return A?E===i||E===s:P?E===2*i||E===2*s:p instanceof w}function $(p,A,P=!0){if(G(p))throw new Error("first arg must be private key");if(!G(A))throw new Error("second arg must be public key");return w.fromHex(A).multiply(N(p)).toRawBytes(P)}const J=e.bits2int||function(p){const A=Ot(p),P=p.length*8-e.nBitLength;return P>0?A>>BigInt(P):A},X=e.bits2int_modN||function(p){return l(J(p))},a=fi(e.nBitLength);function m(p){if(typeof p!="bigint")throw new Error("bigint expected");if(!(ft<=p&&p<a))throw new Error(`bigint expected < 2^${e.nBitLength}`);return kt(p,e.nByteLength)}function f(p,A,P=g){if(["recovered","canonical"].some(V=>V in P))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:M}=e;let{lowS:S,prehash:j,extraEntropy:K}=P;S==null&&(S=!0),p=et("msgHash",p),j&&(p=et("prehashed msgHash",E(p)));const W=X(p),ee=N(A),Q=[m(ee),m(W)];if(K!=null&&K!==!1){const V=K===!0?M(t.BYTES):K;Q.push(et("extraEntropy",V))}const le=er(...Q),ue=W;function z(V){const oe=J(V);if(!I(oe))return;const ce=d(oe),fe=w.BASE.multiply(oe).toAffine(),L=l(fe.x);if(L===ft)return;const D=l(ce*l(ue+L*ee));if(D===ft)return;let F=(fe.x===L?0:2)|Number(fe.y&Ke),ne=D;return S&&B(D)&&(ne=y(D),F^=1),new u(L,ne,F)}return{seed:le,k2sig:z}}const g={lowS:e.lowS,prehash:!1},_={lowS:e.lowS,prehash:!1};function h(p,A,P=g){const{seed:E,k2sig:M}=f(p,A,P),S=e;return ls(S.hash.outputLen,S.nByteLength,S.hmac)(E,M)}w.BASE._setWindowSize(8);function C(p,A,P,E=_){const M=p;if(A=et("msgHash",A),P=et("publicKey",P),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:S,prehash:j}=E;let K,W;try{if(typeof M=="string"||Nt(M))try{K=u.fromDER(M)}catch(fe){if(!(fe instanceof xt.Err))throw fe;K=u.fromCompact(M)}else if(typeof M=="object"&&typeof M.r=="bigint"&&typeof M.s=="bigint"){const{r:fe,s:L}=M;K=new u(fe,L)}else throw new Error("PARSE");W=w.fromHex(P)}catch(fe){if(fe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(S&&K.hasHighS())return!1;j&&(A=e.hash(A));const{r:ee,s:Q}=K,le=X(A),ue=d(Q),z=l(le*ue),V=l(ee*ue),oe=w.BASE.multiplyAndAddUnsafe(W,z,V)?.toAffine();return oe?l(oe.x)===ee:!1}return{CURVE:e,getPublicKey:v,getSharedSecret:$,sign:h,verify:C,ProjectivePoint:w,Signature:u,utils:c}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function vl(r){return{hash:r,hmac:(e,...t)=>os(r,e,Ua(...t)),randomBytes:Wa}}function Al(r,e){const t=n=>Sl({...r,...vl(n)});return Object.freeze({...t(e),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hs=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Co=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Rl=BigInt(1),Jn=BigInt(2),Po=(r,e)=>(r+e/Jn)/e;function Il(r){const e=hs,t=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),l=BigInt(44),d=BigInt(88),w=r*r*r%e,N=w*w*r%e,O=ze(N,t,e)*N%e,I=ze(O,t,e)*N%e,k=ze(I,Jn,e)*w%e,B=ze(k,i,e)*k%e,y=ze(B,s,e)*B%e,b=ze(y,l,e)*y%e,u=ze(b,d,e)*b%e,c=ze(u,l,e)*y%e,v=ze(c,t,e)*N%e,G=ze(v,o,e)*B%e,$=ze(G,n,e)*w%e,J=ze($,Jn,e);if(!Zn.eql(Zn.sqr(J),r))throw new Error("Cannot find square root");return J}const Zn=hl(hs,void 0,void 0,{sqrt:Il}),ci=Al({a:BigInt(0),b:BigInt(7),Fp:Zn,n:Co,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=Co,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Rl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,o=BigInt("0x100000000000000000000000000000000"),l=Po(s*r,e),d=Po(-n*r,e);let w=We(r-l*t-d*i,e),N=We(-l*n-d*s,e);const O=w>o,I=N>o;if(O&&(w=e-w),I&&(N=e-N),w>o||N>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:O,k1:w,k2neg:I,k2:N}}}},Ka);BigInt(0);ci.ProjectivePoint;function Tl(r){let e=r;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}BigInt(0);const Xn={},Qn={};for(let r=0;r<16;r++){const e=r,t=r*16,n=r.toString(16).toLowerCase();Qn[n]=e,Qn[n.toUpperCase()]=e,Xn[n]=t,Xn[n.toUpperCase()]=t}function xl(r){const e=r.length,t=new Uint8Array(e/2);for(let n=0;n<e;n+=2)t[n/2]=Xn[r[n]]+Qn[r[n+1]];return t}Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));for(let r=0;r<=256*256-1;r++)BigInt(r);const Wr=r=>{if(typeof r!="string")throw new Error(`hex argument type ${typeof r} must be of type string`);if(!/^0x[0-9a-fA-F]*$/.test(r))throw new Error(`Input must be a 0x-prefixed hexadecimal string, got ${r}`);const e=r.slice(2);return xl(e.length%2===0?e:Tl(e))},Ol=r=>{if(!Number.isSafeInteger(r)||r<0)throw new Error(`Received an invalid integer type: ${r}`);return`0x${r.toString(16)}`},or=r=>{const e=Ol(r);return Wr(e)};BigInt("0xffffffffffffffff");BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935");ci.CURVE.n;ci.CURVE.n/BigInt(2);BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");const Nl="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";Wr(Nl);const Cl="0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";Wr(Cl);const Pl="0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";Wr(Pl);Uint8Array.from([128]);BigInt(-1);BigInt(0);BigInt(1);BigInt(2);BigInt(3);BigInt(7);BigInt(8);BigInt(27);BigInt(28);BigInt(31);BigInt(32);BigInt(64);BigInt(128);BigInt(255);BigInt(256);BigInt(96);BigInt(100);BigInt(160);BigInt(224);BigInt(7922816251426434e13);BigInt(1461501637330903e33);BigInt(2695994666715064e52);BigInt(1e9);Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var Lo;(function(r){r.String="string",r.Bytes="view",r.Number="number"})(Lo||(Lo={}));var Bo;(function(r){r.String="string",r.Bytes="view",r.JSON="json"})(Bo||(Bo={}));var Mo;(function(r){r[r.Number=0]="Number",r[r.BigInt=1]="BigInt",r[r.Uint8Array=2]="Uint8Array",r[r.PrefixedHexString=3]="PrefixedHexString"})(Mo||(Mo={}));var Do;(function(r){r[r.Deposit=0]="Deposit",r[r.Withdrawal=1]="Withdrawal",r[r.Consolidation=2]="Consolidation"})(Do||(Do={}));var Ct;(function(r){r[r.Version=0]="Version",r[r.Balance=1]="Balance",r[r.Nonce=2]="Nonce",r[r.CodeHash=3]="CodeHash",r[r.CodeSize=4]="CodeSize"})(Ct||(Ct={}));or(Ct.Version);or(Ct.Balance);or(Ct.Nonce);or(Ct.CodeHash);or(Ct.CodeSize);BigInt(256)**BigInt(31);var $n={exports:{}},Ir={},Tr={},qo;function Ll(){if(qo)return Tr;qo=1,Object.defineProperty(Tr,"__esModule",{value:!0});function r(e){var t=4,n=e.length,i=n%t;if(!i)return e;var s=n,o=t-i,l=n+o,d=be.Buffer.alloc(l);for(d.write(e);o--;)d.write("=",s++);return d.toString()}return Tr.default=r,Tr}var ko;function Bl(){if(ko)return Ir;ko=1,Object.defineProperty(Ir,"__esModule",{value:!0});var r=Ll();function e(l,d){return d===void 0&&(d="utf8"),be.Buffer.isBuffer(l)?i(l.toString("base64")):i(be.Buffer.from(l,d).toString("base64"))}function t(l,d){return d===void 0&&(d="utf8"),be.Buffer.from(n(l),"base64").toString(d)}function n(l){return l=l.toString(),r.default(l).replace(/\-/g,"+").replace(/_/g,"/")}function i(l){return l.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function s(l){return be.Buffer.from(n(l),"base64")}var o=e;return o.encode=e,o.decode=t,o.toBase64=n,o.fromBase64=i,o.toBuffer=s,Ir.default=o,Ir}var Uo;function Ml(){return Uo||(Uo=1,(function(r){r.exports=Bl().default,r.exports.default=r.exports})($n)),$n.exports}Ml();const ve={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},yt={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"};ve.MAINNET+"",ve.TESTNET+"",ve.CYAN+"",ve.AQUA+"",ve.CELESTE+"";ve.AQUA+"",yt.SAPPHIRE_MAINNET,ve.CELESTE+"",yt.SAPPHIRE_MAINNET,ve.CYAN+"",yt.SAPPHIRE_MAINNET,ve.MAINNET+"",yt.SAPPHIRE_MAINNET,ve.TESTNET+"",yt.SAPPHIRE_DEVNET;ve.MAINNET+"",ve.TESTNET+"",ve.CYAN+"",ve.AQUA+"",ve.CELESTE+"";yt.SAPPHIRE_MAINNET+"",yt.SAPPHIRE_DEVNET+"",ve.MAINNET+"",ve.TESTNET+"",ve.CYAN+"",ve.AQUA+"",ve.CELESTE+"";ve.MAINNET+"",ve.TESTNET+"",ve.CYAN+"",ve.AQUA+"",ve.CELESTE+"";function jo(r){let e=!1,t=0,n;try{n=window[r],e=!0,t=n.length;const i="__storage_test__";return n.setItem(i,i),n.removeItem(i),!0}catch(i){const s=i;return s&&(s.code===22||s.code===1014||s.name==="QuotaExceededError"||s.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&t!==0}}class Dl{constructor(){ge(this,"store",new Map)}getItem(e){return this.store.get(e)||null}setItem(e,t){this.store.set(e,t)}removeItem(e){this.store.delete(e)}}class ql{constructor(e,t){ge(this,"storage",void 0),ge(this,"_storeKey",void 0),this.storage=t,this._storeKey=e;try{t.getItem(e)||this.resetStore()}catch{}}static getInstance(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"local";if(!this.instanceMap.has(e)){let n;t==="local"&&jo("localStorage")?n=window.localStorage:t==="session"&&jo("sessionStorage")?n=window.sessionStorage:n=new Dl,this.instanceMap.set(e,new this(e,n))}return this.instanceMap.get(e)}toJSON(){return this.storage.getItem(this._storeKey)}resetStore(){const e=this.getStore();return this.storage.removeItem(this._storeKey),e}getStore(){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")}get(e){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")[e]}set(e,t){const n=JSON.parse(this.storage.getItem(this._storeKey)||"{}");n[e]=t,this.storage.setItem(this._storeKey,JSON.stringify(n))}}ge(ql,"instanceMap",new Map);Ye(Ye({},yt),ve);const xr={IFRAME_STATUS:"iframe_status",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},ct={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",CLOSED_WINDOW:"closed_window",WINDOW_BLOCKED:"window_blocked",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key",SHOW_WALLET_CONNECT:"show_wallet_connect",SHOW_CHECKOUT:"show_checkout",SHOW_WALLET_UI:"show_wallet_ui",LOGIN_WITH_SESSION_ID:"login_with_session_id"},kl={GET_PROVIDER_STATE:"wallet_get_provider_state"},Hn={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function Ul(r){return function(t,n,i){i(s=>{n.error&&Pr.warn(`Error in RPC response:
|
|
3
3
|
`,n),!t.isTorusInternal&&(Pr.info(`RPC (${r.origin}):`,t,"->",n),s())})}}var _t=na(),zn,Wo;function jl(){return Wo||(Wo=1,zn=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}),zn}var Wl=jl();const Fl=be.getDefaultExportFromCjs(Wl);var $l="2.1.0";function gs(r){return r!==null&&typeof r=="object"&&typeof r.pipe=="function"}function Hl(r){return gs(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object"}function zl(r){return gs(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object"}function Gl(r){return Hl(r)&&zl(r)}var nt={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:r=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${r} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:r=>`Invalid options. Received: { maxEventListeners: ${r}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:r=>`'args.logger' must include required method '${r}'.`},info:{connected:r=>`Torus: Connected to chain with ID "${r}".`}};const ps={PRODUCTION:"production"},Bt={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},Vl={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var di={translations:Vl,localStorageKeyPrefix:"torus-"},Se=Pr.getLogger("solana-embed");function Kl(){return(r,e,t)=>{(typeof r.method!="string"||!r.method)&&(e.error=_t.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:r})),t(n=>{const{error:i}=e;return i&&Se.error(`Torus - RPC Error: ${i.message}`,i),n()})}}function Yl(r,e,t){let n=`Torus: Lost connection to "${r}".`;e?.stack&&(n+=`
|
|
4
4
|
${e.stack}`),Se.warn(n),t&&t.listenerCount("error")>0&&t.emit("error",n)}const Or=()=>Math.random().toString(36).slice(2),ws=async r=>{let e,t;switch(r){case"testing":e="https://solana-testing.tor.us",t="debug";break;case"development":e="http://localhost:8080",t="debug";break;default:e="https://solana.tor.us",t="error";break}return{torusUrl:e,logLevel:t}},Jl=()=>{let r=window.navigator.language||"en-US";const e=r.split("-");return r=Object.prototype.hasOwnProperty.call(di.translations,e[0])?e[0]:"en",r},Zl={height:660,width:375},Xl={height:740,width:1315},Ql={height:700,width:1200},bs={height:600,width:400};function eu(r){let e;try{e=window[r];const t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(t){const n=t;return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&e.length!==0}}function Zt(r){let{width:e,height:t}=r;const n=window.screenLeft!==void 0?window.screenLeft:window.screenX,i=window.screenTop!==void 0?window.screenTop:window.screenY,s=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,l=1,d=Math.abs((s-e)/2/l+n),w=Math.abs((o-t)/2/l+i);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${t/l},width=${e/l},top=${w},left=${d}`}class ys extends kr{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:i="provider"}=t;if(super(),ge(this,"isTorus",void 0),ge(this,"_rpcEngine",void 0),ge(this,"jsonRpcConnectionEvents",void 0),ge(this,"_state",void 0),!Gl(e))throw new Error(nt.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(n),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const s=new Oa;fo(e,s,e,this._handleStreamDisconnect.bind(this,"Torus")),s.ignoreStream("phishing");const o=Ia();fo(o.stream,s.createStream(i),o.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const l=new ut;l.push(Ta()),l.push(Kl()),l.push(Ul({origin:location.origin})),l.push(o.middleware),this._rpcEngine=l,this.jsonRpcConnectionEvents=o.events}async request(e){if(!e||typeof e!="object"||Array.isArray(e))throw _t.ethErrors.rpc.invalidRequest({message:nt.errors.invalidRequestArgs(),data:e});const{method:t,params:n}=e;if(typeof t!="string"||t.length===0)throw _t.ethErrors.rpc.invalidRequest({message:nt.errors.invalidRequestMethod(),data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw _t.ethErrors.rpc.invalidRequest({message:nt.errors.invalidRequestParams(),data:e});return new Promise((i,s)=>{this._rpcRequest({method:t,params:n},Vn(i,s))})}send(e,t){this._rpcRequest(e,t)}sendAsync(e){return new Promise((t,n)=>{this._rpcRequest(e,Vn(t,n))})}_handleStreamDisconnect(e,t){Yl(e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}}const Mt=r=>{const e=window.document.createElement("template"),t=r.trim();return e.innerHTML=t,e.content.firstChild};function Nr(r){return r.version===void 0}class _s extends kr{constructor(e){let{url:t,target:n,features:i,timeout:s=3e4}=e;super(),ge(this,"url",void 0),ge(this,"target",void 0),ge(this,"features",void 0),ge(this,"window",void 0),ge(this,"windowTimer",void 0),ge(this,"iClosedWindow",void 0),ge(this,"timeout",void 0),this.url=t,this.target=n||"_blank",this.features=i||Zt(Ql),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this.timeout=s,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),setTimeout(()=>{this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0},this.timeout)),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){return this.window=window.open(this.url.href,this.target,this.features),this.window?.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(e){e?window.location.replace(this.url.href):window.location.href=this.url.href}}class Fr extends ys{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:i="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:i}),ge(this,"embedTranslations",void 0),ge(this,"torusUrl",void 0),ge(this,"dappStorageKey",void 0),ge(this,"windowRefs",void 0),ge(this,"tryWindowHandle",void 0),ge(this,"torusAlertContainer",void 0),ge(this,"torusIframe",void 0),this._state=Ye({},Fr._defaultState),this.torusUrl="",this.dappStorageKey="";const s=di.translations[Jl()];this.embedTranslations=s.embed,this.windowRefs={},this.on("connect",()=>{this._state.isConnected=!0});const o=l=>{const{method:d,params:w}=l;if(d===xr.IFRAME_STATUS){const{isFullScreen:N,rid:O}=w;this._displayIframe({isFull:N,rid:O})}else if(d==="create_window"){const{windowId:N,url:O}=w;this._createPopupBlockAlert(N,O)}else if(d===xr.CLOSE_WINDOW)this._handleCloseWindow(w);else if(d===xr.USER_LOGGED_IN){const{currentLoginProvider:N}=w;this._state.isLoggedIn=!0,this._state.currentLoginProvider=N}else d===xr.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())};this.jsonRpcConnectionEvents.on("notification",o)}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(e){try{const{torusUrl:t,dappStorageKey:n,torusAlertContainer:i,torusIframe:s}=e;this.torusUrl=t,this.dappStorageKey=n,this.torusAlertContainer=i,this.torusIframe=s,this.torusIframe.addEventListener("load",()=>{this._state.isIFrameFullScreen||this._displayIframe()});const{currentLoginProvider:o,isLoggedIn:l}=await this.request({method:ct.GET_PROVIDER_STATE,params:[]});this._handleConnect(o,l)}catch(t){Se.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{Se.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(e){let{url:t,target:n,features:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=new URL(t||`${this.torusUrl}/redirect?windowId=${e}`);this.dappStorageKey&&(s.hash?s.hash+=`&dappStorageKey=${this.dappStorageKey}`:s.hash=`#dappStorageKey=${this.dappStorageKey}`);const o=new _s({url:s,target:n,features:i});if(o.open(),!o.window){this._createPopupBlockAlert(e,s.href);return}this.windowRefs[e]=o,this.request({method:"opened_window",params:{windowId:e}}),o.once("close",()=>{delete this.windowRefs[e],this.request({method:ct.CLOSED_WINDOW,params:{windowId:e}})})}_displayIframe(){let{isFull:e=!1,rid:t=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n={};if(e)n.display="block",n.width="100%",n.height="100%",n.top="0px",n.right="0px",n.left="0px",n.bottom="0px";else switch(n.display=this._state.torusWidgetVisibility?"block":"none",n.height="70px",n.width="70px",this._state.buttonPosition){case Bt.TOP_LEFT:n.top="0px",n.left="0px",n.right="auto",n.bottom="auto";break;case Bt.TOP_RIGHT:n.top="0px",n.right="0px",n.left="auto",n.bottom="auto";break;case Bt.BOTTOM_RIGHT:n.bottom="0px",n.right="0px",n.top="auto",n.left="auto";break;case Bt.BOTTOM_LEFT:default:n.bottom="0px",n.left="0px",n.top="auto",n.right="auto";break}Object.assign(this.torusIframe.style,n),this._state.isIFrameFullScreen=e,this.request({method:ct.IFRAME_STATUS,params:{isIFrameFullScreen:e,rid:t}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(e,t){const n=t,i=e;Array.isArray(i)||i.jsonrpc||(i.jsonrpc="2.0"),this.tryWindowHandle(i,n)}_handleConnect(e,t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:e,isLoggedIn:t}),Se.debug(nt.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){this._state.isConnected=!1;let n;e?(n=new _t.EthereumRpcError(1013,t||nt.errors.disconnected()),Se.debug(n)):(n=new _t.EthereumRpcError(1011,t||nt.errors.permanentlyDisconnected()),Se.error(n),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleCloseWindow(e){const{windowId:t}=e;this.windowRefs[t]&&(this.windowRefs[t].close(),delete this.windowRefs[t])}async _createPopupBlockAlert(e,t){const n=this.getLogoUrl(),i=Mt(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${n}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),s=Mt(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),o=Mt('<div id="torusAlert__btn-container"></div>');o.appendChild(s),i.appendChild(o);const l=()=>{s.addEventListener("click",()=>{this._handleWindow(e,{url:t,target:"_blank",features:Zt(bs)}),i.remove(),this.torusAlertContainer.children.length===0&&(this.torusAlertContainer.style.display="none")})};(()=>{this.torusAlertContainer.appendChild(i)})(),l(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}ge(Fr,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});class sr extends ys{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:i="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:i}),ge(this,"chainId",void 0),ge(this,"selectedAddress",void 0),ge(this,"tryWindowHandle",void 0),this._state=Ye({},sr._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",()=>{this._state.isConnected=!0});const s=o=>{const{method:l,params:d}=o;l===Hn.ACCOUNTS_CHANGED?this._handleAccountsChanged(d):l===Hn.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(d):l===Hn.CHAIN_CHANGED&&this._handleChainChanged(d)};this.jsonRpcConnectionEvents.on("notification",s)}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:e,chainId:t,isUnlocked:n}=await this.request({method:kl.GET_PROVIDER_STATE,params:[]});this.emit("connect",{chainId:t}),this._handleChainChanged({chainId:t}),this._handleUnlockStateChanged({accounts:e,isUnlocked:n}),this._handleAccountsChanged(e)}catch(e){Se.error("Torus: Failed to get initial state. Please report this bug.",e)}finally{Se.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=t;const s=e;if(!Array.isArray(s)){if(s.jsonrpc||(s.jsonrpc="2.0"),s.method==="solana_accounts"||s.method==="solana_requestAccounts")i=(o,l)=>{this._handleAccountsChanged(l.result||[],s.method==="solana_accounts",n),t(o,l)};else if(s.method==="wallet_getProviderState"){this._rpcEngine.handle(e,i);return}}this.tryWindowHandle(s,i)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),Se.debug(nt.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){this._state.isConnected=!1;let n;e?(n=new _t.EthereumRpcError(1013,t||nt.errors.disconnected()),Se.debug(n)):(n=new _t.EthereumRpcError(1011,t||nt.errors.permanentlyDisconnected()),Se.error(n),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleAccountsChanged(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e;Array.isArray(i)||(Se.error("Torus: Received non-array accounts parameter. Please report this bug.",i),i=[]);for(const s of e)if(typeof s!="string"){Se.error("Torus: Received non-string account. Please report this bug.",e),i=[];break}Fl(this._state.accounts,i)||(t&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!n&&Se.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',i),this._state.accounts=i,this.emit("accountsChanged",i)),this.selectedAddress!==i[0]&&(this.selectedAddress=i[0]||null)}_handleChainChanged(){let{chainId:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!e){Se.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:e});return}e==="loading"?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId)))}_handleUnlockStateChanged(){let{accounts:e,isUnlocked:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof t!="boolean"){Se.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:t});return}t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[]))}}ge(sr,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});function Fo(r){return new Promise((e,t)=>{try{const n=document.createElement("img");n.onload=()=>e(!0),n.onerror=()=>e(!1),n.src=r}catch(n){t(n)}})}const tu=r=>{const{document:e}=r,t=e.querySelector('head > meta[property="og:site_name"]');if(t)return t.content;const n=e.querySelector('head > meta[name="title"]');return n?n.content:e.title&&e.title.length>0?e.title:r.location.hostname};async function ru(r){try{const{document:e}=r;let t=e.querySelector('head > link[rel="shortcut icon"]');return t&&await Fo(t.href)||(t=Array.from(e.querySelectorAll('head > link[rel="icon"]')).find(n=>!!n.href),t&&await Fo(t.href))?t.href:""}catch{return""}}const nu=async()=>({name:tu(window),icon:await ru(window)}),iu=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],ou=[ct.SET_PROVIDER],su=eu("localStorage");(async function(){try{if(typeof document>"u")return;const e=document.createElement("link"),{torusUrl:t}=await ws("production");e.href=`${t}/frame`,e.crossOrigin="anonymous",e.type="text/html",e.rel="prefetch",e.relList&&e.relList.supports&&e.relList.supports("prefetch")&&document.head.appendChild(e)}catch(e){Se.warn(e)}})();class au{constructor(){let{modalZIndex:e=99999}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ge(this,"isInitialized",void 0),ge(this,"torusAlert",void 0),ge(this,"modalZIndex",void 0),ge(this,"alertZIndex",void 0),ge(this,"requestedLoginProvider",void 0),ge(this,"provider",void 0),ge(this,"communicationProvider",void 0),ge(this,"dappStorageKey",void 0),ge(this,"isTopupHidden",!1),ge(this,"torusAlertContainer",void 0),ge(this,"torusUrl",void 0),ge(this,"torusIframe",void 0),ge(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=e,this.alertZIndex=e+1e3,this.dappStorageKey=""}get isLoggedIn(){return this.communicationProvider?this.communicationProvider.isLoggedIn:!1}async init(){let{buildEnv:e=ps.PRODUCTION,enableLogging:t=!1,network:n,showTorusButton:i=!1,useLocalStorage:s=!1,buttonPosition:o=Bt.BOTTOM_LEFT,apiKey:l="torus-default",extraParams:d={},whiteLabel:w}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");const{torusUrl:N,logLevel:O}=await ws(e);Se.enableAll(),Se.info(N,"url loaded"),Se.info(`Solana Embed Version :${$l}`),this.torusUrl=N,Se.setDefaultLevel(O),t?Se.enableAll():Se.disableAll();const I=this.handleDappStorageKey(s),k=new URL(N);k.pathname.endsWith("/")?k.pathname+="frame":k.pathname+="/frame";const B=new URLSearchParams;return I&&B.append("dappStorageKey",I),B.append("origin",window.location.origin),k.hash=B.toString(),this.torusIframe=Mt(`<iframe
|