@dcl/shop 0.7.3-31004613129.commit-29bd738 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-DHRw9r_G.js → Activity-BpEWDEgt.js} +9 -9
- package/_assets/{AnimatedBackground-lOgqKL4d.js → AnimatedBackground-whCeMUgc.js} +1 -1
- package/_assets/{Assets-VGMfDLPY.js → Assets-CH4B54Xy.js} +11 -11
- package/_assets/{Assets.styles-B_PmcugB.js → Assets.styles-DuSEfvzx.js} +2 -2
- package/_assets/{Authorizations-BDp7n41u.js → Authorizations-DTC0viZ7.js} +1 -1
- package/_assets/{Cart-Bs53nlQk.js → Cart-Ccdz2uXK.js} +2 -2
- package/_assets/{CircularProgress-BPWY_F37.js → CircularProgress-BkDrovgn.js} +1 -1
- package/_assets/{Collection-qqEYK-rA.js → Collection-LGp9HIwD.js} +3 -3
- package/_assets/{CollectionCarousel-C_JJAdFF.js → CollectionCarousel-CnR1So5p.js} +22 -22
- package/_assets/{ContentClient-C2puvDPt.js → ContentClient-CRr9ZuRH.js} +1 -1
- package/_assets/{Creator-BsWzWPDC.js → Creator-2jJw01qB.js} +21 -21
- package/_assets/{DeploymentBuilder-jIyneWTC.js → DeploymentBuilder-DYNbIRzZ.js} +1 -1
- package/_assets/{ErrorNotice-BiqT0Cec.js → ErrorNotice-BXWX_0E4.js} +1 -1
- package/_assets/{ExchangeController-PF6wI6Mp.js → ExchangeController-C_NxeYpZ.js} +1 -1
- package/_assets/{Faq-CwuXgMC7.js → Faq-BXT0tU5Q.js} +1 -1
- package/_assets/{GetCredits-CY9xW-3-.js → GetCredits-CiVv6zS4.js} +1 -1
- package/_assets/{Grow-nUylTs5m.js → Grow-d2ucdHqS.js} +1 -1
- package/_assets/{HelpersUtil-Bwy8o8bw.js → HelpersUtil-BsEaPmaI.js} +1 -1
- package/_assets/{ItemDetail-wxRF5CUO.js → ItemDetail-BxGSP-it.js} +1 -1
- package/_assets/LazyEmoteControls-D7IWhRxC.js +2 -0
- package/_assets/{LoadMore-oc9uIc47.js → LoadMore-DcIHY8Kf.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-CEtfxA02.js → ManaPricingBanner.styles-CxOm66Fo.js} +1 -1
- package/_assets/{MyAssets-BFWp9KWR.js → MyAssets-BozGMHXd.js} +1 -1
- package/_assets/{MyFavorites-BC0Zj7CR.js → MyFavorites-wLuasEwD.js} +1 -1
- package/_assets/{NotFound-BZASz5NG.js → NotFound-D9deZR03.js} +1 -1
- package/_assets/{NotificationsBell-DvmmUfvh.js → NotificationsBell-DULYJmKs.js} +1 -1
- package/_assets/{OutfitDetail-UMdvdT0P.js → OutfitDetail-B28zoBrk.js} +1 -1
- package/_assets/{OutfitPreview-BgPOBB1N.js → OutfitPreview-GRiCEESc.js} +1 -1
- package/_assets/{OutfitStudio-BUW7MldY.js → OutfitStudio-D7500MAI.js} +5 -5
- package/_assets/{StoreSettings-Cf-k3hGA.js → StoreSettings-DK8rP1ia.js} +1 -1
- package/_assets/{Success-cUrjdiUL.js → Success-zZ3HkHoh.js} +8 -8
- package/_assets/{SwapController-DDZdhbmi.js → SwapController-LhvwgYfv.js} +1 -1
- package/_assets/{Tooltip-eMANvv6_.js → Tooltip-Dh6dtNV3.js} +1 -1
- package/_assets/{TradeService-K5TbzQm1.js → TradeService-DjBvwlyu.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-ipn1OWk5.js → W3MFrameProviderSingleton-DyHElSGY.js} +3 -3
- package/_assets/{WebCryptoP256-BzRIl457.js → WebCryptoP256-CGMChTjg.js} +1 -1
- package/_assets/{authorizations-gBmiqrl2.js → authorizations-w-yCHVpU.js} +1 -1
- package/_assets/{basic-BX6XcCy2.js → basic-BwriZEC-.js} +1 -1
- package/_assets/{biconomy-FZ6cxo6V.js → biconomy-CeViGwXz.js} +1 -1
- package/_assets/{builder-C63nhwMn.js → builder-CYMYImB0.js} +1 -1
- package/_assets/{buy-BQ9t9Zrr.js → buy-DIVuBMot.js} +1 -1
- package/_assets/{buy-gasless-B-y8WMZ-.js → buy-gasless-DIfZSqYX.js} +1 -1
- package/_assets/{categories-4GVQVLVO.js → categories-BbYXk3ti.js} +32 -38
- package/_assets/{ccip-D3QGl9dR.js → ccip-CwIu0LfN.js} +1 -1
- package/_assets/{ccip-Dk-2B020.js → ccip-Sex5PzD_.js} +1 -1
- package/_assets/{collectionPage.styles-D9v6voUC.js → collectionPage.styles-CHbJGgda.js} +5 -5
- package/_assets/{controller-BuNan0kN.js → controller-DfTp5YOO.js} +2 -2
- package/_assets/{core-BGdcId97.js → core-BEK9pA3q.js} +4 -4
- package/_assets/{createSvgIcon-W_IY7RAQ.js → createSvgIcon-CU05oHiV.js} +1 -1
- package/_assets/{custom-BvhiNuVl.js → custom-BhGswfT_.js} +1 -1
- package/_assets/{data-capture-CmgoF3cw.js → data-capture-nvuZRuzg.js} +1 -1
- package/_assets/{dcl-schemas-Dr9BTjb7.js → dcl-schemas-CmtP3U6y.js} +1 -1
- package/_assets/{disposePreview-8oEf57G7.js → disposePreview-B96DpOZy.js} +1 -1
- package/_assets/{email-DKRlv_02.js → email-CieTjR51.js} +1 -1
- package/_assets/{embedded-wallet-DOzPMXtH.js → embedded-wallet-CI-r3uDX.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-Ddpetkdy.js → emotion-styled.browser.esm-BlQXcSKx.js} +1 -1
- package/_assets/{engine-T7LkHRv2.js → engine-CHP2eI44.js} +1 -1
- package/_assets/{errors-CPlWFAEN.js → errors-BAqCaL6O.js} +1 -1
- package/_assets/{estimate-l1-fee-DfTmkotx.js → estimate-l1-fee-D_pdXw9y.js} +1 -1
- package/_assets/{ethers-BHogtzPD.js → ethers-DejfrZ8i.js} +1 -1
- package/_assets/{execute-DY3XaITL.js → execute-BJuyrz_X.js} +2 -2
- package/_assets/{features-B0RaX-b9.js → features-B9o2bxOE.js} +1 -1
- package/_assets/{fetchTokenMetadata-CYkVqirC.js → fetchTokenMetadata-DeEXEM9T.js} +2 -2
- package/_assets/{field.styles-CGEOSW7q.js → field.styles-BYH2xB5-.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-CdwwL-l8.js → get-ecosystem-wallet-info-C5KzHIh2.js} +1 -1
- package/_assets/{getBalance-CNjN-sP8.js → getBalance-pkY6oxRI.js} +1 -1
- package/_assets/{getNFT-BfCcimFc.js → getNFT-BXJA28mr.js} +1 -1
- package/_assets/{getNFT-Dp7PGXVr.js → getNFT-CYm9n3Xd.js} +1 -1
- package/_assets/{grid.styles-DszJKyog.js → grid.styles-DoBUqqdT.js} +1 -1
- package/_assets/{hashTypedData-Qed0bO5s.js → hashTypedData-DpkGfcdz.js} +1 -1
- package/_assets/{hashTypedData-nM2s3pqE.js → hashTypedData-ONHChmVW.js} +1 -1
- package/_assets/{in-app-BIFA2e_r.js → in-app-GxZkDa12.js} +1 -1
- package/_assets/{in-app-wallet-calls-BS-El40Z.js → in-app-wallet-calls-B91UMKOr.js} +1 -1
- package/_assets/{index-N1lD9YVF.js → index--dDDhPCb.js} +1 -1
- package/_assets/{index-S3QJcEor.js → index-5GNI01Ww.js} +1 -1
- package/_assets/{index-CTeErQvD.js → index-73vZ1csI.js} +1 -1
- package/_assets/{index-DdKv_wFT.js → index-8TbyLPoA.js} +2 -2
- package/_assets/{index-DTS28jX1.js → index-B-FT9tly.js} +1 -1
- package/_assets/{index-DxkHHnyf.js → index-B49Ra42Y.js} +2 -2
- package/_assets/{index-DsSyWLy-.js → index-B4d9kGHc.js} +1 -1
- package/_assets/{index-DMtPghPO.js → index-B6MX4qjW.js} +3 -3
- package/_assets/{index-CnEDwKLU.js → index-BACQuryf.js} +1 -1
- package/_assets/{index-oAhypoXM.js → index-BFFeuHAN.js} +1 -1
- package/_assets/{index-DBr7T_eT.js → index-BH5LU_4T.js} +1 -1
- package/_assets/{index-WJ3npObe.js → index-BJM0Y8Dj.js} +1 -1
- package/_assets/{index-rNjzxsiO.js → index-BWh4oQv2.js} +1 -1
- package/_assets/{index-DeSzNtSp.js → index-BX8-GtYO.js} +3 -3
- package/_assets/{index-BiJICnih.js → index-BYlZ9YbP.js} +1 -1
- package/_assets/{index-DBjvq-XI.js → index-B_JiruyT.js} +1 -1
- package/_assets/{index-Ba80g_QU.js → index-Bk7mlw_4.js} +1 -1
- package/_assets/{index-BZQAtid_.js → index-BkDtNpJ9.js} +1 -1
- package/_assets/{index-7NadBeuh.js → index-BkMwrTJ3.js} +1 -1
- package/_assets/{index-Bl0AjSkb.js → index-Bk_uITsR.js} +1 -1
- package/_assets/{index-B42zNTgr.js → index-Bmq5dKA-.js} +1 -1
- package/_assets/{index-DT2QfQDk.js → index-BpBengnA.js} +1 -1
- package/_assets/{index-oUhlt_Bb.js → index-BsE741-i.js} +1 -1
- package/_assets/{index-BMd58yCH.js → index-Bzt1xZyM.js} +1 -1
- package/_assets/{index-DrQ4_MN_.js → index-C33PRPh0.js} +1 -1
- package/_assets/{index-Lyytmv-l.js → index-C5F4093w.js} +1 -1
- package/_assets/{index-DMepoE3Z.js → index-CIQQJerR.js} +1 -1
- package/_assets/{index-CLwUPuZs.js → index-CMV7iaeR.js} +1 -1
- package/_assets/{index-DyqDagNo.js → index-CRQCirWA.js} +1 -1
- package/_assets/{index-BkRxRlme.js → index-Cakc_FOK.js} +1 -1
- package/_assets/{index-DNr9nntg.js → index-CrYXAQF7.js} +1 -1
- package/_assets/{index-BxSBXkoJ.js → index-CtybxktV.js} +1 -1
- package/_assets/{index-DlVK89jK.js → index-Cu9CgJO0.js} +1 -1
- package/_assets/{index-C1B5cU5h.js → index-Cv1Bu0gQ.js} +1 -1
- package/_assets/{index-D1j9ElOD.js → index-D3BUTCsu.js} +1 -1
- package/_assets/{index-BZON-2rL.js → index-D4Aqu34H.js} +1 -1
- package/_assets/{index-lM2OO31J.js → index-DEPPVv3y.js} +3 -3
- package/_assets/{index-C9FU26y1.js → index-DGI43LaB.js} +1 -1
- package/_assets/{index-_IBCVipy.js → index-DMNGIYYv.js} +1 -1
- package/_assets/{index-DYx3Y8hN.js → index-DOiEVNYb.js} +1 -1
- package/_assets/index-DOxWmjOH.js +1 -0
- package/_assets/{index-DdGXSTOn.js → index-DPmmgd_P.js} +1 -1
- package/_assets/index-DbCMsBDL.js +3504 -0
- package/_assets/{index-RY9Ezazi.js → index-De1oZcbD.js} +7 -7
- package/_assets/{index-CVEuy3QH.js → index-Dfv984cL.js} +1 -1
- package/_assets/{index-BVQ9R8Ou.js → index-DhNV3-07.js} +1 -1
- package/_assets/{index-CRVeI5_c.js → index-DxSEHau1.js} +1 -1
- package/_assets/{index-Ci9bIwy_.js → index-E7P9-xl1.js} +1 -1
- package/_assets/{index-U9sHU96u.js → index-G6kG-9qx.js} +1 -1
- package/_assets/{index-EMfiBMg7.js → index-INHGq5Es.js} +1 -1
- package/_assets/index-JweqbyGF.js +2 -0
- package/_assets/{index-DpxbmIMg.js → index-L_H5aHd6.js} +1 -1
- package/_assets/{index-ClflEUAF.js → index-OqCfgEJv.js} +1 -1
- package/_assets/{index-CBJPuKa9.js → index-OxDwxhIP.js} +1 -1
- package/_assets/{index-C2Q5s1eA.js → index-_943ql8C.js} +1 -1
- package/_assets/{index-CzV_L3_6.js → index-__99MHKr.js} +2 -2
- package/_assets/{index-BiwxPZf9.js → index-l4-9ZZLe.js} +3 -3
- package/_assets/{index-CAAOpbIF.js → index-t0T-6ZrA.js} +1 -1
- package/_assets/{index.es-BwDqaf8R.js → index.es-7bD3vSL6.js} +4 -4
- package/_assets/{index.es-Dcp_TMfU.js → index.es-DD8zy1OU.js} +1 -1
- package/_assets/{index.es-BmKNbSKx.js → index.es-DdtYF7po.js} +1 -1
- package/_assets/{localBatchGatewayRequest-JfP-082C.js → localBatchGatewayRequest-Cqcm6wSH.js} +1 -1
- package/_assets/{networks-BCXn0uun.js → networks-BsQOwKdI.js} +1 -1
- package/_assets/{onramp-BC8u85Rq.js → onramp-CutBYUPg.js} +1 -1
- package/_assets/{openzeppelin-BA7UqeqU.js → openzeppelin-K-AgEyIf.js} +1 -1
- package/_assets/{parseNft-zNfP6wMG.js → parseNft-pYm9OVKe.js} +2 -2
- package/_assets/{parseSignature-BqSmw9-v.js → parseSignature-BrLHTUOQ.js} +3 -3
- package/_assets/{parseSignature-DWC-KHKy.js → parseSignature-DnyPA3OO.js} +1 -1
- package/_assets/{passkeys-CIu_Utx8.js → passkeys-zi3xVlV1.js} +1 -1
- package/_assets/{pay-with-exchange-DsggiL3i.js → pay-with-exchange-pvINEHpN.js} +1 -1
- package/_assets/{qr-overlay-Drv1G6MN.js → qr-overlay-CLKlyiw2.js} +1 -1
- package/_assets/{receive-CeqabMKU.js → receive-BLXAcZ6B.js} +1 -1
- package/_assets/{resolveImplementation-CQyxSY4d.js → resolveImplementation-CfgIWk0L.js} +1 -1
- package/_assets/{rpc-B3h6KQXA.js → rpc-C2ZJH6qL.js} +1 -1
- package/_assets/{secp256k1-i_L0DASD.js → secp256k1--GaGebUJ.js} +1 -1
- package/_assets/{secp256k1-CrlTAPJ_.js → secp256k1-BPdRWJXL.js} +1 -1
- package/_assets/{secp256k1-B5_ud9a2.js → secp256k1-DQNL-k-L.js} +1 -1
- package/_assets/{send-u523DWGF.js → send-Cl_aA-ga.js} +1 -1
- package/_assets/{send-batch-transaction-BsS_vCy3.js → send-batch-transaction-1ElceULH.js} +1 -1
- package/_assets/{send-eip712-transaction-Cr4-Q79f.js → send-eip712-transaction-BV_DsAbU.js} +2 -2
- package/_assets/{send-gasless-transaction-BGa7BHKv.js → send-gasless-transaction-eTi92Rfc.js} +2 -2
- package/_assets/{send-transaction-Ckey7MpC.js → send-transaction-DWimy5qX.js} +2 -2
- package/_assets/{sendMetaTransaction-C_M5KgcT.js → sendMetaTransaction-B6HBQ8NH.js} +1 -1
- package/_assets/{sendRawTransaction-C7O5sdy-.js → sendRawTransaction-6C6FbT-9.js} +3 -3
- package/_assets/{serializeTransaction-Bqahk7NV.js → serializeTransaction-DJpTnAzh.js} +1 -1
- package/_assets/{session-proposal-10rDfTdh.js → session-proposal-B1fE_9QJ.js} +1 -1
- package/_assets/{session-request-DLQ4W5j6.js → session-request-DVlIT2Cz.js} +2 -2
- package/_assets/{signing-DgL5hw-1.js → signing-C2OtEE_7.js} +3 -3
- package/_assets/{socials-Iclu6gpv.js → socials-CwiK-Oz5.js} +1 -1
- package/_assets/{styled-BtpmW8vE.js → styled-INC_AiMB.js} +2 -2
- package/_assets/{swaps-Dio5DiT_.js → swaps-Cz6uslns.js} +1 -1
- package/_assets/{thirdweb-0ZVJwYkE.js → thirdweb-QagPg_5G.js} +3 -3
- package/_assets/{to-serializable-transaction-DegngUV6.js → to-serializable-transaction-CI3ePtUl.js} +2 -2
- package/_assets/{transactionReceipt-CmwM9KP5.js → transactionReceipt-B2jt8_c5.js} +1 -1
- package/_assets/{transactions-DELzUAyE.js → transactions-DuxoNdoM.js} +1 -1
- package/_assets/{useCreditPacks-CfD1NWa_.js → useCreditPacks-CeoLpXxe.js} +1 -1
- package/_assets/{useImportable-BT9O6VkF.js → useImportable-CHlGR9sz.js} +1 -1
- package/_assets/{useInfiniteGrid-DtKMGQpL.js → useInfiniteGrid-D9jUBgv1.js} +1 -1
- package/_assets/{useTheme-DWUAjMsm.js → useTheme-HGI9qk_L.js} +1 -1
- package/_assets/{verifyHash-Dfknpu50.js → verifyHash-BWYK-_oQ.js} +1 -1
- package/_assets/{w3m-modal-CdoCVhdl.js → w3m-modal-C_cXhjYQ.js} +1 -1
- package/_assets/{w3m-modal-C0qGnhfo.js → w3m-modal-DeCOfGwP.js} +1 -1
- package/_assets/{wait-for-tx-receipt-Bwjk5Mq0.js → wait-for-tx-receipt-D52q1hNL.js} +1 -1
- package/_assets/{wallets-CTtGK85J.js → wallets-BiRgfoDB.js} +5 -5
- package/_assets/{web-connector-DVU2yQ5E.js → web-connector-CI1NmWV2.js} +3 -3
- package/_assets/{writeContract-C0uKNOQ8.js → writeContract-J3cBsNY4.js} +1 -1
- package/_assets/{zoraTestnet-CwVNTWsU.js → zoraTestnet-zRF1Vikt.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/LazyEmoteControls-DBB9eg39.js +0 -2
- package/_assets/index-BIBRNTUK.js +0 -3386
- package/_assets/index-DWVWkLU-.js +0 -2
- package/_assets/index-qY7j72YC.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/fortmatic-EI5cNLV0.js","_assets/react-DehiWSvs.js","_assets/index-C1B5cU5h.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-BHogtzPD.js","_assets/sentry-973sfbO9.js","_assets/index-COjgItKg.js","_assets/index-CVEuy3QH.js","_assets/index-CTpdUOYC.js","_assets/hooks.module-C4R15-Vr.js","_assets/events-DQ172AOg.js","_assets/intl-CBcMB1D2.js","_assets/index-DeSzNtSp.js","_assets/index-BIBRNTUK.js","_assets/index-D-NhBWWr.css","_assets/W3MFrameProviderSingleton-ipn1OWk5.js","_assets/index-DI-3MKLG.js","_assets/browser-ponyfill-I5CKtKME.js","_assets/NetworkUtil-EoWQDMpU.js","_assets/index-EMfiBMg7.js","_assets/index-nibyPLVP.js","_assets/index-CnEDwKLU.js","_assets/index.es-BmKNbSKx.js","_assets/lit-element-B3y9oplH.js","_assets/index-BiwxPZf9.js","_assets/sendRawTransaction-C7O5sdy-.js","_assets/index-CcbRdBPP.js","_assets/store-CraP4F4Y.js","_assets/custom-BvhiNuVl.js","_assets/writeContract-C0uKNOQ8.js","_assets/networks-BCXn0uun.js","_assets/zoraTestnet-CwVNTWsU.js","_assets/verifyHash-Dfknpu50.js","_assets/secp256k1-i_L0DASD.js","_assets/serializeTransaction-Bqahk7NV.js","_assets/index-CSlo2BeJ.js","_assets/index-DftqIOqz.js","_assets/index-DrQ4_MN_.js","_assets/index-U9sHU96u.js","_assets/wallets-CTtGK85J.js","_assets/signing-DgL5hw-1.js","_assets/prepare-contract-call-BnXbUbQT.js","_assets/utils-B9hEgCzc.js","_assets/to-serializable-transaction-DegngUV6.js","_assets/transaction-BRB0QRZP.js","_assets/get-bytecode-knYex1Eu.js","_assets/execute-DY3XaITL.js","_assets/detectExtension-DEjVJeUh.js","_assets/linkAccount-BodpWbRq.js","_assets/index-DMtPghPO.js","_assets/ethereum-CliiIOgc.js","_assets/types-DC0Zmj1B.js","_assets/hashTypedData-nM2s3pqE.js","_assets/send-transaction-Ckey7MpC.js","_assets/eth_sendRawTransaction-DPdnXbFR.js","_assets/index-CJdot1dH.js","_assets/in-app-BIFA2e_r.js","_assets/passkeys-CIu_Utx8.js","_assets/uint8-array-CjVHUazS.js","_assets/thirdweb-0ZVJwYkE.js","_assets/wait-for-tx-receipt-Bwjk5Mq0.js","_assets/transactionReceipt-CmwM9KP5.js","_assets/sleep-mAKpSMLY.js","_assets/eth_estimateGas-BmR_JMy9.js","_assets/eth_getStorageAt-BUYdIAYw.js","_assets/eth_getTransactionCount-riJ8hG2K.js","_assets/decimals-BpjIyOut.js","_assets/decimals-B3pg7hp8.js","_assets/zora-sepolia-Dv22rzxP.js","_assets/send-batch-transaction-BsS_vCy3.js","_assets/chains-DPlhC0Sw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var ce=Object.defineProperty;var de=(o,n,e)=>n in o?ce(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var d=(o,n,e)=>de(o,typeof n!="symbol"?n+"":n,e);import{c as h,e as l,f as g}from"./dcl-schemas-Dr9BTjb7.js";import{g as ue}from"./react-DehiWSvs.js";import{r as he}from"./events-DQ172AOg.js";import{_ as m}from"./index-BIBRNTUK.js";var C;(function(o){o.Update="Web3ReactUpdate",o.Error="Web3ReactError",o.Deactivate="Web3ReactDeactivate"})(C||(C={}));const le={clientId:"e1adce863fe287bb6cf0e3fd90bdb77f",chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY]},pe={storageKey:"decentraland-connect-storage-key",[l.ProviderType.INJECTED]:{},[l.ProviderType.FORTMATIC]:{apiKeys:{[h.ChainId.ETHEREUM_MAINNET]:"pk_live_F8E24DF8DD5BCBC5",[h.ChainId.ETHEREUM_SEPOLIA]:"pk_test_5B728BEFE5C10911"},urls:A(l.ProviderType.FORTMATIC)},[l.ProviderType.NETWORK]:{urls:A(l.ProviderType.NETWORK)},[l.ProviderType.WALLET_LINK]:{appName:"Decentraland",urls:A(l.ProviderType.WALLET_LINK)},[l.ProviderType.WALLET_CONNECT_V2]:{projectId:"61570c542c2d66c659492e5b24a41522",urls:A(l.ProviderType.WALLET_CONNECT_V2),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.ARBITRUM_MAINNET,h.ChainId.OPTIMISM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},[l.ProviderType.MAGIC]:{apiKey:"pk_live_212568025B158355",urls:A(l.ProviderType.MAGIC),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.OPTIMISM_MAINNET,h.ChainId.ARBITRUM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},[l.ProviderType.MAGIC_TEST]:{apiKey:"pk_live_CE856A4938B36648",urls:A(l.ProviderType.MAGIC),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.OPTIMISM_MAINNET,h.ChainId.ARBITRUM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},thirdweb:le};function I(){return pe}function A(o){const n={[h.ChainId.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[h.ChainId.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[h.ChainId.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[h.ChainId.MATIC_AMOY]:"https://rpc.decentraland.org/amoy",[h.ChainId.ARBITRUM_MAINNET]:"https://rpc.decentraland.org/arbitrum",[h.ChainId.OPTIMISM_MAINNET]:"https://rpc.decentraland.org/optimism",[h.ChainId.AVALANCHE_MAINNET]:"https://rpc.decentraland.org/avalanche",[h.ChainId.BSC_MAINNET]:"https://rpc.decentraland.org/binance",[h.ChainId.FANTOM_MAINNET]:"https://rpc.decentraland.org/fantom"};let e="";switch(o){case l.ProviderType.WALLET_LINK:e="walletlink";break;case l.ProviderType.FORTMATIC:e="fortmatic";break;case l.ProviderType.MAGIC:e="magic";break;case l.ProviderType.MAGIC_TEST:e="magic";break;case l.ProviderType.WALLET_CONNECT_V2:e="walletconnect-v2";break;case l.ProviderType.THIRDWEB:e="thirdweb";break}if(e){const t=Object.keys(n);for(const r of t)n[r]+=`?project=${e}`}return n}var $=he();const je=ue($);function fe(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var E=(function(o){fe(n,o);function n(t){var r,i=t===void 0?{}:t,s=i.supportedChainIds;return r=o.call(this)||this,r.supportedChainIds=s,r}var e=n.prototype;return e.emitUpdate=function(r){this.emit(C.Update,r)},e.emitError=function(r){this.emit(C.Error,r)},e.emitDeactivate=function(){this.emit(C.Deactivate)},n})($.EventEmitter);class z extends E{constructor(e){const t=I()[g.ProviderType.FORTMATIC],r=Object.keys(t.apiKeys).map(i=>Number(i));if(!r.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:r});d(this,"apiKey");d(this,"chainId");d(this,"rpcUrl");d(this,"fortmatic");this.apiKey=t.apiKeys[e],this.chainId=e,this.rpcUrl=t.urls[e]}async activate(){if(!this.fortmatic){const{default:t}=await m(async()=>{const{default:r}=await import("./fortmatic-EI5cNLV0.js").then(i=>i.f);return{default:r}},__vite__mapDeps([0,1]));this.fortmatic=new t(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(t=>t[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}close(){return this.fortmatic.user.logout()}}function j(){return j=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])}return o},j.apply(this,arguments)}function q(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}function K(o){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},K(o)}function L(o,n){return L=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},L(o,n)}function ve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(o,n,e){return ve()?O=Reflect.construct:O=function(r,i,s){var a=[null];a.push.apply(a,i);var c=Function.bind.apply(r,a),u=new c;return s&&L(u,s.prototype),u},O.apply(null,arguments)}function we(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function S(o){var n=typeof Map=="function"?new Map:void 0;return S=function(t){if(t===null||!we(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return O(t,arguments,K(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),L(r,t)},S(o)}function b(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function P(o,n){try{var e=o()}catch(t){return n(t)}return e&&e.then?e.then(void 0,n):e}function y(o){return o.hasOwnProperty("result")?o.result:o}var k=(function(o){q(n,o);function n(){var e;return e=o.call(this)||this,e.name=e.constructor.name,e.message="No Ethereum provider was found on window.ethereum.",e}return n})(S(Error)),ge=(function(o){q(n,o);function n(){var e;return e=o.call(this)||this,e.name=e.constructor.name,e.message="The user rejected the request.",e}return n})(S(Error)),me=(function(o){q(n,o);function n(t){var r;return r=o.call(this,t)||this,r.handleNetworkChanged=r.handleNetworkChanged.bind(b(r)),r.handleChainChanged=r.handleChainChanged.bind(b(r)),r.handleAccountsChanged=r.handleAccountsChanged.bind(b(r)),r.handleClose=r.handleClose.bind(b(r)),r}var e=n.prototype;return e.handleChainChanged=function(r){this.emitUpdate({chainId:r,provider:window.ethereum})},e.handleAccountsChanged=function(r){r.length===0?this.emitDeactivate():this.emitUpdate({account:r[0]})},e.handleClose=function(r,i){this.emitDeactivate()},e.handleNetworkChanged=function(r){this.emitUpdate({chainId:r,provider:window.ethereum})},e.activate=function(){try{var r=function(f){if(i)return f;function p(){return j({provider:window.ethereum},a?{account:a}:{})}var v=(function(){if(!a)return Promise.resolve(window.ethereum.enable().then(function(T){return T&&y(T)[0]})).then(function(T){a=T})})();return v&&v.then?v.then(p):p(v)},i=!1,s=this;if(!window.ethereum)throw new k;window.ethereum.on&&(window.ethereum.on("chainChanged",s.handleChainChanged),window.ethereum.on("accountsChanged",s.handleAccountsChanged),window.ethereum.on("close",s.handleClose),window.ethereum.on("networkChanged",s.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var a,c=P(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return y(u)[0]})).then(function(u){a=u})},function(u){if(u.code===4001)throw new ge});return Promise.resolve(c&&c.then?c.then(r):r(c))}catch(u){return Promise.reject(u)}},e.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(r){return Promise.reject(r)}},e.getChainId=function(){try{var r=function(){function c(){if(!i)try{i=y(window.ethereum.send({method:"net_version"}))}catch{}return i||(window.ethereum.isDapper?i=y(window.ethereum.cachedResults.net_version):i=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),i}var u=(function(){if(!i){var f=P(function(){return Promise.resolve(window.ethereum.send("net_version").then(y)).then(function(p){i=p})},function(){});if(f&&f.then)return f.then(function(){})}})();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new k;var i,s=P(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(y)).then(function(a){i=a})},function(){});return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}},e.getAccount=function(){try{var r=function(){function c(){return i||(i=y(window.ethereum.send({method:"eth_accounts"}))[0]),i}var u=(function(){if(!i){var f=P(function(){return Promise.resolve(window.ethereum.enable().then(function(p){return y(p)[0]})).then(function(p){i=p})},function(){});if(f&&f.then)return f.then(function(){})}})();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new k;var i,s=P(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(a){return y(a)[0]})).then(function(a){i=a})},function(){});return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}},e.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},e.isAuthorized=function(){try{return window.ethereum?Promise.resolve(P(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(r){return y(r).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(r){return Promise.reject(r)}},n})(E);class G extends Error{constructor(){super("There was an error unlocking your wallet. Please be sure your wallet is unlocked and try again."),this.name="ErrorUnlockingWallet"}}const Ie=60*1e3;class J extends me{constructor(n){super({supportedChainIds:[n]})}async activate(){const n=new Promise((t,r)=>{setTimeout(()=>{r(new G)},Ie)}),e=super.activate();return Promise.race([e,n])}}var ye="Invariant failed";function V(o,n){throw new Error(ye)}function Y(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,N(o,n)}function D(o){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},D(o)}function N(o,n){return N=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},N(o,n)}function Ce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function R(o,n,e){return Ce()?R=Reflect.construct:R=function(r,i,s){var a=[null];a.push.apply(a,i);var c=Function.bind.apply(r,a),u=new c;return s&&N(u,s.prototype),u},R.apply(null,arguments)}function Ee(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function W(o){var n=typeof Map=="function"?new Map:void 0;return W=function(t){if(t===null||!Ee(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return R(t,arguments,D(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),N(r,t)},W(o)}var U=(function(o){Y(n,o);function n(e,t,r){var i;return i=o.call(this)||this,i.code=t,i.data=r,i.name=i.constructor.name,i.message=e,i}return n})(W(Error)),Ae=function(n,e){var t=this,r=this;this.isMetaMask=!1,this.sendAsync=function(s,a){console.log("sendAsync",s.method,s.params),r.request(s.method,s.params).then(function(c){return a(null,{jsonrpc:"2.0",id:s.id,result:c})}).catch(function(c){return a(c,null)})},this.request=function(s,a){try{return typeof s!="string"&&(a=s.params,s=s.method),Promise.resolve(fetch(t.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:s,params:a}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new U(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,p,v;throw new U(u==null||(f=u.error)==null?void 0:f.message,u==null||(p=u.error)==null?void 0:p.code,u==null||(v=u.error)==null?void 0:v.data)}else{if("result"in u)return u.result;throw new U("Received unexpected JSON-RPC response to "+s+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=n,this.url=e;var i=new URL(e);this.host=i.host,this.path=i.pathname},Te=(function(o){Y(n,o);function n(t){var r,i=t.urls,s=t.defaultChainId;return s||Object.keys(i).length===1||V(),r=o.call(this,{supportedChainIds:Object.keys(i).map(function(a){return Number(a)})})||this,r.currentChainId=s||Number(Object.keys(i)[0]),r.providers=Object.keys(i).reduce(function(a,c){return a[Number(c)]=new Ae(Number(c),i[Number(c)]),a},{}),r}var e=n.prototype;return e.activate=function(){try{var r=this;return Promise.resolve({provider:r.providers[r.currentChainId],chainId:r.currentChainId,account:null})}catch(i){return Promise.reject(i)}},e.getProvider=function(){try{var r=this;return Promise.resolve(r.providers[r.currentChainId])}catch(i){return Promise.reject(i)}},e.getChainId=function(){try{var r=this;return Promise.resolve(r.currentChainId)}catch(i){return Promise.reject(i)}},e.getAccount=function(){return Promise.resolve(null)},e.deactivate=function(){},e.changeChainId=function(r){Object.keys(this.providers).includes(r.toString())||V(),this.currentChainId=r,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:r})},n})(E);class Q extends Te{constructor(n){super({urls:I()[l.ProviderType.NETWORK].urls,defaultChainId:n})}}function x(){return x=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])}return o},x.apply(this,arguments)}function Pe(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,F(o,n)}function F(o,n){return F=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},F(o,n)}function B(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}var _e=1,Ne=(function(o){Pe(n,o);function n(t){var r,i=t.url,s=t.appName,a=t.appLogoUrl,c=t.darkMode,u=t.supportedChainIds;return r=o.call(this,{supportedChainIds:u})||this,r.url=i,r.appName=s,r.appLogoUrl=a,r.darkMode=c||!1,r.handleChainChanged=r.handleChainChanged.bind(B(r)),r.handleAccountsChanged=r.handleAccountsChanged.bind(B(r)),r}var e=n.prototype;return e.activate=function(){try{var r=this,i=function(){return Promise.resolve(r.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return r.provider.on("chainChanged",r.handleChainChanged),r.provider.on("accountsChanged",r.handleAccountsChanged),{provider:r.provider,account:u}})},s=(function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)r.provider=window.ethereum;else{var a=(function(){if(!r.walletLink)return Promise.resolve(m(()=>import("./index-C1B5cU5h.js").then(c=>c.i),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11])).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){r.walletLink=new c(x({appName:r.appName,darkMode:r.darkMode},r.appLogoUrl?{appLogoUrl:r.appLogoUrl}:{})),r.provider=r.walletLink.makeWeb3Provider(r.url,_e)})})();if(a&&a.then)return a.then(function(){})}})();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(a){return Promise.reject(a)}},e.getProvider=function(){try{var r=this;return Promise.resolve(r.provider)}catch(i){return Promise.reject(i)}},e.getChainId=function(){try{var r=this;return Promise.resolve(r.provider.chainId)}catch(i){return Promise.reject(i)}},e.getAccount=function(){try{var r=this;return Promise.resolve(r.provider.request({method:"eth_requestAccounts"})).then(function(i){return i[0]})}catch(i){return Promise.reject(i)}},e.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},e.close=function(){try{var r=this;return r.provider.close(),r.emitDeactivate(),Promise.resolve()}catch(i){return Promise.reject(i)}},e.handleChainChanged=function(r){this.emitUpdate({chainId:r})},e.handleAccountsChanged=function(r){this.emitUpdate({account:r[0]})},n})(E);class X extends Ne{constructor(n){const e=I()[g.ProviderType.WALLET_LINK],t=e.urls[n];if(!t)throw new Error(`Unsupported chainId for WalletLink: ${n}. Supported chains: ${Object.keys(e.urls).join(", ")}`);super({url:t,appName:e.appName,supportedChainIds:[n]})}}class Me{}class Z extends Me{get(n){const e=window.localStorage.getItem(n);return e===null?void 0:e}set(n,e){window.localStorage.setItem(n,e)}remove(n){window.localStorage.removeItem(n)}removeRegExp(n){for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&n.test(t)&&localStorage.removeItem(t)}}}const be={[g.ChainId.ETHEREUM_MAINNET]:"mainnet",[g.ChainId.ETHEREUM_SEPOLIA]:"sepolia",[g.ChainId.MATIC_MAINNET]:"polygon",[g.ChainId.MATIC_AMOY]:"polygonAmoy",[g.ChainId.ARBITRUM_MAINNET]:"arbitrum",[g.ChainId.OPTIMISM_MAINNET]:"optimism",[g.ChainId.AVALANCHE_MAINNET]:"avalanche",[g.ChainId.BSC_MAINNET]:"bsc",[g.ChainId.FANTOM_MAINNET]:"fantom"},w=class w extends E{constructor(e){super({supportedChainIds:w.configuration.chains});d(this,"desiredChainId");d(this,"appKit");d(this,"provider");d(this,"accountUnsubscribe");d(this,"networkUnsubscribe");d(this,"initAppKit",async()=>{if(w.sharedAppKit)return this.appKit=w.sharedAppKit,this.appKit;const{createAppKit:e}=await m(async()=>{const{createAppKit:s}=await import("./index-DeSzNtSp.js").then(a=>a.h);return{createAppKit:s}},__vite__mapDeps([12,13,1,5,3,4,11,14,15,16,17,18,19,20,21,22,23])),{WagmiAdapter:t}=await m(async()=>{const{WagmiAdapter:s}=await import("./index-BiwxPZf9.js").then(a=>a.b);return{WagmiAdapter:s}},__vite__mapDeps([24,15,3,16,1,5,17,18,13,4,11,14,25,26,6,27,28,29])),r=await this.getNetworks(),i=new t({networks:r,projectId:w.configuration.projectId});return this.appKit=e({adapters:[i],projectId:w.configuration.projectId,networks:r,defaultNetwork:r[0],metadata:{name:"Decentraland",description:"Decentraland - Virtual World",url:typeof window<"u"?window.location.origin:"https://decentraland.org",icons:["https://decentraland.org/favicon.ico"]},themeMode:"dark",themeVariables:{"--w3m-z-index":3e3},features:{analytics:!1,email:!1,socials:!1,onramp:!1,swaps:!1},enableInjected:!0,enableEIP6963:!0}),w.sharedAppKit=this.appKit,await this.waitForSessionRestore(),this.appKit});d(this,"waitForSessionRestore",async()=>{const e=this.appKit;if(!e)return;const t=e.getAccount();if((t==null?void 0:t.status)==="connected"||(t==null?void 0:t.status)==="disconnected")return;const r=t!=null&&t.status?5e3:500;return new Promise(i=>{const s=setTimeout(()=>{a==null||a(),i()},r),a=e.subscribeAccount(c=>{((c==null?void 0:c.status)==="connected"||(c==null?void 0:c.status)==="disconnected")&&(clearTimeout(s),a==null||a(),i())},"eip155")})});d(this,"validateRestoredSession",async e=>{try{const t=e.getWalletProvider();return t?(await t.request({method:"eth_chainId"}),!0):!1}catch(t){return w.isStaleSessionError(t)?!1:(console.warn("Error validating WalletConnect session:",t),!0)}});d(this,"openModalAndWaitForConnection",async()=>{const e=this.requireAppKit(),t=()=>new Promise((r,i)=>{let s=!1;const a=(p,v)=>{s||(s=!0,clearTimeout(c),p==null||p(),v==null||v())},c=setTimeout(()=>{a(),i(new Error("Connection timeout"))},3e5),u=e.subscribeAccount(p=>{p!=null&&p.isConnected&&(p!=null&&p.address)&&(a(u,f),r(p.address))},"eip155"),f=e.subscribeState(p=>{!p.open&&!e.getAddress("eip155")&&(a(u,f),i(new Error("User closed the modal without connecting")))})});try{await e.open({view:"Connect"}),await t()}catch(r){if(w.isStaleSessionError(r)){if(console.warn("Stale session detected, retrying connection..."),w.clearStorage(),await this.initAppKit(),!this.appKit)throw new Error("AppKit reinitialization failed");await this.appKit.open({view:"Connect"}),await t()}else throw r}});d(this,"activate",async()=>{try{await this.initAppKit()}catch(c){if(console.error("Error initializing AppKit",c),w.isStaleSessionError(c))console.warn("WalletConnect session is stale, clearing storage and retrying..."),w.clearStorage(),await this.initAppKit();else throw c}const e=this.requireAppKit(),t=e.getAccount();(t==null?void 0:t.status)==="connected"&&(t==null?void 0:t.address)?await this.validateRestoredSession(e)||(console.warn("Restored WalletConnect session is stale, clearing and prompting reconnection..."),w.clearStorage(),await this.initAppKit(),await this.openModalAndWaitForConnection()):await this.openModalAndWaitForConnection();const i=e.getWalletProvider();if(!i)throw new Error("Failed to get wallet provider after connection");this.provider=i,this.accountUnsubscribe=e.subscribeAccount(c=>{c!=null&&c.address&&this.handleAccountsChanged([c.address])},"eip155"),this.networkUnsubscribe=e.subscribeCaipNetworkChange(c=>{c!=null&&c.id&&this.handleChainChanged(c.id)});const s=e.getAddress("eip155");return{chainId:e.getChainId()||this.desiredChainId,account:s||null,provider:this.provider}});d(this,"getProvider",async()=>{if(!this.provider)throw new Error("Provider is undefined");return this.provider});d(this,"getChainId",async()=>this.requireAppKit().getChainId()??this.desiredChainId);d(this,"getAccount",async()=>this.requireAppKit().getAddress("eip155")??null);d(this,"getWalletName",()=>{var e,t,r;return(r=(t=(e=this.appKit)==null?void 0:e.getWalletInfo)==null?void 0:t.call(e,"eip155"))==null?void 0:r.name});d(this,"deactivate",()=>{});d(this,"clearInstance",()=>{var t,r;const e=this.provider;if(e){this.provider=void 0;try{(t=this.accountUnsubscribe)==null||t.call(this),(r=this.networkUnsubscribe)==null||r.call(this)}catch(i){console.warn("Error unsubscribing from AppKit events:",i)}return this.accountUnsubscribe=void 0,this.networkUnsubscribe=void 0,e}});d(this,"close",async()=>{var t;if(this.clearInstance()){try{await((t=this.appKit)==null?void 0:t.disconnect())}catch(r){console.warn("Error during WalletConnect disconnect:",r)}this.appKit=void 0}});d(this,"handleAccountsChanged",e=>{this.emitUpdate({account:e[0]})});d(this,"handleChainChanged",e=>{this.emitUpdate({chainId:e})});d(this,"handleDisconnect",()=>{this.clearInstance(),this.emitDeactivate()});this.desiredChainId=e}requireAppKit(){if(!this.appKit)throw new Error("AppKit is not initialized");return this.appKit}static isStaleSessionError(e){if(e instanceof Error){const t=e.message.toLowerCase();return t.includes("no matching key")||t.includes("session topic doesn't exist")||t.includes("missing or invalid")||t.includes("expired")||t.includes("user rejected methods")||t.includes("is not configured")||t.includes("cannot read properties")||t.includes("undefined is not an object")}return!1}async getNetworks(){const e=w.configuration.chains,t=await m(()=>import("./networks-BCXn0uun.js"),__vite__mapDeps([30,18,5,1,31,32,25,13,3,4,11,14,33,34,29])),r=e.map(s=>{const a=be[s];if(a)return t[a]}).filter(s=>s!==void 0);if(r.length===0)throw new Error("No supported networks found for WalletConnect");const i=r.find(s=>s.id===this.desiredChainId);if(i){const s=r.filter(a=>a.id!==this.desiredChainId);return[i,...s]}return[r[0],...r.slice(1)]}};d(w,"configuration",I()[g.ProviderType.WALLET_CONNECT_V2]),d(w,"clearStorage",(e=new Z)=>{e.removeRegExp(new RegExp("^wc@2:")),e.removeRegExp(new RegExp("^@appkit")),w.sharedAppKit=null}),d(w,"sharedAppKit",null);let _=w;class H extends E{constructor(e,t=!1){super({supportedChainIds:I()[g.ProviderType.MAGIC].chains});d(this,"isTest");d(this,"chainId");d(this,"account");d(this,"magic");d(this,"activate",async()=>{if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const t=await this.getProvider(),r=await t.request({method:"eth_accounts"});return this.account=r[0]??null,{provider:t,chainId:this.chainId,account:this.account}});d(this,"getProvider",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const e=await this.magic.wallet.getProvider();return{...e,isMagic:!0,request:new Proxy(e.request,{apply:async(t,r,i)=>{var s,a,c;if(((s=i[0])==null?void 0:s.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(a=i[0])==null?void 0:a.params[0])==null?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return t.bind(e)(...i)}}),sendAsync:new Proxy(e.send,{apply:async(t,r,i)=>t.bind(e)(...i)})}});d(this,"getChainId",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId});d(this,"getAccount",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account});d(this,"getEmail",async()=>{try{if(!this.magic||!await this.magic.user.isLoggedIn())return;const t=await this.magic.user.getInfo();return(t==null?void 0:t.email)??void 0}catch{return}});d(this,"deactivate",()=>{});d(this,"buildMagicInstance",async e=>{const{Magic:t}=await m(async()=>{const{Magic:a}=await import("./index-CSlo2BeJ.js");return{Magic:a}},__vite__mapDeps([35,5,1,36])),{OAuthExtension:r}=await m(async()=>{const{OAuthExtension:a}=await import("./index-DrQ4_MN_.js");return{OAuthExtension:a}},__vite__mapDeps([37,36,5,1,38,7,8,4,10,3])),i=I()[this.isTest?g.ProviderType.MAGIC_TEST:g.ProviderType.MAGIC],s=i.urls[e];if(!s)throw new Error(`Unsupported chainId for Magic: ${e}. Supported chains: ${Object.keys(i.urls).join(", ")}`);return new t(i.apiKey,{extensions:[new r],network:{rpcUrl:s,chainId:e}})});this.isTest=t,this.chainId=e,this.account=null}close(){if(!this.magic)throw new Error("Magic: instance was not initialized");return this.magic.user.logout()}}class ee extends H{constructor(n){super(n,!0)}}class te extends E{constructor(e){var t;super({supportedChainIds:((t=I().thirdweb)==null?void 0:t.chains)??[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA]});d(this,"chainId");d(this,"client");d(this,"wallet");d(this,"chain");d(this,"eip1193Provider");d(this,"activate",async()=>{const e=await this.getClient(),t=await this.getWallet();let r;try{r=await t.autoConnect({client:e})}catch{throw new Error("Thirdweb: No active session. User must authenticate first.")}if(!r)throw new Error("Thirdweb: No active session. User must authenticate first.");const i=await this.getChain(),{EIP1193:s}=await m(async()=>{const{EIP1193:u}=await import("./wallets-CTtGK85J.js").then(f=>f.Q);return{EIP1193:u}},__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]));return this.eip1193Provider=s.toProvider({wallet:t,chain:i,client:e}),{provider:await this.getProvider(),chainId:this.chainId,account:r.address}});d(this,"getProvider",async()=>{if(!this.eip1193Provider)throw new Error("Thirdweb: wallet is not connected. Call activate() first.");const e=this.eip1193Provider;return{...e,isDapper:!1,isFortmatic:!1,isMetamask:!1,isMagic:!1,isThirdweb:!0,request:new Proxy(e.request,{apply:async(t,r,i)=>{var a,c,u,f;if(((a=i[0])==null?void 0:a.method)==="wallet_switchEthereumChain"){const p=(f=(u=(c=i[0])==null?void 0:c.params)==null?void 0:u[0])==null?void 0:f.chainId,v=parseInt(p,16);if(this.supportedChainIds&&!this.supportedChainIds.includes(v))throw new Error("Thirdweb: unsupported chain");this.chainId=v,this.chain=null,this.eip1193Provider=null;const T=await this.getClient(),ne=await this.getWallet(),ie=await this.getChain(),{EIP1193:oe}=await m(async()=>{const{EIP1193:ae}=await import("./wallets-CTtGK85J.js").then(se=>se.Q);return{EIP1193:ae}},__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]));return this.eip1193Provider=oe.toProvider({wallet:ne,chain:ie,client:T}),this.emitUpdate({chainId:v}),null}return Reflect.apply(t,e,i)}}),sendAsync:new Proxy(e.request,{apply:async(t,r,i)=>Reflect.apply(t,e,i)})}});d(this,"getChainId",async()=>this.chainId);d(this,"getAccount",async()=>{if(!this.wallet)return null;try{const e=this.wallet.getAccount();return(e==null?void 0:e.address)??null}catch{return null}});d(this,"getEmail",async()=>{try{const e=await this.getClient(),{getUserEmail:t}=await m(async()=>{const{getUserEmail:i}=await import("./in-app-BIFA2e_r.js");return{getUserEmail:i}},__vite__mapDeps([56,41,42,5,1,47,46,13,3,4,11,14,57,58]));return await t({client:e})??void 0}catch{return}});d(this,"deactivate",()=>{});this.chainId=e,this.client=null,this.wallet=null,this.chain=null,this.eip1193Provider=null}async getClient(){if(this.client)return this.client;let e;try{e=await m(()=>import("./thirdweb-0ZVJwYkE.js").then(r=>r.t),__vite__mapDeps([59,42,5,1,41,40,13,3,4,11,14,43,44,45,60,61,62,63,64,65,54,66,67,68,69,53]))}catch{throw new Error("Thirdweb: thirdweb package is not installed.")}const t=I().thirdweb;return this.client=e.createThirdwebClient({clientId:t.clientId}),this.client}async getWallet(){if(this.wallet)return this.wallet;let e;try{e=await m(()=>import("./wallets-CTtGK85J.js").then(t=>t.Q),__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]))}catch{throw new Error("Thirdweb: thirdweb package is not installed. Run: npm install thirdweb")}return this.wallet=e.inAppWallet(),this.wallet}async getChain(){if(this.chain)return this.chain;const e=await m(()=>import("./chains-DPlhC0Sw.js"),__vite__mapDeps([70,42,5,1,68,50]));return this.chain=e.defineChain(this.chainId),this.chain}async close(){this.wallet&&await this.wallet.disconnect(),this.wallet=null,this.chain=null,this.eip1193Provider=null}}class M{constructor(n){d(this,"provider");d(this,"id",0);d(this,"on",(n,e)=>this.provider.on(n,e));d(this,"emit",(n,...e)=>this.provider.emit(n,e));d(this,"removeListener",(n,e)=>this.provider.removeListener(n,e));d(this,"request",async({method:n,params:e})=>this.isModernProvider()?this.provider.request({method:n,params:e}):this.send(n,e));d(this,"sendAsync",async(n,e)=>this.hasSendAsync()?this.provider.sendAsync(n,(t,r)=>{r&&!Object.prototype.hasOwnProperty.call(r,"result")?e(t,{id:0,jsonrpc:"2.0",result:r}):e(t,r)}):this.send(n,e));this.provider=n}static adapt(n){const e=new M(n);return{...n,on:e.on,emit:e.emit,removeListener:e.removeListener,request:e.request,sendAsync:e.sendAsync,send:e.send.bind(e)}}async send(n,e){let t,r,i;const s=typeof e=="function";if(s){const a=n;r=a.params||[],t=a.method,i=e}else t=n,r=e||[],i=(a,c)=>{if(a)throw a;return c};if(this.isModernProvider()){const[a,c]=await this.provider.request({method:t,params:r}).then(f=>[null,f]).catch(f=>[f,void 0]);return i(a,s?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[a,c]=s?await new Promise(u=>this.provider.send(n,(f,p)=>{u([f,p])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:t,params:r},(f,p)=>{const v=p;u([(v==null?void 0:v.error)??f,(v==null?void 0:v.result)??p])}));return i(a,c)}}isModernProvider(){return"request"in this.provider&&typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync.bind(this.provider))}}class re{constructor(n){d(this,"storage");d(this,"connector");d(this,"promiseOfConnection");d(this,"getWalletName",()=>{if(this.connector instanceof _)return this.connector.getWalletName()});d(this,"clearConnectionData",()=>{const{storageKey:n}=I();this.storage.remove(n),_.clearStorage(this.storage)});d(this,"handleWeb3ReactDeactivate",async()=>{try{await this.disconnect()}catch(n){console.error(n)}});this.storage=n}async connect(n,e=h.ChainId.ETHEREUM_MAINNET){if(this.connector)try{await this.disconnect()}catch(a){console.error("Error disconnecting previous connection",a)}const t=this.buildConnector(n,e);t.on(C.Deactivate,this.handleWeb3ReactDeactivate);let{provider:r,account:i}={};try{const a=await t.activate();r=a.provider,i=a.account}catch(a){throw console.error("Error activating the connector",a),a}(n===l.ProviderType.MAGIC||n===l.ProviderType.MAGIC_TEST||n===l.ProviderType.THIRDWEB)&&t.on(C.Update,({chainId:a})=>{a&&this.setConnectionData(n,a)});let s=e;if(n===l.ProviderType.INJECTED){const a=await r.request({method:"eth_chainId"});s=a?parseInt(a,16):s}return this.connector=t,this.setConnectionData(n,s),{provider:M.adapt(r),providerType:n,account:i||"",chainId:s}}isConnected(){return!!this.connector&&!!this.getConnectionData()}async tryPreviousConnection(){const n=this.getConnectionData();if(!n)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");if(this.connector){const[t,r]=await Promise.all([this.connector.getProvider(),this.connector.getAccount()]);return{provider:t,providerType:n.providerType,chainId:n.chainId,account:r||""}}let e;try{e=this.promiseOfConnection?await this.promiseOfConnection:await(this.promiseOfConnection=this.connect(n.providerType,n.chainId))}finally{this.promiseOfConnection=void 0}return{...e,chainId:this.getConnectionData().chainId}}getAvailableProviders(){const n=[l.ProviderType.FORTMATIC,l.ProviderType.WALLET_CONNECT,l.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?n.unshift(l.ProviderType.INJECTED):n.unshift(l.ProviderType.METAMASK_MOBILE),n}async disconnect(){this.connector&&(this.connector.removeAllListeners(C.Deactivate),this.connector.removeAllListeners(C.Update),this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async getEmail(){const n=this.connector;if(n!=null&&n.getEmail)try{return await n.getEmail()}catch{return}}async createProvider(n,e=h.ChainId.ETHEREUM_MAINNET){const r=await this.buildConnector(n,e).getProvider();return M.adapt(r)}buildConnector(n,e){switch(n){case l.ProviderType.INJECTED:return new J(e);case l.ProviderType.FORTMATIC:return new z(e);case l.ProviderType.MAGIC:return new H(e);case l.ProviderType.MAGIC_TEST:return new ee(e);case l.ProviderType.WALLET_LINK:return new X(e);case l.ProviderType.NETWORK:return new Q(e);case l.ProviderType.WALLET_CONNECT_V2:return new _(e);case l.ProviderType.THIRDWEB:return new te(e);default:throw new Error(`Invalid provider ${n}`)}}getConnectionData(){const{storageKey:n}=I(),e=this.storage.get(n);try{return e?JSON.parse(e):void 0}catch(t){console.error("Error parsing connection data",t);return}}storeConnectionData(n,e){this.setConnectionData(n,e)}setConnectionData(n,e){const{storageKey:t}=I(),r=JSON.stringify({providerType:n,chainId:e});this.storage.set(t,r)}isClosableConnector(){return this.connector&&"close"in this.connector}}const Oe=new re(new Z),Ke=Object.freeze(Object.defineProperty({__proto__:null,AbstractConnector:E,ConnectionManager:re,ErrorUnlockingWallet:G,FortmaticConnector:z,InjectedConnector:J,MagicConnector:H,MagicTestConnector:ee,NetworkConnector:Q,ProviderAdapter:M,ThirdwebConnector:te,WalletConnectV2Connector:_,WalletLinkConnector:X,connection:Oe,getConfiguration:I,getRpcUrls:A},Symbol.toStringTag,{value:"Module"}));export{je as N,Oe as c,$ as e,Ke as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as g,g as L,k as G}from"./react-DehiWSvs.js";import{p as I,g as h}from"./dcl-schemas-Dr9BTjb7.js";import{bX as Pe,aa as Ie,ab as Re,ac as y,ad as b,cu as U,co as H}from"./index-BIBRNTUK.js";import{B as Me,r as Y,e as Se}from"./createSvgIcon-W_IY7RAQ.js";import{n as T}from"./emotion-styled.browser.esm-Ddpetkdy.js";import{C as ze}from"./CircularProgress-BPWY_F37.js";import{g as we,a as Te,c as de,b as ke}from"./clsx-WwvpwSg0.js";import{s as ae,a as Ae}from"./styled-BtpmW8vE.js";function Ne(e){return we("MuiButton",e)}const F=Te("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),_e=i.createContext({}),je=i.createContext(void 0),Oe=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Le=e=>{const{color:o,disableElevation:n,fullWidth:t,size:r,variant:l,classes:c}=e,u={root:["root",l,`${l}${b(o)}`,`size${b(r)}`,`${l}Size${b(r)}`,`color${b(o)}`,n&&"disableElevation",t&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${b(r)}`],endIcon:["icon","endIcon",`iconSize${b(r)}`]},f=ke(u,Ne,c);return y({},c,f)},xe=e=>y({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),$e=ae(Me,{shouldForwardProp:e=>Ae(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:n}=e;return[o.root,o[n.variant],o[`${n.variant}${b(n.color)}`],o[`size${b(n.size)}`],o[`${n.variant}Size${b(n.size)}`],n.color==="inherit"&&o.colorInherit,n.disableElevation&&o.disableElevation,n.fullWidth&&o.fullWidth]}})(({theme:e,ownerState:o})=>{var n,t;const r=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],l=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return y({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":y({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:U.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="text"&&o.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:U.alpha(e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="outlined"&&o.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[o.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:U.alpha(e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:l,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},o.variant==="contained"&&o.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[o.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[o.color].main}}),"&:active":y({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${F.focusVisible}`]:y({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${F.disabled}`]:y({color:(e.vars||e).palette.action.disabled},o.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},o.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},o.variant==="text"&&{padding:"6px 8px"},o.variant==="text"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].main},o.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},o.variant==="outlined"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[o.color].mainChannel} / 0.5)`:`1px solid ${U.alpha(e.palette[o.color].main,.5)}`},o.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(t=e.palette).getContrastText)==null?void 0:n.call(t,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:r,boxShadow:(e.vars||e).shadows[2]},o.variant==="contained"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].contrastText,backgroundColor:(e.vars||e).palette[o.color].main},o.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},o.size==="small"&&o.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},o.size==="small"&&o.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},o.size==="small"&&o.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},o.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${F.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${F.disabled}`]:{boxShadow:"none"}}),Be=ae("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,o)=>{const{ownerState:n}=e;return[o.startIcon,o[`iconSize${b(n.size)}`]]}})(({ownerState:e})=>y({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},xe(e))),We=ae("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,o)=>{const{ownerState:n}=e;return[o.endIcon,o[`iconSize${b(n.size)}`]]}})(({ownerState:e})=>y({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},xe(e))),Ve=i.forwardRef(function(o,n){const t=i.useContext(_e),r=i.useContext(je),l=Pe(t,o),c=Ie({props:l,name:"MuiButton"}),{children:u,color:f="primary",component:m="button",className:p,disabled:s=!1,disableElevation:S=!1,disableFocusRipple:d=!1,endIcon:x,focusVisibleClassName:C,fullWidth:k=!1,size:v="medium",startIcon:$,type:E,variant:Z="text"}=c,z=Re(c,Oe),R=y({},c,{color:f,component:m,disabled:s,disableElevation:S,disableFocusRipple:d,fullWidth:k,size:v,type:E,variant:Z}),P=Le(R),B=$&&g.jsx(Be,{className:P.startIcon,ownerState:R,children:$}),W=x&&g.jsx(We,{className:P.endIcon,ownerState:R,children:x}),V=r||"";return g.jsxs($e,y({ownerState:R,className:de(t.className,P.root,p,V),component:m,disabled:s,focusRipple:!d,focusVisibleClassName:de(P.focusVisible,C),ref:n,type:E},z,{classes:P,children:[B,u,W]}))});var A={},pe;function qe(){if(pe)return A;pe=1,Object.defineProperty(A,"__esModule",{value:!0});function e(){let o,n;const t=new Promise((r,l)=>{o=c=>{r(c),t.isPending=!1},n=c=>{l(c),t.isPending=!1}}).catch(r=>Promise.reject(r));return t.resolve=o,t.reject=n,"finally"in t||(t.finally=r=>{t.then(r),t.catch(r)}),t.isPending=!0,t}return A.future=e,A.default=e,A}var Ue=qe();const Fe=L(Ue);function ge(e){return{all:e=e||new Map,on:function(o,n){var t=e.get(o);t?t.push(n):e.set(o,[n])},off:function(o,n){var t=e.get(o);t&&(n?t.splice(t.indexOf(n)>>>0,1):e.set(o,[]))},emit:function(o,n){var t=e.get(o);t&&t.slice().map(function(r){r(n)}),(t=e.get("*"))&&t.slice().map(function(r){r(o,n)})}}}const w=new Map,ne=new Map,se=new Map,D=new Map;function fe(e){const o=document.getElementById(e);return!o||!o.contentWindow?!1:se.get(o.contentWindow)??!1}function re(e){if(e.data&&e.data.type)try{switch(e.data.type){case I.PreviewMessageType.CONTROLLER_RESPONSE:{const o=e.data.payload,{id:n}=o,t=w.get(n);t&&(w.delete(n),o.ok?t.resolve(o.result):o.ok===!1&&t.reject(new Error(o.error)));break}case I.PreviewMessageType.EMOTE_EVENT:{const o=e.data.payload,{type:n,payload:t}=o,r=e.source?ne.get(e.source):null;r&&n&&r.emit(n,t);break}case I.PreviewMessageType.LOAD:{e.source&&(se.set(e.source,!0),(D.get(e.source)||[]).filter(t=>{var r;return((r=t.data)==null?void 0:r.type)!==I.PreviewMessageType.LOAD}).forEach(re),D.delete(e.source));break}default:}}catch(o){console.error("Error processing WearablePreview message:",o)}}const De=e=>{var n;if(((n=e.data)==null?void 0:n.type)===I.PreviewMessageType.LOAD){re(e);return}if(!(e.source?se.get(e.source):!1)&&e.source){const t=D.get(e.source)||[];t.push(e),D.set(e.source,t);return}re(e)};typeof window<"u"&&window.addEventListener("message",De,!1);let me=0;function Ge(e){return function(n,t,r){const l=document.getElementById(e);if(!l||!l.contentWindow){const d=new Error("iframe not found or not accessible");return Promise.reject(d)}const c=e+"-"+me,u=Fe();w.set(c,u);const f=I.PreviewMessageType.CONTROLLER_REQUEST,m={id:c,namespace:n,method:t,params:r},p=setTimeout(()=>{w.delete(c),u.reject(new Error(`Request timeout for ${t}`))},1e4),s=u.resolve,S=u.reject;u.resolve=d=>{clearTimeout(p),s(d)},u.reject=d=>{clearTimeout(p),S(d)};try{I.sendMessage(l.contentWindow,f,m)}catch(d){const x=d instanceof Error?d.message:String(d);u.reject(new Error(`Failed to send message: ${x}`)),w.delete(c),clearTimeout(p)}return me++,u}}function He(e){const o=document.getElementById(e);if(!o)throw new Error(`Could not find an iframe with id="${e}"`);w.clear();const n=o.contentWindow?ne.get(o.contentWindow)??ge():ge();o.contentWindow&&ne.set(o.contentWindow,n);const t=Ge(e);return{scene:{getScreenshot(r,l){return t("scene","getScreenshot",[r,l])},getMetrics(){return t("scene","getMetrics",[])},changeZoom:function(r){return t("scene","changeZoom",[r])},panCamera:function(r){return t("scene","panCamera",[r])},changeCameraPosition:function(r){return t("scene","changeCameraPosition",[r])},cleanup(){return t("scene","cleanup",[])},setUsername:function(r){return t("scene","setUsername",[r])}},emote:{getLength(){return t("emote","getLength",[])},isPlaying(){return t("emote","isPlaying",[])},goTo(r){return t("emote","goTo",[r])},play(){return t("emote","play",[])},pause(){return t("emote","pause",[])},stop(){return t("emote","stop",[])},enableSound(){return t("emote","enableSound",[])},disableSound(){return t("emote","disableSound",[])},hasSound(){return t("emote","hasSound",[])},isSocialEmote(){return t("emote","isSocialEmote",[])},getSocialEmoteAnimations(){return t("emote","getSocialEmoteAnimations",[])},getPlayingSocialEmoteAnimation(){return t("emote","getPlayingSocialEmoteAnimation",[])},emote:null,events:n},physics:{setSpringBonesParams(r,l){return t("physics","setSpringBonesParams",[r,l])}}}}var N={},ve;function Ye(){if(ve)return N;ve=1;var e=H();Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var o=e(Y()),n=G();return N.default=(0,o.default)((0,n.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),N}var Ze=Ye();const Je=L(Ze);var _={},be;function Qe(){if(be)return _;be=1;var e=H();Object.defineProperty(_,"__esModule",{value:!0}),_.default=void 0;var o=e(Y()),n=G();return _.default=(0,o.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),_}var Xe=Qe();const Ke=L(Xe);var j={},ye;function eo(){if(ye)return j;ye=1;var e=H();Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var o=e(Y()),n=G();return j.default=(0,o.default)((0,n.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z"}),"VolumeOff"),j}var oo=eo();const to=L(oo);var O={},he;function no(){if(he)return O;he=1;var e=H();Object.defineProperty(O,"__esModule",{value:!0}),O.default=void 0;var o=e(Y()),n=G();return O.default=(0,o.default)((0,n.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),O}var ro=no();const ao=L(ro),so=(e,o)=>{const n=i.useRef(null),[t,r]=i.useState(!1);return i.useEffect(()=>{const l=o??He(e);if(n.current=l,fe(e)){r(!0);return}const c=document.getElementById(e);if(!c){console.error(`Could not find iframe with id="${e}"`);return}if(!c.contentWindow){console.error(`Iframe contentWindow is not accessible for id="${e}"`);return}const f=m=>{var p;((p=m.data)==null?void 0:p.type)===I.PreviewMessageType.LOAD&&fe(e)&&r(!0)};return window.addEventListener("message",f),()=>{window.removeEventListener("message",f),r(!1),n.current=null}},[e,o]),{controllerRef:n,isReady:t}},io={small:16,medium:20,large:24},Ee=({children:e,startIcon:o,endIcon:n,loading:t=!1,loadingIcon:r,loadingPosition:l="center",disabled:c=!1,size:u="medium",...f})=>{const m=g.jsx(ze,{color:"inherit",size:io[u]}),p=r||m,s=t&&l==="center"?p:e;return g.jsx(Ve,{disabled:c||t,startIcon:t&&l==="start"?p:o,endIcon:t&&l==="end"?p:n,size:u,...f,children:s})},lo=T(Se)(({theme:e})=>({display:"flex",position:"absolute",width:"100%",bottom:0,margin:`${e.spacing(2)} 0`,padding:`0 ${e.spacing(3)}`,gap:e.spacing(2)})),co=T(Ee)(({theme:e})=>({width:56,height:44,padding:0,minWidth:"unset",background:"rgba(0, 0, 0, 0.64) !important","& svg":{marginLeft:e.spacing(.5)}})),uo=T(Ee)(({theme:e,muted:o})=>({marginLeft:e.spacing(2.5),minWidth:25,background:"none",padding:0,opacity:o?.5:1})),po=T("input")(({theme:e})=>({flex:1,width:"100%",background:"none",WebkitAppearance:"none","&:focus":{outline:"none"},"&::-webkit-slider-thumb":{WebkitAppearance:"none",width:24,height:24,borderRadius:10,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",paddingBottom:e.spacing(.625),marginTop:e.spacing(-.5)},"&::-moz-range-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",border:"none"},"&::-ms-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer"},"&::-webkit-slider-runnable-track":{width:300,height:15,background:"rgba(115, 110, 125, 0.32)",border:"none",borderRadius:10},"&::-moz-range-track":{width:"100%",height:15,borderRadius:10,cursor:"pointer",background:"rgba(115, 110, 125, 0.32)"}})),go=T("div")({display:"flex",alignItems:"center"}),fo=T("input")({width:56,height:44,borderRadius:5,background:"transparent",border:"1px solid rgba(115, 110, 125, 0.4)",color:"white",textAlign:"center","&:focus-visible":{outline:"1px solid"}}),mo=({wearablePreviewId:e,className:o,hideFrameInput:n,hideProgressInput:t,hidePlayButton:r,hideSoundButton:l,wearablePreviewController:c,renderPlayButton:u,renderSoundButton:f,renderProgressBar:m,renderFrameInput:p})=>{const{controllerRef:s,isReady:S}=so(e,c),[d,x]=i.useState(0),[C,k]=i.useState(!1),[v,$]=i.useState(void 0),[E,Z]=i.useState(!0),[z,R]=i.useState(void 0),[P,B]=i.useState(!1),[W,V]=i.useState(!1),J=i.useCallback(()=>{x(0)},[]),Q=i.useCallback(()=>{k(!1),x(a=>a>=Math.floor((v??0)*100)?0:a)},[v]),X=i.useCallback(()=>{k(!1)},[]),K=i.useCallback(async()=>{if(!W){let a=v;!v&&s.current&&(a=await s.current.emote.getLength()),k(!0),$(a)}},[v,W,s]),ee=i.useCallback(({length:a})=>{x(Math.ceil((a??0)*100))},[]);i.useEffect(()=>{const a=s.current;if(a)return a.emote.events.on(h.PreviewEmoteEventType.ANIMATION_PLAY,K),a.emote.events.on(h.PreviewEmoteEventType.ANIMATION_PLAYING,ee),a.emote.events.on(h.PreviewEmoteEventType.ANIMATION_END,Q),a.emote.events.on(h.PreviewEmoteEventType.ANIMATION_PAUSE,X),a.emote.events.on(h.PreviewEmoteEventType.ANIMATION_LOOP,J),()=>{a.emote.events.off(h.PreviewEmoteEventType.ANIMATION_PLAY,K),a.emote.events.off(h.PreviewEmoteEventType.ANIMATION_PLAYING,ee),a.emote.events.off(h.PreviewEmoteEventType.ANIMATION_END,Q),a.emote.events.off(h.PreviewEmoteEventType.ANIMATION_PAUSE,X),a.emote.events.off(h.PreviewEmoteEventType.ANIMATION_LOOP,J)}},[s,K,ee,Q,X,J]),i.useEffect(()=>{z===void 0&&S&&s.current&&s.current.emote.hasSound().then(a=>R(a)).catch(a=>{console.error("Error checking sound:",a),R(!1)})},[z,S,s]);const oe=i.useCallback(async()=>{if(s.current)try{await s.current.emote.play()}catch(a){console.error("Error playing emote:",a)}},[s]),te=i.useCallback(async()=>{if(s.current)try{await s.current.emote.pause()}catch(a){console.error("Error pausing emote:",a)}},[s]),ie=i.useCallback(async()=>{C?await te():await oe()},[C,oe,te]),le=i.useCallback(()=>{var a,M;E?(a=s.current)==null||a.emote.disableSound():(M=s.current)==null||M.emote.enableSound(),Z(!E)},[E,s]),q=i.useCallback(async a=>{if(isNaN(a)||!s.current)return;let M=a;const ue=v??0;ue*100<a&&(M=ue*100),x(M),V(!0);try{C&&(await s.current.emote.pause(),B(!0)),await s.current.emote.goTo(M/100)}catch(Ce){console.error("Error changing frame:",Ce)}},[v,C,s]),ce=i.useCallback(async()=>{if(V(!1),P&&s.current){try{await s.current.emote.play()}catch(a){console.error("Error resuming play:",a)}B(!1)}},[P,s]);return g.jsxs(lo,{className:o,children:[r?null:u?u({isPlaying:C,onPlay:oe,onPause:te,onToggle:ie}):g.jsx(co,{onClick:ie,children:C?g.jsx(Je,{}):g.jsx(Ke,{})}),t?null:m?m({frame:d,length:v??0,onChange:q,onMouseUp:ce}):g.jsx(po,{type:"range",value:d,max:Math.ceil((v??0)*100),min:0,step:1,onChange:a=>q(Number(a.target.value)),onMouseUp:ce}),n?null:g.jsx(go,{children:p?p({frame:Math.round(d/100),onChange:a=>q(a*100)}):g.jsx(fo,{type:"number",value:Math.round(d/100),onChange:a=>q(Number(a.target.value)*100)})}),l||!z?null:f?f({isSoundEnabled:E,hasSound:z,onToggle:le}):g.jsx(uo,{muted:!E,onClick:le,children:E?g.jsx(ao,{}):g.jsx(to,{})})]})},Io=Object.freeze(Object.defineProperty({__proto__:null,EmoteControls:mo},Symbol.toStringTag,{value:"Module"}));export{_e as B,mo as E,je as a,Ve as b,He as c,Ee as d,Io as i,so as u};
|