@dcl/shop 1.12.2-34971053975.commit-a7f84c8 → 1.12.2-34972265252.commit-b6b0612
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-B6ikNqvo.js → Activity-13NEIX-Y.js} +6 -6
- package/_assets/{AnimatedBackground-BMb7rvun.js → AnimatedBackground-BOPxueue.js} +6 -6
- package/_assets/{Assets-DgMWcGQE.js → Assets-Bep-EwbQ.js} +3 -3
- package/_assets/{Authorizations-B7xAIeF_.js → Authorizations-8uC5eZPi.js} +2 -2
- package/_assets/{Cart-CwBcJxTr.js → Cart-CErsQm4m.js} +2 -2
- package/_assets/{Collection-DlHBHW6I.js → Collection-B9eE-_KX.js} +2 -2
- package/_assets/{CollectionCarousel-BEo7WSno.js → CollectionCarousel-QXfHWCvr.js} +3 -3
- package/_assets/{Confetti-Dn8-JEM9.js → Confetti-DLzbtx80.js} +4 -4
- package/_assets/{ConstantsUtil-BfeVP8OX.js → ConstantsUtil-lSJG1oBK.js} +2 -2
- package/_assets/{ContentClient-BgiyWvaC.js → ContentClient-CAmolMW_.js} +2 -2
- package/_assets/{Creator-CVDhc4KI.js → Creator-D78WiH4k.js} +3 -3
- package/_assets/{DeploymentBuilder-CVfMLlHa.js → DeploymentBuilder-CIGmd9mH.js} +2 -2
- package/_assets/{EmotePlaybackBar-B62YEt9G.js → EmotePlaybackBar-BYIbgokg.js} +5 -5
- package/_assets/{ErrorNotice-CWVZqiKm.js → ErrorNotice-DYxD3jxm.js} +2 -2
- package/_assets/{Event-DnCv7Xg4.js → Event-BQFEpNdZ.js} +2 -2
- package/_assets/{ExchangeController-_gA6u_p7.js → ExchangeController-D8iZPsJP.js} +2 -2
- package/_assets/{Faq-ZShU0n7U.js → Faq-DYxl8UNc.js} +2 -2
- package/_assets/{GetCredits-Bj2YvP67.js → GetCredits-C5EEslut.js} +2 -2
- package/_assets/{Grow-Crvwr5n9.js → Grow-B1ripn2H.js} +2 -2
- package/_assets/{HelpersUtil-CuAlXmSB.js → HelpersUtil-D0DgSWQc.js} +2 -2
- package/_assets/ItemDetail-zFF3ki-O.js +3751 -0
- package/_assets/{LoadMore-YxufSP26.js → LoadMore-D_wNKVH5.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-Bp7LjYRJ.js → ManaPricingBanner.styles-RS_ScgxE.js} +2 -2
- package/_assets/{MyAssets-DaodAqcp.js → MyAssets-C6nxyPjf.js} +2 -2
- package/_assets/{MyFavorites-Veqwi_3D.js → MyFavorites-bGSrMl67.js} +2 -2
- package/_assets/{NetworkUtil-BeQH6gwx.js → NetworkUtil-V2oGNpAE.js} +2 -2
- package/_assets/{NotFound-CVLknwBX.js → NotFound-BUtt-2Of.js} +2 -2
- package/_assets/{NotificationsBell-vJAXfuHR.js → NotificationsBell-B6GL69_i.js} +13 -13
- package/_assets/{OutfitDetail-BEKvifMp.js → OutfitDetail-Cw3PyH5M.js} +2 -2
- package/_assets/{OutfitPreview-9sitM8AO.js → OutfitPreview-DSaqulWY.js} +2 -2
- package/_assets/{OutfitStudio-Cj_PBpbg.js → OutfitStudio-Dv8KmGJk.js} +2 -2
- package/_assets/{StoreSettings-cnSJnEoU.js → StoreSettings-_7koBL4q.js} +22 -22
- package/_assets/{Success-DSjHbwsm.js → Success-DfpWNLUD.js} +2 -2
- package/_assets/{SwapController-D1yNpizk.js → SwapController-DchbZyP-.js} +2 -2
- package/_assets/{TradeService-C-Sp4nAs.js → TradeService-Du8j0qQk.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-DJCn0B4B.js → W3MFrameProviderSingleton-Bvy0-jo9.js} +4 -4
- package/_assets/{WebCryptoP256-DdwSJwak.js → WebCryptoP256-CRYQfxBG.js} +2 -2
- package/_assets/{authorizations-DWBedPPC.js → authorizations-ClG6K2WL.js} +2 -2
- package/_assets/{basic-F8T3s2s0.js → basic-D8e_EGL2.js} +2 -2
- package/_assets/{biconomy-BYnpHohE.js → biconomy-C6Vs1esa.js} +2 -2
- package/_assets/{browseLayout.styles-CUa0JgI7.js → browseLayout.styles-DpNPNkvU.js} +2 -2
- package/_assets/{browser-_u-u7Oe_.js → browser-CRCqDI4t.js} +2 -2
- package/_assets/{browser-BiTB4Srk.js → browser-Dn9j1rw_.js} +2 -2
- package/_assets/{browser-ponyfill-CJDpXLMh.js → browser-ponyfill-DGOvD8_z.js} +2 -2
- package/_assets/{builder-Dha-HVpq.js → builder-DHgUoFci.js} +2 -2
- package/_assets/{buy-D5xK_7jz.js → buy-B6T8anS0.js} +2 -2
- package/_assets/{buy-gasless-B2eSXOhX.js → buy-gasless-BkAuZYxC.js} +2 -2
- package/_assets/{categories-CQewJ4Uc.js → categories-DLotnMLW.js} +2 -2
- package/_assets/{ccip-CoPrnICo.js → ccip-MM51wnq5.js} +2 -2
- package/_assets/{ccip-Cf1Ojagp.js → ccip-w56HhTxc.js} +2 -2
- package/_assets/{chains-hPvY0FLa.js → chains-D0ymqFCD.js} +2 -2
- package/_assets/collectionPage.styles-BlhZYBSo.js +41 -0
- package/_assets/{common-BgWhpEag.js → common-udFjqFdE.js} +2 -2
- package/_assets/{controller-D87zYpDU.js → controller-Df--ggPc.js} +3 -3
- package/_assets/{core-IQh9m55M.js → core-CL-i9UoT.js} +5 -5
- package/_assets/{createSvgIcon-O6Ung3cJ.js → createSvgIcon-BwY8Dl88.js} +2 -2
- package/_assets/{crumbs.styles-Cqk5FLiw.js → crumbs.styles-Z6nFfZJu.js} +2 -2
- package/_assets/{custom-fzVZr1mw.js → custom-7xHLG0Xc.js} +2 -2
- package/_assets/{data-capture-6sabeqek.js → data-capture-C_-irnbv.js} +2 -2
- package/_assets/{dcl-schemas-CKztSOGI.js → dcl-schemas-CwPce9xx.js} +2 -2
- package/_assets/{decimals-BsQudh4A.js → decimals-BU6s-KqT.js} +2 -2
- package/_assets/{decimals-QMRaj8A4.js → decimals-CXOAfmM0.js} +2 -2
- package/_assets/{detectExtension-eFuiXBqe.js → detectExtension-C_1wFpC3.js} +2 -2
- package/_assets/{disposePreview-CRyPyKKT.js → disposePreview-Dp3-krSm.js} +2 -2
- package/_assets/{email-D4EyTUe7.js → email-CJNQewaR.js} +2 -2
- package/_assets/{embedded-wallet-C2D3EAb1.js → embedded-wallet-meGK1sSM.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-CpBJ03i2.js → emotion-styled.browser.esm-Dpzn5Hv7.js} +2 -2
- package/_assets/{engine-BbOCbSlD.js → engine-BGszMhRq.js} +2 -2
- package/_assets/{errors-Bg8qsU53.js → errors-BkpOw6-Z.js} +2 -2
- package/_assets/{estimate-l1-fee-D0jvE3mx.js → estimate-l1-fee-D_ndKFP3.js} +2 -2
- package/_assets/{eth_estimateGas-CQNX7NuJ.js → eth_estimateGas-BFRqQ_t_.js} +2 -2
- package/_assets/{eth_getStorageAt-D0NnJlij.js → eth_getStorageAt-D67J9lnm.js} +2 -2
- package/_assets/{eth_getTransactionCount-CVuUWiNN.js → eth_getTransactionCount-Bomp01Af.js} +2 -2
- package/_assets/{ethereum-6iw3lFOZ.js → ethereum-BJkuNTHa.js} +2 -2
- package/_assets/{ethers-BsaABekR.js → ethers-Bh0IYN8X.js} +2 -2
- package/_assets/{events-C4OPCmQP.js → events-BwWaMw4H.js} +2 -2
- package/_assets/{execute-CgxmdyBm.js → execute-C3ZR4oMp.js} +3 -3
- package/_assets/{extractIPFS-C7dZUA2N.js → extractIPFS-CeaJwhhB.js} +2 -2
- package/_assets/{features-mKpIPTnS.js → features-Dqq9_SCo.js} +2 -2
- package/_assets/{fetchTokenMetadata-W7uHvfeQ.js → fetchTokenMetadata-CQkjZ1EF.js} +3 -3
- package/_assets/{field.styles-BOtOsc-J.js → field.styles-Av2i4idF.js} +2 -2
- package/_assets/{fortmatic-BEQagSCY.js → fortmatic-CnICZ1xv.js} +2 -2
- package/_assets/{get-bytecode-rNyaD7v6.js → get-bytecode-tB4D26w3.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-CIF0vnWX.js → get-ecosystem-wallet-info-SYBnizMd.js} +2 -2
- package/_assets/{getBalance-BkvZMo_t.js → getBalance-D2dIUoob.js} +3 -3
- package/_assets/{getInstalledModules-BgDYjPss.js → getInstalledModules-BBzovqPp.js} +2 -2
- package/_assets/{getNFT-B9d1ULLA.js → getNFT-jlOu6rWk.js} +2 -2
- package/_assets/{getNFT-CvB3KXgJ.js → getNFT-p986m_fI.js} +3 -3
- package/_assets/{grid.styles-BYhO5kl4.js → grid.styles-CjFvLjWz.js} +2 -2
- package/_assets/{hashTypedData-BePwOHrb.js → hashTypedData-CDoLq-H_.js} +2 -2
- package/_assets/{hashTypedData-Dl6tw3EV.js → hashTypedData-mKACwydb.js} +2 -2
- package/_assets/{in-app-xLEGGOxw.js → in-app-Bx5PR1gE.js} +2 -2
- package/_assets/{in-app-wallet-calls-Y2q1hEWu.js → in-app-wallet-calls-zFjYhHKN.js} +2 -2
- package/_assets/{index-F-PZn4me.js → index-309Pjw0W.js} +3 -3
- package/_assets/{index-BHU0VbfL.js → index-6L5QieXK.js} +3 -3
- package/_assets/{index-DF0Z9gru.js → index-9t1ly9Gn.js} +2 -2
- package/_assets/{index-xHMVqN46.js → index-B-yQlG0e.js} +2 -2
- package/_assets/{index-CwDHbFrE.js → index-B3CDIZki.js} +2 -2
- package/_assets/{index-DUqa7_dx.js → index-BFRJOose.js} +2 -2
- package/_assets/{index-D5Du4xGQ.js → index-BI5ZNaRN.js} +2 -2
- package/_assets/{index-BEQnNfRX.js → index-BJMcVrMA.js} +2 -2
- package/_assets/{index-BJu0G-Ry.js → index-BMByI8LI.js} +2 -2
- package/_assets/{index-C4KUTBCy.js → index-BOuP8Apv.js} +2 -2
- package/_assets/{index-C5gt-xEm.js → index-BYd_3Lyu.js} +2 -2
- package/_assets/{index-B_X1F7fX.js → index-BZ4L-bLI.js} +2 -2
- package/_assets/{index-BvkN1JGf.js → index-BagBXcnv.js} +4 -4
- package/_assets/{index-B7zg3iXU.js → index-Bd91dR_U.js} +2 -2
- package/_assets/{index-wjxY48Yl.js → index-BehD7H1s.js} +2 -2
- package/_assets/{index-Dnk8czQv.js → index-BfQaNPBO.js} +2 -2
- package/_assets/{index-Db7v2JAh.js → index-BgtbbSFT.js} +2 -2
- package/_assets/{index-OYOhdV0y.js → index-BnKIKZNd.js} +2 -2
- package/_assets/{index-s6EBI2aX.js → index-BwU7gNqj.js} +2 -2
- package/_assets/{index-C284vC1D.js → index-BzwlWL1j.js} +2 -2
- package/_assets/{index-BPmph_y2.js → index-C7EyMqgV.js} +2 -2
- package/_assets/{index-Dm1LzUJg.js → index-CBoVUBJM.js} +2 -2
- package/_assets/{index-Bz3QM6R_.js → index-CDUP5_t7.js} +2 -2
- package/_assets/{index-CY2qhmNH.js → index-CEkIc7Pu.js} +2 -2
- package/_assets/{index-Bd664zE6.js → index-CFJc6Kmj.js} +2 -2
- package/_assets/{index-t6AoMEJd.js → index-CR6aiS8e.js} +2 -2
- package/_assets/{index-CAR9wmvw.js → index-CRJS9iHS.js} +2 -2
- package/_assets/{index-CG6n56be.js → index-CTxFRhX3.js} +2 -2
- package/_assets/{index-CrX0Yz5L.js → index-CWuKgAv2.js} +2 -2
- package/_assets/{index-DAK-djOp.js → index-CZXds_2L.js} +2 -2
- package/_assets/{index-BT-HHXrw.js → index-CZo7AS63.js} +2 -2
- package/_assets/{index-BNSQiuue.js → index-Cd77lyOB.js} +2 -2
- package/_assets/{index-DExh-qiO.js → index-CifbPOD0.js} +2 -2
- package/_assets/{index-De3Ourso.js → index-CjCBCn7C.js} +2 -2
- package/_assets/{index-KOw8Pyjo.js → index-CooYYcSZ.js} +2 -2
- package/_assets/{index-BmNHZBRl.js → index-CsgJ7C3l.js} +2 -2
- package/_assets/{index-DA1NP8Ju.js → index-Cxjhn75F.js} +2 -2
- package/_assets/{index-D2VIT3xx.js → index-D1ojpYl4.js} +3 -3
- package/_assets/{index-BTy5TIkz.js → index-D5SuW-it.js} +3 -3
- package/_assets/{index-Cd6atmT5.js → index-D79zSp02.js} +2 -2
- package/_assets/{index-DYql6z0j.js → index-D9fJ_vSK.js} +2 -2
- package/_assets/{index-DJkU_5N3.js → index-DGRnLDWH.js} +2 -2
- package/_assets/{index-gvhfk3Kf.js → index-DLhFNpoU.js} +2 -2
- package/_assets/{index-CVV8mr-f.js → index-DPlpNyjw.js} +2 -2
- package/_assets/{index-DPWoZxpF.js → index-DWuOAAMD.js} +2 -2
- package/_assets/{index-Bzs9W9Xf.js → index-DZEBHTEg.js} +2 -2
- package/_assets/{index-lmuWdSJU.js → index-Da6foJqq.js} +2 -2
- package/_assets/{index-CnxpIcjg.js → index-DbT_dlvW.js} +2 -2
- package/_assets/{index-DcqsKEsF.js → index-DpJZ0JXi.js} +2 -2
- package/_assets/{index-CJGZvhoi.js → index-DrFkvVPI.js} +2 -2
- package/_assets/{index-CrQTd_Vt.js → index-DwpSFEXD.js} +2 -2
- package/_assets/{index-BLwUrxaM.js → index-GwumEPdf.js} +2 -2
- package/_assets/{index-BBc3X6XF.js → index-H8n96za2.js} +320 -320
- package/_assets/{index-COocIzMl.js → index-HsiNU-re.js} +2 -2
- package/_assets/{index-B4sJodB8.js → index-QbxZdv5O.js} +2 -2
- package/_assets/{index-B2N1TlZf.js → index-YCiXcg3A.js} +2 -2
- package/_assets/{index-k1aOSuhb.js → index-_cxxEtGC.js} +4 -4
- package/_assets/{index-Bc0x7wx0.js → index-aDYfR8CR.js} +2 -2
- package/_assets/{index-BTtbpRCO.js → index-a_N7tcBy.js} +2 -2
- package/_assets/{index-Bv15foVK.css → index-gGBF8VP5.css} +1 -1
- package/_assets/{index-BDHBYg9U.js → index-hdr7Rn1C.js} +2 -2
- package/_assets/{index-B3dFnJQP.js → index-mPE8xcsy.js} +2 -2
- package/_assets/{index-CRNomRFG.js → index-mYBdKmU0.js} +2 -2
- package/_assets/{index-CMwT-EMo.js → index-pYvGgiYP.js} +2 -2
- package/_assets/{index-OaamUQLA.js → index-rm5b_51E.js} +2 -2
- package/_assets/{index-Dr7jRd9A.js → index-telJAbjh.js} +4 -4
- package/_assets/{index-CWzVzsYx.js → index-uNQ4UaZj.js} +2 -2
- package/_assets/{index-5R1NH3hO.js → index-uZnwhZEJ.js} +2 -2
- package/_assets/{index.es-CAomYnsN.js → index.es-BWB7mVUy.js} +2 -2
- package/_assets/{index.es-D_pn-sSx.js → index.es-CLy5ZnSq.js} +2 -2
- package/_assets/{index.es-xs2jYw5E.js → index.es-CY2AJvVS.js} +2 -2
- package/_assets/{index.es-B4j-BNrr.js → index.es-CeXxnUqU.js} +5 -5
- package/_assets/{items-empty-C7avnipb.js → items-empty-D0Gyzlgo.js} +2 -2
- package/_assets/{jump-C9PIzJMo.js → jump-CMNPjGEj.js} +2 -2
- package/_assets/{linkAccount-BbYoROZZ.js → linkAccount-CqkU_RyC.js} +2 -2
- package/_assets/{localBatchGatewayRequest-C1oGJkvn.js → localBatchGatewayRequest-Gxp4L2xz.js} +2 -2
- package/_assets/{native-D9_vWjzw.js → native-DD-1uQRx.js} +2 -2
- package/_assets/{networks-D-8eSR4f.js → networks-C8GBw0yX.js} +2 -2
- package/_assets/{onramp-CJNj90av.js → onramp-BtCPnHFZ.js} +2 -2
- package/_assets/{openzeppelin-DqgAToDp.js → openzeppelin-BmFzL8H3.js} +2 -2
- package/_assets/{ownerOf-Dt-ag82o.js → ownerOf-V1RN1W8_.js} +2 -2
- package/_assets/{parseNft-DUoA2cf9.js → parseNft-B1URb13x.js} +3 -3
- package/_assets/{parseSignature--ghdQtU2.js → parseSignature-Bl3qa9P_.js} +2 -2
- package/_assets/{parseSignature-DEThZFaN.js → parseSignature-DnnsdhHe.js} +4 -4
- package/_assets/{passkeys-CGWK9Quy.js → passkeys-CfDVU3MB.js} +2 -2
- package/_assets/{pay-with-exchange-BouUEn78.js → pay-with-exchange-BoJ0W8mH.js} +2 -2
- package/_assets/{prepare-contract-call-Cxatn87X.js → prepare-contract-call-ube_t-bx.js} +2 -2
- package/_assets/{qr-overlay-CTxRGEIz.js → qr-overlay-CbHI6HH0.js} +4 -4
- package/_assets/{react-CJ0-yyn7.js → react-CJs-wUB_.js} +2 -2
- package/_assets/{receive-DVMKwcdo.js → receive-B0wxKGye.js} +2 -2
- package/_assets/{resolveImplementation-a3DBQ8m8.js → resolveImplementation-Bf7ypkG9.js} +2 -2
- package/_assets/{resume-buy-Bq0nVPcE.js → resume-buy-Ceu9CDKI.js} +2 -2
- package/_assets/{rpc-B0RZ-vtD.js → rpc-C2nZTgaC.js} +2 -2
- package/_assets/{sales-empty-bGF50GDf.js → sales-empty-DAPuvwuN.js} +2 -2
- package/_assets/{search-empty-tgZpxVpX.js → search-empty-NnYeVLIT.js} +2 -2
- package/_assets/{secp256k1-1jgJmYWx.js → secp256k1-B5mm9Ap6.js} +2 -2
- package/_assets/{secp256k1-BxaRnytz.js → secp256k1-BbULSQ75.js} +2 -2
- package/_assets/{secp256k1-JJlVLcuk.js → secp256k1-CrZtYp4x.js} +2 -2
- package/_assets/{send-DMTfvSnB.js → send-BHwHc6sX.js} +2 -2
- package/_assets/{send-batch-transaction-BVT1kCg_.js → send-batch-transaction-DkvtV-Ux.js} +2 -2
- package/_assets/{send-eip712-transaction-B3M5RWsD.js → send-eip712-transaction-oNLa9Q4d.js} +3 -3
- package/_assets/{send-gasless-transaction-L4j1ZusH.js → send-gasless-transaction-DF9M6C6V.js} +3 -3
- package/_assets/{send-transaction-BbDZEBSv.js → send-transaction-D-CawH7u.js} +3 -3
- package/_assets/{sendMetaTransaction-BhpPcSya.js → sendMetaTransaction-BM7sdRfu.js} +2 -2
- package/_assets/{sendRawTransaction-DoZqg8jx.js → sendRawTransaction-wpWkMce6.js} +4 -4
- package/_assets/{sentry-D5q6Jl_E.js → sentry-DRYpCT2M.js} +3 -3
- package/_assets/{serializeTransaction-CKZVZu41.js → serializeTransaction-BMnx7WFd.js} +2 -2
- package/_assets/{session-proposal-CXoYD_S4.js → session-proposal-BObyZ_F2.js} +2 -2
- package/_assets/{session-request-CVNcyjpe.js → session-request-D5uV1SEf.js} +3 -3
- package/_assets/{sha256-B7YAclKN.js → sha256-DUK_hUi-.js} +2 -2
- package/_assets/{sha3-BhaNbge-.js → sha3-CaAPlP4i.js} +2 -2
- package/_assets/{signing-BhjVqedK.js → signing-BrDeQbOY.js} +4 -4
- package/_assets/{skeleton.styles-BBTzNQBL.js → skeleton.styles-CKaFFR4d.js} +2 -2
- package/_assets/{socials-CwtPBLJA.js → socials-BwpqLbiJ.js} +2 -2
- package/_assets/{styled-UgoNAbpl.js → styled-DoNw9l0w.js} +2 -2
- package/_assets/{swaps-Bnpjv3io.js → swaps-BPgm3gpv.js} +2 -2
- package/_assets/{thirdweb-CjXdOXcl.js → thirdweb-t7GklUUc.js} +4 -4
- package/_assets/{to-serializable-transaction-DW6Rxq_m.js → to-serializable-transaction-eU5E70kv.js} +3 -3
- package/_assets/{totalSupply-DjGpB4tZ.js → totalSupply-D8BQpbee.js} +2 -2
- package/_assets/{transaction-DuJWq6eX.js → transaction-CMkdCkE6.js} +2 -2
- package/_assets/{transactionReceipt-8SAHHVSP.js → transactionReceipt-BES2ER8Z.js} +2 -2
- package/_assets/{transactions-CKBlMfJD.js → transactions-DVxh-ktU.js} +2 -2
- package/_assets/{useCreditPacks-CBkUPkUM.js → useCreditPacks-BdtvxlkD.js} +2 -2
- package/_assets/{useInfiniteGrid-DHrXE4eM.js → useInfiniteGrid-CmWljViN.js} +2 -2
- package/_assets/{useStore-ckE2dxkp.js → useStore-CgQhGiUj.js} +3 -3
- package/_assets/{useTheme-CyUvY5YF.js → useTheme-Di5abbCR.js} +2 -2
- package/_assets/{utils-wnY81oYl.js → utils-CADt4JXW.js} +2 -2
- package/_assets/{verifyHash-DMMueGNF.js → verifyHash-DeUY0SHR.js} +2 -2
- package/_assets/{w3m-modal-BCGJhbtp.js → w3m-modal-Cnb4BWiH.js} +2 -2
- package/_assets/{w3m-modal-C1fyEGvy.js → w3m-modal-cQC4EN8u.js} +2 -2
- package/_assets/{wait-for-tx-receipt-D41lpt1M.js → wait-for-tx-receipt-CxnvYMVd.js} +2 -2
- package/_assets/{wallet-gc8JT2Jk.js → wallet-DseKvpun.js} +2 -2
- package/_assets/{wallets-_qhdmZdK.js → wallets-B7glggqp.js} +6 -6
- package/_assets/{web-connector-SZx3KLiq.js → web-connector-BdVHyGDY.js} +4 -4
- package/_assets/{writeContract-DNkvql92.js → writeContract-DGxmy1E5.js} +2 -2
- package/_assets/{zora-sepolia-Zq3rr1_u.js → zora-sepolia-CLCqQdy4.js} +2 -2
- package/_assets/{zoraTestnet-U_RmMDCL.js → zoraTestnet-C4wBdT3i.js} +2 -2
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/ItemDetail-2gzLCIOg.js +0 -3751
- package/_assets/collectionPage.styles-DyHk1tDQ.js +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{p as dt}from"./sentry-D5q6Jl_E.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-DRYpCT2M.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-mPE8xcsy.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,i as p,b as a}from"./lit-element-wjYUA6aF.js";import{d as w,r as b,e as g}from"./index-
|
|
1
|
+
import{a as h,i as p,b as a}from"./lit-element-wjYUA6aF.js";import{d as w,r as b,e as g}from"./index-BagBXcnv.js";import{c as m}from"./index-CsgJ7C3l.js";import"./index-rm5b_51E.js";import{O as c,E as x,l as v,C as _,W as C,R as $}from"./W3MFrameProviderSingleton-Bvy0-jo9.js";import{r as R}from"./class-map-D0tzaS-h.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="469df344-0274-45f3-bc5c-ec74d6425688",n._sentryDebugIdIdentifier="sentry-dbid-469df344-0274-45f3-bc5c-ec74d6425688")}catch{}})();const T=h``;var O=function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(t=(i<3?s(t):i>3?s(e,r,t):s(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let f=class extends p{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return!e&&!r?null:a`
|
|
2
2
|
<wui-flex
|
|
3
3
|
.padding=${["4","3","3","3"]}
|
|
4
4
|
flexDirection="column"
|
|
@@ -79,4 +79,4 @@ import{a as h,i as p,b as a}from"./lit-element-wjYUA6aF.js";import{d as w,r as b
|
|
|
79
79
|
>`:null}privacyTemplate(){const{privacyPolicyUrl:e}=c.state;return e?a`<a href=${e} target="_blank" rel="noopener noreferrer"
|
|
80
80
|
>Privacy Policy</a
|
|
81
81
|
>`:null}reownBrandingTemplate(e=!1){var r;return(r=this.remoteFeatures)!=null&&r.reownBranding?e?a`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:a`<wui-ux-by-reown></wui-ux-by-reown>`:null}};u.styles=[B];y([R()],u.prototype,"remoteFeatures",void 0);u=y([m("w3m-legal-footer")],u);
|
|
82
|
-
//# sourceMappingURL=index-
|
|
82
|
+
//# sourceMappingURL=index-mYBdKmU0.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./react-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import"./react-CJs-wUB_.js";(function(){try{var v=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new v.Error().stack;d&&(v._sentryDebugIds=v._sentryDebugIds||{},v._sentryDebugIds[d]="baaaa475-91e9-4202-946c-540a970b1d88",v._sentryDebugIdIdentifier="sentry-dbid-baaaa475-91e9-4202-946c-540a970b1d88")}catch{}})();var w={exports:{}},x;function O(){return x||(x=1,(function(v){var d=Object.prototype.hasOwnProperty,f="~";function y(){}Object.create&&(y.prototype=Object.create(null),new y().__proto__||(f=!1));function m(s,t,n){this.fn=s,this.context=t,this.once=n||!1}function g(s,t,n,r,l){if(typeof n!="function")throw new TypeError("The listener must be a function");var c=new m(n,r||s,l),o=f?f+t:t;return s._events[o]?s._events[o].fn?s._events[o]=[s._events[o],c]:s._events[o].push(c):(s._events[o]=c,s._eventsCount++),s}function b(s,t){--s._eventsCount===0?s._events=new y:delete s._events[t]}function u(){this._events=new y,this._eventsCount=0}u.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)d.call(n,r)&&t.push(f?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t},u.prototype.listeners=function(t){var n=f?f+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var l=0,c=r.length,o=new Array(c);l<c;l++)o[l]=r[l].fn;return o},u.prototype.listenerCount=function(t){var n=f?f+t:t,r=this._events[n];return r?r.fn?1:r.length:0},u.prototype.emit=function(t,n,r,l,c,o){var a=f?f+t:t;if(!this._events[a])return!1;var e=this._events[a],p=arguments.length,h,i;if(e.fn){switch(e.once&&this.removeListener(t,e.fn,void 0,!0),p){case 1:return e.fn.call(e.context),!0;case 2:return e.fn.call(e.context,n),!0;case 3:return e.fn.call(e.context,n,r),!0;case 4:return e.fn.call(e.context,n,r,l),!0;case 5:return e.fn.call(e.context,n,r,l,c),!0;case 6:return e.fn.call(e.context,n,r,l,c,o),!0}for(i=1,h=new Array(p-1);i<p;i++)h[i-1]=arguments[i];e.fn.apply(e.context,h)}else{var E=e.length,_;for(i=0;i<E;i++)switch(e[i].once&&this.removeListener(t,e[i].fn,void 0,!0),p){case 1:e[i].fn.call(e[i].context);break;case 2:e[i].fn.call(e[i].context,n);break;case 3:e[i].fn.call(e[i].context,n,r);break;case 4:e[i].fn.call(e[i].context,n,r,l);break;default:if(!h)for(_=1,h=new Array(p-1);_<p;_++)h[_-1]=arguments[_];e[i].fn.apply(e[i].context,h)}}return!0},u.prototype.on=function(t,n,r){return g(this,t,n,r,!1)},u.prototype.once=function(t,n,r){return g(this,t,n,r,!0)},u.prototype.removeListener=function(t,n,r,l){var c=f?f+t:t;if(!this._events[c])return this;if(!n)return b(this,c),this;var o=this._events[c];if(o.fn)o.fn===n&&(!l||o.once)&&(!r||o.context===r)&&b(this,c);else{for(var a=0,e=[],p=o.length;a<p;a++)(o[a].fn!==n||l&&!o[a].once||r&&o[a].context!==r)&&e.push(o[a]);e.length?this._events[c]=e.length===1?e[0]:e:b(this,c)}return this},u.prototype.removeAllListeners=function(t){var n;return t?(n=f?f+t:t,this._events[n]&&b(this,n)):(this._events=new y,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=f,u.EventEmitter=u,v.exports=u})(w)),w.exports}export{O as r};
|
|
2
|
+
//# sourceMappingURL=index-pYvGgiYP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as b,b as l}from"./lit-element-wjYUA6aF.js";import{n as s}from"./class-map-D0tzaS-h.js";import{c as f}from"./index-
|
|
1
|
+
import{i as b,b as l}from"./lit-element-wjYUA6aF.js";import{n as s}from"./class-map-D0tzaS-h.js";import{c as f}from"./index-CsgJ7C3l.js";import{d as p,r as m,e as v}from"./index-BagBXcnv.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]="64c7c618-3955-426f-9bd2-b0c61d80fcc5",e._sentryDebugIdIdentifier="sentry-dbid-64c7c618-3955-426f-9bd2-b0c61d80fcc5")}catch{}})();const y=p`
|
|
2
2
|
button {
|
|
3
3
|
border: none;
|
|
4
4
|
background: transparent;
|
|
@@ -66,4 +66,4 @@ import{i as b,b as l}from"./lit-element-wjYUA6aF.js";import{n as s}from"./class-
|
|
|
66
66
|
${this.iconTemplate()}
|
|
67
67
|
</button>
|
|
68
68
|
`}iconTemplate(){return this.icon?l`<wui-icon name=${this.icon} size="sm"></wui-icon>`:null}};n.styles=[m,v,y];a([s()],n.prototype,"size",void 0);a([s({type:Boolean})],n.prototype,"disabled",void 0);a([s()],n.prototype,"variant",void 0);a([s()],n.prototype,"icon",void 0);n=a([f("wui-link")],n);
|
|
69
|
-
//# sourceMappingURL=index-
|
|
69
|
+
//# sourceMappingURL=index-rm5b_51E.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-BHU0VbfL.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-BHU0VbfL.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-BHU0VbfL.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-6L5QieXK.js","_assets/index-H8n96za2.js","_assets/react-CJs-wUB_.js","_assets/dcl-schemas-CwPce9xx.js","_assets/sentry-DRYpCT2M.js","_assets/ethers-Bh0IYN8X.js","_assets/intl-AKLEHPeO.js","_assets/index-gGBF8VP5.css","_assets/sendRawTransaction-wpWkMce6.js","_assets/NetworkUtil-V2oGNpAE.js","_assets/W3MFrameProviderSingleton-Bvy0-jo9.js","_assets/index-BfQaNPBO.js","_assets/index-309Pjw0W.js","_assets/events-BwWaMw4H.js","_assets/browser-ponyfill-DGOvD8_z.js","_assets/custom-7xHLG0Xc.js","_assets/index-CWuKgAv2.js","_assets/index-pYvGgiYP.js","_assets/store-80QKZ2rN.js","_assets/writeContract-DGxmy1E5.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-Bvy0-jo9.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-V2oGNpAE.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-wpWkMce6.js";import"./dcl-schemas-CwPce9xx.js";import"./index-BfQaNPBO.js";import"./index-309Pjw0W.js";import"./browser-ponyfill-DGOvD8_z.js";import{_ as we}from"./index-H8n96za2.js";import{E as et}from"./index-CWuKgAv2.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-7xHLG0Xc.js";import{s as at,w as dt}from"./writeContract-DGxmy1E5.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]="00dcb16c-c2fa-402d-9da6-3ed97ba9debf",i._sentryDebugIdIdentifier="sentry-dbid-00dcb16c-c2fa-402d-9da6-3ed97ba9debf")}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-6L5QieXK.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-6L5QieXK.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-6L5QieXK.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-telJAbjh.js.map
|