@dcl/shop 0.1.0-29994103056.commit-191afbc → 0.1.0-29996672089.commit-ce4d282
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-ji9z26-b.js +243 -0
- package/assets/{AnimatedBackground-CwVmQoMy.js → AnimatedBackground-dlJZeXOs.js} +3 -3
- package/assets/Assets-DHtvK9gi.js +758 -0
- package/assets/{Assets.styles-BmY0qPN-.js → Assets.styles-DBA9HXW7.js} +1 -1
- package/assets/Authorizations-BNMCiOdB.js +163 -0
- package/assets/Cart-BlShrWP_.js +3 -0
- package/assets/{CircularProgress-BmaY3soK.js → CircularProgress-DvTkhDvC.js} +1 -1
- package/assets/{Collection-BlMV8rIO.js → Collection-DFIFsgYQ.js} +2 -2
- package/assets/CollectionCarousel-DMwkzkYf.js +1 -0
- package/assets/{ConstantsUtil-DO6FyoSW.js → ConstantsUtil-CJUlyS7R.js} +1 -1
- package/assets/{ContentClient-eS-Purid.js → ContentClient-DtuNqgIp.js} +1 -1
- package/assets/{Creator-CVsany2p.js → Creator-BzYX40qE.js} +1 -1
- package/assets/{CssVarsProvider-D03-j1T8.js → CssVarsProvider-D82yS8Ds.js} +1 -1
- package/assets/{DeploymentBuilder-mzKF7T6P.js → DeploymentBuilder-Bt5zjBVh.js} +1 -1
- package/assets/{ErrorNotice-BDH9xoG4.js → ErrorNotice-C7soUjRV.js} +1 -1
- package/assets/{ExchangeController-BKklF67w.js → ExchangeController-CiGVwKQf.js} +1 -1
- package/assets/{GetCredits-l0W_kkUA.js → GetCredits-eVhxGnMo.js} +1 -1
- package/assets/{HelpersUtil-1AJlaO39.js → HelpersUtil-C32FavmO.js} +1 -1
- package/assets/{ImportListings-CaC4hXkS.js → ImportListings-BiGwtdUn.js} +2 -2
- package/assets/ItemDetail-6dC_vNLF.css +1 -0
- package/assets/ItemDetail-DQOBDAhC.js +78 -0
- package/assets/{LoadMore-DCZi1YY-.js → LoadMore-BjvEi3Wj.js} +1 -1
- package/assets/MarketCheckout-BB0_ss_n.js +3 -0
- package/assets/{MyAssets-Gc_o5t9O.js → MyAssets-cbSiEx2B.js} +2 -2
- package/assets/{MyFavorites-CTtHG-tK.js → MyFavorites-DxWrJSpf.js} +2 -2
- package/assets/{NetworkUtil-BGlQiKvg.js → NetworkUtil-Xp0fNa8X.js} +1 -1
- package/assets/{NotFound-0kATSaSv.js → NotFound-Cj4SIl5T.js} +1 -1
- package/assets/{PrimaryListModal-QH5JEih2.js → PrimaryListModal-CdZJXblc.js} +1 -1
- package/assets/{StoreSettings-D97bWmhq.js → StoreSettings-LdrMcuVr.js} +5 -5
- package/assets/Success-BRT1MWds.js +4 -0
- package/assets/{SwapController-C8nP5wvc.js → SwapController-CXQ00xts.js} +1 -1
- package/assets/{Tooltip-BaUllE5E.js → Tooltip-BZ57TVaP.js} +1 -1
- package/assets/TradeService-SfkC7zHZ.js +1 -0
- package/assets/{W3MFrameProviderSingleton-B-iMukUt.js → W3MFrameProviderSingleton-B8RM0-JJ.js} +3 -3
- package/assets/{WebCryptoP256-BN2oUA6b.js → WebCryptoP256-D_33Dvnx.js} +1 -1
- package/assets/authorizations-D44lw00X.js +1 -0
- package/assets/{basic-BAZBRGQf.js → basic-CtFzqtOx.js} +1 -1
- package/assets/{biconomy-Bnx-4bDS.js → biconomy-BaeM1SCU.js} +1 -1
- package/assets/{browser-Cad_aDY9.js → browser-9oFjBwrz.js} +1 -1
- package/assets/{browser-ponyfill-CQ0GHmxr.js → browser-ponyfill-DMgE6PM5.js} +1 -1
- package/assets/browser-ponyfill-Djb5Py6a.js +1 -0
- package/assets/buy-Dszi8UeF.js +1 -0
- package/assets/buy-gasless-Nfp6cMbQ.js +1 -0
- package/assets/{cart-checkout-CUI-WqEI.js → cart-checkout-Ba3nMBI0.js} +1 -1
- package/assets/{categories-BGNx7jfw.js → categories-D0iwhqs_.js} +1 -1
- package/assets/{ccip-CPI8_6cL.js → ccip-CaKFUjmD.js} +1 -1
- package/assets/{ccip-s5BQ-vNw.js → ccip-DGnj8pvI.js} +1 -1
- package/assets/{chains-C1bwVnfj.js → chains-Bzau33xB.js} +1 -1
- package/assets/collection-DSysxaCY.js +1 -0
- package/assets/{common-yfho93wI.js → common-BaN-pXG4.js} +1 -1
- package/assets/{controller-CL9wipr5.js → controller-DqW_a2vQ.js} +2 -2
- package/assets/{core-gCo9rRyh.js → core-BfFj7IDN.js} +4 -4
- package/assets/{custom-BIAxnPyV.js → custom-CyKMgWLF.js} +1 -1
- package/assets/{data-capture-D_IuhqRX.js → data-capture-DyJzM655.js} +1 -1
- package/assets/{decimals-B36bI5dA.js → decimals-DaU_ek4_.js} +1 -1
- package/assets/decimals-HChuNAkm.js +1 -0
- package/assets/{detectExtension-CKplVZ9K.js → detectExtension-C2ped1rb.js} +1 -1
- package/assets/{email-BCklj9Js.js → email-B1LVTurO.js} +1 -1
- package/assets/{embedded-wallet-B6X4cZQC.js → embedded-wallet-DbH1O4GQ.js} +1 -1
- package/assets/{emotion-styled.browser.esm-D40Lt8fm.js → emotion-styled.browser.esm-CMXzhKww.js} +1 -1
- package/assets/{engine-skvS20px.js → engine-BNiIRF8k.js} +1 -1
- package/assets/{errors-DmdGTuzI.js → errors-DUo56sGG.js} +1 -1
- package/assets/estimate-l1-fee-DbEUBk2I.js +1 -0
- package/assets/eth_estimateGas-DcV1bi0C.js +1 -0
- package/assets/{eth_getStorageAt-C0E8Vng5.js → eth_getStorageAt-CvOhghFe.js} +1 -1
- package/assets/eth_getTransactionCount-BNyI69eR.js +1 -0
- package/assets/{ethereum-C5kfwN9D.js → ethereum-B_IIMsg0.js} +1 -1
- package/assets/{ethers-BIvjmL85.js → ethers-w5dOkonM.js} +1 -1
- package/assets/{execute-B_XUV-t5.js → execute-CzNqLgfO.js} +2 -2
- package/assets/{extractIPFS-CsawLTu6.js → extractIPFS-mhjpSq1K.js} +1 -1
- package/assets/{features-D1q967sn.js → features-D_R5E38-.js} +1 -1
- package/assets/{fetchTokenMetadata-Bgs6k1N5.js → fetchTokenMetadata-BZsN957Y.js} +2 -2
- package/assets/{fortmatic-DwISA9k4.js → fortmatic-DhmlcDbL.js} +1 -1
- package/assets/{get-bytecode-nwWHW248.js → get-bytecode-D38h1G96.js} +1 -1
- package/assets/get-ecosystem-wallet-info-BIlu2xkX.js +1 -0
- package/assets/{getBalance-D2FG5QKV.js → getBalance-BD5xADMR.js} +2 -2
- package/assets/{getInstalledModules-fBSGgSis.js → getInstalledModules-3Q5HYxkN.js} +1 -1
- package/assets/getNFT-B7e2uNF-.js +1 -0
- package/assets/{getNFT-BHzS5Cs2.js → getNFT-DjEJIHB0.js} +2 -2
- package/assets/{getOverlayAlpha-B90Fo_-m.js → getOverlayAlpha-Ho14PJoT.js} +1 -1
- package/assets/{hashTypedData-Cetq1UOK.js → hashTypedData-CC4Umz6j.js} +1 -1
- package/assets/{hashTypedData-DwlPS8MG.js → hashTypedData-DE2iuKMA.js} +1 -1
- package/assets/{import-DLMm_P8-.js → import-BPLVQmln.js} +1 -1
- package/assets/{in-app-CL2vGnrW.js → in-app-qD4m50Nn.js} +1 -1
- package/assets/{in-app-wallet-calls-CQYLsbwB.js → in-app-wallet-calls-BcFExuty.js} +1 -1
- package/assets/{index-DYAXJBpy.js → index--PWwvcNI.js} +1 -1
- package/assets/{index-Che81lrU.js → index-0syK5-Ww.js} +1 -1
- package/assets/{index-Chep4cKH.js → index-2Q-POj3l.js} +3 -3
- package/assets/{index-Ctbl3gOg.js → index-5RDpMwKv.js} +1 -1
- package/assets/{index-BptsdzIZ.js → index-Aw0QE_Br.js} +1 -1
- package/assets/{index-DcsKpVUb.js → index-B9U21JU-.js} +1 -1
- package/assets/{index-BrG8RI5z.js → index-B9n-6xCt.js} +1 -1
- package/assets/{index-DOyivP0c.js → index-BAKqn_lj.js} +2 -2
- package/assets/{index-D5zi_XmR.js → index-BBLW_jFO.js} +1 -1
- package/assets/{index-DAhYJ23_.js → index-BFydxC8W.js} +1 -1
- package/assets/{index-CMZ-l1j1.js → index-BGbFLGJH.js} +1 -1
- package/assets/{index-CwlKjFOG.js → index-BNa7Mf2M.js} +1 -1
- package/assets/{index-BEYHZcex.js → index-BW1vsFdc.js} +1 -1
- package/assets/{index-BBg2vZhG.js → index-B_AeYsKa.js} +1 -1
- package/assets/{index-CnFuk6fK.js → index-BfnFZQqu.js} +1 -1
- package/assets/{index-BXIq_1Tg.js → index-Bi7dtaTz.js} +1 -1
- package/assets/{index-Bn-EvtCB.js → index-Bk6ayCIs.js} +1 -1
- package/assets/{index-Dzy3N4vA.js → index-BnrQ0KXT.js} +1 -1
- package/assets/{index-Cx9CeoZH.js → index-Bt55wXtx.js} +1 -1
- package/assets/{index-BywohlL7.js → index-BuXSM1De.js} +1 -1
- package/assets/{index-B65D0iv0.js → index-ByOIX4VW.js} +1 -1
- package/assets/{index-CVPd9k0D.js → index-C4111GJ-.js} +2 -2
- package/assets/{index-DexIqMzn.js → index-C8P6BHpY.js} +3 -3
- package/assets/{index-D6Thjy9g.js → index-CA73t5p4.js} +1 -1
- package/assets/{index-Zev_LSPI.js → index-CDkTFenk.js} +2 -2
- package/assets/index-CGNquv7o.js +289 -0
- package/assets/{index-B-wT7-Au.js → index-CPvKfkxC.js} +1 -1
- package/assets/{index-C6-1JAkG.js → index-CXMHgbT-.js} +1 -1
- package/assets/{index-CrqgaFmq.js → index-Ck1Cgm82.js} +1 -1
- package/assets/{index-D2F7-1mk.js → index-Cl3G53Lb.js} +1 -1
- package/assets/{index-BGuUm-N-.js → index-CqYbCFw1.js} +1 -1
- package/assets/index-CrKaGnrK.css +1 -0
- package/assets/{index-C5t2d1JX.js → index-CrhtLjWe.js} +1 -1
- package/assets/{index-CHspULa1.js → index-CuA9C-j1.js} +1 -1
- package/assets/{index-BedvNbsM.js → index-CwFsoF5e.js} +1 -1
- package/assets/{index-DTJ6mS_J.js → index-CwKIaxXt.js} +1 -1
- package/assets/{index-B-3QmCY1.js → index-Cx9QgWtN.js} +1 -1
- package/assets/{index-C97CPhyL.js → index-D2bdndwX.js} +1 -1
- package/assets/{index-K0TqdX33.js → index-D7KDT9M9.js} +1 -1
- package/assets/{index-nTA1Tk1a.js → index-DD8leihn.js} +1 -1
- package/assets/{index-DjQcD_Sm.js → index-DGOaB47n.js} +1 -1
- package/assets/index-DH3Yzbz3.js +1 -0
- package/assets/{index-CSRkaTCL.js → index-DRB-gQiu.js} +1 -1
- package/assets/{index-ChbyDwUh.js → index-DUx_udvr.js} +1 -1
- package/assets/{index-DLJwIINa.js → index-DVl2fB76.js} +1 -1
- package/assets/{index-CyrfWYlv.js → index-DWj03ICg.js} +1 -1
- package/assets/{index-BZk7RUfM.js → index-D_jFC223.js} +1 -1
- package/assets/{index-C0wsNojR.js → index-D_xn82-1.js} +1 -1
- package/assets/{index-DnxELmkR.js → index-DcVvVcVQ.js} +1 -1
- package/assets/{index-C2te_xAY.js → index-Dg2IevmK.js} +2 -2
- package/assets/{index-CjBPO58E.js → index-Dp3Py-Ws.js} +1 -1
- package/assets/{index-d3ZKkcaA.js → index-Dv2SQ_eL.js} +1 -1
- package/assets/{index-o_m2wFAn.js → index-DxFC7t5T.js} +1 -1
- package/assets/{index-C2N-AU8j.js → index-Dzj-nA_x.js} +3 -3
- package/assets/index-HN6Rk25C.js +1 -0
- package/assets/{index-BkQHYnhC.js → index-I5rJvbQ1.js} +1 -1
- package/assets/{index-CWfnhYLp.js → index-OGdy2qbx.js} +1 -1
- package/assets/{index-CvIOskBU.js → index-QMzB_9kT.js} +1 -1
- package/assets/{index-B6gcmiqs.js → index-VUv3xRHQ.js} +1 -1
- package/assets/{index-DyhpH4px.js → index-grzzP9n9.js} +1 -1
- package/assets/{index-D3iIxnX6.js → index-hDcHuSsT.js} +1 -1
- package/assets/{index-D-i0A7WQ.js → index-hmML8Yn6.js} +2 -2
- package/assets/{index-0F8nhLaF.js → index-lVvjFIjk.js} +1 -1
- package/assets/{index-uK7qM9c7.js → index-w4_5Aj8T.js} +1 -1
- package/assets/{index-CW9ug21x.js → index-yRQsdAyS.js} +3 -3
- package/assets/{index-yr9vyS0z.js → index-z9bgkHOn.js} +1 -1
- package/assets/{index.es-DnNvUOrT.js → index.es-CMAy1XDw.js} +1 -1
- package/assets/{index.es-CZtQ8FVb.js → index.es-CMyspuf3.js} +4 -4
- package/assets/{index.es-DlHsAJbI.js → index.es-DLt1eklQ.js} +1 -1
- package/assets/{linkAccount-DKoZKguc.js → linkAccount-e50lqdUE.js} +1 -1
- package/assets/{localBatchGatewayRequest-DiUucTH0.js → localBatchGatewayRequest-Da4arsJr.js} +1 -1
- package/assets/mana-rate-BM11zYcS.js +1 -0
- package/assets/{native-t1vLKS11.js → native-BMBZUPnx.js} +1 -1
- package/assets/{networks-D5rFr4Uy.js → networks-CP5ZxOS7.js} +1 -1
- package/assets/{onramp-RD8o9zW8.js → onramp-DEaPwD93.js} +1 -1
- package/assets/{openzeppelin-GzHB2W1P.js → openzeppelin-ubglQWTS.js} +1 -1
- package/assets/{ownerOf-Cl_sRHvA.js → ownerOf-dLmWQ3QZ.js} +1 -1
- package/assets/{parseNft-CbgJiXpe.js → parseNft-nhS1PzrY.js} +2 -2
- package/assets/{parseSignature-DGB4v4W-.js → parseSignature-DIaDPyGA.js} +1 -1
- package/assets/{parseSignature-DZazOabU.js → parseSignature-DtIw2rXo.js} +3 -3
- package/assets/{passkeys-BDOXnD26.js → passkeys-l4VrwtfF.js} +1 -1
- package/assets/{pay-with-exchange-ChCNzNHg.js → pay-with-exchange-yIOka8rX.js} +1 -1
- package/assets/{prepare-contract-call-DmYPUPWz.js → prepare-contract-call-aT1l2NVg.js} +1 -1
- package/assets/{qr-overlay-BIPzfQds.js → qr-overlay-BC6wsExf.js} +3 -3
- package/assets/{react-BrLDncxD.js → react-C51i12iP.js} +1 -1
- package/assets/{receive-CsWO80gl.js → receive-DGr9WBJt.js} +1 -1
- package/assets/{resolveImplementation-CInkT_I9.js → resolveImplementation-CgWwbjqg.js} +1 -1
- package/assets/{rpc-DOR15RcJ.js → rpc-2WnfD84R.js} +1 -1
- package/assets/{secp256k1-DUaLgTGJ.js → secp256k1-BzEjkNEy.js} +1 -1
- package/assets/{secp256k1-C8pkcGJ3.js → secp256k1-C2nawWfp.js} +1 -1
- package/assets/{secp256k1-N7sx_maT.js → secp256k1-C3Ly2cZR.js} +1 -1
- package/assets/{send-BEnX8iHn.js → send-DaMmaBKd.js} +1 -1
- package/assets/{send-batch-transaction-Cl-WR4dD.js → send-batch-transaction-BJnHeeX4.js} +1 -1
- package/assets/{send-eip712-transaction-BnpCutKi.js → send-eip712-transaction-lGbfEAzA.js} +2 -2
- package/assets/send-gasless-transaction-GytT3EN0.js +2 -0
- package/assets/{send-transaction-BcThrsCr.js → send-transaction-wju-H3Cn.js} +2 -2
- package/assets/sendMetaTransaction-CiO3jI6F.js +1 -0
- package/assets/{sendRawTransaction-BJLeMhAd.js → sendRawTransaction-B7gRnaFv.js} +3 -3
- package/assets/{sentry-DYZXk5O5.js → sentry-DKBoGDXH.js} +1 -1
- package/assets/{serializeTransaction-BMgHZkKp.js → serializeTransaction-K8-WLWnl.js} +1 -1
- package/assets/{session-proposal-Ds2RY-CA.js → session-proposal-eLNEKDfD.js} +1 -1
- package/assets/{session-request-CLTybC5q.js → session-request-D0qpm2ew.js} +2 -2
- package/assets/{sha256-DM_yyL1v.js → sha256-BcAs0Y4r.js} +1 -1
- package/assets/{signing-Dr9d33yf.js → signing-gBX9gJ32.js} +3 -3
- package/assets/{socials-CaYP6kJa.js → socials-CD_j_07F.js} +1 -1
- package/assets/{swaps-BHrutsbS.js → swaps-Bzm1G8N4.js} +1 -1
- package/assets/{thirdweb-DIAnaqbp.js → thirdweb-DCMx7j1D.js} +3 -3
- package/assets/{to-serializable-transaction-DqNZm-Zy.js → to-serializable-transaction-BZAI7BsG.js} +2 -2
- package/assets/{totalSupply-DKYveUeg.js → totalSupply-BCBM6uY2.js} +1 -1
- package/assets/trade-encoding-2LKm-Goy.js +1 -0
- package/assets/{transaction-HL8b44XJ.js → transaction-Db6pntE5.js} +1 -1
- package/assets/{transactionReceipt-iA2axmC8.js → transactionReceipt-CRyPQK5a.js} +1 -1
- package/assets/{transactions-DAq9dNVo.js → transactions-I7lCf2CM.js} +1 -1
- package/assets/useCreditPacks-DYrmYjK5.js +1 -0
- package/assets/{useInfiniteGrid-Dh1-HUF4.js → useInfiniteGrid-CDzsfZBu.js} +1 -1
- package/assets/useManaRate-BEdT5IGm.js +1 -0
- package/assets/{useStore-DBh7zwbY.js → useStore-D1gCXOP_.js} +2 -2
- package/assets/{useTheme-ddXkiCRZ.js → useTheme-CUwz5NUH.js} +1 -1
- package/assets/useTheme-hvTZJoGa.js +1 -0
- package/assets/{utils-5mrprTVL.js → utils-DBnU1jhd.js} +1 -1
- package/assets/{verifyHash-C62BfpA_.js → verifyHash-DGsbtWAk.js} +1 -1
- package/assets/{w3m-modal-Bxbo8T_Z.js → w3m-modal-C4axQEqk.js} +1 -1
- package/assets/{w3m-modal-BT8yrl74.js → w3m-modal-DJ_LdfUD.js} +1 -1
- package/assets/{wait-for-tx-receipt-D_og-NhE.js → wait-for-tx-receipt-JPXzoKCu.js} +1 -1
- package/assets/{wallets-B72ZtlfA.js → wallets-CkR7yrP_.js} +5 -5
- package/assets/{web-connector-DBmok4eN.js → web-connector-HjRYE3VT.js} +3 -3
- package/assets/{writeContract-CLiFKioV.js → writeContract-DSPOgOMV.js} +1 -1
- package/assets/{zora-sepolia-Bef01XwU.js → zora-sepolia-Bwjy_6bk.js} +1 -1
- package/assets/{zoraTestnet-Bfnpd26p.js → zoraTestnet-2TguyOvD.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Assets-DqZw3BZv.js +0 -758
- package/assets/Authorizations-BxmoVEl_.js +0 -163
- package/assets/Cart-DA1J5Be_.js +0 -3
- package/assets/CollectionCarousel-B2cDWt_o.js +0 -1
- package/assets/ItemDetail-BiAHzfHh.css +0 -1
- package/assets/ItemDetail-DHaOvIrD.js +0 -78
- package/assets/MarketCheckout-BrvEzX8j.js +0 -3
- package/assets/MyPurchases-DLOdIHUA.js +0 -200
- package/assets/Success-DRMy6BRe.js +0 -4
- package/assets/TradeService-ZNznSjPX.js +0 -1
- package/assets/authorizations-QONJAQC4.js +0 -1
- package/assets/browser-ponyfill-vZOvKb_B.js +0 -1
- package/assets/buy-CE5I6jg2.js +0 -1
- package/assets/buy-gasless-DPcBjPtZ.js +0 -1
- package/assets/collection-Bm8Org8q.js +0 -1
- package/assets/decimals-BPDUTKfa.js +0 -1
- package/assets/estimate-l1-fee-J0AI4VGA.js +0 -1
- package/assets/eth_estimateGas-BeErQaun.js +0 -1
- package/assets/eth_getTransactionCount-kFIWL36y.js +0 -1
- package/assets/get-ecosystem-wallet-info-BRMexyn8.js +0 -1
- package/assets/getNFT-DrLPmHpk.js +0 -1
- package/assets/index-Bw9Y53F1.css +0 -1
- package/assets/index-CD_HpB6P.js +0 -1
- package/assets/index-DaOu_NHP.js +0 -289
- package/assets/mana-rate-BX_VjspN.js +0 -1
- package/assets/send-gasless-transaction-CGxm_r0E.js +0 -2
- package/assets/sendMetaTransaction-iOoE_Tw3.js +0 -1
- package/assets/trade-encoding-DqhxC9n7.js +0 -1
- package/assets/useCreditPacks-CV1PhThV.js +0 -1
- package/assets/useTheme--bd6Ub02.js +0 -1
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as N,F as e,N as q,u as B,t as i,d as D,e as F,I as x,g as G,m as A,o as H,c as Q,J as y,E as K,H as z}from"./index-DaOu_NHP.js";import{b as M,c as W,s as J,d as O}from"./authorizations-QONJAQC4.js";import{f as P}from"./errors-DmdGTuzI.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-BIvjmL85.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-iOoE_Tw3.js";const X=q`
|
|
2
|
-
to { transform: rotate(360deg); }
|
|
3
|
-
`,U=a.section`
|
|
4
|
-
width: 100%;
|
|
5
|
-
min-width: 0;
|
|
6
|
-
max-width: 760px;
|
|
7
|
-
`,V=a.div`
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
gap: 6px;
|
|
11
|
-
margin-bottom: 24px;
|
|
12
|
-
`,Y=a.h1`
|
|
13
|
-
font-family: ${e.font.sans};
|
|
14
|
-
margin: 0;
|
|
15
|
-
`,Z=a.p`
|
|
16
|
-
color: ${e.colors.muted};
|
|
17
|
-
font-size: 14px;
|
|
18
|
-
margin: 0;
|
|
19
|
-
max-width: 60ch;
|
|
20
|
-
`,j=a.div`
|
|
21
|
-
margin-bottom: 28px;
|
|
22
|
-
`,w=a.h2`
|
|
23
|
-
font-family: ${e.font.sans};
|
|
24
|
-
font-size: 15px;
|
|
25
|
-
font-weight: 700;
|
|
26
|
-
color: ${e.colors.text};
|
|
27
|
-
margin: 0 0 10px;
|
|
28
|
-
`,b=a.div`
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
gap: 12px;
|
|
32
|
-
`,_=a.div`
|
|
33
|
-
display: grid;
|
|
34
|
-
grid-template-columns: 44px 1fr auto;
|
|
35
|
-
align-items: center;
|
|
36
|
-
gap: 14px;
|
|
37
|
-
padding: 14px 18px;
|
|
38
|
-
background: ${e.colors.white};
|
|
39
|
-
border: 1px solid ${e.colors.line};
|
|
40
|
-
border-radius: 16px;
|
|
41
|
-
|
|
42
|
-
${e.media.down("mobile")} {
|
|
43
|
-
grid-template-columns: 44px 1fr;
|
|
44
|
-
grid-row-gap: 10px;
|
|
45
|
-
}
|
|
46
|
-
`,tt=a.div`
|
|
47
|
-
width: 44px;
|
|
48
|
-
height: 44px;
|
|
49
|
-
border-radius: 10px;
|
|
50
|
-
background: ${e.colors.media};
|
|
51
|
-
overflow: hidden;
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
color: ${e.colors.muted2};
|
|
56
|
-
|
|
57
|
-
img {
|
|
58
|
-
width: 100%;
|
|
59
|
-
height: 100%;
|
|
60
|
-
object-fit: contain;
|
|
61
|
-
}
|
|
62
|
-
`,it=a.div`
|
|
63
|
-
min-width: 0;
|
|
64
|
-
display: flex;
|
|
65
|
-
flex-direction: column;
|
|
66
|
-
gap: 3px;
|
|
67
|
-
`,ot=a.span`
|
|
68
|
-
font-weight: 700;
|
|
69
|
-
color: ${e.colors.text};
|
|
70
|
-
white-space: nowrap;
|
|
71
|
-
overflow: hidden;
|
|
72
|
-
text-overflow: ellipsis;
|
|
73
|
-
`,et=a.span`
|
|
74
|
-
font-size: 13px;
|
|
75
|
-
color: ${e.colors.muted};
|
|
76
|
-
`,at=a.span`
|
|
77
|
-
font-size: 12px;
|
|
78
|
-
font-weight: 700;
|
|
79
|
-
color: ${e.colors.muted2};
|
|
80
|
-
|
|
81
|
-
&[data-active='true'] {
|
|
82
|
-
color: ${e.colors.okStrong};
|
|
83
|
-
}
|
|
84
|
-
`,st=a.div`
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: 10px;
|
|
88
|
-
justify-self: end;
|
|
89
|
-
|
|
90
|
-
${e.media.down("mobile")} {
|
|
91
|
-
grid-column: 1 / -1;
|
|
92
|
-
justify-self: start;
|
|
93
|
-
}
|
|
94
|
-
`,nt=a.button`
|
|
95
|
-
position: relative;
|
|
96
|
-
width: 46px;
|
|
97
|
-
height: 26px;
|
|
98
|
-
flex: 0 0 auto;
|
|
99
|
-
border-radius: ${e.radius.pill};
|
|
100
|
-
border: none;
|
|
101
|
-
background: ${e.colors.gray4};
|
|
102
|
-
cursor: pointer;
|
|
103
|
-
transition: background 0.15s;
|
|
104
|
-
padding: 0;
|
|
105
|
-
|
|
106
|
-
&::after {
|
|
107
|
-
content: '';
|
|
108
|
-
position: absolute;
|
|
109
|
-
top: 3px;
|
|
110
|
-
left: 3px;
|
|
111
|
-
width: 20px;
|
|
112
|
-
height: 20px;
|
|
113
|
-
border-radius: 50%;
|
|
114
|
-
background: ${e.colors.white};
|
|
115
|
-
transition: transform 0.15s;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&[data-active='true'] {
|
|
119
|
-
background: ${e.colors.accent};
|
|
120
|
-
}
|
|
121
|
-
&[data-active='true']::after {
|
|
122
|
-
transform: translateX(20px);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:disabled {
|
|
126
|
-
cursor: default;
|
|
127
|
-
opacity: 0.6;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
&:focus-visible {
|
|
131
|
-
outline: 2px solid ${e.colors.accent};
|
|
132
|
-
outline-offset: 2px;
|
|
133
|
-
}
|
|
134
|
-
`,rt=a.span`
|
|
135
|
-
width: 16px;
|
|
136
|
-
height: 16px;
|
|
137
|
-
border-radius: 50%;
|
|
138
|
-
border: 2px solid ${e.colors.gray4};
|
|
139
|
-
border-top-color: ${e.colors.accent};
|
|
140
|
-
animation: ${X} 0.7s linear infinite;
|
|
141
|
-
|
|
142
|
-
@media (prefers-reduced-motion: reduce) {
|
|
143
|
-
animation: none;
|
|
144
|
-
}
|
|
145
|
-
`,v=a.p`
|
|
146
|
-
color: ${e.colors.muted};
|
|
147
|
-
font-size: 14px;
|
|
148
|
-
margin: 0;
|
|
149
|
-
`,$=a.div`
|
|
150
|
-
display: flex;
|
|
151
|
-
flex-direction: column;
|
|
152
|
-
align-items: center;
|
|
153
|
-
gap: 8px;
|
|
154
|
-
text-align: center;
|
|
155
|
-
padding: 90px 20px;
|
|
156
|
-
min-height: 50vh;
|
|
157
|
-
`,k=a.p`
|
|
158
|
-
font-size: 22px;
|
|
159
|
-
font-weight: 700;
|
|
160
|
-
margin: 6px 0 0;
|
|
161
|
-
`,ct=a(N)`
|
|
162
|
-
margin-top: 12px;
|
|
163
|
-
`;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=L.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){K(f,{flow:"authorizations",step:h?"grant":"revoke"}),y.error(P(f,i("authorizations.errorGeneric")))}finally{g(!1)}}const S=p?i("authorizations.checking"):c?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(_,{"data-testid":`authorization-${o.id}`,"data-active":!!c,children:[t.jsx(tt,{children:r?t.jsx("img",{src:r,alt:""}):u}),t.jsxs(it,{children:[t.jsx(ot,{title:s,children:s}),t.jsx(et,{children:d})]}),t.jsxs(st,{children:[t.jsx(at,{"data-active":!!c,children:S}),m?t.jsx(rt,{"aria-label":i("authorizations.working")}):t.jsx(nt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?i("authorizations.deactivateAria",{name:s}):i("authorizations.activateAria",{name:s}),disabled:p,onClick:()=>void I()})]})]})}function lt(o){return A({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[n,l]=await Promise.all([z(o,{category:"wearable",first:96}),z(o,{category:"emote",first:96})]),s=new Map;for(const d of[...n.assets,...l.assets]){const r=d.contractAddress.toLowerCase();s.has(r)||s.set(r,d)}return[...s.values()]}})}function zt(){B({title:i("authorizations.title"),noindex:!0});const{session:o}=D(),n=Q.chainId,l=F(o==null?void 0:o.providerType),{data:s,isLoading:d}=lt(l?o==null?void 0:o.address:void 0);if(!o)return t.jsxs($,{children:[t.jsx(x,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(k,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")})]});if(!l)return t.jsxs($,{children:[t.jsx(x,{name:"check",size:40,color:"var(--ok)"}),t.jsx(k,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(ct,{as:R,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const r=M(n);return t.jsxs(U,{children:[t.jsxs(V,{children:[t.jsx(Y,{children:i("authorizations.title")}),t.jsx(Z,{children:i("authorizations.intro")})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.buyingTitle")}),t.jsx(b,{children:t.jsx(C,{descriptor:r,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.sellingTitle")}),d?t.jsx(v,{children:i("authorizations.checking")}):s&&s.length>0?t.jsx(b,{children:s.map(u=>t.jsx(C,{descriptor:W(u.contractAddress,n),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(x,{name:"pen",size:18})},u.contractAddress))}):t.jsx(v,{children:i("authorizations.sellingEmpty")})]})]})}export{zt as Authorizations};
|
package/assets/Cart-DA1J5Be_.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e,r as y,a as qe,u as Ie,L as se}from"./react-BrLDncxD.js";import{t as a,g as R,j as J,u as Te,af as v,a as ue,d as Fe,m as Re,n as Ae,o as Be,I as F,h as Le,e as Ue,x as D,ah as he,ai as We,E as U,s as ze,B as $e,C as Ke,w as Qe,q as me,aj as Oe,z as _e,y as Ge,ak as De}from"./index-DaOu_NHP.js";import{a as ye}from"./buy-CE5I6jg2.js";import{a as He,w as Je,S as Ve,G as Ye}from"./buy-gasless-DPcBjPtZ.js";import{R as H,r as Xe}from"./cart-checkout-CUI-WqEI.js";import{a as Ze}from"./authorizations-QONJAQC4.js";import{u as es,M as ss,c as as}from"./useCreditPacks-CV1PhThV.js";import{W as ts,C as rs,a as cs}from"./CollectionCarousel-B2cDWt_o.js";import{l as ns}from"./loader-logo-BzY9EKdC.js";import{i as os,a as is}from"./errors-DmdGTuzI.js";import{E as ls}from"./ErrorNotice-BDH9xoG4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-BIvjmL85.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DqhxC9n7.js";import"./sendMetaTransaction-iOoE_Tw3.js";import"./address-DrURAr9O.js";const ds="https://cdn.decentraland.org/@dcl/shop/0.1.0-29994103056.commit-191afbc/assets/buy-error-22UunaPC.png";function us(r){const{phase:n,balanceCredits:u,onClose:h}=r,C=n==="processing",w=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),S=n==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?void 0:h,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${S?" 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:w}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:h,"aria-label":a("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:n==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(R,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:J(u)})]})]}),n==="processing"&&e.jsx(hs,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(ms,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:h}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:ds,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:h,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??h,children:a("cartCheckout.tryAgain")})]})]})]})]})}function hs({stage:r,step:n,total:u,isSelfCustody:h}){const C=r==="reserving",w=u>0?Math.min(100,Math.round(n/u*100)):0,S=r==="awaiting-signature"?h?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:ns,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:S}),C?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:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ms({lines:r,shortfallCredits:n,packs:u,selectedPack:h,onSelectPack:C,onBuyPacks:w,onCancel:S}){const N=u.find(t=>t.id===h),V=r.reduce((t,m)=>t+(m.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(ts,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,n)})})," ",a("buyModal.warningToPurchase",{count:V})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const m=t.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:t.item.thumbnail?e.jsx("img",{src:t.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:t.item.name,children:[t.item.name||a("buyModal.itemFallback"),m>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:m})}):null]}),t.item.creator?e.jsx(rs,{address:t.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(R,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:J(t.priceCredits*m)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(t=>{const m=t.id===h;return e.jsxs("button",{className:`buy-modal__pack${m?" buy-modal__pack--on":""}`,onClick:()=>C(t.id),children:[e.jsx(R,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:J(t.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",t.usd.toFixed(2),")"]})]},t.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(R,{className:"buy-modal__total-ico"}),e.jsx("span",{children:J((N==null?void 0:N.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((N==null?void 0:N.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:S,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}const _s=ze($e)`
|
|
2
|
-
margin-top: 12px;
|
|
3
|
-
`;function pe(r){if(os(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:Ke.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ys=12e4;function ps(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const be=r=>r.reduce((n,u)=>n+u.priceCredits*u.quantity,0),bs=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function As(){Te({title:a("nav.cart"),noindex:!0});const r=v(s=>s.items),n=v(s=>s.remove),u=v(s=>s.increment),h=v(s=>s.decrement),C=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),N=ue(s=>s.items),V=ue(s=>s.toggle),{session:t}=Fe(),m=es().packs.slice(0,ss);y.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ge=r.some(s=>s.category!=="emote"),{data:Y}=Re({queryKey:["upsell-listings"],queryFn:()=>De({first:40}),staleTime:6e4}),{data:A}=Ae(t),W=Be(),z=qe(),{state:M}=Ie(),[ae,B]=y.useState(null),[fe,E]=y.useState(null),[te,$]=y.useState(null),[xe,P]=y.useState(!1),[f,L]=y.useState(null),re=y.useRef(0),[l,j]=y.useState(null),[X,ce]=y.useState(""),Z=y.useRef(null),je=r.reduce((s,c)=>s+c.priceCredits*c.quantity,0),ne=r.reduce((s,c)=>s+c.quantity,0),ke=f?f.liveTotalCredits:je,ve=new Set(r.map(s=>s.id)),oe=((Y==null?void 0:Y.items)??[]).filter(s=>!ve.has(s.id)).slice(0,12),Ce=new Map(f==null?void 0:f.buyable.map(s=>[s.item.id,s])),K=(A==null?void 0:A.credits)??0,Ne=We;function Q(s){s(),L(null),$(null),E(null)}function we(){j(null),P(!1)}function ie(s){const c=be(s),o=Math.max(0,c-K),p=m.find(d=>d.credits>=o)??m[m.length-1];ce(p.id),D("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:K,shortfall:o}),j({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:o}),P(!1)}async function Se(s){if(!t||s.length===0)return;const c=bs(s),o=c.map(i=>({...i.item,priceCredits:i.priceCredits})),p=s.map(i=>({...i.item,priceCredits:i.priceCredits,quantity:i.quantity})),d=[];let k="authorize",G=!1;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const i=[];for(let x=0;x<c.length;x++){const T=c[x];j({phase:"processing",stage:"reserving",step:x+1,total:c.length});try{const{credit:_,maxCreditedValue:ee}=await Qe(t.identity,T.usdCents,T.trade.id);d.push(_.id),i.push({trade:T.trade,credits:[_],maxCreditedValue:ee})}catch(_){if(is(_)){if(d.length){try{await me(t.identity,d)}catch(ee){U(ee,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}ie(s);return}throw _}}k="submit";const b=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let g=[];if(Ze())try{g=await He({purchases:i,buyer:t.address,signer:t.signer,onSigned:b});const T=(await Promise.allSettled(g.map(_=>Je(_)))).flatMap(_=>_.status==="rejected"?[_.reason]:[]);if(T.length&&!T.some(_=>_ instanceof Ve))throw T[0];G=!0}catch(x){if(!(x instanceof Ye))throw x;g=await ye({purchases:i,buyer:t.address,signer:t.signer,onSigned:b})}else g=await ye({purchases:i,buyer:t.address,signer:t.signer});s.forEach(x=>n(x.item.id)),L(null),D("Shop Completed Purchase",{...Oe(o),payment_type:"credits",no_crypto_step:G,transaction_hash:g[0]??null}),W.invalidateQueries({queryKey:["usd-balance"]});const I=Z.current;Z.current=null,j(null),P(!1);const Pe={items:p,txHash:g[0]??void 0,settled:!0,...I?{creditsAdded:I}:{}};z("/success",{state:Pe,replace:!0})}catch(i){if(_e(i)||U(i,{flow:"cart_checkout",step:k,cart_size:s.length}),D(_e(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:k,error_code:Ge(i),value_usd:he(o.reduce((b,g)=>b+g.priceCredits,0)),cart_size:c.length}),d.length){try{await me(t.identity,d)}catch(b){U(b,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}j({phase:"error",message:pe(i)})}}function le(s){const c=be(s);if(A!=null&&A.credits<c){ie(s);return}Se(s)}async function O(){if(!t){E(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length===0)return;E(null),$(null),P(!0);const c=s.reduce((o,p)=>o+p.priceCredits*p.quantity,0);D("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:he(c),has_sufficient_credits:K>=c});try{B(a("cart.status.reviewing"));const o=await Xe(s,t.address,Ne),p=[...o.unavailable,...o.own];if(p.length&&(p.forEach(d=>n(d.id)),$(ps(o))),o.buyable.length===0){E(a("cart.error.noneAvailable")),L(null),B(null);return}if(o.orderChanged){L(o),re.current=Date.now(),B(null);return}B(null),le(o.buyable)}catch(o){U(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),E(pe(o)),B(null)}finally{P(!1)}}async function Me(){if(f){if(!t){E(a("buyModal.signInToCheckout"));return}if(Date.now()-re.current>ys){L(null),$(null),await O();return}E(null),le(f.buyable)}}async function Ee(){if(X){try{sessionStorage.setItem(H,JSON.stringify(v.getState().items))}catch{}P(!0);try{const s=await as(X,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(H)}catch{}U(s,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const de=y.useRef(!1);y.useEffect(()=>{if(!(M!=null&&M.resumeCheckout)||de.current)return;de.current=!0,Z.current=M.creditsAdded??null;try{const c=sessionStorage.getItem(H);if(c){sessionStorage.removeItem(H);const o=JSON.parse(c);Array.isArray(o)&&o.length&&w(o)}}catch{}W.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[M==null?void 0:M.resumeCheckout]);const q=xe||(l==null?void 0:l.phase)==="processing";return r.length===0&&!l?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(F,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(_s,{as:se,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(F,{name:"arrow-left"}),a("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:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(F,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ne})}),ge?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:q,children:[e.jsx(F,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=Ce.get(s.id),o=c?c.priceCredits:s.priceCredits,p=!!c&&c.priceCredits!==s.priceCredits,d=!s.tokenId,k=s.quantity,G=typeof s.available=="number"&&k>=s.available,i=o*k,b=!!N[s.id],g=s.tokenId??s.itemId,I=s.contractAddress&&g?`/item/${s.contractAddress}/${g}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[I?e.jsx(se,{className:"checkout__thumb-link",to:I,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.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:[I?e.jsx(se,{className:"checkout__name",to:I,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Le,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[d?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>h(s.id)),disabled:q||k<=1,"aria-label":a("cart.decreaseQuantity",{name:s.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:k}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>u(s.id)),disabled:q||G,"aria-label":a("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(R,{className:"checkout__price-ico"})," ",i,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*k}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${b?" is-on":""}`,onClick:()=>V(s),"aria-label":b?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:b?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(F,{name:b?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>n(s.id)),disabled:q,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(F,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>Q(C),disabled:q,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("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:a("cart.totalItems",{count:ne})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(R,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(f?Me():O()),disabled:q,children:q?a("cart.working"):f?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),f?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,te?e.jsx("p",{className:"muted checkout__msg",children:te}):null,ae?e.jsx("p",{className:"muted checkout__msg",children:ae}):null,e.jsx(ls,{message:fe,className:"checkout__msg"})]})]})]})]}),oe.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:oe})}):null,l?e.jsx(us,{phase:l.phase,balanceCredits:K,onClose:we,stage:l.phase==="processing"?l.stage:void 0,step:l.phase==="processing"?l.step:void 0,total:l.phase==="processing"?l.total:void 0,isSelfCustody:Ue(t==null?void 0:t.providerType),lines:l.phase==="nofunds"?l.lines:void 0,shortfallCredits:l.phase==="nofunds"?l.shortfall:void 0,packs:m,selectedPack:X,onSelectPack:ce,onBuyPacks:()=>void Ee(),message:l.phase==="error"?l.message:void 0,onRetry:()=>void O()}):null]})}export{As as Cart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as o}from"./react-BrLDncxD.js";import{al as b,G as N,t as n,I as E,am as _,A as W}from"./index-DaOu_NHP.js";import{s as A}from"./address-DrURAr9O.js";function M({address:c,className:i}){const{data:l}=b(c),s=l!=null&&l.name?N(l.name):A(c);return e.jsx("div",{className:i,children:n("search.byCreator",{name:s})})}function P({className:c}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:c,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 z({title:c,items:i,onViewAll:l}){const s=o.useRef(null),[d,v]=o.useState(1),[h,j]=o.useState(0),[g,p]=o.useState(!0),[k,C]=o.useState(!1),a=o.useCallback(()=>{const r=s.current;if(!r)return;const{scrollLeft:t,scrollWidth:f,clientWidth:u}=r,x=Math.max(1,Math.ceil(f/u));v(x),j(Math.min(x-1,Math.round(t/u))),p(t<=1),C(t+u>=f-1)},[]);if(o.useEffect(()=>{a();const r=s.current;if(r)return r.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a),()=>{r.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,i.length]),i.length===0)return null;function m(r){const t=s.current;t&&t.scrollBy({left:r*t.clientWidth,behavior:"smooth"})}function w(r){const t=s.current;t&&t.scrollTo({left:r*t.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:c}),l?e.jsxs("button",{className:"collection-carousel__viewall",onClick:l,children:[n("collectionCarousel.viewAll"),e.jsx(E,{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:()=>m(-1),"aria-label":n("collectionCarousel.scrollLeft"),disabled:g,children:e.jsx("img",{src:_,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:s,children:i.map(r=>e.jsx(W,{item:r},r.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>m(1),"aria-label":n("collectionCarousel.scrollRight"),disabled:k,children:e.jsx("img",{src:_,alt:"","aria-hidden":!0})})]}),d>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":n("collectionCarousel.pages"),children:Array.from({length:d}).map((r,t)=>e.jsx("button",{className:`collection-carousel__dot${t===h?" is-active":""}`,"aria-label":n("collectionCarousel.goToPage",{page:t+1}),"aria-current":t===h?"true":void 0,onClick:()=>w(t)},t))}):null]})}export{M as C,P as W,z as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.notify{display:flex;flex-direction:column;gap:8px;width:100%}.notify__label{font-size:14px;color:var(--text)}.notify__row{display:flex;align-items:stretch;gap:8px}.notify__input{flex:1;min-width:0;height:42px;padding:0 16px;border:1px solid var(--muted);border-radius:8px;background:#fff;font-size:16px;color:var(--text)}.notify__input::placeholder{color:var(--muted-2)}.notify__input:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.notify__btn{flex-shrink:0;height:42px;padding:0 16px;border:0;border-radius:8px;background:var(--accent);color:var(--soft-white);font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:opacity .15s ease}.notify__btn:hover:not(:disabled){opacity:.9}.notify__btn:disabled{opacity:.5;cursor:default}.notify__signin{width:100%;height:42px;padding:0 16px;border:0;border-radius:8px;background:var(--accent);color:var(--soft-white);font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:opacity .15s ease}.notify__signin:hover{opacity:.9}.notify__done{flex-direction:row;align-items:center;gap:16px;padding:12px;border-radius:16px;background:#c1eecf80}.notify__done-check{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;border-radius:50%;background:#34ce76;color:#fff}.notify__done-text{font-size:16px;line-height:1.5;color:var(--text-2)}.item-detail{max-width:1721px;margin:0 auto}.item-detail__crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:24px}.item-detail__crumb-link{background:none;border:0;padding:0;font:inherit;color:var(--muted)}.item-detail__crumb-link:hover{color:var(--text)}.item-detail__crumb-sep{color:var(--muted-2)}.item-detail__crumb-current{color:var(--text);font-weight:600}.item-detail__main{display:grid;grid-template-columns:minmax(0,1045fr) minmax(0,514fr);gap:48px;align-items:start;max-width:1607px;margin:0 auto}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr;gap:24px;max-width:none}}.item-detail__preview{position:relative;aspect-ratio:1045 / 752;border-radius:16px;overflow:hidden;background:var(--media)}@media(max-width:900px){.item-detail__preview{aspect-ratio:1 / 1}}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:16px;left:16px;z-index:2;width:auto;height:auto;display:inline-flex;gap:2px;padding:3px;background:#ffffffeb;border:1px solid var(--line);border-radius:999px;box-shadow:0 1px 4px #0000001f}.item-preview__toggle button{border:0;background:none;cursor:pointer;padding:6px 16px;border-radius:999px;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);transition:background .12s ease,color .12s ease}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:not(.is-active):hover{color:var(--text)}.item-preview__toggle-ico{display:none;width:18px;height:18px}.item-detail__preview>.item-preview__emote-controls{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:2;width:min(360px,88%);height:auto;display:flex;align-items:center;background:#fffffff0;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);border:1px solid var(--line);border-radius:var(--radius-pill);padding:6px 12px;box-shadow:0 2px 10px #1615181f}.item-preview__emote-controls .MuiBox-root{position:static;width:100%;margin:0;padding:0;display:flex;align-items:center;gap:10px}.item-preview__emote-controls .MuiButtonBase-root{min-width:0;padding:0;margin:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:none!important;box-shadow:none!important;color:var(--muted);flex:0 0 auto;transition:background .12s ease,color .12s ease}.item-preview__emote-controls .MuiButtonBase-root .MuiSvgIcon-root{font-size:20px;margin:0}.item-preview__emote-controls .MuiBox-root>.MuiButtonBase-root:first-child{width:34px;height:34px;background:var(--accent)!important;color:#fff}.item-preview__emote-controls .MuiBox-root>.MuiButtonBase-root:first-child:hover{background:var(--text)!important}.item-preview__emote-controls .MuiBox-root>input+.MuiButtonBase-root{width:30px;height:30px;color:var(--muted)}.item-preview__emote-controls .MuiBox-root>input+.MuiButtonBase-root:hover{background:var(--media)!important;color:var(--text)}.item-preview__emote-controls input[type=range]{flex:1 1 auto;width:auto;min-width:0;height:4px;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;cursor:pointer}.item-preview__emote-controls input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;background:var(--line-strong)}.item-preview__emote-controls input[type=range]::-moz-range-track{height:4px;border-radius:999px;background:var(--line-strong)}.item-preview__emote-controls input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:13px;height:13px;margin-top:-4.5px;border-radius:50%;background:var(--accent);border:2px solid #fff;box-shadow:0 1px 3px #1615184d;cursor:pointer}.item-preview__emote-controls input[type=range]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:var(--accent);border:2px solid #fff;box-shadow:0 1px 3px #1615184d;cursor:pointer}.item-preview__emote-controls input[type=range]:focus-visible{outline:none}.item-preview__emote-controls input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--accent);outline-offset:2px}.item-detail__preview>.item-preview__note{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:88%;margin:0;text-align:center;background:#161518c7;color:#fff;font-size:12px;font-weight:500;padding:6px 12px;border-radius:999px}.item-detail__preview>.item-preview__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:transparent}.item-preview__spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:item-preview-spin .8s linear infinite}@keyframes item-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.item-preview__spinner{animation-duration:2.4s}}.item-detail__preview>.item-preview__loading .item-preview__skeleton{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border-radius:inherit}.item-detail__info-skel{display:flex;flex-direction:column;gap:16px}.id-skel__title{height:34px;width:70%;border-radius:8px}.id-skel__chips{display:flex;gap:8px}.id-skel__chip{height:24px;width:88px;border-radius:6px}.id-skel__line{height:14px;width:100%;border-radius:6px}.id-skel__line--short{width:55%}.id-skel__price{height:30px;width:40%;border-radius:8px}.id-skel__btn{height:48px;width:100%;border-radius:8px;margin-top:8px}.item-detail__info{display:flex;flex-direction:column;gap:0}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:28px;font-weight:600;line-height:34px;color:var(--text-2)}.item-detail__fav{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:var(--media);display:grid;place-items:center;color:var(--text-2);cursor:pointer;transition:color .12s ease,background .12s ease}.item-detail__fav:hover{background:var(--line)}.item-detail__fav.is-on{color:var(--dcl-red)}.item-detail__preview>.item-detail__fav--preview{display:none}.item-detail__label{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:0;color:var(--muted)}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.item-detail__chips .chip{height:24px;padding:0 8px;gap:3px;font-size:13px;font-weight:500;border-radius:4px;letter-spacing:.02em;text-transform:uppercase}.item-detail__chip{background:var(--chip);color:var(--text-2)}.item-detail__section{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.item-detail__description{margin-top:15px;gap:11px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:30px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.item-detail__desc-text.is-expanded{-webkit-line-clamp:unset;overflow:visible}.item-detail__desc-toggle{font-size:13px;align-self:flex-start}.item-detail__meta{display:flex;justify-content:space-between;gap:16px;margin-top:32px}.item-detail__meta-col{display:flex;flex-direction:column;gap:15px;min-width:0}.item-detail__meta-col--collection{align-items:flex-start}.item-detail__creator[data-testid=creator]{color:var(--accent);font-size:14px;gap:12px}.item-detail__creator [data-avatar]{width:48px;height:48px}.item-detail__creator [data-letter]{font-size:18px}.item-detail__creator [data-testid=creator-name]{color:var(--accent);font-weight:500;text-decoration:underline}.item-detail__creator[data-link]:hover [data-testid=creator-name]{color:var(--brand-violet)}.collection-collage{display:flex;flex-direction:column;overflow:hidden;gap:1px;background:var(--line-strong)}.collection-collage__row{display:flex;flex:1 1 50%;min-height:0;gap:1px}.collection-collage__row--full{flex-basis:100%}.collection-collage__row img{flex:1 1 0;min-width:0;width:100%;height:100%;object-fit:cover;display:block}.item-detail__divider{border:0;border-top:1px solid #cfcdd4;margin:24px 0 0;width:100%}.item-detail__price-block{margin-top:16px}.item-detail__price-row{display:flex;align-items:flex-start;gap:16px;width:100%}.item-detail__price-col{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:8px}.item-detail__stock-col{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:8px;text-align:right}.item-detail__stock-value{font-size:18px;font-weight:500;line-height:1;color:var(--text-2)}.item-detail__stock-value--out{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.02em;color:var(--muted-1)}.item-detail__price-label{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:0;color:var(--muted-1)}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text)}.item-detail__diamond{width:30px;height:30px;color:var(--brand-violet)}.item-detail__price-value{font-size:30px;line-height:1}.item-detail__price--none{display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--text)}.item-detail__price-info{display:inline-flex;color:var(--muted-2);cursor:help}.item-detail__price-info:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}.item-detail__approx{font-size:24px;font-weight:700;color:var(--text);margin-right:-2px}.item-detail__market-note{font-size:13px;margin-top:6px}.item-detail__price--sale{flex-wrap:wrap;gap:10px 14px}.item-detail__price--sale .item-detail__price,.item-detail__price--sale .item-detail__price-value,.item-detail__price--sale .item-detail__diamond{color:var(--dcl-red)}.item-detail__price-was{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:line-through;font-weight:600;font-size:20px}.item-detail__diamond--was{width:18px;height:18px;color:var(--muted)}.item-detail__sale-badge{display:inline-flex;align-items:center;background:var(--dcl-red);color:#fff;font-weight:800;font-size:13px;letter-spacing:.03em;text-transform:uppercase;border-radius:6px;padding:4px 10px}.item-detail__countdown{display:inline-flex;align-items:center;gap:5px;background:var(--rarity-bg);color:var(--accent);font-size:13px;font-weight:700;border-radius:6px;padding:4px 10px;white-space:nowrap}.item-detail__ctas{display:flex;flex-direction:column;gap:12px;margin-top:20px}.item-detail__cta-price{display:none;align-items:center;gap:6px}.item-detail__cta-diamond{width:20px;height:20px;color:#fff}.item-detail__addcart{width:100%;height:48px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:8px;font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:filter .15s ease}.item-detail__addcart:hover:not(:disabled){filter:brightness(1.35)}.item-detail__addcart:disabled{opacity:.55;cursor:default}.item-detail__status{margin:0;font-size:13px}.item-detail__own-note{margin:0;font-size:14px}.item-detail__own-note a{color:var(--accent);font-weight:600}@media(max-width:900px){.item-detail__title{font-size:20px;line-height:24px}.item-detail__info-head{order:0}.item-detail__chips{order:1;margin-top:10px}.item-detail__meta{order:2;margin-top:20px}.item-detail__description{order:3;margin-top:20px}.item-detail__divider{order:4;margin-top:20px}.item-detail__price-block{order:5;margin-top:16px}.item-detail__ctas{order:6}.item-detail__status{order:7}.item-detail{padding-bottom:88px}.item-detail__ctas--buttons{position:fixed;left:0;right:0;bottom:0;z-index:40;margin-top:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--soft-white);box-shadow:0 -4px 16px #1615181f}.item-detail__ctas--dual{flex-direction:row;align-items:stretch;gap:12px}.item-detail__ctas--dual .item-detail__cta-price{display:inline-flex}.item-detail__ctas--dual .item-detail__addcart{flex:0 0 auto;width:56px;padding:0}.item-detail__ctas--dual .item-detail__addcart-label{display:none}.item-detail__ctas--dual .item-detail__addcart .ico{margin:0}.item-detail__info-head .item-detail__fav{display:none}.item-detail__preview>.item-detail__fav--preview{display:grid;position:absolute;top:12px;right:12px;z-index:3;width:40px;height:40px;background:#ffffffeb;box-shadow:0 1px 4px #1615182e}.item-detail__preview>.item-detail__fav--preview:hover{background:#fff}.item-detail__preview>.item-preview__toggle{top:auto;left:auto;bottom:12px;right:12px;gap:0;padding:0;background:transparent;border:0;box-shadow:0 1px 4px #1615182e;overflow:hidden}.item-preview__toggle-label{display:none}.item-preview__toggle-ico{display:block}.item-preview__toggle button{padding:9px 13px;border-radius:0;background:#fff;color:var(--text-2)}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:first-child{border-top-left-radius:999px;border-bottom-left-radius:999px}.item-preview__toggle button:last-child{border-top-right-radius:999px;border-bottom-right-radius:999px}}.item-detail--notfound{min-height:46vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}.item-detail__notfound-ico{width:44px;height:44px;opacity:.4}.item-detail__notfound-title{font-size:22px}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C2N-AU8j.js","assets/react-BrLDncxD.js","assets/dcl-schemas-BICTSpB5.js","assets/index-DaOu_NHP.js","assets/sentry-DYZXk5O5.js","assets/ethers-BIvjmL85.js","assets/intl-CBcMB1D2.js","assets/index-Bw9Y53F1.css","assets/emotion-styled.browser.esm-D40Lt8fm.js","assets/useTheme-ddXkiCRZ.js","assets/CircularProgress-BmaY3soK.js","assets/index-D-i0A7WQ.js","assets/useTheme--bd6Ub02.js","assets/CssVarsProvider-D03-j1T8.js","assets/getOverlayAlpha-B90Fo_-m.js","assets/index-BkQHYnhC.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as ce,r as d,j as e,d as ya,u as fa,L as ba}from"./react-BrLDncxD.js";import{d as Z,n as xa,o as Ne,t,ai as ga,i as ja,b as va,w as Na,q as le,x as R,y as je,z as be,aj as ka,E as ee,g as F,j as oe,B as z,C as xe,p as wa,J as Xe,_ as ge,al as Ia,ay as Ca,az as Aa,aA as Sa,aB as Ma,c as ke,aC as Pa,M as Ze,m as D,aD as Ea,I as q,F as W,s as V,aE as Fa,aF as La,aG as Ta,G as Da,af as We,a as Ve,aH as qa,aI as Ra,aJ as Ba,aK as $a,aL as Oa,ag as Ka,u as za,aM as Wa,aN as Va,aO as Ua,h as Qa,aP as Ue,aQ as Ga,f as Ha,ap as Ja,aR as Ya,aS as Xa,aq as Za,aT as et,aU as at,aV as tt}from"./index-DaOu_NHP.js";import{d as H}from"./dcl-schemas-BICTSpB5.js";import{b as Qe,c as st}from"./buy-CE5I6jg2.js";import{P as it,f as rt}from"./PrimaryListModal-QH5JEih2.js";import{b as nt,w as lt,S as dt,G as ot}from"./buy-gasless-DPcBjPtZ.js";import{a as ct}from"./authorizations-QONJAQC4.js";import{u as mt,M as ut,c as ht}from"./useCreditPacks-CV1PhThV.js";import{W as _t,C as pt,a as yt}from"./CollectionCarousel-B2cDWt_o.js";import{R as Ge}from"./resume-buy-Bf0zIH7y.js";import{a as ft,f as ve,i as bt}from"./errors-DmdGTuzI.js";import{E as me}from"./ErrorNotice-BDH9xoG4.js";import{l as xt}from"./loader-logo-BzY9EKdC.js";import{C as gt}from"./CircularProgress-BmaY3soK.js";import{a as jt,b as vt}from"./trade-encoding-DqhxC9n7.js";import{u as Nt,M as kt}from"./MarketCheckout-BrvEzX8j.js";import{s as wt}from"./address-DrURAr9O.js";import{T as ea}from"./Tooltip-BaUllE5E.js";import"./sentry-DYZXk5O5.js";import"./ethers-BIvjmL85.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-iOoE_Tw3.js";import"./mana-rate-BX_VjspN.js";import"./emotion-CSxEP8yM.js";function It({item:s,onClose:n,resume:i=!1}){var te,se;const{session:o}=Z(),{data:c}=xa(o),h=Ne(),k=ce(),b=mt().packs.slice(0,ut),[m,l]=d.useState("loading"),[a,x]=d.useState(null),[y,N]=d.useState(""),[L,g]=d.useState(s.priceCredits),[f,j]=d.useState(null),C=d.useRef(null),M=(f==null?void 0:f.credits)??L,ae=(c==null?void 0:c.credits)??0;d.useEffect(()=>{let u=!1;if(!o){l("error"),x(t("buyModal.signInToCheckout"));return}const A=_=>{const S=_-((c==null?void 0:c.credits)??0),v=b.find(B=>B.credits>=S)??b[b.length-1];N(v.id),R("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(c==null?void 0:c.credits)??0,shortfall:Math.max(0,S)}),l("nofunds")};return(async()=>{var _,S;try{const v=await ga(s);if(!v)throw new Error("not for sale");if(ja(v,o.address))throw new Error("You can't buy your own listing.");const B=va((S=(_=v.received)==null?void 0:_[0])==null?void 0:S.amount);if(!Number.isFinite(B)||B<=0)throw new Error("price unavailable");const U=Math.ceil(B/10);if(u)return;if(g(U),c!=null&&c.credits<U){A(U);return}try{const{credit:P,maxCreditedValue:Y,usdCents:K}=await Na(o.identity,B,v.id);if(u){le(o.identity,[P.id]).catch(()=>{});return}C.current=P.id;const ie=Math.ceil(K/10);g(ie);const Q={trade:v,credit:P,maxCreditedValue:Y,usdCents:K,credits:ie};j(Q),i?J(Q):l("ready")}catch(P){if(u)return;if(ft(P)){A(U);return}throw P}}catch(v){if(u)return;R(be(v)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:je(v)}),l("error"),x(ve(v,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{u=!0,C.current&&o&&(le(o.identity,[C.current]).catch(()=>{}),C.current=null)}},[]);async function J(u=f){if(!o||!u)return;l("processing"),x(null);let A=!1;try{const _={trade:u.trade,buyer:o.address,signer:o.signer,credits:[u.credit],maxCreditedValue:u.maxCreditedValue};let S;if(ct())try{S=await nt(_),await lt(S),A=!0}catch(v){if(v instanceof dt)A=!0;else if(v instanceof ot)S=await Qe(_);else throw v}else S=await Qe(_);C.current=null,R("Shop Completed Purchase",{...ka([s]),payment_type:"credits",no_crypto_step:A,transaction_hash:S??null}),h.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){be(_)||ee(_,{flow:"buy",step:"submit",gasless:A}),le(o.identity,[u.credit.id]).catch(()=>{}),C.current=null,R(be(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:je(_)}),h.invalidateQueries({queryKey:["usd-balance"]}),x(ve(_,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function ue(){if(!(!y||!o)){try{sessionStorage.setItem(Ge,JSON.stringify(s))}catch{}f&&le(o.identity,[f.credit.id]).catch(()=>{}),C.current=null,l("loading");try{const u=await ht(y,{address:o.address,identity:o.identity});if(u.url){window.location.href=u.url;return}k("/credits")}catch(u){ee(u,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ge)}catch{}x(t("buyModal.error.creditsCheckout")),l("error")}}}const O=m==="processing",T=m==="complete"?t("buyModal.titleComplete"):m==="nofunds"?t("buyModal.titleNoFunds"):t("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:s.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:O?void 0:n,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${m==="processing"||m==="loading"?" 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}),!O&&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:m==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(F,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:oe(ae)})]})]}),m==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(gt,{size:44})}),m==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(me,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:n,children:t("buyModal.close")})})]}),m==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(_t,{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,M-ae)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(He,{item:s,priceCredits:M}),e.jsx("div",{className:"buy-modal__packs",children:b.map(u=>{const A=u.credits,_=u.id===y;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>N(u.id),children:[e.jsx(F,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:oe(A)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",u.usd.toFixed(2),")"]})]},u.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(F,{className:"buy-modal__total-ico"}),e.jsx("span",{children:oe(((te=b.find(u=>u.id===y))==null?void 0:te.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((se=b.find(u=>u.id===y))==null?void 0:se.usd)??0).toFixed(2)]})]}),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--gradient",onClick:()=>void ue(),children:t("buyModal.buy")})]})]}),m==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(He,{item:s,priceCredits:M}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void J(),children:t("buyModal.buy")})})]}),m==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:xt,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:i?t("buyModal.completingPurchase"):t("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),m==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:t("getCredits.successTitle")})," ",t("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>k("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:n,children:[t("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function He({item:s,priceCredits:n}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:s.name,children:s.name||t("buyModal.itemFallback")}),s.creator?e.jsx(pt,{address:s.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(F,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:oe(n)})]})]})]})}const Ct=1e3*60*60*24*182;function At({asset:s,session:n,onClose:i}){const o=Ne(),c=ce(),[h,k]=d.useState("10"),[b,m]=d.useState(null),[l,a]=d.useState(null),[x,y]=d.useState(!1),[N,L]=d.useState(null);async function g(){a(null);const j=Number(h);if(!Number.isInteger(j)||j<=0){a(t("sellModal.errorWholeNumber"));return}y(!0);try{m(t("sellModal.statusPreparing")),await jt({signer:n.signer,contractAddress:s.contractAddress,chainId:s.chainId}),m(t("sellModal.statusListing"));const C=await vt({signer:n.signer,nft:{contractAddress:s.contractAddress,tokenId:s.tokenId,network:s.network,chainId:s.chainId},usdPrice:j/10,expiresAtMs:Date.now()+Ct});m(t("sellModal.statusPublishing")),await wa(C,n.identity),m(null),L(j),R("Shop Listed Item",{item_id:s.itemId??s.tokenId??null,contract_address:s.contractAddress,price_credits:j,price_usd:j/10,listing_type:"secondary",is_primary:!1}),Xe.success(t("sellModal.toastOnSale",{name:s.name})),o.invalidateQueries({queryKey:["my-assets",n.address]})}catch(C){ee(C,{flow:"list_secondary"}),R("Shop Listing Failed",{listing_type:"secondary",error_code:je(C)}),a(ve(C,t("sellModal.errorGeneric"))),m(null)}finally{y(!1)}}function f(){i(),c(`/item/${s.contractAddress}/${s.tokenId}`)}return N!==null?e.jsx("div",{className:"modal-backdrop",onClick:i,role:"presentation",children:e.jsxs("div",{className:"modal modal--success",onClick:j=>j.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:t("sellModal.successTitle")}),s.image?e.jsx("img",{className:"modal__img",src:s.image,alt:s.name}):null,e.jsx("p",{className:"modal-success__name",children:s.name}),e.jsxs("p",{className:"muted small",children:[t("sellModal.listedFor")," ",e.jsxs("strong",{children:[e.jsx(F,{className:"ccy-mark"})," ",N]})]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(z,{variant:"ghost",onClick:i,children:t("getCredits.done")}),e.jsx(z,{variant:"purple",onClick:f,children:t("sellModal.viewInShop")})]})]})}):e.jsx("div",{className:"modal-backdrop",onClick:i,role:"presentation",children:e.jsxs("div",{className:"modal","data-testid":"modal",onClick:j=>j.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("h2",{className:"modal__title",children:t("sellModal.listTitle",{name:s.name})}),s.image?e.jsx("img",{className:"modal__img",src:s.image,alt:s.name}):null,e.jsxs("label",{className:"field",children:[e.jsx("span",{children:t("sellModal.priceLabel",{currency:xe.name})}),e.jsx("input",{type:"number",min:"1",step:"1",value:h,onChange:j=>k(j.target.value),disabled:x})]}),e.jsx("p",{className:"muted small",children:t("sellModal.pricedInWhole",{currency:xe.name,currencySingular:xe.nameSingular})}),b?e.jsx("p",{className:"muted",children:b}):null,e.jsx(me,{message:l}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(z,{variant:"ghost",onClick:i,disabled:x,children:t("sellModal.cancel")}),e.jsx(z,{onClick:()=>void g(),disabled:x,children:x?t("sellModal.listing"):t("sellModal.putOnSale")})]})]})})}const St=d.lazy(async()=>{const[{EmoteControls:s},{Experimental_CssVarsProvider:n},{light:i}]=await Promise.all([ge(()=>import("./index-C2N-AU8j.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ge(()=>import("./index-D-i0A7WQ.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ge(()=>import("./index-BkQHYnhC.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:o=>e.jsx(n,{theme:i,children:e.jsx(s,{...o})})}});function Mt(s){return e.jsx(d.Suspense,{fallback:null,children:e.jsx(St,{...s})})}function Pt({item:s}){const n=Z(f=>{var j;return(j=f.session)==null?void 0:j.address}),{data:i,isLoading:o}=Ia(n),c=n&&i?n:"default",h=s.category==="emote",[k,b]=d.useState("item"),m=!h&&k==="item",l=m||!o,[a,x]=d.useState(!0);d.useEffect(()=>{x(!0)},[s.id,m]);const y=!!n&&!!i,N=y&&Ca(s,Aa(i)),L=Sa(s)[0],g=y&&!N&&!h;return e.jsxs(e.Fragment,{children:[l?e.jsx(Ma,{id:"shop-item-preview",contractAddress:s.contractAddress,tokenId:s.tokenId??void 0,itemId:s.tokenId?void 0:s.itemId??void 0,profile:m?void 0:N?c:"default",bodyShape:m||N?void 0:L,type:h?void 0:m?H.PreviewType.WEARABLE:H.PreviewType.AVATAR,emote:h||m?void 0:H.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:h?1.5:void 0,wheelStart:h?100:void 0,dev:ke.chainId===80002,onLoad:()=>x(!1)}):null,!l||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,g&&!m?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:Pa(L)})}):null,h?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(Mt,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":t("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:k==="avatar"?"is-active":"","aria-pressed":k==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>b("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:k==="item"?"is-active":"","aria-pressed":k==="item","aria-label":t("itemPreview.item"),onClick:()=>b("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.item")})]})]})]})}function aa(){return ke.shopServerUrl||(typeof window<"u"?window.location.origin:"")}async function Et(s,n,i){const o=new URLSearchParams({contractAddress:s,itemId:n}),c=`${aa()}/notify-requests?${o.toString()}`,h=await Ze(c,{method:"GET",identity:i,metadata:{}});if(!h.ok)throw new Error(`getNotifyRequest ${h.status}`);return h.json()}async function Ft(s,n){const i=`${aa()}/notify-requests`,o=await Ze(i,{method:"POST",identity:n,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok)throw new Error(`createNotifyRequest ${o.status}: ${await o.text()}`);await o.json().catch(()=>{})}function Je(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())}function Lt({item:s}){const n=Z(g=>g.session),i=Z(g=>g.signIn),[o,c]=d.useState(""),[h,k]=d.useState(!1),[b,m]=d.useState(!1),[l,a]=d.useState(null),x=!!n&&!!s.contractAddress&&!!s.itemId,{data:y}=D({queryKey:["notify-request",s.contractAddress,s.itemId,n==null?void 0:n.address],enabled:x,queryFn:()=>Et(s.contractAddress,s.itemId,n.identity)});d.useEffect(()=>{y!=null&&y.email&&c(g=>g||y.email)},[y==null?void 0:y.email]),d.useEffect(()=>{if(!n)return;let g=!1;return Ea().then(f=>{!g&&f&&c(j=>j||f)}),()=>{g=!0}},[n]);const N=b||!!(y!=null&&y.subscribed);async function L(g){if(g.preventDefault(),!(!n||!s.itemId||!Je(o)||h)){k(!0),a(null);try{await Ft({contractAddress:s.contractAddress,itemId:s.itemId,chainId:s.chainId,email:o.trim()},n.identity),m(!0)}catch(f){ee(f,{flow:"notify-me",contractAddress:s.contractAddress,itemId:s.itemId}),a(t("notifyMe.error"))}finally{k(!1)}}}return n?N?e.jsxs("div",{className:"notify notify__done","data-testid":"notify-subscribed",children:[e.jsx("span",{className:"notify__done-check","aria-hidden":!0,children:e.jsx(q,{name:"check",size:12})}),e.jsx("span",{className:"notify__done-text",children:t("notifyMe.subscribedBody")})]}):e.jsxs("form",{className:"notify",onSubmit:L,"data-testid":"notify",children:[e.jsx("label",{className:"notify__label",htmlFor:"notify-email",children:t("notifyMe.label")}),e.jsxs("div",{className:"notify__row",children:[e.jsx("input",{id:"notify-email",className:"notify__input",type:"email",inputMode:"email",autoComplete:"email",placeholder:t("notifyMe.placeholder"),value:o,onChange:g=>c(g.target.value),"data-testid":"notify-email"}),e.jsx("button",{type:"submit",className:"notify__btn",disabled:!Je(o)||h,"data-testid":"notify-submit",children:h?t("notifyMe.working"):t("notifyMe.cta")})]}),e.jsx(me,{message:l})]}):e.jsx("div",{className:"notify","data-testid":"notify",children:e.jsx("button",{type:"button",className:"notify__signin",onClick:i,"data-testid":"notify-signin",children:t("notifyMe.signInCta")})})}const Tt=V.button`
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
gap: 8px;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 40px;
|
|
9
|
-
padding: 0 12px;
|
|
10
|
-
border: 2px solid #c640cd;
|
|
11
|
-
border-radius: 8px;
|
|
12
|
-
background: transparent;
|
|
13
|
-
color: ${W.colors.accent};
|
|
14
|
-
font-family: ${W.font.sans};
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
font-size: 15px;
|
|
17
|
-
line-height: 24px;
|
|
18
|
-
letter-spacing: 0.46px;
|
|
19
|
-
text-transform: uppercase;
|
|
20
|
-
cursor: not-allowed;
|
|
21
|
-
opacity: 0.55;
|
|
22
|
-
transition: opacity 0.15s ease;
|
|
23
|
-
|
|
24
|
-
&:hover,
|
|
25
|
-
&:focus-visible {
|
|
26
|
-
opacity: 0.75;
|
|
27
|
-
}
|
|
28
|
-
&:focus-visible {
|
|
29
|
-
outline: 2px solid ${W.colors.accent};
|
|
30
|
-
outline-offset: 2px;
|
|
31
|
-
}
|
|
32
|
-
`;function Dt({item:s}){return e.jsx(ea,{block:!0,content:t("makeOffer.comingSoon"),onShow:()=>R("Shop Make Offer Tooltip Shown",{contractAddress:s.contractAddress,itemId:s.itemId}),children:e.jsxs(Tt,{type:"button","aria-disabled":!0,onClick:n=>n.preventDefault(),"data-testid":"make-offer",children:[e.jsx(q,{name:"offer",size:20,"aria-hidden":!0}),e.jsx("span",{children:t("makeOffer.cta")})]})})}const qt=V(Fa)`
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
gap: 1px;
|
|
37
|
-
background: ${W.colors.lineStrong};
|
|
38
|
-
`;function Rt({contractAddress:s,name:n,items:i,className:o}){const c=ce();if(!s||!n)return null;const h=(i??[]).map(m=>m.thumbnail).filter(m=>!!m).slice(0,4),k=h.slice(0,2),b=h.slice(2,4);return e.jsxs(La,{as:"button","data-link":!0,className:o,"data-testid":"creator",onClick:m=>{m.stopPropagation(),c(`/collection/${s}`)},children:[h.length>0?e.jsxs(qt,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${b.length===0?" collection-collage__row--full":""}`,children:k.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}),b.length>0?e.jsx("span",{className:"collection-collage__row",children:b.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}):null]}):null,e.jsx(Ta,{"data-testid":"creator-name",children:Da(n)})]})}const Bt=V(z)`
|
|
39
|
-
margin-top: 6px;
|
|
40
|
-
`,de=V(z)`
|
|
41
|
-
&& {
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 48px;
|
|
44
|
-
font-size: 15px;
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
letter-spacing: 0.46px;
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
gap: 8px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
${W.media.down("lg")} {
|
|
54
|
-
.item-detail__ctas--dual && {
|
|
55
|
-
flex: 1 1 auto;
|
|
56
|
-
width: auto;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`,$t=V("div")`
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
gap: 10px;
|
|
63
|
-
width: 100%;
|
|
64
|
-
`,Ot=V(z)`
|
|
65
|
-
&& {
|
|
66
|
-
width: 100%;
|
|
67
|
-
height: 44px;
|
|
68
|
-
}
|
|
69
|
-
`,Kt=V("p")`
|
|
70
|
-
margin: 4px 0 0;
|
|
71
|
-
font-size: 13px;
|
|
72
|
-
color: ${W.colors.muted};
|
|
73
|
-
|
|
74
|
-
a {
|
|
75
|
-
color: ${W.colors.accent};
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
}
|
|
78
|
-
`;function zt(s){return Object.values(H.Rarity).includes(s)}function Wt(s){return s==="male"?t("itemDetail.genderMale"):s==="female"?t("itemDetail.genderFemale"):s==="unisex"?t("itemDetail.genderUnisex"):null}function Ye(s){return s.wearableCategory?s.wearableCategory.replace(/_/g," "):s.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function fs(){var Ke;const{contractAddress:s,tokenId:n}=ya(),{state:i}=fa(),o=ce(),c=!!(i!=null&&i.market),h=(i==null?void 0:i.marketPriceCredits)??null,k=We(r=>r.add),b=We(r=>r.items),m=Ve(r=>r.toggle),{session:l}=Z(),[a,x]=d.useState(()=>i!=null&&i.item?{...i.item,tradeId:i.tradeId??i.item.tradeId}:{id:`${s}-${n}`,name:"",creator:"",contractAddress:s??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:ke.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:n??void 0,tradeId:i==null?void 0:i.tradeId}),[y,N]=d.useState(!1),[L,g]=d.useState(!!(i!=null&&i.resumeBuy));d.useEffect(()=>{i!=null&&i.resumeBuy&&N(!0)},[i==null?void 0:i.resumeBuy]);const{data:f=[],isFetched:j}=D({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>Ja(a.contractAddress,{first:20}).then(r=>r.items)}),C=a.available==null&&!a.tokenId,{data:M,isLoading:ae}=D({queryKey:["shop-item",a.contractAddress,n],enabled:!c&&!!a.contractAddress&&!!n&&(!(i!=null&&i.item)||C),queryFn:()=>Ya(a.contractAddress,n)});d.useEffect(()=>{M&&x(r=>r.tradeId?r.available!=null&&r.wearableCategory?r:{...r,available:r.available??M.available,wearableCategory:r.wearableCategory??M.wearableCategory}:{...M})},[M]);const[J,ue]=d.useState(!1),{data:O=""}=D({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Xa(a.contractAddress,a.itemId)}),{data:T}=D({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Za(a.contractAddress)});d.useEffect(()=>{if(a.name||M||f.length===0)return;const r=n&&f.find(w=>w.tokenId===n||w.itemId===n)||f.find(w=>w.contractAddress===a.contractAddress);r&&x(w=>({...r,tradeId:w.tradeId??r.tradeId}))},[f,M]);const te=d.useMemo(()=>{const r=new Set,w=[];for(const E of f){if(E.id===a.id||a.itemId&&E.itemId===a.itemId||a.tokenId&&E.tokenId===a.tokenId)continue;const ze=`${E.contractAddress}-${E.itemId??E.tokenId??E.id}`;r.has(ze)||(r.add(ze),w.push(E))}return w},[f,a.id,a.itemId,a.tokenId]),{data:se,isLoading:u}=D({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const r=await et(a.contractAddress,a.itemId);return(r==null?void 0:r.id)??null}return null}}),A=a.tradeId??se??void 0,_=!!A,{data:S}=Nt(c),v=d.useMemo(()=>{if(!c||!(i!=null&&i.item))return null;const r=i.item;return r.manaWei?{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei,available:1,network:r.network,chainId:r.chainId,createdAt:0}:null},[c,i==null?void 0:i.item]),B=c&&h!=null&&!!S&&!!v,U=qa({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),P=d.useMemo(()=>({...a,tradeId:A,id:A??a.id}),[a,A]),Y=b.some(r=>r.id===P.id),K=!P.tokenId,ie=((Ke=b.find(r=>r.id===P.id))==null?void 0:Ke.quantity)??0,Q=K&&typeof a.available=="number"&&ie>=a.available,$=Ve(r=>!!r.items[a.id]),we=d.useRef(null);d.useEffect(()=>{!a.name||u||we.current===a.id||(we.current=a.id,R("Shop Viewed Item",{...Ra(a),for_sale:_}),Ba(a))},[a.id,a.name,u,_]);const re=`${s}/${n}`,Ie=d.useRef(re);d.useEffect(()=>{Ie.current!==re&&(Ie.current=re,i!=null&&i.item&&x({...i.item,tradeId:i.tradeId??i.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[re]);function ta(){!_||_e||u||!K&&Y||Q||k(P,"item_detail")}const he=zt(a.rarity)?a.rarity:H.Rarity.COMMON,Ce=Wt(a.gender),Ae=$a(a),Se=Oa(a.gender),sa=_&&U,ia=t("itemDetail.moreFromCollection"),_e=Ka(a,l==null?void 0:l.address),ne=Ne(),[ra,Me]=d.useState(!1),[na,Pe]=d.useState(!1),[X,Ee]=d.useState(!1),[la,Fe]=d.useState(null),{data:p,isLoading:Le}=D({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!c&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?at(l.address,a.contractAddress,a.tokenId):null});d.useEffect(()=>{p&&x(r=>r.name?r.issuedId?r:{...r,issuedId:p.issuedId}:{id:p.id,name:p.name,creator:"",contractAddress:p.contractAddress,itemId:p.itemId,category:p.category,rarity:p.rarity??"common",network:p.network,chainId:p.chainId,thumbnail:p.image,priceCredits:p.listingPrice??0,gender:null,isSmart:!1,tokenId:p.tokenId,issuedId:p.issuedId,tradeId:p.tradeId})},[p]);const{data:I}=D({queryKey:["public-token",a.contractAddress,a.tokenId],enabled:!c&&!!a.contractAddress&&!!a.tokenId&&!a.name&&!M&&!Le&&!p,queryFn:()=>tt(a.contractAddress,a.tokenId)});d.useEffect(()=>{I&&x(r=>r.name?r.issuedId?r:{...r,issuedId:I.issuedId}:{id:I.id,name:I.name,creator:"",contractAddress:I.contractAddress,itemId:I.itemId,category:I.category,rarity:I.rarity??"common",network:I.network,chainId:I.chainId,thumbnail:I.image,priceCredits:I.listingPrice??0,gender:null,isSmart:!1,tokenId:I.tokenId,issuedId:I.issuedId,tradeId:I.tradeId})},[I]);const{data:pe}=D({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:_e&&!!l&&!!a.itemId,queryFn:async()=>l?(await rt(l.address,l.identity)).find(w=>w.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&w.blockchainItemId===a.itemId)??null:null}),G=!!p,ye=!c&&(_e||G),da=G?!!(p!=null&&p.isOnSale):_,fe=G?p==null?void 0:p.tradeId:A,Te=G?!!p:!!pe;async function De(){await Promise.all([ne.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),ne.invalidateQueries({queryKey:["detail-trade"]}),ne.invalidateQueries({queryKey:["shop-item"]}),ne.invalidateQueries({queryKey:["collection-sale-state"]})])}async function qe(r={}){if(!l||!fe)return!1;Fe(null),Ee(!0);try{const w=await Ha(fe);return await st({trade:w,signer:l.signer}),r.silent||Xe.success(t("myAssets.removedFromSale",{name:a.name})),await De(),!0}catch(w){const E=bt(w);return E||ee(w,{flow:"remove-listing",tradeId:fe}),Fe(E?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{Ee(!1)}}function Re(){G?Me(!0):Pe(!0)}async function oa(){await qe({silent:!0})&&Re()}function Be(){Me(!1),Pe(!1),De()}const $e=_?u?t("itemDetail.checking"):Q?t("itemDetail.maxInCart"):!K&&Y?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),ca=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!c,ma=!c&&!a.tokenId&&a.available===0,ua=!ye&&_&&!c,ha=c||!ye,_a=ae||!!a.contractAddress&&!j||!a.name&&Le,Oe=!a.name&&!_a,pa=/^https?:\/\//i.test(a.thumbnail);return za(Oe?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:O||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ye(a),creator:wt(a.creator)}),image:pa?a.thumbnail:void 0,type:"product"}:{}),Oe?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(q,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:t("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:t("itemDetail.notAvailableBody")}),e.jsx(Bt,{variant:"purple",onClick:()=>o("/assets"),children:t("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":t("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>o("/assets"),children:t("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||t("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx(Pt,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${$?" is-on":""}`,onClick:()=>m(a),"aria-pressed":$,"aria-label":$?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(q,{name:$?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${$?" is-on":""}`,onClick:()=>m(a),"aria-pressed":$,"aria-label":$?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(q,{name:$?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:Ua(he),color:Va(he)},title:Wa(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[Ae?e.jsx(q,{name:Ae,size:18,color:"var(--text-2)"}):null,Ye(a)]}),Ce?e.jsxs("span",{className:"chip item-detail__chip",children:[Se?e.jsx(q,{name:Se,size:18,color:"var(--text-2)"}):null,Ce]}):null,a.issuedId?e.jsxs("span",{className:"chip item-detail__chip","data-testid":"detail-issued",children:["#",a.issuedId]}):null]}),O?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${J?" is-expanded":""}`,children:O}),O.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>ue(r=>!r),children:J?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||T!=null&&T.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.creator")}),e.jsx(Qa,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,T!=null&&T.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.collection")}),e.jsx(Rt,{contractAddress:a.contractAddress,name:T.name,items:f,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[c||_?e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}):null,c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:h==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(F,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:h})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):_?sa?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(F,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(F,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),Ue(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:Ue(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Ga,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(F,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsxs("div",{className:"item-detail__price item-detail__price--none",children:[e.jsx("span",{children:t("itemDetail.notForSale")}),e.jsx(ea,{content:t("itemDetail.notForSaleHint"),children:e.jsx("span",{className:"item-detail__price-info",tabIndex:0,role:"img","aria-label":t("itemDetail.notForSaleHint"),children:e.jsx(q,{name:"info",size:14})})})]})]}),ca?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",H.Rarity.getMaxSupply(he).toLocaleString()]})]}):ma?e.jsx("div",{className:"item-detail__stock-col",children:e.jsx("div",{className:"item-detail__stock-value item-detail__stock-value--out","data-testid":"out-of-stock",children:t("itemDetail.outOfStock")})}):null]})}),e.jsx("div",{className:`item-detail__ctas${ha?" item-detail__ctas--buttons":""}${ua?" item-detail__ctas--dual":""}`,children:c?e.jsxs(de,{variant:"purple",onClick:()=>N(!0),disabled:!B,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),h!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(F,{className:"item-detail__cta-diamond"}),h]}):null]}):ye?e.jsxs($t,{"data-testid":"manage-actions",children:[e.jsx(me,{message:la}),da?e.jsxs(e.Fragment,{children:[e.jsx(de,{variant:"purple",onClick:()=>void oa(),disabled:X||!Te,children:e.jsx("span",{className:"item-detail__cta-label",children:X?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(Ot,{variant:"ghost",onClick:()=>void qe(),disabled:X,children:X?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(de,{variant:"purple",onClick:()=>{G&&R("Shop Started Listing",{listing_type:"secondary",item_id:a.itemId??a.tokenId??null}),Re()},disabled:X||!Te,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(Kt,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(ba,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):_?e.jsxs(e.Fragment,{children:[e.jsxs(de,{variant:"purple",onClick:()=>N(!0),disabled:u,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(F,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}),e.jsxs("button",{className:"item-detail__addcart",onClick:ta,disabled:u||(K?Q:Y),"aria-label":$e,children:[e.jsx(q,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:$e})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Lt,{item:a}),e.jsx(Dt,{item:a})]})})]}):e.jsx(Vt,{})})]}),e.jsx(yt,{title:ia,items:te,onViewAll:a.contractAddress?()=>o(`/collection/${a.contractAddress}`):void 0}),y&&c&&v&&S?e.jsx(kt,{listing:v,rate:S,onClose:()=>N(!1),onSold:()=>N(!1)}):y&&!c?e.jsx(It,{item:P,resume:L,onClose:()=>{N(!1),g(!1)}}):null,ra&&p&&l?e.jsx(At,{asset:p,session:l,onClose:Be}):null,na&&pe&&l?e.jsx(it,{item:pe,session:l,onClose:Be}):null]})}function Vt(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{fs as ItemDetail,fs as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{m as O,c as S,d as V,n as Y,o as H,t,q as k,g as x,r as M,v as $,C as j,f as D,i as J,w as X,x as p,y as F,z as R,s as Z,B as ee}from"./index-DaOu_NHP.js";import{r as re,a as b}from"./mana-rate-BX_VjspN.js";import{a as ae,r as m,j as r}from"./react-BrLDncxD.js";import{b as A}from"./buy-CE5I6jg2.js";import{b as te,w as se,S as ie,G as ce}from"./buy-gasless-DPcBjPtZ.js";import{a as ne}from"./authorizations-QONJAQC4.js";import{i as de}from"./errors-DmdGTuzI.js";import{E as oe}from"./ErrorNotice-BDH9xoG4.js";function Ce(e=!0){return O({queryKey:["mana-rate",S.chainId],queryFn:()=>re(S.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}const B=Z(ee)`
|
|
2
|
-
flex: 1;
|
|
3
|
-
`;function U(e){if(de(e))return t("errors.rejected");const n=(e.message??"").toLowerCase();return n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:j.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("errors.cantBuyOwn"):t("marketCheckout.error.generic")}function le(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function ve({listing:e,rate:n,onClose:q,onSold:W}){const{session:i}=V(),{data:d,isError:T}=Y(i),w=H(),g=ae(),[N,f]=m.useState("confirm"),[C,I]=m.useState(t("marketCheckout.lockingPrice")),[z,_]=m.useState(null),[a,G]=m.useState(null),o=m.useRef(null),L=Math.ceil(b(e.manaWei,n)/10);m.useEffect(()=>{let l=!1;if(!i){f("error"),_(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await D(e.tradeId);if(!s)throw new Error("not found");if(J(s,i.address))throw new Error("You can't buy your own listing.");const h=b(e.manaWei,n);if(!Number.isFinite(h)||h<=0)throw new Error("price unavailable");const{credit:u,maxCreditedValue:K,usdCents:P}=await X(i.identity,h,e.tradeId);if(l){k(i.identity,[u.id]).catch(()=>{});return}o.current=u.id,G({trade:s,credit:u,maxCreditedValue:K,usdCents:P,credits:Math.ceil(P/10)}),I("")}catch(s){if(l)return;console.error("[market] authorize failed",s),p(R(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:F(s),value_usd:Math.round(b(e.manaWei,n))/100}),f("error"),_(U(s))}})(),()=>{l=!0,o.current&&i&&(k(i.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const v=!!a&&d!=null&&d.credits<a.credits;async function Q(){if(!i||!a)return;if(v){p("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),k(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,g("/credits");return}f("working"),_(null);let l=!1;try{I(t("marketCheckout.confirming"));const c={trade:a.trade,buyer:i.address,signer:i.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(ne())try{s=await te(c),await se(s),l=!0}catch(u){if(u instanceof ie)l=!0;else if(u instanceof ce)s=await A(c);else throw u}else s=await A(c);o.current=null,p("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),w.invalidateQueries({queryKey:["usd-balance"]});const h={items:[le(e)],txHash:s};g("/success",{state:h})}catch(c){console.error("[market] buy now failed",c),k(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,p(R(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:F(c),value_usd:a.usdCents/100}),w.invalidateQueries({queryKey:["usd-balance"]}),_(U(c)),f("error");const s=(c.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&W()}}function E(){i&&a&&k(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,q()}const y=N==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:y?void 0:E,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),M(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),M(L)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:C||t("marketCheckout.lockingPrice")})]})}),i?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",$(d,T)]}):null,v?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:j.name})}):null,C&&N==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:C}):null,r.jsx(oe,{message:z,className:"mkt-modal__note"}),r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx(B,{variant:"ghost",onClick:E,disabled:y,children:t("buyModal.cancel")}),r.jsx(B,{variant:"purple",onClick:()=>void Q(),disabled:y||!a,children:y?t("marketCheckout.buying"):v?t("nav.getCredits",{currency:j.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{ve as M,Ce as u};
|