@dcl/shop 0.1.0-30279564518.commit-0ea36ab → 0.1.0-30341633105.commit-bfa7613
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-CjKP24SM.js → Activity-DUQW_Z22.js} +4 -4
- package/assets/{AnimatedBackground-D2jsXv_Q.js → AnimatedBackground-D5TaGH4y.js} +1 -1
- package/assets/{Assets-DjrlGGuo.js → Assets-B4NCA-FL.js} +54 -54
- package/assets/{Assets.styles-DKu0M-fo.js → Assets.styles-CE4c2s9w.js} +1 -1
- package/assets/{Authorizations-DfNkZpjD.js → Authorizations-FSevrZuz.js} +1 -1
- package/assets/{Button-DUuwMw2g.js → Button-CVXKA5VS.js} +2 -2
- package/assets/Cart-Bwa3a9Hp.js +1 -0
- package/assets/{CircularProgress-BOITSQXA.js → CircularProgress-B7WalF_4.js} +1 -1
- package/assets/{Collection-0X39SWqr.js → Collection-DdHzXaav.js} +1 -1
- package/assets/CollectionCarousel-BLfBmiC7.js +292 -0
- package/assets/{ConstantsUtil-DTrOBzCe.js → ConstantsUtil-CqaPdSAF.js} +1 -1
- package/assets/{ContentClient-jyMKirlf.js → ContentClient-0BEnf6CP.js} +1 -1
- package/assets/{Creator-BjoPunwO.js → Creator-B9a3v2rB.js} +1 -1
- package/assets/{DeploymentBuilder-j08uBP-r.js → DeploymentBuilder-Df9ZJakk.js} +1 -1
- package/assets/{ErrorNotice-BG40E5Ff.js → ErrorNotice-D_Z5OVFI.js} +1 -1
- package/assets/{ExchangeController--3J53YgS.js → ExchangeController-DTUPu5lZ.js} +1 -1
- package/assets/{GetCredits-BcZpGmti.js → GetCredits-CEruTT5O.js} +6 -6
- package/assets/{HelpersUtil-DWI18gI9.js → HelpersUtil-DY1hA3MT.js} +1 -1
- package/assets/{ImportListings-DNcnjuRU.js → ImportListings-CUNQkt5i.js} +2 -2
- package/assets/ItemDetail-gPIjOR_D.js +2406 -0
- package/assets/{LoadMore-Cv8ieNqf.js → LoadMore-K8EfO7If.js} +1 -1
- package/assets/MarketCheckout-BlfeUpjX.js +3 -0
- package/assets/{MenuList-Dpn2ZgKk.js → MenuList-DPrUOTQw.js} +1 -1
- package/assets/{MyAssets-yXg0a1Zj.js → MyAssets-qLOA_5tD.js} +1 -1
- package/assets/{MyFavorites-C6oOSvkj.js → MyFavorites-C1SUs-Jy.js} +1 -1
- package/assets/{NetworkUtil-C1aEwuOK.js → NetworkUtil-DQZGJzap.js} +1 -1
- package/assets/{NotFound-BMCYiONc.js → NotFound-hEgIvZDQ.js} +1 -1
- package/assets/{NotificationsBell-5E6mEGEn.js → NotificationsBell-BPdngTao.js} +1 -1
- package/assets/{StoreSettings-DbdH6mzE.js → StoreSettings-BvrwDCuq.js} +5 -5
- package/assets/{Success-D7KdjdBY.js → Success-DfPUnbUp.js} +2 -2
- package/assets/{SwapController-C0FvCHWq.js → SwapController-Cvanu67b.js} +1 -1
- package/assets/{Tooltip-DSEH6tal.js → Tooltip-8SR8hseo.js} +5 -5
- package/assets/{TradeService-CbFSATer.js → TradeService-DH4vjiAB.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-CCVyEXOJ.js → W3MFrameProviderSingleton-DtrTVFth.js} +3 -3
- package/assets/{WebCryptoP256-CxdV7gm_.js → WebCryptoP256-B_JP0jDJ.js} +1 -1
- package/assets/{authorizations-Bt-yiKpU.js → authorizations-Dtu8Ye0y.js} +1 -1
- package/assets/{basic-1GkOUAUg.js → basic-DljOvbvB.js} +1 -1
- package/assets/{biconomy-CEgRNCV3.js → biconomy-ik7MjMyj.js} +1 -1
- package/assets/{browser-CTzRZpIE.js → browser-BgOlLsTO.js} +1 -1
- package/assets/{browser-ponyfill-CI1-rMvf.js → browser-ponyfill-CMZ3i8tY.js} +1 -1
- package/assets/browser-ponyfill-lfpnveOA.js +1 -0
- package/assets/{builder-ChMzGlEf.js → builder-BsAwBvGZ.js} +1 -1
- package/assets/{buy-C8thJCOQ.js → buy-CyhVI8ih.js} +1 -1
- package/assets/buy-gasless-D6tjB5nW.js +1 -0
- package/assets/{cart-checkout-DtChJ5jV.js → cart-checkout-Bp3fmOrE.js} +1 -1
- package/assets/{categories-CQDU6eKt.js → categories-Jh3tfbEa.js} +1 -1
- package/assets/{ccip-DHMKr_5U.js → ccip-Dn5CKGMr.js} +1 -1
- package/assets/{ccip-D0x94rIy.js → ccip-fs__7FtW.js} +1 -1
- package/assets/{chains-Znt1BTfw.js → chains-Bk8fyLPj.js} +1 -1
- package/assets/collection-Cbl5FMco.js +1 -0
- package/assets/{common-D9tSChDa.js → common-CI-kmbOq.js} +1 -1
- package/assets/{controller-BkyUM4Zl.js → controller-CFA_t_aX.js} +2 -2
- package/assets/{core-xNSXcK8v.js → core-bscEUkDr.js} +4 -4
- package/assets/{custom-DbKBJS0m.js → custom-CBNtVqpj.js} +1 -1
- package/assets/{data-capture-DDPGGwVG.js → data-capture-OumUBjqI.js} +1 -1
- package/assets/{decimals-C4nLn1ac.js → decimals-CIbX1tiW.js} +1 -1
- package/assets/decimals-CS6j__sw.js +1 -0
- package/assets/{detectExtension-BgMIFAUw.js → detectExtension-DObVoAzH.js} +1 -1
- package/assets/{email-Bdh6R3aN.js → email-Psj4ILkk.js} +1 -1
- package/assets/{embedded-wallet-D6Oykct7.js → embedded-wallet-8Rn02F-5.js} +1 -1
- package/assets/{emotion-styled.browser.esm-D7LnnFGM.js → emotion-styled.browser.esm-D1IYcc-A.js} +1 -1
- package/assets/{engine-DKBZ9rvO.js → engine-FKONhXUm.js} +1 -1
- package/assets/{errors-CGr_h4qk.js → errors-C_tFJwwX.js} +1 -1
- package/assets/estimate-l1-fee-CQQK05Yj.js +1 -0
- package/assets/eth_estimateGas-D2jEM0E-.js +1 -0
- package/assets/{eth_getStorageAt--oQrWy0Q.js → eth_getStorageAt-y8U-lfEv.js} +1 -1
- package/assets/eth_getTransactionCount-CME439qZ.js +1 -0
- package/assets/{ethereum-3zUUm4Pr.js → ethereum-D72JFjbG.js} +1 -1
- package/assets/{ethers-CtVvB8eG.js → ethers-BteKixT0.js} +1 -1
- package/assets/{execute-BNAgRbv2.js → execute-DvgHhaNY.js} +2 -2
- package/assets/{extractIPFS-BmriCqG8.js → extractIPFS-BVwwoxM1.js} +1 -1
- package/assets/{features-yBnE0kv6.js → features-C_I0ed0g.js} +1 -1
- package/assets/{fetchTokenMetadata-BgTzU1uv.js → fetchTokenMetadata-DXP5pKit.js} +2 -2
- package/assets/{fortmatic-DM_o40Lo.js → fortmatic-uodRBNqF.js} +1 -1
- package/assets/{get-bytecode-C6TlbHJu.js → get-bytecode-PhqNpgKV.js} +1 -1
- package/assets/get-ecosystem-wallet-info-CojUzYKW.js +1 -0
- package/assets/{getBalance-Ck3AgdKh.js → getBalance-Bi0yMf6a.js} +2 -2
- package/assets/{getInstalledModules-BLQxYEXn.js → getInstalledModules-DS4FSkHX.js} +1 -1
- package/assets/{getNFT-Ticzp8Hs.js → getNFT-CebGWsfS.js} +2 -2
- package/assets/getNFT-uBr4IPr-.js +1 -0
- package/assets/getThemeProps-D9znDKcF.js +1 -0
- package/assets/{hashTypedData-vyJGLMpP.js → hashTypedData-CmwGgOTV.js} +1 -1
- package/assets/{hashTypedData-D-QtOqRa.js → hashTypedData-CvnET0ek.js} +1 -1
- package/assets/{import-DaK3l2L4.js → import-5htnR-24.js} +1 -1
- package/assets/{in-app-VsfJDWao.js → in-app-CXNVMtY6.js} +1 -1
- package/assets/{in-app-wallet-calls-Cc6TEySq.js → in-app-wallet-calls-CL_h73Vx.js} +1 -1
- package/assets/{index-BvrGtJes.js → index-5PxxT_Hi.js} +1 -1
- package/assets/{index-m5R1RgvV.js → index-9s4_sQX7.js} +1 -1
- package/assets/{index-Bek4_t_L.js → index-B8HPZU8G.js} +1 -1
- package/assets/{index-DNoUzleZ.js → index-BBFf3j9R.js} +1 -1
- package/assets/{index-DEKVNi4L.js → index-BEwgqhCL.js} +1 -1
- package/assets/{index-CJxmpG1K.js → index-BF0jg5eX.js} +1 -1
- package/assets/{index-D_DMIRz9.js → index-BUuFv1bp.js} +1 -1
- package/assets/{index-Cpv_qKx8.js → index-BZVhR8G8.js} +1 -1
- package/assets/{index--P2VwVy3.js → index-BaeTuT24.js} +1 -1
- package/assets/{index-BYz2fOpG.js → index-BjJBV4qL.js} +1 -1
- package/assets/{index-BCx0SxC7.js → index-BksD36hR.js} +1 -1
- package/assets/{index-DGwlKYP1.js → index-BofIoUki.js} +1 -1
- package/assets/{index-CKwiZFh4.js → index-BqdSTJ_h.js} +1 -1
- package/assets/{index-Bx2U1tYr.js → index-BwVcZ3vw.js} +1 -1
- package/assets/{index-L08mwnOc.js → index-C-3NWHgA.js} +1 -1
- package/assets/{index-CWzvA55Z.js → index-C-dFvnUH.js} +1 -1
- package/assets/{index-Bxhq99ht.js → index-C1Tsxo3r.js} +1 -1
- package/assets/{index-C8RikeW4.js → index-C1UJcewJ.js} +1 -1
- package/assets/{index-BG7lZdfP.js → index-C3SS5bz4.js} +1 -1
- package/assets/{index-BVMw5QjZ.js → index-C4GKDkj4.js} +1 -1
- package/assets/{index-B56Mz2YS.js → index-C5V5wALq.js} +1 -1
- package/assets/{index-jsB1K3Ty.js → index-CAPIrEyl.js} +1 -1
- package/assets/{index-C9AUsopd.js → index-CBgD93CB.js} +1 -1
- package/assets/{index-BzD7Ebgn.js → index-CFnxUGBP.js} +1 -1
- package/assets/{index-z80r03Cx.js → index-CIRaZxV0.js} +1 -1
- package/assets/{index-BDwWglvl.js → index-CJIwpbLW.js} +1 -1
- package/assets/{index-7KtzBMW3.js → index-CLiiVHBN.js} +1 -1
- package/assets/{index-BZ6S4-Qy.js → index-CMYPEZgT.js} +1 -1
- package/assets/{index-SvOsIc3H.js → index-CSdulB00.js} +3 -3
- package/assets/{index-tFmbSlHL.js → index-CVi7PdPM.js} +1 -1
- package/assets/{index-B2DUxMjO.js → index-CdccZQ_A.js} +1 -1
- package/assets/{index-DiGXPxzb.js → index-CjxT1gx4.js} +1 -1
- package/assets/{index-B13clZOY.js → index-CkYGCiA-.js} +1 -1
- package/assets/{index-Cmu7kehM.js → index-Cp-efrxt.js} +2 -2
- package/assets/{index-DdJ_OK_4.js → index-Cq9m0rf1.js} +1 -1
- package/assets/{index-ColsJYiD.js → index-CvxSD2TZ.js} +1 -1
- package/assets/{index-DbSgqncZ.js → index-D-BpvO4i.js} +1 -1
- package/assets/{index-DUxDUxur.js → index-D3MkM_Ow.js} +2 -2
- package/assets/{index-CSZuXP_O.js → index-D7uajZIF.js} +1 -1
- package/assets/{index-Bf27DWaL.js → index-D9zmC2OF.js} +1 -1
- package/assets/{index-DHxeKfAR.js → index-DTjLQDJj.js} +3 -3
- package/assets/{index-Ceh4tqVd.js → index-DVCrh7RP.js} +1 -1
- package/assets/{index-Cf5UQJ_k.js → index-DXqFhRIG.js} +2 -2
- package/assets/{index-ehEPbUUu.js → index-D_GOecnW.js} +1 -1
- package/assets/{index-32dihjZM.js → index-Dcx57z9h.js} +1 -1
- package/assets/{index-n-ml-ClE.js → index-De5m0zpT.js} +1 -1
- package/assets/{index-BTV13rXH.js → index-Ded3SJr4.js} +1 -1
- package/assets/{index-8eIQG8Kl.js → index-DhbTDQu0.js} +1 -1
- package/assets/{index-BIgVkoHN.js → index-DiarXSIn.js} +1 -1
- package/assets/{index-DB0uJXc-.js → index-Dlw2S5cF.js} +3 -3
- package/assets/index-DpPUc0sl.js +1 -0
- package/assets/{index-DGZZiECR.js → index-Ds0rGqyb.js} +1 -1
- package/assets/{index-unwNWDy6.js → index-Ds6dHrLZ.js} +1 -1
- package/assets/{index-Dcg9IkwS.js → index-DsV59IEv.js} +1 -1
- package/assets/{index-CEUqEDHj.js → index-VchcND_n.js} +11 -11
- package/assets/{index-DsgKSUtS.js → index-VdY2qv1p.js} +1 -1
- package/assets/{index-Bd6gPKw4.js → index-aP6PSm0J.js} +1 -1
- package/assets/{index-CZQ2_otu.js → index-lJWah8De.js} +1 -1
- package/assets/{index-CkWJ4sTo.js → index-nJZkl4yb.js} +1 -1
- package/assets/{index-6uEdFIR0.js → index-sW-sKm0x.js} +2 -2
- package/assets/{index-COEkUMH9.js → index-scsn5pcE.js} +1 -1
- package/assets/{index-C6PL2Fdt.js → index-tf9y--bx.js} +1 -1
- package/assets/{index-jX2jQJPr.js → index-zLpiSX4V.js} +2 -2
- package/assets/{index.es-DI7x2TJx.js → index.es-9B4hUsAR.js} +1 -1
- package/assets/{index.es-BZebHuYA.js → index.es-9Zrxu-nr.js} +4 -4
- package/assets/{index.es-DpokeYPv.js → index.es-BwS14sFg.js} +1 -1
- package/assets/{linkAccount-BR5_llhd.js → linkAccount-6BFCh5cx.js} +1 -1
- package/assets/{localBatchGatewayRequest-B9Ybd7dg.js → localBatchGatewayRequest-BHik-cdx.js} +1 -1
- package/assets/{mana-rate-D7GRB_Ot.js → mana-rate-CY9tOCr1.js} +1 -1
- package/assets/{native-BSpg_u0K.js → native-15jVjX8Y.js} +1 -1
- package/assets/{networks-fMdVA1sr.js → networks-Ddkp84aU.js} +1 -1
- package/assets/{onramp-B2Q3gTV8.js → onramp-CeSaj6Aa.js} +1 -1
- package/assets/{openzeppelin-Dfbjq166.js → openzeppelin-CDpkjcS1.js} +1 -1
- package/assets/{ownerOf-D9UDfElT.js → ownerOf-CFrKicrH.js} +1 -1
- package/assets/{parseNft-D4L1MnwK.js → parseNft-ChsA4Coa.js} +2 -2
- package/assets/{parseSignature-B2YsV13I.js → parseSignature--QSaxzyZ.js} +3 -3
- package/assets/{parseSignature-Ch8Ikh9R.js → parseSignature-DFSq1jun.js} +1 -1
- package/assets/{passkeys-CRQs5lh-.js → passkeys-CUsQnAGE.js} +1 -1
- package/assets/{pay-with-exchange-DwcPixRd.js → pay-with-exchange-DD3fWFhp.js} +1 -1
- package/assets/{prepare-contract-call-CHrp3EL4.js → prepare-contract-call-DUVOtgM0.js} +1 -1
- package/assets/{qr-overlay-WecOYNdc.js → qr-overlay-FXDRFg86.js} +3 -3
- package/assets/{react-BW1xvPTF.js → react-B36MyIP_.js} +1 -1
- package/assets/{receive-r6itEu_X.js → receive-YGf7MQMM.js} +1 -1
- package/assets/{resolveImplementation-DuORFImi.js → resolveImplementation-ChZxSPSt.js} +1 -1
- package/assets/{rpc--KkC2qWz.js → rpc-DcocuHbv.js} +1 -1
- package/assets/{secp256k1-7vUkF5ib.js → secp256k1-2n6IN3fh.js} +1 -1
- package/assets/{secp256k1-CSfTjZp_.js → secp256k1-B6R4GN3D.js} +1 -1
- package/assets/{secp256k1-DRVSRXu6.js → secp256k1-Da2UK_yU.js} +1 -1
- package/assets/{send-BRRQlzci.js → send-DM7q2CKX.js} +1 -1
- package/assets/{send-batch-transaction-BASQMYYn.js → send-batch-transaction-BQiw5Eds.js} +1 -1
- package/assets/{send-eip712-transaction-Cb0e5jgJ.js → send-eip712-transaction-D9_VwAnb.js} +2 -2
- package/assets/send-gasless-transaction-fl9Lqf73.js +2 -0
- package/assets/{send-transaction-URhXksgR.js → send-transaction-lapcUIfe.js} +2 -2
- package/assets/{sendMetaTransaction-DnNlMy1f.js → sendMetaTransaction-CydgYVdt.js} +1 -1
- package/assets/{sendRawTransaction-Cp9PwWbz.js → sendRawTransaction-CkQeCcPa.js} +3 -3
- package/assets/{sentry-BV_ZSgtd.js → sentry-gZJVwIqQ.js} +1 -1
- package/assets/{serializeTransaction-D6bPY-5e.js → serializeTransaction-CiKWV5oi.js} +1 -1
- package/assets/{session-proposal-CO8C9FgE.js → session-proposal-C1hZCkvv.js} +1 -1
- package/assets/{session-request-CU3My76o.js → session-request-BTvx34S0.js} +2 -2
- package/assets/{sha256-BImz_UXn.js → sha256-DDEIajFz.js} +1 -1
- package/assets/{signing-C1foQi87.js → signing-clXGZp7N.js} +3 -3
- package/assets/{socials-Bsjh-kcj.js → socials-Djo-_tRh.js} +1 -1
- package/assets/{swaps-D4LpMI-N.js → swaps-BwoxWJmp.js} +1 -1
- package/assets/{thirdweb-D1z-XTZ-.js → thirdweb-DIYiKqri.js} +3 -3
- package/assets/{to-serializable-transaction-B7zKZp3o.js → to-serializable-transaction-_IYF-b5r.js} +2 -2
- package/assets/{totalSupply-D4j1WOYW.js → totalSupply-CGOKYv2C.js} +1 -1
- package/assets/trade-encoding-DbssSNOL.js +1 -0
- package/assets/{transaction-BOS1fhp8.js → transaction-C_LVUDbA.js} +1 -1
- package/assets/{transactionReceipt-TiskXrB6.js → transactionReceipt-dAN1T4b9.js} +1 -1
- package/assets/{transactions-B5kAYK1L.js → transactions-V175lLd8.js} +1 -1
- package/assets/useCreditPacks-B8su_g3G.js +1 -0
- package/assets/{useInfiniteGrid-CiDuQRnP.js → useInfiniteGrid-S2Upf1Ae.js} +1 -1
- package/assets/useManaRate-CCWK1pxl.js +1 -0
- package/assets/{useStore-BF0NEfcO.js → useStore-BEtv4alq.js} +2 -2
- package/assets/useTheme-BoNUL1hb.js +1 -0
- package/assets/{utils-B7rjkjB1.js → utils-swuB5ZX6.js} +1 -1
- package/assets/{verifyHash-BLnnKj_-.js → verifyHash-CSBAlIiR.js} +1 -1
- package/assets/{w3m-modal-D2jSpmw2.js → w3m-modal-CXjKWsrV.js} +1 -1
- package/assets/{w3m-modal-CRKh97nT.js → w3m-modal-DVav-Ijf.js} +1 -1
- package/assets/{wait-for-tx-receipt-CUP8flYl.js → wait-for-tx-receipt-CRuc-ylw.js} +1 -1
- package/assets/{wallets-CBncd5Al.js → wallets-C2Qy7KSV.js} +5 -5
- package/assets/{web-connector-BbbFAPbG.js → web-connector-D4itPEVN.js} +3 -3
- package/assets/{writeContract-DeZcPQuU.js → writeContract-BR9KO0Ok.js} +1 -1
- package/assets/{zora-sepolia-CVS3owSi.js → zora-sepolia-BltAzWAs.js} +1 -1
- package/assets/{zoraTestnet-Dea0RHqm.js → zoraTestnet-VaouiZC2.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-DYkqiuyJ.js +0 -1
- package/assets/CollectionCarousel-B0A1YOX-.js +0 -292
- package/assets/ItemDetail-By9hJU7O.js +0 -2406
- package/assets/MarketCheckout-B7kj-ofT.js +0 -3
- package/assets/browser-ponyfill-6L1OGOLN.js +0 -1
- package/assets/buy-gasless-kzWGfidX.js +0 -1
- package/assets/collection-4qJRowPN.js +0 -1
- package/assets/decimals-Bmvg-V50.js +0 -1
- package/assets/estimate-l1-fee-CoGVlirt.js +0 -1
- package/assets/eth_estimateGas-JYqF9U1i.js +0 -1
- package/assets/eth_getTransactionCount-BEhAgz2O.js +0 -1
- package/assets/get-ecosystem-wallet-info-DCVnaTdL.js +0 -1
- package/assets/getNFT-v9ULC-Df.js +0 -1
- package/assets/getThemeProps-BcAfOiiP.js +0 -1
- package/assets/index-B6MKNzS8.js +0 -1
- package/assets/send-gasless-transaction-TLFFm8L4.js +0 -2
- package/assets/trade-encoding-rbwEO5I2.js +0 -1
- package/assets/useCreditPacks-DPTBuCyg.js +0 -1
- package/assets/useManaRate-WxBKKUcB.js +0 -1
- package/assets/useTheme-BhK6j6Fd.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bb as Xe,bc as Ye,
|
|
1
|
+
import{bb as Xe,bc as Ye,q as Ge,bd as qe,Y as G,Z as b,$ as z,W as ee,X as se,be as Ze,a2 as H,R as le,V as Ce,bf as be,bg as we,bh as w,a1 as Re,bi as Je,T as Qe,aT as eo,r as oo,a0 as B,bj as to,bk as J}from"./index-VchcND_n.js";import{r as l,j as T,R as Y}from"./react-B36MyIP_.js";function Me(e){var o,t,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(o=0;o<n;o++)e[o]&&(t=Me(e[o]))&&(i&&(i+=" "),i+=t)}else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function no(){for(var e,o,t=0,i="",n=arguments.length;t<n;t++)(e=arguments[t])&&(o=Me(e))&&(i&&(i+=" "),i+=o);return i}const io=["className","component"];function ao(e={}){const{themeId:o,defaultTheme:t,defaultClassName:i="MuiBox-root",generateClassName:n}=e,a=Xe("div",{shouldForwardProp:u=>u!=="theme"&&u!=="sx"&&u!=="as"})(Ye);return l.forwardRef(function(c,p){const f=Ge(t),g=qe(c),{className:m,component:v="div"}=g,h=G(g,io);return T.jsx(a,b({as:v,ref:p,className:no(m,n?n(i):i),theme:o&&f[o]||f},h))})}function ae(e,o){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},ae(e,o)}function ro(e,o){e.prototype=Object.create(o.prototype),e.prototype.constructor=e,ae(e,o)}const ge=Y.createContext(null);function so(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ce(e,o){var t=function(a){return o&&l.isValidElement(a)?o(a):a},i=Object.create(null);return e&&l.Children.map(e,function(n){return n}).forEach(function(n){i[n.key]=t(n)}),i}function lo(e,o){e=e||{},o=o||{};function t(f){return f in o?o[f]:e[f]}var i=Object.create(null),n=[];for(var a in e)a in o?n.length&&(i[a]=n,n=[]):n.push(a);var r,u={};for(var c in o){if(i[c])for(r=0;r<i[c].length;r++){var p=i[c][r];u[i[c][r]]=t(p)}u[c]=t(c)}for(r=0;r<n.length;r++)u[n[r]]=t(n[r]);return u}function A(e,o,t){return t[o]!=null?t[o]:e.props[o]}function co(e,o){return ce(e.children,function(t){return l.cloneElement(t,{onExited:o.bind(null,t),in:!0,appear:A(t,"appear",e),enter:A(t,"enter",e),exit:A(t,"exit",e)})})}function uo(e,o,t){var i=ce(e.children),n=lo(o,i);return Object.keys(n).forEach(function(a){var r=n[a];if(l.isValidElement(r)){var u=a in o,c=a in i,p=o[a],f=l.isValidElement(p)&&!p.props.in;c&&(!u||f)?n[a]=l.cloneElement(r,{onExited:t.bind(null,r),in:!0,exit:A(r,"exit",e),enter:A(r,"enter",e)}):!c&&u&&!f?n[a]=l.cloneElement(r,{in:!1}):c&&u&&l.isValidElement(p)&&(n[a]=l.cloneElement(r,{onExited:t.bind(null,r),in:p.props.in,exit:A(r,"exit",e),enter:A(r,"enter",e)}))}}),n}var po=Object.values||function(e){return Object.keys(e).map(function(o){return e[o]})},fo={component:"div",childFactory:function(o){return o}},ue=(function(e){ro(o,e);function o(i,n){var a;a=e.call(this,i,n)||this;var r=a.handleExited.bind(so(a));return a.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},a}var t=o.prototype;return t.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},t.componentWillUnmount=function(){this.mounted=!1},o.getDerivedStateFromProps=function(n,a){var r=a.children,u=a.handleExited,c=a.firstRender;return{children:c?co(n,u):uo(n,r,u),firstRender:!1}},t.handleExited=function(n,a){var r=ce(this.props.children);n.key in r||(n.props.onExited&&n.props.onExited(a),this.mounted&&this.setState(function(u){var c=b({},u.children);return delete c[n.key],{children:c}}))},t.render=function(){var n=this.props,a=n.component,r=n.childFactory,u=G(n,["component","childFactory"]),c=this.state.contextValue,p=po(this.state.children).map(r);return delete u.appear,delete u.enter,delete u.exit,a===null?Y.createElement(ge.Provider,{value:c},p):Y.createElement(ge.Provider,{value:c},Y.createElement(a,u,p))},o})(Y.Component);ue.propTypes={};ue.defaultProps=fo;function ho(e){const{className:o,classes:t,pulsate:i=!1,rippleX:n,rippleY:a,rippleSize:r,in:u,onExited:c,timeout:p}=e,[f,g]=l.useState(!1),m=z(o,t.ripple,t.rippleVisible,i&&t.ripplePulsate),v={width:r,height:r,top:-(r/2)+a,left:-(r/2)+n},h=z(t.child,f&&t.childLeaving,i&&t.childPulsate);return!u&&!f&&g(!0),l.useEffect(()=>{if(!u&&c!=null){const C=setTimeout(c,p);return()=>{clearTimeout(C)}}},[c,u,p]),T.jsx("span",{className:m,style:v,children:T.jsx("span",{className:h})})}const E=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),bo=["center","classes","className"];let oe=e=>e,me,xe,ve,ye;const re=550,go=80,mo=le(me||(me=oe`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0.1;
|
|
@@ -71,4 +71,4 @@ import{bb as Xe,bc as Ye,F as Ge,bd as qe,Y as G,Z as b,$ as z,W as ee,X as se,b
|
|
|
71
71
|
animation-iteration-count: infinite;
|
|
72
72
|
animation-delay: 200ms;
|
|
73
73
|
}
|
|
74
|
-
`),E.rippleVisible,mo,re,({theme:e})=>e.transitions.easing.easeInOut,E.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,E.child,E.childLeaving,xo,re,({theme:e})=>e.transitions.easing.easeInOut,E.childPulsate,vo,({theme:e})=>e.transitions.easing.easeInOut),Ro=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiTouchRipple"}),{center:n=!1,classes:a={},className:r}=i,u=G(i,bo),[c,p]=l.useState([]),f=l.useRef(0),g=l.useRef(null);l.useEffect(()=>{g.current&&(g.current(),g.current=null)},[c]);const m=l.useRef(!1),v=Ze(),h=l.useRef(null),C=l.useRef(null),_=l.useCallback(d=>{const{pulsate:R,rippleX:x,rippleY:y,rippleSize:L,cb:O}=d;p(M=>[...M,T.jsx(Co,{classes:{ripple:z(a.ripple,E.ripple),rippleVisible:z(a.rippleVisible,E.rippleVisible),ripplePulsate:z(a.ripplePulsate,E.ripplePulsate),child:z(a.child,E.child),childLeaving:z(a.childLeaving,E.childLeaving),childPulsate:z(a.childPulsate,E.childPulsate)},timeout:re,pulsate:R,rippleX:x,rippleY:y,rippleSize:L},f.current)]),f.current+=1,g.current=O},[a]),V=l.useCallback((d={},R={},x=()=>{})=>{const{pulsate:y=!1,center:L=n||R.pulsate,fakeElement:O=!1}=R;if((d==null?void 0:d.type)==="mousedown"&&m.current){m.current=!1;return}(d==null?void 0:d.type)==="touchstart"&&(m.current=!0);const M=O?null:C.current,D=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,F,j;if(L||d===void 0||d.clientX===0&&d.clientY===0||!d.clientX&&!d.touches)P=Math.round(D.width/2),F=Math.round(D.height/2);else{const{clientX:W,clientY:k}=d.touches&&d.touches.length>0?d.touches[0]:d;P=Math.round(W-D.left),F=Math.round(k-D.top)}if(L)j=Math.sqrt((2*D.width**2+D.height**2)/3),j%2===0&&(j+=1);else{const W=Math.max(Math.abs((M?M.clientWidth:0)-P),P)*2+2,k=Math.max(Math.abs((M?M.clientHeight:0)-F),F)*2+2;j=Math.sqrt(W**2+k**2)}d!=null&&d.touches?h.current===null&&(h.current=()=>{_({pulsate:y,rippleX:P,rippleY:F,rippleSize:j,cb:x})},v.start(go,()=>{h.current&&(h.current(),h.current=null)})):_({pulsate:y,rippleX:P,rippleY:F,rippleSize:j,cb:x})},[n,_,v]),S=l.useCallback(()=>{V({},{pulsate:!0})},[V]),I=l.useCallback((d,R)=>{if(v.clear(),(d==null?void 0:d.type)==="touchend"&&h.current){h.current(),h.current=null,v.start(0,()=>{I(d,R)});return}h.current=null,p(x=>x.length>0?x.slice(1):x),g.current=R},[v]);return l.useImperativeHandle(t,()=>({pulsate:S,start:V,stop:I}),[S,V,I]),T.jsx(yo,b({className:z(E.root,a.root,r),ref:C},u,{children:T.jsx(ue,{component:null,exit:!0,children:c})}))});function Mo(e){return Ce("MuiButtonBase",e)}const zo=ee("MuiButtonBase",["root","disabled","focusVisible"]),Eo=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Bo=e=>{const{disabled:o,focusVisible:t,focusVisibleClassName:i,classes:n}=e,r=Re({root:["root",o&&"disabled",t&&"focusVisible"]},Mo,n);return t&&i&&(r.root+=` ${i}`),r},To=H("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,o)=>o.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${zo.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),$o=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiButtonBase"}),{action:n,centerRipple:a=!1,children:r,className:u,component:c="button",disabled:p=!1,disableRipple:f=!1,disableTouchRipple:g=!1,focusRipple:m=!1,LinkComponent:v="a",onBlur:h,onClick:C,onContextMenu:_,onDragLeave:V,onFocus:S,onFocusVisible:I,onKeyDown:d,onKeyUp:R,onMouseDown:x,onMouseLeave:y,onMouseUp:L,onTouchEnd:O,onTouchMove:M,onTouchStart:D,tabIndex:P=0,TouchRippleProps:F,touchRippleRef:j,type:W}=i,k=G(i,Eo),K=l.useRef(null),$=l.useRef(null),Ee=be($,j),{isFocusVisibleRef:pe,onFocus:Be,onBlur:Te,ref:$e}=we(),[U,q]=l.useState(!1);p&&U&&q(!1),l.useImperativeHandle(n,()=>({focusVisible:()=>{q(!0),K.current.focus()}}),[]);const[te,Ie]=l.useState(!1);l.useEffect(()=>{Ie(!0)},[]);const Pe=te&&!f&&!p;l.useEffect(()=>{U&&m&&!f&&te&&$.current.pulsate()},[f,m,U,te]);function N(s,fe,Ke=g){return w(he=>(fe&&fe(he),!Ke&&$.current&&$.current[s](he),!0))}const ke=N("start",x),Ne=N("stop",_),Ve=N("stop",V),Se=N("stop",L),Le=N("stop",s=>{U&&s.preventDefault(),y&&y(s)}),De=N("start",D),Fe=N("stop",O),je=N("stop",M),_e=N("stop",s=>{Te(s),pe.current===!1&&q(!1),h&&h(s)},!1),Oe=w(s=>{K.current||(K.current=s.currentTarget),Be(s),pe.current===!0&&(q(!0),I&&I(s)),S&&S(s)}),ne=()=>{const s=K.current;return c&&c!=="button"&&!(s.tagName==="A"&&s.href)},ie=l.useRef(!1),We=w(s=>{m&&!ie.current&&U&&$.current&&s.key===" "&&(ie.current=!0,$.current.stop(s,()=>{$.current.start(s)})),s.target===s.currentTarget&&ne()&&s.key===" "&&s.preventDefault(),d&&d(s),s.target===s.currentTarget&&ne()&&s.key==="Enter"&&!p&&(s.preventDefault(),C&&C(s))}),Ue=w(s=>{m&&s.key===" "&&$.current&&U&&!s.defaultPrevented&&(ie.current=!1,$.current.stop(s,()=>{$.current.pulsate(s)})),R&&R(s),C&&s.target===s.currentTarget&&ne()&&s.key===" "&&!s.defaultPrevented&&C(s)});let Z=c;Z==="button"&&(k.href||k.to)&&(Z=v);const X={};Z==="button"?(X.type=W===void 0?"button":W,X.disabled=p):(!k.href&&!k.to&&(X.role="button"),p&&(X["aria-disabled"]=p));const Ae=be(t,$e,K),de=b({},i,{centerRipple:a,component:c,disabled:p,disableRipple:f,disableTouchRipple:g,focusRipple:m,tabIndex:P,focusVisible:U}),He=Bo(de);return T.jsxs(To,b({as:Z,className:z(He.root,u),ownerState:de,onBlur:_e,onClick:C,onContextMenu:Ne,onFocus:Oe,onKeyDown:We,onKeyUp:Ue,onMouseDown:ke,onMouseLeave:Le,onMouseUp:Se,onDragLeave:Ve,onTouchEnd:Fe,onTouchMove:je,onTouchStart:De,ref:Ae,tabIndex:p?-1:P,type:W},X,k,{children:[r,Pe?T.jsx(Ro,b({ref:Ee,center:a},F)):null]}))}),Io=ee("MuiBox",["root"]),Po=eo(),Uo=ao({themeId:Qe,defaultTheme:Po,defaultClassName:Io.root,generateClassName:Je.generate});function ko(e){return Ce("MuiButton",e)}const Q=ee("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"]),No=l.createContext({}),Vo=l.createContext(void 0),So=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Lo=e=>{const{color:o,disableElevation:t,fullWidth:i,size:n,variant:a,classes:r}=e,u={root:["root",a,`${a}${B(o)}`,`size${B(n)}`,`${a}Size${B(n)}`,`color${B(o)}`,t&&"disableElevation",i&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${B(n)}`],endIcon:["icon","endIcon",`iconSize${B(n)}`]},c=Re(u,ko,r);return b({},r,c)},ze=e=>b({},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}}),Do=H($o,{shouldForwardProp:e=>to(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`${t.variant}${B(t.color)}`],o[`size${B(t.size)}`],o[`${t.variant}Size${B(t.size)}`],t.color==="inherit"&&o.colorInherit,t.disableElevation&&o.disableElevation,t.fullWidth&&o.fullWidth]}})(({theme:e,ownerState:o})=>{var t,i;const n=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],a=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return b({},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":b({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:J.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})`:J.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})`:J.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:a,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":b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Q.focusVisible}`]:b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Q.disabled}`]:b({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 ${J.alpha(e.palette[o.color].main,.5)}`},o.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(t=(i=e.palette).getContrastText)==null?void 0:t.call(i,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:n,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"},[`&.${Q.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Q.disabled}`]:{boxShadow:"none"}}),Fo=H("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.startIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},ze(e))),jo=H("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.endIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},ze(e))),Ao=l.forwardRef(function(o,t){const i=l.useContext(No),n=l.useContext(Vo),a=oo(i,o),r=se({props:a,name:"MuiButton"}),{children:u,color:c="primary",component:p="button",className:f,disabled:g=!1,disableElevation:m=!1,disableFocusRipple:v=!1,endIcon:h,focusVisibleClassName:C,fullWidth:_=!1,size:V="medium",startIcon:S,type:I,variant:d="text"}=r,R=G(r,So),x=b({},r,{color:c,component:p,disabled:g,disableElevation:m,disableFocusRipple:v,fullWidth:_,size:V,type:I,variant:d}),y=Lo(x),L=S&&T.jsx(Fo,{className:y.startIcon,ownerState:x,children:S}),O=h&&T.jsx(jo,{className:y.endIcon,ownerState:x,children:h}),M=n||"";return T.jsxs(Do,b({ownerState:x,className:z(i.className,y.root,f,M),component:p,disabled:g,focusRipple:!v,focusVisibleClassName:z(y.focusVisible,C),ref:t,type:I},R,{classes:y,children:[L,u,O]}))});export{No as B,ge as T,ro as _,Vo as a,$o as b,Ao as c,Uo as d};
|
|
74
|
+
`),E.rippleVisible,mo,re,({theme:e})=>e.transitions.easing.easeInOut,E.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,E.child,E.childLeaving,xo,re,({theme:e})=>e.transitions.easing.easeInOut,E.childPulsate,vo,({theme:e})=>e.transitions.easing.easeInOut),Ro=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiTouchRipple"}),{center:n=!1,classes:a={},className:r}=i,u=G(i,bo),[c,p]=l.useState([]),f=l.useRef(0),g=l.useRef(null);l.useEffect(()=>{g.current&&(g.current(),g.current=null)},[c]);const m=l.useRef(!1),v=Ze(),h=l.useRef(null),C=l.useRef(null),_=l.useCallback(d=>{const{pulsate:R,rippleX:x,rippleY:y,rippleSize:L,cb:O}=d;p(M=>[...M,T.jsx(Co,{classes:{ripple:z(a.ripple,E.ripple),rippleVisible:z(a.rippleVisible,E.rippleVisible),ripplePulsate:z(a.ripplePulsate,E.ripplePulsate),child:z(a.child,E.child),childLeaving:z(a.childLeaving,E.childLeaving),childPulsate:z(a.childPulsate,E.childPulsate)},timeout:re,pulsate:R,rippleX:x,rippleY:y,rippleSize:L},f.current)]),f.current+=1,g.current=O},[a]),V=l.useCallback((d={},R={},x=()=>{})=>{const{pulsate:y=!1,center:L=n||R.pulsate,fakeElement:O=!1}=R;if((d==null?void 0:d.type)==="mousedown"&&m.current){m.current=!1;return}(d==null?void 0:d.type)==="touchstart"&&(m.current=!0);const M=O?null:C.current,D=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,j,F;if(L||d===void 0||d.clientX===0&&d.clientY===0||!d.clientX&&!d.touches)P=Math.round(D.width/2),j=Math.round(D.height/2);else{const{clientX:W,clientY:k}=d.touches&&d.touches.length>0?d.touches[0]:d;P=Math.round(W-D.left),j=Math.round(k-D.top)}if(L)F=Math.sqrt((2*D.width**2+D.height**2)/3),F%2===0&&(F+=1);else{const W=Math.max(Math.abs((M?M.clientWidth:0)-P),P)*2+2,k=Math.max(Math.abs((M?M.clientHeight:0)-j),j)*2+2;F=Math.sqrt(W**2+k**2)}d!=null&&d.touches?h.current===null&&(h.current=()=>{_({pulsate:y,rippleX:P,rippleY:j,rippleSize:F,cb:x})},v.start(go,()=>{h.current&&(h.current(),h.current=null)})):_({pulsate:y,rippleX:P,rippleY:j,rippleSize:F,cb:x})},[n,_,v]),S=l.useCallback(()=>{V({},{pulsate:!0})},[V]),I=l.useCallback((d,R)=>{if(v.clear(),(d==null?void 0:d.type)==="touchend"&&h.current){h.current(),h.current=null,v.start(0,()=>{I(d,R)});return}h.current=null,p(x=>x.length>0?x.slice(1):x),g.current=R},[v]);return l.useImperativeHandle(t,()=>({pulsate:S,start:V,stop:I}),[S,V,I]),T.jsx(yo,b({className:z(E.root,a.root,r),ref:C},u,{children:T.jsx(ue,{component:null,exit:!0,children:c})}))});function Mo(e){return Ce("MuiButtonBase",e)}const zo=ee("MuiButtonBase",["root","disabled","focusVisible"]),Eo=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Bo=e=>{const{disabled:o,focusVisible:t,focusVisibleClassName:i,classes:n}=e,r=Re({root:["root",o&&"disabled",t&&"focusVisible"]},Mo,n);return t&&i&&(r.root+=` ${i}`),r},To=H("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,o)=>o.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${zo.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),$o=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiButtonBase"}),{action:n,centerRipple:a=!1,children:r,className:u,component:c="button",disabled:p=!1,disableRipple:f=!1,disableTouchRipple:g=!1,focusRipple:m=!1,LinkComponent:v="a",onBlur:h,onClick:C,onContextMenu:_,onDragLeave:V,onFocus:S,onFocusVisible:I,onKeyDown:d,onKeyUp:R,onMouseDown:x,onMouseLeave:y,onMouseUp:L,onTouchEnd:O,onTouchMove:M,onTouchStart:D,tabIndex:P=0,TouchRippleProps:j,touchRippleRef:F,type:W}=i,k=G(i,Eo),K=l.useRef(null),$=l.useRef(null),Ee=be($,F),{isFocusVisibleRef:pe,onFocus:Be,onBlur:Te,ref:$e}=we(),[U,q]=l.useState(!1);p&&U&&q(!1),l.useImperativeHandle(n,()=>({focusVisible:()=>{q(!0),K.current.focus()}}),[]);const[te,Ie]=l.useState(!1);l.useEffect(()=>{Ie(!0)},[]);const Pe=te&&!f&&!p;l.useEffect(()=>{U&&m&&!f&&te&&$.current.pulsate()},[f,m,U,te]);function N(s,fe,Ke=g){return w(he=>(fe&&fe(he),!Ke&&$.current&&$.current[s](he),!0))}const ke=N("start",x),Ne=N("stop",_),Ve=N("stop",V),Se=N("stop",L),Le=N("stop",s=>{U&&s.preventDefault(),y&&y(s)}),De=N("start",D),je=N("stop",O),Fe=N("stop",M),_e=N("stop",s=>{Te(s),pe.current===!1&&q(!1),h&&h(s)},!1),Oe=w(s=>{K.current||(K.current=s.currentTarget),Be(s),pe.current===!0&&(q(!0),I&&I(s)),S&&S(s)}),ne=()=>{const s=K.current;return c&&c!=="button"&&!(s.tagName==="A"&&s.href)},ie=l.useRef(!1),We=w(s=>{m&&!ie.current&&U&&$.current&&s.key===" "&&(ie.current=!0,$.current.stop(s,()=>{$.current.start(s)})),s.target===s.currentTarget&&ne()&&s.key===" "&&s.preventDefault(),d&&d(s),s.target===s.currentTarget&&ne()&&s.key==="Enter"&&!p&&(s.preventDefault(),C&&C(s))}),Ue=w(s=>{m&&s.key===" "&&$.current&&U&&!s.defaultPrevented&&(ie.current=!1,$.current.stop(s,()=>{$.current.pulsate(s)})),R&&R(s),C&&s.target===s.currentTarget&&ne()&&s.key===" "&&!s.defaultPrevented&&C(s)});let Z=c;Z==="button"&&(k.href||k.to)&&(Z=v);const X={};Z==="button"?(X.type=W===void 0?"button":W,X.disabled=p):(!k.href&&!k.to&&(X.role="button"),p&&(X["aria-disabled"]=p));const Ae=be(t,$e,K),de=b({},i,{centerRipple:a,component:c,disabled:p,disableRipple:f,disableTouchRipple:g,focusRipple:m,tabIndex:P,focusVisible:U}),He=Bo(de);return T.jsxs(To,b({as:Z,className:z(He.root,u),ownerState:de,onBlur:_e,onClick:C,onContextMenu:Ne,onFocus:Oe,onKeyDown:We,onKeyUp:Ue,onMouseDown:ke,onMouseLeave:Le,onMouseUp:Se,onDragLeave:Ve,onTouchEnd:je,onTouchMove:Fe,onTouchStart:De,ref:Ae,tabIndex:p?-1:P,type:W},X,k,{children:[r,Pe?T.jsx(Ro,b({ref:Ee,center:a},j)):null]}))}),Io=ee("MuiBox",["root"]),Po=eo(),Uo=ao({themeId:Qe,defaultTheme:Po,defaultClassName:Io.root,generateClassName:Je.generate});function ko(e){return Ce("MuiButton",e)}const Q=ee("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"]),No=l.createContext({}),Vo=l.createContext(void 0),So=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Lo=e=>{const{color:o,disableElevation:t,fullWidth:i,size:n,variant:a,classes:r}=e,u={root:["root",a,`${a}${B(o)}`,`size${B(n)}`,`${a}Size${B(n)}`,`color${B(o)}`,t&&"disableElevation",i&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${B(n)}`],endIcon:["icon","endIcon",`iconSize${B(n)}`]},c=Re(u,ko,r);return b({},r,c)},ze=e=>b({},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}}),Do=H($o,{shouldForwardProp:e=>to(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`${t.variant}${B(t.color)}`],o[`size${B(t.size)}`],o[`${t.variant}Size${B(t.size)}`],t.color==="inherit"&&o.colorInherit,t.disableElevation&&o.disableElevation,t.fullWidth&&o.fullWidth]}})(({theme:e,ownerState:o})=>{var t,i;const n=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],a=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return b({},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":b({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:J.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})`:J.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})`:J.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:a,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":b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Q.focusVisible}`]:b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Q.disabled}`]:b({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 ${J.alpha(e.palette[o.color].main,.5)}`},o.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(t=(i=e.palette).getContrastText)==null?void 0:t.call(i,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:n,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"},[`&.${Q.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Q.disabled}`]:{boxShadow:"none"}}),jo=H("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.startIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},ze(e))),Fo=H("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.endIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},ze(e))),Ao=l.forwardRef(function(o,t){const i=l.useContext(No),n=l.useContext(Vo),a=oo(i,o),r=se({props:a,name:"MuiButton"}),{children:u,color:c="primary",component:p="button",className:f,disabled:g=!1,disableElevation:m=!1,disableFocusRipple:v=!1,endIcon:h,focusVisibleClassName:C,fullWidth:_=!1,size:V="medium",startIcon:S,type:I,variant:d="text"}=r,R=G(r,So),x=b({},r,{color:c,component:p,disabled:g,disableElevation:m,disableFocusRipple:v,fullWidth:_,size:V,type:I,variant:d}),y=Lo(x),L=S&&T.jsx(jo,{className:y.startIcon,ownerState:x,children:S}),O=h&&T.jsx(Fo,{className:y.endIcon,ownerState:x,children:h}),M=n||"";return T.jsxs(Do,b({ownerState:x,className:z(i.className,y.root,f,M),component:p,disabled:g,focusRipple:!v,focusVisibleClassName:z(y.focusVisible,C),ref:t,type:I},R,{classes:y,children:[L,u,O]}))});export{No as B,ge as T,ro as _,Vo as a,$o as b,Ao as c,Uo as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as j,a as pa,u as _a,L as te}from"./react-B36MyIP_.js";import{t,k as K,m as G,ak as ga,h as ba,ai as P,Q as Ue,e as fa,u as va,w as xa,x as Ca,al as ja,am as ka,I as A,an as Na,l as wa,j as Ma,ao as Oe,E as B,ap as $e,aq as Sa,J as O,b as qa,D as Ve,y as pe,ar as _e,G as se,F as De,g as ne,a as Pa,C as ge,c as Ge,as as Aa}from"./index-VchcND_n.js";import{P as Ye,m as Xe,W as Ia,c as be,t as Ra,C as Fa,A as Ta,a as Ea,s as He,i as Wa,b as La,d as Ba,e as Ka}from"./CollectionCarousel-BLfBmiC7.js";import{u as Qa}from"./useManaRate-CCWK1pxl.js";import{u as Je,r as za}from"./mana-rate-CY9tOCr1.js";import{a as Ua,j as Oa,h as $a,n as Va,i as Da,A as Ga}from"./authorizations-Dtu8Ye0y.js";import{a as fe}from"./buy-CyhVI8ih.js";import{a as Ha,w as Ja,S as Ya,G as Xa}from"./buy-gasless-D6tjB5nW.js";import{R as re,r as Za}from"./cart-checkout-Bp3fmOrE.js";import{u as et,M as at,c as tt}from"./useCreditPacks-B8su_g3G.js";import{l as st}from"./loader-logo-BzY9EKdC.js";import{i as nt,a as rt}from"./errors-C_tFJwwX.js";import{E as ct}from"./ErrorNotice-D_Z5OVFI.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DbssSNOL.js";import"./sendMetaTransaction-CydgYVdt.js";const it="https://cdn.decentraland.org/@dcl/shop/0.1.0-30341633105.commit-bfa7613/assets/buy-error-22UunaPC.png";function ot(c){const{phase:o,balanceCredits:C,onClose:N}=c,I=o==="processing",T=o==="error"?t("cartCheckout.errorTitle"):o==="nofunds"?t("cartCheckout.titleNoFunds"):o==="choose"?t("buyModal.choosePayment"):t("cartCheckout.titleBuy"),E=o==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:I?void 0:N,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${E?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:T}),!I&&e.jsx("button",{className:"buy-modal__x",onClick:N,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:o==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(K,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:G(C)})]})]}),o==="choose"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"cart-checkout__choose-total",children:[e.jsx("span",{children:t("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(K,{className:"buy-modal__balance-ico"}),G(c.totalCredits??0)]})]}),e.jsx(Ye,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const M=Xe(c.totalCents??0,c.totalManaWei??0n);return M!=null?t("buyModal.manaRate",{mana:M.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),o==="processing"&&e.jsx(lt,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),o==="nofunds"&&e.jsx(dt,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:N}),o==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:it,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:t("cartCheckout.errorHeadline")})," ",t("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:N,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:c.onRetry??N,children:t("cartCheckout.tryAgain")})]})]})]})]})}function lt({stage:c,step:o,total:C,isSelfCustody:N}){const I=c==="reserving",T=C>0?Math.min(100,Math.round(o/C*100)):0,E=c==="awaiting-signature"?N?t("buyModal.confirmToContinue"):t("buyModal.completingTransaction"):c==="settling"?t("buyModal.completingTransaction"):t("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:st,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:E}),I?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${T}%`}})}),C>1?e.jsxs("span",{className:"cart-checkout__step",children:[o,"/",C]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function dt({lines:c,shortfallCredits:o,packs:C,selectedPack:N,onSelectPack:I,onBuyPacks:T,onCancel:E}){const M=C.find(n=>n.id===N),ie=c.reduce((n,q)=>n+(q.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(Ia,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,o)})})," ",t("buyModal.warningToPurchase",{count:ie})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:c.map(n=>{const q=n.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:n.item.name,children:[n.item.name||t("buyModal.itemFallback"),q>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:t("cartCheckout.qty",{count:q})}):null]}),n.item.creator?e.jsx(ga,{address:n.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(K,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:G(n.priceCredits*q)})]})]})]},n.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:C.map(n=>{const q=n.id===N;return e.jsxs("button",{className:`buy-modal__pack${q?" buy-modal__pack--on":""}`,onClick:()=>I(n.id),children:[e.jsx(K,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:G(n.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(K,{className:"buy-modal__total-ico"}),e.jsx("span",{children:G((M==null?void 0:M.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((M==null?void 0:M.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:E,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:T,children:t("buyModal.buy")})]})]})}function ve(c){if(nt(c))return t("errors.rejected");const o=(c.message??"").toLowerCase();return o.includes("insufficient")?t("cart.error.insufficient",{currency:qa.name}):o.includes("no active listing")||o.includes("your own listing")?t("cart.error.listingChanged"):t("marketCheckout.error.generic")}const ut=12e4;function ht(c){const o=[];return c.unavailable.length&&o.push(t("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&o.push(t("cart.drop.own",{count:c.own.length})),t("cart.drop.removed",{items:o.join(` ${t("cart.drop.and")} `)})}const xe=c=>c.reduce((o,C)=>o+C.priceCredits*C.quantity,0),ce=c=>c.flatMap(o=>Array.from({length:o.quantity},()=>({...o,quantity:1})));function It(){ba({title:t("nav.cart"),noindex:!0});const c=P(a=>a.items),o=P(a=>a.remove),C=P(a=>a.increment),N=P(a=>a.decrement),I=P(a=>a.clear),T=P(a=>a.restore),E=P(a=>a.setFittingOpen),M=Ue(a=>a.items),ie=Ue(a=>a.toggle),{session:n,signIn:q}=fa(),H=et().packs.slice(0,at);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Ze=c.some(a=>a.category!=="emote"),{data:oe}=va({queryKey:["upsell-listings"],queryFn:()=>Aa({first:40}),staleTime:6e4}),{data:f}=xa(n),y=Ca(),Q=pa(),{state:W}=_a(),[ea,$]=j.useState(null),[Ce,J]=j.useState(null),[aa,S]=j.useState(!1),[w,L]=j.useState(null),je=j.useRef(0),[u,g]=j.useState(null),{data:V}=ja(n),{data:le}=Qa(!0),[de,ke]=j.useState(""),D=j.useRef(null),Ne=ka(c),we=a=>Oe(Ne[a.id]),ue=c.filter(we),he=c.length>0&&ue.length===0,ta=ue.reduce((a,s)=>a+s.priceCredits*s.quantity,0),sa=c.reduce((a,s)=>a+s.quantity,0),na=ue.reduce((a,s)=>a+s.quantity,0),Me=w?w.liveTotalCredits:ta,ra=new Set(c.map(a=>a.id)),Se=((oe==null?void 0:oe.items)??[]).filter(a=>!ra.has(a.id)).slice(0,12),ca=new Map(w==null?void 0:w.buyable.map(a=>[a.item.id,a])),Y=(f==null?void 0:f.credits)??0,X=Me*10,qe=le?Je(X,le):0n,Z=be({priceCents:X,priceManaWei:qe,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n}),Pe=Xe(X,qe),Ae=Pe!=null?t("buyModal.manaRate",{mana:Pe.toLocaleString("en",{maximumFractionDigits:2})}):null,ia=Sa;function ee(a){a(),L(null),J(null),$(null)}function oa(){g(null),S(!1)}function Ie(a){const s=xe(a),i=Math.max(0,s-Y),r=H.find(l=>l.credits>=i)??H[H.length-1];ke(r.id),B("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:Y,shortfall:i}),g({phase:"nofunds",lines:a.map(l=>({item:l.item,priceCredits:l.priceCredits,quantity:l.quantity})),shortfall:i}),S(!1)}async function me(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(m=>({...m.item,priceCredits:m.priceCredits})),r=a.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),l=[];let d="authorize",p=!1;g({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[];for(let x=0;x<s.length;x++){const b=s[x];g({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const{credit:v,maxCreditedValue:U}=await Ve(n.identity,b.usdCents,b.trade.id);l.push(v.id),m.push({trade:b.trade,credits:[v],maxCreditedValue:U})}catch(v){if(rt(v)){if(l.length){try{await pe(n.identity,l)}catch(U){O(U,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}Ie(a);return}throw v}}d="submit";const k=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let _=[];if(Ua())try{_=await Ha({purchases:m,buyer:n.address,signer:n.signer,onSigned:k});const b=(await Promise.allSettled(_.map(v=>Ja(v)))).flatMap(v=>v.status==="rejected"?[v.reason]:[]);if(b.length&&!b.some(v=>v instanceof Ya))throw b[0];p=!0}catch(x){if(!(x instanceof Xa))throw x;_=await fe({purchases:m,buyer:n.address,signer:n.signer,onSigned:k})}else _=await fe({purchases:m,buyer:n.address,signer:n.signer});a.forEach(x=>o(x.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"credits",no_crypto_step:p,transaction_hash:_[0]??null}),Wa(y);const h=D.current;D.current=null,g(null),S(!1);const F={items:r,txHash:_[0]??void 0,settled:!0,...h?{creditsAdded:h}:{}};Q("/success",{state:F,replace:!0})}catch(m){if(se(m)||O(m,{flow:"cart_checkout",step:d,cart_size:a.length}),B(se(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:De(m),value_usd:$e(i.reduce((k,_)=>k+_.priceCredits,0)),cart_size:s.length}),l.length){try{await pe(n.identity,l)}catch(k){O(k,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}g({phase:"error",message:ve(m)})}}function Re(a,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const i=D.current;D.current=null,g(null),S(!1);const r={items:a,txHash:s[0]??void 0,settled:!0,...i?{creditsAdded:i}:{}};Q("/success",{state:r,replace:!0})}function Fe(a,s){se(a)||O(a,{flow:s,step:"submit"}),B(se(a)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:De(a)}),g({phase:"error",message:ve(a)}),S(!1)}async function la(a,s){const i=ne(ge.MANAToken,s),r=ne(ge.CreditsManager,s);await Da({auth:{kind:Ga.Allowance,contractAddress:i.address,spenderAddress:r.address,chainId:s},signer:a})}async function da(a){const s=ce(a).reduce((d,p)=>d+p.usdCents,0),i=(V??0n)>0n;let r=le;if(!r&&i)try{r=await y.fetchQuery({queryKey:["mana-rate",Ge.chainId],queryFn:()=>za(Ge.chainId),staleTime:6e4})}catch{r=void 0}const l=r?Je(s,r):0n;return{totalCents:s,manaWei:l}}async function Te(a,s){const i=xe(a),{totalCents:r,manaWei:l}=await da(a),d=be({priceCents:r,priceManaWei:l,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n});if(s&&d.options.some(p=>p.method===s)){if(s==="credits"){me(a);return}const{spender:p,chainId:m}=Ee(s,a);await We(p,m,()=>s==="mana"?void Le(a):void Be(a,r,l));return}if(d.options.some(p=>p.method==="mana"||p.method==="combined")){g({phase:"choose",lines:a,totalCents:r,manaWei:l}),S(!1);return}if(f!=null&&f.credits<i){Ie(a);return}me(a)}function ua(a){return be({priceCents:a.totalCents,priceManaWei:a.manaWei,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n})}const[ye,ae]=j.useState(null);function Ee(a,s){const i=s[0].trade;return{spender:a==="mana"?ne(Pa(i.contract),i.chainId).address:ne(ge.CreditsManager,i.chainId).address,chainId:i.chainId}}async function We(a,s,i){const r=Oa(s,a),l=n?await $a(r,n.address).catch(()=>!0):!0;if(Va(n==null?void 0:n.providerType,l)){S(!1),ae({auth:r,run:i});return}i()}function ha(a){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:i,manaWei:r}=u;if(a==="credits"){me(s);return}const{spender:l,chainId:d}=Ee(a,s);We(l,d,()=>a==="mana"?void Le(s):void Be(s,i,r))}async function Le(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(d=>({...d.item,priceCredits:d.priceCredits})),r=a.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),l=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const d=await La({trades:s.map(p=>p.trade),buyer:n.address,signer:n.signer,onSigned:l});a.forEach(p=>o(p.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"mana",transaction_hash:d[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(r,d)}catch(d){Fe(d,"buy_cart_mana")}}async function Be(a,s,i){if(!n||a.length===0)return;const r=ce(a),l=r.map(h=>({...h.item,priceCredits:h.priceCredits})),d=a.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),p=Ba(r.map(h=>h.usdCents),(f==null?void 0:f.balanceCents)??0),m=p.reduce((h,F)=>h+F,0),k=Ka(Math.max(0,s-m),s,i),_=[];g({phase:"processing",stage:"reserving",step:1,total:r.length});try{const h=[];for(let b=0;b<r.length;b++){const v=p[b];if(v<=0)continue;g({phase:"processing",stage:"reserving",step:b+1,total:r.length});const{credit:U,maxCreditedValue:ya}=await Ve(n.identity,v,r[b].trade.id);_.push(U.id),h.push({trade:r[b].trade,credits:[U],maxCreditedValue:ya})}r.forEach((b,v)=>{p[v]<=0&&h.push({trade:b.trade,credits:[],maxCreditedValue:"0"})}),h[0]={...h[0],maxCreditedValue:(BigInt(h[0].maxCreditedValue)+k).toString()},await la(n.signer,r[0].trade.chainId);const F=()=>g({phase:"processing",stage:"settling",step:r.length,total:r.length});g({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const x=await fe({purchases:h,buyer:n.address,signer:n.signer,onSigned:F});a.forEach(b=>o(b.item.id)),L(null),B("Shop Completed Purchase",{..._e(l),payment_type:"credits_and_mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(d,x)}catch(h){_.length&&(pe(n.identity,_).catch(()=>{}),y.invalidateQueries({queryKey:["usd-balance"]})),Fe(h,"buy_cart_combined")}}async function z(a){if(!n){He({type:"cart-checkout"}),q();return}const s=P.getState().items.filter(we);if(s.length===0)return;$(null),J(null),S(!0);const i=s.reduce((r,l)=>r+l.priceCredits*l.quantity,0);B("Shop Started Checkout",{cart_size:s.length,cart_value_credits:i,cart_value_usd:$e(i),has_sufficient_credits:Y>=i});try{const r=await Za(s,n.address,ia),l=[...r.unavailable,...r.own];if(l.length&&(l.forEach(d=>o(d.id)),J(ht(r))),r.buyable.length===0){$(t("cart.error.noneAvailable")),L(null);return}if(r.orderChanged){L(r),je.current=Date.now();return}await Te(r.buyable,a)}catch(r){O(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),$(ve(r))}finally{S(!1)}}async function Ke(){if(w){if(!n){He({type:"cart-checkout"}),q();return}if(Date.now()-je.current>ut){L(null),J(null),await z();return}$(null),Te(w.buyable)}}async function ma(){if(de){try{sessionStorage.setItem(re,JSON.stringify(P.getState().items))}catch{}S(!0);try{const a=await tt(de,n?{address:n.address,identity:n.identity}:void 0);if(a.url){window.location.href=a.url;return}Q("/credits")}catch(a){try{sessionStorage.removeItem(re)}catch{}O(a,{flow:"cart_buy_credits"}),g({phase:"error",message:t("buyModal.error.creditsCheckout")})}finally{S(!1)}}}const Qe=j.useRef(!1);j.useEffect(()=>{if(!n||Qe.current||!Ra("cart-checkout"))return;Qe.current=!0;const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[n]);const ze=j.useRef(!1);j.useEffect(()=>{if(!(W!=null&&W.resumeCheckout)||ze.current)return;ze.current=!0,D.current=W.creditsAdded??null;try{const s=sessionStorage.getItem(re);if(s){sessionStorage.removeItem(re);const i=JSON.parse(s);Array.isArray(i)&&i.length&&T(i)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[W==null?void 0:W.resumeCheckout]);const R=aa||(u==null?void 0:u.phase)==="processing";return c.length===0&&!u?e.jsx("div",{className:"checkout checkout--empty",children:e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("section",{className:"checkout__panel cart-empty","data-testid":"cart-empty",children:[e.jsx(A,{name:"cart-plus",size:110,className:"cart-empty__icon"}),e.jsxs("div",{className:"cart-empty__text",children:[e.jsx("p",{className:"cart-empty__title",children:t("cart.empty.title")}),e.jsx("p",{className:"cart-empty__body",children:t("cart.empty.body")})]}),e.jsx(te,{className:"cart-empty__cta",to:"/assets",children:t("cart.empty.cta")})]})]})}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>Q(-1),type:"button","aria-label":t("cart.goBack"),children:e.jsx(A,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:t("cart.panelTitle",{count:sa})}),Ze?e.jsxs("button",{className:"checkout__fitting",onClick:()=>E(!0),disabled:R,children:[e.jsx(A,{name:"fitting-room"}),t("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:c.map(a=>{const s=ca.get(a.id),i=s?s.priceCredits:a.priceCredits,r=!!s&&s.priceCredits!==a.priceCredits,l=!a.tokenId,d=a.quantity,p=typeof a.available=="number"&&d>=a.available,m=i*d,k=!!M[a.id],_=Na(a),h=Ne[a.id],F=!Oe(h),x=h==="sold-out"?t("cart.availability.soldOut"):t("cart.availability.unavailable");return e.jsxs("div",{className:`checkout__card${F?" is-unavailable":""}`,children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(te,{className:"checkout__thumb-link",to:_,state:{item:a,tradeId:a.tradeId},"aria-label":a.name,children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null}):a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(te,{className:"checkout__name",to:_,state:{item:a,tradeId:a.tradeId},title:a.name,children:a.name}):e.jsx("div",{className:"checkout__name",title:a.name,children:a.name}),a.creator?e.jsx(wa,{address:a.creator,className:"checkout__creator",linkToProfile:!0}):null,l?e.jsxs("span",{className:"checkout__creator-tag","data-testid":"cart-creator-tag",children:[e.jsx(A,{name:"buy-from-creator",className:"checkout__creator-tag-ico","aria-hidden":!0}),t("cart.creatorTag")]}):null]}),e.jsx("div",{className:"checkout__foot",children:F?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"checkout__unavailable",children:[e.jsx(A,{name:"warning-fill",size:24,className:"checkout__warn","aria-hidden":!0}),x]}),_?e.jsx(te,{className:"checkout__resales",to:_,state:{item:a,tradeId:a.tradeId},children:t("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>N(a.id)),disabled:R||d<=1,"aria-label":t("cart.decreaseQuantity",{name:a.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:d}),e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>C(a.id)),disabled:R||p,"aria-label":t("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(K,{className:"checkout__price-ico"})," ",m,r?e.jsx("span",{className:"checkout__price-was",children:a.priceCredits*d}):null]})]})})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${k?" is-on":""}`,onClick:()=>ie(a),"aria-label":k?t("cart.removeFromFavorites",{name:a.name}):t("cart.addToFavorites",{name:a.name}),title:k?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(A,{name:k?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>ee(()=>o(a.id)),disabled:R,"aria-label":t("cart.remove",{name:a.name}),title:t("cart.removeTitle"),children:e.jsx(A,{name:"trash",size:24})})]})]},a.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>ee(I),disabled:R,children:t("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:t("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:t("cart.totalItems",{count:na})}),e.jsxs("span",{className:"checkout__total-side",children:[e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(K,{className:"checkout__total-ico"})," ",Me]}),Ae&&(V??0n)>0n?e.jsx("span",{className:"checkout__total-rate","data-testid":"cart-mana-rate",children:Ae}):null]})]}),Z.options.length>0||Z.manaShortfall?e.jsx(Ye,{options:Z.options,totalCents:X,shortfall:Z.manaShortfall,creditsLabel:w?t("marketCheckout.confirmPurchase"):t("cart.buyWithCredits"),busy:R||he,onPay:a=>void(w?Ke():z(a))}):e.jsx("button",{className:"checkout__cta",onClick:()=>void(w?Ke():z()),disabled:R||he,children:R?t("cart.working"):w?t("marketCheckout.confirmPurchase"):t("assetCard.buyNow")}),he?e.jsx("p",{className:"muted checkout__msg",children:t("cart.allUnavailable")}):null,n?null:e.jsx("p",{className:"muted checkout__msg",children:t("cart.signInHint")}),w?e.jsx("p",{className:"muted checkout__msg",children:t("cart.priceChanged")}):null,Ce?e.jsx("p",{className:"muted checkout__msg",children:Ce}):null,e.jsx(ct,{message:ea,className:"checkout__msg"})]})]})]})]}),Se.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(Fa,{title:t("cart.youMightAlsoLike"),items:Se})}):null,ye&&n?e.jsx(Ta,{auth:ye.auth,signer:n.signer,title:t("authorizeStep.manaTitle"),name:t("authorizeStep.manaName"),reason:t("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ea,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:a}=ye;ae(null),a()},onCancel:()=>ae(null),onClose:()=>ae(null)}):null,u?e.jsx(ot,{phase:u.phase,balanceCredits:Y,onClose:oa,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ma(n==null?void 0:n.providerType),options:u.phase==="choose"?ua(u).options:void 0,onPay:ha,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?xe(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:H,selectedPack:de,onSelectPack:ke,onBuyPacks:()=>void ma(),message:u.phase==="error"?u.message:void 0,onRetry:()=>void z()}):null]})}export{It as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{V as N,W as U,X as w,Y as z,Z as o,$ as E,a0 as c,a1 as I,a2 as g,a3 as D,R}from"./index-
|
|
1
|
+
import{V as N,W as U,X as w,Y as z,Z as o,$ as E,a0 as c,a1 as I,a2 as g,a3 as D,R}from"./index-VchcND_n.js";import{r as W,j as v}from"./react-B36MyIP_.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,V=R(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as O,
|
|
1
|
+
import{j as e,r as p,d as O,a as Q}from"./react-B36MyIP_.js";import{K as N,n as v,ay as Y,az as E,I as Z,t,c as V,J as W,u as X,h as ee,M as ae,aA as te,b as re,aB as se}from"./index-VchcND_n.js";import{E as oe}from"./ErrorNotice-D_Z5OVFI.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-Cbl5FMco.js";import{u as de}from"./useStore-BEtv4alq.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-Jh3tfbEa.js";import{L as xe}from"./LoadMore-K8EfO7If.js";import{u as he}from"./useInfiniteGrid-S2Upf1Ae.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import{j as e,r as w}from"./react-B36MyIP_.js";import{n as l,K as s,t as f,k as R,m as j,aN as C,b as Q,R as D,I as K,J as O,g as $,C as _,a as U,aO as B,M as G}from"./index-VchcND_n.js";import{s as H,i as T,A as P,g as L,r as J,m as V,e as Y}from"./authorizations-Dtu8Ye0y.js";import{i as Z}from"./errors-C_tFJwwX.js";import{E as q}from"./ErrorNotice-D_Z5OVFI.js";import{b as X}from"./buy-CyhVI8ih.js";import{g as ee,d as te}from"./trade-encoding-DbssSNOL.js";import{s as ne,M as ae,E as re}from"./sendMetaTransaction-CydgYVdt.js";import{I as se,C as ie}from"./ethers-BteKixT0.js";const I="shop:resume_after_signin",oe=900*1e3;function Oe(n){try{sessionStorage.setItem(I,JSON.stringify({...n,at:Date.now()}))}catch{}}function Ue(n){let t;try{t=sessionStorage.getItem(I)}catch{return null}if(!t)return null;try{sessionStorage.removeItem(I)}catch{}let a;try{a=JSON.parse(t)}catch{return null}return!a||a.type!==n||typeof a.at!="number"||Date.now()-a.at>oe?null:a.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:a.path}}function ce(n,t){return(n+t-1n)/t}function le(n,t,a){return n<=0||t<=0?0n:n>=t?a:ce(a*BigInt(n),BigInt(t))}function Ge(n){var m,x,y;const t=Number.isFinite(n.priceCents)?Math.max(0,Math.trunc(n.priceCents)):0,a=Number.isFinite(n.balanceCents)?Math.max(0,Math.trunc(n.balanceCents)):0,r=n.priceManaWei>0n?n.priceManaWei:0n,o=n.manaBalanceWei>0n?n.manaBalanceWei:0n;if(t<=0)return{options:[],preferred:null,manaShortfall:null};const i=[];if(a>=t&&i.push({method:"credits",creditsCents:t,manaWei:0n}),r>0n&&a>0&&a<t){const c=t-a,g=le(c,t,r);o>=g&&i.push({method:"combined",creditsCents:a,manaWei:g})}r>0n&&o>=r&&i.push({method:"mana",creditsCents:0,manaWei:r});const d=((m=i.find(c=>c.method==="credits"))==null?void 0:m.method)??((x=i.find(c=>c.method==="combined"))==null?void 0:x.method)??((y=i.find(c=>c.method==="mana"))==null?void 0:y.method)??null,b=!i.some(c=>c.method==="mana"||c.method==="combined")&&r>0n&&o>0n?{manaWei:o,manaCents:de(o,t,r),priceCents:t}:null;return{options:i,preferred:d,manaShortfall:b}}function de(n,t,a){return Number(n*BigInt(t)/a)}function He(n,t){let a=Number.isFinite(t)?Math.max(0,Math.trunc(t)):0;return n.map(r=>{const o=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0,i=Math.min(o,a);return a-=i,i})}function k(n){return Number.isFinite(n)?Math.max(0,n)/10:0}function Je(n,t){return n.options.find(a=>a.method===t)??null}function Ve(n,t){if(!Number.isFinite(n)||n<=0||t<=0n)return null;const a=n/10;return Number(t)/1e18/a}const A="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ue=l.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,F=`
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-height: 56px;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
padding: 0 12px;
|
|
16
|
+
border: 0;
|
|
17
|
+
border-radius: 12px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
transition:
|
|
20
|
+
background 0.15s ease,
|
|
21
|
+
filter 0.15s ease;
|
|
22
|
+
font-family: ${s.font.sans};
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
font-size: 15px;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
letter-spacing: 0.46px;
|
|
27
|
+
text-transform: uppercase;
|
|
28
|
+
color: ${s.colors.softWhite};
|
|
29
|
+
|
|
30
|
+
&:focus-visible {
|
|
31
|
+
outline: 2px solid ${s.colors.accent};
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
&:disabled {
|
|
35
|
+
opacity: 0.6;
|
|
36
|
+
cursor: default;
|
|
37
|
+
}
|
|
38
|
+
`,he=l.button`
|
|
39
|
+
${F}
|
|
40
|
+
background: ${s.gradients.amethyst};
|
|
41
|
+
|
|
42
|
+
&:hover:not(:disabled) {
|
|
43
|
+
filter: brightness(1.08);
|
|
44
|
+
}
|
|
45
|
+
`,W=l.button`
|
|
46
|
+
${F}
|
|
47
|
+
background: ${s.colors.text2};
|
|
48
|
+
|
|
49
|
+
&:hover:not(:disabled) {
|
|
50
|
+
background: ${s.colors.gray0};
|
|
51
|
+
}
|
|
52
|
+
`,M=l.span`
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 6px;
|
|
56
|
+
text-transform: none;
|
|
57
|
+
letter-spacing: 0;
|
|
58
|
+
|
|
59
|
+
span {
|
|
60
|
+
font-size: 20px;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
line-height: normal;
|
|
63
|
+
}
|
|
64
|
+
.ico {
|
|
65
|
+
width: 24px;
|
|
66
|
+
height: 24px;
|
|
67
|
+
background: ${s.colors.softWhite};
|
|
68
|
+
}
|
|
69
|
+
`,z=l.span`
|
|
70
|
+
position: relative;
|
|
71
|
+
display: block;
|
|
72
|
+
width: 30px;
|
|
73
|
+
height: 30px;
|
|
74
|
+
flex: none;
|
|
75
|
+
|
|
76
|
+
/* Centred in the slot, not pinned to its top: the slot is taller than the glyph and sits next to a
|
|
77
|
+
vertically centred amount, so a top-pinned mark reads as floating above the number. */
|
|
78
|
+
img {
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: 50%;
|
|
81
|
+
left: 0;
|
|
82
|
+
transform: translateY(-50%);
|
|
83
|
+
width: 24px;
|
|
84
|
+
height: 24px;
|
|
85
|
+
display: block;
|
|
86
|
+
}
|
|
87
|
+
`,pe=l.span`
|
|
88
|
+
font-size: 13px;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
letter-spacing: 0.02em;
|
|
91
|
+
opacity: 0.85;
|
|
92
|
+
`,fe=l.span`
|
|
93
|
+
font-size: 18px;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
opacity: 0.7;
|
|
96
|
+
`,xe=l.p`
|
|
97
|
+
margin: 0;
|
|
98
|
+
font-family: ${s.font.sans};
|
|
99
|
+
font-weight: 400;
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
line-height: 1;
|
|
102
|
+
color: ${s.colors.muted};
|
|
103
|
+
text-align: center;
|
|
104
|
+
`,me=l.p`
|
|
105
|
+
margin: -4px 0 0;
|
|
106
|
+
font-family: ${s.font.sans};
|
|
107
|
+
font-weight: 400;
|
|
108
|
+
font-size: 12px;
|
|
109
|
+
line-height: 1.4;
|
|
110
|
+
color: ${s.colors.muted};
|
|
111
|
+
text-align: center;
|
|
112
|
+
`;function Ye({options:n,totalCents:t,onPay:a,busy:r=!1,rateNote:o,creditsLabel:i,shortfall:d}){return e.jsxs(ue,{children:[n.map(u=>u.method==="credits"?e.jsxs(he,{type:"button","data-testid":"pay-with-credits",onClick:()=>a("credits"),disabled:r,children:[e.jsx("span",{children:i??f("buyModal.buy")}),e.jsxs(M,{children:[e.jsx(R,{}),e.jsx("span",{children:j(k(u.creditsCents))})]})]},"credits"):u.method==="mana"?e.jsxs(W,{type:"button","data-testid":"pay-with-mana",onClick:()=>a("mana"),disabled:r,children:[e.jsx("span",{children:f("buyModal.buyWithMana")}),e.jsxs(M,{children:[e.jsx(z,{children:e.jsx("img",{src:A,alt:"","aria-hidden":!0})}),e.jsx("span",{children:C(u.manaWei)})]})]},"mana"):e.jsxs(W,{type:"button","data-testid":"pay-with-combined",onClick:()=>a("combined"),disabled:r,children:[e.jsx("span",{children:f("buyModal.buyWith")}),e.jsxs(M,{children:[e.jsx(R,{}),e.jsx("span",{children:j(k(u.creditsCents))}),e.jsx(fe,{children:"+"}),e.jsx(z,{children:e.jsx("img",{src:A,alt:"","aria-hidden":!0})}),e.jsx("span",{children:C(u.manaWei)}),e.jsx(pe,{children:"MANA"})]})]},"combined")),d?e.jsxs(e.Fragment,{children:[e.jsxs(W,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[e.jsx("span",{children:f("buyModal.buyWithMana")}),e.jsxs(M,{children:[e.jsx(z,{children:e.jsx("img",{src:A,alt:"","aria-hidden":!0})}),e.jsx("span",{children:C(d.manaWei)})]})]},"mana-short"),e.jsx(me,{"data-testid":"mana-shortfall-note",children:f("buyModal.manaWorth",{mana:C(d.manaWei),credits:j(k(d.manaCents)),price:j(k(d.priceCents)),currency:Q.name})})]}):null,o?e.jsx(xe,{"data-testid":"mana-rate-note",children:o}):null,e.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:t})]})}function Ze(n,t){const a=(r,...o)=>void n.invalidateQueries({queryKey:t?[r,...o]:[r]});n.invalidateQueries({queryKey:["usd-balance"]}),n.invalidateQueries({queryKey:["detail-trade"]}),n.invalidateQueries({queryKey:["shop-item"]}),a("owned-token",t==null?void 0:t.contractAddress,t==null?void 0:t.tokenId),a("public-token",t==null?void 0:t.contractAddress,t==null?void 0:t.tokenId),a("item-resales",t==null?void 0:t.contractAddress,t==null?void 0:t.itemId),n.invalidateQueries({queryKey:["shop-items"]}),n.invalidateQueries({queryKey:["catalog-items"]}),n.invalidateQueries({queryKey:["overview-listings"]}),n.invalidateQueries({queryKey:["upsell-listings"]}),n.invalidateQueries({queryKey:["my-assets"]}),n.invalidateQueries({queryKey:["purchases"]}),n.invalidateQueries({queryKey:["owned-item-count"]})}const ge=D`
|
|
113
|
+
to { transform: rotate(360deg); }
|
|
114
|
+
`,be=l.div`
|
|
115
|
+
position: fixed;
|
|
116
|
+
inset: 0;
|
|
117
|
+
z-index: 10000;
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
padding: 16px;
|
|
122
|
+
background: rgba(22, 21, 24, 0.55);
|
|
123
|
+
`,ye=l.div`
|
|
124
|
+
width: 480px;
|
|
125
|
+
max-width: 100%;
|
|
126
|
+
max-height: 92vh;
|
|
127
|
+
overflow-y: auto;
|
|
128
|
+
background: ${s.colors.white};
|
|
129
|
+
border-radius: 16px;
|
|
130
|
+
padding: 12px 16px 16px;
|
|
131
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
gap: 20px;
|
|
135
|
+
`,we=l.div`
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
gap: 8px;
|
|
140
|
+
padding-bottom: 16px;
|
|
141
|
+
border-bottom: 1px solid ${s.colors.gray4};
|
|
142
|
+
`,ve=l.h2`
|
|
143
|
+
margin: 0;
|
|
144
|
+
font-family: ${s.font.sans};
|
|
145
|
+
font-weight: 600;
|
|
146
|
+
font-size: 20px;
|
|
147
|
+
line-height: 1.6;
|
|
148
|
+
color: ${s.colors.text};
|
|
149
|
+
`,je=l.button`
|
|
150
|
+
flex: none;
|
|
151
|
+
display: grid;
|
|
152
|
+
place-items: center;
|
|
153
|
+
width: 24px;
|
|
154
|
+
height: 24px;
|
|
155
|
+
border: 0;
|
|
156
|
+
background: none;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
color: ${s.colors.text};
|
|
159
|
+
|
|
160
|
+
.ico {
|
|
161
|
+
width: 18px;
|
|
162
|
+
height: 18px;
|
|
163
|
+
}
|
|
164
|
+
&:disabled {
|
|
165
|
+
opacity: 0.4;
|
|
166
|
+
cursor: default;
|
|
167
|
+
}
|
|
168
|
+
&:focus-visible {
|
|
169
|
+
outline: 2px solid ${s.colors.accent};
|
|
170
|
+
outline-offset: 2px;
|
|
171
|
+
}
|
|
172
|
+
`,Ce=l.div`
|
|
173
|
+
display: grid;
|
|
174
|
+
grid-template-columns: 44px 1fr;
|
|
175
|
+
align-items: center;
|
|
176
|
+
gap: 14px;
|
|
177
|
+
padding: 14px 18px;
|
|
178
|
+
background: ${s.colors.white};
|
|
179
|
+
border: 1px solid ${s.colors.line};
|
|
180
|
+
border-radius: 16px;
|
|
181
|
+
`,ke=l.div`
|
|
182
|
+
width: 44px;
|
|
183
|
+
height: 44px;
|
|
184
|
+
border-radius: 10px;
|
|
185
|
+
background: ${s.colors.media};
|
|
186
|
+
overflow: hidden;
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
color: ${s.colors.muted2};
|
|
191
|
+
|
|
192
|
+
img {
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 100%;
|
|
195
|
+
object-fit: contain;
|
|
196
|
+
}
|
|
197
|
+
.ccy-mark {
|
|
198
|
+
width: 26px;
|
|
199
|
+
height: 26px;
|
|
200
|
+
}
|
|
201
|
+
`,Me=l.div`
|
|
202
|
+
min-width: 0;
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
gap: 4px;
|
|
206
|
+
`,$e=l.span`
|
|
207
|
+
font-weight: 700;
|
|
208
|
+
color: ${s.colors.text};
|
|
209
|
+
`,Ne=l.span`
|
|
210
|
+
font-size: 13px;
|
|
211
|
+
line-height: 1.45;
|
|
212
|
+
color: ${s.colors.muted};
|
|
213
|
+
`,Ae=l.p`
|
|
214
|
+
margin: 0;
|
|
215
|
+
font-size: 12px;
|
|
216
|
+
line-height: 1.5;
|
|
217
|
+
color: ${s.colors.muted2};
|
|
218
|
+
`,We=l.div`
|
|
219
|
+
display: flex;
|
|
220
|
+
gap: 12px;
|
|
221
|
+
|
|
222
|
+
${s.media.down("mobile")} {
|
|
223
|
+
flex-direction: column-reverse;
|
|
224
|
+
}
|
|
225
|
+
`,ze=l.button`
|
|
226
|
+
flex: 1 1 0;
|
|
227
|
+
height: 48px;
|
|
228
|
+
border: 2px solid ${s.colors.accent};
|
|
229
|
+
border-radius: 12px;
|
|
230
|
+
background: transparent;
|
|
231
|
+
color: ${s.colors.accent};
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
font-family: ${s.font.sans};
|
|
234
|
+
font-weight: 600;
|
|
235
|
+
font-size: 13px;
|
|
236
|
+
line-height: 24px;
|
|
237
|
+
letter-spacing: 0.46px;
|
|
238
|
+
text-transform: uppercase;
|
|
239
|
+
|
|
240
|
+
&:hover:not(:disabled) {
|
|
241
|
+
background: rgba(105, 31, 169, 0.06);
|
|
242
|
+
}
|
|
243
|
+
&:disabled {
|
|
244
|
+
cursor: default;
|
|
245
|
+
opacity: 0.5;
|
|
246
|
+
}
|
|
247
|
+
&:focus-visible {
|
|
248
|
+
outline: 2px solid ${s.colors.accent};
|
|
249
|
+
outline-offset: 2px;
|
|
250
|
+
}
|
|
251
|
+
`,_e=l.button`
|
|
252
|
+
flex: 1 1 0;
|
|
253
|
+
display: inline-flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
gap: 8px;
|
|
257
|
+
height: 48px;
|
|
258
|
+
border: 0;
|
|
259
|
+
border-radius: 12px;
|
|
260
|
+
background: ${s.colors.accent};
|
|
261
|
+
color: ${s.colors.softWhite};
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
font-family: ${s.font.sans};
|
|
264
|
+
font-weight: 600;
|
|
265
|
+
font-size: 13px;
|
|
266
|
+
line-height: 24px;
|
|
267
|
+
letter-spacing: 0.46px;
|
|
268
|
+
text-transform: uppercase;
|
|
269
|
+
|
|
270
|
+
&:hover:not(:disabled) {
|
|
271
|
+
background: ${s.colors.accentHover};
|
|
272
|
+
}
|
|
273
|
+
&:disabled {
|
|
274
|
+
cursor: default;
|
|
275
|
+
background: rgba(105, 31, 169, 0.4);
|
|
276
|
+
}
|
|
277
|
+
&:focus-visible {
|
|
278
|
+
outline: 2px solid ${s.colors.accent};
|
|
279
|
+
outline-offset: 2px;
|
|
280
|
+
}
|
|
281
|
+
`,Ie=l.span`
|
|
282
|
+
width: 16px;
|
|
283
|
+
height: 16px;
|
|
284
|
+
border-radius: 50%;
|
|
285
|
+
border: 2px solid rgba(255, 255, 255, 0.5);
|
|
286
|
+
border-top-color: ${s.colors.white};
|
|
287
|
+
animation: ${ge} 0.7s linear infinite;
|
|
288
|
+
|
|
289
|
+
@media (prefers-reduced-motion: reduce) {
|
|
290
|
+
animation: none;
|
|
291
|
+
}
|
|
292
|
+
`;function qe({auth:n,signer:t,title:a,reason:r,name:o,image:i,icon:d,onAuthorized:u,onCancel:b,onClose:m}){const[x,y]=w.useState(!1),[c,g]=w.useState(null);async function v(){y(!0),g(null);try{await H({auth:n,signer:t,active:!0}),u()}catch(h){Z(h)?g(f("authorizeStep.errorRejected")):(O(h,{flow:"authorize_step",kind:n.kind}),g(f("authorizeStep.errorGeneric"))),y(!1)}}return e.jsx(be,{onClick:x?void 0:m,role:"presentation",children:e.jsxs(ye,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":a,children:[e.jsxs(we,{children:[e.jsx(ve,{children:a}),e.jsx(je,{onClick:m,disabled:x,"aria-label":f("authorizeStep.close"),children:e.jsx(K,{name:"close",className:"ico"})})]}),e.jsxs(Ce,{"data-testid":"authorize-step-row",children:[e.jsx(ke,{children:i?e.jsx("img",{src:i,alt:""}):d}),e.jsxs(Me,{children:[e.jsx($e,{title:o,children:o}),e.jsx(Ne,{children:r})]})]}),e.jsx(Ae,{children:f("authorizeStep.note")}),e.jsx(q,{message:c}),e.jsxs(We,{children:[e.jsx(ze,{type:"button",onClick:b,disabled:x,children:f("authorizeStep.cancel")}),e.jsx(_e,{type:"button","data-testid":"authorize-step-action",onClick:()=>void v(),disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(Ie,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function Xe(n){const[t]=await Se({...n,trades:[n.trade]});return t}async function Se(n){const{trades:t,buyer:a,signer:r,onSigned:o}=n;if(t.length===0)throw new Error("No items to buy");const i=new Map;for(const u of t){const b=`${u.chainId}:${u.contract.toLowerCase()}`,m=i.get(b);m?m.push(u):i.set(b,[u])}const d=[];for(const u of i.values())d.push(await Ee({trades:u,buyer:a,signer:r,onSigned:o}));return d}async function Ee(n){const{trades:t,buyer:a,signer:r,onSigned:o}=n,i=t[0],d=$(U(i.contract),i.chainId),u=$(_.MANAToken,i.chainId);await T({auth:{kind:P.Allowance,contractAddress:u.address,spenderAddress:d.address,chainId:i.chainId},signer:r});const b=t.map(c=>ee(c,a));if(L.enabled)try{const c=new se(d.abi).encodeFunctionData("accept",[b]),g=J(),v=V(r.provider,g),h=await ne(v,g,c,d,{serverURL:L.relayerUrl});return o==null||o(),await g.waitForTransaction(h,1,12e4),h}catch(c){if(c instanceof ae&&c.code===re.USER_DENIED)throw c;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",c)}await Y(r.provider,i.chainId);const x=await new ie(d.address,d.abi,r).accept(b,te(i.chainId));return o==null||o(),(await x.wait()).transactionHash}async function et(n){const{trade:t,buyer:a,signer:r,credits:o,manaGapWei:i}=n;if(o.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(i<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const d=$(_.MANAToken,t.chainId),u=$(_.CreditsManager,t.chainId);await T({auth:{kind:P.Allowance,contractAddress:d.address,spenderAddress:u.address,chainId:t.chainId},signer:r});const m=(o.reduce((x,y)=>x+BigInt(y.availableAmount),0n)+i).toString();return X({trade:t,buyer:a,signer:r,credits:o,maxCreditedValue:m})}function tt({className:n}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:n,children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"#691fa9",strokeWidth:"1.8"}),e.jsx("path",{d:"M12 7v6",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"16.5",r:"1.1",fill:"#691fa9"})]})}function nt({title:n,items:t,onViewAll:a}){const r=w.useRef(null),[o,i]=w.useState(1),[d,u]=w.useState(0),[b,m]=w.useState(!0),[x,y]=w.useState(!1),c=w.useCallback(()=>{const h=r.current;if(!h)return;const{scrollLeft:p,scrollWidth:S,clientWidth:N}=h,E=Math.max(1,Math.ceil(S/N));i(E),u(Math.min(E-1,Math.round(p/N))),m(p<=1),y(p+N>=S-1)},[]);if(w.useEffect(()=>{c();const h=r.current;if(h)return h.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{h.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,t.length]),t.length===0)return null;function g(h){const p=r.current;p&&p.scrollBy({left:h*p.clientWidth,behavior:"smooth"})}function v(h){const p=r.current;p&&p.scrollTo({left:h*p.clientWidth,behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:n}),a?e.jsxs("button",{className:"collection-carousel__viewall",onClick:a,children:[f("collectionCarousel.viewAll"),e.jsx(K,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),e.jsxs("div",{className:"collection-carousel__viewport",children:[e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>g(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:b,children:e.jsx("img",{src:B,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:r,children:t.map(h=>e.jsx(G,{item:h},h.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>g(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:x,children:e.jsx("img",{src:B,alt:"","aria-hidden":!0})})]}),o>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":f("collectionCarousel.pages"),children:Array.from({length:o}).map((h,p)=>e.jsx("button",{className:`collection-carousel__dot${p===d?" is-active":""}`,"aria-label":f("collectionCarousel.goToPage",{page:p+1}),"aria-current":p===d?"true":void 0,onClick:()=>v(p)},p))}):null]})}export{qe as A,nt as C,Ye as P,tt as W,A as a,Se as b,Ge as c,He as d,le as e,k as f,Xe as g,Je as h,Ze as i,et as j,Ve as m,Oe as s,Ue as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./sentry-
|
|
1
|
+
import{p as t}from"./sentry-gZJVwIqQ.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as ee}from"./react-BW1xvPTF.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-BTV13rXH.js";import{p as N}from"./sentry-BV_ZSgtd.js";import{r as ne}from"./browser-ponyfill-CI1-rMvf.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|
|
1
|
+
import{g as ee}from"./react-B36MyIP_.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-Ded3SJr4.js";import{p as N}from"./sentry-gZJVwIqQ.js";import{r as ne}from"./browser-ponyfill-CMZ3i8tY.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|