@dcl/shop 0.1.0-29842935035.commit-a65be40 → 0.1.0-29869835587.commit-e6e6578
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/{AnimatedBackground-CnAO4k7S.js → AnimatedBackground-BvysF8a0.js} +3 -3
- package/assets/Assets-DoUIRoSX.js +503 -0
- package/assets/Cart-Cyj_u0xP.js +3 -0
- package/assets/Cart-Ep_4Wxpy.css +1 -0
- package/assets/{CircularProgress-ApNcnq7N.js → CircularProgress-Bf7cTa84.js} +5 -5
- package/assets/{Collection-DuTrg3E-.js → Collection-BFUSn0Z_.js} +2 -2
- package/assets/{CollectionCarousel-C5GeFa_Y.js → CollectionCarousel-BaK4BZqg.js} +1 -1
- package/assets/{CollectionCarousel-BRpR9AB4.css → CollectionCarousel-BbM25ExM.css} +1 -1
- package/assets/Creator-CTfg9WAL.js +1 -0
- package/assets/{CssVarsProvider-D2zNKsxj.js → CssVarsProvider-DQXUaIP8.js} +1 -1
- package/assets/{ExchangeController-DWwsC0kg.js → ExchangeController-H99cRhIr.js} +1 -1
- package/assets/GetCredits-BqhYAHL0.js +1 -0
- package/assets/{HelpersUtil-DXarOia5.js → HelpersUtil-CN9OoRaT.js} +1 -1
- package/assets/{ImportListings-CdLYYVRk.js → ImportListings-CCQDdZMF.js} +2 -2
- package/assets/ItemDetail-BiAHzfHh.css +1 -0
- package/assets/ItemDetail-C6EEFa3M.js +78 -0
- package/assets/{LoadMore-BMDjLVnk.js → LoadMore-QYabEF53.js} +1 -1
- package/assets/MarketCheckout-B1QbAQBC.js +50 -0
- package/assets/{MyAssets-Bvn9R5Vx.js → MyAssets-gjvqMgx3.js} +3 -3
- package/assets/{MyFavorites-CnUUhrsk.js → MyFavorites-CCbFgdqL.js} +1 -1
- package/assets/{MyPurchases-BLpXWFws.js → MyPurchases-D04-_M8f.js} +1 -1
- package/assets/{NotFound-9S6G5mG4.js → NotFound-ViHzr3Nr.js} +1 -1
- package/assets/PrimaryListModal-D6DU8-ZC.js +1 -0
- package/assets/{StoreSettings-YvF4h8EI.js → StoreSettings-BnHjda9z.js} +5 -5
- package/assets/{Success-C1LGYw7c.js → Success-CbfD54bz.js} +2 -2
- package/assets/{SwapController-DzlqZKEu.js → SwapController-Tfj7j5wZ.js} +1 -1
- package/assets/{TradeService-BIXNDi8_.js → TradeService-kxdTGO_i.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-7ZlGHyOT.js → W3MFrameProviderSingleton-BWjqHbac.js} +3 -3
- package/assets/{WebCryptoP256-BsFuSRMZ.js → WebCryptoP256-8HU24K3x.js} +1 -1
- package/assets/{basic-Bas_eU9V.js → basic-DX-B5_bS.js} +1 -1
- package/assets/{biconomy-DxGC86Xq.js → biconomy-DIiiyQwz.js} +1 -1
- package/assets/buy-C5_gzZWJ.js +1 -0
- package/assets/buy-error-22UunaPC.png +0 -0
- package/assets/buy-gasless-Cxx1jwuH.js +1 -0
- package/assets/{cart-checkout-BsPe3vsb.js → cart-checkout-C3WNM4cy.js} +1 -1
- package/assets/{categories-CgoVNI3r.js → categories-DQ55lr2p.js} +10 -10
- package/assets/{ccip-BZ5t4M98.js → ccip-BafcYzQ9.js} +1 -1
- package/assets/{ccip-CLolljPY.js → ccip-CYEnvd4I.js} +1 -1
- package/assets/collection-DHOETntw.js +1 -0
- package/assets/{controller-Dmiz4V9v.js → controller-B80HcZCL.js} +2 -2
- package/assets/{core-CClsAKFe.js → core-BtRDOtev.js} +4 -4
- package/assets/{custom-8DiMBmid.js → custom-DiiPEfeO.js} +1 -1
- package/assets/{data-capture-DMdQZHt4.js → data-capture-BFGedRFL.js} +1 -1
- package/assets/{decimals-BMkgPUUI.js → decimals-Cdn10TAV.js} +1 -1
- package/assets/{decimals-jsc6T1pS.js → decimals-DCazhsdS.js} +1 -1
- package/assets/{detectExtension-_uzJMxml.js → detectExtension-BSAkQ0I6.js} +1 -1
- package/assets/{email-rauE2gwy.js → email-D8YhsjSC.js} +1 -1
- package/assets/{embedded-wallet-DcPnMzKJ.js → embedded-wallet-CIVu6rdk.js} +1 -1
- package/assets/emotion-CSxEP8yM.js +1 -0
- package/assets/emotion-styled.browser.esm-ClqtCiJQ.js +1 -0
- package/assets/{engine-8fIJfqfj.js → engine-DsQHyohE.js} +1 -1
- package/assets/{errors-p2bFnwUF.js → errors-BLIsDEoc.js} +1 -1
- package/assets/{estimate-l1-fee-XBWG77Ow.js → estimate-l1-fee-Cna0j8C0.js} +1 -1
- package/assets/{eth_estimateGas-r87LpjqX.js → eth_estimateGas-A7dV8Dq8.js} +1 -1
- package/assets/{eth_getStorageAt-qm5qDkl9.js → eth_getStorageAt-DVqXAuzZ.js} +1 -1
- package/assets/{eth_getTransactionCount-BAARL3ae.js → eth_getTransactionCount-DLrwUt6V.js} +1 -1
- package/assets/{extractIPFS-nkX8AeoZ.js → extractIPFS-Dq1wghef.js} +1 -1
- package/assets/{features-C_BSHMtq.js → features-CFz8G3yF.js} +1 -1
- package/assets/{fetchTokenMetadata-DFl0aYrb.js → fetchTokenMetadata-BTRazXId.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-BHQDfsn-.js → get-ecosystem-wallet-info-B8H2bbhI.js} +1 -1
- package/assets/{getBalance-BfswuTLE.js → getBalance-BewKvJ6T.js} +1 -1
- package/assets/{getInstalledModules-DCDW2oYW.js → getInstalledModules-ByFUGStC.js} +1 -1
- package/assets/{getNFT-IEcrtkPh.js → getNFT-1nUsfQAJ.js} +1 -1
- package/assets/{getNFT-d_1IA_yV.js → getNFT-BuDjU8-b.js} +2 -2
- package/assets/{getOverlayAlpha-yAmCaiXy.js → getOverlayAlpha-B_CoLTSj.js} +1 -1
- package/assets/{hashTypedData-DtoFYwPK.js → hashTypedData-BYNsvxyc.js} +1 -1
- package/assets/{hashTypedData-C8lb7A30.js → hashTypedData-DHR5yJit.js} +1 -1
- package/assets/{import-YJkTWfno.js → import-CWsWpkUA.js} +1 -1
- package/assets/{in-app-wallet-calls-BnNBT5Mt.js → in-app-wallet-calls-Fj_OJpWi.js} +1 -1
- package/assets/{index-w6PsRxrI.js → index--JSSHFMQ.js} +1 -1
- package/assets/{index-CAx92XfP.js → index-07n_zhYq.js} +1 -1
- package/assets/{index-D_Xsd3Vt.js → index-2yTqM9xZ.js} +1 -1
- package/assets/{index-QpE7O6o7.js → index-B04ndUbB.js} +2 -2
- package/assets/{index-Cc_DM0iK.js → index-B3vzzuVP.js} +1 -1
- package/assets/{index-CDtEmRi2.js → index-B4OkjZ5Z.js} +3 -3
- package/assets/{index-BQyF5ApH.js → index-B4p2eLga.js} +1 -1
- package/assets/index-BBuZMaWr.js +231 -0
- package/assets/{index-DWGTPbVn.js → index-BCGZozX2.js} +1 -1
- package/assets/{index-DTW5h3EC.js → index-BDRB8FDm.js} +1 -1
- package/assets/{index-2lvvWbBd.js → index-BDfpUFpd.js} +1 -1
- package/assets/{index-DibWgfYu.js → index-BMFRmVon.js} +1 -1
- package/assets/{index-G6xf-Q3K.js → index-BQwZ_U1w.js} +1 -1
- package/assets/{index-CbWEoIuL.js → index-BSjx8-a9.js} +1 -1
- package/assets/{index-DVF8Krqj.js → index-BmxotHif.js} +1 -1
- package/assets/{index-ibDi_M3N.js → index-BtmcJRGy.js} +1 -1
- package/assets/{index-BUqo3Tj9.js → index-BuMOiAUw.js} +1 -1
- package/assets/{index-CCGHENcO.js → index-BufR0bxC.js} +1 -1
- package/assets/{index-BdfJq1z-.js → index-C7VPGrdO.js} +1 -1
- package/assets/{index-_cQYPRhD.js → index-CN5ZLDnc.js} +1 -1
- package/assets/{index-DmCYLxGR.js → index-CTwiT5J0.js} +1 -1
- package/assets/{index-PleUZn46.js → index-CWuMb79R.js} +3 -3
- package/assets/{index-B2ys_PW2.js → index-CXYokVDz.js} +1 -1
- package/assets/{index-7IQPQlmq.js → index-C_jKIil3.js} +1 -1
- package/assets/{index-B0GbG2PP.js → index-CaHcCfyv.js} +1 -1
- package/assets/{index-BtEbPAKt.js → index-CcJuo_B4.js} +1 -1
- package/assets/{index-CBiJc7wf.js → index-CdfmzGmf.js} +1 -1
- package/assets/{index-BSZAIF-P.js → index-Cmi7sq59.js} +1 -1
- package/assets/{index-DMcwCitM.js → index-Cr7q_wI-.js} +1 -1
- package/assets/{index-BNnVKxqC.js → index-CtzfdSwK.js} +1 -1
- package/assets/{index-BEXITBRH.js → index-Cuf2In7m.js} +1 -1
- package/assets/{index-XbUjhNHl.js → index-Cuq6iGY1.js} +1 -1
- package/assets/{index-BbKMnNcs.js → index-Cv6TsksD.js} +1 -1
- package/assets/{index-hPqe-mn5.js → index-CwWLPHI8.js} +1 -1
- package/assets/{index-D1YQ5vIT.js → index-CzDOjIXr.js} +1 -1
- package/assets/{index-FDBQ0uaQ.js → index-DJsdR_Dh.js} +1 -1
- package/assets/{index-Db2SQ7UZ.js → index-Da6whmyR.js} +1 -1
- package/assets/{index-CyKa-S56.js → index-DfnBxBKK.js} +2 -2
- package/assets/{index-DII6Tqu_.js → index-Dhu9IXc1.js} +1 -1
- package/assets/{index-aUi4MQGL.js → index-DkfyzgR8.js} +1 -1
- package/assets/{index-DXm5dWgZ.js → index-Do7lLz-O.js} +1 -1
- package/assets/{index--j54mUQU.js → index-FUu8bz4c.js} +1 -1
- package/assets/{index-B_msdDpn.js → index-PGZV0u8x.js} +1 -1
- package/assets/index-PISx9bvm.css +1 -0
- package/assets/{index-C7g3x2a5.js → index-Y6b_vUQr.js} +1 -1
- package/assets/{index-CgY1C4yg.js → index-fOZ3JG1l.js} +1 -1
- package/assets/{index-KNJzOfGC.js → index-g3sxw2b2.js} +2 -2
- package/assets/{index-Bcoz1tgv.js → index-goSkKmOv.js} +1 -1
- package/assets/{index-z4NyCW59.js → index-gvpjFbR1.js} +1 -1
- package/assets/{index-BlgZoMqa.js → index-mfpj9mGL.js} +1 -1
- package/assets/{index-B0KyEyZW.js → index-nRbKhfJe.js} +2 -2
- package/assets/{index-CT03O-jT.js → index-tKIgdudq.js} +1 -1
- package/assets/{index.es-Cj4qvOPU.js → index.es-BsTkmkjS.js} +1 -1
- package/assets/{index.es-DTVjAbnO.js → index.es-CiHN99GO.js} +1 -1
- package/assets/{index.es-B8p45Gxw.js → index.es-Dvmu0NoU.js} +4 -4
- package/assets/loader-logo-CK-TcJ-S.js +1 -0
- package/assets/{localBatchGatewayRequest-qe0AcPei.js → localBatchGatewayRequest-Cej95COc.js} +1 -1
- package/assets/{mana-rate-C9OeZ3I-.js → mana-rate-Disk-ReT.js} +1 -1
- package/assets/{networks-CpT7rAv_.js → networks-Dapm2cWP.js} +1 -1
- package/assets/{onramp-DILJkR23.js → onramp-DLQLHSLI.js} +1 -1
- package/assets/{openzeppelin-I_v5U0zJ.js → openzeppelin-B2ua0Itn.js} +1 -1
- package/assets/{ownerOf-swrVNY-9.js → ownerOf-DOppg2jR.js} +1 -1
- package/assets/{parseNft-CooUo9vw.js → parseNft-D_8M9mfO.js} +2 -2
- package/assets/{parseSignature-CIOeOtiN.js → parseSignature-BUx9b-zW.js} +3 -3
- package/assets/{parseSignature-DK4ozIkj.js → parseSignature-O3FZfUUc.js} +1 -1
- package/assets/{pay-with-exchange-BUUCcSJH.js → pay-with-exchange-DaiVhZAg.js} +1 -1
- package/assets/{qr-overlay-C9GK8MHy.js → qr-overlay-CGmkZvV0.js} +1 -1
- package/assets/{receive-DSXgD8l5.js → receive-DVL3YCyE.js} +1 -1
- package/assets/{resolveImplementation-Bbq7vp1O.js → resolveImplementation-06H3horI.js} +1 -1
- package/assets/{rpc-DLfN54Vu.js → rpc-q1fg-PaK.js} +1 -1
- package/assets/{secp256k1-D7jgbcwp.js → secp256k1-D6rN1PGV.js} +1 -1
- package/assets/{secp256k1-JPjPXkQA.js → secp256k1-DT5nTJQH.js} +1 -1
- package/assets/{secp256k1-vft3wPq6.js → secp256k1-Dj-unqH_.js} +1 -1
- package/assets/{send-C7bIAjWP.js → send-CjhoocaG.js} +1 -1
- package/assets/{send-batch-transaction-DCaMbGgk.js → send-batch-transaction-Bbiva6rb.js} +1 -1
- package/assets/{send-eip712-transaction-B0EfagOx.js → send-eip712-transaction-NxK7USDp.js} +2 -2
- package/assets/{send-gasless-transaction-DADJYiOb.js → send-gasless-transaction-x5mofsoE.js} +2 -2
- package/assets/{sendRawTransaction-B0JjP1WZ.js → sendRawTransaction-CxX-WJOv.js} +3 -3
- package/assets/{serializeTransaction-DqLhlNY8.js → serializeTransaction-KtBgxNjB.js} +1 -1
- package/assets/{session-proposal-B-aCZN30.js → session-proposal-KoaDAo-a.js} +1 -1
- package/assets/{session-request-BD7-zSM_.js → session-request-CSef7ndM.js} +2 -2
- package/assets/{sha256-CKNPKKPX.js → sha256-DkPvB4om.js} +1 -1
- package/assets/{signing-BPqQRusg.js → signing-B9F_g0GG.js} +4 -4
- package/assets/{socials-C1dbbHYL.js → socials-BqxUUXtR.js} +1 -1
- package/assets/{swaps-DkWNTomv.js → swaps-EDZta6zk.js} +1 -1
- package/assets/{thirdweb-D0HOfogA.js → thirdweb-D99mQjH-.js} +3 -3
- package/assets/{totalSupply-CpvOP_C5.js → totalSupply-BhpAtMjH.js} +1 -1
- package/assets/{trade-encoding-Bkk79sDB.js → trade-encoding-CWytSFjw.js} +1 -1
- package/assets/{transactionReceipt-CHeWdSHX.js → transactionReceipt-OilL7-NS.js} +1 -1
- package/assets/{transactions-59I5qjgt.js → transactions-CGvL3Aj1.js} +1 -1
- package/assets/useInfiniteGrid-CpiD11c4.js +1 -0
- package/assets/{useStore-BxLN3UHd.js → useStore-CQIJvFZA.js} +1 -1
- package/assets/useTheme-6tr3eE7K.js +1 -0
- package/assets/useTheme-Dpdkvivv.js +1 -0
- package/assets/{verifyHash-BHrLI5gL.js → verifyHash-2hJaw2xF.js} +1 -1
- package/assets/{w3m-modal-f6BMPOJv.js → w3m-modal-CXTIrAhw.js} +1 -1
- package/assets/{w3m-modal-3Wn89MEZ.js → w3m-modal-DZpfNka8.js} +1 -1
- package/assets/{wait-for-tx-receipt-CkGwzcag.js → wait-for-tx-receipt-Dt-8wYDQ.js} +1 -1
- package/assets/{wallets-Kk_yC_Zf.js → wallets-v6YyPYY8.js} +6 -6
- package/assets/{web-connector-BQJIB5KD.js → web-connector-DBKfHuJF.js} +3 -3
- package/assets/{writeContract-C8YjcPqM.js → writeContract-CJkUo9D7.js} +1 -1
- package/assets/{zoraTestnet-BUaTQysG.js → zoraTestnet-CRD_79WO.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Assets-B1FxBJPM.js +0 -503
- package/assets/Cart-BxDJekyS.js +0 -3
- package/assets/Cart-DXZzP7Af.css +0 -1
- package/assets/Creator-f3wTway-.js +0 -1
- package/assets/GetCredits-B-V0lmX1.js +0 -1
- package/assets/ItemDetail-CV-0-ZkB.css +0 -1
- package/assets/ItemDetail-CnDcWx8Z.js +0 -48
- package/assets/MarketCheckout-CI0IRHEV.js +0 -3
- package/assets/PrimaryListModal-BFbTQMIs.js +0 -1
- package/assets/buy-BlwZzU_E.js +0 -1
- package/assets/buy-gasless-B1VlH3HF.js +0 -1
- package/assets/collection-Qcgn_TR_.js +0 -1
- package/assets/emotion-styled.browser.esm-Cj9DOOij.js +0 -1
- package/assets/index-CnOiYeAk.js +0 -231
- package/assets/index-eE-_qVda.css +0 -1
- package/assets/useCreditPacks-Q7ub-ShV.js +0 -1
- package/assets/useInfiniteGrid-DNbOhMyq.js +0 -1
- package/assets/useTheme-3SpHG4Qk.js +0 -1
- package/assets/useTheme-DLmJNPU6.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-C51i12iP.js";import{aw as oe,ax as ce,aa as le,t as a,ay as E,B as ne,ah as z,b as ie,I,g as de,u as me,A as ue,ae as he,az as ge,h as xe}from"./index-CnOiYeAk.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-Qcgn_TR_.js";import{u as be,L as fe}from"./useStore-BxLN3UHd.js";import{s as D}from"./address-DrURAr9O.js";import{S as $,C as ve,c as w,F as Ce,e as we,d as ke}from"./categories-CgoVNI3r.js";import{L as B}from"./LoadMore-BMDjLVnk.js";import{u as R}from"./useInfiniteGrid-DNbOhMyq.js";import{E as T}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=z(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||D(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Oe(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=z(t),g=(m==null?void 0:m.name)||(t?D(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,O]=j.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:O,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Oe as Creator,Oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as O,b as D,r as n,j as e}from"./react-C51i12iP.js";import{u as K,t as s,b as Y,m as $,v as g,h as d,z as R,w as A,C as q,o as z}from"./index-CnOiYeAk.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as Q}from"./cart-checkout-BsPe3vsb.js";import{u as W,p as J,c as X,i as ee}from"./useCreditPacks-Q7ub-ShV.js";import{C as se}from"./CircularProgress-ApNcnq7N.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-29842935035.commit-a65be40/assets/pack-chips--HnOpf5U.webp",te="https://cdn.decentraland.org/@dcl/shop/0.1.0-29842935035.commit-a65be40/assets/credit-coin-CmcTCd5i.webp",re="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",ce="data:image/svg+xml,%3csvg%20width='61'%20height='61'%20viewBox='0%200%2061%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.5%2061C47.3447%2061%2061%2047.3447%2061%2030.5C61%2013.6553%2047.3447%200%2030.5%200C13.6553%200%200%2013.6553%200%2030.5C0%2047.3447%2013.6553%2061%2030.5%2061Z'%20fill='url(%23gc_paint0)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2001%2054.8997C17.2935%2058.7274%2023.6375%2060.9997%2030.5%2060.9997C37.3625%2060.9997%2043.7065%2058.7274%2048.8%2054.8997H12.2001Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.10013%2048.7997C7.83863%2051.1024%209.89738%2053.1612%2012.2001%2054.8997H48.8001C51.1029%2053.1612%2053.1616%2051.1024%2054.9001%2048.7997H6.10013Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2042.6998H2.5468C3.4923%2044.8805%204.69705%2046.924%206.10005%2048.7997H40.9311V42.6998H40.9158Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6094%2019.8247V42.6997H40.6719L21.6094%2019.8247Z'%20fill='url(%23gc_paint1)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.5468%2042.6997H21.6093V19.8248L2.5468%2042.6997Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2032.025V48.8H54.9L40.9158%2032.025Z'%20fill='url(%23gc_paint2)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9467%2048.8H40.9157V32.025L26.9467%2048.8Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2027.4497C45.127%2027.4497%2048.5408%2024.0359%2048.5408%2019.8247C48.5408%2015.6136%2045.127%2012.1998%2040.9158%2012.1998C36.7046%2012.1998%2033.2908%2015.6136%2033.2908%2019.8247C33.2908%2024.0359%2036.7046%2027.4497%2040.9158%2027.4497Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6092%2015.2497C23.7148%2015.2497%2025.4217%2013.5428%2025.4217%2011.4372C25.4217%209.33166%2023.7148%207.62475%2021.6092%207.62475C19.5036%207.62475%2017.7967%209.33166%2017.7967%2011.4372C17.7967%2013.5428%2019.5036%2015.2497%2021.6092%2015.2497Z'%20fill='%23FFC95B'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='gc_paint0'%20x1='30.5'%20y1='-12.6335'%20x2='-12.6335'%20y2='30.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint1'%20x1='21.6029'%20y1='19.8247'%20x2='21.6029'%20y2='42.6997'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint2'%20x1='40.9111'%20y1='32.025'%20x2='40.9111'%20y2='48.8'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",C=ee()?"mock":"stripe",ae={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ie="https://docs.decentraland.org";function P(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const p=((r==null?void 0:r.message)??"").toLowerCase();return p.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):p.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function xe(){K({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=O(),{session:r,signIn:p}=Y(),i=$(),[v,w]=D(),{packs:H,isLoading:I}=W(),[m,l]=n.useState("select"),[a,S]=n.useState(null),[F,B]=n.useState(null),[U,h]=n.useState(null),[Z,j]=n.useState(!1),k=n.useRef(null);n.useEffect(()=>()=>{var t;return(t=k.current)==null?void 0:t.abort()},[]);const E=n.useCallback(()=>{w(t=>{const c=new URLSearchParams(t);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[w]),N=n.useCallback(async t=>{l("processing");const c=new AbortController;k.current=c;try{const u=await J(t,{signal:c.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const f=u.creditsGranted??(a==null?void 0:a.credits)??0;B(f>0?f:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(a==null?void 0:a.usd)??null,credits:f>0?f:null,provider:C}),i.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(Q)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const L=sessionStorage.getItem(G);if(L){sessionStorage.removeItem(G);const _=JSON.parse(L),M=_.tokenId??_.itemId;if(_.contractAddress&&M){o(`/item/${_.contractAddress}/${M}`,{state:{item:_,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),i.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),h(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){R(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:A(u),pack_usd:(a==null?void 0:a.usd)??null}),h(P(u)),l("error")}},[a,r,i,o]),T=n.useCallback(async t=>{if(!r){p();return}h(null),j(!1),S(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const c=await X(t.id,{address:r.address,identity:r.identity});if(c.mock)N(c.orderId);else if(c.url)g("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){R(c,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:A(c),pack_usd:t.usd}),h(P(c)),l("error")}},[r,p,N]),y=n.useRef(!1);n.useEffect(()=>{if(y.current)return;const t=v.get("order");if(v.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),E(),j(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,E(),N(t)))},[v,r]);function b(){var t;(t=k.current)==null||t.abort(),l("select"),S(null),B(null),h(null),j(!1)}const V=m==="select";return e.jsxs("div",{className:"getcredits",children:[V&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ie,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),m==="select"&&e.jsxs(e.Fragment,{children:[Z&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ne,{packs:H,loading:I,onSelect:t=>void T(t)})]}),m==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(se,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),m==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:ce,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),m==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:re,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),F!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:te,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(q,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:F,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:b,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")})]})]}),m==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:b,children:s("getCredits.done")})]})]}),m==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:b,children:s("getCredits.tryAgain")})})]})]})}function ne({packs:o,loading:r,onSelect:p}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(i=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},i))}):e.jsx("div",{className:"packs",children:o.map(i=>e.jsxs("button",{type:"button",className:`pack${i.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>p(i),"aria-label":s("getCredits.packAria",{amount:z(i.credits),usd:i.usd}),children:[i.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:i.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ae[i.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",i.usd.toFixed(2)]})})]})]},i.id))})}export{xe as GetCredits,xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.item-detail{max-width:1721px;margin:0 auto}.item-detail__crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:24px}.item-detail__crumb-link{background:none;border:0;padding:0;font:inherit;color:var(--muted)}.item-detail__crumb-link:hover{color:var(--text)}.item-detail__crumb-sep{color:var(--muted-2)}.item-detail__crumb-current{color:var(--text);font-weight:600}.item-detail__main{display:grid;grid-template-columns:minmax(0,1045fr) minmax(0,514fr);gap:48px;align-items:start;max-width:1607px;margin:0 auto}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr;gap:24px;max-width:none}}.item-detail__preview{position:relative;aspect-ratio:1045 / 752;border-radius:16px;overflow:hidden;background:var(--media)}@media(max-width:900px){.item-detail__preview{aspect-ratio:1 / 1}}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:16px;left:16px;z-index:2;width:auto;height:auto;display:inline-flex;gap:2px;padding:3px;background:#ffffffeb;border:1px solid var(--line);border-radius:999px;box-shadow:0 1px 4px #0000001f}.item-preview__toggle button{border:0;background:none;cursor:pointer;padding:6px 16px;border-radius:999px;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);transition:background .12s ease,color .12s ease}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:not(.is-active):hover{color:var(--text)}.item-preview__toggle-ico{display:none;width:18px;height:18px}.item-detail__preview>.item-preview__emote-controls{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:2;width:min(360px,88%);height:auto;display:flex;align-items:center;background:#fffffff0;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);border:1px solid var(--line);border-radius:var(--radius-pill);padding:6px 12px;box-shadow:0 2px 10px #1615181f}.item-preview__emote-controls .MuiBox-root{position:static;width:100%;margin:0;padding:0;display:flex;align-items:center;gap:10px}.item-preview__emote-controls .MuiButtonBase-root{min-width:0;padding:0;margin:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:none!important;box-shadow:none!important;color:var(--muted);flex:0 0 auto;transition:background .12s ease,color .12s ease}.item-preview__emote-controls .MuiButtonBase-root .MuiSvgIcon-root{font-size:20px;margin:0}.item-preview__emote-controls .MuiBox-root>.MuiButtonBase-root:first-child{width:34px;height:34px;background:var(--accent)!important;color:#fff}.item-preview__emote-controls .MuiBox-root>.MuiButtonBase-root:first-child:hover{background:var(--text)!important}.item-preview__emote-controls .MuiBox-root>input+.MuiButtonBase-root{width:30px;height:30px;color:var(--muted)}.item-preview__emote-controls .MuiBox-root>input+.MuiButtonBase-root:hover{background:var(--media)!important;color:var(--text)}.item-preview__emote-controls input[type=range]{flex:1 1 auto;width:auto;min-width:0;height:4px;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;cursor:pointer}.item-preview__emote-controls input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;background:var(--line-strong)}.item-preview__emote-controls input[type=range]::-moz-range-track{height:4px;border-radius:999px;background:var(--line-strong)}.item-preview__emote-controls input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:13px;height:13px;margin-top:-4.5px;border-radius:50%;background:var(--accent);border:2px solid #fff;box-shadow:0 1px 3px #1615184d;cursor:pointer}.item-preview__emote-controls input[type=range]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:var(--accent);border:2px solid #fff;box-shadow:0 1px 3px #1615184d;cursor:pointer}.item-preview__emote-controls input[type=range]:focus-visible{outline:none}.item-preview__emote-controls input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--accent);outline-offset:2px}.item-detail__preview>.item-preview__note{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:88%;margin:0;text-align:center;background:#161518c7;color:#fff;font-size:12px;font-weight:500;padding:6px 12px;border-radius:999px}.item-detail__preview>.item-preview__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:transparent}.item-preview__spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:item-preview-spin .8s linear infinite}@keyframes item-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.item-preview__spinner{animation-duration:2.4s}}.item-detail__preview>.item-preview__loading .item-preview__skeleton{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border-radius:inherit}.item-detail__info-skel{display:flex;flex-direction:column;gap:16px}.id-skel__title{height:34px;width:70%;border-radius:8px}.id-skel__chips{display:flex;gap:8px}.id-skel__chip{height:24px;width:88px;border-radius:6px}.id-skel__line{height:14px;width:100%;border-radius:6px}.id-skel__line--short{width:55%}.id-skel__price{height:30px;width:40%;border-radius:8px}.id-skel__btn{height:48px;width:100%;border-radius:8px;margin-top:8px}.item-detail__info{display:flex;flex-direction:column;gap:0}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:28px;font-weight:600;line-height:34px;color:var(--text-2)}.item-detail__fav{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:var(--media);display:grid;place-items:center;color:var(--text-2);cursor:pointer;transition:color .12s ease,background .12s ease}.item-detail__fav:hover{background:var(--line)}.item-detail__fav.is-on{color:var(--dcl-red)}.item-detail__preview>.item-detail__fav--preview{display:none}.item-detail__label{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:0;color:var(--muted)}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.item-detail__chips .chip{height:24px;padding:0 8px;gap:3px;font-size:13px;font-weight:500;border-radius:4px;letter-spacing:.02em;text-transform:uppercase}.item-detail__chip{background:var(--chip);color:var(--text-2)}.item-detail__section{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.item-detail__description{margin-top:15px;gap:11px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:30px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.item-detail__desc-text.is-expanded{-webkit-line-clamp:unset;overflow:visible}.item-detail__desc-toggle{font-size:13px;align-self:flex-start}.item-detail__meta{display:flex;justify-content:space-between;gap:16px;margin-top:32px}.item-detail__meta-col{display:flex;flex-direction:column;gap:15px;min-width:0}.item-detail__meta-col--collection{align-items:flex-start}.item-detail__creator[data-testid=creator]{color:var(--accent);font-size:14px;gap:12px}.item-detail__creator [data-avatar]{width:48px;height:48px}.item-detail__creator [data-letter]{font-size:18px}.item-detail__creator [data-testid=creator-name]{color:var(--accent);font-weight:500;text-decoration:underline}.item-detail__creator[data-link]:hover [data-testid=creator-name]{color:var(--brand-violet)}.collection-collage{display:flex;flex-direction:column;overflow:hidden;gap:1px;background:var(--line-strong)}.collection-collage__row{display:flex;flex:1 1 50%;min-height:0;gap:1px}.collection-collage__row--full{flex-basis:100%}.collection-collage__row img{flex:1 1 0;min-width:0;width:100%;height:100%;object-fit:cover;display:block}.item-detail__divider{border:0;border-top:1px solid #cfcdd4;margin:24px 0 0;width:100%}.item-detail__price-block{margin-top:16px}.item-detail__price-row{display:flex;align-items:flex-start;gap:16px;width:100%}.item-detail__price-col{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:8px}.item-detail__stock-col{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:8px;text-align:right}.item-detail__stock-value{font-size:18px;font-weight:500;line-height:1;color:var(--text-2)}.item-detail__price-label{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:0;color:#5e5b67}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text)}.item-detail__diamond{width:30px;height:30px;color:var(--brand-violet)}.item-detail__price-value{font-size:30px;line-height:1}.item-detail__price--none{font-size:18px;color:var(--muted)}.item-detail__approx{font-size:24px;font-weight:700;color:var(--text);margin-right:-2px}.item-detail__market-note{font-size:13px;margin-top:6px}.item-detail__price--sale{flex-wrap:wrap;gap:10px 14px}.item-detail__price--sale .item-detail__price,.item-detail__price--sale .item-detail__price-value,.item-detail__price--sale .item-detail__diamond{color:var(--dcl-red)}.item-detail__price-was{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:line-through;font-weight:600;font-size:20px}.item-detail__diamond--was{width:18px;height:18px;color:var(--muted)}.item-detail__sale-badge{display:inline-flex;align-items:center;background:var(--dcl-red);color:#fff;font-weight:800;font-size:13px;letter-spacing:.03em;text-transform:uppercase;border-radius:6px;padding:4px 10px}.item-detail__countdown{display:inline-flex;align-items:center;gap:5px;background:var(--rarity-bg);color:var(--accent);font-size:13px;font-weight:700;border-radius:6px;padding:4px 10px;white-space:nowrap}.item-detail__ctas{display:flex;flex-direction:column;gap:12px;margin-top:20px}.item-detail__cta-price{display:none;align-items:center;gap:6px}.item-detail__cta-diamond{width:20px;height:20px;color:#fff}.item-detail__addcart{width:100%;height:48px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:8px;font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:filter .15s ease}.item-detail__addcart:hover:not(:disabled){filter:brightness(1.35)}.item-detail__addcart:disabled{opacity:.55;cursor:default}.item-detail__status{margin:0;font-size:13px}.item-detail__own-note{margin:0;font-size:14px}.item-detail__own-note a{color:var(--accent);font-weight:600}@media(max-width:900px){.item-detail__title{font-size:20px;line-height:24px}.item-detail__info-head{order:0}.item-detail__chips{order:1;margin-top:10px}.item-detail__meta{order:2;margin-top:20px}.item-detail__description{order:3;margin-top:20px}.item-detail__divider{order:4;margin-top:20px}.item-detail__price-block{order:5;margin-top:16px}.item-detail__ctas{order:6}.item-detail__status{order:7}.item-detail{padding-bottom:88px}.item-detail__ctas--buttons{position:fixed;left:0;right:0;bottom:0;z-index:40;margin-top:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--soft-white);box-shadow:0 -4px 16px #1615181f}.item-detail__ctas--dual{flex-direction:row;align-items:stretch;gap:12px}.item-detail__ctas--dual .item-detail__cta-price{display:inline-flex}.item-detail__ctas--dual .item-detail__addcart{flex:0 0 auto;width:56px;padding:0}.item-detail__ctas--dual .item-detail__addcart-label{display:none}.item-detail__ctas--dual .item-detail__addcart .ico{margin:0}.item-detail__info-head .item-detail__fav{display:none}.item-detail__preview>.item-detail__fav--preview{display:grid;position:absolute;top:12px;right:12px;z-index:3;width:40px;height:40px;background:#ffffffeb;box-shadow:0 1px 4px #1615182e}.item-detail__preview>.item-detail__fav--preview:hover{background:#fff}.item-detail__preview>.item-preview__toggle{top:auto;left:auto;bottom:12px;right:12px;gap:0;padding:0;background:transparent;border:0;box-shadow:0 1px 4px #1615182e;overflow:hidden}.item-preview__toggle-label{display:none}.item-preview__toggle-ico{display:block}.item-preview__toggle button{padding:9px 13px;border-radius:0;background:#fff;color:var(--text-2)}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:first-child{border-top-left-radius:999px;border-bottom-left-radius:999px}.item-preview__toggle button:last-child{border-top-right-radius:999px;border-bottom-right-radius:999px}}.item-detail--notfound{min-height:46vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}.item-detail__notfound-ico{width:44px;height:44px;opacity:.4}.item-detail__notfound-title{font-size:22px}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BNnVKxqC.js","assets/react-C51i12iP.js","assets/dcl-schemas-BICTSpB5.js","assets/index-CnOiYeAk.js","assets/sentry-DKBoGDXH.js","assets/ethers-BeFqf2KO.js","assets/intl-CBcMB1D2.js","assets/index-eE-_qVda.css","assets/emotion-styled.browser.esm-Cj9DOOij.js","assets/useTheme-DLmJNPU6.js","assets/CircularProgress-ApNcnq7N.js","assets/index-CyKa-S56.js","assets/useTheme-3SpHG4Qk.js","assets/CssVarsProvider-D2zNKsxj.js","assets/getOverlayAlpha-yAmCaiXy.js","assets/index-2lvvWbBd.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as pe,r as o,j as e,d as na,a as da,L as ca}from"./react-C51i12iP.js";import{b as ye,l as oa,m as Ve,t,ac as ma,i as ua,j as ha,r as _a,n as te,v as H,w as Te,x as ue,ad as pa,z as _e,C as S,a8 as ie,_ as he,ah as ya,ak as ba,aj as xa,aA as fa,an as va,g as Qe,aB as ja,ag as re,s as z,aC as ga,aD as Na,aE as wa,ap as ka,a9 as Be,a as Re,c as T,aF as Ca,aG as Ia,aH as Aa,aI as Sa,aJ as Ma,ar as Pa,u as Ea,I as O,aK as Fa,aL as La,aM as Da,aa as Ta,aN as qe,aO as Ba,B as be,e as Ra,E as qa,au as $a,aP as Ka,aQ as Oa,av as Wa,aR as za,aS as Va}from"./index-CnOiYeAk.js";import{d as W}from"./dcl-schemas-BICTSpB5.js";import{b as $e,c as Qa}from"./buy-BlwZzU_E.js";import{S as Ua,P as Ga,f as Ha}from"./PrimaryListModal-BFbTQMIs.js";import{g as Ya,b as Ja,w as Za,S as Xa,G as et}from"./buy-gasless-B1VlH3HF.js";import{u as at,c as tt}from"./useCreditPacks-Q7ub-ShV.js";import{R as Ke}from"./resume-buy-Bf0zIH7y.js";import{a as st,f as Oe,i as it}from"./errors-p2bFnwUF.js";import{E as Ue}from"./ErrorNotice-C7soUjRV.js";import{C as rt}from"./CircularProgress-ApNcnq7N.js";import{u as lt,M as nt}from"./MarketCheckout-CI0IRHEV.js";import{s as dt}from"./address-DrURAr9O.js";import{C as ct}from"./CollectionCarousel-C5GeFa_Y.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-Bkk79sDB.js";import"./index-HN6Rk25C.js";import"./wallet-kind-B9P1TeIH.js";import"./mana-rate-C9OeZ3I-.js";function ot({item:r,onClose:u,resume:i=!1}){var J,Z;const{session:h}=ye(),{data:c}=oa(h),_=Ve(),g=pe(),b=at().packs.slice(0,3),[n,l]=o.useState("loading"),[a,N]=o.useState(null),[k,j]=o.useState(""),[B,R]=o.useState(r.priceCredits),[x,q]=o.useState(null),M=o.useRef(null),C=(x==null?void 0:x.credits)??B,Y=(c==null?void 0:c.credits)??0;o.useEffect(()=>{let d=!1;if(!h){l("error"),N(t("buyModal.signInToCheckout"));return}const f=m=>{const v=m-((c==null?void 0:c.credits)??0),p=b.find(E=>E.credits>=v)??b[b.length-1];j(p.id),H("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:m,credits_balance:(c==null?void 0:c.credits)??0,shortfall:Math.max(0,v)}),l("nofunds")};return(async()=>{var m,v;try{const p=await ma(r);if(!p)throw new Error("not for sale");if(ua(p,h.address))throw new Error("You can't buy your own listing.");const E=ha((v=(m=p.received)==null?void 0:m[0])==null?void 0:v.amount);if(!Number.isFinite(E)||E<=0)throw new Error("price unavailable");const $=Math.ceil(E/10);if(d)return;if(R($),c!=null&&c.credits<$){f($);return}try{const{credit:w,maxCreditedValue:Q,usdCents:D}=await _a(h.identity,E,p.id);if(d){te(h.identity,[w.id]).catch(()=>{});return}M.current=w.id;const X=Math.ceil(D/10);R(X);const K={trade:p,credit:w,maxCreditedValue:Q,usdCents:D,credits:X};q(K),i?V(K):l("ready")}catch(w){if(d)return;if(st(w)){f($);return}throw w}}catch(p){if(d)return;H(ue(p)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Te(p)}),l("error"),N(Oe(p,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{d=!0,M.current&&h&&(te(h.identity,[M.current]).catch(()=>{}),M.current=null)}},[]);async function V(d=x){if(!h||!d)return;l("processing"),N(null);let f=!1;try{const m={trade:d.trade,buyer:h.address,signer:h.signer,credits:[d.credit],maxCreditedValue:d.maxCreditedValue};let v;if(Ya())try{v=await Ja(m),await Za(v),f=!0}catch(p){if(p instanceof Xa)f=!0;else if(p instanceof et)v=await $e(m);else throw p}else v=await $e(m);M.current=null,H("Shop Completed Purchase",{...pa([r]),payment_type:"credits",no_crypto_step:f,transaction_hash:v??null}),_.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(m){ue(m)||_e(m,{flow:"buy",step:"submit",gasless:f}),te(h.identity,[d.credit.id]).catch(()=>{}),M.current=null,H(ue(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Te(m)}),_.invalidateQueries({queryKey:["usd-balance"]}),N(Oe(m,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function le(){if(!(!k||!h)){try{sessionStorage.setItem(Ke,JSON.stringify(r))}catch{}x&&te(h.identity,[x.credit.id]).catch(()=>{}),M.current=null,l("loading");try{const d=await tt(k,{address:h.address,identity:h.identity});if(d.url){window.location.href=d.url;return}g("/credits")}catch(d){_e(d,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ke)}catch{}N(t("buyModal.error.creditsCheckout")),l("error")}}}const L=n==="processing",P=n==="complete"?t("buyModal.titleComplete"):n==="nofunds"?t("buyModal.titleNoFunds"):t("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:r.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:L?void 0:u,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${n==="processing"||n==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:P}),!L&&e.jsx("button",{className:"buy-modal__x",onClick:u,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:n==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(S,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ie(Y)})]})]}),n==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(rt,{size:44})}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ue,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:u,children:t("buyModal.close")})})]}),n==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,C-Y)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(We,{item:r,priceCredits:C}),e.jsx("div",{className:"buy-modal__packs",children:b.map(d=>{const f=d.credits,m=d.id===k;return e.jsxs("button",{className:`buy-modal__pack${m?" buy-modal__pack--on":""}`,onClick:()=>j(d.id),children:[e.jsx(S,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ie(f)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",d.usd.toFixed(2),")"]})]},d.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(S,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ie(((J=b.find(d=>d.id===k))==null?void 0:J.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((Z=b.find(d=>d.id===k))==null?void 0:Z.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:u,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void le(),children:t("buyModal.buy")})]})]}),n==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(We,{item:r,priceCredits:C}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void V(),children:t("buyModal.buy")})})]}),n==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:i?t("buyModal.completingPurchase"):t("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),n==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:t("getCredits.successTitle")})," ",t("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>g("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:u,children:[t("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function We({item:r,priceCredits:u}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:r.name,children:r.name||t("buyModal.itemFallback")}),r.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:t("search.byCreator",{name:r.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(S,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ie(u)})]})]})]})}const mt=o.lazy(async()=>{const[{EmoteControls:r},{Experimental_CssVarsProvider:u},{light:i}]=await Promise.all([he(()=>import("./index-BNnVKxqC.js").then(h=>h.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),he(()=>import("./index-CyKa-S56.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),he(()=>import("./index-2lvvWbBd.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:h=>e.jsx(u,{theme:i,children:e.jsx(r,{...h})})}});function ut(r){return e.jsx(o.Suspense,{fallback:null,children:e.jsx(mt,{...r})})}function ht({item:r}){const u=ye(x=>{var q;return(q=x.session)==null?void 0:q.address}),{data:i,isLoading:h}=ya(u),c=u&&i?u:"default",_=r.category==="emote",[g,b]=o.useState("item"),n=!_&&g==="item",l=n||!h,[a,N]=o.useState(!0);o.useEffect(()=>{N(!0)},[r.id,n]);const k=!!u&&!!i,j=k&&ba(r,xa(i)),B=fa(r)[0],R=k&&!j&&!_;return e.jsxs(e.Fragment,{children:[l?e.jsx(va,{id:"shop-item-preview",contractAddress:r.contractAddress,tokenId:r.tokenId??void 0,itemId:r.tokenId?void 0:r.itemId??void 0,profile:n?void 0:j?c:"default",bodyShape:n||j?void 0:B,type:_?void 0:n?W.PreviewType.WEARABLE:W.PreviewType.AVATAR,emote:_||n?void 0:W.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:_?1.5:void 0,wheelStart:_?100:void 0,dev:Qe.chainId===80002,onLoad:()=>N(!1)}):null,!l||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,R&&!n?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:ja(B)})}):null,_?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(ut,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":t("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:g==="avatar"?"is-active":"","aria-pressed":g==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>b("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:g==="item"?"is-active":"","aria-pressed":g==="item","aria-label":t("itemPreview.item"),onClick:()=>b("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.item")})]})]})]})}const _t=z(ga)`
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
gap: 1px;
|
|
7
|
-
background: ${re.colors.lineStrong};
|
|
8
|
-
`;function pt({contractAddress:r,name:u,items:i,className:h}){const c=pe();if(!r||!u)return null;const _=(i??[]).map(n=>n.thumbnail).filter(n=>!!n).slice(0,4),g=_.slice(0,2),b=_.slice(2,4);return e.jsxs(Na,{as:"button","data-link":!0,className:h,"data-testid":"creator",onClick:n=>{n.stopPropagation(),c(`/collection/${r}`)},children:[_.length>0?e.jsxs(_t,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${b.length===0?" collection-collage__row--full":""}`,children:g.map((n,l)=>e.jsx("img",{src:n,alt:""},l))}),b.length>0?e.jsx("span",{className:"collection-collage__row",children:b.map((n,l)=>e.jsx("img",{src:n,alt:""},l))}):null]}):null,e.jsx(wa,{"data-testid":"creator-name",children:ka(u)})]})}const yt=z(be)`
|
|
9
|
-
margin-top: 6px;
|
|
10
|
-
`,se=z(be)`
|
|
11
|
-
&& {
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 48px;
|
|
14
|
-
font-size: 15px;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
letter-spacing: 0.46px;
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
gap: 8px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
${re.media.down("lg")} {
|
|
24
|
-
.item-detail__ctas--dual && {
|
|
25
|
-
flex: 1 1 auto;
|
|
26
|
-
width: auto;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`,bt=z("div")`
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
gap: 10px;
|
|
33
|
-
width: 100%;
|
|
34
|
-
`,xt=z(be)`
|
|
35
|
-
&& {
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 44px;
|
|
38
|
-
}
|
|
39
|
-
`,ft=z("p")`
|
|
40
|
-
margin: 4px 0 0;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
color: ${re.colors.muted};
|
|
43
|
-
|
|
44
|
-
a {
|
|
45
|
-
color: ${re.colors.accent};
|
|
46
|
-
font-weight: 600;
|
|
47
|
-
}
|
|
48
|
-
`;function vt(r){return Object.values(W.Rarity).includes(r)}function jt(r){return r==="male"?t("itemDetail.genderMale"):r==="female"?t("itemDetail.genderFemale"):r==="unisex"?t("itemDetail.genderUnisex"):null}function ze(r){return r.wearableCategory?r.wearableCategory.replace(/_/g," "):r.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function Vt(){var Le;const{contractAddress:r,tokenId:u}=na(),{state:i}=da(),h=pe(),c=!!(i!=null&&i.market),_=(i==null?void 0:i.marketPriceCredits)??null,g=Be(s=>s.add),b=Be(s=>s.items),n=Re(s=>s.toggle),{session:l}=ye(),[a,N]=o.useState(()=>i!=null&&i.item?{...i.item,tradeId:i.tradeId??i.item.tradeId}:{id:`${r}-${u}`,name:"",creator:"",contractAddress:r??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:Qe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:u??void 0,tradeId:i==null?void 0:i.tradeId}),[k,j]=o.useState(!1),[B,R]=o.useState(!!(i!=null&&i.resumeBuy));o.useEffect(()=>{i!=null&&i.resumeBuy&&j(!0)},[i==null?void 0:i.resumeBuy]);const{data:x=[],isFetched:q}=T({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>$a(a.contractAddress,{first:20}).then(s=>s.items)}),M=a.available==null&&!a.tokenId,{data:C,isLoading:Y}=T({queryKey:["shop-item",a.contractAddress,u],enabled:!c&&!!a.contractAddress&&!!u&&(!(i!=null&&i.item)||M),queryFn:()=>Ka(a.contractAddress,u)});o.useEffect(()=>{C&&N(s=>s.tradeId?s.available!=null&&s.wearableCategory?s:{...s,available:s.available??C.available,wearableCategory:s.wearableCategory??C.wearableCategory}:{...C})},[C]);const[V,le]=o.useState(!1),{data:L=""}=T({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Oa(a.contractAddress,a.itemId)}),{data:P}=T({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Wa(a.contractAddress)});o.useEffect(()=>{if(a.name||C||x.length===0)return;const s=u&&x.find(y=>y.tokenId===u||y.itemId===u)||x.find(y=>y.contractAddress===a.contractAddress);s&&N(y=>({...s,tradeId:y.tradeId??s.tradeId}))},[x,C]);const J=o.useMemo(()=>{const s=new Set,y=[];for(const I of x){if(I.id===a.id||a.itemId&&I.itemId===a.itemId||a.tokenId&&I.tokenId===a.tokenId)continue;const De=`${I.contractAddress}-${I.itemId??I.tokenId??I.id}`;s.has(De)||(s.add(De),y.push(I))}return y},[x,a.id,a.itemId,a.tokenId]),{data:Z,isLoading:d}=T({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const s=await za(a.contractAddress,a.itemId);return(s==null?void 0:s.id)??null}return null}}),f=a.tradeId??Z??void 0,m=!!f,{data:v}=lt(c),p=o.useMemo(()=>{if(!c||!(i!=null&&i.item))return null;const s=i.item;return s.manaWei?{tradeId:s.tradeId??s.id,listingType:"primary",contractAddress:s.contractAddress,itemId:s.itemId??"",name:s.name,thumbnail:s.thumbnail,rarity:s.rarity,category:s.category,wearableCategory:s.wearableCategory??null,creator:s.creator,manaWei:s.manaWei,available:1,network:s.network,chainId:s.chainId,createdAt:0}:null},[c,i==null?void 0:i.item]),E=c&&_!=null&&!!v&&!!p,$=Ca({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),w=o.useMemo(()=>({...a,tradeId:f,id:f??a.id}),[a,f]),Q=b.some(s=>s.id===w.id),D=!w.tokenId,X=((Le=b.find(s=>s.id===w.id))==null?void 0:Le.quantity)??0,K=D&&typeof a.available=="number"&&X>=a.available,F=Re(s=>!!s.items[a.id]),xe=o.useRef(null);o.useEffect(()=>{!a.name||d||xe.current===a.id||(xe.current=a.id,H("Shop Viewed Item",{...Ia(a),for_sale:m}),Aa(a))},[a.id,a.name,d,m]);const ee=`${r}/${u}`,fe=o.useRef(ee);o.useEffect(()=>{fe.current!==ee&&(fe.current=ee,i!=null&&i.item&&N({...i.item,tradeId:i.tradeId??i.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[ee]);function Ge(){!m||de||d||!D&&Q||K||g(w,"item_detail")}const ne=vt(a.rarity)?a.rarity:W.Rarity.COMMON,ve=jt(a.gender),je=Sa(a),ge=Ma(a.gender),He=m&&$,Ye=t("itemDetail.moreFromCollection"),de=Pa(a,l==null?void 0:l.address),ae=Ve(),[Je,Ne]=o.useState(!1),[Ze,we]=o.useState(!1),[U,ke]=o.useState(!1),[Xe,Ce]=o.useState(null),{data:A}=T({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!c&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?Va(l.address,a.contractAddress,a.tokenId):null}),{data:ce}=T({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:de&&!!l&&!!a.itemId,queryFn:async()=>l?(await Ha(l.address,l.identity)).find(y=>y.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&y.blockchainItemId===a.itemId)??null:null}),G=!!A,oe=!c&&(de||G),ea=G?!!(A!=null&&A.isOnSale):m,me=G?A==null?void 0:A.tradeId:f,Ie=G?!!A:!!ce;async function Ae(){await Promise.all([ae.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),ae.invalidateQueries({queryKey:["detail-trade"]}),ae.invalidateQueries({queryKey:["shop-item"]}),ae.invalidateQueries({queryKey:["collection-sale-state"]})])}async function Se(s={}){if(!l||!me)return!1;Ce(null),ke(!0);try{const y=await Ra(me);return await Qa({trade:y,signer:l.signer}),s.silent||qa.success(t("myAssets.removedFromSale",{name:a.name})),await Ae(),!0}catch(y){const I=it(y);return I||_e(y,{flow:"remove-listing",tradeId:me}),Ce(I?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{ke(!1)}}function Me(){G?Ne(!0):we(!0)}async function aa(){await Se({silent:!0})&&Me()}function Pe(){Ne(!1),we(!1),Ae()}const Ee=m?d?t("itemDetail.checking"):K?t("itemDetail.maxInCart"):!D&&Q?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),ta=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!c,sa=!oe&&m&&!c,ia=c||!oe,ra=Y||!!a.contractAddress&&!q,Fe=!a.name&&!ra,la=/^https?:\/\//i.test(a.thumbnail);return Ea(Fe?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:L||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:ze(a),creator:dt(a.creator)}),image:la?a.thumbnail:void 0,type:"product"}:{}),Fe?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(O,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:t("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:t("itemDetail.notAvailableBody")}),e.jsx(yt,{variant:"purple",onClick:()=>h("/assets"),children:t("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":t("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>h("/assets"),children:t("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||t("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx(ht,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${F?" is-on":""}`,onClick:()=>n(a),"aria-pressed":F,"aria-label":F?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(O,{name:F?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${F?" is-on":""}`,onClick:()=>n(a),"aria-pressed":F,"aria-label":F?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(O,{name:F?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:Da(ne),color:La(ne)},title:Fa(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[je?e.jsx(O,{name:je,size:18,color:"var(--text-2)"}):null,ze(a)]}),ve?e.jsxs("span",{className:"chip item-detail__chip",children:[ge?e.jsx(O,{name:ge,size:18,color:"var(--text-2)"}):null,ve]}):null]}),L?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${V?" is-expanded":""}`,children:L}),L.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>le(s=>!s),children:V?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||P!=null&&P.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.creator")}),e.jsx(Ta,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,P!=null&&P.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.collection")}),e.jsx(pt,{contractAddress:a.contractAddress,name:P.name,items:x,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}),c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:_==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(S,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:_})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):m?He?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(S,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(S,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),qe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:qe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Ba,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(S,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:t("itemDetail.notForSale")})]}),ta?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",W.Rarity.getMaxSupply(ne).toLocaleString()]})]}):null]})}),e.jsx("div",{className:`item-detail__ctas${ia?" item-detail__ctas--buttons":""}${sa?" item-detail__ctas--dual":""}`,children:c?e.jsxs(se,{variant:"purple",onClick:()=>j(!0),disabled:!E,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),_!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(S,{className:"item-detail__cta-diamond"}),_]}):null]}):oe?e.jsxs(bt,{"data-testid":"manage-actions",children:[e.jsx(Ue,{message:Xe}),ea?e.jsxs(e.Fragment,{children:[e.jsx(se,{variant:"purple",onClick:()=>void aa(),disabled:U||!Ie,children:e.jsx("span",{className:"item-detail__cta-label",children:U?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(xt,{variant:"ghost",onClick:()=>void Se(),disabled:U,children:U?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(se,{variant:"purple",onClick:Me,disabled:U||!Ie,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(ft,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(ca,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):e.jsxs(e.Fragment,{children:[m?e.jsxs(se,{variant:"purple",onClick:()=>j(!0),disabled:d,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(S,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Ge,disabled:!m||d||(D?K:Q),"aria-label":Ee,children:[e.jsx(O,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:Ee})]})]})})]}):e.jsx(gt,{})})]}),e.jsx(ct,{title:Ye,items:J,onViewAll:a.contractAddress?()=>h(`/collection/${a.contractAddress}`):void 0}),k&&c&&p&&v?e.jsx(nt,{listing:p,rate:v,onClose:()=>j(!1),onSold:()=>j(!1)}):k&&!c?e.jsx(ot,{item:w,resume:B,onClose:()=>{j(!1),R(!1)}}):null,Je&&A&&l?e.jsx(Ua,{asset:A,session:l,onClose:Pe}):null,Ze&&ce&&l?e.jsx(Ga,{item:ce,session:l,onClose:Pe}):null]})}function gt(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{Vt as ItemDetail,Vt as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as O,g as S,b as V,l as Y,m as H,t,n as h,C as x,o as M,q as $,h as j,e as D,i as J,r as X,v as y,w as F,x as R,s as Z,B as ee}from"./index-CnOiYeAk.js";import{r as re,a as b}from"./mana-rate-C9OeZ3I-.js";import{u as ae,r as m,j as r}from"./react-C51i12iP.js";import{b as A}from"./buy-BlwZzU_E.js";import{g as te,b as se,w as ie,S as ce,G as ne}from"./buy-gasless-B1VlH3HF.js";import{i as de}from"./errors-p2bFnwUF.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";function pe(e=!0){return O({queryKey:["mana-rate",S.chainId],queryFn:()=>re(S.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}const B=Z(ee)`
|
|
2
|
-
flex: 1;
|
|
3
|
-
`;function U(e){if(de(e))return t("errors.rejected");const n=(e.message??"").toLowerCase();return n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:j.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("errors.cantBuyOwn"):t("marketCheckout.error.generic")}function le(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function Ce({listing:e,rate:n,onClose:q,onSold:W}){const{session:i}=V(),{data:d,isError:T}=Y(i),w=H(),g=ae(),[N,k]=m.useState("confirm"),[p,I]=m.useState(t("marketCheckout.lockingPrice")),[G,f]=m.useState(null),[a,L]=m.useState(null),o=m.useRef(null),Q=Math.ceil(b(e.manaWei,n)/10);m.useEffect(()=>{let l=!1;if(!i){k("error"),f(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await D(e.tradeId);if(!s)throw new Error("not found");if(J(s,i.address))throw new Error("You can't buy your own listing.");const u=b(e.manaWei,n);if(!Number.isFinite(u)||u<=0)throw new Error("price unavailable");const{credit:v,maxCreditedValue:K,usdCents:P}=await X(i.identity,u,e.tradeId);if(l){h(i.identity,[v.id]).catch(()=>{});return}o.current=v.id,L({trade:s,credit:v,maxCreditedValue:K,usdCents:P,credits:Math.ceil(P/10)}),I("")}catch(s){if(l)return;console.error("[market] authorize failed",s),y(R(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:F(s),value_usd:Math.round(b(e.manaWei,n))/100}),k("error"),f(U(s))}})(),()=>{l=!0,o.current&&i&&(h(i.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const C=!!a&&d!=null&&d.credits<a.credits;async function z(){if(!i||!a)return;if(C){y("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,g("/credits");return}k("working"),f(null);let l=!1;try{I(t("marketCheckout.confirming"));const c={trade:a.trade,buyer:i.address,signer:i.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(te())try{s=await se(c),await ie(s),l=!0}catch(u){if(u instanceof ce)l=!0;else if(u instanceof ne)s=await A(c);else throw u}else s=await A(c);o.current=null,y("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),w.invalidateQueries({queryKey:["usd-balance"]}),g("/success",{state:{items:[le(e)],txHash:s}})}catch(c){console.error("[market] buy now failed",c),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,y(R(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:F(c),value_usd:a.usdCents/100}),w.invalidateQueries({queryKey:["usd-balance"]}),f(U(c)),k("error");const s=(c.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&W()}}function E(){i&&a&&h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,q()}const _=N==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:_?void 0:E,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),M(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),M(Q)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:p||t("marketCheckout.lockingPrice")})]})}),i?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",$(d,T)]}):null,C?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:j.name})}):null,p&&N==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:p}):null,r.jsx(oe,{message:G,className:"mkt-modal__note"}),r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx(B,{variant:"ghost",onClick:E,disabled:_,children:t("buyModal.cancel")}),r.jsx(B,{variant:"purple",onClick:()=>void z(),disabled:_||!a,children:_?t("marketCheckout.buying"):C?t("nav.getCredits",{currency:j.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{Ce as M,pe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as w,a2 as K,m as M,t as a,C as P,B as f,h as j,p as E,v as C,E as $,z as T,w as O}from"./index-CnOiYeAk.js";import{d as F}from"./dcl-schemas-BICTSpB5.js";import{u as R,r as u,j as s}from"./react-C51i12iP.js";import{a as H,b as X,i as z,e as J,c as V}from"./trade-encoding-Bkk79sDB.js";import{f as U}from"./errors-p2bFnwUF.js";import{E as q}from"./ErrorNotice-C7soUjRV.js";import{s as Y}from"./wallet-kind-B9P1TeIH.js";const I=()=>`${w.builderServerUrl}/v1`;function B(e){return Array.isArray(e)?e:"results"in e&&Array.isArray(e.results)?e.results:"data"in e&&Array.isArray(e.data)?e.data:[]}async function Q(e,r){const t=await K(e,{method:"GET",identity:r,metadata:{}});if(!t.ok)throw new Error(`builder-server ${t.status}: ${await t.text()}`);const l=await t.json();return l.data??l}function Z(e,r){const t=r-e;return t>0?t:0}function ee(e){var r,t,l,i,n;return((t=(r=e.data)==null?void 0:r.wearable)==null?void 0:t.category)??((i=(l=e.data)==null?void 0:l.emote)==null?void 0:i.category)??((n=e.data)==null?void 0:n.category)??e.type??"wearable"}function A(e){return`${I()}/storage/contents/${e}`}function S(e,r){if(!e)return"";if(/^https?:\/\//.test(e))return e;const t=r==null?void 0:r[e];return t?A(t):/^(ba|Qm)/.test(e)?A(e):""}async function se(e,r){try{const t=await fetch(`${I()}/items/${e}/${r}/contents`);if(!t.ok)return{};const l=await t.json();return l.data??l}catch{return{}}}async function ae(e,r,t){const l=S(e.thumbnail,e.contents)||S("thumbnail.png",e.contents);if(l)return l;if(r&&t){const i=await se(r,t);return S(e.thumbnail,i)||S("thumbnail.png",i)||S("image.png",i)}return""}async function te(e,r){const t=`${I()}/${e.toLowerCase()}/collections?is_published=true`,l=await Q(t,r);return B(l).filter(i=>i.is_published&&!!i.contract_address).map(i=>({id:i.id,name:i.name,contractAddress:i.contract_address.toLowerCase(),isPublished:i.is_published,isApproved:i.is_approved,minters:(i.minters??[]).map(n=>n.toLowerCase())}))}async function re(e,r){const t=`${I()}/collections/${e.id}/items`,l=await Q(t,r);return(await Promise.all(B(l).map(async n=>{const _=n.rarity??"common",y=Number(n.total_supply??0)||0;let o;try{o=F.Rarity.getMaxSupply(_)}catch{o=0}const x=(n.contract_address??e.contractAddress).toLowerCase(),p=n.blockchain_item_id??"";return{id:n.id,collectionId:e.id,collectionName:e.name,contractAddress:x,blockchainItemId:p,name:n.name,category:ee(n),rarity:_,thumbnail:await ae(n,x,p),type:n.type??"wearable",isPublished:n.is_published??e.isPublished,isApproved:n.is_approved??e.isApproved,totalSupply:y,maxSupply:o,remainingSupply:Z(y,o),minters:e.minters}}))).filter(ie)}function ie(e){return e.isPublished&&e.isApproved&&e.blockchainItemId!==""&&e.blockchainItemId!=null&&e.remainingSupply>0}async function ye(e,r){const t=await te(e,r);return(await Promise.all(t.map(async i=>{try{return await re(i,r)}catch{return[]}}))).flat()}const ne=1e3*60*60*24*182;function ge({asset:e,session:r,onClose:t}){const l=M(),i=R(),[n,_]=u.useState("10"),[y,o]=u.useState(null),[x,p]=u.useState(null),[m,N]=u.useState(!1),[h,v]=u.useState(null);async function k(){p(null);const c=Number(n);if(!Number.isInteger(c)||c<=0){p(a("sellModal.errorWholeNumber"));return}N(!0);try{o(a("sellModal.statusPreparing")),await H({signer:r.signer,contractAddress:e.contractAddress,chainId:e.chainId}),o(a("sellModal.statusListing"));const g=await X({signer:r.signer,nft:{contractAddress:e.contractAddress,tokenId:e.tokenId,network:e.network,chainId:e.chainId},usdPrice:c/10,expiresAtMs:Date.now()+ne});o(a("sellModal.statusPublishing")),await E(g,r.identity),o(null),v(c),C("Shop Listed Item",{item_id:e.itemId??e.tokenId??null,contract_address:e.contractAddress,price_credits:c,price_usd:c/10,listing_type:"secondary",is_primary:!1}),$.success(a("sellModal.toastOnSale",{name:e.name})),l.invalidateQueries({queryKey:["my-assets",r.address]})}catch(g){T(g,{flow:"list_secondary"}),C("Shop Listing Failed",{listing_type:"secondary",error_code:O(g)}),p(U(g,a("sellModal.errorGeneric"))),o(null)}finally{N(!1)}}function L(){t(),i(`/item/${e.contractAddress}/${e.tokenId}`)}return h!==null?s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:a("sellModal.successTitle")}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:[a("sellModal.listedFor")," ",s.jsxs("strong",{children:[s.jsx(P,{className:"ccy-mark"})," ",h]})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,children:a("getCredits.done")}),s.jsx(f,{variant:"purple",onClick:L,children:a("sellModal.viewInShop")})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal","data-testid":"modal",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("h2",{className:"modal__title",children:a("sellModal.listTitle",{name:e.name})}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsxs("label",{className:"field",children:[s.jsx("span",{children:a("sellModal.priceLabel",{currency:j.name})}),s.jsx("input",{type:"number",min:"1",step:"1",value:n,onChange:c=>_(c.target.value),disabled:m})]}),s.jsx("p",{className:"muted small",children:a("sellModal.pricedInWhole",{currency:j.name,currencySingular:j.nameSingular})}),y?s.jsx("p",{className:"muted",children:y}):null,s.jsx(q,{message:x}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,disabled:m,children:a("sellModal.cancel")}),s.jsx(f,{onClick:()=>void k(),disabled:m,children:m?a("sellModal.listing"):a("sellModal.putOnSale")})]})]})})}const le=1e3*60*60*24*182;function fe({item:e,session:r,onClose:t}){const l=M(),i=R(),[n,_]=u.useState("10"),[y,o]=u.useState(null),[x,p]=u.useState(null),[m,N]=u.useState(!1),[h,v]=u.useState(null),[k,L]=u.useState(null),c=w.chainId,g=Y(r.providerType);u.useEffect(()=>{let d=!1;return(async()=>{try{const b=await z({contractAddress:e.contractAddress,chainId:c});d||v(b)}catch{d||v(!1)}})(),()=>{d=!0}},[e.contractAddress,c]);async function W(){p(null);const d=Number(n);if(!Number.isInteger(d)||d<=0){p(a("primaryList.errorWholeNumber"));return}N(!0);try{h||(o(a("primaryList.statusEnabling")),await J({signer:r.signer,contractAddress:e.contractAddress,chainId:c}),v(!0)),o(a("primaryList.statusPublishing"));const b=await V({signer:r.signer,item:{contractAddress:e.contractAddress,itemId:e.blockchainItemId,network:F.Network.MATIC,chainId:c},usdPrice:d/10,uses:e.remainingSupply,expiresAtMs:Date.now()+le});o(a("primaryList.statusFinishing")),await E(b,r.identity),o(null),L(d),C("Shop Listed Item",{item_id:e.blockchainItemId,contract_address:e.contractAddress,price_credits:d,price_usd:d/10,listing_type:"primary",is_primary:!0}),$.success(a("primaryList.toastOnSale",{name:e.name})),l.invalidateQueries({queryKey:["publishable-items"]}),l.invalidateQueries({queryKey:["collection-sale-state"]})}catch(b){T(b,{flow:"list_primary"}),C("Shop Listing Failed",{listing_type:"primary",error_code:O(b)}),p(U(b,a("primaryList.errorGeneric"))),o(null)}finally{N(!1)}}function D(){t(),i(`/item/${e.contractAddress}/${e.blockchainItemId}`)}const G=m?a("primaryList.listing"):h===!1?a("primaryList.enableAndPutOnSale"):a("primaryList.putOnSale");return k!==null?s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:a("primaryList.successTitle")}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:[a("primaryList.listedFor")," ",s.jsxs("strong",{children:[s.jsx(P,{className:"ccy-mark"})," ",k]})," ",a("primaryList.dotAvailable",{count:e.remainingSupply})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,children:a("getCredits.done")}),s.jsx(f,{variant:"purple",onClick:D,children:a("primaryList.viewInShop")})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal","data-testid":"modal",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("h2",{className:"modal__title",children:a("primaryList.publishTitle",{name:e.name})}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"muted small",children:a("primaryList.fromCollection",{collectionName:e.collectionName,count:e.remainingSupply})}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:a("primaryList.priceLabel",{currency:j.name})}),s.jsx("input",{type:"number",min:"1",step:"1",value:n,onChange:d=>_(d.target.value),disabled:m})]}),s.jsx("p",{className:"muted small",children:a("primaryList.pricedInWhole",{currency:j.name,currencySingular:j.nameSingular})}),h===!1&&!m?g?s.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeConfirm",{collectionName:e.collectionName})}):s.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeManaged",{collectionName:e.collectionName})}):h===!0&&!m?g?s.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyConfirm")}):s.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyManaged")}):null,y?s.jsx("p",{className:"muted",children:y}):null,s.jsx(q,{message:x}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,disabled:m,children:a("primaryList.cancel")}),s.jsx(f,{onClick:()=>void W(),disabled:m||h===null,children:h===null?a("primaryList.checking"):G})]})]})})}export{fe as P,ge as S,ye as f};
|
package/assets/buy-BlwZzU_E.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as A}from"./dcl-schemas-BICTSpB5.js";import{g as N}from"./index-CnOiYeAk.js";import{d as l,g as E,f as C,h as y}from"./trade-encoding-Bkk79sDB.js";import{g as m,a as p,C as I}from"./index-HN6Rk25C.js";import{C as g,J as M,B as u}from"./ethers-BeFqf2KO.js";async function U(a){const t=a.received[0],n=t.amount??"0";if(t.assetType!==Number(A.TradeAssetType.USD_PEGGED_MANA))return n;const c=m(p(a.contract),a.chainId),e=new M(N.rpcUrl),r=await new g(c.address,["function manaUsdAggregator() view returns (address)"],e).manaUsdAggregator(),s=new g(r,["function decimals() view returns (uint8)","function latestRoundData() view returns (uint80,int256,uint256,uint256,uint80)"],e),i=await s.decimals(),w=await s.latestRoundData(),f=u.from(w[1]);return u.from(n).mul(u.from(10).pow(i)).div(f).mul(102).div(100).toString()}async function b(a,t,n){const c=n.provider;await l(c,a);const e=await c.getNetwork();if(e.chainId!==a)throw new Error(`Wrong network: wallet is on chain ${e.chainId}, expected ${a}. Switch networks and try again.`);const o=m(I.CreditsManager,a);return(await(await new g(o.address,o.abi,n).useCredits(t,C(a))).wait()).transactionHash}async function $(a){const{trade:t,signer:n}=a,c=(await n.getAddress()).toLowerCase();await l(n.provider,t.chainId);const e=m(p(t.contract),t.chainId),o=E(t,c);return(await(await new g(e.address,e.abi,n).cancelSignature([o],C(t.chainId))).wait()).transactionHash}async function G(a){const{trade:t,buyer:n,signer:c,credits:e}=a;if(e.length===0)throw new Error("No credits to spend");const o=m(p(t.contract),t.chainId),r=a.maxCreditedValue??await U(t),s=y(o.address,o.abi,[t],n,e,r);return b(t.chainId,s,c)}async function L(a){const{purchases:t,buyer:n,signer:c}=a;if(t.length===0)throw new Error("No items to buy");const e=new Map;for(const r of t){const s=`${r.trade.chainId}:${r.trade.contract.toLowerCase()}`,i=e.get(s);i?i.push(r):e.set(s,[r])}const o=[];for(const r of e.values()){const{chainId:s,contract:i}=r[0].trade,w=m(p(i),s),f=r.map(d=>d.trade),h=r.flatMap(d=>d.credits),v=r.reduce((d,k)=>d.add(u.from(k.maxCreditedValue)),u.from(0)).toString(),x=y(w.address,w.abi,f,n,h,v);o.push(await b(s,x,c))}return o}export{L as a,G as b,$ as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as P}from"./index-CnOiYeAk.js";import{h as M}from"./trade-encoding-Bkk79sDB.js";import{g as m,a as N,C as y}from"./index-HN6Rk25C.js";import{u as I,C as F,J as U,h as A,B as x}from"./ethers-BeFqf2KO.js";const E="".trim().toLowerCase(),p={enabled:E!=="0"&&E!=="false",relayerUrl:"https://transactions-api.decentraland.zone/v1"};function B(){return p.enabled}const{Interface:b,hexZeroPad:G}=I;class u extends Error{constructor(e,a="unknown"){super(e),this.reason=a,this.name="GaslessUnavailableError"}}class v extends Error{constructor(e,a){super("Purchase not yet confirmed"),this.txHash=e,this.name="SettlementPendingError",a&&"cause"in a&&(this.cause=a.cause)}}const O=[{name:"nonce",type:"uint256"},{name:"from",type:"address"},{name:"functionData",type:"bytes"}];function _(n){return G(A(n),32)}function $(n,e,a,c){return new b(n).encodeFunctionData("executeMetaTransaction",[e,a,c])}function S(){return new U(P.rpcUrl)}async function T(n,e,a,c){const r=m(y.CreditsManager,n),o=await new F(r.address,["function getNonce(address) view returns (uint256)"],S()).getNonce(e),i=a,d={name:r.name,version:r.version,verifyingContract:r.address,salt:_(n)},l={nonce:o.toString(),from:e,functionData:i};let g;try{g=await c._signTypedData(d,{MetaTransaction:O},l)}catch(s){const w=(s==null?void 0:s.message)??"signature failed";throw new u(w,/denied/i.test(w)?"unknown":"contract-account")}const C=$(r.abi,e,i,g);let t;try{const s=await fetch(`${p.relayerUrl}/transactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transactionData:{from:e,params:[r.address,C]}})});if(t=await s.json(),!s.ok&&(t==null?void 0:t.ok)!==!0&&!(t!=null&&t.txHash))throw new u((t==null?void 0:t.message)??`relayer ${s.status}`,"relayer")}catch(s){throw s instanceof u?s:new u((s==null?void 0:s.message)??"relayer unreachable","relayer")}if((t==null?void 0:t.ok)===!1||!(t!=null&&t.txHash))throw new u((t==null?void 0:t.message)??"relayer rejected the transaction","relayer");return t.txHash}async function L(n,e){const a=S();let c;try{c=await a.waitForTransaction(n,1,(e==null?void 0:e.timeoutMs)??12e4)}catch(r){throw new v(n,{cause:r})}if(!c)throw new v(n);if(c.status===0)throw new Error("Purchase reverted")}async function R(n){if(!p.enabled)throw new u("gasless checkout disabled","disabled");const{trade:e,buyer:a,signer:c,credits:r,maxCreditedValue:f}=n;if(r.length===0)throw new Error("No credits to spend");const o=m(N(e.contract),e.chainId),i=M(o.address,o.abi,[e],a,r,f),d=m(y.CreditsManager,e.chainId),l=new b(d.abi).encodeFunctionData("useCredits",[i]);return T(e.chainId,a,l,c)}async function z(n){if(!p.enabled)throw new u("gasless checkout disabled","disabled");const{purchases:e,buyer:a,signer:c}=n;if(e.length===0)throw new Error("No items to buy");const r=new Map;for(const o of e){const i=`${o.trade.chainId}:${o.trade.contract.toLowerCase()}`,d=r.get(i);d?d.push(o):r.set(i,[o])}const f=[];for(const o of r.values()){const{chainId:i,contract:d}=o[0].trade,l=m(N(d),i),g=o.map(h=>h.trade),C=o.flatMap(h=>h.credits),t=o.reduce((h,D)=>h.add(x.from(D.maxCreditedValue)),x.from(0)).toString(),s=M(l.address,l.abi,g,a,C,t),w=m(y.CreditsManager,i),k=new b(w.abi).encodeFunctionData("useCredits",[s]);f.push(await T(i,a,k,c))}return f}export{u as G,v as S,z as a,R as b,B as g,L as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./react-C51i12iP.js";import{a9 as g,b as p,ar as A,t as u,C,B as b,E as x}from"./index-CnOiYeAk.js";const $="https://cdn.decentraland.org/@dcl/shop/0.1.0-29842935035.commit-a65be40/assets/default-cover-7vUE644d.jpeg",E=2166136261,_=16777619,M=4294967295,S=.75,I=1,N="#ffffff",T=/[\p{L}\p{N}]/u;function j(n){let r=E>>>0;for(let t=0;t<n.length;t++)r^=n.charCodeAt(t),r=Math.imul(r,_)>>>0;return r>>>0}function L(n,r,t){const a=n>=1?n-Math.floor(n):n,i=Math.floor(a*6),c=a*6-i,o=t*(1-r),e=t*(1-r*c),l=t*(1-r*(1-c));switch(i%6){case 0:return{r:t,g:l,b:o};case 1:return{r:e,g:t,b:o};case 2:return{r:o,g:t,b:l};case 3:return{r:o,g:e,b:t};case 4:return{r:l,g:o,b:t};default:return{r:t,g:o,b:e}}}function h(n){return Math.max(0,Math.min(255,Math.round(n*255))).toString(16).padStart(2,"0")}function R({r:n,g:r,b:t}){return`#${h(n)}${h(r)}${h(t)}`}function U(n){if(!n)return"";let r="";for(let t=0;t<n.length;t++){const a=n[t];T.test(a)&&(r+=a)}return r}function B({name:n,hasClaimedName:r,ethAddress:t}){const a=U(n);return a?r||!t||t.length<=4?a:`${a}#${t.slice(-4)}`:""}function H(n){if(!n)return N;const t=j(n)/M;return R(L(t,S,I))}function V({items:n,source:r}){const t=g(s=>s.add),a=g(s=>s.items.map(d=>d.id)),i=p(s=>{var d;return(d=s.session)==null?void 0:d.address}),c=n.filter(s=>s.priceCredits>0&&!A(s,i));if(c.length===0)return null;const o=new Set(a),e=c.filter(s=>!o.has(s.id)),l=c.reduce((s,d)=>s+d.priceCredits,0);function m(){e.forEach(s=>t(s,r)),x.success(u("addAll.added",{count:e.length}))}return f.jsxs("div",{className:"addall",children:[f.jsxs("span",{className:"addall__summary",children:[u("addAll.forSale",{count:c.length})," · ",f.jsx(C,{className:"addall__diamond"})," ",l.toLocaleString()]}),f.jsx(b,{variant:"purple",size:"sm",onClick:m,disabled:e.length===0,children:e.length===0?u("addAll.allInCart"):u("addAll.addAll",{count:e.length})})]})}export{V as A,B as a,$ as d,H as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M as z,U as I,V as j,W as q,X as A,Y as D,Z as G,$ as R,a0 as U}from"./index-CnOiYeAk.js";import{r as c}from"./react-C51i12iP.js";var V=I,W=function(e){return e!=="theme"},E=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?V:W},O=function(e,t,s){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(d){return e.__emotion_forwardProp(d)&&i(d)}:i}return typeof r!="function"&&s&&(r=e.__emotion_forwardProp),r},M=function(e){var t=e.cache,s=e.serialized,r=e.isStringTag;return G(t,s,r),R(function(){return U(t,s,r)}),null},X=function o(e,t){var s=e.__emotion_real===e,r=s&&e.__emotion_base||e,i,d;t!==void 0&&(i=t.label,d=t.target);var b=O(e,t,s),w=b||E(r),_=!w("as");return function(){var m=arguments,l=s&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(i!==void 0&&l.push("label:"+i+";"),m[0]==null||m[0].raw===void 0)l.push.apply(l,m);else{var S=m[0];l.push(S[0]);for(var x=m.length,p=1;p<x;p++)l.push(m[p],S[p])}var n=j(function(a,u,v){var P=_&&a.as||r,f="",F=[],h=a;if(a.theme==null){h={};for(var C in a)h[C]=a[C];h.theme=c.useContext(q)}typeof a.className=="string"?f=A(u.registered,F,a.className):a.className!=null&&(f=a.className+" ");var N=D(l.concat(F),u.registered,h);f+=u.key+"-"+N.name,d!==void 0&&(f+=" "+d);var k=_&&b===void 0?E(P):w,g={};for(var y in a)_&&y==="as"||k(y)&&(g[y]=a[y]);return g.className=f,v&&(g.ref=v),c.createElement(c.Fragment,null,c.createElement(M,{cache:u,serialized:N,isStringTag:typeof P=="string"}),c.createElement(P,g))});return n.displayName=i!==void 0?i:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",n.defaultProps=e.defaultProps,n.__emotion_real=n,n.__emotion_base=r,n.__emotion_styles=l,n.__emotion_forwardProp=b,Object.defineProperty(n,"toString",{value:function(){return"."+d}}),n.withComponent=function(a,u){var v=o(a,z({},t,u,{shouldForwardProp:O(n,u,!0)}));return v.apply(void 0,l)},n}},Y=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],T=X.bind(null);Y.forEach(function(o){T[o]=T(o)});export{T as n};
|