@dcl/shop 0.1.0-30461849576.commit-12d07d4 → 0.1.0-30465483842.commit-35256d2
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-CSuhDydH.js → Activity-BeTqkBj9.js} +7 -7
- package/assets/{AnimatedBackground-8Z_8Mlol.js → AnimatedBackground-Cn4Zf2W1.js} +1 -1
- package/assets/{Assets-SN3Y76GI.js → Assets-DudI0KEf.js} +7 -7
- package/assets/{Assets.styles-ciQtjliZ.js → Assets.styles-BVt9ny1H.js} +1 -1
- package/assets/{Authorizations-lx92TdPJ.js → Authorizations-BAz8f3JR.js} +1 -1
- package/assets/{Cart-B21LiuAo.js → Cart-ivYSIGG2.js} +2 -2
- package/assets/{CircularProgress-Djai3zyH.js → CircularProgress-CtiP6dpx.js} +1 -1
- package/assets/{Collection-CEQxSX4E.js → Collection-DtymV7vw.js} +1 -1
- package/assets/{CollectionCarousel-DfMAEnsm.js → CollectionCarousel-cAnwcIFc.js} +1 -1
- package/assets/{ConstantsUtil-CJLq5-wb.js → ConstantsUtil-CtukCvy7.js} +1 -1
- package/assets/{ContentClient-Dt2-TsxC.js → ContentClient-Y4SsAlAh.js} +1 -1
- package/assets/Creator-BXEtxAG-.js +306 -0
- package/assets/{DeploymentBuilder-Cu-VDjOR.js → DeploymentBuilder-GpEcBaRI.js} +1 -1
- package/assets/{ErrorNotice-CyxiR_Rh.js → ErrorNotice-CCmfdXO-.js} +1 -1
- package/assets/{ExchangeController-Z_fhiIuM.js → ExchangeController-DricVZKh.js} +1 -1
- package/assets/{GetCredits-Ctz5CKT1.js → GetCredits-CteYpfxR.js} +4 -4
- package/assets/{HelpersUtil-CfY7XYFI.js → HelpersUtil-CGIcCkK_.js} +1 -1
- package/assets/{ImportListings-DmVwt0Ax.js → ImportListings-Bbmrn90L.js} +8 -8
- package/assets/{ItemDetail-CX5br1KM.js → ItemDetail-0VoDt4ER.js} +3 -3
- package/assets/{LoadMore-BpBgRt6U.js → LoadMore-C4ahcKGI.js} +1 -1
- package/assets/{MenuList-D6x9iVBq.js → MenuList-B2tx2Rax.js} +1 -1
- package/assets/{MyAssets-BexRoK4a.js → MyAssets-CN-grtYY.js} +1 -1
- package/assets/{MyFavorites-YMHXyXLK.js → MyFavorites-BbfXGeat.js} +1 -1
- package/assets/{NetworkUtil-DrZx-6FF.js → NetworkUtil-DXqql1Wz.js} +1 -1
- package/assets/{NotFound-BGBtr9uR.js → NotFound-3nwiotnn.js} +1 -1
- package/assets/{NotificationsBell-DC-1Irju.js → NotificationsBell-HgkcWigI.js} +1 -1
- package/assets/{StoreSettings-U-7XtzFv.js → StoreSettings-qabn4ON-.js} +1 -1
- package/assets/{Success-DpsXoJt6.js → Success-CjzxOGc_.js} +1 -1
- package/assets/{SwapController-DYEFHcHa.js → SwapController-DMsZNMmX.js} +1 -1
- package/assets/{Tooltip-azUGAy-5.js → Tooltip-C7o9WgVx.js} +1 -1
- package/assets/{TradeService-DctYnk8d.js → TradeService-DPp_8P7A.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-E3LZaKPB.js → W3MFrameProviderSingleton-CTol_EUI.js} +3 -3
- package/assets/{WebCryptoP256-CVsQ_o8H.js → WebCryptoP256-DpdlkbHJ.js} +1 -1
- package/assets/{authorizations-wLlzXVR-.js → authorizations-93IYCFGd.js} +1 -1
- package/assets/{basic-CKpMAJq4.js → basic-CpElrsn8.js} +1 -1
- package/assets/{biconomy-C-ggcRFD.js → biconomy-DxKbEqvI.js} +1 -1
- package/assets/{browseLayout.styles-4wApiFUk.js → browseLayout.styles-oJ6cJp3z.js} +1 -1
- package/assets/{browser-CNT004n0.js → browser-DxF-qILS.js} +1 -1
- package/assets/browser-ponyfill-Bfl4ugg_.js +1 -0
- package/assets/{browser-ponyfill-C5PEoXZC.js → browser-ponyfill-CxIDDbrC.js} +1 -1
- package/assets/{builder-DMvOfu4D.js → builder-BxP8tT4f.js} +1 -1
- package/assets/{buy-F5h0O1Oz.js → buy-BYXdfz24.js} +1 -1
- package/assets/{buy-gasless-Bx1g9q5n.js → buy-gasless-BS7n5_qI.js} +1 -1
- package/assets/{categories-DSuB3dEO.js → categories-5tCT8xWh.js} +1 -1
- package/assets/{ccip-BO523Iyo.js → ccip-Bl6ljmaH.js} +1 -1
- package/assets/{ccip-DFl4XluK.js → ccip-D8XoWaW0.js} +1 -1
- package/assets/{chains-B1nqR6QI.js → chains-Dlj4CXzw.js} +1 -1
- package/assets/{clsx-CdAehort.js → clsx-GM87-Mfi.js} +2 -2
- package/assets/{common-D06fGQP-.js → common-B0ixkeRu.js} +1 -1
- package/assets/{controller--bXZwMEA.js → controller-B9756Ryj.js} +2 -2
- package/assets/{core-BBTEsxmO.js → core-CnxuTyuu.js} +4 -4
- package/assets/{createSvgIcon-CthtS2fU.js → createSvgIcon-tZB5vU5t.js} +2 -2
- package/assets/{custom-CsWArT5d.js → custom-BpAwBsCt.js} +1 -1
- package/assets/{data-capture-kKOdMtvw.js → data-capture-CHeYJ3vX.js} +1 -1
- package/assets/decimals-CMCAWgOh.js +1 -0
- package/assets/{decimals-DxZ5UHfB.js → decimals-CqRsKj6U.js} +1 -1
- package/assets/{detectExtension-FEABfJC9.js → detectExtension-DX7grDLh.js} +1 -1
- package/assets/{email-vr9UbC4V.js → email-XSD702LD.js} +1 -1
- package/assets/{embedded-wallet-DFmANWep.js → embedded-wallet-DXacld5x.js} +1 -1
- package/assets/{emotion-styled.browser.esm-BjmVKpEM.js → emotion-styled.browser.esm-CDVeR2pU.js} +1 -1
- package/assets/{engine-CIkOAXtz.js → engine-Dh3r5QUk.js} +1 -1
- package/assets/{errors-BHFRAZhi.js → errors-DLr34B3-.js} +1 -1
- package/assets/estimate-l1-fee-2qvKT5Nf.js +1 -0
- package/assets/eth_estimateGas-BZtzeL48.js +1 -0
- package/assets/{eth_getStorageAt-DTRcHmRI.js → eth_getStorageAt-E4OzrSEc.js} +1 -1
- package/assets/eth_getTransactionCount-Ck8bEyl_.js +1 -0
- package/assets/{ethereum-BtCbkX0F.js → ethereum-CBeS7QFR.js} +1 -1
- package/assets/{ethers-C3WgUna9.js → ethers--abqWJu6.js} +1 -1
- package/assets/{execute-DXk7xWDJ.js → execute-BjxgVD5q.js} +2 -2
- package/assets/{extractIPFS-CSmwBy8V.js → extractIPFS-ChPZSPQw.js} +1 -1
- package/assets/{features-CB_msUrB.js → features-ZVa1PXQo.js} +1 -1
- package/assets/{fetchTokenMetadata-BonBD4HK.js → fetchTokenMetadata-BonGxoWN.js} +2 -2
- package/assets/{fortmatic-ClwQlaPX.js → fortmatic-HaPICQeD.js} +1 -1
- package/assets/{get-bytecode-DKGahtxz.js → get-bytecode-BRKTQsHC.js} +1 -1
- package/assets/get-ecosystem-wallet-info-BxqcPq0B.js +1 -0
- package/assets/{getBalance-CthDORPr.js → getBalance-D4riIp1B.js} +2 -2
- package/assets/{getInstalledModules-Cox2YDyF.js → getInstalledModules-DbNUTCf0.js} +1 -1
- package/assets/{getNFT-Bjg_w6DD.js → getNFT-BZdDzwN-.js} +2 -2
- package/assets/getNFT-D06wHDW0.js +1 -0
- package/assets/{getThemeProps-B7lAOokG.js → getThemeProps-_DRrmPGx.js} +1 -1
- package/assets/{grid.styles-BWHADUFG.js → grid.styles-Cw26IyBx.js} +1 -1
- package/assets/{hashTypedData-D3KNbXgE.js → hashTypedData-4FQ0aWPB.js} +1 -1
- package/assets/{hashTypedData-BXeSV9EI.js → hashTypedData-DjUej2SL.js} +1 -1
- package/assets/{import-C0ulsb8r.js → import-BDu1boR-.js} +1 -1
- package/assets/{in-app-8FmH0RQh.js → in-app-BS6ANRK_.js} +1 -1
- package/assets/{in-app-wallet-calls-BFluJbdo.js → in-app-wallet-calls-DISlGB0f.js} +1 -1
- package/assets/{index-CFTDHoZh.js → index-798yU1Mw.js} +1 -1
- package/assets/{index-C1OJ-tO9.js → index-Am_UuYtn.js} +1 -1
- package/assets/{index-CDf3efkp.js → index-B-BkGVd_.js} +2 -2
- package/assets/{index-DLXZ5p81.js → index-B25RdNLD.js} +1 -1
- package/assets/{index-DoxTF6om.js → index-B4kPBdQm.js} +1 -1
- package/assets/{index-cZ6tjlq1.js → index-BDJa77HS.js} +1 -1
- package/assets/{index-IwNV31qY.js → index-BJvvuyHt.js} +1 -1
- package/assets/{index-DH1wbhHD.js → index-BQEI0eWt.js} +1 -1
- package/assets/{index-3AqvKhGz.js → index-BQgkgQ46.js} +1 -1
- package/assets/{index-12wxaJ06.js → index-BSGQxCOa.js} +1 -1
- package/assets/{index-BUxWfTma.js → index-BX3lLNL7.js} +1 -1
- package/assets/{index-Bsc1WoyD.js → index-BoRS8U2O.js} +1 -1
- package/assets/{index-C7NK0fVJ.js → index-BqbJpa0j.js} +1 -1
- package/assets/{index-C76nP1O6.js → index-BuvFoyTD.js} +1 -1
- package/assets/{index-JCA7K3yc.js → index-BxLxzt3o.js} +1 -1
- package/assets/{index-DuM4noYk.js → index-BzdD6V6H.js} +1 -1
- package/assets/{index-CnNIEazo.js → index-C1Asz4E8.js} +1 -1
- package/assets/{index-BWWTHnLr.js → index-C7XgriCO.js} +1 -1
- package/assets/{index-CBA5ujss.js → index-C8dqc2e-.js} +1 -1
- package/assets/{index-DN4XOFSE.js → index-CCfTPrm0.js} +1 -1
- package/assets/{index-DNViA462.js → index-CDthvVRG.js} +1 -1
- package/assets/{index-CUCrSrys.js → index-CLqMYMp_.js} +1 -1
- package/assets/{index-BEgz8ixE.js → index-CLrPXCJt.js} +1 -1
- package/assets/{index-BO_zSTNJ.js → index-CWWazwi9.js} +1 -1
- package/assets/{index-DV8kBwEP.js → index-C_NJ5W3Q.js} +1 -1
- package/assets/{index-C29PIOfp.js → index-C_q9eRuG.js} +1 -1
- package/assets/{index-D8AjAhj_.js → index-CbCySxiP.js} +1 -1
- package/assets/{index-C2y7hJrh.js → index-CeV-QjPU.js} +1 -1
- package/assets/{index-VW-lnGw2.js → index-Cg7CPUHg.js} +1 -1
- package/assets/{index-cfvsnH5y.js → index-CpLfF_C5.js} +1 -1
- package/assets/{index-Bhux6d7O.js → index-CtOaoAtu.js} +1 -1
- package/assets/{index-CyJEkuRi.js → index-CwklEm59.js} +1 -1
- package/assets/{index-BD3ZPd_8.js → index-D19PQguq.js} +1 -1
- package/assets/{index-CyiPWf5n.js → index-D8oxVq2h.js} +1 -1
- package/assets/{index-Bycb_NiK.js → index-DGHjUc9b.js} +2 -2
- package/assets/{index-M0lk4EtX.js → index-DGZgLX5H.js} +1 -1
- package/assets/{index-DMlCumM5.js → index-DLR5U5u7.js} +1 -1
- package/assets/{index-ce0Tcydb.js → index-DMKlwtPQ.js} +3 -3
- package/assets/{index-C4j5Yt0J.js → index-DN_GgU69.js} +1 -1
- package/assets/{index-B6O6tYQ5.js → index-DO6Qu3WW.js} +3 -3
- package/assets/{index-C80znnDW.js → index-DOjpmFkl.js} +1 -1
- package/assets/{index-Brd7ji4Z.js → index-DQ6JWiqD.js} +552 -463
- package/assets/{index-rLHhvU40.js → index-DSiEomXM.js} +2 -2
- package/assets/{index-CAnUnOx3.js → index-DTDCTp2g.js} +1 -1
- package/assets/{index-DX3DHT9n.js → index-DVuMdLqo.js} +1 -1
- package/assets/index-DbLpdy-5.js +1 -0
- package/assets/{index-D3kilUkp.js → index-DbPcoBNe.js} +1 -1
- package/assets/{index-PPPdjER1.js → index-DgrIRrjH.js} +3 -3
- package/assets/{index-CgvLEwoy.js → index-Dh0Sv0e8.js} +1 -1
- package/assets/{index-pYqFSwbF.js → index-DoKViOPe.js} +2 -2
- package/assets/{index-Cjb2XrcZ.js → index-LJjUqlEi.js} +1 -1
- package/assets/{index-Dig_dNhS.js → index-M7UEwjGY.js} +1 -1
- package/assets/{index-CUa9_lhM.js → index-OMa8Tj-T.js} +1 -1
- package/assets/{index-9-Neoanw.js → index-T2XOIIOd.js} +1 -1
- package/assets/{index-CuZV-f-I.js → index-_c5LJlQE.js} +1 -1
- package/assets/{index-DdfWi7TC.js → index-d7uAVQJc.js} +1 -1
- package/assets/{index-DkOjkCdA.js → index-eFPFED8d.js} +1 -1
- package/assets/{index-CMZZ1Nga.js → index-eefVCnI5.js} +1 -1
- package/assets/{index-Cq2ACCOS.js → index-gugejC0m.js} +1 -1
- package/assets/{index-B17_4zRY.js → index-tvUXHAjm.js} +1 -1
- package/assets/{index-DwMtnb8J.js → index-vHUJJrBU.js} +1 -1
- package/assets/{index-kLxn63lr.js → index-w01WQ1OT.js} +1 -1
- package/assets/{index-CnxZGgAx.js → index-zwRq9h0X.js} +1 -1
- package/assets/{index.es-CO16vBVD.js → index.es-B7o2FOqd.js} +1 -1
- package/assets/{index.es-BTrwCm6j.js → index.es-DF0fPg1w.js} +1 -1
- package/assets/{index.es-ZvhCWtmg.js → index.es-DwC36uQk.js} +4 -4
- package/assets/{linkAccount-D6C-iWP9.js → linkAccount-BtAQZlYa.js} +1 -1
- package/assets/{localBatchGatewayRequest-D0lgdcRM.js → localBatchGatewayRequest-CMQNhumX.js} +1 -1
- package/assets/{mana-convert-BSx_Udpc.js → mana-convert-DVF4taBh.js} +1 -1
- package/assets/{mana-rate-BZhaJjml.js → mana-rate-DghhfRg4.js} +1 -1
- package/assets/{native-DzURTJjQ.js → native-CPZ4GKee.js} +1 -1
- package/assets/{networks-DPBJRt6B.js → networks-CTtxcDaZ.js} +1 -1
- package/assets/{onramp-D-V8FIFR.js → onramp-DH1m5q3Z.js} +1 -1
- package/assets/{openzeppelin-B7Q08QJ0.js → openzeppelin-C43jcpbd.js} +1 -1
- package/assets/{ownerOf-6qjJmcwz.js → ownerOf-DmpjD1-R.js} +1 -1
- package/assets/{parseNft-CZxwd5ZF.js → parseNft-DfOGe9m5.js} +2 -2
- package/assets/{parseSignature-3qwrNvoW.js → parseSignature-DikUb694.js} +1 -1
- package/assets/{parseSignature-CtyJ-6L0.js → parseSignature-aw_zZz28.js} +3 -3
- package/assets/{passkeys-Cj0tHoDP.js → passkeys-nBMLF2xb.js} +1 -1
- package/assets/{pay-with-exchange-B3f1_w5e.js → pay-with-exchange-BvzhQXq9.js} +1 -1
- package/assets/{prepare-contract-call-ydWcAfZ2.js → prepare-contract-call-DDzIRXLv.js} +1 -1
- package/assets/{qr-overlay-DWPthnKn.js → qr-overlay-DraTWZGb.js} +3 -3
- package/assets/{react-CDiFgvN_.js → react-BYHuwl8r.js} +1 -1
- package/assets/{receive-CsXmvAKt.js → receive-4VdJwQ5p.js} +1 -1
- package/assets/{resolveImplementation-BOT-NVc7.js → resolveImplementation-BeIaeyw0.js} +1 -1
- package/assets/{rpc-DSWXzB82.js → rpc-BBuy0siA.js} +1 -1
- package/assets/{secp256k1-ByXzWbcW.js → secp256k1-BB8knln0.js} +1 -1
- package/assets/{secp256k1-BaOo-or_.js → secp256k1-CNxo_fPH.js} +1 -1
- package/assets/{secp256k1-uUJiV589.js → secp256k1-vpgDrCPF.js} +1 -1
- package/assets/{send-C05YEc1T.js → send-DVC7onZT.js} +1 -1
- package/assets/{send-batch-transaction-Be0wAoEe.js → send-batch-transaction-98lAmXJd.js} +1 -1
- package/assets/{send-eip712-transaction-BJNkYYKf.js → send-eip712-transaction-Eg93axAQ.js} +2 -2
- package/assets/send-gasless-transaction-B7IHL-9x.js +2 -0
- package/assets/{send-transaction-Bes27L5G.js → send-transaction-DIVDHo0b.js} +2 -2
- package/assets/{sendMetaTransaction-CDDozl0u.js → sendMetaTransaction-BjStTgy8.js} +1 -1
- package/assets/{sendRawTransaction-CaQYbFlQ.js → sendRawTransaction-C0hCcwaF.js} +3 -3
- package/assets/{sentry-DGsLxYkt.js → sentry-Dx-KuLV3.js} +1 -1
- package/assets/{serializeTransaction-DLXlE_fY.js → serializeTransaction-CTD81sCU.js} +1 -1
- package/assets/{session-proposal-269TY8JU.js → session-proposal-BqbaK0vH.js} +1 -1
- package/assets/{session-request-DxaePUXl.js → session-request-DQi229nq.js} +2 -2
- package/assets/{sha256-BkM0tz1g.js → sha256-CfLwtdyC.js} +1 -1
- package/assets/{signing-ZKf523YR.js → signing-C-hS2sII.js} +3 -3
- package/assets/{socials-JFjng574.js → socials-CBTjIC0C.js} +1 -1
- package/assets/{swaps-Cq3Wdoki.js → swaps-BMaKKFJL.js} +1 -1
- package/assets/{thirdweb-BNmNZhah.js → thirdweb-gVaYX1Nm.js} +3 -3
- package/assets/{to-serializable-transaction-PJm0PzIG.js → to-serializable-transaction-BRT7Q8xs.js} +2 -2
- package/assets/{totalSupply-C71_H-lN.js → totalSupply-DRNaCAzP.js} +1 -1
- package/assets/{trade-encoding-BmLGOyo-.js → trade-encoding-BTpnbAqu.js} +1 -1
- package/assets/{transaction-DLOHYmaw.js → transaction-Col-q-Ce.js} +1 -1
- package/assets/{transactionReceipt-CSJT-pKm.js → transactionReceipt-DKKCsI26.js} +1 -1
- package/assets/{transactions-DDewGRUS.js → transactions-CadGL-lV.js} +1 -1
- package/assets/{useCreditPacks-Bqe9pTXx.js → useCreditPacks-B4TLB8Ir.js} +1 -1
- package/assets/{useInfiniteGrid-C1qvdQfd.js → useInfiniteGrid-C6HwGwYR.js} +1 -1
- package/assets/useManaRate-iYCZTzak.js +1 -0
- package/assets/{useSecondarySales-CVaNw0md.js → useSecondarySales-BTqJsuhI.js} +1 -1
- package/assets/{useStore-oZmFLyam.js → useStore-BzU6Jh1o.js} +2 -2
- package/assets/useTheme-BoNwKDMf.js +1 -0
- package/assets/{utils-a6twR_kC.js → utils-BQF5MiO5.js} +1 -1
- package/assets/{verifyHash-BPxoGPRB.js → verifyHash-u7AIFmcv.js} +1 -1
- package/assets/{w3m-modal-BKND42Yg.js → w3m-modal-D-H2XJii.js} +1 -1
- package/assets/{w3m-modal-B7e4dFsC.js → w3m-modal-pEA1kWyU.js} +1 -1
- package/assets/{wait-for-tx-receipt-Dkm_Ycmc.js → wait-for-tx-receipt-h9USNCLV.js} +1 -1
- package/assets/{wallets-Dcnx0DBg.js → wallets-BwDMgJZD.js} +5 -5
- package/assets/{web-connector-B41jHtWN.js → web-connector-CPZEHhv9.js} +3 -3
- package/assets/{writeContract-BBk0XlYd.js → writeContract-D2343X96.js} +1 -1
- package/assets/{zora-sepolia-o_iB8zm8.js → zora-sepolia-5SAdD430.js} +1 -1
- package/assets/{zoraTestnet-AMJQiMJL.js → zoraTestnet-C10IoprX.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Creator-BPKqpaQ0.js +0 -283
- package/assets/browser-ponyfill-U6QFC0pq.js +0 -1
- package/assets/decimals-2E8lbkVo.js +0 -1
- package/assets/estimate-l1-fee-DKfVBk0L.js +0 -1
- package/assets/eth_estimateGas-CYhr9GQg.js +0 -1
- package/assets/eth_getTransactionCount-ZhW4UX5p.js +0 -1
- package/assets/get-ecosystem-wallet-info-B_lrKX-x.js +0 -1
- package/assets/getNFT-BTjqjEEe.js +0 -1
- package/assets/index-867E6STW.js +0 -1
- package/assets/send-gasless-transaction-ytRd_Rwn.js +0 -2
- package/assets/useManaRate-LgUHZXYp.js +0 -1
- package/assets/useTheme-1sGnebNp.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b,j as e,L as _,e as dt}from"./react-
|
|
1
|
+
import{r as b,j as e,L as _,e as dt}from"./react-BYHuwl8r.js";import{aE as lt,s as l,t as o,w as ut,B as ht,l as xt,d,m as pt,u as j,I as g,aF as G,aG as R,aH as mt,y as v,aI as gt,al as E,z as Q,H as ft,aJ as yt,aK as X}from"./index-DQ6JWiqD.js";import{m as bt}from"./mana-convert-DVF4taBh.js";import{u as jt}from"./useManaRate-iYCZTzak.js";import{L as vt}from"./LoadMore-C4ahcKGI.js";import{u as f}from"./useInfiniteGrid-C6HwGwYR.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";import"./mana-rate-DghhfRg4.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(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,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const J=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=J(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Et(t,i,s=Date.now()){const a=i.txHash?t.get(J(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Tt(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Tt(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/credits-product-vs4Q6u6l.svg",T=ut`
|
|
2
2
|
0% { background-position: 200% 0; }
|
|
3
3
|
100% { background-position: -200% 0; }
|
|
4
4
|
`,Ft=l.section`
|
|
@@ -14,13 +14,13 @@ import{r as b,j as e,L as _,e as dt}from"./react-CDiFgvN_.js";import{aB as lt,s
|
|
|
14
14
|
align-items: baseline;
|
|
15
15
|
gap: 12px;
|
|
16
16
|
margin-bottom: 20px;
|
|
17
|
-
`,
|
|
17
|
+
`,Mt=l.h1`
|
|
18
18
|
font-family: ${o.font.sans};
|
|
19
19
|
margin: 0;
|
|
20
20
|
`;l.span`
|
|
21
21
|
color: ${o.colors.muted};
|
|
22
22
|
font-size: 14px;
|
|
23
|
-
`;const
|
|
23
|
+
`;const Dt=l.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
gap: 8px;
|
|
26
26
|
margin-bottom: 20px;
|
|
@@ -150,7 +150,7 @@ import{r as b,j as e,L as _,e as dt}from"./react-CDiFgvN_.js";import{aB as lt,s
|
|
|
150
150
|
&[data-kind='income'] {
|
|
151
151
|
color: ${o.colors.okStrong};
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,Z=l.img`
|
|
154
154
|
width: 16px;
|
|
155
155
|
height: 16px;
|
|
156
156
|
vertical-align: -0.15em;
|
|
@@ -225,12 +225,12 @@ import{r as b,j as e,L as _,e as dt}from"./react-CDiFgvN_.js";import{aB as lt,s
|
|
|
225
225
|
@media (prefers-reduced-motion: reduce) {
|
|
226
226
|
animation: none;
|
|
227
227
|
}
|
|
228
|
-
`,
|
|
228
|
+
`,M=l.div`
|
|
229
229
|
min-width: 0;
|
|
230
230
|
display: flex;
|
|
231
231
|
flex-direction: column;
|
|
232
232
|
gap: 2px;
|
|
233
|
-
`,
|
|
233
|
+
`,D=l.span`
|
|
234
234
|
font-weight: 700;
|
|
235
235
|
white-space: nowrap;
|
|
236
236
|
overflow: hidden;
|
|
@@ -288,4 +288,4 @@ import{r as b,j as e,L as _,e as dt}from"./react-CDiFgvN_.js";import{aB as lt,s
|
|
|
288
288
|
margin: 6px 0 0;
|
|
289
289
|
`,Bt=l(ht)`
|
|
290
290
|
margin-top: 12px;
|
|
291
|
-
`,q=N.withComponent(_),y=24,Gt=["all","purchases","sales"];function m(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 i=Number(t)/1e18;return Number.isFinite(i)?i.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const i=b.useRef(null),[s,a]=b.useState(null),n=()=>{var h;const c=(h=i.current)==null?void 0:h.getBoundingClientRect();c&&a({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(qt,{ref:i,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>a(null),onFocus:n,onBlur:()=>a(null),children:[t,s?dt.createPortal(e.jsx(Ot,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Rt({item:t}){const{data:i,isLoading:s}=j({queryKey:["trade-display",t.tradeId],queryFn:()=>yt(t.tradeId),enabled:!!t.tradeId,staleTime:3e5}),a=!!t.tradeId&&s,n=(i==null?void 0:i.name)??d("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",h=E({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"cart",size:20})}),e.jsxs(
|
|
291
|
+
`,q=N.withComponent(_),y=24,Gt=["all","purchases","sales"];function m(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 i=Number(t)/1e18;return Number.isFinite(i)?i.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const i=b.useRef(null),[s,a]=b.useState(null),n=()=>{var h;const c=(h=i.current)==null?void 0:h.getBoundingClientRect();c&&a({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(qt,{ref:i,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>a(null),onFocus:n,onBlur:()=>a(null),children:[t,s?dt.createPortal(e.jsx(Ot,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Rt({item:t}){const{data:i,isLoading:s}=j({queryKey:["trade-display",t.tradeId],queryFn:()=>yt(t.tradeId),enabled:!!t.tradeId,staleTime:3e5}),a=!!t.tradeId&&s,n=(i==null?void 0:i.name)??d("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",h=E({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"cart",size:20})}),e.jsxs(M,{children:[a?e.jsx(H,{}):e.jsx(D,{title:n,children:n}),t.quantity>1?e.jsx(z,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(Wt,{children:[e.jsx(v,{className:"ccy-mark"})," ",t.credits]})]});return h?e.jsx(q,{to:h,"data-link":"true",children:r}):e.jsx(N,{children:r})}function Kt({order:t}){const i=At(t.lines),s=i.reduce((a,n)=>a+n.quantity,0);return e.jsxs(k,{"data-testid":"purchase-order",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsxs($,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:s})]})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(p,{children:[e.jsx(v,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(C,{children:i.map(a=>e.jsx(Rt,{item:a},a.key))})]})}function Ut({sale:t}){const{data:i,isLoading:s}=j({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>X(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),a=(i==null?void 0:i.name)??d("activity.itemFallback"),n=(i==null?void 0:i.thumbnail)??"",c=E({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[s?e.jsx(S,{}):e.jsx(F,{children:n?e.jsx("img",{src:n,alt:a}):e.jsx(g,{name:"offer",size:20})}),e.jsxs(M,{children:[s?e.jsx(H,{}):e.jsx(D,{title:a,children:a}),e.jsx(z,{children:d("activity.boughtFrom",{account:tt(t.seller)})})]})]});return e.jsxs(k,{"data-testid":"activity-mana-purchase",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsx($,{children:d("activity.paidWithMana")})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(p,{children:[et(t.manaWei)," ",e.jsx(it,{children:e.jsx(Z,{src:Q,alt:"MANA"})})]})]})]}),e.jsx(C,{children:c?e.jsx(q,{to:c,"data-link":"true",children:h}):e.jsx(N,{children:h})})]})}function _t({sale:t,payout:i}){const{data:s,isLoading:a}=j({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>X(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),n=(s==null?void 0:s.name)??d("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",h=E({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"offer",size:20})}),e.jsxs(M,{children:[a?e.jsx(H,{}):e.jsx(D,{title:n,children:n}),e.jsxs(z,{children:[d("activity.soldTo",{account:tt(t.counterparty)}),i.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:m(i.availableAt)})}`:""]})]})]});return e.jsxs(k,{"data-testid":"activity-sale",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsx($,{children:d("activity.saleLabel")})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":i.kind==="pending"?"PENDING":"SOLD",children:i.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),i.kind==="direct"?e.jsxs(p,{"data-kind":"income",children:["+",et(t.manaWei)," ",e.jsx(it,{children:e.jsx(Z,{src:Q,alt:"MANA"})})]}):i.credits!==null?e.jsxs(p,{"data-kind":"income",children:[e.jsx(v,{className:"ccy-mark"})," +",ft(i.credits)]}):e.jsx(p,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(C,{children:h?e.jsx(q,{to:h,"data-link":"true",children:r}):e.jsx(N,{children:r})})]})}function Qt({order:t}){const i=`$${(t.usdCents/100).toFixed(2)}`,s=gt(t.status),a=s==="SETTLED"?d("activity.completed"):s==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(k,{"data-testid":"credit-order",children:e.jsxs(w,{children:[e.jsx(zt,{children:e.jsx("img",{src:Ct,alt:"","aria-hidden":!0})}),e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsxs($,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:i})]})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":s,children:a}),e.jsxs(p,{"data-kind":"income",children:["+",e.jsx(v,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Xt({filter:t}){const i={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(g,{name:i.icon,size:40,color:o.colors.muted2}),e.jsx(Y,{children:i.title}),e.jsx("p",{className:"muted",children:i.body}),t!=="sales"?e.jsx(Bt,{as:_,to:"/assets",variant:"purple",children:d("notFound.cta")}):null]})}function oe(){xt({title:d("nav.activity"),noindex:!0});const{session:t}=pt(),[i,s]=b.useState("all"),a=!!t&&i!=="sales",n=!!t&&i!=="purchases",c=f(["purchases",t==null?void 0:t.address],u=>mt(t.address,t.identity,{first:y,skip:u}),{enabled:a}),h=f(["sales",t==null?void 0:t.address],u=>G(t.address,{role:"seller",first:y,skip:u}),{enabled:n}),r=f(["credit-orders",t==null?void 0:t.address],u=>R(t.address,t.identity,{first:y,skip:u}),{enabled:a}),x=f(["mana-purchases",t==null?void 0:t.address],u=>G(t.address,{role:"buyer",first:y,skip:u}),{enabled:a}),{data:O}=j({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>R(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:n,staleTime:6e4}),at=b.useMemo(()=>Nt(O),[O]),{data:nt}=jt(n);if(!t)return e.jsxs(V,{children:[e.jsx(g,{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 W=Lt(Pt({purchases:a?c.items:[],sales:n?h.items:[],creditOrders:a?r.items:[],manaPurchases:a?x.items:[],rate:nt}),i),st=a&&(c.isLoading||r.isLoading||x.isLoading)||n&&h.isLoading,B=a&&(c.isFetchingNextPage||r.isFetchingNextPage||x.isFetchingNextPage)||n&&h.isFetchingNextPage,rt=a&&(c.hasNextPage||r.hasNextPage||x.hasNextPage)||n&&h.hasNextPage;function ot(){a&&c.hasNextPage&&c.fetchNextPage(),a&&r.hasNextPage&&r.fetchNextPage(),a&&x.hasNextPage&&x.fetchNextPage(),n&&h.hasNextPage&&h.fetchNextPage()}return e.jsxs(Ft,{children:[e.jsx(St,{children:e.jsx(Mt,{children:d("nav.activity")})}),e.jsx(Dt,{role:"tablist","aria-label":d("nav.activity"),children:Gt.map(u=>e.jsx(Ht,{type:"button",role:"tab","aria-selected":i===u,"data-active":i===u,"data-testid":`activity-filter-${u}`,onClick:()=>s(u),children:d(`activity.filter.${u}`)},u))}),st?e.jsx(K,{children:Array.from({length:5}).map((u,ct)=>e.jsx(U,{},ct))}):W.length===0?e.jsx(Xt,{filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(K,{children:[W.map(u=>u.kind==="purchase"?e.jsx(Kt,{order:u.order},u.id):u.kind==="credit"?e.jsx(Qt,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ut,{sale:u.sale},u.id):e.jsx(_t,{sale:u.sale,payout:Et(at,u.sale)},u.id)),B?e.jsx(U,{}):null]}),e.jsx(vt,{hasNextPage:rt,isFetching:B,onLoadMore:ot})]})]})}export{oe 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-BYHuwl8r.js";import{s as u}from"./index-DQ6JWiqD.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as ze,r as m,j as e,u as Ve}from"./react-
|
|
1
|
+
import{b as ze,r as m,j as e,u as Ve}from"./react-BYHuwl8r.js";import{c as B,aq as Ze,ar as Ke,b as Je,s as n,t,m as Ie,ai as Qe,D as Xe,H as Ae,x as Ye,d as s,I as R,y as W,aN as he,an as J,au as et,at as tt,l as Ne,n as nt,S as fe,A as O,aO as st,aP as ot}from"./index-DQ6JWiqD.js";import{u as it}from"./useSecondarySales-BTqJsuhI.js";import{a as rt,m as Me}from"./mana-convert-DVF4taBh.js";import{u as Pe}from"./useManaRate-iYCZTzak.js";import{g as at,h as lt,i as ct,j as dt,k as pt,C as xt,l as ht,o as ft,m as mt,n as ut,M as gt,p as bt,E as yt,q as wt,r as jt,s as vt,t as $t,u as Ct,v as kt}from"./Assets.styles-BVt9ny1H.js";import{c as me,R as St,F as Et,S as Rt}from"./categories-5tCT8xWh.js";import{L as Tt}from"./LoadMore-C4ahcKGI.js";import{u as _t}from"./useInfiniteGrid-C6HwGwYR.js";import{E as zt}from"./ErrorNotice-CCmfdXO-.js";import{d as It}from"./dcl-schemas-BICTSpB5.js";import{s as At,G as Nt,w as Mt,S as Pt}from"./buy-gasless-BS7n5_qI.js";import{s as Wt}from"./buy-BYXdfz24.js";import{i as Bt}from"./trade-encoding-BTpnbAqu.js";import{r as Ft}from"./mana-rate-DghhfRg4.js";import{f as Lt}from"./errors-DLr34B3-.js";import{J as Ht,C as Ut,B as ee}from"./ethers--abqWJu6.js";import{l as Ot}from"./loader-logo-BzY9EKdC.js";import{n as Dt}from"./Tooltip-C7o9WgVx.js";import{G as Gt}from"./grid.styles-Cw26IyBx.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-93IYCFGd.js";import"./sendMetaTransaction-BjStTgy8.js";function D(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Kt(){return B.chainId===Number(It.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Jt(o,i={}){var p;const{rpc:l,address:x}=Kt(),c=new Ht(l),d=new Ut(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return rt(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Je(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Bt(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:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Ft(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,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 Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await At({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Nt))throw y;f=await Wt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Mt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Pt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Ke(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Lt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -366,7 +366,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-CDiFgvN_.js";import{c as B,aq
|
|
|
366
366
|
flex: none;
|
|
367
367
|
color: ${t.colors.dclRed};
|
|
368
368
|
}
|
|
369
|
-
`;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){J(tt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:et(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:Ot,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
369
|
+
`;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){J(tt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:et(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:Ot,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/governance-DnazlIjy.webp",In=n.div`
|
|
370
370
|
width: 100%;
|
|
371
371
|
min-width: 0;
|
|
372
372
|
`,An=n.nav`
|
|
@@ -538,7 +538,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-CDiFgvN_.js";import{c as B,aq
|
|
|
538
538
|
gap: 0;
|
|
539
539
|
cursor: text;
|
|
540
540
|
overflow: hidden;
|
|
541
|
-
`,
|
|
541
|
+
`,Zn=n.span`
|
|
542
542
|
flex: none;
|
|
543
543
|
margin-right: 8px;
|
|
544
544
|
font-family: ${t.font.sans};
|
|
@@ -550,7 +550,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-CDiFgvN_.js";import{c as B,aq
|
|
|
550
550
|
${t.media.maxWidth("mobile")} {
|
|
551
551
|
font-size: 20px;
|
|
552
552
|
}
|
|
553
|
-
`,
|
|
553
|
+
`,Kn=n.input`
|
|
554
554
|
flex: 0 1 auto;
|
|
555
555
|
min-width: 0;
|
|
556
556
|
max-width: 100%;
|
|
@@ -735,7 +735,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-CDiFgvN_.js";import{c as B,aq
|
|
|
735
735
|
flex-direction: column;
|
|
736
736
|
gap: 6px;
|
|
737
737
|
padding: 12px 16px;
|
|
738
|
-
`,
|
|
738
|
+
`,Z=n.h3`
|
|
739
739
|
margin: 0;
|
|
740
740
|
font-family: ${t.font.sans};
|
|
741
741
|
font-weight: 700;
|
|
@@ -743,7 +743,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-CDiFgvN_.js";import{c as B,aq
|
|
|
743
743
|
line-height: 1.57;
|
|
744
744
|
text-transform: uppercase;
|
|
745
745
|
color: ${t.colors.text};
|
|
746
|
-
`,
|
|
746
|
+
`,K=n.p`
|
|
747
747
|
margin: 0;
|
|
748
748
|
font-family: ${t.font.sans};
|
|
749
749
|
font-weight: 400;
|
|
@@ -784,4 +784,4 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-CDiFgvN_.js";import{c as B,aq
|
|
|
784
784
|
clip: rect(0, 0, 0, 0);
|
|
785
785
|
white-space: nowrap;
|
|
786
786
|
border: 0;
|
|
787
|
-
`,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(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 ds({onBack:o}){Ne({title:s("seo.names.title"),description:s("seo.names.description")});const{session:i,signIn:l}=Ie(),{data:x}=Pe(),c=x?Me(F,x):null,[d,h]=m.useState(""),[p,a]=m.useState("idle"),[u,b]=m.useState(!1),w=m.useRef(null),[j,$]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&$(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ue(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const z=new AbortController,E=setTimeout(()=>{(async()=>{try{const g=await Jt(d,{signal:z.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(E),z.abort()}},[d]);const f=ue(d),y=f.ok&&(p==="available"||p==="error");function v(){if(y){if(!i){l();return}b(!0)}}const k=e.jsxs(e.Fragment,{children:[s("names.claim"),c!=null?e.jsxs(Yn,{children:[e.jsx(W,{}),Ae(c)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:o,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Mn,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsx(Fn,{children:s("names.heroTitle")}),e.jsx(Ln,{children:s("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(Un,{children:[e.jsxs(On,{invalid:p==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Zn,{value:d,onChange:C=>h(Vt(C.target.value)),placeholder:s("names.inputPlaceholder"),"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Q,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||s("names.inputPlaceholder")}),e.jsx(Jn,{children:s("names.suffix")})]}),d.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[d.length,"/",Q]}):null,e.jsx(Fe,{onClick:v,disabled:!y,"data-testid":"names-claim",children:k})]}),p==="taken"?e.jsxs(Gn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(qn,{href:cs(d),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:v,disabled:!y,children:k}),p==="checking"?e.jsx(X,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):p==="error"?e.jsx(X,{tone:"muted",role:"status",children:s("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(X,{tone:"muted",role:"status",children:s("names.tooShort",{min:We})}):null,e.jsx(rs,{role:"status","aria-live":"polite",children:p==="available"?s("names.available",{name:d}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s("names.whyTitle")}),e.jsx(ss,{children:s("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(G,{children:[e.jsx(q,{src:Rn,alt:""}),e.jsxs(V,{children:[e.jsx(K,{children:s("names.why1Title")}),e.jsx(Z,{children:s("names.why1")})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:Tn,alt:""}),e.jsxs(V,{children:[e.jsx(K,{children:s("names.why2Title")}),e.jsxs(Z,{children:[s("names.why2")," ",e.jsx(is,{children:s("names.why2Address")})]}),e.jsxs(_e,{href:as,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:_n,alt:""}),e.jsxs(V,{children:[e.jsx(K,{children:s("names.why3Title")}),e.jsx(Z,{children:s("names.why3")})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:zn,alt:""}),e.jsxs(V,{children:[e.jsx(K,{children:s("names.why4Title")}),e.jsx(Z,{children:s("names.why4")}),e.jsxs(_e,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(Sn,{name:d,priceCredits:c,onClose:()=>b(!1)}):null]})}const ps="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",Y=48;function Ps(){const[o]=Ve(),i=ze(),l=(o.get("q")??"").trim().toLowerCase(),x=(o.get("q")??"").trim();Ne({title:x?s("seo.collectibles.searchTitle",{query:x}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const[c,d]=m.useState("wearable"),[h,p]=m.useState(null),[a,u]=m.useState([]),[b,w]=m.useState(""),[j,$]=m.useState(""),[f,y]=m.useState("on_sale"),[v,k]=m.useState(!1),[C,z]=m.useState("newest"),[E,g]=m.useState(!1);m.useEffect(()=>{if(!E)return;const r=N=>{N.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=S}},[E]);const I=f==="on_sale",T=b&&!Number.isNaN(Number(b))?Number(b):void 0,M=j&&!Number.isNaN(Number(j))?Number(j):void 0,Le=it(),te=h?Rt[h]:void 0,ne=(me.find(r=>r.key===C)??me[0]).server,se={category:c,rarities:a.length?a:void 0,wearableCategories:te,minPriceCredits:T,maxPriceCredits:M,search:l||void 0,sortBy:ne,isSmart:v||void 0,onSale:!0,listingType:Le?void 0:"primary"},oe={category:c,rarities:a.length?a:void 0,wearableCategories:te,search:l||void 0,sortBy:ne,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:L,total:ie,isLoading:_,isPlaceholderData:A,error:re,hasNextPage:He,isFetchingNextPage:ae,fetchNextPage:Ue}=_t(I?["shop-items",se]:["catalog-items",oe],r=>I?st({...se,first:Y,skip:r}):ot({...oe,first:Y,skip:r}),{enabled:c!=="names"}),H=ie,le=_||A,Oe=_?15:Math.min(Math.max(L.length,1),Y),{data:ce,isError:De}=Pe(),Ge=r=>ce&&r.manaWei?Me(r.manaWei,ce):null,de=m.useRef(null);m.useEffect(()=>{_||A||!l||de.current===l||(de.current=l,J("Shop Searched",{query:l,result_count:H}))},[l,_,A,H]);const U=m.useRef("__init__");m.useEffect(()=>{if(_||A)return;const r=JSON.stringify({category:c,subCategory:h,rarities:a,min:T,max:M,sort:C,status:f,smart:v});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,J("Shop Applied Filter",{filters:{category:c,sub_category:h,rarities:a,min_price_credits:T??null,max_price_credits:M??null,status:f,smart:v,sort:C},result_count:H})},[c,h,a,T,M,C,f,v,_,A,H]);function pe(r){d(r),p(null)}function xe(r){u(S=>S.includes(r)?S.filter(N=>N!==r):[...S,r])}function qe(){d("wearable"),p(null),u([]),w(""),$(""),y("on_sale"),k(!1)}const P=[];(T!=null||M!=null)&&P.push({key:"price",label:s("filter.price"),onRemove:()=>{w(""),$("")}});for(const r of St)a.includes(r)&&P.push({key:`rarity-${r}`,label:nt(r),onRemove:()=>xe(r)});return v&&P.push({key:"smart",label:s("filter.smart"),onRemove:()=>k(!1)}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?s("filter.statusAll"):s("filter.notForSale"),onRemove:()=>y("on_sale")}),e.jsxs(at,{"data-testid":"browse",children:[c!=="names"&&e.jsxs(e.Fragment,{children:[E?e.jsx(lt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ct,{"data-open":E||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(dt,{children:[e.jsx(pt,{children:s("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(ft,{category:c,subCategory:h,onCategory:pe,onSub:p,priceMin:b,priceMax:j,onPriceMin:w,onPriceMax:$,rarities:a,onToggleRarity:xe,status:f,onStatus:y,smart:v,onSmart:k})}),e.jsx(mt,{children:e.jsx(ut,{type:"button",onClick:()=>g(!1),children:s("assets.showItems")})})]})]}),e.jsx(gt,{children:c==="names"?e.jsx(ds,{onBack:()=>pe("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Et,{sort:C,onSort:z,total:ie,loading:_||A,query:l,onOpenFilters:()=>g(!0),chips:P,onClearChips:qe}),De&&I&&L.some(r=>r.source==="legacy")?e.jsx(bt,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,re?e.jsx(zt,{message:s("assets.loadError"),testId:"browse-error"}):null,!le&&L.length===0&&!re?e.jsxs(yt,{"data-testid":"browse-empty",children:[e.jsx(wt,{src:ps,alt:""}),e.jsxs(jt,{children:[e.jsx(vt,{children:s("assets.empty.title")}),e.jsx($t,{children:x?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:x}),s("assets.empty.searchAfter")]}):s("assets.empty.filters")})]}),e.jsx(Ct,{children:e.jsx(kt,{type:"button",onClick:()=>i("/overview"),children:s("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Gt,{"data-testid":"grid",children:le?e.jsx(fe,{count:Oe}):e.jsxs(e.Fragment,{children:[L.map(r=>{if(!I)return e.jsx(O,{item:r,mode:"view"},D(r));const S=r;if(S.source!=="legacy")return e.jsx(O,{item:r},D(r));const N=Ge(S);return N==null?e.jsx(O,{item:r,mode:"view"},D(r)):e.jsx(O,{item:{...S,priceCredits:N}},D(r))}),ae?e.jsx(fe,{count:6}):null]})}),e.jsx(Tt,{hasNextPage:He,isFetching:ae,onLoadMore:()=>void Ue()})]})]})})]})}export{Ps as Assets};
|
|
787
|
+
`,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(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 ds({onBack:o}){Ne({title:s("seo.names.title"),description:s("seo.names.description")});const{session:i,signIn:l}=Ie(),{data:x}=Pe(),c=x?Me(F,x):null,[d,h]=m.useState(""),[p,a]=m.useState("idle"),[u,b]=m.useState(!1),w=m.useRef(null),[j,$]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&$(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ue(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const z=new AbortController,E=setTimeout(()=>{(async()=>{try{const g=await Jt(d,{signal:z.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(E),z.abort()}},[d]);const f=ue(d),y=f.ok&&(p==="available"||p==="error");function v(){if(y){if(!i){l();return}b(!0)}}const k=e.jsxs(e.Fragment,{children:[s("names.claim"),c!=null?e.jsxs(Yn,{children:[e.jsx(W,{}),Ae(c)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:o,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Mn,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsx(Fn,{children:s("names.heroTitle")}),e.jsx(Ln,{children:s("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(Un,{children:[e.jsxs(On,{invalid:p==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Zn,{"aria-hidden":!0,children:"@"}),e.jsx(Kn,{value:d,onChange:C=>h(Vt(C.target.value)),placeholder:s("names.inputPlaceholder"),"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Q,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||s("names.inputPlaceholder")}),e.jsx(Jn,{children:s("names.suffix")})]}),d.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[d.length,"/",Q]}):null,e.jsx(Fe,{onClick:v,disabled:!y,"data-testid":"names-claim",children:k})]}),p==="taken"?e.jsxs(Gn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(qn,{href:cs(d),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:v,disabled:!y,children:k}),p==="checking"?e.jsx(X,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):p==="error"?e.jsx(X,{tone:"muted",role:"status",children:s("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(X,{tone:"muted",role:"status",children:s("names.tooShort",{min:We})}):null,e.jsx(rs,{role:"status","aria-live":"polite",children:p==="available"?s("names.available",{name:d}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s("names.whyTitle")}),e.jsx(ss,{children:s("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(G,{children:[e.jsx(q,{src:Rn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why1Title")}),e.jsx(K,{children:s("names.why1")})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:Tn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why2Title")}),e.jsxs(K,{children:[s("names.why2")," ",e.jsx(is,{children:s("names.why2Address")})]}),e.jsxs(_e,{href:as,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:_n,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why3Title")}),e.jsx(K,{children:s("names.why3")})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:zn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why4Title")}),e.jsx(K,{children:s("names.why4")}),e.jsxs(_e,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(Sn,{name:d,priceCredits:c,onClose:()=>b(!1)}):null]})}const ps="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",Y=48;function Ps(){const[o]=Ve(),i=ze(),l=(o.get("q")??"").trim().toLowerCase(),x=(o.get("q")??"").trim();Ne({title:x?s("seo.collectibles.searchTitle",{query:x}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const[c,d]=m.useState("wearable"),[h,p]=m.useState(null),[a,u]=m.useState([]),[b,w]=m.useState(""),[j,$]=m.useState(""),[f,y]=m.useState("on_sale"),[v,k]=m.useState(!1),[C,z]=m.useState("newest"),[E,g]=m.useState(!1);m.useEffect(()=>{if(!E)return;const r=N=>{N.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=S}},[E]);const I=f==="on_sale",T=b&&!Number.isNaN(Number(b))?Number(b):void 0,M=j&&!Number.isNaN(Number(j))?Number(j):void 0,Le=it(),te=h?Rt[h]:void 0,ne=(me.find(r=>r.key===C)??me[0]).server,se={category:c,rarities:a.length?a:void 0,wearableCategories:te,minPriceCredits:T,maxPriceCredits:M,search:l||void 0,sortBy:ne,isSmart:v||void 0,onSale:!0,listingType:Le?void 0:"primary"},oe={category:c,rarities:a.length?a:void 0,wearableCategories:te,search:l||void 0,sortBy:ne,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:L,total:ie,isLoading:_,isPlaceholderData:A,error:re,hasNextPage:He,isFetchingNextPage:ae,fetchNextPage:Ue}=_t(I?["shop-items",se]:["catalog-items",oe],r=>I?st({...se,first:Y,skip:r}):ot({...oe,first:Y,skip:r}),{enabled:c!=="names"}),H=ie,le=_||A,Oe=_?15:Math.min(Math.max(L.length,1),Y),{data:ce,isError:De}=Pe(),Ge=r=>ce&&r.manaWei?Me(r.manaWei,ce):null,de=m.useRef(null);m.useEffect(()=>{_||A||!l||de.current===l||(de.current=l,J("Shop Searched",{query:l,result_count:H}))},[l,_,A,H]);const U=m.useRef("__init__");m.useEffect(()=>{if(_||A)return;const r=JSON.stringify({category:c,subCategory:h,rarities:a,min:T,max:M,sort:C,status:f,smart:v});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,J("Shop Applied Filter",{filters:{category:c,sub_category:h,rarities:a,min_price_credits:T??null,max_price_credits:M??null,status:f,smart:v,sort:C},result_count:H})},[c,h,a,T,M,C,f,v,_,A,H]);function pe(r){d(r),p(null)}function xe(r){u(S=>S.includes(r)?S.filter(N=>N!==r):[...S,r])}function qe(){d("wearable"),p(null),u([]),w(""),$(""),y("on_sale"),k(!1)}const P=[];(T!=null||M!=null)&&P.push({key:"price",label:s("filter.price"),onRemove:()=>{w(""),$("")}});for(const r of St)a.includes(r)&&P.push({key:`rarity-${r}`,label:nt(r),onRemove:()=>xe(r)});return v&&P.push({key:"smart",label:s("filter.smart"),onRemove:()=>k(!1)}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?s("filter.statusAll"):s("filter.notForSale"),onRemove:()=>y("on_sale")}),e.jsxs(at,{"data-testid":"browse",children:[c!=="names"&&e.jsxs(e.Fragment,{children:[E?e.jsx(lt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ct,{"data-open":E||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(dt,{children:[e.jsx(pt,{children:s("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(ft,{category:c,subCategory:h,onCategory:pe,onSub:p,priceMin:b,priceMax:j,onPriceMin:w,onPriceMax:$,rarities:a,onToggleRarity:xe,status:f,onStatus:y,smart:v,onSmart:k})}),e.jsx(mt,{children:e.jsx(ut,{type:"button",onClick:()=>g(!1),children:s("assets.showItems")})})]})]}),e.jsx(gt,{children:c==="names"?e.jsx(ds,{onBack:()=>pe("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Et,{sort:C,onSort:z,total:ie,loading:_||A,query:l,onOpenFilters:()=>g(!0),chips:P,onClearChips:qe}),De&&I&&L.some(r=>r.source==="legacy")?e.jsx(bt,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,re?e.jsx(zt,{message:s("assets.loadError"),testId:"browse-error"}):null,!le&&L.length===0&&!re?e.jsxs(yt,{"data-testid":"browse-empty",children:[e.jsx(wt,{src:ps,alt:""}),e.jsxs(jt,{children:[e.jsx(vt,{children:s("assets.empty.title")}),e.jsx($t,{children:x?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:x}),s("assets.empty.searchAfter")]}):s("assets.empty.filters")})]}),e.jsx(Ct,{children:e.jsx(kt,{type:"button",onClick:()=>i("/overview"),children:s("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Gt,{"data-testid":"grid",children:le?e.jsx(fe,{count:Oe}):e.jsxs(e.Fragment,{children:[L.map(r=>{if(!I)return e.jsx(O,{item:r,mode:"view"},D(r));const S=r;if(S.source!=="legacy")return e.jsx(O,{item:r},D(r));const N=Ge(S);return N==null?e.jsx(O,{item:r,mode:"view"},D(r)):e.jsx(O,{item:{...S,priceCredits:N}},D(r))}),ae?e.jsx(fe,{count:6}):null]})}),e.jsx(Tt,{hasNextPage:He,isFetching:ae,onLoadMore:()=>void Ue()})]})]})})]})}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-BYHuwl8r.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-5tCT8xWh.js";import{n as c,T as se}from"./Tooltip-C7o9WgVx.js";import{t as e,s as o,I as g,d as s,n as ae,e as v}from"./index-DQ6JWiqD.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 t,L as q,r as M}from"./react-
|
|
1
|
+
import{j as t,L as q,r as M}from"./react-BYHuwl8r.js";import{s as a,B as N,t as o,w as I,l as B,d as e,m as F,x as W,I as f,y as G,z as K,u as w,D as P,c as Q,E as k,k as H,o as $}from"./index-DQ6JWiqD.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-93IYCFGd.js";import{a as Y}from"./builder-BxP8tT4f.js";import{f as Z}from"./errors-DLr34B3-.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BjStTgy8.js";const tt=I`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,it=I`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-
|
|
1
|
+
import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t as ee,s as i,d as a,H as Z,F as Qt,I as R,y as xt,G as ze,l as Kt,ah as q,O as Ze,m as Ut,u as Ot,ai as Ht,D as Vt,aj as Dt,ak as Gt,al as Yt,x as Jt,am as et,an as Q,ao as tt,ap as Xt,k as V,c as at,e as Zt,aq as st,ar as we,as as ke,at as ce,au as nt,g as le,a as ea,C as $e,av as ta}from"./index-DQ6JWiqD.js";import{M as aa,S as sa,C as na,H as ia,a as ra,T as oa,X as ca,b as la,B as da,c as ua,d as it,e as ha,f as pe,P as gt,m as mt,g as pa,h as xa,i as ga,j as ft,k as xe,L as ma,l as fa,n as rt,o as ot,W as ya,p as ba,q as va,A as Ca,r as ja,s as wa,t as ka,u as $a,v as Sa,w as Ma,x as Ta,y as Pa,z as za,D as Aa,E as Ia,F as qa,G as Ra,I as _a,J as Ba,K as Se,N as Ea,O as Fa,Q as Wa,R as La,U as ct,V as Na,Y as Qa,Z as Ka,_ as Ua}from"./CollectionCarousel-cAnwcIFc.js";import{u as Oa}from"./useManaRate-iYCZTzak.js";import{r as Ha}from"./mana-rate-DghhfRg4.js";import{i as Va,j as Da,f as Ga,n as Ya,h as Ja,A as Xa}from"./authorizations-93IYCFGd.js";import{b as Me}from"./buy-BYXdfz24.js";import{b as Za,w as es,S as ts,G as as}from"./buy-gasless-BS7n5_qI.js";import{u as ss,M as ns,R as de,r as is,c as rs}from"./useCreditPacks-B4TLB8Ir.js";import{l as os}from"./loader-logo-BzY9EKdC.js";import{i as cs,a as ls}from"./errors-DLr34B3-.js";import{E as ds}from"./ErrorNotice-CCmfdXO-.js";import{u as lt}from"./mana-convert-DVF4taBh.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BTpnbAqu.js";import"./sendMetaTransaction-BjStTgy8.js";const{colors:D,radius:us}=ee,hs=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -53,7 +53,7 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-CDiFgvN_.js";import{t
|
|
|
53
53
|
font-weight: 700;
|
|
54
54
|
color: ${D.text};
|
|
55
55
|
}
|
|
56
|
-
`,fs="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
56
|
+
`,fs="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/buy-error-22UunaPC.png";function ys(c){const{phase:d,balanceCredits:k,onClose:T}=c,_=d==="processing",F=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),W=d==="processing";return e.jsxs(aa,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(sa,{onClick:_?void 0:T,"aria-hidden":!0}),e.jsxs(na,{"data-tall":W||void 0,children:[e.jsxs(ia,{children:[e.jsxs(ra,{children:[e.jsx(oa,{children:F}),!_&&e.jsx(ca,{onClick:T,"aria-label":a("buyModal.close"),children:e.jsx(la,{})})]}),e.jsxs(da,{children:[e.jsx(ua,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(it,{}),e.jsx(ha,{children:Z(k)})]})]}),d==="choose"&&e.jsxs(pe,{children:[e.jsxs(ms,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(it,{}),Z(c.totalCredits??0)]})]}),e.jsx(gt,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const z=mt(c.totalCents??0,c.totalManaWei??0n);return z!=null?a("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(bs,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),d==="nofunds"&&e.jsx(vs,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:T}),d==="error"&&e.jsxs(pe,{children:[e.jsxs(pa,{"data-testid":"buy-error",children:[e.jsx(xa,{src:fs,alt:"",width:64,height:80}),e.jsxs(ga,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs(ft,{children:[e.jsx(xe,{"data-variant":"outline",onClick:T,children:a("buyModal.cancel")}),e.jsx(xe,{"data-variant":"purple",onClick:c.onRetry??T,children:a("cartCheckout.tryAgain")})]})]})]})]})}function bs({stage:c,step:d,total:k,isSelfCustody:T}){const _=c==="reserving",F=k>0?Math.min(100,Math.round(d/k*100)):0,W=c==="awaiting-signature"?T?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):c==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(pe,{"data-processing":!0,children:[e.jsx(ma,{src:os,alt:"",width:61,height:61}),e.jsx(fa,{children:W}),_?e.jsxs(hs,{children:[e.jsx(rt,{"aria-hidden":!0,children:e.jsx(ot,{"data-step":!0,style:{width:`${F}%`}})}),k>1?e.jsxs(ps,{children:[d,"/",k]}):null]}):e.jsx(rt,{"aria-hidden":!0,children:e.jsx(ot,{})})]})}function vs({lines:c,shortfallCredits:d,packs:k,selectedPack:T,onSelectPack:_,onBuyPacks:F,onCancel:W}){const z=k.find(n=>n.id===T),me=c.reduce((n,I)=>n+(I.quantity??1),0);return e.jsxs(pe,{children:[e.jsxs(ya,{"data-testid":"nofunds-warning",children:[e.jsx(ba,{}),e.jsxs(va,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:me})]})]}),e.jsx(xs,{children:c.map(n=>{const I=n.quantity??1;return e.jsxs(Ca,{children:[e.jsx(ja,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(wa,{children:[e.jsxs("div",{children:[e.jsxs(ka,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),I>1?e.jsx(gs,{children:a("cartCheckout.qty",{count:I})}):null]}),n.item.creator?e.jsx($a,{address:n.item.creator}):null]}),e.jsxs(Sa,{children:[e.jsx(Ma,{}),e.jsx("span",{children:Z(n.priceCredits*I)})]})]})]},n.item.id)})}),e.jsx(Ta,{children:k.map(n=>{const I=n.id===T;return e.jsxs(Pa,{"data-testid":"credit-pack","data-on":I||void 0,onClick:()=>_(n.id),children:[e.jsx(za,{}),e.jsx(Aa,{children:Z(n.credits)}),e.jsxs(Ia,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(qa,{children:[e.jsxs(Ra,{children:[e.jsx(_a,{}),e.jsx("span",{children:Z((z==null?void 0:z.credits)??0)})]}),e.jsxs(Ba,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]}),e.jsxs(ft,{children:[e.jsx(xe,{"data-variant":"outline",onClick:W,children:a("buyModal.cancel")}),e.jsx(xe,{"data-variant":"gradient",onClick:F,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:yt,radius:K}=ee,bt="@media (max-width: 1080px)",S="@media (max-width: 880px)",dt=i.div`
|
|
57
57
|
max-width: 1510px;
|
|
58
58
|
margin: 0 auto;
|
|
59
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{K as N,L as w,M as o,N as n,G as D,w as M}from"./index-
|
|
1
|
+
import{K as N,L as w,M as o,N as n,G as D,w as M}from"./index-DQ6JWiqD.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K,s as v}from"./clsx-GM87-Mfi.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const G=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,L=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as m,d as Y,b as Z}from"./react-
|
|
1
|
+
import{j as e,r as m,d as Y,b as Z}from"./react-BYHuwl8r.js";import{t as v,s as c,ad as J,ae as z,I as X,d as a,c as ee,k as te,u as ae,l as re,e as oe,S as E,A as ie,af as se,ag as ne}from"./index-DQ6JWiqD.js";import{E as ce}from"./ErrorNotice-CCmfdXO-.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-oJ6cJp3z.js";import{u as ve}from"./useStore-BzU6Jh1o.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-5tCT8xWh.js";import{L as $e}from"./LoadMore-C4ahcKGI.js";import{u as Pe}from"./useInfiniteGrid-C6HwGwYR.js";import{G as Me}from"./grid.styles-Cw26IyBx.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";const Re=c.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${v.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-
|
|
1
|
+
import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as k,H as j,b8 as C,e as G,w as Y,I as Q,k as X,g as W,C as B,a as Z,b9 as J,ba as F,A as q}from"./index-DQ6JWiqD.js";import{s as ee,h as H,A as U,g as K,r as te,m as ne,e as ae}from"./authorizations-93IYCFGd.js";import{i as ie}from"./errors-DLr34B3-.js";import{E as oe}from"./ErrorNotice-CCmfdXO-.js";import{a as se}from"./buy-BYXdfz24.js";import{d as re,f as ce}from"./trade-encoding-BTpnbAqu.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-BjStTgy8.js";import{I as he,C as ue}from"./ethers--abqWJu6.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const E="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./sentry-
|
|
1
|
+
import{p as t}from"./sentry-Dx-KuLV3.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as ee}from"./react-CDiFgvN_.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-DLXZ5p81.js";import{p as N}from"./sentry-DGsLxYkt.js";import{r as ne}from"./browser-ponyfill-C5PEoXZC.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|
|
1
|
+
import{g as ee}from"./react-BYHuwl8r.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-B25RdNLD.js";import{p as N}from"./sentry-Dx-KuLV3.js";import{r as ne}from"./browser-ponyfill-CxIDDbrC.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|