@dcl/shop 1.6.0 → 1.6.1-31370108751.commit-2755363
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/_assets/{Activity-BIves4tB.js → Activity-DWeYGk2k.js} +5 -5
- package/_assets/{AnimatedBackground-BAIZo2fR.js → AnimatedBackground-CbDeSC7B.js} +2 -2
- package/_assets/{Assets-C0vteGqy.js → Assets-QbbX36Ou.js} +3 -3
- package/_assets/{Assets.styles-BMNglk-c.js → Assets.styles-BE1GPeOY.js} +2 -2
- package/_assets/{Authorizations-CoYQLT-v.js → Authorizations-Bn6fMH9f.js} +2 -2
- package/_assets/{Cart-D93xxbh3.js → Cart-Bd0wI8H4.js} +2 -2
- package/_assets/{CircularProgress-CWLrSo38.js → CircularProgress-BUtWjcFk.js} +2 -2
- package/_assets/{Collection-D53xuozg.js → Collection-CHkOYyBY.js} +2 -2
- package/_assets/{CollectionCarousel-vaYY-nnI.js → CollectionCarousel-Dbc29wYK.js} +82 -82
- package/_assets/{Confetti-FKTM_6PB.js → Confetti-BKzWrJgP.js} +4 -4
- package/_assets/{ConstantsUtil-sccHYIeE.js → ConstantsUtil-Biaaz1nI.js} +2 -2
- package/_assets/{ContentClient-BlVGFGAc.js → ContentClient-B9a-oy1d.js} +2 -2
- package/_assets/{Creator-Cn38JTBO.js → Creator-CkCucPh0.js} +2 -2
- package/_assets/{DeploymentBuilder-CeRoTifx.js → DeploymentBuilder-CttRRhx6.js} +2 -2
- package/_assets/{ErrorNotice-FmyHmiX7.js → ErrorNotice-Cz9mdeZK.js} +2 -2
- package/_assets/{ExchangeController-C6phi3nr.js → ExchangeController-uyfjcuS8.js} +2 -2
- package/_assets/{Faq-CCxX2eZe.js → Faq-CsC9R0f3.js} +2 -2
- package/_assets/{GetCredits-Bd3X1aDf.js → GetCredits-BzSB0fG-.js} +2 -2
- package/_assets/{Grow-Szn7ieZq.js → Grow-COHISHJT.js} +2 -2
- package/_assets/{HelpersUtil-CVPw5G-7.js → HelpersUtil-CShZFZ8T.js} +2 -2
- package/_assets/{ItemDetail-DyL0T8Py.js → ItemDetail-B7bQPzaP.js} +209 -209
- package/_assets/{JumpInIcon-BZzvbRJa.js → JumpInIcon-C01IIWY1.js} +2 -2
- package/_assets/LazyEmoteControls-0pIPDV5f.js +3 -0
- package/_assets/{LoadMore-92xFi8QJ.js → LoadMore-DMWADXyE.js} +2 -2
- package/_assets/{ManaPricingBanner.styles--RdbEZkX.js → ManaPricingBanner.styles-BF68MVFb.js} +2 -2
- package/_assets/{MyAssets-B7RmTDGk.js → MyAssets-Be-4TCmD.js} +5 -5
- package/_assets/{MyFavorites-BuMQZ6jE.js → MyFavorites-qmnjPjWS.js} +2 -2
- package/_assets/{NetworkUtil-v1MXp5Vw.js → NetworkUtil-DvNAPomE.js} +2 -2
- package/_assets/{NotFound-D1Z51qWS.js → NotFound--6jYNTxF.js} +2 -2
- package/_assets/{NotificationsBell-DpejsSGV.js → NotificationsBell-MdKtoZHZ.js} +2 -2
- package/_assets/{OutfitDetail-DTTL13km.js → OutfitDetail-BFik7fzt.js} +2 -2
- package/_assets/{OutfitPreview-B7h5Y44d.js → OutfitPreview-nib8oxCV.js} +2 -2
- package/_assets/{OutfitStudio-mDG-ZDvy.js → OutfitStudio-Da929F26.js} +2 -2
- package/_assets/{StoreSettings-BGVOGpcd.js → StoreSettings-C8cUvPnc.js} +2 -2
- package/_assets/{Success-Dfu0eQTO.js → Success-BuJNKIw2.js} +2 -2
- package/_assets/{SwapController-IlZfb2oR.js → SwapController-BbLFLB_4.js} +2 -2
- package/_assets/{Tooltip-CWAMxtHJ.js → Tooltip-CrN6vx00.js} +2 -2
- package/_assets/{TradeService-DlMas9Vb.js → TradeService-DEQoqhqw.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-C8G1VIpP.js → W3MFrameProviderSingleton-c1L9h1jC.js} +4 -4
- package/_assets/{WebCryptoP256-BBVW5Z8w.js → WebCryptoP256-DsjhpWmu.js} +2 -2
- package/_assets/{authorizations-DQDCaRjI.js → authorizations-C4p2o_MU.js} +2 -2
- package/_assets/{basic-0SGNtdGq.js → basic-6i3C8Aaz.js} +2 -2
- package/_assets/{biconomy-C4PcPOSj.js → biconomy-CZYHgSMr.js} +2 -2
- package/_assets/{browser-Dst46xRs.js → browser-B9fuRkp5.js} +2 -2
- package/_assets/{browser-ponyfill-B4fVbiDF.js → browser-ponyfill-DU-iU6Q_.js} +2 -2
- package/_assets/{builder-BiWmveAr.js → builder-yqqF9HRf.js} +2 -2
- package/_assets/{buy-C2M8gL0v.js → buy-DFQiIW23.js} +2 -2
- package/_assets/{buy-gasless-BXOm8q1f.js → buy-gasless-DCLyO8az.js} +2 -2
- package/_assets/{categories-CuW61PR3.js → categories-3tY2qOcF.js} +2 -2
- package/_assets/{ccip-BDwbzP8Z.js → ccip-BjTglt-_.js} +2 -2
- package/_assets/{ccip-DixrJ5wW.js → ccip-kN_8D49D.js} +2 -2
- package/_assets/{chains-CNTkcl2t.js → chains-B8i3FSTh.js} +2 -2
- package/_assets/collectionPage.styles-CSg8mZzU.js +33 -0
- package/_assets/{common-5tdC843P.js → common-Dc1f_AMZ.js} +2 -2
- package/_assets/{controller-BZsQSl-q.js → controller-Z7iKSG14.js} +3 -3
- package/_assets/{core-DQ4_JbBr.js → core-BRaO3Zrh.js} +5 -5
- package/_assets/{createSvgIcon-Cc45-VrR.js → createSvgIcon-Bp7qNpKi.js} +2 -2
- package/_assets/{custom-66NEjGko.js → custom-CFQr9ih7.js} +2 -2
- package/_assets/{data-capture-CqiPZ2Dm.js → data-capture-DpRgtuss.js} +2 -2
- package/_assets/{dcl-schemas-DmZ1KjqP.js → dcl-schemas-DY5rlTqz.js} +2 -2
- package/_assets/{decimals-CQ3tvNvn.js → decimals-FbfQWKLa.js} +2 -2
- package/_assets/{decimals-DhgpuU8P.js → decimals-ujCy4cDh.js} +2 -2
- package/_assets/{detectExtension-C1cG3GwA.js → detectExtension-CxKFIBjj.js} +2 -2
- package/_assets/{disposePreview-CfIXEOx1.js → disposePreview-D8Lqr7lL.js} +2 -2
- package/_assets/{email-BLc4FzVi.js → email-BppPvQf3.js} +2 -2
- package/_assets/{embedded-wallet-BpA8BhnT.js → embedded-wallet-DHuGHp64.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-DI3elzvy.js → emotion-styled.browser.esm-BowfphUR.js} +2 -2
- package/_assets/{engine-BB4xJ5Oj.js → engine-Dbt9EhzD.js} +2 -2
- package/_assets/{errors-Cz5ORqut.js → errors-D29nn5r9.js} +2 -2
- package/_assets/{estimate-l1-fee-CCWjRO9T.js → estimate-l1-fee-Bd9Ky08w.js} +2 -2
- package/_assets/{eth_estimateGas-BNRzb3Ka.js → eth_estimateGas-CMk5Cyj7.js} +2 -2
- package/_assets/{eth_getStorageAt-BK3HtAHN.js → eth_getStorageAt-Dz9q6h2L.js} +2 -2
- package/_assets/{eth_getTransactionCount-CgLld_3O.js → eth_getTransactionCount-Mugv60wF.js} +2 -2
- package/_assets/{ethereum-BTpgh80m.js → ethereum-B0K3iVRV.js} +2 -2
- package/_assets/{ethers-Bwl9qW1Q.js → ethers-evc5SAlJ.js} +2 -2
- package/_assets/{events-B3VuLoYR.js → events-BvNj6DBD.js} +2 -2
- package/_assets/{execute-DyAmqArd.js → execute-DcztY50V.js} +3 -3
- package/_assets/{extractIPFS-BMAQepht.js → extractIPFS-CN8tzkhe.js} +2 -2
- package/_assets/{features-CUTJRjck.js → features-DBitFjqt.js} +2 -2
- package/_assets/{fetchTokenMetadata-kas9IVYf.js → fetchTokenMetadata-CrVUfDe-.js} +3 -3
- package/_assets/{field.styles-SWJjNrTo.js → field.styles-DxhjXr3D.js} +2 -2
- package/_assets/{fortmatic-D4eqKU3e.js → fortmatic-hNX3Exay.js} +2 -2
- package/_assets/{get-bytecode-CQ0Bp2Nz.js → get-bytecode-C9bJ623O.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-CBdIQ8IP.js → get-ecosystem-wallet-info-Hw-jfKtT.js} +2 -2
- package/_assets/{getBalance-CCRsJje1.js → getBalance-Dys5LAtY.js} +3 -3
- package/_assets/{getInstalledModules-Bc4QhhXD.js → getInstalledModules-CPy8v_bm.js} +2 -2
- package/_assets/{getNFT-BYn270lC.js → getNFT-CcMbkF47.js} +3 -3
- package/_assets/{getNFT-C_Osmrsa.js → getNFT-DI9m_T7K.js} +2 -2
- package/_assets/{grid.styles-DR-yfn2C.js → grid.styles-DRfEiDmW.js} +2 -2
- package/_assets/{hashTypedData-CeBi4t5w.js → hashTypedData-BVCs-PgN.js} +2 -2
- package/_assets/{hashTypedData-C1qCorAA.js → hashTypedData-DLWGQoFc.js} +2 -2
- package/_assets/{in-app-2gN362Bh.js → in-app-BKmcmQ4D.js} +2 -2
- package/_assets/{in-app-wallet-calls-PNnqKiqK.js → in-app-wallet-calls-Dtd86Ju0.js} +2 -2
- package/_assets/{index-DhkNwQp3.js → index-96KFxIh-.js} +2 -2
- package/_assets/{index-Dyqo4Xho.js → index-9Me9LyVz.js} +2 -2
- package/_assets/{index-BoHkcwcC.js → index-9ZWsICZl.js} +2 -2
- package/_assets/{index-DkcAcz8h.js → index-B3om-pBL.js} +2 -2
- package/_assets/{index-BU6Tiyue.js → index-B8OZX12U.js} +2 -2
- package/_assets/{index-BeMzZGKs.js → index-B9Pnvvy0.js} +2 -2
- package/_assets/{index-CdLAfk4q.js → index-B9ujknEr.js} +2 -2
- package/_assets/{index-Bt_8JDRO.js → index-BCWA_trr.js} +3 -3
- package/_assets/{index-CfSUieWC.js → index-BHmGoCL8.js} +2 -2
- package/_assets/{index-Lwl-Gnxw.js → index-BYpNHX76.js} +2 -2
- package/_assets/{index-67jL7Qs-.js → index-B_nCi6La.js} +2 -2
- package/_assets/{index-BlLjMUpL.js → index-BeQt-XZx.js} +2 -2
- package/_assets/{index-CpWOfn2m.js → index-BppX8sMP.js} +2 -2
- package/_assets/{index-D32IHfJX.js → index-BptUbJXl.js} +2 -2
- package/_assets/{index-ocHSoaei.js → index-Bq1YVO0U.js} +2 -2
- package/_assets/{index-73fIwcux.js → index-BradhSLB.js} +2 -2
- package/_assets/{index-BcjBfjfJ.js → index-ByIHwLvG.js} +2 -2
- package/_assets/{index-D9Y0Wc1r.js → index-C-Rn429O.js} +2 -2
- package/_assets/{index-BUR5Lw5K.js → index-C6m0S04g.js} +2 -2
- package/_assets/{index-DFZZspY1.js → index-C7SMakJG.js} +2 -2
- package/_assets/{index-DZKRIXYQ.js → index-CHI5BeMl.js} +2 -2
- package/_assets/{index-DoqSvppp.js → index-CIZDfw33.js} +2 -2
- package/_assets/{index-C6A0BHjJ.js → index-CMdjAd6Q.js} +2 -2
- package/_assets/{index-EUtQr9pG.js → index-COB5iKYo.js} +2 -2
- package/_assets/{index-BCh0GUEt.js → index-COTuVHMB.js} +2 -2
- package/_assets/{index-CW8A4Tx8.js → index-CP0N5WwM.js} +2 -2
- package/_assets/{index-BVaG-gCl.js → index-CP8Bo6u4.js} +2 -2
- package/_assets/{index-Dcv4xKCh.js → index-CSDo3SUl.js} +2 -2
- package/_assets/{index-BLJavdiY.js → index-CSRVtFp6.js} +2 -2
- package/_assets/{index-CR3r1Rkd.js → index-CW6S88BJ.js} +2 -2
- package/_assets/{index-McsfYopR.js → index-CZq9jFj5.js} +2 -2
- package/_assets/{index-BDvy-qRF.js → index-CcmtVrnY.js} +2 -2
- package/_assets/{index-DgQUgQE7.js → index-CiqHVu_j.js} +2 -2
- package/_assets/{index--mp_sYJN.js → index-CitPizWg.js} +3 -3
- package/_assets/{index-CDk-Ypb7.js → index-CjXac2rs.js} +4 -4
- package/_assets/{index-lrEd_RLF.js → index-Ckphw5GW.js} +2 -2
- package/_assets/{index-CcOzVhfx.js → index-Cmqv9wwB.js} +2 -2
- package/_assets/{index-DmOQRnzD.js → index-CooN4TmQ.js} +2 -2
- package/_assets/{index-CSbGkt1l.js → index-CpgQAXnK.js} +2 -2
- package/_assets/{index-C4-xGbXH.js → index-CtID95VM.js} +2 -2
- package/_assets/{index-aNvf8EmA.js → index-D1BQ6GsP.js} +2 -2
- package/_assets/{index-RFt6OUu2.js → index-D5pzmPdj.js} +3 -3
- package/_assets/{index-8eeuiTS_.js → index-DATJMIZB.js} +2 -2
- package/_assets/{index-dG_Iw9GB.js → index-DAvQ5R0l.js} +3 -3
- package/_assets/{index-DyFuH2_H.js → index-DDJqhh5b.js} +2 -2
- package/_assets/{index-CcH2ARDV.js → index-DF3yAd2i.js} +2 -2
- package/_assets/{index-g37PxJX_.js → index-DGK0cmlE.js} +2 -2
- package/_assets/{index-CWgwVtUi.js → index-DIh4RG_N.js} +2 -2
- package/_assets/{index-B9IZeR_D.js → index-DTgLf1KL.js} +4 -4
- package/_assets/{index-Hi9hy4n_.js → index-DX4nmZrH.js} +2 -2
- package/_assets/{index-CWbxi5Ll.js → index-DYyAwsGC.js} +2 -2
- package/_assets/{index-BzEF6QSS.js → index-DbIr6xtd.js} +2 -2
- package/_assets/{index-CEOgZYKL.js → index-Dfqxa7HX.js} +2 -2
- package/_assets/{index-vnMkhThD.js → index-DjOXQ9Rp.js} +2 -2
- package/_assets/{index-V2ifzLDA.js → index-DjysywcL.js} +2 -2
- package/_assets/{index-DZXmWU2z.js → index-DoqQfu6i.js} +2 -2
- package/_assets/{index-CTySZKr_.js → index-DyyZsRpx.js} +2 -2
- package/_assets/{index-BMNKoN1X.js → index-DzNvBddH.js} +4 -4
- package/_assets/{index-CcSVe5HQ.js → index-GU0w_cmQ.js} +2 -2
- package/_assets/{index-BHLzNgT3.js → index-Hd2AP84a.js} +2 -2
- package/_assets/{index-LO6_NqYq.js → index-J2L2tvfG.js} +2 -2
- package/_assets/{index-BZzN_etT.js → index-Qu_Bwssg.js} +2 -2
- package/_assets/{index-0JRdMK7v.js → index-S1Bk9bEz.js} +2 -2
- package/_assets/{index-DNg2ina0.js → index-bRwHqOaJ.js} +2 -2
- package/_assets/{index-nCgh9GDW.js → index-cKBBNgZp.js} +2 -2
- package/_assets/{index-WHHsi8wC.js → index-vzC7xf1_.js} +17 -17
- package/_assets/{index-D_XOaK9C.js → index-x-d7uMoq.js} +2 -2
- package/_assets/{index.es-DvysfVti.js → index.es-DJtPKpwB.js} +2 -2
- package/_assets/{index.es-B-CrcVRz.js → index.es-Day0ON71.js} +5 -5
- package/_assets/{index.es-afGy5SKE.js → index.es-GLCb592k.js} +2 -2
- package/_assets/{index.es-OCWnmqFN.js → index.es-cn2e1xF7.js} +2 -2
- package/_assets/{linkAccount-BifsRGz3.js → linkAccount-akn1q2le.js} +2 -2
- package/_assets/{localBatchGatewayRequest-DFLku6l5.js → localBatchGatewayRequest-D7b991L7.js} +2 -2
- package/_assets/{native-DJ_aUpsb.js → native-DnQxyzrr.js} +2 -2
- package/_assets/{networks-CydjJiM4.js → networks-B78Z9z_D.js} +2 -2
- package/_assets/{onramp-B5sqXzRM.js → onramp-BOCFm3bM.js} +2 -2
- package/_assets/{openzeppelin-qXDLyFfJ.js → openzeppelin-DV5EMIyj.js} +2 -2
- package/_assets/{ownerOf-BbSxGD2J.js → ownerOf-bdcF7yVB.js} +2 -2
- package/_assets/{parseNft-CzaJPKTy.js → parseNft-t3bbwzKq.js} +3 -3
- package/_assets/{parseSignature-HsnnoUE2.js → parseSignature-Dn_R-fya.js} +2 -2
- package/_assets/{parseSignature-g3bgmU83.js → parseSignature-HfgK9gax.js} +4 -4
- package/_assets/{passkeys-D_G_4dk2.js → passkeys-TTkyTcM5.js} +2 -2
- package/_assets/{pay-with-exchange-CIY60crz.js → pay-with-exchange-iSitptaW.js} +2 -2
- package/_assets/{prepare-contract-call-DcoWBYfb.js → prepare-contract-call-CdN1cghW.js} +2 -2
- package/_assets/{qr-overlay-D0y8Agq2.js → qr-overlay-CkP2Q-PM.js} +4 -4
- package/_assets/{react-C5703MPC.js → react-Bo67Hww7.js} +2 -2
- package/_assets/{receive-DNjIhYc8.js → receive-Cg3IBVO1.js} +2 -2
- package/_assets/{resolveImplementation-B_rCiF72.js → resolveImplementation-TasB8DjV.js} +2 -2
- package/_assets/{resume-buy-CYbFLUtA.js → resume-buy-BtsrRrYS.js} +2 -2
- package/_assets/{rpc-tyv59_YL.js → rpc-CqZcdXs7.js} +2 -2
- package/_assets/{secp256k1-DLyimMSS.js → secp256k1-BeSP8kfD.js} +2 -2
- package/_assets/{secp256k1-BLVn6ftw.js → secp256k1-BxHGPVpc.js} +2 -2
- package/_assets/{secp256k1--JJyTmSc.js → secp256k1-tmpYjd2h.js} +2 -2
- package/_assets/{send-DvmnwxI5.js → send-Cvf1mb2o.js} +2 -2
- package/_assets/{send-batch-transaction-CrafOV72.js → send-batch-transaction-BJrASmh9.js} +2 -2
- package/_assets/{send-eip712-transaction-BV9i5dtU.js → send-eip712-transaction-ILbxuZPs.js} +3 -3
- package/_assets/{send-gasless-transaction-Bq1ZzcAz.js → send-gasless-transaction-CGJ2Lnbw.js} +3 -3
- package/_assets/{send-transaction-CowbeyJV.js → send-transaction-CMBHvwU0.js} +3 -3
- package/_assets/{sendMetaTransaction-U4ILDtVI.js → sendMetaTransaction-CZw226wQ.js} +2 -2
- package/_assets/{sendRawTransaction-DKcXOGXo.js → sendRawTransaction-Dtoqam6b.js} +4 -4
- package/_assets/{sentry-CVZH1wJB.js → sentry-CTenBeQF.js} +3 -3
- package/_assets/{serializeTransaction-CSki-hu9.js → serializeTransaction-CaquCSnc.js} +2 -2
- package/_assets/{session-proposal-BYkdworc.js → session-proposal-OE4EYmkP.js} +2 -2
- package/_assets/{session-request-DpnE_8qu.js → session-request-B7g4Gs9F.js} +3 -3
- package/_assets/{sha256-B2jbYpqD.js → sha256-B3LbWZA0.js} +2 -2
- package/_assets/{signing-h5AacBtI.js → signing-2opGQAaO.js} +4 -4
- package/_assets/{skeleton.styles-CSCidn_Q.js → skeleton.styles-otj6H0rc.js} +2 -2
- package/_assets/{socials-ya0LeLbM.js → socials-C4HCP3lk.js} +2 -2
- package/_assets/{styled-DbFIixuP.js → styled-hWmZMu2y.js} +2 -2
- package/_assets/{swaps-D9ljXaLw.js → swaps-DWVmUoui.js} +2 -2
- package/_assets/{thirdweb-BuQ1AtjV.js → thirdweb-BStl3wTr.js} +4 -4
- package/_assets/{to-serializable-transaction-CwBmyCV-.js → to-serializable-transaction-v2VfdA2c.js} +3 -3
- package/_assets/{totalSupply-D5VVA3Kk.js → totalSupply-NJnRTA9S.js} +2 -2
- package/_assets/{transaction-DAE8a5oD.js → transaction-BeY4AwNx.js} +2 -2
- package/_assets/{transactionReceipt-CkcO-YHq.js → transactionReceipt-ChWeHQbv.js} +2 -2
- package/_assets/{transactions-BiJd-UHs.js → transactions-jonf3UoA.js} +2 -2
- package/_assets/{useCreditPacks-D3849BP_.js → useCreditPacks-DDDa7dMb.js} +2 -2
- package/_assets/{useImportable-C6MLtTFO.js → useImportable-DeVF_OyA.js} +2 -2
- package/_assets/{useInfiniteGrid-71BcT-U8.js → useInfiniteGrid-jAPf4Fgf.js} +2 -2
- package/_assets/{useStore-8JDRpkO8.js → useStore-fXbQbIk9.js} +3 -3
- package/_assets/{useTheme-MdNi5P1R.js → useTheme-ChHqL3HZ.js} +2 -2
- package/_assets/{useUrlFilters-CFmAGAg1.js → useUrlFilters-DHWM92lb.js} +2 -2
- package/_assets/{utils-C82G3dfy.js → utils-CR4o2Oj3.js} +2 -2
- package/_assets/{verifyHash-RPP3evxq.js → verifyHash-zl93ZJJb.js} +2 -2
- package/_assets/{w3m-modal-C4h-YRCi.js → w3m-modal-XUCQWSNg.js} +2 -2
- package/_assets/{w3m-modal--PJ6j5FW.js → w3m-modal-bwgqPi6u.js} +2 -2
- package/_assets/{wait-for-tx-receipt-Cv-z1dNO.js → wait-for-tx-receipt-DuB8bs41.js} +2 -2
- package/_assets/{wallets-BvzIqPfn.js → wallets-C1-cKOag.js} +6 -6
- package/_assets/{web-connector-Crctq1Jf.js → web-connector-B7CjdbPd.js} +4 -4
- package/_assets/{writeContract-DfTzq8xm.js → writeContract-CZbTQjYE.js} +2 -2
- package/_assets/{zora-sepolia-DBHkUWS0.js → zora-sepolia-ub-pUXQ0.js} +2 -2
- package/_assets/{zoraTestnet-DadjQYYU.js → zoraTestnet-DaJsrsch.js} +2 -2
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/LazyEmoteControls-COuiKh_p.js +0 -3
- package/_assets/collectionPage.styles-CNk59IDd.js +0 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{p as dt}from"./sentry-CVZH1wJB.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5cee38ea-1aae-4489-9b7d-bbc1e0d6c990",e._sentryDebugIdIdentifier="sentry-dbid-5cee38ea-1aae-4489-9b7d-bbc1e0d6c990")}catch{}})();var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),ve=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(ve||{}),M=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(M||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),ut=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(ut||{}),ht=(e=>(e.Retry="retry",e))(ht||{}),pt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(pt||{}),B=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(B||{}),mt=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(mt||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),Et=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(Et||{}),C=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(C||{}),ft=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(ft||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),gt=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(gt||{}),_t=(e=>(e.Harmony="HARMONY",e))(_t||{}),vt=(e=>(e.PhoneNumber="phone_number",e))(vt||{}),Ee={},yt=Object.create,pe=Object.defineProperty,It=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,Nt=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ye=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Te)for(var r of Te(t))At.call(t,r)&&Le(e,r,t[r]);return e},Ie=(e,t)=>It(e,Rt(t)),Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Tt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $t(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=wt(t,n))||i.enumerable});return e},Lt=(e,t,r)=>(r=e!=null?yt(Nt(e)):{},Tt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),v=(e,t,r)=>new Promise((i,n)=>{var s=d=>{try{o(r.next(d))}catch(l){n(l)}},a=d=>{try{o(r.throw(d))}catch(l){n(l)}},o=d=>d.done?i(d.value):Promise.resolve(d.value).then(s,a);o((r=r.apply(e,t)).next())}),St=Ot((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function a(l,c,u,f,_){if(typeof u!="function")throw new TypeError("The listener must be a function");var y=new s(u,f||l,_),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],y]:l._events[$].push(y):(l._events[$]=y,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function d(){this._events=new n,this._eventsCount=0}d.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)r.call(c,u)&&l.push(i?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},d.prototype.listeners=function(l){var c=i?i+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,_=u.length,y=new Array(_);f<_;f++)y[f]=u[f].fn;return y},d.prototype.listenerCount=function(l){var c=i?i+l:l,u=this._events[c];return u?u.fn?1:u.length:0},d.prototype.emit=function(l,c,u,f,_,y){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,b,I;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,u),!0;case 4:return p.fn.call(p.context,c,u,f),!0;case 5:return p.fn.call(p.context,c,u,f,_),!0;case 6:return p.fn.call(p.context,c,u,f,_,y),!0}for(I=1,b=new Array(L-1);I<L;I++)b[I-1]=arguments[I];p.fn.apply(p.context,b)}else{var ct=p.length,V;for(I=0;I<ct;I++)switch(p[I].once&&this.removeListener(l,p[I].fn,void 0,!0),L){case 1:p[I].fn.call(p[I].context);break;case 2:p[I].fn.call(p[I].context,c);break;case 3:p[I].fn.call(p[I].context,c,u);break;case 4:p[I].fn.call(p[I].context,c,u,f);break;default:if(!b)for(V=1,b=new Array(L-1);V<L;V++)b[V-1]=arguments[V];p[I].fn.apply(p[I].context,b)}}return!0},d.prototype.on=function(l,c,u){return a(this,l,c,u,!1)},d.prototype.once=function(l,c,u){return a(this,l,c,u,!0)},d.prototype.removeListener=function(l,c,u,f){var _=i?i+l:l;if(!this._events[_])return this;if(!c)return o(this,_),this;var y=this._events[_];if(y.fn)y.fn===c&&(!f||y.once)&&(!u||y.context===u)&&o(this,_);else{for(var $=0,p=[],L=y.length;$<L;$++)(y[$].fn!==c||f&&!y[$].once||u&&y[$].context!==u)&&p.push(y[$]);p.length?this._events[_]=p.length===1?p[0]:p:o(this,_)}return this},d.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=i,d.EventEmitter=d,typeof t<"u"&&(t.exports=d)});function bt(e){let t={exports:{}};return e(t,t.exports),t.exports}var Ct=Number.MAX_SAFE_INTEGER||9007199254740991,we={MAX_LENGTH:256,MAX_SAFE_INTEGER:Ct,MAX_SAFE_COMPONENT_LENGTH:16},Pt=typeof dt=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=Pt,ee=bt(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(d,l,c)=>{let u=a++;E(u,l),s[d]=u,n[u]=l,i[u]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,kt=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},Ut={compareIdentifiers:kt},{MAX_LENGTH:be,MAX_SAFE_INTEGER:re}=we,{re:Ce,t:Pe}=ee,{compareIdentifiers:H}=Ut,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>be)throw new TypeError(`version is longer than ${be} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Ce[Pe.LOOSE]:Ce[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Dt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Dt,Gt=(e,t,r)=>q(e,t,r)===0,xt=Gt,Ft=(e,t,r)=>q(e,t,r)!==0,Wt=Ft,jt=(e,t,r)=>q(e,t,r)>0,qt=jt,Vt=(e,t,r)=>q(e,t,r)>=0,Ht=Vt,Xt=(e,t,r)=>q(e,t,r)<0,Bt=Xt,Kt=(e,t,r)=>q(e,t,r)<=0,Yt=Kt,zt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return xt(e,r,i);case"!=":return Wt(e,r,i);case">":return qt(e,r,i);case">=":return Ht(e,r,i);case"<":return Bt(e,r,i);case"<=":return Yt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=zt,X=Symbol("SemVer ANY"),Q=class{static get ANY(){return X}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===X?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=X}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===X||e===X)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,cr(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Jt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Qt)).replace(N[R.CARETTRIM],Zt)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>er(n,this.options)).join(" ").split(/\s+/).map(n=>lr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(dr(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Jt,tildeTrimReplace:Qt,caretTrimReplace:Zt}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},er=(e,t)=>(E("comp",e,t),e=ir(e,t),E("caret",e),e=tr(e,t),E("tildes",e),e=sr(e,t),E("xrange",e),e=ar(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",tr=(e,t)=>e.trim().split(/\s+/).map(r=>rr(r,t)).join(" "),rr=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let d;return E("tilde",e,i,n,s,a,o),A(n)?d="":A(s)?d=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?d=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),d=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):d=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",d),d})},ir=(e,t)=>e.trim().split(/\s+/).map(r=>nr(r,t)).join(" "),nr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,d)=>{let l;return E("caret",e,n,s,a,o,d),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:d?(E("replaceCaret pr",d),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${d} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${d} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${d} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},sr=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>or(r,t)).join(" ")),or=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,d)=>{E("xRange",e,i,n,s,a,o,d);let l=A(s),c=l||A(a),u=c||A(o),f=u;return n==="="&&f&&(n=""),d=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(d="-0"),i=`${n+s}.${a}.${o}${d}`):c?i=`>=${s}.0.0${d} <${+s+1}.0.0-0`:u&&(i=`>=${s}.${a}.0${d} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},ar=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),lr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),cr=e=>(t,r,i,n,s,a,o,d,l,c,u,f,_)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${d=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(u)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${u}-${f}`:e?`<${l}.${c}.${+u+1}-0`:`<=${d}`}`.trim(),dr=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},ur=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:hr}=we,{re:Ge,t:xe}=ee,pr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>hr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},mr=pr,{re:ie,t:ne}=ee,Er=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:mr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function fr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function gr(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function _r(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,fr))}function vr(e){return decodeURIComponent(Array.from(atob(e),gr).join(""))}function Xe(e){return _r(JSON.stringify(e))}function yr(e){return JSON.parse(vr(e))}function K(e){return typeof e>"u"}function Ir(e){return e===null}function Be(e){return Ir(e)||K(e)}function wr(e){return Be(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function Rr(e){return Be(e)?!1:typeof e=="number"&&Object.values(ve).includes(e)}function de(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function vi(e,t){return Object.assign(g,t),e}var $r={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},ue=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Rr(t)?t:ve.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,ue.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ke=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ke.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Nr(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Ar(){return new D(U.ModalNotReady,"Modal is not ready.")}function Or(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Mr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Tr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
|
|
1
|
+
import{p as dt}from"./sentry-CTenBeQF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5cee38ea-1aae-4489-9b7d-bbc1e0d6c990",e._sentryDebugIdIdentifier="sentry-dbid-5cee38ea-1aae-4489-9b7d-bbc1e0d6c990")}catch{}})();var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),ve=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(ve||{}),M=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(M||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),ut=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(ut||{}),ht=(e=>(e.Retry="retry",e))(ht||{}),pt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(pt||{}),B=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(B||{}),mt=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(mt||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),Et=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(Et||{}),C=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(C||{}),ft=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(ft||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),gt=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(gt||{}),_t=(e=>(e.Harmony="HARMONY",e))(_t||{}),vt=(e=>(e.PhoneNumber="phone_number",e))(vt||{}),Ee={},yt=Object.create,pe=Object.defineProperty,It=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,Nt=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ye=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Te)for(var r of Te(t))At.call(t,r)&&Le(e,r,t[r]);return e},Ie=(e,t)=>It(e,Rt(t)),Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Tt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $t(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=wt(t,n))||i.enumerable});return e},Lt=(e,t,r)=>(r=e!=null?yt(Nt(e)):{},Tt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),v=(e,t,r)=>new Promise((i,n)=>{var s=d=>{try{o(r.next(d))}catch(l){n(l)}},a=d=>{try{o(r.throw(d))}catch(l){n(l)}},o=d=>d.done?i(d.value):Promise.resolve(d.value).then(s,a);o((r=r.apply(e,t)).next())}),St=Ot((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function a(l,c,u,f,_){if(typeof u!="function")throw new TypeError("The listener must be a function");var y=new s(u,f||l,_),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],y]:l._events[$].push(y):(l._events[$]=y,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function d(){this._events=new n,this._eventsCount=0}d.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)r.call(c,u)&&l.push(i?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},d.prototype.listeners=function(l){var c=i?i+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,_=u.length,y=new Array(_);f<_;f++)y[f]=u[f].fn;return y},d.prototype.listenerCount=function(l){var c=i?i+l:l,u=this._events[c];return u?u.fn?1:u.length:0},d.prototype.emit=function(l,c,u,f,_,y){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,b,I;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,u),!0;case 4:return p.fn.call(p.context,c,u,f),!0;case 5:return p.fn.call(p.context,c,u,f,_),!0;case 6:return p.fn.call(p.context,c,u,f,_,y),!0}for(I=1,b=new Array(L-1);I<L;I++)b[I-1]=arguments[I];p.fn.apply(p.context,b)}else{var ct=p.length,V;for(I=0;I<ct;I++)switch(p[I].once&&this.removeListener(l,p[I].fn,void 0,!0),L){case 1:p[I].fn.call(p[I].context);break;case 2:p[I].fn.call(p[I].context,c);break;case 3:p[I].fn.call(p[I].context,c,u);break;case 4:p[I].fn.call(p[I].context,c,u,f);break;default:if(!b)for(V=1,b=new Array(L-1);V<L;V++)b[V-1]=arguments[V];p[I].fn.apply(p[I].context,b)}}return!0},d.prototype.on=function(l,c,u){return a(this,l,c,u,!1)},d.prototype.once=function(l,c,u){return a(this,l,c,u,!0)},d.prototype.removeListener=function(l,c,u,f){var _=i?i+l:l;if(!this._events[_])return this;if(!c)return o(this,_),this;var y=this._events[_];if(y.fn)y.fn===c&&(!f||y.once)&&(!u||y.context===u)&&o(this,_);else{for(var $=0,p=[],L=y.length;$<L;$++)(y[$].fn!==c||f&&!y[$].once||u&&y[$].context!==u)&&p.push(y[$]);p.length?this._events[_]=p.length===1?p[0]:p:o(this,_)}return this},d.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=i,d.EventEmitter=d,typeof t<"u"&&(t.exports=d)});function bt(e){let t={exports:{}};return e(t,t.exports),t.exports}var Ct=Number.MAX_SAFE_INTEGER||9007199254740991,we={MAX_LENGTH:256,MAX_SAFE_INTEGER:Ct,MAX_SAFE_COMPONENT_LENGTH:16},Pt=typeof dt=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=Pt,ee=bt(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(d,l,c)=>{let u=a++;E(u,l),s[d]=u,n[u]=l,i[u]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,kt=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},Ut={compareIdentifiers:kt},{MAX_LENGTH:be,MAX_SAFE_INTEGER:re}=we,{re:Ce,t:Pe}=ee,{compareIdentifiers:H}=Ut,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>be)throw new TypeError(`version is longer than ${be} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Ce[Pe.LOOSE]:Ce[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Dt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Dt,Gt=(e,t,r)=>q(e,t,r)===0,xt=Gt,Ft=(e,t,r)=>q(e,t,r)!==0,Wt=Ft,jt=(e,t,r)=>q(e,t,r)>0,qt=jt,Vt=(e,t,r)=>q(e,t,r)>=0,Ht=Vt,Xt=(e,t,r)=>q(e,t,r)<0,Bt=Xt,Kt=(e,t,r)=>q(e,t,r)<=0,Yt=Kt,zt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return xt(e,r,i);case"!=":return Wt(e,r,i);case">":return qt(e,r,i);case">=":return Ht(e,r,i);case"<":return Bt(e,r,i);case"<=":return Yt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=zt,X=Symbol("SemVer ANY"),Q=class{static get ANY(){return X}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===X?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=X}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===X||e===X)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,cr(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Jt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Qt)).replace(N[R.CARETTRIM],Zt)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>er(n,this.options)).join(" ").split(/\s+/).map(n=>lr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(dr(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Jt,tildeTrimReplace:Qt,caretTrimReplace:Zt}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},er=(e,t)=>(E("comp",e,t),e=ir(e,t),E("caret",e),e=tr(e,t),E("tildes",e),e=sr(e,t),E("xrange",e),e=ar(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",tr=(e,t)=>e.trim().split(/\s+/).map(r=>rr(r,t)).join(" "),rr=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let d;return E("tilde",e,i,n,s,a,o),A(n)?d="":A(s)?d=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?d=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),d=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):d=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",d),d})},ir=(e,t)=>e.trim().split(/\s+/).map(r=>nr(r,t)).join(" "),nr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,d)=>{let l;return E("caret",e,n,s,a,o,d),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:d?(E("replaceCaret pr",d),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${d} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${d} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${d} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},sr=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>or(r,t)).join(" ")),or=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,d)=>{E("xRange",e,i,n,s,a,o,d);let l=A(s),c=l||A(a),u=c||A(o),f=u;return n==="="&&f&&(n=""),d=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(d="-0"),i=`${n+s}.${a}.${o}${d}`):c?i=`>=${s}.0.0${d} <${+s+1}.0.0-0`:u&&(i=`>=${s}.${a}.0${d} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},ar=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),lr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),cr=e=>(t,r,i,n,s,a,o,d,l,c,u,f,_)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${d=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(u)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${u}-${f}`:e?`<${l}.${c}.${+u+1}-0`:`<=${d}`}`.trim(),dr=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},ur=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:hr}=we,{re:Ge,t:xe}=ee,pr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>hr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},mr=pr,{re:ie,t:ne}=ee,Er=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:mr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function fr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function gr(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function _r(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,fr))}function vr(e){return decodeURIComponent(Array.from(atob(e),gr).join(""))}function Xe(e){return _r(JSON.stringify(e))}function yr(e){return JSON.parse(vr(e))}function K(e){return typeof e>"u"}function Ir(e){return e===null}function Be(e){return Ir(e)||K(e)}function wr(e){return Be(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function Rr(e){return Be(e)?!1:typeof e=="number"&&Object.values(ve).includes(e)}function de(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function vi(e,t){return Object.assign(g,t),e}var $r={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},ue=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Rr(t)?t:ve.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,ue.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ke=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ke.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Nr(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Ar(){return new D(U.ModalNotReady,"Modal is not ready.")}function Or(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Mr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Tr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
|
|
2
2
|
- Extension \`${r.name}\` supports version(s) \`${i}\``:i||(t+=`
|
|
3
3
|
- Extension \`${r.name}\` does not support ${g.platform} environments.`)}),new D(U.IncompatibleExtensions,t)}function Lr(e){let t=r=>{let i=r+1,n=i%10,s=i%100;return n===1&&s!==11?`${i}st`:n===2&&s!==12?`${i}nd`:n===3&&s!==13?`${i}rd`:`${i}th`};return new D(U.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
|
|
4
4
|
Expected: \`${e.expected}\`
|
|
5
5
|
Received: \`${e.received}\``)}function yi(){return new te(j.DuplicateIframe,"Duplicate iframes found.")}function Sr(){return new te(j.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function br(){return new te(j.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${g.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function Y(e){let{method:t,removalVersions:r,useInstead:i}=e,n=r[g.sdkName],s=i?` Use \`${i}\` instead.`:"",a=`\`${t}\` will be removed from \`${g.sdkName}\` in version \`${n}\`.${s}`;return new te(j.DeprecationNotice,a)}function*Cr(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var Pr=Cr();function Ye(){return Pr.next().value}var ze=Symbol("Payload pre-processed by Magic SDK");function Je(e){return Object.defineProperty(e,ze,{value:!0,enumerable:!1}),e}function kr(e){return!!e[ze]}function he(e){var t,r,i;return kr(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Ye(),e.method=(r=e.method)!=null?r:"noop",e.params=(i=e.params)!=null?i:[],Je(e)),e}function m(e,t=[]){return Je({params:t,method:e,jsonrpc:"2.0",id:Ye()})}var Re=class{constructor(e){e instanceof Re?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):wr(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},Ur=Lt(St()),Dr=class extends Ur.default{};function Qe(){let e=new Dr;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...i)=>(e[t].apply(e,i),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var Ze=Symbol("isPromiEvent");function Gr(e){return!!e[Ze]}function Z(e){let t=et(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:i}=Qe(),n=Symbol("Promise.then"),s=Symbol("Promise.catch"),a=Symbol("Promise.finally"),o=(c,u)=>(...f)=>{let _=u[c].apply(u,f);return d(_)},d=c=>Object.assign(c,{[Ze]:!0,[n]:c[n]||c.then,[s]:c[s]||c.catch,[a]:c[a]||c.finally,then:o(n,c),catch:o(s,c),finally:o(a,c),on:i("on",c),once:i("once",c),addListener:i("addListener",c),off:i("off",c),removeListener:i("removeListener",c),removeAllListeners:i("removeAllListeners",c),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),l=d(t.then(c=>(l.emit("done",c),l.emit("settled"),c),c=>{throw l.emit("error",c),l.emit("settled"),c}));return l}function et(e){return new Promise((t,r)=>{let i=e(t,r);Promise.resolve(i).catch(r)})}var G=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(ce.MAGIC_HANDLE_REQUEST,he(e)),r=Z((n,s)=>{t.then(a=>{if(i(),a.hasError)s(new ue(a.payload.error));else if(a.hasResult)n(a.payload.result);else throw Or()}).catch(a=>{i(),s(a)})}),i=this.overlay.on(k.MAGIC_HANDLE_EVENT,n=>{var s;let{response:a}=n.data;if(a.id===e.id&&((s=a.result)!=null&&s.event)){let{event:o,params:d=[]}=a.result;r.emit(o,...d)}});return r}createIntermediaryEvent(e,t){return r=>{let i=m(h.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(i)}}};function xr(e,t){let[r]=e.split(".").map(Number);return r>=t}var z={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},Fr=class extends G{loginWithMagicLink(e){let t=g.sdkName==="@magic-sdk/react-native"||g.sdkName==="@magic-sdk/react-native-bare"||g.sdkName==="@magic-sdk/react-native-expo";if(t&&xr(g.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&Y({method:"auth.loginWithMagicLink()",removalVersions:z,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:i=!0,redirectURI:n,overrides:s}=e,a=m(this.sdk.testMode?h.LoginWithMagicLinkTestMode:h.LoginWithMagicLink,[{email:r,showUI:i,redirectURI:n,overrides:s}]);return this.request(a)}loginWithSMS(e){let{phoneNumber:t}=e,r=m(this.sdk.testMode?h.LoginWithSmsTestMode:h.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r,deviceCheckUI:i,overrides:n}=e,s=m(this.sdk.testMode?h.LoginWithEmailOTPTestMode:h.LoginWithEmailOTP,[{email:t,showUI:r,deviceCheckUI:i,overrides:n}]),a=this.request(s);return!i&&a&&a.on(ge.Retry,()=>{this.createIntermediaryEvent(ge.Retry,s.id)()}),!r&&a&&(a.on(B.VerifyEmailOtp,o=>{this.createIntermediaryEvent(B.VerifyEmailOtp,s.id)(o)}),a.on(B.Cancel,()=>{this.createIntermediaryEvent(B.Cancel,s.id)()})),a}loginWithCredential(e){let t=e??"";if(!e&&g.platform==="web"){t=window.location.search;let i=window.location.origin+window.location.pathname;window.history.replaceState(null,"",i)}let r=m(this.sdk.testMode?h.LoginWithCredentialTestMode:h.LoginWithCredential,[t]);return this.request(r)}setAuthorizationToken(e){let t=m(h.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:r=!0}=e,i=m(this.sdk.testMode?h.UpdateEmailTestMode:h.UpdateEmail,[{email:t,showUI:r}]),n=this.request(i);return r||(n.on(C.Retry,()=>{this.createIntermediaryEvent(C.Retry,i.id)()}),n.on(C.Cancel,()=>{this.createIntermediaryEvent(C.Cancel,i.id)()}),n.on(C.VerifyEmailOtp,s=>{this.createIntermediaryEvent(C.VerifyEmailOtp,i.id)(s)}),n.on(P.RetryWithNewEmail,s=>{this.createIntermediaryEvent(P.RetryWithNewEmail,i.id)(s)}),n.on(P.Cancel,()=>{this.createIntermediaryEvent(P.Cancel,i.id)()}),n.on(P.VerifyEmailOtp,s=>{this.createIntermediaryEvent(P.VerifyEmailOtp,i.id)(s)})),n}},tt={};Mt(tt,{clear:()=>Wr,getItem:()=>O,iterate:()=>rt,key:()=>qr,keys:()=>Vr,length:()=>jr,removeItem:()=>W,setItem:()=>T});var se;function S(e){return(...t)=>v(this,null,function*(){return se||(se=yield g.configureStorage()),yield se.ready(),se[e](...t)})}var O=S("getItem"),T=S("setItem"),W=S("removeItem"),Wr=S("clear"),jr=S("length"),qr=S("key"),Vr=S("keys"),rt=S("iterate");function Hr(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var it="STORE_KEY_PRIVATE_KEY",_e="STORE_KEY_PUBLIC_JWK",nt="ECDSA",Xr="P-256",Br={name:nt,namedCurve:Xr};function me(){let e=typeof window<"u"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Kr(){return v(this,null,function*(){let e=yield Yr();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield O(it);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let i={iat:Math.floor(new Date().getTime()/1e3),jti:Hr()},n={typ:"dpop+jwt",alg:"ES256",jwk:e},s={protected:We(JSON.stringify(n)),claims:We(JSON.stringify(i))},a=Jr(`${s.protected}.${s.claims}`),o={name:nt,hash:{name:"SHA-256"}},d=Zr(new Uint8Array(yield t.sign(o,r,a)));return`${s.protected}.${s.claims}.${d}`})}function Yr(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}return(yield O(_e))||(yield zr()),O(_e)})}function zr(){return v(this,null,function*(){let{subtle:e}=window.crypto,t=yield e.generateKey(Br,!1,["sign"]),r=yield e.exportKey("jwk",t.publicKey);yield T(it,t.privateKey),yield T(_e,r)})}function We(e){return st(Qr(e))}function Jr(e){return new TextEncoder().encode(e)}function st(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Qr(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function Zr(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),st(t)}var $e="ds",Ne="ek",Ae="iv",Oe="AES-GCM",ei=256;function Me(){return v(this,null,function*(){let e=[];yield rt((t,r,i)=>{r.startsWith(`${$e}_`)&&e.push(r)});for(let t of e)yield W(t)})}function ot(e){let t="",r=new Uint8Array(e),i=r.byteLength;for(let n=0;n<i;n++)t+=String.fromCharCode(r[n]);return window.btoa(t)}function at(e){let t=window.atob(e),r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}function ti(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{crypto:e}=window;return(yield O(Ae))||e.getRandomValues(new Uint8Array(12))})}function ri(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{subtle:e}=window.crypto;return(yield O(Ne))||(yield e.generateKey({name:Oe,length:ei},!1,["encrypt","decrypt"]))})}function ii(e,t){return v(this,null,function*(){let r=yield ti(),i=yield ri();if(!r||!i||!e)return;let n=at(e),{subtle:s}=window.crypto,a=yield s.encrypt({name:Oe,iv:r},i,n),o=ot(a);yield T(`${$e}_${t}`,o),yield T(Ne,i),yield T(Ae,r)})}function ni(e){return v(this,null,function*(){let t=yield O(`${$e}_${e}`),r=yield O(Ae),i=yield O(Ne);if(!r||!t||!i||!me())return;let{subtle:n}=window.crypto,s=yield n.decrypt({name:Oe,iv:r},i,at(t));return ot(s)})}function je(e,t){return t?new URL(e,t):new URL(e)}var si=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet",this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(e){let t=m(this.sdk.testMode?h.GetIdTokenTestMode:h.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=m(this.sdk.testMode?h.GenerateIdTokenTestMode:h.GenerateIdToken,[e]);return this.request(t)}getInfo(){return v(this,null,function*(){let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}isLoggedIn(){return Z((e,t)=>v(this,null,function*(){try{let r=!1;this.sdk.useStorageCache&&(r=(yield O(this.localForageIsLoggedInKey))==="true",r&&e(!0));let i=m(this.sdk.testMode?h.IsLoggedInTestMode:h.IsLoggedIn),n=yield this.request(i);this.sdk.useStorageCache&&(n?T(this.localForageIsLoggedInKey,!0):W(this.localForageIsLoggedInKey),r&&!n&&this.emitUserLoggedOut(!0)),e(n)}catch(r){t(r)}}))}logout(){return W(this.localForageKey),W(this.localForageIsLoggedInKey),Me(),Z((e,t)=>v(this,null,function*(){try{let r=m(this.sdk.testMode?h.LogoutTestMode:h.Logout),i=yield this.request(r);this.sdk.useStorageCache&&this.emitUserLoggedOut(i),e(i)}catch(r){t(r)}}))}requestInfoWithUI(e){let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(e){let t=m(this.sdk.testMode?h.UserSettingsTestMode:h.UserSettings,[e]);return this.request(t)}recoverAccount(e){let t=m(this.sdk.testMode?h.RecoverAccountTestMode:h.RecoverAccount,[e]);return this.request(t)}getMetadata(){Y({method:"user.getMetadata()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=m(this.sdk.testMode?h.GetMetadataTestMode:h.GetMetadata);return this.request(e)}onUserLoggedOut(e){this.userLoggedOutCallbacks.push(e)}emitUserLoggedOut(e){this.userLoggedOutCallbacks.forEach(t=>{t(e)})}},oi=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Z((t,r)=>v(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(M.MetaMask))){let o=yield this.autoConnectIfWalletBrowser(M.MetaMask);t(o);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(M.CoinbaseWallet))){let o=yield this.autoConnectIfWalletBrowser(M.CoinbaseWallet);t(o);return}let i=this.getUserEnv(),n=m(h.Login,[i]),s=this.request(n);s.on(ae.WalletSelected,o=>this.handleWalletSelected(Ie(ye({},o),{payloadId:n.id}))),s.on("id-token-created",o=>{e.emit("id-token-created",o)});let a=yield s;a.error&&r(a),t(a)}catch(i){r(i)}}));return e}showUI(){return this.request(m(h.ShowUI))}showAddress(){return this.request(m(h.ShowAddress))}showSendTokensUI(){return this.request(m(h.ShowSendTokensUI))}showOnRamp(){return this.request(m(h.ShowOnRamp))}showNFTs(){return this.request(m(h.ShowNFTs))}showBalances(){return this.request(m(h.ShowBalances))}sendGaslessTransaction(e,t){return this.request(m(h.SendGaslessTransaction,[e,t]))}getInfo(){return v(this,null,function*(){Y({method:"wallet.getInfo()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}disconnect(){Y({method:"wallet.disconnect()",removalVersions:z,useInstead:"user.logout()"}).log(),W(this.localForageKey),Me();let e=m(h.Disconnect);return this.request(e)}requestUserInfoWithUI(e){Y({method:"wallet.requestUserInfoWithUI()",removalVersions:z,useInstead:"user.requestUserInfoWithUI()"}).log();let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}getProvider(){return v(this,null,function*(){switch(yield O(this.localForageKey)){case M.MetaMask:return this.getMetaMaskProvider();case M.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case M.MetaMask:return this.connectToMetaMask();case M.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let t=m("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return v(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield T(this.localForageKey,e.wallet),this.createIntermediaryEvent(ae.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(ae.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return v(this,null,function*(){let t;e===M.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===M.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield T(this.localForageKey,e);let r=m(h.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:oe,createChainingEmitterMethod:x}=Qe(),ai=class extends G{constructor(){super(...arguments),this.isMagic=!0,this.on=x("on",this),this.once=x("once",this),this.addListener=x("addListener",this),this.off=x("off",this),this.removeListener=x("removeListener",this),this.removeAllListeners=x("removeAllListeners",this),this.emit=oe("emit"),this.eventNames=oe("eventNames"),this.listeners=oe("listeners"),this.listenerCount=oe("listenerCount")}sendAsync(e,t){if(!t)throw Lr({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(ce.MAGIC_HANDLE_REQUEST,e.map(r=>{let i=he(r);return this.prefixPayloadMethodForTestMode(i),i})).then(r=>{t(null,r.map(i=>Ie(ye({},i.payload),{error:i.hasError?new ue(i.payload.error):null})))});else{let r=he(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(ce.MAGIC_HANDLE_REQUEST,r).then(i=>{t(i.hasError?new ue(i.payload.error):null,i.payload)})}}send(e,t){if(typeof e=="string"){let i=m(e,Array.isArray(t)?t:[]);return this.request(i)}if(Array.isArray(e)||t){this.sendAsync(e,t);return}let r=Sr();return r.log(),new Re(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=m(h.Login);return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}},qe=["request","overlay","sdk"];function li(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==G.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var lt=class extends G{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Z,isPromiEvent:Gr,encodeJSON:Xe,decodeJSON:yr,createJsonRpcRequestPayload:m,standardizeJsonRpcRequestPayload:he,storage:tt};let e=[this,...li(this)];qe.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),i=r.findIndex(a=>!!a),n=i>0,s=r[i];s&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:s,isPrototypeField:n}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Mr(t)}}))})}init(e){this.__is_initialized__||(qe.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:i}=this.__sdk_access_field_descriptors__.get(t);i?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:i}=e,n=i?` Use \`${i}\` instead.`:"",s=`\`${t}\` will be removed from this Extension in version \`${r}\`.${n}`;return new Fe(this,"DEPRECATION_NOTICE",s)}createWarning(e,t){return new Fe(this,e,t)}createError(e,t,r){return new Ke(this,e,t,r)}},ci=class extends lt{},J=class extends lt{};J.Internal=ci,J.Anonymous="anonymous extension";var di=class extends G{purchase(e){let t=m(h.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=m(h.NFTCheckout,[e]);return this.request(t)}transfer(e){let t=m(h.NFTTransfer,[e]);return this.request(t)}};function Ve(e){return e.compat&&e.compat[g.sdkName]!=null?typeof e.compat[g.sdkName]=="string"?ur(Er(g.version),e.compat[g.sdkName]):!!e.compat[g.sdkName]:!0}function ui(e,t,r){return!t&&!r?`${e}_eth_mainnet`:r?`${e}_${JSON.stringify(r)}`:t?typeof t=="string"?`${e}_eth_${t}`:`${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}`:`${e}_unknown`}function hi(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],i={},n=[];if(Array.isArray(r)?r.forEach(s=>{Ve(s)?(s.init(this),(s.name||s.name!==J.Anonymous)&&(this[s.name]=s),s instanceof J.Internal&&(de(s.config)||(i[s.name]=s.config))):n.push(s)}):Object.keys(r).forEach(s=>{if(Ve(r[s])){r[s].init(this);let a=r[s];this[s]=a,a instanceof J.Internal&&(de(a.config)||(i[r[s].name]=a.config))}else n.push(r[s])}),n.length)throw Tr(n);return i}var le=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw Nr();g.platform==="react-native"&&(t!=null&&t.endpoint)&&br().log();let{defaultEndpoint:i,version:n}=g;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=je((r=t==null?void 0:t.endpoint)!=null?r:i).origin,this.auth=new Fr(this),this.user=new si(this),this.wallet=new oi(this),this.nft=new di(this),this.rpcProvider=new ai(this);let s=hi.call(this,t);this.parameters=Xe(Ie(ye({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:je(this.endpoint).host,sdk:$r[g.sdkName],version:n,ext:de(s)?void 0:s,locale:(t==null?void 0:t.locale)||"en_US"},g.bundleId?{bundleId:g.bundleId}:{}),{meta:t==null?void 0:t.meta})),this.networkHash=ui(this.apiKey,t==null?void 0:t.network,de(s)?void 0:s),t!=null&&t.deferPreload||this.preload()}get overlay(){if(!le.__overlays__.has(this.parameters)){let e=new g.ViewController(this.endpoint,this.parameters,this.networkHash);e.init(),le.__overlays__.set(this.parameters,e)}return le.__overlays__.get(this.parameters)}preload(){return v(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},pi=le;pi.__overlays__=new Map;function mi(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function Ei(e,t){var r;let i=(r=t.data.response)==null?void 0:r.id,n=mi(e,i);if(i&&n){let s=new Re(n).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:i,response:s}}return{}}function fi(e,t,r){return v(this,null,function*(){var i;let n=yield O("rt"),s;if(g.platform==="web")try{s=(i=yield O("jwt"))!=null?i:yield Kr()}catch(d){console.error("webcrypto error",d)}let a={msgType:e,payload:t};s&&(a.jwt=s),s&&n&&(a.rt=n);let o=yield ni(r);return o&&(a.deviceShare=o),a})}function gi(e){return v(this,null,function*(){!e.data.rt||(yield T("rt",e.data.rt))})}var Ii=class{constructor(e,t,r){this.endpoint=e,this.parameters=t,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(e,t){return v(this,null,function*(){return et((r,i)=>v(this,null,function*(){if(!this.isConnectedToInternet){let l=Ar();i(l)}this.isReadyForRequest||(yield this.waitForReady());let n=[],s=Array.isArray(t)?t.map(l=>l.id):[],a=yield fi(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(a);let o=l=>c=>{var u;let{id:f,response:_}=Ei(t,c);if(gi(c),((u=_==null?void 0:_.payload.error)==null?void 0:u.message)==="User denied account access.")Me();else if(c.data.deviceShare){let{deviceShare:y}=c.data;ii(y,this.networkHash)}f&&_&&Array.isArray(t)&&s.includes(f)?(n.push(_),n.length===t.length&&(l(),r(n))):f&&_&&!Array.isArray(t)&&f===t.id&&(l(),r(_))},d=this.on(k.MAGIC_HANDLE_RESPONSE,o(()=>d()))}))})}on(e,t){let r=t.bind(window),i=n=>{n.data.msgType===`${e}-${this.parameters}`&&r(n)};return this.messageHandlers.add(i),()=>this.messageHandlers.delete(i)}waitForReady(){return new Promise(e=>{let t=this.on(k.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,e(),t()})})}listen(){this.on(k.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(k.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()}),this.on(k.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new te(j.ProductAnnouncement,e.data.response.result.product_announcement).log()})}};export{pi as $,mt as A,Ii as B,ae as E,B as I,je as J,vi as K,gt as L,pt as N,ft as O,ge as R,Et as T,P as U,Ke as V,te as W,ue as _,J as a,ve as b,D as c,ce as d,U as e,k as f,ut as g,C as h,Gr as i,Z as j,_t as k,Ar as m,j as p,yi as q,Fe as s,M as u,h as v,ht as x,vt as y};
|
|
6
|
-
//# sourceMappingURL=index-
|
|
6
|
+
//# sourceMappingURL=index-DGK0cmlE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as j}from"./index-
|
|
1
|
+
import{d as j}from"./index-ByIHwLvG.js";import"./react-Bo67Hww7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="c6ab9c0a-75c1-4c89-835b-d663130576b4",e._sentryDebugIdIdentifier="sentry-dbid-c6ab9c0a-75c1-4c89-835b-d663130576b4")}catch{}})();/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function B(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function I(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=l=>l,n=(l,c)=>i=>l(c(i)),h=e.map(l=>l.encode).reduceRight(n,r),d=e.map(l=>l.decode).reduce(n,r);return{encode:h,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const h=new Map(r.map((d,l)=>[d,l]));return{encode:d=>(v(d),d.map(l=>{if(!Number.isSafeInteger(l)||l<0||l>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${l}". Allowed: ${e}`);return r[l]})),decode:d=>(v(d),d.map(l=>{B("alphabet.decode",l);const c=h.get(l);if(c===void 0)throw new Error(`Unknown letter: "${l}". Allowed: ${e}`);return c}))}}function W(e=""){return B("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(B("join.decode",r),r.split(e))}}function fe(e,r="="){return I(e),B("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let h=n.length;if(h*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;h>0&&n[h-1]===r;h--)if((h-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,h)}}}function G(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let h=0;const d=[],l=Array.from(e,i=>{if(I(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),c=l.length;for(;;){let i=0,a=!0;for(let w=h;w<c;w++){const p=l[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const s=Math.floor(m);if(l[w]=s,!Number.isSafeInteger(s)||s*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)s?a=!1:h=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,h){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,l=0;const c=R[r],i=R[n]-1,a=[];for(const w of e){if(I(w),w>=c)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,l+r>32)throw new Error(`convertRadix2: carry overflow pos=${l} from=${r}`);for(l+=r;l>=n;l-=n)a.push((d>>l-n&i)>>>0);const p=R[l];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-l&i,!h&&l>=r)throw new Error("Excess padding");if(!h&&d>0)throw new Error(`Non-zero padding: ${d}`);return h&&l>0&&a.push(d>>>0),a}function ae(e){I(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return G(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(G(n,e,r)))}}function se(e,r=!1){if(I(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const we=J(se(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),le=e=>J(ae(58),Q(e),W("")),ge=le("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function M(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?M(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function pe(e,r){r||(r=e.reduce((d,l)=>d+l.length,0));const n=Y(r);let h=0;for(const d of e)n.set(d,h),h+=d.length;return M(n)}function Z(e,r,n,h){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:h}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:j.base16,latin1:T,ascii:T,binary:T,...j};function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?M(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function Ae(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(c){let i;if(c instanceof Uint8Array)i=c;else if(typeof c=="string")i=new TextEncoder().encode(c);else throw new Error(e);return i}function n(c){return Array.prototype.map.call(c,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function h(c){return(4294967296+c).toString(16).substring(1)}function d(c,i,a){let w=`
|
|
2
2
|
`+c+" = ";for(let p=0;p<i.length;p+=2){if(a===32)w+=h(i[p]).toUpperCase(),w+=" ",w+=h(i[p+1]).toUpperCase();else if(a===64)w+=h(i[p+1]).toUpperCase(),w+=h(i[p]).toUpperCase();else throw new Error("Invalid size "+a);p%6===4?w+=`
|
|
3
3
|
`+new Array(c.length+4).join(" "):p<i.length-2&&(w+=" ")}console.log(w)}function l(c,i,a){let w=new Date().getTime();const p=new Uint8Array(i);for(let A=0;A<i;A++)p[A]=A%256;const x=new Date().getTime();console.log("Generated random input in "+(x-w)+"ms"),w=x;for(let A=0;A<a;A++){const m=c(p),s=new Date().getTime(),b=s-w;w=s,console.log("Hashed in "+b+"ms: "+m.substring(0,20)+"..."),console.log(Math.round(i/(1<<20)/(b/1e3)*100)/100+" MB PER SECOND")}}return H={normalizeInput:r,toHex:n,debugPrint:d,testSpeed:l},H}var C,O;function ce(){if(O)return C;O=1;const e=re();function r(t,u,o){const g=t[u]+t[o];let y=t[u+1]+t[o+1];g>=4294967296&&y++,t[u]=g,t[u+1]=y}function n(t,u,o,g){let y=t[u]+o;o<0&&(y+=4294967296);let k=t[u+1]+g;y>=4294967296&&k++,t[u]=y,t[u+1]=k}function h(t,u){return t[u]^t[u+1]<<8^t[u+2]<<16^t[u+3]<<24}function d(t,u,o,g,y,k){const ne=w[y],te=w[y+1],oe=w[k],ie=w[k+1];r(a,t,u),n(a,t,ne,te);let U=a[g]^a[t],E=a[g+1]^a[t+1];a[g]=E,a[g+1]=U,r(a,o,g),U=a[u]^a[o],E=a[u+1]^a[o+1],a[u]=U>>>24^E<<8,a[u+1]=E>>>24^U<<8,r(a,t,u),n(a,t,oe,ie),U=a[g]^a[t],E=a[g+1]^a[t+1],a[g]=U>>>16^E<<16,a[g+1]=E>>>16^U<<16,r(a,o,g),U=a[u]^a[o],E=a[u+1]^a[o+1],a[u]=E>>>31^U<<1,a[u+1]=U>>>31^E<<1}const l=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],i=new Uint8Array(c.map(function(t){return t*2})),a=new Uint32Array(32),w=new Uint32Array(32);function p(t,u){let o=0;for(o=0;o<16;o++)a[o]=t.h[o],a[o+16]=l[o];for(a[24]=a[24]^t.t,a[25]=a[25]^t.t/4294967296,u&&(a[28]=~a[28],a[29]=~a[29]),o=0;o<32;o++)w[o]=h(t.b,4*o);for(o=0;o<12;o++)d(0,8,16,24,i[o*16+0],i[o*16+1]),d(2,10,18,26,i[o*16+2],i[o*16+3]),d(4,12,20,28,i[o*16+4],i[o*16+5]),d(6,14,22,30,i[o*16+6],i[o*16+7]),d(0,10,20,30,i[o*16+8],i[o*16+9]),d(2,12,22,24,i[o*16+10],i[o*16+11]),d(4,14,16,26,i[o*16+12],i[o*16+13]),d(6,8,18,28,i[o*16+14],i[o*16+15]);for(o=0;o<16;o++)t.h[o]=t.h[o]^a[o]^a[o+16]}const x=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function A(t,u,o,g){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(u&&u.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(o&&o.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(g&&g.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const y={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};x.fill(0),x[0]=t,u&&(x[1]=u.length),x[2]=1,x[3]=1,o&&x.set(o,32),g&&x.set(g,48);for(let k=0;k<16;k++)y.h[k]=l[k]^h(x,k*4);return u&&(m(y,u),y.c=128),y}function m(t,u){for(let o=0;o<u.length;o++)t.c===128&&(t.t+=t.c,p(t,!1),t.c=0),t.b[t.c++]=u[o]}function s(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;p(t,!0);const u=new Uint8Array(t.outlen);for(let o=0;o<t.outlen;o++)u[o]=t.h[o>>2]>>8*(o&3);return u}function b(t,u,o,g,y){o=o||64,t=e.normalizeInput(t),g&&(g=e.normalizeInput(g)),y&&(y=e.normalizeInput(y));const k=A(o,u,g,y);return m(k,t),s(k)}function f(t,u,o,g,y){const k=b(t,u,o,g,y);return e.toHex(k)}return C={blake2b:b,blake2bHex:f,blake2bInit:A,blake2bUpdate:m,blake2bFinal:s},C}var D,z;function ue(){if(z)return D;z=1;const e=re();function r(s,b){return s[b]^s[b+1]<<8^s[b+2]<<16^s[b+3]<<24}function n(s,b,f,t,u,o){c[s]=c[s]+c[b]+u,c[t]=h(c[t]^c[s],16),c[f]=c[f]+c[t],c[b]=h(c[b]^c[f],12),c[s]=c[s]+c[b]+o,c[t]=h(c[t]^c[s],8),c[f]=c[f]+c[t],c[b]=h(c[b]^c[f],7)}function h(s,b){return s>>>b^s<<32-b}const d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),l=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),c=new Uint32Array(16),i=new Uint32Array(16);function a(s,b){let f=0;for(f=0;f<8;f++)c[f]=s.h[f],c[f+8]=d[f];for(c[12]^=s.t,c[13]^=s.t/4294967296,b&&(c[14]=~c[14]),f=0;f<16;f++)i[f]=r(s.b,4*f);for(f=0;f<10;f++)n(0,4,8,12,i[l[f*16+0]],i[l[f*16+1]]),n(1,5,9,13,i[l[f*16+2]],i[l[f*16+3]]),n(2,6,10,14,i[l[f*16+4]],i[l[f*16+5]]),n(3,7,11,15,i[l[f*16+6]],i[l[f*16+7]]),n(0,5,10,15,i[l[f*16+8]],i[l[f*16+9]]),n(1,6,11,12,i[l[f*16+10]],i[l[f*16+11]]),n(2,7,8,13,i[l[f*16+12]],i[l[f*16+13]]),n(3,4,9,14,i[l[f*16+14]],i[l[f*16+15]]);for(f=0;f<8;f++)s.h[f]^=c[f]^c[f+8]}function w(s,b){if(!(s>0&&s<=32))throw new Error("Incorrect output length, should be in [1, 32]");const f=b?b.length:0;if(b&&!(f>0&&f<=32))throw new Error("Incorrect key length, should be in [1, 32]");const t={h:new Uint32Array(d),b:new Uint8Array(64),c:0,t:0,outlen:s};return t.h[0]^=16842752^f<<8^s,f>0&&(p(t,b),t.c=64),t}function p(s,b){for(let f=0;f<b.length;f++)s.c===64&&(s.t+=s.c,a(s,!1),s.c=0),s.b[s.c++]=b[f]}function x(s){for(s.t+=s.c;s.c<64;)s.b[s.c++]=0;a(s,!0);const b=new Uint8Array(s.outlen);for(let f=0;f<s.outlen;f++)b[f]=s.h[f>>2]>>8*(f&3)&255;return b}function A(s,b,f){f=f||32,s=e.normalizeInput(s);const t=w(f,b);return p(t,s),x(t)}function m(s,b,f){const t=A(s,b,f);return e.toHex(t)}return D={blake2s:A,blake2sHex:m,blake2sInit:w,blake2sUpdate:p,blake2sFinal:x},D}var _,L;function de(){if(L)return _;L=1;const e=ce(),r=ue();return _={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal},_}var xe=de();export{we as a,ge as b,pe as c,xe as d,ye as f,Ae as t};
|
|
4
|
-
//# sourceMappingURL=index-
|
|
4
|
+
//# sourceMappingURL=index-DIh4RG_N.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as D,Z as qe,t as H,O as x,a7 as $e,e as De,p as xe,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-
|
|
3
|
-
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function i(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",i).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(i,e){var n;let t;if(typeof e.connector=="function"?t=i._internal.connectors.setup(e.connector):t=e.connector,t.uid===i.state.current)throw new ht;try{i.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:o,...s}=e,u=await t.connect(s);return t.emitter.off("connect",i._internal.events.connect),t.emitter.on("change",i._internal.events.change),t.emitter.on("disconnect",i._internal.events.disconnect),await((n=i.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),i.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:s.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:s.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(o){throw i.setState(s=>({...s,status:s.current?"connected":"disconnected"})),o}}async function G(i,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(i.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=i.state.connections.get(i.state.current);if(!n)throw new ft;const o=e.chainId??n.chainId,s=await n.connector.getChainId();if(t&&s!==o)throw new mt({connectionChainId:o,connectorChainId:s});const u=n.connector;if(u.getClient)return u.getClient({chainId:o});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=i.chains.find(r=>r.id===o),a=await n.connector.getProvider({chainId:o});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(i,e={}){var o,s;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=i.state,d=u.get(c);t=d==null?void 0:d.connector}const n=i.state.connections;t&&(await t.disconnect(),t.emitter.off("change",i._internal.events.change),t.emitter.off("disconnect",i._internal.events.disconnect),t.emitter.on("connect",i._internal.events.connect),n.delete(t.uid)),i.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=i.state.current;if(!u)return;const c=(o=i.state.connections.get(u))==null?void 0:o.connector;if(!c)return;await((s=i.storage)==null?void 0:s.setItem("recentConnectorId",c.id))}}async function wt(i,e){const{chainId:t,connector:n,...o}=e;let s;e.account?s=e.account:s=(await G(i,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=i.getClient({chainId:t});return U(u,Xe,"estimateGas")({...o,account:s})}async function pt(i,e){const{address:t,blockNumber:n,blockTag:o,chainId:s}=e,u=i.getClient({chainId:s}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:o}),a=i.chains.find(r=>r.id===s)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(i.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(i)&&Array.isArray(e)){if(t=i.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(i[n],e[n]))return!1;return!0}if(typeof i.valueOf=="function"&&i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(typeof i.toString=="function"&&i.toString!==Object.prototype.toString)return i.toString()===e.toString();const o=Object.keys(i);if(t=o.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,o[n]))return!1;for(n=t;n--!==0;){const s=o[n];if(s&&!V(i[s],e[s]))return!1}return!0}return i!==i&&e!==e}function se(i){const e=i.state.current,t=i.state.connections.get(e),n=t==null?void 0:t.accounts,o=n==null?void 0:n[0],s=i.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=i.state.status;switch(u){case"connected":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!o,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(i){const e=[...i.state.connections.values()];return i.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o}),U(u,Ye,"prepareTransactionRequest")({...s,...t?{account:t}:{}})}let le=!1;async function he(i,e={}){var a,r;if(le)return[];le=!0,i.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=i._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...i.connectors);let n;try{n=await((r=i.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const o={};for(const[,l]of i.state.connections)o[l.connector.id]=1;n&&(o[n]=0);const s=Object.keys(o).length>0?[...t].sort((l,g)=>(o[l.id]??10)-(o[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of s){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",i._internal.events.connect),l.emitter.on("change",i._internal.events.change),l.emitter.on("disconnect",i._internal.events.disconnect),i.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(i.state.status==="reconnecting"||i.state.status==="connecting")&&(u?i.setState(l=>({...l,status:"connected"})):i.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:s.gas??void 0})}async function bt(i,e){const{account:t,connector:n,...o}=e;let s;return typeof t=="object"&&t.type==="local"?s=i.getClient():s=await G(i,{account:t,connector:n}),U(s,ut,"signMessage")({...o,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(i,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,o=i.state.connections.get(((u=e.connector)==null?void 0:u.uid)??i.state.current);if(o){const c=o.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const s=i.chains.find(c=>c.id===n);if(!s)throw new z;return i.setState(c=>({...c,chainId:n})),s}async function At(i,e){const{chainId:t,timeout:n=0,...o}=e,s=i.getClient({chainId:t}),c=await U(s,st,"waitForTransactionReceipt")({...o,timeout:n});if(c.status==="reverted"){const d=U(s,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(s,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:s.chain.id}}function Nt(i,e){const{onChange:t}=e;return i.subscribe(()=>se(i),t,{equalityFn(n,o){const{connector:s,...u}=n,{connector:c,...d}=o;return V(u,d)&&(s==null?void 0:s.id)===(c==null?void 0:c.id)&&(s==null?void 0:s.uid)===(c==null?void 0:c.uid)}})}function Et(i,e){const{onChange:t}=e;return i.subscribe(()=>M(i),t,{equalityFn:V})}function St(i,e){const{onChange:t}=e;return i._internal.connectors.subscribe((n,o)=>{t(Object.values(n),o)})}function _t(i,e){const{syncConnectedChain:t=i._internal.syncConnectedChain,...n}=e;let o;const s=d=>{o&&o();const a=i.getClient({chainId:d});return o=U(a,rt,"watchPendingTransactions")(n),o},u=s(e.chainId);let c;return t&&!e.chainId&&(c=i.subscribe(({chainId:d})=>d,async d=>s(d))),()=>{u==null||u(),c==null||c()}}async function Tt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c})}function dn(i){return i}ae.type="injected";function ae(i={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=i;function n(){const d=i.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let o,s,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&i.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),o||(o=this.onAccountsChanged.bind(this),a.on("accountsChanged",o)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),i.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;s&&(a.removeListener("chainChanged",s),s=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),i.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!i.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(s&&(r.removeListener("chainChanged",s),s=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(i){return i!=null&&i.coinbaseWalletExtension?i.coinbaseWalletExtension:oe(i,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(i){return oe(i,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(i){var e,t;return(e=i==null?void 0:i.phantom)!=null&&e.ethereum?(t=i.phantom)==null?void 0:t.ethereum:oe(i,"isPhantom")}}};function oe(i,e){function t(o){return typeof e=="function"?e(o):typeof e=="string"?o[e]:!0}const n=i.ethereum;if(n!=null&&n.providers)return n.providers.find(o=>t(o));if(n&&t(n))return n}const kt=i=>(e,t,n)=>{const o=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return o(a)},i(e,t,n)},Rt=kt;function Ot(i,e){let t;try{t=i()}catch{return}return{getItem:o=>{var s;const u=d=>d===null?null:JSON.parse(d,void 0),c=(s=t.getItem(o))!=null?s:null;return c instanceof Promise?c.then(u):u(c)},setItem:(o,s)=>t.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>t.removeItem(o)}}const me=i=>e=>{try{const t=i(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(i,e)=>(t,n,o)=>{let s={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=s.storage;if(!a)return i((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...m)},n,o);const r=()=>{const m=s.partialize({...n()});return a.setItem(s.name,{state:m,version:s.version})},l=o.setState;o.setState=(m,I)=>{l(m,I),r()};const g=i((...m)=>{t(...m),r()},n,o);o.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=s.onRehydrateStorage)==null?void 0:I.call(s,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(s.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return[!0,s.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=s.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return o.persist={setOptions:m=>{s={...s,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},s.skipHydration||p(),f||g},jt=Ut,Ne=i=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=i(n,o,c);return c},fe=i=>i?Ne(i):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(i){return new Mt(i)}function Lt(i,e){return JSON.parse(i,(t,n)=>{let o=n;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(e==null?void 0:e(t,o))??o})}function Ee(i,e){return i.slice(0,e).join(".")||"."}function Se(i,e){const{length:t}=i;for(let n=0;n<t;++n)if(i[n]===e)return n+1;return 0}function qt(i,e){const t=typeof i=="function",n=typeof e=="function",o=[],s=[];return function(c,d){if(typeof d=="object")if(o.length){const a=Se(o,this);a===0?o[o.length]=this:(o.splice(a),s.splice(a)),s[s.length]=c;const r=Se(o,d);if(r!==0)return n?e.call(this,c,d,Ee(s,r)):`[ref=${Ee(s,r)}]`}else o[0]=d,s[0]=c;return t?i.call(this,c,d):d}}function $t(i,e,t,n){return JSON.stringify(i,qt((o,s)=>{let u=s;return typeof u=="bigint"&&(u={__type:"bigint",value:s.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(o,u))??u},n),t??void 0)}function Dt(i){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:o=Oe}=i;function s(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...o,key:t,async getItem(u,c){const d=o.getItem(`${t}.${u}`),a=await s(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await s(o.removeItem(d)):await s(o.setItem(d,n(c)))},async removeItem(u){await s(o.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function xt(){const i=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return i.getItem(e)},removeItem(e){i.removeItem(e)},setItem(e,t){try{i.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(i=11){if(!te||ee+i>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++i)}function Ft(i){const{multiInjectedProviderDiscovery:e=!0,storage:t=Dt({storage:xt()}),syncConnectedChain:n=!0,ssr:o=!1,...s}=i,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>s.chains),d=fe(()=>{const h=[],C=new Set;for(const w of s.connectors??[]){const A=a(w);if(h.push(A),!o&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!o&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:s.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(s.client)A=s.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(s);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>s.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:o,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!o,syncConnectedChain:n,transports:s.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(i){let e=[],t,n;function o(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function s(){var c;return t||(t=ye.getInstance({projectId:i.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:i.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=s();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=i.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=o(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:i.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:i.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return o(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(i){const e=i.isNewChainsStale??!0;let t,n,o,s,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:i.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(s||(s=this.onConnect.bind(this),r.on("connect",s)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=x.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),s&&(m.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),m.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{o&&(r==null||r.removeListener("chainChanged",o),o=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),s||(s=this.onConnect.bind(this),r==null||r.on("connect",s)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=i.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),o&&(l.removeListener("chainChanged",o),o=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=xe({pendingTransactions:0}),_e={state:F,subscribeKey(i,e){return De(F,i,e)},increase(i){F[i]+=1},decrease(i){F[i]-=1},reset(i){F[i]=0}};async function Bt(i){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-dG_Iw9GB.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.type==="safe"))return e()}return null}async function zt(i){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-dG_Iw9GB.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(i){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-dG_Iw9GB.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:o,chainId:s}=se(this.wagmiConfig);return Promise.resolve({accounts:s?[...new Set(n||[o])].map(u=>ne.createAccount({caipAddress:`eip155:${s}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(o=>o.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(o=>{var c,d;const s=(c=e.transports)==null?void 0:c[o.id],u=X.getCaipNetworkId(o);s?t[o.id]=X.extendWagmiTransports(o,e.projectId,s):t[o.id]=X.getViemTransport(o,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(s=>s.id===t.chainId),o=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(s=>({address:this.toChecksummedAddress(s)})),caipNetwork:n,connectorId:t.connector.id,auth:o?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const o=e.address!==(t==null?void 0:t.address),s=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(o||s||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=x.state||{};if(n!==!1){const s=await zt(this.wagmiConfig.connectors);s&&e.push(s)}if(t!==!1){const s=await Vt(this.wagmiConfig.connectors);s&&e.push(s)}const o=await Bt(this.wagmiConfig.connectors);o&&e.push(o),await Promise.all(e.map(s=>{const u=this.configureInternalConnector(s);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];x.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:o,enableAuthLogger:s}=x.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:o,enableAuthLogger:s}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const o=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:o,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),o=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),s={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:o,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,s);const u=await yt(this.wagmiConfig,s);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,o=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===o);return{hash:await Tt(this.wagmiConfig,{chain:s,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=x.state||{},o=e.type===S.CONNECTOR_ID.INJECTED,s=e.id===S.CONNECTOR_ID.INJECTED,u=o&&!s;if(s&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:o}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&o}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,s=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(s!=null&&s.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=s==null?void 0:s.connector.type)==null?void 0:a.toUpperCase(),id:s==null?void 0:s.connector.id}}}return{chainId:Number(s==null?void 0:s.chainId),address:this.toChecksummedAddress(s==null?void 0:s.accounts[0]),provider:c,type:(r=s==null?void 0:s.connector.type)==null?void 0:r.toUpperCase(),id:s==null?void 0:s.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const o=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return o.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:o.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,o,s,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(o=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:o.get(p.uid);if(m){await((s=this.wagmiConfig.storage)==null?void 0:s.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(o=>o.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const o=`${n.caipNetworkId}:${e.address}`,s=this.balancePromises[o];if(s)return s;const u=H.getNativeBalanceCacheForCaipAddress(o);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[o]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:o,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[o]}),this.balancePromises[o]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),o=M(this.wagmiConfig).find(s=>Y.isLowerCaseMatch(s.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),x.state.enableReconnect===!1&&this.deleteConnection(e.id),o?{connections:[{accounts:o.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:o.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const o=this.getWagmiConnector(n.connector.id);return o&&await ve(this.wagmiConfig,{connector:o}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(o=>({address:this.toChecksummedAddress(o)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:o,nativeCurrency:s,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=s??t.nativeCurrency,g=o??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await s.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return s.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return s.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return s.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),o=this.getWagmiConnector("walletConnect");if(o&&!n.find(s=>s.connector.id===o.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[o]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const un=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,un as b,dn as c,ae as i};
|
|
4
|
-
//# sourceMappingURL=index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-DAvQ5R0l.js","_assets/index-vzC7xf1_.js","_assets/react-Bo67Hww7.js","_assets/dcl-schemas-DY5rlTqz.js","_assets/sentry-CTenBeQF.js","_assets/ethers-evc5SAlJ.js","_assets/intl-AKLEHPeO.js","_assets/index-l2QjlKjX.css","_assets/sendRawTransaction-Dtoqam6b.js","_assets/NetworkUtil-DvNAPomE.js","_assets/W3MFrameProviderSingleton-c1L9h1jC.js","_assets/index-9ZWsICZl.js","_assets/index-BCWA_trr.js","_assets/events-BvNj6DBD.js","_assets/browser-ponyfill-DU-iU6Q_.js","_assets/custom-CFQr9ih7.js","_assets/index-9Me9LyVz.js","_assets/index-S1Bk9bEz.js","_assets/store-80QKZ2rN.js","_assets/writeContract-CZbTQjYE.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as D,Z as qe,t as H,O as x,a7 as $e,e as De,p as xe,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-c1L9h1jC.js";import{al as ze,ao as Ve,ab as Ge,x as B,af as re,Y as _,r as de,au as S,az as ge,a4 as Ke}from"./NetworkUtil-DvNAPomE.js";import{b7 as Je,bh as Te,aI as q,cv as Xe,bc as Ye,bi as Qe,ah as Ze}from"./sendRawTransaction-Dtoqam6b.js";import"./dcl-schemas-DY5rlTqz.js";import"./index-9ZWsICZl.js";import"./index-BCWA_trr.js";import"./browser-ponyfill-DU-iU6Q_.js";import{_ as we}from"./index-vzC7xf1_.js";import{E as et}from"./index-9Me9LyVz.js";import{c as tt}from"./store-80QKZ2rN.js";import{c as Pe,a as nt,g as it,b as st,d as ot,e as rt,p as ct}from"./custom-CFQr9ih7.js";import{s as at,w as dt}from"./writeContract-CZbTQjYE.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="ef9df738-e87d-4c80-a70e-45ee57fc146a",i._sentryDebugIdIdentifier="sentry-dbid-ef9df738-e87d-4c80-a70e-45ee57fc146a")}catch{}})();async function ut(i,{account:e=i.account,message:t}){if(!e)throw new Je({docsPath:"/docs/actions/wallet/signMessage"});const n=Te(e);if(n.signMessage)return n.signMessage({message:t});const o=typeof t=="string"?ze(t):t.raw instanceof Uint8Array?Ve(t.raw):t.raw;return i.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}function U(i,e,t){const n=i[e.name];if(typeof n=="function")return n;const o=i[t];return typeof o=="function"?o:s=>e(i,s)}const ie="3.5.5",lt=()=>`@wagmi/core@${ie}`;var ke=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},ce,Re;class O extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return lt()}constructor(e,t={}){var s;super(),ce.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=t.cause instanceof O?t.cause.details:(s=t.cause)!=null&&s.message?t.cause.message:t.details,o=t.cause instanceof O&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${this.docsBaseUrl}${o}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
|
|
3
|
+
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function i(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",i).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(i,e){var n;let t;if(typeof e.connector=="function"?t=i._internal.connectors.setup(e.connector):t=e.connector,t.uid===i.state.current)throw new ht;try{i.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:o,...s}=e,u=await t.connect(s);return t.emitter.off("connect",i._internal.events.connect),t.emitter.on("change",i._internal.events.change),t.emitter.on("disconnect",i._internal.events.disconnect),await((n=i.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),i.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:s.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:s.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(o){throw i.setState(s=>({...s,status:s.current?"connected":"disconnected"})),o}}async function G(i,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(i.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=i.state.connections.get(i.state.current);if(!n)throw new ft;const o=e.chainId??n.chainId,s=await n.connector.getChainId();if(t&&s!==o)throw new mt({connectionChainId:o,connectorChainId:s});const u=n.connector;if(u.getClient)return u.getClient({chainId:o});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=i.chains.find(r=>r.id===o),a=await n.connector.getProvider({chainId:o});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(i,e={}){var o,s;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=i.state,d=u.get(c);t=d==null?void 0:d.connector}const n=i.state.connections;t&&(await t.disconnect(),t.emitter.off("change",i._internal.events.change),t.emitter.off("disconnect",i._internal.events.disconnect),t.emitter.on("connect",i._internal.events.connect),n.delete(t.uid)),i.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=i.state.current;if(!u)return;const c=(o=i.state.connections.get(u))==null?void 0:o.connector;if(!c)return;await((s=i.storage)==null?void 0:s.setItem("recentConnectorId",c.id))}}async function wt(i,e){const{chainId:t,connector:n,...o}=e;let s;e.account?s=e.account:s=(await G(i,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=i.getClient({chainId:t});return U(u,Xe,"estimateGas")({...o,account:s})}async function pt(i,e){const{address:t,blockNumber:n,blockTag:o,chainId:s}=e,u=i.getClient({chainId:s}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:o}),a=i.chains.find(r=>r.id===s)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(i.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(i)&&Array.isArray(e)){if(t=i.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(i[n],e[n]))return!1;return!0}if(typeof i.valueOf=="function"&&i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(typeof i.toString=="function"&&i.toString!==Object.prototype.toString)return i.toString()===e.toString();const o=Object.keys(i);if(t=o.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,o[n]))return!1;for(n=t;n--!==0;){const s=o[n];if(s&&!V(i[s],e[s]))return!1}return!0}return i!==i&&e!==e}function se(i){const e=i.state.current,t=i.state.connections.get(e),n=t==null?void 0:t.accounts,o=n==null?void 0:n[0],s=i.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=i.state.status;switch(u){case"connected":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!o,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(i){const e=[...i.state.connections.values()];return i.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o}),U(u,Ye,"prepareTransactionRequest")({...s,...t?{account:t}:{}})}let le=!1;async function he(i,e={}){var a,r;if(le)return[];le=!0,i.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=i._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...i.connectors);let n;try{n=await((r=i.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const o={};for(const[,l]of i.state.connections)o[l.connector.id]=1;n&&(o[n]=0);const s=Object.keys(o).length>0?[...t].sort((l,g)=>(o[l.id]??10)-(o[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of s){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",i._internal.events.connect),l.emitter.on("change",i._internal.events.change),l.emitter.on("disconnect",i._internal.events.disconnect),i.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(i.state.status==="reconnecting"||i.state.status==="connecting")&&(u?i.setState(l=>({...l,status:"connected"})):i.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:s.gas??void 0})}async function bt(i,e){const{account:t,connector:n,...o}=e;let s;return typeof t=="object"&&t.type==="local"?s=i.getClient():s=await G(i,{account:t,connector:n}),U(s,ut,"signMessage")({...o,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(i,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,o=i.state.connections.get(((u=e.connector)==null?void 0:u.uid)??i.state.current);if(o){const c=o.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const s=i.chains.find(c=>c.id===n);if(!s)throw new z;return i.setState(c=>({...c,chainId:n})),s}async function At(i,e){const{chainId:t,timeout:n=0,...o}=e,s=i.getClient({chainId:t}),c=await U(s,st,"waitForTransactionReceipt")({...o,timeout:n});if(c.status==="reverted"){const d=U(s,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(s,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:s.chain.id}}function Nt(i,e){const{onChange:t}=e;return i.subscribe(()=>se(i),t,{equalityFn(n,o){const{connector:s,...u}=n,{connector:c,...d}=o;return V(u,d)&&(s==null?void 0:s.id)===(c==null?void 0:c.id)&&(s==null?void 0:s.uid)===(c==null?void 0:c.uid)}})}function Et(i,e){const{onChange:t}=e;return i.subscribe(()=>M(i),t,{equalityFn:V})}function St(i,e){const{onChange:t}=e;return i._internal.connectors.subscribe((n,o)=>{t(Object.values(n),o)})}function _t(i,e){const{syncConnectedChain:t=i._internal.syncConnectedChain,...n}=e;let o;const s=d=>{o&&o();const a=i.getClient({chainId:d});return o=U(a,rt,"watchPendingTransactions")(n),o},u=s(e.chainId);let c;return t&&!e.chainId&&(c=i.subscribe(({chainId:d})=>d,async d=>s(d))),()=>{u==null||u(),c==null||c()}}async function Tt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c})}function dn(i){return i}ae.type="injected";function ae(i={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=i;function n(){const d=i.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let o,s,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&i.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),o||(o=this.onAccountsChanged.bind(this),a.on("accountsChanged",o)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),i.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;s&&(a.removeListener("chainChanged",s),s=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),i.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!i.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(s&&(r.removeListener("chainChanged",s),s=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(i){return i!=null&&i.coinbaseWalletExtension?i.coinbaseWalletExtension:oe(i,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(i){return oe(i,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(i){var e,t;return(e=i==null?void 0:i.phantom)!=null&&e.ethereum?(t=i.phantom)==null?void 0:t.ethereum:oe(i,"isPhantom")}}};function oe(i,e){function t(o){return typeof e=="function"?e(o):typeof e=="string"?o[e]:!0}const n=i.ethereum;if(n!=null&&n.providers)return n.providers.find(o=>t(o));if(n&&t(n))return n}const kt=i=>(e,t,n)=>{const o=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return o(a)},i(e,t,n)},Rt=kt;function Ot(i,e){let t;try{t=i()}catch{return}return{getItem:o=>{var s;const u=d=>d===null?null:JSON.parse(d,void 0),c=(s=t.getItem(o))!=null?s:null;return c instanceof Promise?c.then(u):u(c)},setItem:(o,s)=>t.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>t.removeItem(o)}}const me=i=>e=>{try{const t=i(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(i,e)=>(t,n,o)=>{let s={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=s.storage;if(!a)return i((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...m)},n,o);const r=()=>{const m=s.partialize({...n()});return a.setItem(s.name,{state:m,version:s.version})},l=o.setState;o.setState=(m,I)=>{l(m,I),r()};const g=i((...m)=>{t(...m),r()},n,o);o.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=s.onRehydrateStorage)==null?void 0:I.call(s,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(s.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return[!0,s.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=s.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return o.persist={setOptions:m=>{s={...s,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},s.skipHydration||p(),f||g},jt=Ut,Ne=i=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=i(n,o,c);return c},fe=i=>i?Ne(i):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(i){return new Mt(i)}function Lt(i,e){return JSON.parse(i,(t,n)=>{let o=n;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(e==null?void 0:e(t,o))??o})}function Ee(i,e){return i.slice(0,e).join(".")||"."}function Se(i,e){const{length:t}=i;for(let n=0;n<t;++n)if(i[n]===e)return n+1;return 0}function qt(i,e){const t=typeof i=="function",n=typeof e=="function",o=[],s=[];return function(c,d){if(typeof d=="object")if(o.length){const a=Se(o,this);a===0?o[o.length]=this:(o.splice(a),s.splice(a)),s[s.length]=c;const r=Se(o,d);if(r!==0)return n?e.call(this,c,d,Ee(s,r)):`[ref=${Ee(s,r)}]`}else o[0]=d,s[0]=c;return t?i.call(this,c,d):d}}function $t(i,e,t,n){return JSON.stringify(i,qt((o,s)=>{let u=s;return typeof u=="bigint"&&(u={__type:"bigint",value:s.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(o,u))??u},n),t??void 0)}function Dt(i){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:o=Oe}=i;function s(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...o,key:t,async getItem(u,c){const d=o.getItem(`${t}.${u}`),a=await s(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await s(o.removeItem(d)):await s(o.setItem(d,n(c)))},async removeItem(u){await s(o.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function xt(){const i=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return i.getItem(e)},removeItem(e){i.removeItem(e)},setItem(e,t){try{i.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(i=11){if(!te||ee+i>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++i)}function Ft(i){const{multiInjectedProviderDiscovery:e=!0,storage:t=Dt({storage:xt()}),syncConnectedChain:n=!0,ssr:o=!1,...s}=i,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>s.chains),d=fe(()=>{const h=[],C=new Set;for(const w of s.connectors??[]){const A=a(w);if(h.push(A),!o&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!o&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:s.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(s.client)A=s.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(s);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>s.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:o,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!o,syncConnectedChain:n,transports:s.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(i){let e=[],t,n;function o(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function s(){var c;return t||(t=ye.getInstance({projectId:i.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:i.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=s();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=i.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=o(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:i.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:i.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return o(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(i){const e=i.isNewChainsStale??!0;let t,n,o,s,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:i.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(s||(s=this.onConnect.bind(this),r.on("connect",s)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=x.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),s&&(m.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),m.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{o&&(r==null||r.removeListener("chainChanged",o),o=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),s||(s=this.onConnect.bind(this),r==null||r.on("connect",s)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=i.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),o&&(l.removeListener("chainChanged",o),o=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=xe({pendingTransactions:0}),_e={state:F,subscribeKey(i,e){return De(F,i,e)},increase(i){F[i]+=1},decrease(i){F[i]-=1},reset(i){F[i]=0}};async function Bt(i){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-DAvQ5R0l.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.type==="safe"))return e()}return null}async function zt(i){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-DAvQ5R0l.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(i){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-DAvQ5R0l.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:o,chainId:s}=se(this.wagmiConfig);return Promise.resolve({accounts:s?[...new Set(n||[o])].map(u=>ne.createAccount({caipAddress:`eip155:${s}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(o=>o.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(o=>{var c,d;const s=(c=e.transports)==null?void 0:c[o.id],u=X.getCaipNetworkId(o);s?t[o.id]=X.extendWagmiTransports(o,e.projectId,s):t[o.id]=X.getViemTransport(o,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(s=>s.id===t.chainId),o=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(s=>({address:this.toChecksummedAddress(s)})),caipNetwork:n,connectorId:t.connector.id,auth:o?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const o=e.address!==(t==null?void 0:t.address),s=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(o||s||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=x.state||{};if(n!==!1){const s=await zt(this.wagmiConfig.connectors);s&&e.push(s)}if(t!==!1){const s=await Vt(this.wagmiConfig.connectors);s&&e.push(s)}const o=await Bt(this.wagmiConfig.connectors);o&&e.push(o),await Promise.all(e.map(s=>{const u=this.configureInternalConnector(s);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];x.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:o,enableAuthLogger:s}=x.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:o,enableAuthLogger:s}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const o=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:o,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),o=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),s={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:o,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,s);const u=await yt(this.wagmiConfig,s);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,o=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===o);return{hash:await Tt(this.wagmiConfig,{chain:s,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=x.state||{},o=e.type===S.CONNECTOR_ID.INJECTED,s=e.id===S.CONNECTOR_ID.INJECTED,u=o&&!s;if(s&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:o}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&o}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,s=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(s!=null&&s.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=s==null?void 0:s.connector.type)==null?void 0:a.toUpperCase(),id:s==null?void 0:s.connector.id}}}return{chainId:Number(s==null?void 0:s.chainId),address:this.toChecksummedAddress(s==null?void 0:s.accounts[0]),provider:c,type:(r=s==null?void 0:s.connector.type)==null?void 0:r.toUpperCase(),id:s==null?void 0:s.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const o=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return o.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:o.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,o,s,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(o=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:o.get(p.uid);if(m){await((s=this.wagmiConfig.storage)==null?void 0:s.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(o=>o.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const o=`${n.caipNetworkId}:${e.address}`,s=this.balancePromises[o];if(s)return s;const u=H.getNativeBalanceCacheForCaipAddress(o);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[o]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:o,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[o]}),this.balancePromises[o]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),o=M(this.wagmiConfig).find(s=>Y.isLowerCaseMatch(s.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),x.state.enableReconnect===!1&&this.deleteConnection(e.id),o?{connections:[{accounts:o.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:o.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const o=this.getWagmiConnector(n.connector.id);return o&&await ve(this.wagmiConfig,{connector:o}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(o=>({address:this.toChecksummedAddress(o)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:o,nativeCurrency:s,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=s??t.nativeCurrency,g=o??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await s.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return s.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return s.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return s.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),o=this.getWagmiConnector("walletConnect");if(o&&!n.find(s=>s.connector.id===o.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[o]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const un=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,un as b,dn as c,ae as i};
|
|
4
|
+
//# sourceMappingURL=index-DTgLf1KL.js.map
|