@dcl/shop 0.4.1-30932341848.commit-2643c3e → 0.5.0
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-BkSkVMgx.js → Activity-GNtRBDkH.js} +1 -1
- package/_assets/{AnimatedBackground-BTZET6f2.js → AnimatedBackground-C4vGO85y.js} +1 -1
- package/_assets/{Assets-D1i5mRl6.js → Assets-DUB4VCUr.js} +7 -7
- package/_assets/{Assets.styles-Bi4xjNky.js → Assets.styles-DIh1hG4_.js} +1 -1
- package/_assets/{Authorizations-IONuoFEE.js → Authorizations-gse9z0i5.js} +1 -1
- package/_assets/{Cart-CC6i3iiK.js → Cart-xOvVoYwp.js} +2 -2
- package/_assets/{CircularProgress-TASjBonD.js → CircularProgress-BZT_u7sL.js} +1 -1
- package/_assets/{Collection-CG2b4Gx7.js → Collection-DkMWDyM9.js} +1 -1
- package/_assets/{CollectionCarousel-DclZ0mlb.js → CollectionCarousel-D-7TqEHy.js} +1 -1
- package/_assets/{Creator-8Mfi_dnj.js → Creator-CIj-i2cJ.js} +1 -1
- package/_assets/{ErrorNotice-Dp7YPtfk.js → ErrorNotice-qXSCgBBe.js} +1 -1
- package/_assets/{ExchangeController-D0Rulps3.js → ExchangeController-CoWk4iJ_.js} +1 -1
- package/_assets/{GetCredits-D3f6eK7Z.js → GetCredits-91dR46BQ.js} +1 -1
- package/_assets/{HelpersUtil-CHZxw6Oq.js → HelpersUtil-B_EI8lTR.js} +1 -1
- package/_assets/{ImportListings-CrYfE8u0.js → ImportListings-DrIx4tN-.js} +1 -1
- package/_assets/{ItemDetail-Dh08n_fl.js → ItemDetail-DneK31a0.js} +3 -3
- package/_assets/{ItemPreview.styles-wYbd945M.js → ItemPreview.styles--MP-O7tE.js} +1 -1
- package/_assets/{LoadMore-BNIL9tET.js → LoadMore-CPg41rwp.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-aqXUo-bI.js → ManaPricingBanner.styles-4CDYw79q.js} +1 -1
- package/_assets/{MenuList-Cuj0vFC5.js → MenuList-D5E4Wrvx.js} +1 -1
- package/_assets/{MyAssets-D5p4sDDv.js → MyAssets-C29gKaZs.js} +1 -1
- package/_assets/{MyFavorites-Gk_fH6sw.js → MyFavorites-CfsWFXpI.js} +1 -1
- package/_assets/{NotFound-DwGJKrjH.js → NotFound-DVmSPOa9.js} +1 -1
- package/_assets/{NotificationsBell-B0X96P7p.js → NotificationsBell-C_HZmA4_.js} +1 -1
- package/_assets/{OutfitDetail-Dd5OejtY.js → OutfitDetail-BCkHFvPX.js} +1 -1
- package/_assets/{OutfitPreview-x404cIYl.js → OutfitPreview-XyEsGBYa.js} +1 -1
- package/_assets/{OutfitStudio-DF_iLA7k.js → OutfitStudio-D6HxPa0M.js} +1 -1
- package/_assets/{StoreSettings-CXY0qyzv.js → StoreSettings-CmI6OJyt.js} +1 -1
- package/_assets/{Success-DNkWodW6.js → Success-CILFVgai.js} +1 -1
- package/_assets/{SwapController-Rg3Irf1I.js → SwapController-BtZYC1DC.js} +1 -1
- package/_assets/{Tooltip-BO9fgnbG.js → Tooltip-D-dOz9cj.js} +1 -1
- package/_assets/{TradeService-DIzj7uCq.js → TradeService-DFGHQuam.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-CVfGARdD.js → W3MFrameProviderSingleton-Dd3fipah.js} +3 -3
- package/_assets/{WebCryptoP256-0eyBpluy.js → WebCryptoP256-83ZQlmY9.js} +1 -1
- package/_assets/{authorizations-C1AfJLRY.js → authorizations-3-Mq1Ehl.js} +1 -1
- package/_assets/{basic-rL97KQul.js → basic-BndfWYou.js} +1 -1
- package/_assets/{biconomy-DkmjzVV4.js → biconomy-UoaVnBXL.js} +1 -1
- package/_assets/{browseLayout.styles-DzWXZTdR.js → browseLayout.styles-C2XsX59Z.js} +1 -1
- package/_assets/{builder-jhZkD6bW.js → builder-BCsqID1m.js} +1 -1
- package/_assets/{buy-CXpnZ35Y.js → buy-Bs_G6nfA.js} +1 -1
- package/_assets/{buy-gasless-BziA3gtB.js → buy-gasless-Cf6hPQpJ.js} +1 -1
- package/_assets/{categories-DraU6LZY.js → categories-CJDomWri.js} +1 -1
- package/_assets/{ccip-B6_1GTZr.js → ccip-DL1ik4S_.js} +1 -1
- package/_assets/{ccip-BJCCRkIr.js → ccip-LyTNGN_g.js} +1 -1
- package/_assets/{clsx-bcb20HaA.js → clsx-CbhzNwHc.js} +1 -1
- package/_assets/{controller-CqltqUJK.js → controller-DI4T8YXU.js} +2 -2
- package/_assets/{core-DFgcDI0R.js → core-DLkqCpDz.js} +4 -4
- package/_assets/{createSvgIcon-DKhyR4iX.js → createSvgIcon-BdIjzl8A.js} +1 -1
- package/_assets/{custom-C1vnmcgY.js → custom-DjHlYa2L.js} +1 -1
- package/_assets/{data-capture-D_wAwrCz.js → data-capture-CCEqsOVC.js} +1 -1
- package/_assets/{email-CDpqkxI2.js → email-MyVfElwc.js} +1 -1
- package/_assets/{embedded-wallet-CCymge2a.js → embedded-wallet-DGKPNmRz.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-79WZWEvr.js → emotion-styled.browser.esm-B-KYMSCc.js} +1 -1
- package/_assets/{engine-K79-3wUG.js → engine-P4mrsX3-.js} +1 -1
- package/_assets/{errors-4DfPe5KG.js → errors-B5G852-H.js} +1 -1
- package/_assets/{estimate-l1-fee-e9M5mnGL.js → estimate-l1-fee-CZTQo2Yh.js} +1 -1
- package/_assets/{execute-BAoe28Qg.js → execute-CqlntYG8.js} +2 -2
- package/_assets/{features-Bs2FlBtm.js → features-BstqY0d8.js} +1 -1
- package/_assets/{fetchTokenMetadata-pClntfRM.js → fetchTokenMetadata-wr3bODuw.js} +2 -2
- package/_assets/{field.styles-BlCMUm6N.js → field.styles-CeFk4Y5o.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-yxRtiVgT.js → get-ecosystem-wallet-info-BmrdD1ZM.js} +1 -1
- package/_assets/{getBalance-CcbCVOsb.js → getBalance-CGp1VbNi.js} +1 -1
- package/_assets/{getNFT-BHZbxxfy.js → getNFT-BATtEfMr.js} +1 -1
- package/_assets/{getNFT-Cs3xtqCU.js → getNFT-Bc7mOqON.js} +1 -1
- package/_assets/{getThemeProps-BLLnclJV.js → getThemeProps-Cj1ePFOP.js} +1 -1
- package/_assets/{grid.styles-ULDFkMa6.js → grid.styles-4uR2Oqak.js} +1 -1
- package/_assets/{hashTypedData-CO0tgaiF.js → hashTypedData--isNjJrk.js} +1 -1
- package/_assets/{hashTypedData-DpNd075i.js → hashTypedData-DmaIP4Ta.js} +1 -1
- package/_assets/{in-app-DRgzQ5z0.js → in-app-DkfGauuN.js} +1 -1
- package/_assets/{in-app-wallet-calls-DkrL1cCt.js → in-app-wallet-calls-_oAp4gRk.js} +1 -1
- package/_assets/{index-s0P5AR2z.js → index-6-oWZZKk.js} +1 -1
- package/_assets/{index-ndvGyFuK.js → index-6TyUCKeH.js} +1 -1
- package/_assets/{index-QYzzmkrp.js → index-9uXo0dDW.js} +1 -1
- package/_assets/{index-DZ_CpgRO.js → index-B08mxqyH.js} +1 -1
- package/_assets/{index-C2kzA4mV.js → index-B0XZJoRs.js} +3 -3
- package/_assets/{index-BD5xbVRd.js → index-B3qntzSb.js} +1 -1
- package/_assets/{index-UnW-qttV.js → index-B4VZ6oCr.js} +1 -1
- package/_assets/{index-Cw9Buaqy.js → index-B9aCuD80.js} +1 -1
- package/_assets/{index-pmYgNf4o.js → index-BF4F4-es.js} +1 -1
- package/_assets/{index-DZv1yX3H.js → index-BHPckyG6.js} +1 -1
- package/_assets/{index-B4CSRI8M.js → index-BQEMTtHk.js} +1 -1
- package/_assets/{index-CZAkoXAT.js → index-BQJhzjgB.js} +1 -1
- package/_assets/{index-UVKX7gHV.js → index-BYndrnYs.js} +1 -1
- package/_assets/{index-HzKciouT.js → index-BlqD0sjz.js} +1 -1
- package/_assets/{index-iNQ1gNi_.js → index-BmlqG1wa.js} +1 -1
- package/_assets/{index-DVhYSN4n.js → index-Bq3RaeMg.js} +1 -1
- package/_assets/{index-CLwlwAIK.js → index-CAtB_PCp.js} +2 -2
- package/_assets/{index-9wwl-XRz.js → index-CEec1iYe.js} +17 -17
- package/_assets/{index-UkpFRfQ7.js → index-CKuDkHtx.js} +1 -1
- package/_assets/{index-IL8sDetE.js → index-CNLdKmSV.js} +1 -1
- package/_assets/{index-wnXGZDFx.js → index-COG_bMzA.js} +1 -1
- package/_assets/{index-Cy78NsWj.js → index-CVTYXB-H.js} +1 -1
- package/_assets/{index-DA9YlTs2.js → index-CwgAx_D_.js} +1 -1
- package/_assets/{index-APj4WzhC.js → index-D-cwjSAX.js} +3 -3
- package/_assets/{index-DtTxgVE8.js → index-DA6dfZrr.js} +1 -1
- package/_assets/{index-CZ6qluuL.js → index-DARDndd8.js} +1 -1
- package/_assets/{index-BayCkUJb.js → index-DA_UmuJW.js} +2 -2
- package/_assets/{index-DZWN2B23.js → index-DCcvZO5Y.js} +1 -1
- package/_assets/{index-BmqSpa_-.js → index-DG2jERXm.js} +1 -1
- package/_assets/{index-CD-1zUsA.js → index-DI6mFHN_.js} +1 -1
- package/_assets/{index-BaScAbc6.js → index-DMfeEICj.js} +1 -1
- package/_assets/{index-CDoPxnOt.js → index-DXe6U5Nd.js} +1 -1
- package/_assets/{index-DeeVEpUN.js → index-DYIatsEA.js} +1 -1
- package/_assets/{index-F7iGy4N6.js → index-DYJqGaxj.js} +2 -2
- package/_assets/{index-BtcGKkld.js → index-Df_MtlRn.js} +1 -1
- package/_assets/{index-CQDwyW0y.js → index-DiwV8Pqc.js} +1 -1
- package/_assets/{index-XKNU4pMQ.js → index-DwhWwt0R.js} +1 -1
- package/_assets/{index-BH_V6MtA.js → index-GIpFWU31.js} +1 -1
- package/_assets/{index-DxvEkyFh.js → index-Jw4WyTL7.js} +1 -1
- package/_assets/{index-u80x1-iQ.js → index-Rzy39Nn7.js} +1 -1
- package/_assets/{index-CuyybehC.js → index-TXpJyzEO.js} +1 -1
- package/_assets/{index-xSU_1Q0H.js → index-TyIfm5pC.js} +1 -1
- package/_assets/{index-ChXTmBUQ.js → index-UOqdWcGo.js} +1 -1
- package/_assets/{index-CPXhIJG_.js → index-a7lLIynB.js} +1 -1
- package/_assets/{index-C7PcZNVu.js → index-bI7YB81Q.js} +1 -1
- package/_assets/{index-C1IdaBWg.js → index-g7yoq537.js} +1 -1
- package/_assets/{index-DWDCHhqm.js → index-hFWlaYZc.js} +1 -1
- package/_assets/{index-mYETjRZ2.js → index-hxv9huma.js} +1 -1
- package/_assets/{index-D__XyT6J.js → index-pUOx764A.js} +1 -1
- package/_assets/{index-C7pWVQTv.js → index-qOIpyDqw.js} +3 -3
- package/_assets/{index-38gtJ95w.js → index-wLhUVrXT.js} +1 -1
- package/_assets/{index.es-Bfm7fmDv.js → index.es-CleSpdBe.js} +1 -1
- package/_assets/{index.es-CSDWEQ3N.js → index.es-DSBJgnik.js} +4 -4
- package/_assets/{index.es-DJMgYiau.js → index.es-DcH5dh4Z.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DCo_Witg.js → localBatchGatewayRequest-BQaanzyf.js} +1 -1
- package/_assets/{mana-convert-BVz9Ojfp.js → mana-convert-gdOzEDdP.js} +1 -1
- package/_assets/{mana-rate-CNR1wHIx.js → mana-rate-DFh9C_O1.js} +1 -1
- package/_assets/{networks-BjEprBZY.js → networks-DweEIHqd.js} +1 -1
- package/_assets/{onramp-DA0IXhxL.js → onramp-CQin_sc0.js} +1 -1
- package/_assets/{openzeppelin-CZE9q4eI.js → openzeppelin-aL0pLCk3.js} +1 -1
- package/_assets/{parseNft-B18S2NmF.js → parseNft-C3_Nz5T-.js} +2 -2
- package/_assets/{parseSignature-9n8B-B9F.js → parseSignature-CaUNRWNX.js} +3 -3
- package/_assets/{parseSignature-Cff06c2o.js → parseSignature-DbUWX_0J.js} +1 -1
- package/_assets/{passkeys-CC8JVy-m.js → passkeys-ErJmNcK7.js} +1 -1
- package/_assets/{pay-with-exchange-D3NuRJmY.js → pay-with-exchange-IR4P3LG2.js} +1 -1
- package/_assets/{qr-overlay-DbTnL2jo.js → qr-overlay-CdnDwp_H.js} +1 -1
- package/_assets/{receive-Bcdayv7D.js → receive-zGMAuzLF.js} +1 -1
- package/_assets/{resolveImplementation-CwGmt-Ul.js → resolveImplementation-DBCwfUsj.js} +1 -1
- package/_assets/{rpc-DRzCeqsN.js → rpc-DcBDiZd9.js} +1 -1
- package/_assets/{secp256k1-ClhqnUH3.js → secp256k1-B-E-jiWl.js} +1 -1
- package/_assets/{secp256k1-DLUn4TB-.js → secp256k1-Dewsd8iM.js} +1 -1
- package/_assets/{secp256k1-DhzpyilF.js → secp256k1-Dw0WpBX5.js} +1 -1
- package/_assets/{send-wLs7dMmi.js → send-DDT-5Y8C.js} +1 -1
- package/_assets/{send-batch-transaction-DHantNiN.js → send-batch-transaction-BurBPeh7.js} +1 -1
- package/_assets/{send-eip712-transaction-fLP_Vd1c.js → send-eip712-transaction-D77WUDwd.js} +2 -2
- package/_assets/{send-gasless-transaction-SMtNChEu.js → send-gasless-transaction-CIWAOyRc.js} +2 -2
- package/_assets/{send-transaction-BsC7jNWJ.js → send-transaction-BXhwaD9S.js} +2 -2
- package/_assets/{sendMetaTransaction-CtKaGv9m.js → sendMetaTransaction-CrIt0KCG.js} +1 -1
- package/_assets/{sendRawTransaction-DFSXwuy_.js → sendRawTransaction-DNK5LA13.js} +3 -3
- package/_assets/{serializeTransaction-ndx8JnHB.js → serializeTransaction-D3WekrgC.js} +1 -1
- package/_assets/{session-proposal-C8st7cqE.js → session-proposal-BlosSPbJ.js} +1 -1
- package/_assets/{session-request-vqs34KuA.js → session-request-C8iYxI6j.js} +2 -2
- package/_assets/{signing-4la8JLly.js → signing-Bx48W7O-.js} +3 -3
- package/_assets/{socials-6ow68kgk.js → socials-BSmNv258.js} +1 -1
- package/_assets/{swaps-D5qhgYfH.js → swaps-DyNopWtM.js} +1 -1
- package/_assets/{thirdweb-BbrRIT8Z.js → thirdweb-Bc1voIUm.js} +3 -3
- package/_assets/{to-serializable-transaction-DdVBjpVG.js → to-serializable-transaction-BXY289Ul.js} +2 -2
- package/_assets/{trade-encoding-u1ITpVgD.js → trade-encoding-B7y8VfDo.js} +1 -1
- package/_assets/{transactionReceipt-KCU4fxr5.js → transactionReceipt-DLzKebEg.js} +1 -1
- package/_assets/{transactions-BA1mj6Hg.js → transactions-BWXAu1Vp.js} +1 -1
- package/_assets/{useCreditPacks-CQJURGzy.js → useCreditPacks-CYnMKZmp.js} +1 -1
- package/_assets/{useInfiniteGrid-BE0gx0bE.js → useInfiniteGrid-ottWIC3k.js} +1 -1
- package/_assets/useManaRate-CPn6JNFj.js +1 -0
- package/_assets/{useStore-u-3kFHFb.js → useStore-DC77ufHd.js} +1 -1
- package/_assets/{useTheme-CjaDxtu4.js → useTheme-BOb3XgSe.js} +1 -1
- package/_assets/{verifyHash-DeQJYKTd.js → verifyHash-B6wVUzvm.js} +1 -1
- package/_assets/{w3m-modal-CTZXmBh-.js → w3m-modal-CYIABu52.js} +1 -1
- package/_assets/{w3m-modal-DyW-GOaP.js → w3m-modal-D0DQYwij.js} +1 -1
- package/_assets/{wait-for-tx-receipt-CWPx3r9S.js → wait-for-tx-receipt-CzEApn7N.js} +1 -1
- package/_assets/{wallets-GJytAlIt.js → wallets-CQPQ_gpR.js} +5 -5
- package/_assets/{web-connector-DWE3a9mg.js → web-connector-B5U5FrL8.js} +3 -3
- package/_assets/{writeContract-D3GlbOtW.js → writeContract-CGlJd1QG.js} +1 -1
- package/_assets/{zoraTestnet-C9-Fej0w.js → zoraTestnet-pKTbhMUO.js} +1 -1
- package/index.html +11 -11
- package/package.json +1 -1
- package/_assets/useManaRate-CrXBa97M.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bm as lt,s as l,t as o,k as ut,B as ht,m as xt,b as d,n as mt,u as v,I as f,bn as G,bo as K,bp as pt,p as k,bq as gt,b2 as T,ao as ft,br as bt,bs as C}from"./index-
|
|
1
|
+
import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bm as lt,s as l,t as o,k as ut,B as ht,m as xt,b as d,n as mt,u as v,I as f,bn as G,bo as K,bp as pt,p as k,bq as gt,b2 as T,ao as ft,br as bt,bs as C}from"./index-CEec1iYe.js";import{a as yt}from"./mana-convert-gdOzEDdP.js";import{u as jt}from"./useManaRate-CPn6JNFj.js";import{L as vt}from"./LoadMore-CPg41rwp.js";import{u as b}from"./useInfiniteGrid-ottWIC3k.js";import{m as X}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-rate-DFh9C_O1.js";const kt=15e3;function It(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=kt}function At(t){const n=[...t].sort((i,a)=>a.createdAt-i.createdAt),s=[];for(const i of n){const a=s[s.length-1];a&&It(a[a.length-1],i)?a.push(i):s.push([i])}return s.map(i=>{var a;return{id:((a=i.find(c=>c.txHash))==null?void 0:a.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,h)=>c+h.credits,0),lines:i}})}function wt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function $t(t){const n=[],s=new Map;for(const i of t){const a=wt(i);if(!a){n.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=s.get(a);if(c){c.quantity+=1,c.credits+=i.credits;continue}const h={key:a,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};s.set(a,h),n.push(h)}return n}function Pt(t,n){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:n?yt(t.manaWei,n):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Lt(t){const s=At(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=t.sales.map(r=>{const x=Pt(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),a=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...i,...a,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Nt(t,n){return n==="all"?t:n==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const Z=t=>t.trim().toLowerCase();function Et(t){const n=new Map;for(const s of t??[]){const i=Z(s.txHash??"");if(!i)continue;const a=n.get(i);a?a.push(s):n.set(i,[s])}return n}function Tt(t,n,s=Date.now()){const i=n.txHash?t.get(Z(n.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const a=i.length===1?Ct(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:a};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:a,availableAt:h}}function Ct(t){return lt(t)}const Ft="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/credits-product-vs4Q6u6l.svg",F=ut`
|
|
2
2
|
0% { background-position: 200% 0; }
|
|
3
3
|
100% { background-position: -200% 0; }
|
|
4
4
|
`,St=l.section`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-
|
|
1
|
+
import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-CEec1iYe.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.5.0/_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{d as We,r as
|
|
1
|
+
import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b7 as Xe,b8 as Ye,a as et,s,t,n as Be,a_ as tt,q as nt,ao as ge,b as n,o as st,I as S,p as M,bv as ne,aZ as ot,O as Y,bb as it,ba as rt,m as Fe,aa as at,ac as _e,ad as q,aq as lt,bw as ct}from"./index-CEec1iYe.js";import{s as dt,u as pt}from"./buy-Bs_G6nfA.js";import{m as ht,a as Le}from"./mana-convert-gdOzEDdP.js";import{u as Ue}from"./useManaRate-CPn6JNFj.js";import{g as xt,h as ft,i as mt,j as ut,k as gt,C as bt,l as yt,o as wt,m as jt,n as vt,M as $t,p as Ct,E as kt,q as St,r as Et,s as Rt,t as _t,u as Tt,v as zt}from"./Assets.styles-DIh1hG4_.js";import{S as Te,R as It,F as At,e as Nt}from"./categories-CJDomWri.js";import{L as Mt}from"./LoadMore-CPg41rwp.js";import{u as Pt}from"./useInfiniteGrid-ottWIC3k.js";import{E as Wt}from"./ErrorNotice-qXSCgBBe.js";import{d as Bt}from"./dcl-schemas-Dr9BTjb7.js";import{s as Ft,G as Lt,w as Ut,S as Ht}from"./buy-gasless-Cf6hPQpJ.js";import{i as Ot}from"./trade-encoding-B7y8VfDo.js";import{r as Gt}from"./mana-rate-DFh9C_O1.js";import{f as Dt}from"./errors-B5G852-H.js";import{J as qt,C as Vt,B as be}from"./ethers-CtNGBird.js";import{n as Zt}from"./Tooltip-D-dOz9cj.js";import{G as Kt}from"./grid.styles-4uR2Oqak.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-3-Mq1Ehl.js";import"./sendMetaTransaction-CrIt0KCG.js";function V(o){const i=o.source??"item",a=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${a}`}const L="100000000000000000000",He=2,ee=15,Jt=/^[a-zA-Z0-9]+$/;function ze(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:Jt.test(i)?i.length<He?{ok:!1,reason:"too-short"}:i.length>ee?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Xt=["function available(string _subdomain) view returns (bool)"],Ie={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return F.chainId===Number(Bt.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function en(o,i={}){var p;const{rpc:a,address:h}=Yt(),l=new qt(a),d=new Vt(h,Xt,l);console.info(`[names] availability check → DCLRegistrar(${h}).available("${o}") on ${a}`);const x=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${x}`),x?"available":"taken"}const tn="https://app.across.to/api";class ye extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(o){return ht(L,o)}async function sn(o,i,a={}){var p;const h=a.chainId??F.chainId,l=a.provider??"across",d=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${h}&provider=${l}`,x=await et(d,{method:"GET",identity:o,metadata:{}});if(!x.ok){let r;try{r=(p=await x.json())==null?void 0:p.code}catch{}throw r==="ROUTE_COST_TOO_HIGH"?new ye:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function on(o,i){const a=be.from(o.availableAmount),l=be.from(L).sub(a);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ot(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:L}}async function rn(o,i={}){const a=tn,h=i.intervalMs??1e4,l=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const p=await fetch(`${a}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const r=await p.json(),u=(r.status??"pending").toLowerCase(),g=r.fillTx??r.fillTxnRef??null,w=r.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:w}}}catch{}x<l-1&&await new Promise(p=>setTimeout(p,h))}return d}async function an(o){const{name:i,identity:a,signer:h}=o,l=o.chainId??F.chainId,d=o.provider??"across",x=(o.beneficiary??await h.getAddress()).toLowerCase();let p=null,r=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:d});try{const u=await Gt(l),g=nn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await sn(a,i,{chainId:l,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Xe(a,g);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),be.from(j.maxCreditedValue).lt(L))throw new Error("Credit under-sized for the name price");const k=on(j.credit,w);let f;try{f=await Ft({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Lt))throw b;f=await dt(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ut(f),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await rn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:f};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:x,originConfirmed:r}),u instanceof Ht)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Ye(a,[p]).catch(()=>{}),u instanceof ye)throw u;const g=new Error(Dt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=u,g}}const ln=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -161,12 +161,12 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b7
|
|
|
161
161
|
&:focus-within {
|
|
162
162
|
border-color: ${t.colors.magenta};
|
|
163
163
|
}
|
|
164
|
-
`,
|
|
164
|
+
`,fn=s.span`
|
|
165
165
|
flex: none;
|
|
166
166
|
font-family: ${t.font.sans};
|
|
167
167
|
font-size: 18px;
|
|
168
168
|
color: ${t.colors.muted2};
|
|
169
|
-
`,
|
|
169
|
+
`,mn=s.input`
|
|
170
170
|
flex: 0 1 auto;
|
|
171
171
|
min-width: 0;
|
|
172
172
|
border: 0;
|
|
@@ -347,7 +347,7 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b7
|
|
|
347
347
|
outline: 2px solid ${t.colors.accent};
|
|
348
348
|
outline-offset: 2px;
|
|
349
349
|
}
|
|
350
|
-
`,
|
|
350
|
+
`,fe=s.div`
|
|
351
351
|
display: flex;
|
|
352
352
|
align-items: flex-start;
|
|
353
353
|
gap: 12px;
|
|
@@ -379,7 +379,7 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b7
|
|
|
379
379
|
color: ${t.colors.accent};
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
`;function En({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=
|
|
382
|
+
`;function En({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=m.useState("confirm"),[g,w]=m.useState(""),[j,k]=m.useState(null),f=m.useRef(!1),b=g.trim().toLowerCase()===o.toLowerCase(),v=r==="completing",E=i!=null?ge(i):"—",C=i==null,T=l==null?void 0:l.credits,R=i!=null&&T!=null?i-T:0,$=R>0,z=C?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:ge(R)}):null;m.useEffect(()=>{const y=H=>{H.key==="Escape"&&!v&&a()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[v,a]);async function I(){if(!(!h||!b||C||$||f.current)){f.current=!0,u("completing"),k(null);try{const y=await an({name:o,identity:h.identity,signer:h.signer});Y("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:y.status}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),u(y.status==="registered"?"success":"pending")}catch(y){Y(rt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:it(y),purchase_type:"name"}),k(y instanceof ye?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),u("error")}finally{f.current=!1}}}const A=r!=="success"&&r!=="pending",te=st(h==null?void 0:h.providerType);return e.jsx(ln,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:r==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:a,disabled:v,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{})]}),(r==="confirm"||r==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),r==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ae,{onClick:()=>u("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Rn(o)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(fn,{"aria-hidden":!0,children:"@"}),e.jsx(mn,{value:g,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),z?e.jsxs(fe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:z})]}):null,e.jsx(Ae,{onClick:()=>void I(),disabled:!b||!h||C||$,children:n("names.buyCta")})]})]}),r==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ot,alt:"",width:56,height:56}),e.jsx(yn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),r==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs(fe,{"data-tone":"info",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsx(Ne,{children:e.jsx(Me,{onClick:()=>{a(),p("/my-items")},children:n("names.myItems")})})]}),r==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsxs(Ne,{children:[e.jsx(Me,{onClick:()=>{a(),p("/my-items")},children:n("names.myItems")}),e.jsx(Sn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Rn(o){return o.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}const _n="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/governance-DnazlIjy.webp",An=s.div`
|
|
383
383
|
width: 100%;
|
|
384
384
|
min-width: 0;
|
|
385
385
|
`,Nn=s.nav`
|
|
@@ -658,7 +658,7 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b7
|
|
|
658
658
|
width: 16px;
|
|
659
659
|
height: 16px;
|
|
660
660
|
}
|
|
661
|
-
`,
|
|
661
|
+
`,me=s.div`
|
|
662
662
|
display: flex;
|
|
663
663
|
align-items: center;
|
|
664
664
|
gap: 8px;
|
|
@@ -797,4 +797,4 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b7
|
|
|
797
797
|
clip: rect(0, 0, 0, 0);
|
|
798
798
|
white-space: nowrap;
|
|
799
799
|
border: 0;
|
|
800
|
-
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function ps({onBack:o}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=f.useState(""),[p,r]=f.useState("idle"),[u,g]=f.useState(!1),w=f.useRef(null),[j,k]=f.useState(void 0);f.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),f.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const T=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:T.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),T.abort()}},[d]);const m=ze(d),b=m.ok&&(p==="available"||p==="error");function v(){if(b){if(!i){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(fe,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!m.ok&&m.reason==="too-short"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(os,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ue=48;function Ms(){const[o]=Qe(),i=We(),a=(o.get("q")??"").trim().toLowerCase(),h=(o.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=f.useState("wearable"),[x,p]=f.useState(null),[r,u]=f.useState([]),[g,w]=f.useState(""),[j,k]=f.useState(""),[m,b]=f.useState("on_sale"),[v,E]=f.useState(!1),[C,T]=f.useState("newest"),[R,$]=f.useState(!1);f.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=_}},[R]);const z=m==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=pt(),y=x?Nt[x]:void 0,U=(Te.find(c=>c.key===C)??Te[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:m==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Pt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=f.useRef(null);f.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=f.useRef("__init__");f.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:m,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:m,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,m,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(_=>_.includes(c)?_.filter(W=>W!==c):[..._,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of It)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),m!=="on_sale"&&B.push({key:"status",label:m==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(xt,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(mt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(ft,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(ut,{children:[e.jsx(gt,{children:n("assets.filters")}),e.jsx(bt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(yt,{children:e.jsx(wt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:m,onStatus:b,smart:v,onSmart:E})}),e.jsx(jt,{children:e.jsx(vt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx($t,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(At,{sort:C,onSort:T,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx(Ct,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Wt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(kt,{"data-testid":"browse-empty",children:[e.jsx(St,{src:hs,alt:""}),e.jsxs(Et,{children:[e.jsx(Rt,{children:n("assets.empty.title")}),e.jsx(_t,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(zt,{type:"button",onClick:()=>i("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(_e,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const _=c;if(_.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(_);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{..._,priceCredits:W}},V(c))}),$e?e.jsx(_e,{count:6}):null]})}),e.jsx(Mt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ms as Assets};
|
|
800
|
+
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function ps({onBack:o}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=m.useState(""),[p,r]=m.useState("idle"),[u,g]=m.useState(!1),w=m.useRef(null),[j,k]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const T=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:T.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),T.abort()}},[d]);const f=ze(d),b=f.ok&&(p==="available"||p==="error");function v(){if(b){if(!i){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(me,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(me,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(me,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(os,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ue=48;function Ms(){const[o]=Qe(),i=We(),a=(o.get("q")??"").trim().toLowerCase(),h=(o.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=m.useState("wearable"),[x,p]=m.useState(null),[r,u]=m.useState([]),[g,w]=m.useState(""),[j,k]=m.useState(""),[f,b]=m.useState("on_sale"),[v,E]=m.useState(!1),[C,T]=m.useState("newest"),[R,$]=m.useState(!1);m.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=_}},[R]);const z=f==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=pt(),y=x?Nt[x]:void 0,U=(Te.find(c=>c.key===C)??Te[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Pt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=m.useRef(null);m.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=m.useRef("__init__");m.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:f,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:f,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,f,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(_=>_.includes(c)?_.filter(W=>W!==c):[..._,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of It)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),f!=="on_sale"&&B.push({key:"status",label:f==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(xt,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(ft,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(ut,{children:[e.jsx(gt,{children:n("assets.filters")}),e.jsx(bt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(yt,{children:e.jsx(wt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:f,onStatus:b,smart:v,onSmart:E})}),e.jsx(jt,{children:e.jsx(vt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx($t,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(At,{sort:C,onSort:T,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx(Ct,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Wt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(kt,{"data-testid":"browse-empty",children:[e.jsx(St,{src:hs,alt:""}),e.jsxs(Et,{children:[e.jsx(Rt,{children:n("assets.empty.title")}),e.jsx(_t,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(zt,{type:"button",onClick:()=>i("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(_e,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const _=c;if(_.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(_);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{..._,priceCredits:W}},V(c))}),$e?e.jsx(_e,{count:6}):null]})}),e.jsx(Mt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ms as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-
|
|
1
|
+
import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-CJDomWri.js";import{n as c,T as se}from"./Tooltip-D-dOz9cj.js";import{t as e,s as o,I as g,b as s,aa as ae,d as v}from"./index-CEec1iYe.js";const re=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,k as R,m as F,b as e,n as G,o as O,I as z,p as B,u as w,q as K,c as Q,v as H,w as A,j as X,x as Z,y as T}from"./index-
|
|
1
|
+
import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,k as R,m as F,b as e,n as G,o as O,I as z,p as B,u as w,q as K,c as Q,v as H,w as A,j as X,x as Z,y as T}from"./index-CEec1iYe.js";import{a as J,b as U,d as V,f as Y,s as tt,h as it}from"./authorizations-3-Mq1Ehl.js";import{f as et}from"./builder-BCsqID1m.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-B5G852-H.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CrIt0KCG.js";const nt=R`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,st=R`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as le,s as i,b as s,ao as de,aZ as sa,an as na,I as O,p as Mt,a9 as Ne,m as ia,L as Q,ab as dt,n as ra,u as oa,a_ as ca,q as da,a$ as la,b0 as ua,b1 as ha,b2 as pa,o as ga,b3 as lt,O as G,b4 as ut,b5 as xa,j as ae,c as ht,b6 as ma,d as fa,b7 as pt,b8 as Re,b9 as ye,ba as be,bb as gt,g as ve,e as ya,C as We,bc as ba}from"./index-
|
|
1
|
+
import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as le,s as i,b as s,ao as de,aZ as sa,an as na,I as O,p as Mt,a9 as Ne,m as ia,L as Q,ab as dt,n as ra,u as oa,a_ as ca,q as da,a$ as la,b0 as ua,b1 as ha,b2 as pa,o as ga,b3 as lt,O as G,b4 as ut,b5 as xa,j as ae,c as ht,b6 as ma,d as fa,b7 as pt,b8 as Re,b9 as ye,ba as be,bb as gt,g as ve,e as ya,C as We,bc as ba}from"./index-CEec1iYe.js";import{M as va,S as wa,C as Ca,H as ja,a as ka,T as $a,X as Sa,b as Ma,B as Ta,c as Ia,d as xt,e as Pa,f as ke,P as Tt,m as za,g as Aa,h as Ea,i as qa,j as It,k as $e,L as _a,l as Ba,n as mt,o as ft,W as Ra,p as Wa,q as Fa,A as La,r as Ka,s as Ua,t as Na,u as Qa,v as Oa,w as Ha,x as Va,y as Ga,z as Da,D as Ya,E as Ja,F as Xa,G as Za,I as es,J as ts,K as Fe,N as as,O as ss,Q as ns,R as is,U as yt,V as bt,Y as rs,Z as os,_ as cs}from"./CollectionCarousel-D-7TqEHy.js";import{u as ds}from"./useManaRate-CPn6JNFj.js";import{r as ls}from"./mana-rate-DFh9C_O1.js";import{j as us,k as hs,h as ps,n as gs,i as xs,A as ms}from"./authorizations-3-Mq1Ehl.js";import{u as fs,g as ys,b as Le}from"./buy-Bs_G6nfA.js";import{b as bs,w as vs,S as vt,G as ws}from"./buy-gasless-Cf6hPQpJ.js";import{u as Cs,M as js,R as we,r as ks,c as $s,p as wt}from"./useCreditPacks-CYnMKZmp.js";import{i as Ss,a as Ms}from"./errors-B5G852-H.js";import{E as Ts}from"./ErrorNotice-qXSCgBBe.js";import{u as Ct}from"./mana-convert-gdOzEDdP.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-B7y8VfDo.js";import"./sendMetaTransaction-CrIt0KCG.js";const{colors:se,radius:Is}=le,Ps=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${se.text};
|
|
60
60
|
}
|
|
61
|
-
`,_s="https://cdn.decentraland.org/@dcl/shop/0.
|
|
61
|
+
`,_s="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(va,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(wa,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Ca,{"data-tall":Y||void 0,children:[e.jsxs(ja,{children:[e.jsxs(ka,{children:[e.jsx($a,{children:D}),!W&&e.jsx(Sa,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Ma,{})})]}),e.jsxs(Ta,{children:[e.jsx(Ia,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Pa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=za(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(Aa,{"data-testid":"buy-error",children:[e.jsx(Ea,{src:_s,alt:"",width:64,height:80}),e.jsxs(qa,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(_a,{src:sa,alt:"",width:61,height:61}),e.jsx(Ba,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ra,{"data-testid":"nofunds-warning",children:[e.jsx(Wa,{}),e.jsxs(Fa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(La,{children:[e.jsx(Ka,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ua,{children:[e.jsxs("div",{children:[e.jsxs(Na,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Es,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Qa,{address:n.item.creator}):null]}),e.jsxs(Oa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Va,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ga,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Da,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Ja,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Xa,{children:[e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ts,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
62
|
max-width: 1510px;
|
|
63
63
|
margin: 0 auto;
|
|
64
64
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a5 as N,a6 as U,a7 as o,a8 as n,a9 as D,k as M}from"./index-
|
|
1
|
+
import{a5 as N,a6 as U,a7 as o,a8 as n,a9 as D,k as M}from"./index-CEec1iYe.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-CbhzNwHc.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,B=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as c,R as X,v as E,I as ee,b as a,c as te,j as ae,u as re,m as oe,d as ie,ac as F,ad as se,aT as ne,aU as ce}from"./index-
|
|
1
|
+
import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as c,R as X,v as E,I as ee,b as a,c as te,j as ae,u as re,m as oe,d as ie,ac as F,ad as se,aT as ne,aU as ce}from"./index-CEec1iYe.js";import{E as le}from"./ErrorNotice-qXSCgBBe.js";import{d as de,g as pe,a as xe,P as ue,C as me,b as ge,c as he,B as be,S as fe,M as je,A as ve}from"./browseLayout.styles-C2XsX59Z.js";import{u as ye}from"./useStore-DC77ufHd.js";import{S as z,C as Ce,F as we,c as Ne,P as Se,d as ke,H as Pe,e as $e}from"./categories-CJDomWri.js";import{L as Ae}from"./LoadMore-CPg41rwp.js";import{u as Me}from"./useInfiniteGrid-ottWIC3k.js";import{G as Re}from"./grid.styles-4uR2Oqak.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Te=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-DehiWSvs.js";import{s as e,t as o,b as g,p as k,ao as j,bt as C,d as Y,k as G,I as Q,j as X,g as W,C as B,e as Z,Y as J,bR as F,ad as q}from"./index-
|
|
1
|
+
import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,p as k,ao as j,bt as C,d as Y,k as G,I as Q,j as X,g as W,C as B,e as Z,Y as J,bR as F,ad as q}from"./index-CEec1iYe.js";import{s as ee,i as U,A as H,g as K,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-3-Mq1Ehl.js";import{i as se}from"./errors-B5G852-H.js";import{E as re}from"./ErrorNotice-qXSCgBBe.js";import{a as ce}from"./buy-Bs_G6nfA.js";import{g as de,a as le}from"./trade-encoding-B7y8VfDo.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-CrIt0KCG.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function pt(a){var b,y,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,l=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 d=n-i,f=be(d,n,s);l>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,m=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="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",we=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";import{t as Z,A as je,E as I,D as _,s as r,bd as ve,an as Ce,be as ye,b as t,bf as $e,bg as W,B as ke,a9 as q,R as J,n as Ne,v as Q,I as T,c as Pe,m as Se,ac as S,d as Le,ad as Ae,bc as Ee,bh as Fe}from"./index-
|
|
1
|
+
import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";import{t as Z,A as je,E as I,D as _,s as r,bd as ve,an as Ce,be as ye,b as t,bf as $e,bg as W,B as ke,a9 as q,R as J,n as Ne,v as Q,I as T,c as Pe,m as Se,ac as S,d as Le,ad as Ae,bc as Ee,bh as Fe}from"./index-CEec1iYe.js";import{d as Me,g as ze,a as Be,P as Re,C as Ie,b as _e,c as We,A as Te,B as He,S as Ue,M as De,e as Ge,f as Ke}from"./browseLayout.styles-C2XsX59Z.js";import{u as Oe,L as Ve}from"./useStore-DC77ufHd.js";import{S as H,C as Ye,F as Ze,c as qe,P as Je,d as Qe,H as Xe,e as et}from"./categories-CJDomWri.js";import{L as U}from"./LoadMore-CPg41rwp.js";import{u as D}from"./useInfiniteGrid-ottWIC3k.js";import{E as G}from"./ErrorNotice-qXSCgBBe.js";import{G as K}from"./grid.styles-4uR2Oqak.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:tt}=Z,it=r.article`
|
|
2
2
|
height: 300px;
|
|
3
3
|
background: ${u.bg};
|
|
4
4
|
border-radius: ${X.card};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-
|
|
1
|
+
import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-CEec1iYe.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-
|
|
1
|
+
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-Dd3fipah.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-qOIpyDqw.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,k as B,m as ue,b as r,d as p,n as ge,q as fe,O as g,b2 as me,j as N,bb as U,I as ie,aZ as H,p as re,bu as O}from"./index-
|
|
1
|
+
import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,k as B,m as ue,b as r,d as p,n as ge,q as fe,O as g,b2 as me,j as N,bb as U,I as ie,aZ as H,p as re,bu as O}from"./index-CEec1iYe.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-CYnMKZmp.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-convert-gdOzEDdP.js";const P="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/credit-coin-CmcTCd5i.webp",je="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",Se="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 24px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-
|
|
1
|
+
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-TXpJyzEO.js";import{d as g,r as v}from"./index-qOIpyDqw.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-Dd3fipah.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,d as se,r as w,L as ae}from"./react-DehiWSvs.js";import{t as Q,s as t,k as re,o as oe,b as n,d as _,B as S,p as q,O as de,aY as F,j as D,F as le,m as ce,n as pe,q as xe,u as he,aa as ge,I as K,Z as me,a1 as ue,a2 as fe,bt as we,w as ye}from"./index-
|
|
1
|
+
import{j as e,d as se,r as w,L as ae}from"./react-DehiWSvs.js";import{t as Q,s as t,k as re,o as oe,b as n,d as _,B as S,p as q,O as de,aY as F,j as D,F as le,m as ce,n as pe,q as xe,u as he,aa as ge,I as K,Z as me,a1 as ue,a2 as fe,bt as we,w as ye}from"./index-CEec1iYe.js";import{i as be,b as je,S as ve,C as ke,c as $e,f as Ie}from"./ManaPricingBanner.styles-4CDYw79q.js";import{u as Ce}from"./buy-Bs_G6nfA.js";import{C as W}from"./field.styles-CeFk4Y5o.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-rate-DFh9C_O1.js";import"./mana-convert-gdOzEDdP.js";import"./trade-encoding-B7y8VfDo.js";import"./authorizations-3-Mq1Ehl.js";import"./sendMetaTransaction-CrIt0KCG.js";function O({size:a=12,...v}){return e.jsx("svg",{viewBox:"0 0 20 20",width:a,height:a,fill:"none","aria-hidden":!0,focusable:"false",...v,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:L,radius:Se,z:Le}=Q,Te=re`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0;
|