@dcl/shop 0.8.0 → 0.8.1-31010487922.commit-7e8c168
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-BpEWDEgt.js → Activity-D0ke7CND.js} +3 -3
- package/_assets/{AnimatedBackground-whCeMUgc.js → AnimatedBackground-ECFAiLHT.js} +1 -1
- package/_assets/Assets-BF1jmHXH.js +801 -0
- package/_assets/{Assets.styles-DuSEfvzx.js → Assets.styles-oV1FeEer.js} +2 -2
- package/_assets/{Authorizations-DTC0viZ7.js → Authorizations-Cc50JSP-.js} +3 -3
- package/_assets/{Cart-Ccdz2uXK.js → Cart-D4Ru3hhk.js} +3 -3
- package/_assets/{CircularProgress-BkDrovgn.js → CircularProgress-DqnGiMZe.js} +3 -3
- package/_assets/{Collection-LGp9HIwD.js → Collection-YEjRwps6.js} +10 -10
- package/_assets/{CollectionCarousel-CnR1So5p.js → CollectionCarousel-BeRnGCYD.js} +32 -32
- package/_assets/{ConstantsUtil-Di3dRDAF.js → ConstantsUtil-BkhvNc68.js} +1 -1
- package/_assets/{ContentClient-CRr9ZuRH.js → ContentClient-CGWTGqN4.js} +1 -1
- package/_assets/Creator-D__6ZkY9.js +306 -0
- package/_assets/{DeploymentBuilder-DYNbIRzZ.js → DeploymentBuilder-CFls_09j.js} +1 -1
- package/_assets/{ErrorNotice-BXWX_0E4.js → ErrorNotice-Q_ppMazV.js} +1 -1
- package/_assets/{ExchangeController-C_NxeYpZ.js → ExchangeController-qVRplriS.js} +1 -1
- package/_assets/{Faq-BXT0tU5Q.js → Faq-cnUUa754.js} +1 -1
- package/_assets/{GetCredits-CiVv6zS4.js → GetCredits-B0kU7FuE.js} +19 -19
- package/_assets/{Grow-d2ucdHqS.js → Grow-HgGzFpE3.js} +1 -1
- package/_assets/{HelpersUtil-BsEaPmaI.js → HelpersUtil-Ew-F4vBT.js} +1 -1
- package/_assets/{ItemDetail-BxGSP-it.js → ItemDetail-qqSyfKPj.js} +13 -13
- package/_assets/LazyEmoteControls-DNXHFm3g.js +2 -0
- package/_assets/{LoadMore-DcIHY8Kf.js → LoadMore-DSHozISi.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-CxOm66Fo.js → ManaPricingBanner.styles-UwzPqB3A.js} +1 -1
- package/_assets/{MyAssets-BozGMHXd.js → MyAssets-fpg41I4K.js} +1 -1
- package/_assets/{MyFavorites-wLuasEwD.js → MyFavorites-Cd7TlT9w.js} +2 -2
- package/_assets/{NetworkUtil-EoWQDMpU.js → NetworkUtil-CO-1nCx-.js} +1 -1
- package/_assets/{NotFound-D9deZR03.js → NotFound-CTSrHIhr.js} +1 -1
- package/_assets/{NotificationsBell-DULYJmKs.js → NotificationsBell-DabycGGR.js} +1 -1
- package/_assets/{OutfitDetail-B28zoBrk.js → OutfitDetail-BCQPpfUl.js} +15 -15
- package/_assets/{OutfitPreview-GRiCEESc.js → OutfitPreview-CNVm-Mmy.js} +2 -2
- package/_assets/{OutfitStudio-D7500MAI.js → OutfitStudio-DF2ScfYx.js} +13 -13
- package/_assets/{StoreSettings-DK8rP1ia.js → StoreSettings-rrOuug9U.js} +9 -9
- package/_assets/{Success-zZ3HkHoh.js → Success-D8XBSWq_.js} +13 -13
- package/_assets/{SwapController-LhvwgYfv.js → SwapController-ZQOTT4HD.js} +1 -1
- package/_assets/{Tooltip-Dh6dtNV3.js → Tooltip-xIVvDLOp.js} +2 -2
- package/_assets/{TradeService-DjBvwlyu.js → TradeService-DmCFIQne.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-DyHElSGY.js → W3MFrameProviderSingleton-CRZ8AP2Q.js} +3 -3
- package/_assets/{WebCryptoP256-CGMChTjg.js → WebCryptoP256-DXjlDDMT.js} +1 -1
- package/_assets/authorizations-BixBV4TD.js +1 -0
- package/_assets/{basic-BwriZEC-.js → basic-CcERZRfI.js} +1 -1
- package/_assets/{biconomy-CeViGwXz.js → biconomy-BIgRCmes.js} +1 -1
- package/_assets/{browser-CqsLPmeb.js → browser-DrmA6_0y.js} +1 -1
- package/_assets/{browser-ponyfill-I5CKtKME.js → browser-ponyfill-fSxUcg6c.js} +1 -1
- package/_assets/{builder-CYMYImB0.js → builder-yYkfVnmO.js} +1 -1
- package/_assets/buy-C6t8EdJL.js +1 -0
- package/_assets/{buy-gasless-DIfZSqYX.js → buy-gasless-uXmROTXZ.js} +1 -1
- package/_assets/{categories-BbYXk3ti.js → categories-CGxAQH-_.js} +45 -33
- package/_assets/{ccip-CwIu0LfN.js → ccip-ClC71LrZ.js} +1 -1
- package/_assets/{ccip-Sex5PzD_.js → ccip-TCYs1z3C.js} +1 -1
- package/_assets/{chains-DPlhC0Sw.js → chains-BqVOrxrG.js} +1 -1
- package/_assets/{collectionPage.styles-CHbJGgda.js → collectionPage.styles-DxfKkCjZ.js} +4 -4
- package/_assets/{common-CNwVQ4p9.js → common-CkYiP-7J.js} +1 -1
- package/_assets/{controller-DfTp5YOO.js → controller-CAD_Ncxd.js} +2 -2
- package/_assets/{core-BEK9pA3q.js → core-C5ZUevur.js} +4 -4
- package/_assets/{createSvgIcon-CU05oHiV.js → createSvgIcon-DsB10OiJ.js} +4 -4
- package/_assets/{custom-BhGswfT_.js → custom-CizQsxK3.js} +1 -1
- package/_assets/{data-capture-nvuZRuzg.js → data-capture-Bwsb_w-3.js} +1 -1
- package/_assets/decimals-DO67KSdi.js +1 -0
- package/_assets/{decimals-B3pg7hp8.js → decimals-DyjR4aoq.js} +1 -1
- package/_assets/{detectExtension-DEjVJeUh.js → detectExtension-DWfhzRDC.js} +1 -1
- package/_assets/{disposePreview-B96DpOZy.js → disposePreview-flulL6RX.js} +1 -1
- package/_assets/{email-CieTjR51.js → email-CUebz27I.js} +1 -1
- package/_assets/{embedded-wallet-CI-r3uDX.js → embedded-wallet-DHuEKb2B.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-BlQXcSKx.js → emotion-styled.browser.esm-CVKaLYZX.js} +1 -1
- package/_assets/{engine-CHP2eI44.js → engine-CwQ6coYl.js} +1 -1
- package/_assets/errors-CBUUj0FX.js +1 -0
- package/_assets/estimate-l1-fee-BJpzTLgk.js +1 -0
- package/_assets/eth_estimateGas-CZdRIIy4.js +1 -0
- package/_assets/{eth_getStorageAt-BUYdIAYw.js → eth_getStorageAt-C4Yqzc5m.js} +1 -1
- package/_assets/eth_getTransactionCount-W_BA_-db.js +1 -0
- package/_assets/{ethereum-CliiIOgc.js → ethereum-DFU7Vz3W.js} +1 -1
- package/_assets/{ethers-DejfrZ8i.js → ethers-lk3HAbPB.js} +1 -1
- package/_assets/{execute-BJuyrz_X.js → execute-BkwPHs5d.js} +2 -2
- package/_assets/{extractIPFS-CUaS-9Rs.js → extractIPFS-DzfSqAlh.js} +1 -1
- package/_assets/{features-B9o2bxOE.js → features-COoncQLs.js} +1 -1
- package/_assets/{fetchTokenMetadata-DeEXEM9T.js → fetchTokenMetadata-DVdGF8SH.js} +2 -2
- package/_assets/{field.styles-BYH2xB5-.js → field.styles-ChGQv28p.js} +1 -1
- package/_assets/{fortmatic-EI5cNLV0.js → fortmatic-9W3d2zrH.js} +1 -1
- package/_assets/{get-bytecode-knYex1Eu.js → get-bytecode-BsB9WanS.js} +1 -1
- package/_assets/get-ecosystem-wallet-info-BpyDXVOG.js +1 -0
- package/_assets/{getBalance-pkY6oxRI.js → getBalance-NmIU2b2O.js} +2 -2
- package/_assets/{getInstalledModules-tywfzr6y.js → getInstalledModules-BE5-ES5I.js} +1 -1
- package/_assets/{getNFT-CYm9n3Xd.js → getNFT-BGxpYRoe.js} +2 -2
- package/_assets/getNFT-YEPEG38f.js +1 -0
- package/_assets/{grid.styles-DoBUqqdT.js → grid.styles-D2J96SwT.js} +1 -1
- package/_assets/{hashTypedData-DpkGfcdz.js → hashTypedData-CApfLnos.js} +1 -1
- package/_assets/{hashTypedData-ONHChmVW.js → hashTypedData-CcYMI56c.js} +1 -1
- package/_assets/{in-app-GxZkDa12.js → in-app-CKc3O4Sv.js} +1 -1
- package/_assets/{in-app-wallet-calls-B91UMKOr.js → in-app-wallet-calls-n0DVkHti.js} +1 -1
- package/_assets/index-0kdmGL8P.js +3390 -0
- package/_assets/index-3QPqSkja.js +1 -0
- package/_assets/{index-DEPPVv3y.js → index-4iaG5DfH.js} +1 -1
- package/_assets/{index-DOxWmjOH.js → index-6S3FMUEk.js} +1 -1
- package/_assets/{index-5GNI01Ww.js → index-6X3q9jcE.js} +1 -1
- package/_assets/{index-CSlo2BeJ.js → index-7vaOJntM.js} +1 -1
- package/_assets/{index-BJM0Y8Dj.js → index-9ZdEDnsf.js} +1 -1
- package/_assets/{index-L36hhrTC.js → index-B0Nj1Xpe.js} +1 -1
- package/_assets/{index-CMV7iaeR.js → index-B7SwXBLX.js} +1 -1
- package/_assets/{index-L_H5aHd6.js → index-BAuvCwBS.js} +1 -1
- package/_assets/{index-BACQuryf.js → index-BBAMyxaq.js} +1 -1
- package/_assets/{index-JweqbyGF.js → index-BKGDTHnI.js} +2 -2
- package/_assets/{index-BsE741-i.js → index-BW8WltKr.js} +1 -1
- package/_assets/{index-B49Ra42Y.js → index-Be2ZgTC2.js} +2 -2
- package/_assets/{index-C33PRPh0.js → index-BhB231bL.js} +1 -1
- package/_assets/{index-BkDtNpJ9.js → index-BhLXJT-A.js} +1 -1
- package/_assets/{index-Bk7mlw_4.js → index-BiCSZsIb.js} +1 -1
- package/_assets/{index-_943ql8C.js → index-BkyUhgF6.js} +1 -1
- package/_assets/{index-CRQCirWA.js → index-Bm2p-zGj.js} +1 -1
- package/_assets/{index-DMNGIYYv.js → index-BmnaNalD.js} +1 -1
- package/_assets/{index-Cv1Bu0gQ.js → index-BsSKIwHD.js} +1 -1
- package/_assets/{index-Bzt1xZyM.js → index-BxR_qhCB.js} +1 -1
- package/_assets/{index-__99MHKr.js → index-BxmGjj2a.js} +2 -2
- package/_assets/{index-CTpdUOYC.js → index-BzcwOGk4.js} +1 -1
- package/_assets/{index-OxDwxhIP.js → index-BzkS1G6W.js} +1 -1
- package/_assets/{index-BpBengnA.js → index-C3Stq5lv.js} +1 -1
- package/_assets/{index-BH5LU_4T.js → index-C59CJSbo.js} +1 -1
- package/_assets/{index-l4-9ZZLe.js → index-C6MGFWmE.js} +3 -3
- package/_assets/{index-B-FT9tly.js → index-C7RtdG3Z.js} +1 -1
- package/_assets/{index-DxSEHau1.js → index-CA4L-7AN.js} +1 -1
- package/_assets/{index--dDDhPCb.js → index-CBeTDdme.js} +1 -1
- package/_assets/{index-DftqIOqz.js → index-CC3KVZ-C.js} +1 -1
- package/_assets/{index-t0T-6ZrA.js → index-CF7r6gRE.js} +1 -1
- package/_assets/{index-DI-3MKLG.js → index-CJEkcTww.js} +1 -1
- package/_assets/{index-Cu9CgJO0.js → index-CLpv_ZJ-.js} +1 -1
- package/_assets/{index-OqCfgEJv.js → index-CMEuS0ny.js} +1 -1
- package/_assets/{index-BX8-GtYO.js → index-CVOcWyr3.js} +3 -3
- package/_assets/{index-INHGq5Es.js → index-CcVPLkSq.js} +1 -1
- package/_assets/{index-CIQQJerR.js → index-CczTfLT1.js} +1 -1
- package/_assets/{index-B6MX4qjW.js → index-CgeqYqkT.js} +3 -3
- package/_assets/{index-BFFeuHAN.js → index-CpR4TF12.js} +1 -1
- package/_assets/{index-Bmq5dKA-.js → index-CtdnhIV0.js} +1 -1
- package/_assets/{index-73vZ1csI.js → index-CxzejZj0.js} +1 -1
- package/_assets/{index-B_JiruyT.js → index-CydESP8d.js} +1 -1
- package/_assets/{index-D4Aqu34H.js → index-D0cG_Wab.js} +1 -1
- package/_assets/{index-B4d9kGHc.js → index-DGxvuwYE.js} +1 -1
- package/_assets/{index-DOiEVNYb.js → index-DN1EN0BQ.js} +1 -1
- package/_assets/{index-G6kG-9qx.js → index-DRT-S6qO.js} +1 -1
- package/_assets/{index-DPmmgd_P.js → index-DaUjgiMa.js} +2 -2
- package/_assets/{index-Bk_uITsR.js → index-DhLM0XTE.js} +1 -1
- package/_assets/{index-C5F4093w.js → index-DmMFljl8.js} +1 -1
- package/_assets/{index-BYlZ9YbP.js → index-DxEnMKm3.js} +1 -1
- package/_assets/{index-DhNV3-07.js → index-DxQd7A0J.js} +1 -1
- package/_assets/{index-BkMwrTJ3.js → index-DzGUGKu8.js} +1 -1
- package/_assets/{index-E7P9-xl1.js → index-IpNLzHgx.js} +1 -1
- package/_assets/{index-Dfv984cL.js → index-KJ7hHQUO.js} +1 -1
- package/_assets/{index-CtybxktV.js → index-U0B_ruvX.js} +1 -1
- package/_assets/{index-BWh4oQv2.js → index-Y97601kH.js} +1 -1
- package/_assets/{index-Cakc_FOK.js → index-Yr43kIYd.js} +1 -1
- package/_assets/{index-DGI43LaB.js → index-_jZ2ge8B.js} +1 -1
- package/_assets/{index-D3BUTCsu.js → index-c7dUn7oS.js} +1 -1
- package/_assets/{index-De1oZcbD.js → index-hCVFHVic.js} +11 -11
- package/_assets/{index-CrYXAQF7.js → index-mRgaZ-_k.js} +1 -1
- package/_assets/{index-8TbyLPoA.js → index-wnob8aZw.js} +2 -2
- package/_assets/{index.es-DD8zy1OU.js → index.es-Bt1vrHLy.js} +1 -1
- package/_assets/{index.es-7bD3vSL6.js → index.es-CQZWy8u6.js} +4 -4
- package/_assets/{index.es-DdtYF7po.js → index.es-DrGoY9Xx.js} +1 -1
- package/_assets/{index.es-DQ3AciL_.js → index.es-DrfFlp1M.js} +1 -1
- package/_assets/{linkAccount-BodpWbRq.js → linkAccount-CNeA4_rd.js} +1 -1
- package/_assets/{localBatchGatewayRequest-Cqcm6wSH.js → localBatchGatewayRequest-DjDL8c_C.js} +1 -1
- package/_assets/{native-DfrS-44q.js → native-D1Bt7nPF.js} +1 -1
- package/_assets/{networks-BsQOwKdI.js → networks-BICt4Cqn.js} +1 -1
- package/_assets/{onramp-CutBYUPg.js → onramp-DG7xtPwJ.js} +1 -1
- package/_assets/{openzeppelin-K-AgEyIf.js → openzeppelin-DT5thYhO.js} +1 -1
- package/_assets/{ownerOf-Dw2VC0ue.js → ownerOf-CSle-7WO.js} +1 -1
- package/_assets/parseNft-DeY1x__c.js +2 -0
- package/_assets/{parseSignature-DnyPA3OO.js → parseSignature-BwH4RvfH.js} +1 -1
- package/_assets/{parseSignature-BrLHTUOQ.js → parseSignature-C3vshYUJ.js} +3 -3
- package/_assets/{passkeys-zi3xVlV1.js → passkeys-BL7MgzVl.js} +1 -1
- package/_assets/{pay-with-exchange-pvINEHpN.js → pay-with-exchange-qF0q90BH.js} +1 -1
- package/_assets/{prepare-contract-call-BnXbUbQT.js → prepare-contract-call-Nm9e1q7x.js} +1 -1
- package/_assets/{qr-overlay-CLKlyiw2.js → qr-overlay-hZqIuLIW.js} +3 -3
- package/_assets/{react-DehiWSvs.js → react-OEOSdkUk.js} +1 -1
- package/_assets/{receive-BLXAcZ6B.js → receive-COE1EvWZ.js} +1 -1
- package/_assets/{resolveImplementation-CfgIWk0L.js → resolveImplementation-HLbNG2Vp.js} +1 -1
- package/_assets/{rpc-C2ZJH6qL.js → rpc-lGsIPm3Z.js} +1 -1
- package/_assets/{secp256k1-DQNL-k-L.js → secp256k1-BBTaGZ_Y.js} +1 -1
- package/_assets/{secp256k1-BPdRWJXL.js → secp256k1-CQZtwuUm.js} +1 -1
- package/_assets/{secp256k1--GaGebUJ.js → secp256k1-GE4zGOQU.js} +1 -1
- package/_assets/{send-Cl_aA-ga.js → send-BJWcTbds.js} +1 -1
- package/_assets/{send-batch-transaction-1ElceULH.js → send-batch-transaction-Ba7JslR9.js} +1 -1
- package/_assets/{send-eip712-transaction-BV_DsAbU.js → send-eip712-transaction-BSFP8vKh.js} +2 -2
- package/_assets/send-gasless-transaction-dOOl0_oC.js +2 -0
- package/_assets/{send-transaction-DWimy5qX.js → send-transaction-CMc6wANs.js} +2 -2
- package/_assets/{sendMetaTransaction-B6HBQ8NH.js → sendMetaTransaction-DqzmtvVe.js} +1 -1
- package/_assets/{sendRawTransaction-6C6FbT-9.js → sendRawTransaction-zYZQ5Tfd.js} +3 -3
- package/_assets/{sentry-973sfbO9.js → sentry-B60WY-np.js} +1 -1
- package/_assets/{serializeTransaction-DJpTnAzh.js → serializeTransaction-CDXHLkZy.js} +1 -1
- package/_assets/{session-proposal-B1fE_9QJ.js → session-proposal-B6LJtMoi.js} +1 -1
- package/_assets/{session-request-DVlIT2Cz.js → session-request-B2L7VQbP.js} +2 -2
- package/_assets/{sha256--PXCNFKm.js → sha256-B3W1x8Ou.js} +1 -1
- package/_assets/{signing-C2OtEE_7.js → signing-DH8o0qgI.js} +3 -3
- package/_assets/{socials-CwiK-Oz5.js → socials-De6pYslK.js} +1 -1
- package/_assets/{styled-INC_AiMB.js → styled-Dlzz4gCY.js} +2 -2
- package/_assets/{swaps-Cz6uslns.js → swaps-C1ulCDV2.js} +1 -1
- package/_assets/{thirdweb-QagPg_5G.js → thirdweb-BB9WKhiC.js} +3 -3
- package/_assets/{to-serializable-transaction-CI3ePtUl.js → to-serializable-transaction-BxPcLWhE.js} +2 -2
- package/_assets/{totalSupply-DEpB2B-R.js → totalSupply-BfIXxtR1.js} +1 -1
- package/_assets/{transaction-BRB0QRZP.js → transaction-C7nbuBwl.js} +1 -1
- package/_assets/{transactionReceipt-B2jt8_c5.js → transactionReceipt-D9BW4O3E.js} +1 -1
- package/_assets/{transactions-DuxoNdoM.js → transactions-CA_3u_cG.js} +1 -1
- package/_assets/{useCreditPacks-CeoLpXxe.js → useCreditPacks-D4YqwUaM.js} +1 -1
- package/_assets/useImportable-B7DZOe6X.js +1 -0
- package/_assets/{useInfiniteGrid-D9jUBgv1.js → useInfiniteGrid-DDAFkDbL.js} +1 -1
- package/_assets/useTheme-jEgFLoWg.js +1 -0
- package/_assets/useUrlFilters-DABDXRpV.js +1 -0
- package/_assets/{utils-B9hEgCzc.js → utils-BkRfOA0C.js} +1 -1
- package/_assets/{verifyHash-BWYK-_oQ.js → verifyHash-CfhhiiiM.js} +1 -1
- package/_assets/{w3m-modal-C_cXhjYQ.js → w3m-modal-Dgkl_pUo.js} +1 -1
- package/_assets/{w3m-modal-DeCOfGwP.js → w3m-modal-oirp7A4F.js} +1 -1
- package/_assets/{wait-for-tx-receipt-D52q1hNL.js → wait-for-tx-receipt-DJ9PgMUD.js} +1 -1
- package/_assets/{wallets-BiRgfoDB.js → wallets-Bj-wvS3Z.js} +5 -5
- package/_assets/{web-connector-CI1NmWV2.js → web-connector-Djk4hyaT.js} +3 -3
- package/_assets/{writeContract-J3cBsNY4.js → writeContract-oXMRoqds.js} +1 -1
- package/_assets/{zora-sepolia-Dv22rzxP.js → zora-sepolia-DOetv30E.js} +1 -1
- package/_assets/{zoraTestnet-zRF1Vikt.js → zoraTestnet-nCZwff13.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Assets-CH4B54Xy.js +0 -801
- package/_assets/Creator-2jJw01qB.js +0 -306
- package/_assets/LazyEmoteControls-D7IWhRxC.js +0 -2
- package/_assets/authorizations-w-yCHVpU.js +0 -1
- package/_assets/buy-DIVuBMot.js +0 -1
- package/_assets/decimals-BpjIyOut.js +0 -1
- package/_assets/errors-BAqCaL6O.js +0 -1
- package/_assets/estimate-l1-fee-D_pdXw9y.js +0 -1
- package/_assets/eth_estimateGas-BmR_JMy9.js +0 -1
- package/_assets/eth_getTransactionCount-riJ8hG2K.js +0 -1
- package/_assets/get-ecosystem-wallet-info-C5KzHIh2.js +0 -1
- package/_assets/getNFT-BXJA28mr.js +0 -1
- package/_assets/index-CcbRdBPP.js +0 -1
- package/_assets/index-DbCMsBDL.js +0 -3504
- package/_assets/parseNft-pYm9OVKe.js +0 -2
- package/_assets/send-gasless-transaction-eTi92Rfc.js +0 -2
- package/_assets/useImportable-CHlGR9sz.js +0 -1
- package/_assets/useTheme-HGI9qk_L.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as k,
|
|
1
|
+
import{L as k,a as te,j as e,r as p}from"./react-OEOSdkUk.js";import{s as t,I as j,t as ie,J as se,K as ae,L as ne,B as w,M as oe,o as R,N as re,v as le,x as de,b as a,O as B,P as N,Q as ce,R as pe,S as he,U as me,V as xe,W as ue,X as ge,Y as fe,Z as be,$ as ve,a0 as ye,a1 as je,a2 as we,a3 as ke,a4 as Ie,a5 as $e,z as E,a6 as Ce,a7 as Ee,a8 as ze,a9 as Le,aa as Oe,ab as Se}from"./index-0kdmGL8P.js";import{E as _}from"./ErrorNotice-Q_ppMazV.js";import{E as Ae}from"./LazyEmoteControls-DNXHFm3g.js";import{O as Ne}from"./OutfitPreview-CNVm-Mmy.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./disposePreview-flulL6RX.js";const{colors:o,radius:Fe,media:d}=ie,K=t.div`
|
|
2
2
|
max-width: 1721px;
|
|
3
3
|
margin: 0 auto;
|
|
4
4
|
`,Te=t.nav`
|
|
@@ -8,7 +8,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
8
8
|
font-size: 13px;
|
|
9
9
|
color: ${o.muted};
|
|
10
10
|
margin-bottom: 18px;
|
|
11
|
-
`,
|
|
11
|
+
`,F=t(k)`
|
|
12
12
|
color: ${o.muted};
|
|
13
13
|
|
|
14
14
|
&:hover {
|
|
@@ -20,7 +20,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
white-space: nowrap;
|
|
22
22
|
text-overflow: ellipsis;
|
|
23
|
-
`,
|
|
23
|
+
`,H=t.div`
|
|
24
24
|
display: grid;
|
|
25
25
|
grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
|
|
26
26
|
gap: 40px;
|
|
@@ -34,7 +34,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
34
34
|
height: auto;
|
|
35
35
|
min-height: 0;
|
|
36
36
|
}
|
|
37
|
-
`,
|
|
37
|
+
`,D=t.div`
|
|
38
38
|
position: relative;
|
|
39
39
|
border-radius: 24px;
|
|
40
40
|
overflow: hidden;
|
|
@@ -70,7 +70,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
70
70
|
width: 100%;
|
|
71
71
|
height: 100%;
|
|
72
72
|
object-fit: contain;
|
|
73
|
-
`,
|
|
73
|
+
`,U=t.div`
|
|
74
74
|
display: flex;
|
|
75
75
|
flex-direction: column;
|
|
76
76
|
gap: 15px;
|
|
@@ -99,14 +99,14 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
99
99
|
padding: 0;
|
|
100
100
|
margin: 0;
|
|
101
101
|
}
|
|
102
|
-
`,
|
|
102
|
+
`,Ke=t.ul`
|
|
103
103
|
list-style: none;
|
|
104
104
|
margin: 0;
|
|
105
105
|
padding: 0;
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-direction: column;
|
|
108
108
|
gap: 10px;
|
|
109
|
-
`,
|
|
109
|
+
`,He=t.li`
|
|
110
110
|
position: relative;
|
|
111
111
|
display: flex;
|
|
112
112
|
align-items: stretch;
|
|
@@ -165,11 +165,11 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
165
165
|
&[data-state='missing'] {
|
|
166
166
|
opacity: 0.55;
|
|
167
167
|
}
|
|
168
|
-
`,
|
|
168
|
+
`,De=t(k)`
|
|
169
169
|
position: absolute;
|
|
170
170
|
inset: 0;
|
|
171
171
|
z-index: 1;
|
|
172
|
-
`,
|
|
172
|
+
`,Ue=t.img`
|
|
173
173
|
width: 96px;
|
|
174
174
|
height: 96px;
|
|
175
175
|
object-fit: cover;
|
|
@@ -180,7 +180,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
180
180
|
width: 88px;
|
|
181
181
|
height: 88px;
|
|
182
182
|
}
|
|
183
|
-
`,
|
|
183
|
+
`,Ve=t.span`
|
|
184
184
|
width: 96px;
|
|
185
185
|
height: 96px;
|
|
186
186
|
background: ${o.panel};
|
|
@@ -204,7 +204,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
204
204
|
white-space: nowrap;
|
|
205
205
|
overflow: hidden;
|
|
206
206
|
text-overflow: ellipsis;
|
|
207
|
-
`,
|
|
207
|
+
`,qe=t(k)`
|
|
208
208
|
position: relative;
|
|
209
209
|
z-index: 2;
|
|
210
210
|
align-self: flex-start;
|
|
@@ -227,11 +227,11 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
227
227
|
font-size: 16px;
|
|
228
228
|
font-weight: 600;
|
|
229
229
|
white-space: nowrap;
|
|
230
|
-
`,
|
|
230
|
+
`,v=t.span`
|
|
231
231
|
font-size: 12px;
|
|
232
232
|
font-weight: 400;
|
|
233
233
|
padding: 2px 8px;
|
|
234
|
-
border-radius: ${
|
|
234
|
+
border-radius: ${Fe.chip};
|
|
235
235
|
background: ${o.chip};
|
|
236
236
|
color: ${o.text2};
|
|
237
237
|
white-space: nowrap;
|
|
@@ -244,7 +244,7 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
244
244
|
${d.maxWidth("mobile")} {
|
|
245
245
|
display: none;
|
|
246
246
|
}
|
|
247
|
-
`,
|
|
247
|
+
`,y=t(oe)`
|
|
248
248
|
&[data-variant='smart'] {
|
|
249
249
|
gap: 2px;
|
|
250
250
|
background: ${o.chip};
|
|
@@ -331,4 +331,4 @@ import{L as k,u as te,j as e,r as p}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
331
331
|
opacity: 0.4;
|
|
332
332
|
`,nt=t.h1`
|
|
333
333
|
font-size: 24px;
|
|
334
|
-
`,M="outfit-detail-preview";function bt(){const{id:i}=te(),n=R(f=>f.session),c=re(),g=c==="creator",{data:r,isError:I,refetch:m}=le({queryKey:["outfit",i,g],enabled:
|
|
334
|
+
`,M="outfit-detail-preview";function bt(){const{id:i}=te(),n=R(f=>f.session),c=re(),g=c==="creator",{data:r,isError:I,refetch:m}=le({queryKey:["outfit",i,g],enabled:N()&&!!i,staleTime:6e4,queryFn:()=>Se(i,g&&n?n.identity:void 0)}),l=!N()||!i||r===null&&c!=="pending";return de(l?{title:a("seo.outfit.notFoundTitle"),noindex:!0}:r?{title:r.name,image:B(r.thumbnailHash)??void 0}:{}),l?e.jsxs(W,{"data-testid":"outfit-notfound",children:[e.jsx(at,{name:"cart",size:44}),e.jsx(nt,{children:a("outfits.detail.notFoundTitle")}),e.jsx("p",{className:"muted",children:a("outfits.detail.notFoundBody")}),e.jsx(w,{as:k,to:"/items",variant:"purple",children:a("notFound.cta")})]}):I?e.jsxs(W,{"data-testid":"outfit-detail-error",children:[e.jsx(_,{message:a("outfits.errors.generic")}),e.jsx(w,{variant:"purple",onClick:()=>void m(),children:a("outfits.detail.retry")})]}):r?e.jsx(rt,{outfit:r}):e.jsx(K,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(H,{children:[e.jsx(D,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(U,{children:[e.jsx("span",{className:"skeleton",style:{width:"60%",height:32},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"40%",height:16},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"100%",height:48},"aria-hidden":!0})]})]})})}function ot({item:i}){const n=Ce(i),c=Ee(i.gender);return e.jsxs(Qe,{children:[i.rarity?e.jsx(y,{"data-variant":"rarity",style:{background:Oe(i.rarity),color:Le(i.rarity)},title:ze(i.rarity),children:i.rarity}):null,i.isSmart?e.jsxs(y,{"data-variant":"smart",children:[e.jsx(j,{name:"smart",size:13}),a("assetCard.smart")]}):null,n?e.jsx(y,{"data-variant":"icon",children:e.jsx(j,{name:n})}):null,c?e.jsx(y,{"data-variant":"icon",children:e.jsx(j,{name:c})}):null]})}function rt({outfit:i}){const n=ce(i),{split:c,availableCount:g,totalCredits:r,addOutfit:I,isAdding:m}=pe(i,n),l=R(s=>{var u;return(u=s.session)==null?void 0:u.address}),f=he(s=>s.items),L=p.useMemo(()=>new Set(f.map(me)),[f]),O=B(i.thumbnailHash),S=p.useRef(null);p.useEffect(()=>{S.current!==i.id&&(S.current=i.id,xe("Shop Outfit Viewed",{outfit_id:i.id,item_count:i.items.length}))},[i.id,i.items.length]);const $=p.useMemo(()=>i.items.map(s=>{const u=ue(s),C=n.byKey.get(u)??null;return{key:u,item:C,state:C?ge(C,{address:l,cartKeys:L}):"missing"}}),[i,n.byKey,l,L]),{data:V,isFetched:q}=fe(l),G=!l||q,Q=!!l&&!!V,J=i.bodyShape==="female"?be:i.bodyShape==="male"?ve:void 0,x=p.useMemo(()=>$.map(s=>s.item).filter(s=>!!s),[$]),A=p.useMemo(()=>ye(x),[x]),X=p.useMemo(()=>!!je(x),[x]),Y=p.useMemo(()=>x.map(s=>we(s)??"").filter(Boolean),[x]),h=ke({address:l,tryOnUrns:A,tryOnCategories:Y}),Z=i.items.length,ee=!n.isLoading&&!n.isError,b=c.purchasable.length;return e.jsxs(K,{"data-testid":"outfit-detail",children:[e.jsxs(Te,{"aria-label":a("outfits.detail.breadcrumbAria"),children:[e.jsx(F,{to:"/overview",children:a("nav.overview")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(F,{to:"/overview",children:a("outfits.detail.breadcrumbLooks")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pe,{children:i.name})]}),e.jsxs(H,{children:[e.jsx(D,{"data-testid":"outfit-detail-preview",style:{background:Ie(i)},children:O&&!n.isLoading&&A.length===0?e.jsx(Me,{src:O,alt:i.name}):e.jsx(Ne,{id:M,profile:h.profile,bodyShape:h.bodyShape??(Q?void 0:J),urns:h.urns,skin:h.skin,hair:h.hair,eyes:h.eyes,enabled:G&&!h.isLoading&&!n.isLoading,controls:X?e.jsx(We,{"data-testid":"outfit-emote-controls",children:e.jsx(Ae,{wearablePreviewId:M,hideFrameInput:!0})}):null})}),e.jsxs(U,{children:[e.jsx(Re,{children:i.name}),e.jsx(Be,{"data-testid":"outfit-detail-meta",children:a("outfits.detail.itemsCount",{count:Z})}),n.isError?e.jsxs(Xe,{children:[e.jsx(_,{message:a("outfits.detail.resolveError"),testId:"outfit-detail-resolve-error"}),e.jsx(w,{variant:"outline","data-testid":"outfit-detail-retry",onClick:n.retry,children:a("outfits.detail.retry")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(_e,{children:[e.jsx(Ke,{children:$.map(s=>e.jsx(He,{"data-testid":"outfit-detail-item","data-state":s.state,children:s.item?e.jsxs(e.Fragment,{children:[e.jsx(De,{to:`/item/${s.item.contractAddress}/${s.item.itemId}`,state:{item:s.item},"aria-label":s.item.name}),e.jsx(Ue,{src:s.item.thumbnail,alt:"",loading:"lazy"}),e.jsxs(T,{children:[e.jsx(z,{children:s.item.name}),s.item.creator?e.jsx(qe,{to:`/items/creator/${s.item.creator}`,children:e.jsx($e,{address:s.item.creator})}):null,e.jsxs(P,{children:[s.state!=="unavailable"?e.jsxs(Ge,{children:[e.jsx(E,{size:15}),s.item.priceCredits.toLocaleString()]}):null,s.state==="unavailable"?e.jsx(v,{children:a("outfits.card.unavailable")}):s.state==="own_listing"?e.jsx(v,{children:a("outfits.detail.yourListing")}):s.state==="in_cart"?e.jsx(v,{children:a("outfits.detail.inCart")}):null,e.jsx(ot,{item:s.item})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{className:n.isLoading?"skeleton":void 0,"aria-hidden":!0}),e.jsx(T,{children:n.isLoading?e.jsx(z,{children:e.jsx("span",{className:"skeleton",style:{display:"block",width:"70%",height:14}})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"muted",children:a("outfits.card.unavailable")}),e.jsx(P,{children:e.jsx(v,{children:a("outfits.card.unavailable")})})]})})]})},s.key))}),ee&&c.ownListing.length>0?e.jsx(Je,{className:"muted small",children:a("outfits.detail.yourListingHint")}):null]}),e.jsxs(Ye,{"data-testid":"outfit-detail-ctabar",children:[e.jsxs(Ze,{children:[e.jsx(et,{children:a("outfits.detail.totalPrice")}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:64,height:26},"aria-hidden":!0}):e.jsxs(tt,{children:[e.jsx(E,{size:22}),r.toLocaleString()]})]}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:"100%",height:52,borderRadius:26},"aria-hidden":!0}):e.jsxs(it,{variant:"purple","data-testid":"outfit-detail-cta",onClick:I,disabled:m||b===0,"aria-busy":m||void 0,children:[m?a("outfits.card.adding"):b>0?a("outfits.detail.addCount",{count:b}):g>0?a("outfits.detail.nothingToAdd"):a("outfits.card.unavailable"),!m&&b>0?e.jsxs(st,{children:[e.jsx(E,{size:16}),r.toLocaleString()]}):null]})]})]})]})]})]})}export{bt as OutfitDetail,bt as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r,j as n}from"./react-
|
|
1
|
+
import{r,j as n}from"./react-OEOSdkUk.js";import{d as v}from"./dcl-schemas-CmtP3U6y.js";import{s as P,S as R,c as F,ac as O,b as S}from"./index-0kdmGL8P.js";import{u as B,d as W}from"./disposePreview-flulL6RX.js";const H=P.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
inset: 0;
|
|
4
4
|
display: grid;
|
|
5
5
|
place-items: center;
|
|
6
|
-
`;function q({id:a,profile:i,bodyShape:g,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=R(t=>t.fittingOpen),{ref:x,active:h}=B(),e=c&&s.length>0&&h&&!E,y=s.length>0?s[0].includes(":amoy:"):F.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[
|
|
6
|
+
`;function q({id:a,profile:i,bodyShape:g,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=R(t=>t.fittingOpen),{ref:x,active:h}=B(),e=c&&s.length>0&&h&&!E,y=s.length>0?s[0].includes(":amoy:"):F.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[b,m]=r.useState(!1);r.useEffect(()=>{if(!e){m(!1);return}let t=0,I=0;const p=()=>{document.getElementById(a)?m(!0):I++<300&&(t=requestAnimationFrame(p))};return p(),()=>cancelAnimationFrame(t)},[e,a]);const u=r.useRef(null);return r.useEffect(()=>{if(e)return()=>{W(u.current),u.current=null}},[e]),n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:x,"data-preview-viewport":!0,"aria-hidden":!0}),e?n.jsx(O,{id:a,profile:i,bodyShape:g,urns:s,skin:l,hair:f,eyes:d,type:v.PreviewType.AVATAR,emote:v.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:y,onLoad:()=>{var t;o(!0),u.current=((t=document.getElementById(a))==null?void 0:t.contentWindow)??null}},i):null,b?w:null,c&&s.length===0?null:!e||!j?n.jsx(H,{"aria-busy":"true","aria-label":S("spinner.loading"),children:n.jsx("span",{className:"spinner","aria-hidden":!0})}):null]})}export{q as O};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as t,L as
|
|
1
|
+
import{r as d,j as t,L as F,a as Qt,d as Vt,e as Jt}from"./react-OEOSdkUk.js";import{s as o,t as dt,I as K,aF as Xt,b as e,z as st,B as x,ah as kt,o as J,N as Yt,x as Zt,A as Tt,v as Ct,Q as te,W as N,aG as Q,aH as ee,aI as ie,aJ as V,a0 as se,a1 as oe,Z as ae,$ as ne,O as It,a4 as re,aK as ot,aL as de,aM as le,aN as ue,E as A,aO as Et,aP as Lt,aQ as O,F as at,aR as nt,aS as ce,aT as pe,aU as fe,V as me,aV as he,aW as xe,ab as ge}from"./index-0kdmGL8P.js";import{E as D}from"./ErrorNotice-Q_ppMazV.js";import{L as be}from"./LoadMore-DSHozISi.js";import{u as ye}from"./useInfiniteGrid-DDAFkDbL.js";import{O as je}from"./OutfitPreview-CNVm-Mmy.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./disposePreview-flulL6RX.js";const{colors:h,radius:X,media:ve}=dt,we=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -102,7 +102,7 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
102
102
|
color: ${h.accent};
|
|
103
103
|
background: ${h.bg};
|
|
104
104
|
border-radius: 50%;
|
|
105
|
-
`,Re=[{key:"wearable",labelKey:"categories.wearables"},{key:"emote",labelKey:"categories.emotes"}];function ze({selectedKeys:r,onPick:m,canPick:f}){const[c,y]=d.useState("wearable"),[j,b]=d.useState(""),[s,L]=d.useState("");d.useEffect(()=>{const l=setTimeout(()=>L(j.trim()),300);return()=>clearTimeout(l)},[j]);const{items:T,isLoading:C,isPlaceholderData:u,isError:S,hasNextPage:I,isFetchingNextPage:Y,fetchNextPage:$}=ye(["outfit-picker",c,s],l=>Xt({search:s||void 0,category:c,onSale:!0,listingType:"primary",first:24,skip:l,sortBy:"cheapest"})),g=e(c==="emote"?"outfits.studio.searchEmotes":"outfits.studio.searchWearables"),W=new Set,M=T.filter(l=>{if(!l.itemId)return!1;const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`;return W.has(v)?!1:(W.add(v),!0)});return t.jsxs(we,{"data-testid":"outfit-picker",children:[t.jsx(Se,{role:"group","aria-label":e("outfits.studio.pickerCategory"),"data-testid":"outfit-picker-category",children:Re.map(({key:l,labelKey:v})=>t.jsx(ke,{type:"button","data-category":l,"data-selected":c===l||void 0,"aria-pressed":c===l,onClick:()=>{y(l),b("")},children:e(v)},l))}),t.jsxs($e,{children:[t.jsx(K,{name:"search",color:dt.colors.muted}),t.jsx("input",{value:j,placeholder:g,"aria-label":g,onChange:l=>b(l.target.value),"data-testid":"outfit-picker-search"})]}),S?t.jsx("p",{className:"muted small",children:e("outfits.errors.generic")}):C||u?t.jsx(jt,{"aria-busy":"true",children:Array.from({length:8},(l,v)=>t.jsx(Te,{className:"skeleton","aria-hidden":!0},v))}):M.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noResults")}):t.jsx(jt,{children:M.map(l=>{const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`,
|
|
105
|
+
`,Re=[{key:"wearable",labelKey:"categories.wearables"},{key:"emote",labelKey:"categories.emotes"}];function ze({selectedKeys:r,onPick:m,canPick:f}){const[c,y]=d.useState("wearable"),[j,b]=d.useState(""),[s,L]=d.useState("");d.useEffect(()=>{const l=setTimeout(()=>L(j.trim()),300);return()=>clearTimeout(l)},[j]);const{items:T,isLoading:C,isPlaceholderData:u,isError:S,hasNextPage:I,isFetchingNextPage:Y,fetchNextPage:$}=ye(["outfit-picker",c,s],l=>Xt({search:s||void 0,category:c,onSale:!0,listingType:"primary",first:24,skip:l,sortBy:"cheapest"})),g=e(c==="emote"?"outfits.studio.searchEmotes":"outfits.studio.searchWearables"),W=new Set,M=T.filter(l=>{if(!l.itemId)return!1;const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`;return W.has(v)?!1:(W.add(v),!0)});return t.jsxs(we,{"data-testid":"outfit-picker",children:[t.jsx(Se,{role:"group","aria-label":e("outfits.studio.pickerCategory"),"data-testid":"outfit-picker-category",children:Re.map(({key:l,labelKey:v})=>t.jsx(ke,{type:"button","data-category":l,"data-selected":c===l||void 0,"aria-pressed":c===l,onClick:()=>{y(l),b("")},children:e(v)},l))}),t.jsxs($e,{children:[t.jsx(K,{name:"search",color:dt.colors.muted}),t.jsx("input",{value:j,placeholder:g,"aria-label":g,onChange:l=>b(l.target.value),"data-testid":"outfit-picker-search"})]}),S?t.jsx("p",{className:"muted small",children:e("outfits.errors.generic")}):C||u?t.jsx(jt,{"aria-busy":"true",children:Array.from({length:8},(l,v)=>t.jsx(Te,{className:"skeleton","aria-hidden":!0},v))}):M.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noResults")}):t.jsx(jt,{children:M.map(l=>{const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`,U=r.has(v);return t.jsxs(Ce,{type:"button","data-testid":"outfit-picker-item","data-selected":U||void 0,disabled:!U&&!f(l),onClick:()=>m(l),title:l.name,children:[t.jsx(Ie,{src:l.thumbnail,alt:"",loading:"lazy"}),t.jsx(Ee,{children:l.name}),t.jsxs(Le,{children:[t.jsx(st,{size:12}),l.priceCredits.toLocaleString()]}),U?t.jsx(Ne,{name:"check-rounded",size:18}):null]},v)})}),!S&&!C&&!u?t.jsx(be,{auto:!1,hasNextPage:!!I,isFetching:Y,onLoadMore:()=>void $()}):null]})}const{colors:a,radius:w,media:B,z:Pe}=dt,Nt=o.div`
|
|
106
106
|
max-width: 1200px;
|
|
107
107
|
margin: 0 auto;
|
|
108
108
|
display: flex;
|
|
@@ -126,7 +126,7 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
126
126
|
font-size: 24px;
|
|
127
127
|
font-weight: 800;
|
|
128
128
|
margin-right: auto;
|
|
129
|
-
`,Oe=o(
|
|
129
|
+
`,Oe=o(F)`
|
|
130
130
|
display: inline-flex;
|
|
131
131
|
align-items: center;
|
|
132
132
|
justify-content: center;
|
|
@@ -156,10 +156,10 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: column;
|
|
158
158
|
gap: 10px;
|
|
159
|
-
`,
|
|
159
|
+
`,Fe=o.span`
|
|
160
160
|
height: 76px;
|
|
161
161
|
border-radius: ${w.card};
|
|
162
|
-
`,
|
|
162
|
+
`,Ae=o.div`
|
|
163
163
|
display: flex;
|
|
164
164
|
align-items: center;
|
|
165
165
|
gap: 14px;
|
|
@@ -189,7 +189,7 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
189
189
|
`,Me=o.span`
|
|
190
190
|
${Ot};
|
|
191
191
|
display: inline-block;
|
|
192
|
-
`,
|
|
192
|
+
`,Ue=o.div`
|
|
193
193
|
flex: 1;
|
|
194
194
|
min-width: 0;
|
|
195
195
|
display: flex;
|
|
@@ -201,7 +201,7 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
201
201
|
white-space: nowrap;
|
|
202
202
|
overflow: hidden;
|
|
203
203
|
text-overflow: ellipsis;
|
|
204
|
-
`,
|
|
204
|
+
`,De=o.span`
|
|
205
205
|
display: inline-flex;
|
|
206
206
|
align-items: center;
|
|
207
207
|
gap: 8px;
|
|
@@ -261,12 +261,12 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
261
261
|
`,Qe=o.h2`
|
|
262
262
|
font-size: 18px;
|
|
263
263
|
font-weight: 800;
|
|
264
|
-
`,
|
|
264
|
+
`,Ve=o.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-wrap: wrap;
|
|
267
267
|
gap: 10px;
|
|
268
268
|
margin-top: 6px;
|
|
269
|
-
`,
|
|
269
|
+
`,Je=o.div`
|
|
270
270
|
display: grid;
|
|
271
271
|
grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
|
|
272
272
|
gap: 32px;
|
|
@@ -453,17 +453,17 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
453
453
|
&[data-missing] {
|
|
454
454
|
opacity: 0.6;
|
|
455
455
|
}
|
|
456
|
-
`,
|
|
456
|
+
`,Ft=kt`
|
|
457
457
|
width: 40px;
|
|
458
458
|
height: 40px;
|
|
459
459
|
border-radius: 8px;
|
|
460
460
|
background: ${a.media};
|
|
461
461
|
flex-shrink: 0;
|
|
462
462
|
`,mi=o.img`
|
|
463
|
-
${
|
|
463
|
+
${Ft};
|
|
464
464
|
object-fit: cover;
|
|
465
465
|
`,hi=o.span`
|
|
466
|
-
${
|
|
466
|
+
${Ft};
|
|
467
467
|
display: inline-block;
|
|
468
468
|
`,xi=o.span`
|
|
469
469
|
flex: 1;
|
|
@@ -534,4 +534,4 @@ import{r as d,j as t,L as A,u as Qt,b as Jt,d as Vt}from"./react-DehiWSvs.js";im
|
|
|
534
534
|
display: flex;
|
|
535
535
|
flex-wrap: wrap;
|
|
536
536
|
gap: 10px;
|
|
537
|
-
`;function Di(){const{id:r}=Qt(),{pathname:m}=Jt(),f=V(b=>b.session),c=V(b=>b.signIn),y=Yt();Zt({title:e("outfits.studio.title"),noindex:!0});const j=m.endsWith("/new")?"new":r?"edit":"list";return y==="pending"?t.jsx(P,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?y!=="creator"?t.jsxs(P,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:A,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(ki,{}):t.jsx(Ii,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(P,{"data-testid":"outfit-studio-signin",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"purple",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Si({outfit:r}){const m=It(r.thumbnailHash);return m?t.jsx(Be,{style:{background:le(r)},children:t.jsx("img",{src:m,alt:"",loading:"lazy"})}):t.jsx(Me,{"aria-hidden":!0})}function ki(){const r=V(u=>u.session),m=Tt(),[f,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:s,isError:L,refetch:T}=Ct({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>xe(r.identity)});async function C(u,S){if(r){j(u.id);try{S==="delete"?(await ue(u.id,r.identity),F.success(e("outfits.studio.deleted"))):(await Et({...rt(u),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Lt(m)}catch(I){I instanceof O||at(I,{flow:`outfit-${S}`}),F.error(e(I instanceof O?nt(I.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Nt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Rt,{children:[t.jsx(zt,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:A,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Ae,{className:"skeleton","aria-hidden":!0},S))}):L?t.jsxs(P,{children:[t.jsx(U,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void T(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(wt,{children:b.map(u=>t.jsxs(Fe,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Si,{outfit:u}),t.jsxs(De,{children:[t.jsx(He,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(Ue,{children:[t.jsx(Pt,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ke,{children:[u.published?t.jsx(x,{as:A,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:A,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(We,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),f?t.jsxs(_e,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ge,{onClick:()=>c(null)}),t.jsxs(qe,{children:[t.jsx(Qe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Je,{children:[f.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===f.id,onClick:()=>void C(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===f.id,onClick:()=>void C(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const St=["image/png","image/jpeg","image/webp"];function Ti(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:ot.from,gradientTo:ot.to,published:!1}}function rt(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function Ci(r){try{const m=sessionStorage.getItem(r);return m?JSON.parse(m):null}catch{return null}}function Ii({outfitId:r}){const m=r===null,f=`outfit-draft:${r??"new"}`,c=V(i=>i.session),y=Tt(),j=Vt(),[b]=d.useState(()=>Ci(f)),[s,L]=d.useState(()=>b??(m?Ti():null)),[T,C]=d.useState(!!b),{data:u,isLoading:S,isError:I,refetch:Y}=Ct({queryKey:["outfit",r,!0],enabled:!m&&!!c,staleTime:0,queryFn:()=>ge(r,c.identity)});d.useEffect(()=>{u&&L(i=>i??rt(u))},[u]);function $(i){L(n=>n&&{...n,...i}),C(!0)}d.useEffect(()=>{if(!(!s||!T))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,T,f]),d.useEffect(()=>{if(!T)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[T]),d.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const g=te(s??void 0),W=d.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(N)),[s]),M=i=>he((s==null?void 0:s.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=J;function v(i){!s||!l(i)||$({items:M(i)})}const[D,lt]=d.useState(null),E=d.useRef(null),Z=d.useRef(!0);d.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]);const[_,ut]=d.useState(!1),[Ft,G]=d.useState(null),[tt,ct]=d.useState(""),[Bt,pt]=d.useState(null),[k,Mt]=d.useState();d.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ft(){const i=fe(tt);if(!i){pt(e("outfits.studio.importError"));return}pt(null),ct(""),Mt(i.colors),$({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Dt(i){if(!i||!c)return;if(G(null),!St.includes(i.type)){G(e("outfits.errors.unsupportedType"));return}if(i.size>ce){G(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,lt(n),ut(!0);try{const p=await pe(i,c.identity);$({thumbnailHash:p})}catch(p){p instanceof O||at(p,{flow:"outfit-thumbnail"}),G(e(p instanceof O?nt(p.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),lt(null)}finally{ut(!1)}}const[H,mt]=d.useState(!1),[Ht,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Ut=!!s&&Q(s.gradientFrom)&&Q(s.gradientTo),xt=!!s&&s.items.some(i=>{const n=g.byKey.get(N(i));return!n||ee(n)}),gt=!!s&&et&&!!s.thumbnailHash&&Ut&&xt&&s.items.length>=ie&&s.items.length<=J;async function it(i){if(!(!c||!s||H)){mt(!0),ht(null);try{const n=await Et({...s,published:i},c.identity,m?"create":"update");if(!Z.current)return;sessionStorage.removeItem(f),L(rt(n)),C(!1),Lt(y),i&&!s.published?(me("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),m&&(y.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof O||at(n,{flow:"outfit-save"}),ht(e(n instanceof O?nt(n.code):"outfits.errors.generic"))}finally{mt(!1)}}}const q=d.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>g.byKey.get(N(i))).filter(i=>!!i),[s,g.byKey]),bt=d.useMemo(()=>se(q),[q]),Kt=d.useMemo(()=>{const i=oe(q);return i!=null&&i.itemId?N({contractAddress:i.contractAddress,itemId:i.itemId}):null},[q]),Wt=(s==null?void 0:s.bodyShape)==="female"?ae:(s==null?void 0:s.bodyShape)==="male"?ne:void 0;if(!c)return null;if(!s)return I?t.jsxs(P,{children:[t.jsx(U,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void Y(),children:e("outfits.detail.retry")})]}):!S&&u===null?t.jsxs(P,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(x,{as:A,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(P,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const yt=D??It(s.thumbnailHash),_t={...s,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Gt=s.items.reduce((i,n)=>{var p;return i+(((p=g.byKey.get(N(n)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Nt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Rt,{children:[t.jsx(Oe,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(zt,{children:m?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Pt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Ve,{children:[t.jsxs(Xe,{children:[t.jsxs(Ze,{"data-testid":"outfit-studio-preview",style:{background:re(s)},children:[t.jsx(je,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Wt,urns:bt,skin:k==null?void 0:k.skin,hair:k==null?void 0:k.hair,eyes:k==null?void 0:k.eyes,enabled:!g.isLoading}),bt.length===0&&!g.isLoading?t.jsx(ti,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(ei,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ii,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>$({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(oi,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(ai,{children:[t.jsx(ni,{type:"color",value:Q(s[i])?s[i]:ot.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>$({[i]:n.target.value.toLowerCase()})}),t.jsxs(ri,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(di,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!Q(s[i])||void 0,onChange:n=>{const p=n.target.value.trim().toLowerCase();$({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.thumbnail")}),yt?t.jsx(si,{"data-busy":_||void 0,children:t.jsx("img",{src:yt,alt:""})}):null,t.jsxs(ui,{as:"label",variant:"outline",size:"sm","data-busy":_||void 0,children:[_?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:St.join(","),hidden:!0,disabled:_,onChange:i=>{var n;return void Dt((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(U,{message:Ft,testId:"outfit-studio-thumb-error"})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(li,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(de,{outfit:_t,resolution:g})})]})]}),t.jsxs(Ye,{children:[t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(ci,{children:[t.jsx($t,{id:"outfit-import",value:tt,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>ct(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:tt.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(U,{message:Bt,testId:"outfit-studio-import-error"})]}),t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx($t,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>$({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(R,{children:[t.jsxs(z,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",J,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(pi,{children:s.items.map(i=>{const n=N(i),p=g.byKey.get(n);return t.jsxs(fi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(mi,{src:p.thumbnail,alt:""}):t.jsx(hi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(xi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?"…":e("outfits.card.unavailable")}),n===Kt?t.jsx(gi,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(bi,{children:[t.jsx(st,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(vi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>$({items:s.items.filter(qt=>N(qt)!==n)}),children:t.jsx(K,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(yi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ji,{children:[t.jsx(st,{size:14}),Gt.toLocaleString()]})]}):null,s.items.length>=J?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ze,{selectedKeys:W,onPick:v,canPick:l})]})]}),t.jsxs(wi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(U,{message:Ht,testId:"outfit-studio-save-error"}),et?!gt&&!s.published?t.jsx("p",{className:"muted small","data-testid":"outfit-studio-publish-hint",children:!xt&&s.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs($i,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:H||!et,onClick:()=>void it(s.published),children:H?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:H,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:H||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Di as OutfitStudio,Di as default};
|
|
537
|
+
`;function Ui(){const{id:r}=Qt(),{pathname:m}=Vt(),f=J(b=>b.session),c=J(b=>b.signIn),y=Yt();Zt({title:e("outfits.studio.title"),noindex:!0});const j=m.endsWith("/new")?"new":r?"edit":"list";return y==="pending"?t.jsx(P,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?y!=="creator"?t.jsxs(P,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:F,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(ki,{}):t.jsx(Ii,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(P,{"data-testid":"outfit-studio-signin",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"purple",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Si({outfit:r}){const m=It(r.thumbnailHash);return m?t.jsx(Be,{style:{background:le(r)},children:t.jsx("img",{src:m,alt:"",loading:"lazy"})}):t.jsx(Me,{"aria-hidden":!0})}function ki(){const r=J(u=>u.session),m=Tt(),[f,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:s,isError:L,refetch:T}=Ct({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>xe(r.identity)});async function C(u,S){if(r){j(u.id);try{S==="delete"?(await ue(u.id,r.identity),A.success(e("outfits.studio.deleted"))):(await Et({...rt(u),published:!1},r.identity,"update"),A.success(e("outfits.studio.unpublished"))),Lt(m)}catch(I){I instanceof O||at(I,{flow:`outfit-${S}`}),A.error(e(I instanceof O?nt(I.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Nt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Rt,{children:[t.jsx(zt,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:F,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Fe,{className:"skeleton","aria-hidden":!0},S))}):L?t.jsxs(P,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void T(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(wt,{children:b.map(u=>t.jsxs(Ae,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Si,{outfit:u}),t.jsxs(Ue,{children:[t.jsx(He,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(De,{children:[t.jsx(Pt,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ke,{children:[u.published?t.jsx(x,{as:F,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:F,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(We,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),f?t.jsxs(_e,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ge,{onClick:()=>c(null)}),t.jsxs(qe,{children:[t.jsx(Qe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ve,{children:[f.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===f.id,onClick:()=>void C(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===f.id,onClick:()=>void C(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const St=["image/png","image/jpeg","image/webp"];function Ti(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:ot.from,gradientTo:ot.to,published:!1}}function rt(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function Ci(r){try{const m=sessionStorage.getItem(r);return m?JSON.parse(m):null}catch{return null}}function Ii({outfitId:r}){const m=r===null,f=`outfit-draft:${r??"new"}`,c=J(i=>i.session),y=Tt(),j=Jt(),[b]=d.useState(()=>Ci(f)),[s,L]=d.useState(()=>b??(m?Ti():null)),[T,C]=d.useState(!!b),{data:u,isLoading:S,isError:I,refetch:Y}=Ct({queryKey:["outfit",r,!0],enabled:!m&&!!c,staleTime:0,queryFn:()=>ge(r,c.identity)});d.useEffect(()=>{u&&L(i=>i??rt(u))},[u]);function $(i){L(n=>n&&{...n,...i}),C(!0)}d.useEffect(()=>{if(!(!s||!T))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,T,f]),d.useEffect(()=>{if(!T)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[T]),d.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const g=te(s??void 0),W=d.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(N)),[s]),M=i=>he((s==null?void 0:s.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=V;function v(i){!s||!l(i)||$({items:M(i)})}const[U,lt]=d.useState(null),E=d.useRef(null),Z=d.useRef(!0);d.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]);const[_,ut]=d.useState(!1),[At,G]=d.useState(null),[tt,ct]=d.useState(""),[Bt,pt]=d.useState(null),[k,Mt]=d.useState();d.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ft(){const i=fe(tt);if(!i){pt(e("outfits.studio.importError"));return}pt(null),ct(""),Mt(i.colors),$({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),A.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ut(i){if(!i||!c)return;if(G(null),!St.includes(i.type)){G(e("outfits.errors.unsupportedType"));return}if(i.size>ce){G(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,lt(n),ut(!0);try{const p=await pe(i,c.identity);$({thumbnailHash:p})}catch(p){p instanceof O||at(p,{flow:"outfit-thumbnail"}),G(e(p instanceof O?nt(p.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),lt(null)}finally{ut(!1)}}const[H,mt]=d.useState(!1),[Ht,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Dt=!!s&&Q(s.gradientFrom)&&Q(s.gradientTo),xt=!!s&&s.items.some(i=>{const n=g.byKey.get(N(i));return!n||ee(n)}),gt=!!s&&et&&!!s.thumbnailHash&&Dt&&xt&&s.items.length>=ie&&s.items.length<=V;async function it(i){if(!(!c||!s||H)){mt(!0),ht(null);try{const n=await Et({...s,published:i},c.identity,m?"create":"update");if(!Z.current)return;sessionStorage.removeItem(f),L(rt(n)),C(!1),Lt(y),i&&!s.published?(me("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),A.success(e("outfits.studio.publishedToast"))):A.success(e("outfits.studio.saved")),m&&(y.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof O||at(n,{flow:"outfit-save"}),ht(e(n instanceof O?nt(n.code):"outfits.errors.generic"))}finally{mt(!1)}}}const q=d.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>g.byKey.get(N(i))).filter(i=>!!i),[s,g.byKey]),bt=d.useMemo(()=>se(q),[q]),Kt=d.useMemo(()=>{const i=oe(q);return i!=null&&i.itemId?N({contractAddress:i.contractAddress,itemId:i.itemId}):null},[q]),Wt=(s==null?void 0:s.bodyShape)==="female"?ae:(s==null?void 0:s.bodyShape)==="male"?ne:void 0;if(!c)return null;if(!s)return I?t.jsxs(P,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void Y(),children:e("outfits.detail.retry")})]}):!S&&u===null?t.jsxs(P,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(x,{as:F,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(P,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const yt=U??It(s.thumbnailHash),_t={...s,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Gt=s.items.reduce((i,n)=>{var p;return i+(((p=g.byKey.get(N(n)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Nt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Rt,{children:[t.jsx(Oe,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(zt,{children:m?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Pt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Je,{children:[t.jsxs(Xe,{children:[t.jsxs(Ze,{"data-testid":"outfit-studio-preview",style:{background:re(s)},children:[t.jsx(je,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Wt,urns:bt,skin:k==null?void 0:k.skin,hair:k==null?void 0:k.hair,eyes:k==null?void 0:k.eyes,enabled:!g.isLoading}),bt.length===0&&!g.isLoading?t.jsx(ti,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(ei,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ii,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>$({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(oi,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(ai,{children:[t.jsx(ni,{type:"color",value:Q(s[i])?s[i]:ot.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>$({[i]:n.target.value.toLowerCase()})}),t.jsxs(ri,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(di,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!Q(s[i])||void 0,onChange:n=>{const p=n.target.value.trim().toLowerCase();$({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.thumbnail")}),yt?t.jsx(si,{"data-busy":_||void 0,children:t.jsx("img",{src:yt,alt:""})}):null,t.jsxs(ui,{as:"label",variant:"outline",size:"sm","data-busy":_||void 0,children:[_?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:St.join(","),hidden:!0,disabled:_,onChange:i=>{var n;return void Ut((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:At,testId:"outfit-studio-thumb-error"})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(li,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(de,{outfit:_t,resolution:g})})]})]}),t.jsxs(Ye,{children:[t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(ci,{children:[t.jsx($t,{id:"outfit-import",value:tt,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>ct(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:tt.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(D,{message:Bt,testId:"outfit-studio-import-error"})]}),t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx($t,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>$({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(R,{children:[t.jsxs(z,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",V,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(pi,{children:s.items.map(i=>{const n=N(i),p=g.byKey.get(n);return t.jsxs(fi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(mi,{src:p.thumbnail,alt:""}):t.jsx(hi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(xi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?"…":e("outfits.card.unavailable")}),n===Kt?t.jsx(gi,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(bi,{children:[t.jsx(st,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(vi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>$({items:s.items.filter(qt=>N(qt)!==n)}),children:t.jsx(K,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(yi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ji,{children:[t.jsx(st,{size:14}),Gt.toLocaleString()]})]}):null,s.items.length>=V?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ze,{selectedKeys:W,onPick:v,canPick:l})]})]}),t.jsxs(wi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Ht,testId:"outfit-studio-save-error"}),et?!gt&&!s.published?t.jsx("p",{className:"muted small","data-testid":"outfit-studio-publish-hint",children:!xt&&s.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs($i,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:H||!et,onClick:()=>void it(s.published),children:H?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:H,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:H||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ui as OutfitStudio,Ui as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as oe,
|
|
1
|
+
import{j as t,L as oe,e as le,r as l}from"./react-OEOSdkUk.js";import{b as s,t as j,s as a,w as ce,B as G,x as de,o as pe,A as ue,br as ge,bw as me,bx as xe,by as he,bz as R,I as N,bA as f,bB as fe,E as F}from"./index-0kdmGL8P.js";import{E as M}from"./ErrorNotice-Q_ppMazV.js";import{F as w}from"./field.styles-ChGQv28p.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const ve="https://cdn.decentraland.org/@dcl/shop/0.8.1-31010487922.commit-7e8c168/_assets/template-cover-1-BETekfHg.jpeg",be="https://cdn.decentraland.org/@dcl/shop/0.8.1-31010487922.commit-7e8c168/_assets/template-cover-2-Dni9s0i_.jpeg",we=Object.assign({"../assets/creator-covers/template-cover-1.jpeg":ve,"../assets/creator-covers/template-cover-2.jpeg":be}),v=Object.entries(we).sort(([r],[u])=>r.localeCompare(u)).map(([r,u])=>({name:r.split("/").pop(),url:u})),je=ce`
|
|
2
2
|
to {
|
|
3
3
|
transform: rotate(360deg);
|
|
4
4
|
}
|
|
@@ -46,11 +46,11 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
46
46
|
`,$e=a.span`
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
font-weight: 600;
|
|
49
|
-
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:n,radius:_e,media:
|
|
49
|
+
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:n,radius:_e,media:K}=j,Ee=a(ye)`
|
|
50
50
|
display: grid;
|
|
51
51
|
place-items: center;
|
|
52
52
|
min-height: 60vh;
|
|
53
|
-
`,ze=a(
|
|
53
|
+
`,ze=a(G)`
|
|
54
54
|
align-self: center;
|
|
55
55
|
min-width: 200px;
|
|
56
56
|
margin-top: 8px;
|
|
@@ -155,7 +155,7 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
155
155
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
156
156
|
gap: 12px;
|
|
157
157
|
|
|
158
|
-
${
|
|
158
|
+
${K.maxWidth("mobile")} {
|
|
159
159
|
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
160
160
|
}
|
|
161
161
|
`,C=a.button`
|
|
@@ -219,21 +219,21 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
219
219
|
&[data-variant='upload']:hover .ico {
|
|
220
220
|
background: ${n.accent};
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
222
|
+
`,Ae=a.input`
|
|
223
223
|
position: absolute;
|
|
224
224
|
width: 1px;
|
|
225
225
|
height: 1px;
|
|
226
226
|
opacity: 0;
|
|
227
227
|
pointer-events: none;
|
|
228
|
-
`,
|
|
228
|
+
`,Pe=a.div`
|
|
229
229
|
display: flex;
|
|
230
230
|
justify-content: flex-end;
|
|
231
231
|
gap: 12px;
|
|
232
232
|
margin-top: 8px;
|
|
233
|
-
`,
|
|
233
|
+
`,Re=a(G)`
|
|
234
234
|
min-width: 180px;
|
|
235
235
|
|
|
236
|
-
${
|
|
236
|
+
${K.maxWidth("mobile")} {
|
|
237
237
|
width: 100%;
|
|
238
238
|
}
|
|
239
|
-
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function
|
|
239
|
+
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function Ke(){de({title:s("seo.storeSettings.title"),noindex:!0});const{session:r,signIn:u}=pe(),S=le(),k=ue(),p=r==null?void 0:r.address,{data:$,isLoading:q}=ge(p),[o,g]=l.useState(W),[L,H]=l.useState(W),[y,x]=l.useState(),[h,I]=l.useState(!1),[c,_]=l.useState(null),[b,J]=l.useState({}),T=l.useRef(null);l.useEffect(()=>{if($){const e=me($);g(e),H(e),x(void 0),_(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[$]),l.useEffect(()=>{let e=!1;return Promise.all(v.map(async i=>[i.name,await xe(i.url)])).then(i=>{e||J(Object.fromEntries(i))}).catch(()=>{}),()=>{e=!0}},[]);const E=l.useMemo(()=>{const e=v.find(d=>o.coverName===`cover/${d.name}`);if(e)return e.name;const i=o.coverHash?v.find(d=>b[d.name]===o.coverHash):void 0;return i==null?void 0:i.name},[o.coverName,o.coverHash,b]);l.useEffect(()=>{c!=null&&c.hash&&v.some(e=>b[e.name]===c.hash)&&_(null)},[b,c]);const B=y!==void 0&&y>V,Q=l.useMemo(()=>he.filter(e=>!R(e,o.links[e])),[o.links]),U=B||Q.length>0,z=l.useMemo(()=>JSON.stringify(o)!==JSON.stringify(L),[o,L]),X=z&&!U&&!h;if(l.useEffect(()=>{if(!z)return;const e=i=>{i.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[z]),!r)return t.jsxs(O,{"data-signin":!0,"aria-label":s("storeSettings.title"),children:[t.jsx(D,{children:s("storeSettings.title")}),t.jsx("p",{className:"muted",children:s("storeSettings.signInPrompt")}),t.jsx(ze,{variant:"purple",onClick:u,children:s("storeSettings.signIn")})]});function Z(e,i){x(void 0),g(d=>({...d,cover:i,coverName:`cover/${e}`,coverHash:""}))}const ee=["image/png","image/jpeg","image/webp"];function te(e){var A;const i=(A=e.target.files)==null?void 0:A[0];if(!i||!ee.includes(i.type))return;x(i.size);const d=`cover/${i.name}`,m=new FileReader;m.onload=()=>{const P=m.result;_({url:P,name:d,hash:""}),g(re=>({...re,cover:P,coverName:d,coverHash:""}))},m.readAsDataURL(i)}function ie(){c&&(x(void 0),g(e=>({...e,cover:c.url,coverName:c.name,coverHash:c.hash})))}function se(e,i){const d=i?(f[e]+i).replace(/\s/g,""):"";g(m=>({...m,links:{...m.links,[e]:d}}))}function ne(e){const i=o.links[e];return e==="website"?i:i.replace(f[e],"")}async function ae(){if(!(!p||!r)){I(!0);try{await fe(p,o,r.identity),H(o),x(void 0),await k.invalidateQueries({queryKey:["store",p.toLowerCase()]}),F.success(s("storeSettings.saved")),S(`/items/creator/${p}`)}catch{F.error(s("storeSettings.saveError"))}finally{I(!1)}}}return t.jsxs(O,{"aria-label":s("storeSettings.title"),children:[t.jsxs(Ne,{children:[t.jsxs(Ce,{children:[p?t.jsx(Le,{to:`/items/creator/${p}`,title:s("storeSettings.back"),"aria-label":s("storeSettings.back"),children:t.jsx(N,{name:"arrow-left"})}):null,t.jsx(D,{children:s("storeSettings.title")})]}),p?t.jsxs(He,{href:`/items/creator/${p}`,target:"_blank",rel:"noopener noreferrer",children:[s("storeSettings.seeAsGuest"),t.jsx(N,{name:"external-link"})]}):null]}),q?t.jsx(Ee,{size:"large",label:s("storeSettings.loading")}):t.jsxs(t.Fragment,{children:[t.jsxs(w,{children:[t.jsx("span",{className:"field__label",children:s("storeSettings.cover")}),t.jsxs(Be,{role:"group","aria-label":s("storeSettings.cover"),children:[v.map(e=>{const i=E===e.name;return t.jsx(C,{type:"button","data-testid":"cover-picker-tile","data-selected":i,"aria-pressed":i,onClick:()=>Z(e.name,e.url),children:t.jsx("img",{src:e.url,alt:"",loading:"lazy"})},e.name)}),c?t.jsx(C,{type:"button","data-testid":"cover-picker-tile","data-variant":"custom","data-selected":!E,"aria-pressed":!E,onClick:ie,children:t.jsx("img",{src:c.url,alt:""})}):null,t.jsxs(C,{type:"button","data-testid":"cover-picker-tile","data-variant":"upload",onClick:()=>{var e;return(e=T.current)==null?void 0:e.click()},children:[t.jsx(N,{name:"upload"}),t.jsx("span",{children:s("storeSettings.upload")})]}),t.jsx(Ae,{ref:T,type:"file",accept:"image/png, image/jpeg, image/webp","data-testid":"cover-picker-input",onChange:te})]}),B?t.jsx(M,{message:s("storeSettings.sizeError",{max:Y(V),current:Y(y)})}):null]}),t.jsxs(w,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.description")}),t.jsx("textarea",{value:o.description,rows:4,disabled:h,onChange:e=>g(i=>({...i,description:e.target.value}))})]}),t.jsxs(w,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.website")}),t.jsx("input",{type:"url",value:o.links.website,placeholder:f.website,disabled:h,onChange:e=>g(i=>({...i,links:{...i.links,website:e.target.value.replace(/\s/g,"")}}))}),R("website",o.links.website)?null:t.jsx(M,{message:s("storeSettings.linkError",{value:f.website})})]}),["twitter","discord","facebook"].map(e=>t.jsxs(w,{as:"label",children:[t.jsx("span",{className:"field__label",children:s(`storeSettings.${e}`)}),t.jsxs(Ie,{children:[t.jsx(Te,{children:f[e]}),t.jsx("input",{type:"text",value:ne(e),disabled:h,onChange:i=>se(e,i.target.value)})]})]},e)),t.jsx(Pe,{children:t.jsx(Re,{variant:"purple","data-testid":"store-settings-save",onClick:()=>void ae(),disabled:!X,children:h?s("storeSettings.saving"):s("storeSettings.save")})})]})]})}export{Ke as StoreSettings,Ke as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-
|
|
2
|
-
import{r as g,j as e,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-DrfFlp1M.js","_assets/react-OEOSdkUk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as g,j as e,d as P,e as N,N as M}from"./react-OEOSdkUk.js";import{s as t,_ as I,t as D,z as E,aC as F,ah as O,o as W,x as q,b as n,y as U,C as V,aD as H,c as _,B as J,aE as X}from"./index-0kdmGL8P.js";import{w as G,S as K}from"./buy-gasless-uXmROTXZ.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./authorizations-BixBV4TD.js";import"./sendMetaTransaction-DqzmtvVe.js";import"./buy-C6t8EdJL.js";const Q=t.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|
|
@@ -14,7 +14,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
14
14
|
*/
|
|
15
15
|
z-index: -1;
|
|
16
16
|
pointer-events: none;
|
|
17
|
-
`,Y=g.lazy(async()=>{const[{default:c},{default:r}]=await Promise.all([I(()=>import("./index.es-
|
|
17
|
+
`,Y=g.lazy(async()=>{const[{default:c},{default:r}]=await Promise.all([I(()=>import("./index.es-DrfFlp1M.js"),__vite__mapDeps([0,1])),I(()=>import("./confettiAnimation-BpyTLLuX.js"),[])]);return{default:()=>e.jsx(c,{animationData:r,loop:1})}});function Z(){const[c]=g.useState(()=>{var r;return!((r=window.matchMedia)!=null&&r.call(window,"(prefers-reduced-motion: reduce)").matches)});return c?e.jsx(Q,{"aria-hidden":!0,"data-testid":"confetti",children:e.jsx(g.Suspense,{fallback:null,children:e.jsx(Y,{})})}):null}const{colors:s,radius:m}=D,j="@media (max-width: 600px)",L=t.div`
|
|
18
18
|
/* Its own stacking context, above the confetti layer (z-index 0). Needed because z-index is inert without
|
|
19
19
|
a position, so the content would otherwise sit below the burst regardless of order. */
|
|
20
20
|
position: relative;
|
|
@@ -43,7 +43,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
43
43
|
font-size: 18px;
|
|
44
44
|
color: #4b4b57;
|
|
45
45
|
margin: 0 0 22px;
|
|
46
|
-
`,
|
|
46
|
+
`,y=t.div`
|
|
47
47
|
display: flex;
|
|
48
48
|
gap: 18px;
|
|
49
49
|
justify-content: center;
|
|
@@ -121,7 +121,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
121
121
|
border-radius: ${m.btn};
|
|
122
122
|
background: #f4e9ff;
|
|
123
123
|
color: ${s.text};
|
|
124
|
-
`,xe=t(
|
|
124
|
+
`,xe=t(E)`
|
|
125
125
|
width: 30px;
|
|
126
126
|
height: 30px;
|
|
127
127
|
color: ${s.text};
|
|
@@ -196,12 +196,12 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
196
196
|
${j} {
|
|
197
197
|
font-size: 16px;
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,ye=t.span`
|
|
200
200
|
margin-left: 8px;
|
|
201
201
|
font-weight: 600;
|
|
202
202
|
font-size: 13px;
|
|
203
203
|
color: ${s.muted};
|
|
204
|
-
`,
|
|
204
|
+
`,be=t(F)`
|
|
205
205
|
position: relative;
|
|
206
206
|
z-index: 1;
|
|
207
207
|
color: ${s.muted};
|
|
@@ -210,7 +210,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
210
210
|
& [data-avatar] {
|
|
211
211
|
display: none;
|
|
212
212
|
}
|
|
213
|
-
`,
|
|
213
|
+
`,ve=t.div`
|
|
214
214
|
flex-shrink: 0;
|
|
215
215
|
display: flex;
|
|
216
216
|
align-items: center;
|
|
@@ -224,7 +224,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
224
224
|
${j} {
|
|
225
225
|
font-size: 18px;
|
|
226
226
|
}
|
|
227
|
-
`,ke=t(
|
|
227
|
+
`,ke=t(E)`
|
|
228
228
|
width: 22px;
|
|
229
229
|
height: 22px;
|
|
230
230
|
`,$e=t.div`
|
|
@@ -236,7 +236,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
236
236
|
${j} {
|
|
237
237
|
flex-direction: column-reverse;
|
|
238
238
|
}
|
|
239
|
-
`,
|
|
239
|
+
`,B=O`
|
|
240
240
|
flex: 1;
|
|
241
241
|
min-width: 0;
|
|
242
242
|
height: 48px;
|
|
@@ -278,9 +278,9 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
278
278
|
flex: none;
|
|
279
279
|
}
|
|
280
280
|
`,Ce=t.button`
|
|
281
|
-
${
|
|
281
|
+
${B};
|
|
282
282
|
`,ze=t.a`
|
|
283
|
-
${
|
|
283
|
+
${B};
|
|
284
284
|
`,Re=t.span`
|
|
285
285
|
display: inline-flex;
|
|
286
286
|
align-items: center;
|
|
@@ -293,4 +293,4 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
293
293
|
`,R=t(J)`
|
|
294
294
|
min-width: 160px;
|
|
295
295
|
text-align: center;
|
|
296
|
-
`;function Ae(c){return null}const Se=c=>new Promise(r=>setTimeout(r,c));function Ie(c,r){const[i,a]=g.useState(c?"pending":"confirmed"),x=r?`${r.owner}-${r.contractAddress}-${r.itemId}`:"";return g.useEffect(()=>{if(!c)return;let l=!1;return(async()=>{let f=!1;for(let o=0;o<20&&!l;o++)try{await G(c,{timeoutMs:15e3}),f=!0;break}catch(
|
|
296
|
+
`;function Ae(c){return null}const Se=c=>new Promise(r=>setTimeout(r,c));function Ie(c,r){const[i,a]=g.useState(c?"pending":"confirmed"),x=r?`${r.owner}-${r.contractAddress}-${r.itemId}`:"";return g.useEffect(()=>{if(!c)return;let l=!1;return(async()=>{let f=!1;for(let o=0;o<20&&!l;o++)try{await G(c,{timeoutMs:15e3}),f=!0;break}catch(v){if(v instanceof K)continue;l||a("failed");return}if(!l){if(!f){a("timed-out");return}if(!r){a("confirmed");return}a("indexing");for(let o=0;o<40&&!l;o++){if(await X(r.owner,r.contractAddress,r.itemId)){l||a("confirmed");return}await Se(3e3)}l||a("timed-out")}})(),()=>{l=!0}},[c,x]),i}const Le=_.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump",Te=_.chainId===80002?"https://amoy.polygonscan.com/tx/":"https://polygonscan.com/tx/";function Ue(){var S;const{state:c,search:r}=P(),i=c??Ae(),a=N(),{session:x}=W(),l=i==null?void 0:i.txHash,b=(i==null?void 0:i.items)??[],f=i!=null&&i.creditsAdded&&i.creditsAdded>0?i.creditsAdded:null,o=b[0],v=x!=null&&x.address&&(o!=null&&o.contractAddress)&&(o!=null&&o.itemId)?{owner:x.address,contractAddress:o.contractAddress,itemId:o.itemId}:null,u=Ie(i!=null&&i.settled?void 0:l,v);q({title:n("seo.success.title"),noindex:!0});const p=b;if(p.length===0)return e.jsx(M,{to:"/items",replace:!0});const A=p[0],w=(S=i==null?void 0:i.txHashes)!=null&&S.length?i.txHashes:l?[l]:[],h=w.length>0&&U(x==null?void 0:x.providerType)?w.map((d,k)=>e.jsx(ne,{href:`${Te}${d}`,target:"_blank",rel:"noreferrer",children:w.length>1?n("success.viewTransactionNumbered",{n:k+1,total:w.length}):n("success.viewTransaction")},d)):null;return u!=="confirmed"?e.jsx(L,{children:e.jsx(ee,{children:u==="pending"||u==="indexing"?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"spinner","aria-hidden":!0}),e.jsx(C,{children:u==="indexing"?n("success.finalizing"):n("success.processing")}),e.jsx(z,{children:u==="indexing"?e.jsxs(e.Fragment,{children:[n("success.indexingBefore")," ",p.length===1?e.jsx("strong",{children:A.name}):n("success.itemCount",{count:p.length})," ",n("success.indexingAfter")]}):e.jsxs(e.Fragment,{children:[n("success.confirmingBefore")," ",p.length===1?e.jsx("strong",{children:A.name}):n("success.itemCount",{count:p.length})," ",n("success.confirmingAfter")]})}),h?e.jsx(y,{children:h}):null]}):u==="timed-out"?e.jsxs(e.Fragment,{children:[e.jsx(C,{children:n("success.stillProcessingTitle")}),e.jsxs(z,{children:[n("success.timedOutBefore")," ",e.jsx("button",{className:"link",onClick:()=>a("/activity"),children:n("nav.activity")})," ",n("success.timedOutAfter")]}),h?e.jsx(y,{children:h}):null,e.jsxs(T,{children:[e.jsx(R,{variant:"purple",onClick:()=>a("/activity"),children:n("success.viewActivity")}),e.jsx(R,{variant:"ghost",onClick:()=>a("/items"),children:n("success.keepShopping")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{children:n("success.failedTitle")}),e.jsx(z,{children:n("success.failedBody")}),h?e.jsx(y,{children:h}):null,e.jsx(T,{children:e.jsx(R,{variant:"purple",onClick:()=>a("/items"),children:n("success.backToShop")})})]})})}):e.jsxs(L,{children:[e.jsx(Z,{}),e.jsxs(ie,{children:[e.jsxs(se,{role:"status",children:[e.jsx(re,{"aria-hidden":!0,children:e.jsxs("svg",{viewBox:"0 0 60 60",width:"60",height:"60",children:[e.jsx("circle",{cx:"30",cy:"30",r:"30",fill:"#34ce77"}),e.jsx("path",{d:"M18 31l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxs(oe,{children:[e.jsx("b",{children:n("success.bannerTitle")})," ",n("success.bannerBody")]})]}),e.jsxs(ce,{children:[f?e.jsxs(le,{"data-testid":"success-credits",children:[e.jsx(xe,{}),e.jsxs(he,{children:[e.jsx(pe,{children:n("getCredits.creditsAmount",{credits:f,currency:V.name})})," ",e.jsx(ue,{children:n("getCredits.creditsAdded")})]})]}):null,p.map((d,k)=>{const $=d.quantity??1;return e.jsxs(ae,{children:[k>0?e.jsx(de,{"aria-hidden":!0}):null,e.jsxs(fe,{children:[e.jsxs(ge,{children:[d.thumbnail?e.jsx("img",{src:d.thumbnail,alt:""}):null,e.jsx(me,{"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(je,{children:[e.jsxs(we,{title:d.name,children:[d.name||n("buyModal.itemFallback"),$>1?e.jsx(ye,{children:n("cartCheckout.qty",{count:$})}):null]}),d.creator?e.jsx(be,{address:d.creator,linkToProfile:!0}):null]}),e.jsxs(ve,{children:[e.jsx(ke,{}),e.jsx("span",{children:H(d.priceCredits*$)})]})]})]},d.id)})]}),h?e.jsx(y,{"data-receipt":!0,children:h}):null,e.jsxs($e,{children:[e.jsx(Ce,{"data-variant":"ghost",onClick:()=>a("/my-items"),children:n("success.myAssets")}),e.jsxs(ze,{"data-variant":"ruby",href:Le,target:"_blank",rel:"noreferrer",children:[n("success.tryInWorld"),e.jsx(Re,{"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]})]})}export{Ue as Success,Ue as default};
|