@dcl/shop 0.1.1-30909439604.commit-4721d83 → 0.1.1-30910936579.commit-bb58bbb
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-CiQm3fPZ.js → Activity-BFxuJO2y.js} +11 -11
- package/_assets/{AnimatedBackground-BFRTkuDo.js → AnimatedBackground-VQDTmdjQ.js} +2 -2
- package/_assets/{Assets--cn5UbRN.js → Assets-BikrL8IX.js} +3 -3
- package/_assets/{Assets.styles-CkJWzjdk.js → Assets.styles-Cxk14RF3.js} +1 -1
- package/_assets/{Authorizations-Cqqxn9wD.js → Authorizations-BtKTUS-9.js} +1 -1
- package/_assets/{Cart-ByLo0Q5U.js → Cart-BTqp0FRv.js} +11 -11
- package/_assets/{CircularProgress-Cv24wKWu.js → CircularProgress-17SCzKSq.js} +5 -5
- package/_assets/{Collection-DbZpN_eH.js → Collection-CYIm3Htv.js} +7 -7
- package/_assets/{CollectionCarousel-DKVvizGs.js → CollectionCarousel-C0LgFQAu.js} +1 -1
- package/_assets/{ConstantsUtil-CNJ3pGKv.js → ConstantsUtil-Di3dRDAF.js} +1 -1
- package/_assets/{ContentClient-BJFWm8Bs.js → ContentClient-Bv-dXg1a.js} +1 -1
- package/_assets/{Creator-CtdwyJXl.js → Creator-DVEvwEf2.js} +32 -32
- package/_assets/{DeploymentBuilder-CXBC22K0.js → DeploymentBuilder-DbR23a3M.js} +1 -1
- package/_assets/{ErrorNotice-51eOicue.js → ErrorNotice-D6-7YD_C.js} +1 -1
- package/_assets/{ExchangeController--vn2md5b.js → ExchangeController-DjKSc6Rd.js} +1 -1
- package/_assets/{GetCredits-CnE9Mkj3.js → GetCredits-B3XWTumM.js} +9 -9
- package/_assets/{HelpersUtil-Dg90boC1.js → HelpersUtil-iIr5k8S3.js} +1 -1
- package/_assets/{ImportListings-BxeqcxAE.js → ImportListings-ZrRXROSR.js} +21 -21
- package/_assets/{ItemDetail-CqkeMLxu.js → ItemDetail-KjO5zo9p.js} +326 -491
- package/_assets/ItemPreview.styles-Cb0L-oUy.js +166 -0
- package/_assets/LoadMore-CUa0BsTv.js +7 -0
- package/_assets/ManaPricingBanner.styles-D8qXS7kM.js +74 -0
- package/_assets/{MenuList-D4kLbIwO.js → MenuList-BrAB8iKy.js} +2 -2
- package/_assets/{MyAssets-v3gryjCk.js → MyAssets-BOrcLKie.js} +2 -2
- package/_assets/{MyFavorites-Bg2hc3VG.js → MyFavorites-D9J7HO-j.js} +3 -3
- package/_assets/{NetworkUtil-Dh3JWXso.js → NetworkUtil-EoWQDMpU.js} +1 -1
- package/_assets/{NotFound-R9sTwMQk.js → NotFound-DOxwZxko.js} +1 -1
- package/_assets/NotificationsBell-DRP3FzbO.js +34 -0
- package/_assets/OutfitDetail-C5eyGpEA.js +357 -0
- package/_assets/OutfitPreview-BL8cCtEn.js +6 -0
- package/_assets/OutfitStudio-D_CB2QVA.js +500 -0
- package/_assets/{StoreSettings-GYoZCBBR.js → StoreSettings-B6o_W0eW.js} +1 -1
- package/_assets/{Success-CGQGJeM-.js → Success-CXS2Dcqd.js} +5 -5
- package/_assets/{SwapController-BcfprLwB.js → SwapController-B4ZfPAwx.js} +1 -1
- package/_assets/{Tooltip-CoMCVLgL.js → Tooltip-bl4-JEoI.js} +1 -1
- package/_assets/{TradeService-Be5Jm26-.js → TradeService-DDRO-auD.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BLAdE798.js → W3MFrameProviderSingleton-CNMm9yRj.js} +3 -3
- package/_assets/{WebCryptoP256-B2g3GckQ.js → WebCryptoP256-B6pqCsYE.js} +1 -1
- package/_assets/{authorizations-FkFZVBeE.js → authorizations-CYYNI-9S.js} +1 -1
- package/_assets/{basic-DEelCa7C.js → basic-C44jT8B4.js} +1 -1
- package/_assets/{biconomy-BuAmKMqp.js → biconomy-eZih2UZJ.js} +1 -1
- package/_assets/browseLayout.styles-CrLB3Lke.js +91 -0
- package/_assets/{browser-CMge1DAk.js → browser-CqsLPmeb.js} +1 -1
- package/_assets/{browser-ponyfill-DdemUjDS.js → browser-ponyfill-I5CKtKME.js} +1 -1
- package/_assets/{builder-Z4iUHEpn.js → builder-WW8inl03.js} +1 -1
- package/_assets/{buy-DiLzTHFT.js → buy-D9SdPT0I.js} +1 -1
- package/_assets/{buy-gasless-Cn4_YLUa.js → buy-gasless-ByVYfkrv.js} +1 -1
- package/_assets/{categories-Byz019bF.js → categories-koDpxIGQ.js} +3 -3
- package/_assets/{ccip-DUqe0wPP.js → ccip-BpZ0kBt9.js} +1 -1
- package/_assets/{ccip-CCZIckpG.js → ccip-DecJozf8.js} +1 -1
- package/_assets/{chains-DwiEm2Ny.js → chains-DPlhC0Sw.js} +1 -1
- package/_assets/{clsx-sy6nSRXN.js → clsx-_vaSICRo.js} +2 -2
- package/_assets/{common-ChK99Sbg.js → common-CNwVQ4p9.js} +1 -1
- package/_assets/{controller-D2U901D4.js → controller-CiF4NSKd.js} +2 -2
- package/_assets/{core-BqndrHwC.js → core-DH1NTGuy.js} +4 -4
- package/_assets/{createSvgIcon-nAlfqqgf.js → createSvgIcon-CUzS88Su.js} +3 -3
- package/_assets/{custom-DJvYgxJy.js → custom-CuL2B_VD.js} +1 -1
- package/_assets/{data-capture-CLOU8jih.js → data-capture-BbHnyf8W.js} +1 -1
- package/_assets/{dcl-schemas-BICTSpB5.js → dcl-schemas-Dr9BTjb7.js} +1 -1
- package/_assets/{decimals-C49MnWnC.js → decimals-B3pg7hp8.js} +1 -1
- package/_assets/decimals-BpjIyOut.js +1 -0
- package/_assets/{detectExtension-Bs6N_T7E.js → detectExtension-DEjVJeUh.js} +1 -1
- package/_assets/disposePreview-DIA1G1eQ.js +1 -0
- package/_assets/{email-BxF_EMmd.js → email-D8w7eAFp.js} +1 -1
- package/_assets/{embedded-wallet-6IYwV5B_.js → embedded-wallet-DGxnQp0J.js} +1 -1
- package/_assets/emotion-styled.browser.esm-COxDrE1C.js +1 -0
- package/_assets/{engine-CDTFOGA6.js → engine-B5M1X4Zk.js} +1 -1
- package/_assets/{errors-sJnX14Ki.js → errors-boW7-tfx.js} +1 -1
- package/_assets/estimate-l1-fee-Zly2VYMS.js +1 -0
- package/_assets/eth_estimateGas-BmR_JMy9.js +1 -0
- package/_assets/{eth_getStorageAt-g-V8ByC9.js → eth_getStorageAt-BUYdIAYw.js} +1 -1
- package/_assets/eth_getTransactionCount-riJ8hG2K.js +1 -0
- package/_assets/{ethereum-DdnrEX6r.js → ethereum-CliiIOgc.js} +1 -1
- package/_assets/{ethers-rFeF6PNV.js → ethers-CtNGBird.js} +1 -1
- package/_assets/{execute-D8YtDqpj.js → execute-BTxBSnXr.js} +2 -2
- package/_assets/{extractIPFS-DiQ3ktqZ.js → extractIPFS-CUaS-9Rs.js} +1 -1
- package/_assets/{features-B8MZg8q9.js → features-DqfGz-fi.js} +1 -1
- package/_assets/{fetchTokenMetadata-Cn6UkNbd.js → fetchTokenMetadata-CGRbolN0.js} +2 -2
- package/_assets/{field.styles-o0yoMx97.js → field.styles-icpuqiLd.js} +1 -1
- package/_assets/{fortmatic-ZrVXe0if.js → fortmatic-EI5cNLV0.js} +1 -1
- package/_assets/{get-bytecode-B5xpAv7a.js → get-bytecode-knYex1Eu.js} +1 -1
- package/_assets/get-ecosystem-wallet-info-zJw2ag43.js +1 -0
- package/_assets/{getBalance-pdi104jy.js → getBalance-CykzuUJG.js} +2 -2
- package/_assets/{getInstalledModules-vRyVzBkY.js → getInstalledModules-tywfzr6y.js} +1 -1
- package/_assets/{getNFT-ChdTpPL_.js → getNFT-DIQvefS-.js} +2 -2
- package/_assets/getNFT-DvHzzPp2.js +1 -0
- package/_assets/{getThemeProps-CFDZlxj4.js → getThemeProps-B3ytv_sA.js} +1 -1
- package/_assets/{grid.styles-DVBPQuRz.js → grid.styles-DY-TUpQG.js} +1 -1
- package/_assets/{hashTypedData-DP9JOjjX.js → hashTypedData-KiRlt_KE.js} +1 -1
- package/_assets/{hashTypedData-2Z2_gEL6.js → hashTypedData-hmAiNCzj.js} +1 -1
- package/_assets/{in-app-CRH3jQep.js → in-app-DwX-TQ4J.js} +1 -1
- package/_assets/{in-app-wallet-calls-Dp9TxCgN.js → in-app-wallet-calls-CeJWzRpW.js} +1 -1
- package/_assets/{index-DaBMwl5V.js → index-0hJ-EeUf.js} +1 -1
- package/_assets/{index-BaUli81x.js → index-2HjgvGE0.js} +1 -1
- package/_assets/{index-Det24uTr.js → index-5hmoUi31.js} +3 -3
- package/_assets/{index-ClSZl7Vh.js → index-707cZyU3.js} +1 -1
- package/_assets/{index-CwLvQ9MJ.js → index-8_Ez2ez1.js} +1 -1
- package/_assets/{index-Csd0nRMS.js → index-8kcK18dY.js} +2 -2
- package/_assets/{index-BRGDK96N.js → index-B8qNqBrK.js} +1 -1
- package/_assets/{index-Dhe2yejG.js → index-BFGZVce1.js} +1 -1
- package/_assets/{index-5o0_4PJn.js → index-BGDkYZ9X.js} +1 -1
- package/_assets/{index-klYUwFTu.js → index-BKiicFqW.js} +1 -1
- package/_assets/{index-B1YUW9FQ.js → index-BZDHc6sA.js} +2 -2
- package/_assets/{index-BWXsvDqD.js → index-BbJIcREt.js} +1 -1
- package/_assets/{index-DDqqXhJL.js → index-BeZANkpU.js} +3 -3
- package/_assets/index-Bg-QKz9Z.js +4 -0
- package/_assets/{index-D29EUWHC.js → index-BxIPGFn3.js} +1 -1
- package/_assets/{index-PfgUlDb3.js → index-BznO72_i.js} +1 -1
- package/_assets/{index-Dz7l4WRb.js → index-CJDQqTIn.js} +1 -1
- package/_assets/{index-BGPVOBHa.js → index-CNepofQh.js} +1 -1
- package/_assets/{index-BZWNTqaV.js → index-CPEUTeuP.js} +1 -1
- package/_assets/{index-jDLQZQqn.js → index-CSlo2BeJ.js} +1 -1
- package/_assets/{index-CJ03r2wd.js → index-CSsIBkjj.js} +1 -1
- package/_assets/{index-DGuNIM9a.js → index-CThPTHFI.js} +1 -1
- package/_assets/{index-6_pDklk8.js → index-CTpdUOYC.js} +1 -1
- package/_assets/{index-Bu5mtkuE.js → index-CUAlYj50.js} +1 -1
- package/_assets/{index-B8_IX_3e.js → index-CXnd9PaX.js} +1 -1
- package/_assets/index-CYA8v3ru.js +2 -0
- package/_assets/{index-BLpG8mks.js → index-C_J3Tg-X.js} +1 -1
- package/_assets/{index-DHFAjoyI.js → index-C_k6QnYS.js} +1 -1
- package/_assets/index-CcbRdBPP.js +1 -0
- package/_assets/{index-DkdxS38k.js → index-CjpWKs8Q.js} +1 -1
- package/_assets/{index-DquJiMJI.js → index-ClhaoFwr.js} +1 -1
- package/_assets/{index-Duy_bLYT.js → index-CljY6PrF.js} +1 -1
- package/_assets/{index-CY1VUN_S.js → index-CrudFoei.js} +1 -1
- package/_assets/{index-DXe1QzPN.js → index-Cz8ctv2n.js} +1 -1
- package/_assets/{index-D3OKsJLK.js → index-D5pWb9fn.js} +1 -1
- package/_assets/{index-BUbZ4ieP.js → index-DG6oakSS.js} +1 -1
- package/_assets/{index-CCoJpS6M.js → index-DI-3MKLG.js} +1 -1
- package/_assets/{index-D0JhTMR7.js → index-DM4q9M_E.js} +1 -1
- package/_assets/{index-DkmumT6q.js → index-DMpkdgJ2.js} +1 -1
- package/_assets/{index-DitauyL5.js → index-DQRRTksr.js} +1 -1
- package/_assets/{index-Rjrwrr8k.js → index-DQvmiIO9.js} +1 -1
- package/_assets/{index-hBIDXrfA.js → index-DRYUJJ5d.js} +1 -1
- package/_assets/{index-C4AfvPtb.js → index-Db8XAM6H.js} +1 -1
- package/_assets/{index-DbyPzhzJ.js → index-DdyXqr-l.js} +1 -1
- package/_assets/{index-BszwI7-F.js → index-DftqIOqz.js} +1 -1
- package/_assets/{index-BtkxBg3h.js → index-DhNBmPpe.js} +2 -2
- package/_assets/{index-D9Dv7ZRq.js → index-DrLsGQFY.js} +1 -1
- package/_assets/index-DubLtINT.js +3260 -0
- package/_assets/{index-CsEaqK5K.js → index-L36hhrTC.js} +1 -1
- package/_assets/{index-efx_UGwj.js → index-OzGvz8K0.js} +3 -3
- package/_assets/{index-C-E_Jk-6.js → index-PWgePIOy.js} +1 -1
- package/_assets/index-RLaXeWRK.js +1 -0
- package/_assets/{index-CDCj0Qak.js → index-_H6tRTcn.js} +2 -2
- package/_assets/{index-CyyhNrl2.js → index-bMsIU7Dw.js} +1 -1
- package/_assets/{index-72R1sLRe.js → index-dG4ogQCm.js} +1 -1
- package/_assets/{index-CYEynknO.js → index-kUOBQ2KK.js} +1 -1
- package/_assets/{index-UOQDoXBN.js → index-kibPayQR.js} +1 -1
- package/_assets/{index-BtLL7F-4.js → index-l92NuJVf.js} +1 -1
- package/_assets/{index-BkP6Akod.js → index-lSNqSHBI.js} +1 -1
- package/_assets/{index-CZQ-Avg8.js → index-ocDIHs1j.js} +1 -1
- package/_assets/{index-BHMMC_4O.js → index-qsorFlMF.js} +1 -1
- package/_assets/{index-ThwwXj7K.js → index-uNbynO8A.js} +1 -1
- package/_assets/{index-CBrp3dUZ.js → index-zgoTY9Mb.js} +1 -1
- package/_assets/{index.es-DWEmsLX5.js → index.es-C_UXSWig.js} +4 -4
- package/_assets/{index.es-gS9A1DPX.js → index.es-DGFKmGxx.js} +1 -1
- package/_assets/{index.es-CWcx_MPC.js → index.es-DQ3AciL_.js} +1 -1
- package/_assets/{index.es-DGdQax5Y.js → index.es-zHc4Qg3k.js} +1 -1
- package/_assets/{linkAccount-DktwtO-V.js → linkAccount-BodpWbRq.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DoA6w-sg.js → localBatchGatewayRequest-CCfsw-I3.js} +1 -1
- package/_assets/{mana-convert-8bdglmK2.js → mana-convert-C1xSiqqu.js} +1 -1
- package/_assets/{mana-rate-pg062I50.js → mana-rate-BpHfe_iw.js} +1 -1
- package/_assets/{native-DUHK6GYV.js → native-DfrS-44q.js} +1 -1
- package/_assets/{networks-CS3wn-YQ.js → networks-BV-X4qTe.js} +1 -1
- package/_assets/{onramp-_fU1CUPx.js → onramp-B_uKFllv.js} +1 -1
- package/_assets/{openzeppelin-Byo7VjiL.js → openzeppelin-Cls--iTO.js} +1 -1
- package/_assets/{ownerOf-9FPRCliB.js → ownerOf-Dw2VC0ue.js} +1 -1
- package/_assets/parseNft-Bnklm1HN.js +2 -0
- package/_assets/{parseSignature-7zbxP3S5.js → parseSignature-B03xBRZR.js} +3 -3
- package/_assets/{parseSignature-B4bdR_8K.js → parseSignature-CGE07wnH.js} +1 -1
- package/_assets/{passkeys--fWD2NEw.js → passkeys-uRKe3IGl.js} +1 -1
- package/_assets/{pay-with-exchange-Dk9Xcd3H.js → pay-with-exchange-ClC7J5eZ.js} +1 -1
- package/_assets/{prepare-contract-call-CUP20AbD.js → prepare-contract-call-BnXbUbQT.js} +1 -1
- package/_assets/{qr-overlay-DkdnRl_0.js → qr-overlay-B49rbQOU.js} +3 -3
- package/_assets/{react-IQWs2nb4.js → react-DehiWSvs.js} +1 -1
- package/_assets/{receive-C29mXrSs.js → receive-D5yoBmvW.js} +1 -1
- package/_assets/{resolveImplementation-Brjkq9B3.js → resolveImplementation-zUXnrfgu.js} +1 -1
- package/_assets/{rpc-Oikc4qrs.js → rpc-D5nQZP6e.js} +1 -1
- package/_assets/{secp256k1-WT42JaIN.js → secp256k1-C--Hpe6V.js} +1 -1
- package/_assets/{secp256k1-v_OYVKpT.js → secp256k1-CeWXTOjm.js} +1 -1
- package/_assets/{secp256k1-CUWzbXuP.js → secp256k1-dQSlTzqe.js} +1 -1
- package/_assets/{send-CSdyFqol.js → send-DnOBdj_w.js} +1 -1
- package/_assets/{send-batch-transaction-BlExRlz8.js → send-batch-transaction-DcYpxyD8.js} +1 -1
- package/_assets/{send-eip712-transaction-DyfTHBv1.js → send-eip712-transaction-DEyxEhYn.js} +2 -2
- package/_assets/send-gasless-transaction-B0KoDSZI.js +2 -0
- package/_assets/{send-transaction-kmfCvyrI.js → send-transaction-DLrp33Ay.js} +2 -2
- package/_assets/{sendMetaTransaction-BA-2MGdZ.js → sendMetaTransaction-CgzqVu54.js} +1 -1
- package/_assets/{sendRawTransaction-CTjGjbSv.js → sendRawTransaction-B8yZxOzl.js} +3 -3
- package/_assets/{sentry-DvOx8Rfb.js → sentry-973sfbO9.js} +1 -1
- package/_assets/{serializeTransaction-BmaoI9rx.js → serializeTransaction-BoUYQ-jQ.js} +1 -1
- package/_assets/{session-proposal-nGkLb8fO.js → session-proposal-DMzEaWkq.js} +1 -1
- package/_assets/{session-request-QSI6Jos8.js → session-request-CtZEDQ6h.js} +2 -2
- package/_assets/{sha256-Dx4Jqb1P.js → sha256--PXCNFKm.js} +1 -1
- package/_assets/{signing-VekuwpLK.js → signing-DTUoW6Aq.js} +3 -3
- package/_assets/{socials-BkZgS9yz.js → socials-B0V1ulX-.js} +1 -1
- package/_assets/{swaps-CAZTnQ-D.js → swaps-CIG58tbY.js} +1 -1
- package/_assets/{thirdweb-Xk7WShny.js → thirdweb-CFdrUc0X.js} +3 -3
- package/_assets/{to-serializable-transaction-C5BoASVF.js → to-serializable-transaction-BzLjLX_S.js} +2 -2
- package/_assets/{totalSupply-CLQexq9U.js → totalSupply-DEpB2B-R.js} +1 -1
- package/_assets/{trade-encoding-DgV-A2zO.js → trade-encoding-BJEZpBsE.js} +1 -1
- package/_assets/{transaction-ToPxlTkC.js → transaction-BRB0QRZP.js} +1 -1
- package/_assets/{transactionReceipt-BHGI1PBX.js → transactionReceipt-BaDMkEKJ.js} +1 -1
- package/_assets/{transactions-paKZZL-W.js → transactions-DbSW24RG.js} +1 -1
- package/_assets/useCreditPacks-B9dcdQRV.js +1 -0
- package/_assets/useInfiniteGrid-DY2zLmAX.js +1 -0
- package/_assets/useManaRate-GUe-CE9q.js +1 -0
- package/_assets/{useSecondarySales-3tEx5YvY.js → useSecondarySales-T5w4v68V.js} +1 -1
- package/_assets/{useStore-ByHpJuVH.js → useStore-Br1E1f__.js} +2 -2
- package/_assets/useTheme-CwpMDe-4.js +1 -0
- package/_assets/{utils-BgbaLlfC.js → utils-B9hEgCzc.js} +1 -1
- package/_assets/{verifyHash-uE8nq1-h.js → verifyHash-B4t13z9H.js} +1 -1
- package/_assets/{w3m-modal-BWkASM7Q.js → w3m-modal-BH1vdfAR.js} +1 -1
- package/_assets/{w3m-modal-CIhzAZkD.js → w3m-modal-BqfbNw0J.js} +1 -1
- package/_assets/{wait-for-tx-receipt-Ban9Kz9f.js → wait-for-tx-receipt-mlGWyLwH.js} +1 -1
- package/_assets/{wallets-COZ4xX__.js → wallets-Ci88s6wU.js} +5 -5
- package/_assets/{web-connector-gi_cmfjU.js → web-connector-8oIz3OFz.js} +3 -3
- package/_assets/{writeContract-MVlwq6Xg.js → writeContract-f90YYlnO.js} +1 -1
- package/_assets/{zora-sepolia-BOt0KLBF.js → zora-sepolia-Dv22rzxP.js} +1 -1
- package/_assets/{zoraTestnet-BcRH2RHD.js → zoraTestnet-IkEqWruQ.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/LoadMore-BolkAKn7.js +0 -7
- package/_assets/ManaPricingBanner.styles-DKUacHFQ.js +0 -74
- package/_assets/NotificationsBell-BoefPrvQ.js +0 -34
- package/_assets/browseLayout.styles-6Bx0cPB_.js +0 -91
- package/_assets/decimals-DenLQ0L2.js +0 -1
- package/_assets/emotion-styled.browser.esm-9O-_UQ_M.js +0 -1
- package/_assets/estimate-l1-fee-B4XbNvFY.js +0 -1
- package/_assets/eth_estimateGas-DaegCW9w.js +0 -1
- package/_assets/eth_getTransactionCount-ChnmCar0.js +0 -1
- package/_assets/get-ecosystem-wallet-info-DyEERgSx.js +0 -1
- package/_assets/getNFT-JwHQ_s5F.js +0 -1
- package/_assets/index--coIj_2Q.js +0 -4
- package/_assets/index-B2O7rGJL.js +0 -1
- package/_assets/index-Bbgy14tN.js +0 -1
- package/_assets/index-BiIZh9R9.js +0 -2820
- package/_assets/index-XMkvXJnG.js +0 -2
- package/_assets/parseNft-f2SijHni.js +0 -2
- package/_assets/send-gasless-transaction-Daukbk69.js +0 -2
- package/_assets/useCreditPacks-CaE-vAPX.js +0 -1
- package/_assets/useInfiniteGrid-CeEt3Zid.js +0 -1
- package/_assets/useManaRate-D4_9UlI5.js +0 -1
- package/_assets/useTheme-xAwBEFWH.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j,j as e,L as Q,a as dt}from"./react-
|
|
1
|
+
import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bl as lt,s as l,t as o,k as ut,B as ht,m as xt,e as d,n as mt,u as v,I as f,bm as G,bn as K,bo as pt,p as k,bp as gt,b1 as T,ao as ft,bq as bt,br as C}from"./index-DubLtINT.js";import{a as yt}from"./mana-convert-C1xSiqqu.js";import{u as jt}from"./useManaRate-GUe-CE9q.js";import{L as vt}from"./LoadMore-CUa0BsTv.js";import{u as b}from"./useInfiniteGrid-DY2zLmAX.js";import{m as X}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-rate-BpHfe_iw.js";const kt=15e3;function It(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=kt}function At(t){const n=[...t].sort((i,a)=>a.createdAt-i.createdAt),s=[];for(const i of n){const a=s[s.length-1];a&&It(a[a.length-1],i)?a.push(i):s.push([i])}return s.map(i=>{var a;return{id:((a=i.find(c=>c.txHash))==null?void 0:a.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,h)=>c+h.credits,0),lines:i}})}function wt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function $t(t){const n=[],s=new Map;for(const i of t){const a=wt(i);if(!a){n.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=s.get(a);if(c){c.quantity+=1,c.credits+=i.credits;continue}const h={key:a,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};s.set(a,h),n.push(h)}return n}function Pt(t,n){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:n?yt(t.manaWei,n):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Lt(t){const s=At(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=t.sales.map(r=>{const x=Pt(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),a=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...i,...a,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Nt(t,n){return n==="all"?t:n==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const Z=t=>t.trim().toLowerCase();function Et(t){const n=new Map;for(const s of t??[]){const i=Z(s.txHash??"");if(!i)continue;const a=n.get(i);a?a.push(s):n.set(i,[s])}return n}function Tt(t,n,s=Date.now()){const i=n.txHash?t.get(Z(n.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const a=i.length===1?Ct(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:a};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:a,availableAt:h}}function Ct(t){return lt(t)}const Ft="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/credits-product-vs4Q6u6l.svg",F=ut`
|
|
2
2
|
0% { background-position: 200% 0; }
|
|
3
3
|
100% { background-position: -200% 0; }
|
|
4
4
|
`,St=l.section`
|
|
@@ -93,7 +93,7 @@ import{r as j,j as e,L as Q,a as dt}from"./react-IQWs2nb4.js";import{aL as lt,s
|
|
|
93
93
|
/* Pin to the right regardless of how many elements sit on the left (the credit-purchase card adds a
|
|
94
94
|
leading thumbnail, giving the head three children instead of two). */
|
|
95
95
|
margin-left: auto;
|
|
96
|
-
`,
|
|
96
|
+
`,qt=l.div`
|
|
97
97
|
flex: 0 0 auto;
|
|
98
98
|
width: 52px;
|
|
99
99
|
height: 52px;
|
|
@@ -150,11 +150,11 @@ import{r as j,j as e,L as Q,a as dt}from"./react-IQWs2nb4.js";import{aL as lt,s
|
|
|
150
150
|
&[data-kind='income'] {
|
|
151
151
|
color: ${o.colors.okStrong};
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,J=l.img`
|
|
154
154
|
width: 16px;
|
|
155
155
|
height: 16px;
|
|
156
156
|
vertical-align: -0.15em;
|
|
157
|
-
`,
|
|
157
|
+
`,Ot=l.span`
|
|
158
158
|
display: inline-flex;
|
|
159
159
|
align-items: center;
|
|
160
160
|
cursor: pointer;
|
|
@@ -235,7 +235,7 @@ import{r as j,j as e,L as Q,a as dt}from"./react-IQWs2nb4.js";import{aL as lt,s
|
|
|
235
235
|
white-space: nowrap;
|
|
236
236
|
overflow: hidden;
|
|
237
237
|
text-overflow: ellipsis;
|
|
238
|
-
`,
|
|
238
|
+
`,q=l.span`
|
|
239
239
|
display: inline-block;
|
|
240
240
|
width: 140px;
|
|
241
241
|
max-width: 60%;
|
|
@@ -248,10 +248,10 @@ import{r as j,j as e,L as Q,a as dt}from"./react-IQWs2nb4.js";import{aL as lt,s
|
|
|
248
248
|
@media (prefers-reduced-motion: reduce) {
|
|
249
249
|
animation: none;
|
|
250
250
|
}
|
|
251
|
-
`,
|
|
251
|
+
`,O=l.span`
|
|
252
252
|
font-size: 13px;
|
|
253
253
|
color: ${o.colors.muted};
|
|
254
|
-
`,
|
|
254
|
+
`,Bt=l.div`
|
|
255
255
|
display: flex;
|
|
256
256
|
align-items: center;
|
|
257
257
|
gap: 4px;
|
|
@@ -274,7 +274,7 @@ import{r as j,j as e,L as Q,a as dt}from"./react-IQWs2nb4.js";import{aL as lt,s
|
|
|
274
274
|
@media (prefers-reduced-motion: reduce) {
|
|
275
275
|
animation: none;
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,V=l.div`
|
|
278
278
|
display: flex;
|
|
279
279
|
flex-direction: column;
|
|
280
280
|
align-items: center;
|
|
@@ -282,10 +282,10 @@ import{r as j,j as e,L as Q,a as dt}from"./react-IQWs2nb4.js";import{aL as lt,s
|
|
|
282
282
|
text-align: center;
|
|
283
283
|
padding: 90px 20px;
|
|
284
284
|
min-height: 50vh;
|
|
285
|
-
`,
|
|
285
|
+
`,Y=l.p`
|
|
286
286
|
font-size: 22px;
|
|
287
287
|
font-weight: 700;
|
|
288
288
|
margin: 6px 0 0;
|
|
289
|
-
`,
|
|
289
|
+
`,Rt=l(ht)`
|
|
290
290
|
margin-top: 12px;
|
|
291
|
-
`,W=E.withComponent(Q),
|
|
291
|
+
`,W=E.withComponent(Q),y=24,Gt=["all","purchases","sales"];function g(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function tt(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function et(t){const n=Number(t)/1e18;return Number.isFinite(n)?n.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const n=j.useRef(null),[s,i]=j.useState(null),a=()=>{var h;const c=(h=n.current)==null?void 0:h.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(Ot,{ref:n,tabIndex:0,onMouseEnter:a,onMouseLeave:()=>i(null),onFocus:a,onBlur:()=>i(null),children:[t,s?dt.createPortal(e.jsx(Wt,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Kt({item:t}){const n=!!t.contractAddress&&!!t.itemId,s=!!t.tradeId||n,{data:i,isLoading:a}=v({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?bt(t.tradeId):C(t.contractAddress,{itemId:t.itemId}),enabled:s,staleTime:5*6e4}),c=s&&a,h=(i==null?void 0:i.name)??d("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",x=T({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,p=e.jsxs(e.Fragment,{children:[c?e.jsx(D,{}):e.jsx(M,{children:r?e.jsx("img",{src:r,alt:h}):e.jsx(f,{name:"cart",size:20})}),e.jsxs(H,{children:[c?e.jsx(q,{}):e.jsx(z,{title:h,children:h}),t.quantity>1?e.jsx(O,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(Bt,{children:[e.jsx(k,{className:"ccy-mark"})," ",t.credits]})]});return x?e.jsx(W,{to:x,"data-link":"true",children:p}):e.jsx(E,{children:p})}function _t({order:t}){const n=$t(t.lines),s=n.reduce((i,a)=>i+a.quantity,0);return e.jsxs(I,{"data-testid":"purchase-order",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsxs(P,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:s})]})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(m,{children:[e.jsx(k,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(S,{children:n.map(i=>e.jsx(Kt,{item:i},i.key))})]})}function Ut({sale:t}){const{data:n,isLoading:s}=v({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>C(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(n==null?void 0:n.name)??d("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",c=T({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[s?e.jsx(D,{}):e.jsx(M,{children:a?e.jsx("img",{src:a,alt:i}):e.jsx(f,{name:"offer",size:20})}),e.jsxs(H,{children:[s?e.jsx(q,{}):e.jsx(z,{title:i,children:i}),e.jsx(O,{children:d("activity.boughtFrom",{account:tt(t.seller)})})]})]});return e.jsxs(I,{"data-testid":"activity-mana-purchase",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsx(P,{children:d("activity.paidWithMana")})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(m,{children:[et(t.manaWei)," ",e.jsx(it,{children:e.jsx(J,{src:X,alt:"MANA"})})]})]})]}),e.jsx(S,{children:c?e.jsx(W,{to:c,"data-link":"true",children:h}):e.jsx(E,{children:h})})]})}function Qt({sale:t,payout:n}){const{data:s,isLoading:i}=v({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>C(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),a=(s==null?void 0:s.name)??d("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",h=T({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[i?e.jsx(D,{}):e.jsx(M,{children:c?e.jsx("img",{src:c,alt:a}):e.jsx(f,{name:"offer",size:20})}),e.jsxs(H,{children:[i?e.jsx(q,{}):e.jsx(z,{title:a,children:a}),e.jsxs(O,{children:[d("activity.soldTo",{account:tt(t.counterparty)}),n.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:g(n.availableAt)})}`:""]})]})]});return e.jsxs(I,{"data-testid":"activity-sale",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsx(P,{children:d("activity.saleLabel")})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":n.kind==="pending"?"PENDING":"SOLD",children:n.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),n.kind==="direct"?e.jsxs(m,{"data-kind":"income",children:["+",et(t.manaWei)," ",e.jsx(it,{children:e.jsx(J,{src:X,alt:"MANA"})})]}):n.credits!==null?e.jsxs(m,{"data-kind":"income",children:[e.jsx(k,{className:"ccy-mark"})," +",ft(n.credits)]}):e.jsx(m,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(S,{children:h?e.jsx(W,{to:h,"data-link":"true",children:r}):e.jsx(E,{children:r})})]})}function Xt({order:t}){const n=`$${(t.usdCents/100).toFixed(2)}`,s=gt(t.status),i=s==="SETTLED"?d("activity.completed"):s==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(I,{"data-testid":"credit-order",children:e.jsxs(A,{children:[e.jsx(qt,{children:e.jsx("img",{src:Ft,alt:"","aria-hidden":!0})}),e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsxs(P,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:n})]})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":s,children:i}),e.jsxs(m,{"data-kind":"income",children:["+",e.jsx(k,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Zt({filter:t}){const n={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[t];return e.jsxs(V,{children:[e.jsx(f,{name:n.icon,size:40,color:o.colors.muted2}),e.jsx(Y,{children:n.title}),e.jsx("p",{className:"muted",children:n.body}),t!=="sales"?e.jsx(Rt,{as:Q,to:"/assets",variant:"purple",children:d("notFound.cta")}):null]})}function de(){xt({title:d("nav.activity"),noindex:!0});const{session:t}=mt(),[n,s]=j.useState("all"),i=!!t&&n!=="sales",a=!!t&&n!=="purchases",c=b(["purchases",t==null?void 0:t.address],u=>pt(t.address,t.identity,{first:y,skip:u}),{enabled:i}),h=b(["sales",t==null?void 0:t.address],u=>G(t.address,{role:"seller",first:y,skip:u}),{enabled:a}),r=b(["credit-orders",t==null?void 0:t.address],u=>K(t.address,t.identity,{first:y,skip:u}),{enabled:i}),x=b(["mana-purchases",t==null?void 0:t.address],u=>G(t.address,{role:"buyer",first:y,skip:u}),{enabled:i}),{data:p}=v({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>K(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:a,staleTime:6e4}),nt=j.useMemo(()=>Et(p),[p]),{data:st}=jt(a);if(!t)return e.jsxs(V,{children:[e.jsx(f,{name:"clock",size:40,color:o.colors.muted2}),e.jsx(Y,{children:d("activity.signInTitle")}),e.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const B=Nt(Lt({purchases:i?c.items:[],sales:a?h.items:[],creditOrders:i?r.items:[],manaPurchases:i?x.items:[],rate:st}),n),at=i&&(c.isLoading||r.isLoading||x.isLoading)||a&&h.isLoading,R=i&&(c.isFetchingNextPage||r.isFetchingNextPage||x.isFetchingNextPage)||a&&h.isFetchingNextPage,rt=i&&(c.hasNextPage||r.hasNextPage||x.hasNextPage)||a&&h.hasNextPage;function ot(){i&&c.hasNextPage&&c.fetchNextPage(),i&&r.hasNextPage&&r.fetchNextPage(),i&&x.hasNextPage&&x.fetchNextPage(),a&&h.hasNextPage&&h.fetchNextPage()}return e.jsxs(St,{children:[e.jsx(Mt,{children:e.jsx(Dt,{children:d("nav.activity")})}),e.jsx(Ht,{role:"tablist","aria-label":d("nav.activity"),children:Gt.map(u=>e.jsx(zt,{type:"button",role:"tab","aria-selected":n===u,"data-active":n===u,"data-testid":`activity-filter-${u}`,onClick:()=>s(u),children:d(`activity.filter.${u}`)},u))}),at?e.jsx(_,{children:Array.from({length:5}).map((u,ct)=>e.jsx(U,{},ct))}):B.length===0?e.jsx(Zt,{filter:n}):e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[B.map(u=>u.kind==="purchase"?e.jsx(_t,{order:u.order},u.id):u.kind==="credit"?e.jsx(Xt,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ut,{sale:u.sale},u.id):e.jsx(Qt,{sale:u.sale,payout:Tt(nt,u.sale)},u.id)),R?e.jsx(U,{}):null]}),e.jsx(vt,{hasNextPage:rt,isFetching:R,onLoadMore:ot})]})]})}export{de as Activity};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-
|
|
1
|
+
import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-DubLtINT.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -94,4 +94,4 @@ void main() {
|
|
|
94
94
|
inset: 0;
|
|
95
95
|
width: 100%;
|
|
96
96
|
height: 100%;
|
|
97
|
-
`;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,
|
|
97
|
+
`;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,S,()=>d),b=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},w=performance.now()/1e3,h=()=>{b(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-w),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${A})`}}),v.jsx(I,{ref:t})]})}export{G as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6 as Xe,b7 as Ye,d as et,s,t,n as Be,aZ as tt,q as nt,ao as ge,e as n,o as st,I as S,p as M,bu as ne,aY as ot,O as Y,ba as it,b9 as rt,m as Fe,aa as at,ac as Te,ad as q,aq as lt,bv as ct}from"./index-DubLtINT.js";import{u as dt}from"./useSecondarySales-T5w4v68V.js";import{m as pt,a as Le}from"./mana-convert-C1xSiqqu.js";import{u as Ue}from"./useManaRate-GUe-CE9q.js";import{g as ht,h as xt,i as mt,j as ft,k as ut,C as gt,l as bt,o as yt,m as wt,n as jt,M as vt,p as $t,E as Ct,q as kt,r as St,s as Et,t as Rt,u as Tt,v as _t}from"./Assets.styles-Cxk14RF3.js";import{S as _e,R as zt,F as It,e as At}from"./categories-koDpxIGQ.js";import{L as Nt}from"./LoadMore-CUa0BsTv.js";import{u as Mt}from"./useInfiniteGrid-DY2zLmAX.js";import{E as Pt}from"./ErrorNotice-D6-7YD_C.js";import{d as Wt}from"./dcl-schemas-Dr9BTjb7.js";import{s as Bt,G as Ft,w as Lt,S as Ut}from"./buy-gasless-ByVYfkrv.js";import{s as Ht}from"./buy-D9SdPT0I.js";import{i as Ot}from"./trade-encoding-BJEZpBsE.js";import{r as Gt}from"./mana-rate-BpHfe_iw.js";import{f as Dt}from"./errors-boW7-tfx.js";import{J as qt,C as Vt,B as be}from"./ethers-CtNGBird.js";import{n as Zt}from"./Tooltip-bl4-JEoI.js";import{G as Kt}from"./grid.styles-DY-TUpQG.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-CYYNI-9S.js";import"./sendMetaTransaction-CgzqVu54.js";function V(o){const i=o.source??"item",a=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${a}`}const L="100000000000000000000",He=2,ee=15,Jt=/^[a-zA-Z0-9]+$/;function ze(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:Jt.test(i)?i.length<He?{ok:!1,reason:"too-short"}:i.length>ee?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Xt=["function available(string _subdomain) view returns (bool)"],Ie={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return F.chainId===Number(Wt.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function en(o,i={}){var p;const{rpc:a,address:h}=Yt(),l=new qt(a),d=new Vt(h,Xt,l);console.info(`[names] availability check → DCLRegistrar(${h}).available("${o}") on ${a}`);const x=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${x}`),x?"available":"taken"}const tn="https://app.across.to/api";class ye extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(o){return pt(L,o)}async function sn(o,i,a={}){var p;const h=a.chainId??F.chainId,l=a.provider??"across",d=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${h}&provider=${l}`,x=await et(d,{method:"GET",identity:o,metadata:{}});if(!x.ok){let r;try{r=(p=await x.json())==null?void 0:p.code}catch{}throw r==="ROUTE_COST_TOO_HIGH"?new ye:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function on(o,i){const a=be.from(o.availableAmount),l=be.from(L).sub(a);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ot(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:L}}async function rn(o,i={}){const a=tn,h=i.intervalMs??1e4,l=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const p=await fetch(`${a}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const r=await p.json(),u=(r.status??"pending").toLowerCase(),g=r.fillTx??r.fillTxnRef??null,w=r.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:w}}}catch{}x<l-1&&await new Promise(p=>setTimeout(p,h))}return d}async function an(o){const{name:i,identity:a,signer:h}=o,l=o.chainId??F.chainId,d=o.provider??"across",x=(o.beneficiary??await h.getAddress()).toLowerCase();let p=null,r=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:d});try{const u=await Gt(l),g=nn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await sn(a,i,{chainId:l,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Xe(a,g);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),be.from(j.maxCreditedValue).lt(L))throw new Error("Credit under-sized for the name price");const k=on(j.credit,w);let m;try{m=await Bt({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Ft))throw b;m=await Ht(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:m}),await Lt(m),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:m}),d==="across"){const b=await rn(m,o.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:m};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:m,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:m}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:x,originConfirmed:r}),u instanceof Ut)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Ye(a,[p]).catch(()=>{}),u instanceof ye)throw u;const g=new Error(Dt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=u,g}}const ln=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -379,7 +379,7 @@ import{b as We,r as f,j as e,e as Qe}from"./react-IQWs2nb4.js";import{c as F,au
|
|
|
379
379
|
color: ${t.colors.accent};
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
`;function En({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=f.useState("confirm"),[g,w]=f.useState(""),[j,k]=f.useState(null),m=f.useRef(!1),b=g.trim().toLowerCase()===o.toLowerCase(),v=r==="completing",E=i!=null?ge(i):"—",C=i==null,
|
|
382
|
+
`;function En({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=f.useState("confirm"),[g,w]=f.useState(""),[j,k]=f.useState(null),m=f.useRef(!1),b=g.trim().toLowerCase()===o.toLowerCase(),v=r==="completing",E=i!=null?ge(i):"—",C=i==null,_=l==null?void 0:l.credits,R=i!=null&&_!=null?i-_:0,$=R>0,z=C?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:ge(R)}):null;f.useEffect(()=>{const y=H=>{H.key==="Escape"&&!v&&a()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[v,a]);async function I(){if(!(!h||!b||C||$||m.current)){m.current=!0,u("completing"),k(null);try{const y=await an({name:o,identity:h.identity,signer:h.signer});Y("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:y.status}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),u(y.status==="registered"?"success":"pending")}catch(y){Y(rt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:it(y),purchase_type:"name"}),k(y instanceof ye?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),u("error")}finally{m.current=!1}}}const A=r!=="success"&&r!=="pending",te=st(h==null?void 0:h.providerType);return e.jsx(ln,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:r==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:a,disabled:v,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{})]}),(r==="confirm"||r==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),r==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(me,{children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ae,{onClick:()=>u("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Rn(o)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(fn,{value:g,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),z?e.jsxs(me,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:z})]}):null,e.jsx(Ae,{onClick:()=>void I(),disabled:!b||!h||C||$,children:n("names.buyCta")})]})]}),r==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ot,alt:"",width:56,height:56}),e.jsx(yn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),r==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs(me,{"data-tone":"info",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsx(Ne,{children:e.jsx(Me,{onClick:()=>{a(),p("/my-assets")},children:n("names.myItems")})})]}),r==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsxs(Ne,{children:[e.jsx(Me,{onClick:()=>{a(),p("/my-assets")},children:n("names.myItems")}),e.jsx(Sn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Rn(o){return o.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}const Tn="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/identity-B4DXDuJP.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/governance-DnazlIjy.webp",An=s.div`
|
|
383
383
|
width: 100%;
|
|
384
384
|
min-width: 0;
|
|
385
385
|
`,Nn=s.nav`
|
|
@@ -797,4 +797,4 @@ import{b as We,r as f,j as e,e as Qe}from"./react-IQWs2nb4.js";import{c as F,au
|
|
|
797
797
|
clip: rect(0, 0, 0, 0);
|
|
798
798
|
white-space: nowrap;
|
|
799
799
|
border: 0;
|
|
800
|
-
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function ps({onBack:o}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=f.useState(""),[p,r]=f.useState("idle"),[u,g]=f.useState(!1),w=f.useRef(null),[j,k]=f.useState(void 0);f.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),f.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const T=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:T.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),T.abort()}},[d]);const m=ze(d),b=m.ok&&(p==="available"||p==="error");function v(){if(b){if(!i){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(fe,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!m.ok&&m.reason==="too-short"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(os,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ue=48;function Ps(){const[o]=Qe(),i=We(),a=(o.get("q")??"").trim().toLowerCase(),h=(o.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=f.useState("wearable"),[x,p]=f.useState(null),[r,u]=f.useState([]),[g,w]=f.useState(""),[j,k]=f.useState(""),[m,b]=f.useState("on_sale"),[v,E]=f.useState(!1),[C,T]=f.useState("newest"),[R,$]=f.useState(!1);f.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=_}},[R]);const z=m==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=dt(),y=x?At[x]:void 0,U=(Te.find(c=>c.key===C)??Te[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:m==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Mt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=f.useRef(null);f.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=f.useRef("__init__");f.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:m,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:m,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,m,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(_=>_.includes(c)?_.filter(W=>W!==c):[..._,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of zt)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),m!=="on_sale"&&B.push({key:"status",label:m==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ht,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(xt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(ft,{children:[e.jsx(ut,{children:n("assets.filters")}),e.jsx(gt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(bt,{children:e.jsx(yt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:m,onStatus:b,smart:v,onSmart:E})}),e.jsx(wt,{children:e.jsx(jt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(vt,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(It,{sort:C,onSort:T,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx($t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Pt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(Ct,{"data-testid":"browse-empty",children:[e.jsx(kt,{src:hs,alt:""}),e.jsxs(St,{children:[e.jsx(Et,{children:n("assets.empty.title")}),e.jsx(Rt,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(_t,{children:e.jsx(Tt,{type:"button",onClick:()=>i("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(_e,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const _=c;if(_.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(_);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{..._,priceCredits:W}},V(c))}),$e?e.jsx(_e,{count:6}):null]})}),e.jsx(Nt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ps as Assets};
|
|
800
|
+
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function ps({onBack:o}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=f.useState(""),[p,r]=f.useState("idle"),[u,g]=f.useState(!1),w=f.useRef(null),[j,k]=f.useState(void 0);f.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),f.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const _=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:_.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),_.abort()}},[d]);const m=ze(d),b=m.ok&&(p==="available"||p==="error");function v(){if(b){if(!i){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(fe,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!m.ok&&m.reason==="too-short"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(os,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ue=48;function Ps(){const[o]=Qe(),i=We(),a=(o.get("q")??"").trim().toLowerCase(),h=(o.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=f.useState("wearable"),[x,p]=f.useState(null),[r,u]=f.useState([]),[g,w]=f.useState(""),[j,k]=f.useState(""),[m,b]=f.useState("on_sale"),[v,E]=f.useState(!1),[C,_]=f.useState("newest"),[R,$]=f.useState(!1);f.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=T}},[R]);const z=m==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=dt(),y=x?At[x]:void 0,U=(_e.find(c=>c.key===C)??_e[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:m==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Mt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=f.useRef(null);f.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=f.useRef("__init__");f.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:m,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:m,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,m,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(T=>T.includes(c)?T.filter(W=>W!==c):[...T,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of zt)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),m!=="on_sale"&&B.push({key:"status",label:m==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ht,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(xt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(ft,{children:[e.jsx(ut,{children:n("assets.filters")}),e.jsx(gt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(bt,{children:e.jsx(yt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:m,onStatus:b,smart:v,onSmart:E})}),e.jsx(wt,{children:e.jsx(jt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(vt,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(It,{sort:C,onSort:_,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx($t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Pt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(Ct,{"data-testid":"browse-empty",children:[e.jsx(kt,{src:hs,alt:""}),e.jsxs(St,{children:[e.jsx(Et,{children:n("assets.empty.title")}),e.jsx(Rt,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(_t,{type:"button",onClick:()=>i("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(Te,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const T=c;if(T.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(T);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{...T,priceCredits:W}},V(c))}),$e?e.jsx(Te,{count:6}):null]})}),e.jsx(Nt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ps as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,j as t}from"./react-
|
|
1
|
+
import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-koDpxIGQ.js";import{n as c,T as se}from"./Tooltip-bl4-JEoI.js";import{t as e,s as o,I as g,e as s,aa as ae,f as v}from"./index-DubLtINT.js";const re=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i,L as _,r as P}from"./react-
|
|
1
|
+
import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,k as R,m as F,e,n as G,o as O,I as z,p as B,u as w,q as K,c as Q,v as H,w as A,l as X,x as Z,y as T}from"./index-DubLtINT.js";import{a as J,b as U,c as V,d as Y,s as tt,f as it}from"./authorizations-CYYNI-9S.js";import{f as et}from"./builder-WW8inl03.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-boW7-tfx.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CgzqVu54.js";const nt=R`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,st=R`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as Se,r as P,
|
|
1
|
+
import{j as e,L as Se,r as P,d as ea,b as ta}from"./react-DehiWSvs.js";import{t as le,s as i,e as s,ao as de,aY as aa,an as sa,I as O,p as Mt,a9 as Ne,m as na,L as Q,ab as dt,n as ia,u as ra,aZ as oa,q as ca,a_ as da,a$ as la,b0 as ua,b1 as ha,o as pa,b2 as lt,O as G,b3 as ut,b4 as ga,l as ae,c as ht,b5 as xa,f as ma,b6 as pt,b7 as Re,b8 as ye,b9 as be,ba as gt,a as ve,b as fa,C as We,bb as ya}from"./index-DubLtINT.js";import{M as ba,S as va,C as wa,H as Ca,a as ja,T as ka,X as $a,b as Sa,B as Ma,c as Ta,d as xt,e as Ia,f as ke,P as Tt,m as Pa,g as za,h as Aa,i as Ea,j as It,k as $e,L as qa,l as _a,n as mt,o as ft,W as Ba,p as Ra,q as Wa,A as Fa,r as La,s as Ka,t as Ua,u as Na,v as Qa,w as Oa,x as Ha,y as Va,z as Ga,D as Ya,E as Da,F as Ja,G as Xa,I as Za,J as es,K as Fe,N as ts,O as as,Q as ss,R as ns,U as yt,V as bt,Y as is,Z as rs,_ as os}from"./CollectionCarousel-C0LgFQAu.js";import{u as cs}from"./useManaRate-GUe-CE9q.js";import{r as ds}from"./mana-rate-BpHfe_iw.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-CYYNI-9S.js";import{g as ms,b as Le}from"./buy-D9SdPT0I.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-ByVYfkrv.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-B9dcdQRV.js";import{i as ks,a as $s}from"./errors-boW7-tfx.js";import{E as Ss}from"./ErrorNotice-D6-7YD_C.js";import{u as Ct}from"./mana-convert-C1xSiqqu.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BJEZpBsE.js";import"./sendMetaTransaction-CgzqVu54.js";const{colors:se,radius:Ms}=le,Ts=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${se.text};
|
|
60
60
|
}
|
|
61
|
-
`,Es="https://cdn.decentraland.org/@dcl/shop/0.1.1-
|
|
61
|
+
`,Es="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(ba,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(va,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(wa,{"data-tall":D||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:Y}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Sa,{})})]}),e.jsxs(Ma,{children:[e.jsx(Ta,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ia,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(As,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Pa(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Bs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(za,{"data-testid":"buy-error",children:[e.jsx(Aa,{src:Es,alt:"",width:64,height:80}),e.jsxs(Ea,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(qa,{src:aa,alt:"",width:61,height:61}),e.jsx(_a,{children:ne}),Y?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Is,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Bs({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(Ra,{}),e.jsxs(Wa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(Ps,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Fa,{children:[e.jsx(La,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ka,{children:[e.jsxs("div",{children:[e.jsxs(Ua,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(zs,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Na,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Oa,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ha,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Va,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ga,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Da,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Ja,{children:[e.jsxs(Xa,{children:[e.jsx(Za,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(es,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:D,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:Y,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
62
|
max-width: 1510px;
|
|
63
63
|
margin: 0 auto;
|
|
64
64
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -98,7 +98,7 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
98
98
|
${T} {
|
|
99
99
|
display: none;
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,Rs=i.div`
|
|
102
102
|
display: grid;
|
|
103
103
|
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
104
|
gap: 24px;
|
|
@@ -212,7 +212,7 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
212
212
|
outline: 2px solid ${r.accent};
|
|
213
213
|
outline-offset: 2px;
|
|
214
214
|
}
|
|
215
|
-
`,
|
|
215
|
+
`,Os=i.button`
|
|
216
216
|
display: none;
|
|
217
217
|
|
|
218
218
|
${T} {
|
|
@@ -230,7 +230,7 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
230
230
|
height: 20px;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
`,
|
|
233
|
+
`,Hs=i.h1`
|
|
234
234
|
margin: 0;
|
|
235
235
|
font-size: 14px;
|
|
236
236
|
font-weight: 600;
|
|
@@ -478,7 +478,7 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
478
478
|
line-height: 1;
|
|
479
479
|
text-transform: uppercase;
|
|
480
480
|
color: ${r.text2};
|
|
481
|
-
`,pn=i(
|
|
481
|
+
`,pn=i(O)`
|
|
482
482
|
color: #f48221;
|
|
483
483
|
`,gn=i(Se)`
|
|
484
484
|
font-size: 12px;
|
|
@@ -508,7 +508,7 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
508
508
|
font-weight: 400;
|
|
509
509
|
line-height: 14px;
|
|
510
510
|
color: ${r.text};
|
|
511
|
-
`,mn=i(
|
|
511
|
+
`,mn=i(O)`
|
|
512
512
|
width: 11.31px;
|
|
513
513
|
height: 10.94px;
|
|
514
514
|
background: ${r.text};
|
|
@@ -658,13 +658,13 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
658
658
|
opacity: 0.6;
|
|
659
659
|
cursor: default;
|
|
660
660
|
}
|
|
661
|
-
`,
|
|
661
|
+
`,_t=Ne`
|
|
662
662
|
margin: 0;
|
|
663
663
|
font-size: 13px;
|
|
664
664
|
`,Ce=i.p`
|
|
665
|
-
${
|
|
665
|
+
${_t};
|
|
666
666
|
`,In=i(Ss)`
|
|
667
|
-
${
|
|
667
|
+
${_t};
|
|
668
668
|
`,Pn=i.div`
|
|
669
669
|
position: relative;
|
|
670
670
|
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t
|
|
|
692
692
|
& section {
|
|
693
693
|
margin-top: 0;
|
|
694
694
|
}
|
|
695
|
-
`;function Ke(o){if(ks(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ma.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const zn=12e4;function An(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Jn(){na({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),Y=Q(t=>t.restore),D=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ia(),ue=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(t=>t.category!=="emote"),{data:Me}=ra({queryKey:["upsell-listings"],queryFn:()=>ya({first:40}),staleTime:6e4}),{data:$}=oa(n),b=ca(),ee=ea(),{state:J}=ta(),[_t,ie]=P.useState(null),[Qe,he]=P.useState(null),[Wt,B]=P.useState(!1),[R,O]=P.useState(null),He=P.useRef(0),[p,j]=P.useState(null),{data:pe}=da(n),{data:re}=cs(!0),[Te,Oe]=P.useState(""),oe=P.useRef(null),Ve=la(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Ft=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Lt=o.reduce((t,a)=>t+a.quantity,0),Kt=Ie.reduce((t,a)=>t+a.quantity,0),Ye=R?R.liveTotalCredits:Ft,Ut=new Set(o.map(t=>t.id)),De=((Me==null?void 0:Me.items)??[]).filter(t=>!Ut.has(t.id)).slice(0,12),Nt=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=Ye*10,Qt=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Qt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Ot=ga,Vt=t=>xa(t.contractAddress,String(t.itemId));function me(t){t(),O(null),he(null),ie(null)}function Gt(){j(null),B(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Oe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await _e(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ms(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ls()&&!v)try{const m=new Map;f=await fs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>ys(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Re=>S.add(Re)),E.push(f[N])):C.reason instanceof vt||X.forEach(Re=>_.add(Re))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof bs))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>_.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>_.add(x))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),B(!1);const Be={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Be,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!_.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await _e(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),O(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),B(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await gs({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ds(ht.chainId),staleTime:6e4})}catch{return}}async function Dt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Dt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:_}=at(a,t);await st(S,_,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Jt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(fa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=us(a,t),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){B(!1),fe({auth:c,run:d});return}d()}function Xt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await is({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=rs(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),_=os(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:Be}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Be})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&_e(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),B(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await Cs(a,n.address,Ot,await et(),Vt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(An(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),He.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{B(!1)}}async function rt(){if(R){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-He.current>zn){O(null),he(null),await te();return}ie(null),tt(R.buyable)}}async function Zt(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}B(!0);try{const t=await js(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!ts("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&Y(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ls,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Ks,{children:[e.jsx(Us,{children:s("cart.empty.title")}),e.jsx(Ns,{children:s("cart.empty.body")})]}),e.jsx(Qs,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(_s,{children:[e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsx(Hs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Os,{children:s("cart.panelTitle",{count:Lt})}),Rt?e.jsxs(Vs,{onClick:()=>D(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Gs,{children:o.map(t=>{const a=Nt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,_=ua(t),E=!!_&&!!A[_],q=ha(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ys,{"data-unavailable":g||void 0,children:[e.jsxs(Ds,{"data-thumb":!0,children:[q?e.jsx(Js,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Xs,{"data-check":!0,"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(Zs,{children:[e.jsxs(en,{"data-desc":!0,children:[q?e.jsx(an,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(tn,{title:t.name,children:t.name}),t.creator?e.jsx(sn,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(xn,{"data-testid":"cart-creator-tag",children:[e.jsx(mn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(nn,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(hn,{children:[e.jsx(pn,{name:"warning-fill",size:24}),k]}),q?e.jsx(gn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(rn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("cart.decreaseQuantity",{name:t.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(on,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("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(cn,{children:[e.jsx(dn,{})," ",S,c?e.jsx(ln,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(un,{children:[_?e.jsx(fn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(yn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(bn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(vn,{children:[e.jsx(wn,{children:s("cart.purchaseSummary")}),e.jsxs(Cn,{children:[e.jsxs(jn,{children:[e.jsx(kn,{children:s("cart.totalItems",{count:Kt})}),e.jsx(Sn,{children:e.jsxs($n,{children:[e.jsx(Mn,{})," ",Ye]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:R?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(R?rt():te(t))}):e.jsx(Tn,{onClick:()=>void(R?rt():te()),disabled:V||Pe,children:V?s("cart.working"):R?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),R?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(In,{message:_t})]})]})]})]}),De.length>0?e.jsx(Pn,{children:e.jsx(as,{title:s("cart.youMightAlsoLike"),items:De})}):null,qe&&n?e.jsx(ss,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:ns,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(qs,{phase:p.phase,balanceCredits:ge,onClose:Gt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Jt(p).options:void 0,onPay:Xt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:Oe,onBuyPacks:()=>void Zt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Jn as Cart};
|
|
695
|
+
`;function Ke(o){if(ks(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ma.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const zn=12e4;function An(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Jn(){na({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),Y=Q(t=>t.restore),D=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ia(),ue=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:Me}=ra({queryKey:["upsell-listings"],queryFn:()=>ya({first:40}),staleTime:6e4}),{data:$}=oa(n),b=ca(),ee=ea(),{state:J}=ta(),[Rt,ie]=P.useState(null),[Qe,he]=P.useState(null),[Wt,_]=P.useState(!1),[B,H]=P.useState(null),Oe=P.useRef(0),[p,j]=P.useState(null),{data:pe}=da(n),{data:re}=cs(!0),[Te,He]=P.useState(""),oe=P.useRef(null),Ve=la(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Ft=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Lt=o.reduce((t,a)=>t+a.quantity,0),Kt=Ie.reduce((t,a)=>t+a.quantity,0),Ye=B?B.liveTotalCredits:Ft,Ut=new Set(o.map(t=>t.id)),De=((Me==null?void 0:Me.items)??[]).filter(t=>!Ut.has(t.id)).slice(0,12),Nt=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=Ye*10,Qt=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Qt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ot=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Ht=ga,Vt=t=>xa(t.contractAddress,String(t.itemId));function me(t){t(),H(null),he(null),ie(null)}function Gt(){j(null),_(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];He(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),_(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,R=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ms(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ls()&&!v)try{const m=new Map;f=await fs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>ys(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Be=>S.add(Be)),E.push(f[N])):C.reason instanceof vt||X.forEach(Be=>R.add(Be))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof bs))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>R.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>R.add(x))});t.forEach(m=>l(m.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),_(!1);const _e={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:_e,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!R.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),H(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),_(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),_(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),_(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await gs({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ds(ht.chainId),staleTime:6e4})}catch{return}}async function Dt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Dt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ot(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:R}=at(a,t);await st(S,R,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Jt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(fa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=us(a,t),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){_(!1),fe({auth:c,run:d});return}d()}function Xt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await is({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=rs(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),R=os(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:_e}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:_e})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+R).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),H(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),_(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await Cs(a,n.address,Ht,await et(),Vt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(An(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),H(null);return}if(c.orderChanged){H(c),Oe.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{_(!1)}}async function rt(){if(B){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-Oe.current>zn){H(null),he(null),await te();return}ie(null),tt(B.buyable)}}async function Zt(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}_(!0);try{const t=await js(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!ts("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&Y(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ls,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ks,{children:[e.jsx(Us,{children:s("cart.empty.title")}),e.jsx(Ns,{children:s("cart.empty.body")})]}),e.jsx(Qs,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Rs,{children:[e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsx(Os,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Hs,{children:s("cart.panelTitle",{count:Lt})}),Bt?e.jsxs(Vs,{onClick:()=>D(!0),disabled:V,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Gs,{children:o.map(t=>{const a=Nt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,R=ua(t),E=!!R&&!!A[R],q=ha(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ys,{"data-unavailable":g||void 0,children:[e.jsxs(Ds,{"data-thumb":!0,children:[q?e.jsx(Js,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Xs,{"data-check":!0,"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(Zs,{children:[e.jsxs(en,{"data-desc":!0,children:[q?e.jsx(an,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(tn,{title:t.name,children:t.name}),t.creator?e.jsx(sn,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(xn,{"data-testid":"cart-creator-tag",children:[e.jsx(mn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(nn,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(hn,{children:[e.jsx(pn,{name:"warning-fill",size:24}),k]}),q?e.jsx(gn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(rn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("cart.decreaseQuantity",{name:t.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(on,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("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(cn,{children:[e.jsx(dn,{})," ",S,c?e.jsx(ln,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(un,{children:[R?e.jsx(fn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:E?"heart-solid":"heart"})}):null,e.jsx(yn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(bn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(vn,{children:[e.jsx(wn,{children:s("cart.purchaseSummary")}),e.jsxs(Cn,{children:[e.jsxs(jn,{children:[e.jsx(kn,{children:s("cart.totalItems",{count:Kt})}),e.jsx(Sn,{children:e.jsxs($n,{children:[e.jsx(Mn,{})," ",Ye]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:B?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(B?rt():te(t))}):e.jsx(Tn,{onClick:()=>void(B?rt():te()),disabled:V||Pe,children:V?s("cart.working"):B?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),B?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(In,{message:Rt})]})]})]})]}),De.length>0?e.jsx(Pn,{children:e.jsx(as,{title:s("cart.youMightAlsoLike"),items:De})}):null,qe&&n?e.jsx(ss,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:ns,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(qs,{phase:p.phase,balanceCredits:ge,onClose:Gt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Jt(p).options:void 0,onPay:Xt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:He,onBuyPacks:()=>void Zt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Jn as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a5 as N,a6 as U,a7 as o,a8 as n,a9 as D,k as M}from"./index-DubLtINT.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-_vaSICRo.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,B=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ import{A as N,D as E,E as o,F as n,G as $,l as M}from"./index-BiIZh9R9.js";impor
|
|
|
6
6
|
100% {
|
|
7
7
|
transform: rotate(360deg);
|
|
8
8
|
}
|
|
9
|
-
`)),
|
|
9
|
+
`)),G=M(b||(b=l`
|
|
10
10
|
0% {
|
|
11
11
|
stroke-dasharray: 1px, 200px;
|
|
12
12
|
stroke-dashoffset: 0;
|
|
@@ -21,8 +21,8 @@ import{A as N,D as E,E as o,F as n,G as $,l as M}from"./index-BiIZh9R9.js";impor
|
|
|
21
21
|
stroke-dasharray: 100px, 200px;
|
|
22
22
|
stroke-dashoffset: -125px;
|
|
23
23
|
}
|
|
24
|
-
`)),
|
|
24
|
+
`)),L=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,u={root:["root",s,`color${n(t)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(u,K,e)},V=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
|
-
`),
|
|
26
|
+
`),B)),Z=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),q=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
|
|
27
27
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
-
`),
|
|
28
|
+
`),G)),O=w.forwardRef(function(e,s){const t=N({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=t,j=U(t,W),c=o({},t,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=L(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((a-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(V,o({className:I(f.root,d),style:o({width:m,height:m},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(Z,{className:f.svg,ownerState:c,viewBox:`${a/2} ${a/2} ${a} ${a}`,children:g.jsx(q,{className:f.circle,style:h,ownerState:c,cx:a,cy:a,r:(a-i)/2,fill:"none",strokeWidth:i})})}))});export{O as C};
|