@dcl/shop 0.1.0-29843281528.commit-80ee4fe → 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-DuljJ5eE.js → AnimatedBackground-BvysF8a0.js} +1 -1
- package/assets/Assets-DoUIRoSX.js +503 -0
- package/assets/{Cart-DgfiEY34.js → Cart-Cyj_u0xP.js} +1 -1
- package/assets/{CircularProgress-CFOLSY9J.js → CircularProgress-Bf7cTa84.js} +5 -5
- package/assets/{Collection-Br_6eVW2.js → Collection-BFUSn0Z_.js} +2 -2
- package/assets/{CollectionCarousel-DijkJOGi.js → CollectionCarousel-BaK4BZqg.js} +1 -1
- package/assets/Creator-CTfg9WAL.js +1 -0
- package/assets/{CssVarsProvider-B-9OhdaT.js → CssVarsProvider-DQXUaIP8.js} +1 -1
- package/assets/{ExchangeController-DZeSfQ3O.js → ExchangeController-H99cRhIr.js} +1 -1
- package/assets/GetCredits-BqhYAHL0.js +1 -0
- package/assets/{HelpersUtil-CIxak-Dl.js → HelpersUtil-CN9OoRaT.js} +1 -1
- package/assets/{ImportListings-BupAm--j.js → ImportListings-CCQDdZMF.js} +2 -2
- package/assets/ItemDetail-BiAHzfHh.css +1 -0
- package/assets/ItemDetail-C6EEFa3M.js +78 -0
- package/assets/{LoadMore-DdNzWoKw.js → LoadMore-QYabEF53.js} +1 -1
- package/assets/MarketCheckout-B1QbAQBC.js +50 -0
- package/assets/{MyAssets-Bob-0Xll.js → MyAssets-gjvqMgx3.js} +3 -3
- package/assets/{MyFavorites-DIQniaKO.js → MyFavorites-CCbFgdqL.js} +1 -1
- package/assets/{MyPurchases-Ds2kIXc6.js → MyPurchases-D04-_M8f.js} +1 -1
- package/assets/{NotFound-CTFVq52Q.js → NotFound-ViHzr3Nr.js} +1 -1
- package/assets/PrimaryListModal-D6DU8-ZC.js +1 -0
- package/assets/{StoreSettings-CcLPXhlS.js → StoreSettings-BnHjda9z.js} +8 -8
- package/assets/{Success-CKgJamne.js → Success-CbfD54bz.js} +2 -2
- package/assets/{SwapController-BvaLktQP.js → SwapController-Tfj7j5wZ.js} +1 -1
- package/assets/{TradeService-BkvXSNTO.js → TradeService-kxdTGO_i.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-CVKTirvY.js → W3MFrameProviderSingleton-BWjqHbac.js} +3 -3
- package/assets/{WebCryptoP256-DqHDVOgM.js → WebCryptoP256-8HU24K3x.js} +1 -1
- package/assets/{basic-CPzfNN7q.js → basic-DX-B5_bS.js} +1 -1
- package/assets/{biconomy-Dv0xaKml.js → biconomy-DIiiyQwz.js} +1 -1
- package/assets/{buy-C-p0vOlr.js → buy-C5_gzZWJ.js} +1 -1
- package/assets/{buy-gasless-80rsxFwS.js → buy-gasless-Cxx1jwuH.js} +1 -1
- package/assets/{cart-checkout-C8WkR2Mv.js → cart-checkout-C3WNM4cy.js} +1 -1
- package/assets/{categories-DMvvNpsP.js → categories-DQ55lr2p.js} +10 -10
- package/assets/{ccip-BwOwAXNb.js → ccip-BafcYzQ9.js} +1 -1
- package/assets/{ccip-BwGwocPa.js → ccip-CYEnvd4I.js} +1 -1
- package/assets/collection-DHOETntw.js +1 -0
- package/assets/{controller-CgqGHx7D.js → controller-B80HcZCL.js} +2 -2
- package/assets/{core-B2nfA4sd.js → core-BtRDOtev.js} +4 -4
- package/assets/{custom-CdZQaelR.js → custom-DiiPEfeO.js} +1 -1
- package/assets/{data-capture-DMW4pF-p.js → data-capture-BFGedRFL.js} +1 -1
- package/assets/{decimals-D67NJCrH.js → decimals-Cdn10TAV.js} +1 -1
- package/assets/{decimals-rp_QRWgQ.js → decimals-DCazhsdS.js} +1 -1
- package/assets/{detectExtension-CdyBy88S.js → detectExtension-BSAkQ0I6.js} +1 -1
- package/assets/{email-DbiwTCeu.js → email-D8YhsjSC.js} +1 -1
- package/assets/{embedded-wallet-BsM4YZGP.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-BIaee4cN.js → engine-DsQHyohE.js} +1 -1
- package/assets/{errors-Cy2OMz1f.js → errors-BLIsDEoc.js} +1 -1
- package/assets/{estimate-l1-fee-gJM_qs-2.js → estimate-l1-fee-Cna0j8C0.js} +1 -1
- package/assets/{eth_estimateGas-D2ajTk6Z.js → eth_estimateGas-A7dV8Dq8.js} +1 -1
- package/assets/{eth_getStorageAt-BvK-sxlh.js → eth_getStorageAt-DVqXAuzZ.js} +1 -1
- package/assets/{eth_getTransactionCount-YDPYaO31.js → eth_getTransactionCount-DLrwUt6V.js} +1 -1
- package/assets/{extractIPFS-jmhJ6PDc.js → extractIPFS-Dq1wghef.js} +1 -1
- package/assets/{features-DliQhpqn.js → features-CFz8G3yF.js} +1 -1
- package/assets/{fetchTokenMetadata-e-tnU9jP.js → fetchTokenMetadata-BTRazXId.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-CZC3jXDk.js → get-ecosystem-wallet-info-B8H2bbhI.js} +1 -1
- package/assets/{getBalance-DW56jwnz.js → getBalance-BewKvJ6T.js} +1 -1
- package/assets/{getInstalledModules-DnVuL5FL.js → getInstalledModules-ByFUGStC.js} +1 -1
- package/assets/{getNFT-BrnrnPkZ.js → getNFT-1nUsfQAJ.js} +1 -1
- package/assets/{getNFT-DS4NW5JT.js → getNFT-BuDjU8-b.js} +2 -2
- package/assets/{getOverlayAlpha-BYOq19Nw.js → getOverlayAlpha-B_CoLTSj.js} +1 -1
- package/assets/{hashTypedData-CwfOunhR.js → hashTypedData-BYNsvxyc.js} +1 -1
- package/assets/{hashTypedData-y5e_N0pF.js → hashTypedData-DHR5yJit.js} +1 -1
- package/assets/{import-DGp843-7.js → import-CWsWpkUA.js} +1 -1
- package/assets/{in-app-wallet-calls-ByxidTQ9.js → in-app-wallet-calls-Fj_OJpWi.js} +1 -1
- package/assets/{index-CRwyTQtp.js → index--JSSHFMQ.js} +1 -1
- package/assets/{index-CczWbtzB.js → index-07n_zhYq.js} +1 -1
- package/assets/{index-kB2cGSV_.js → index-2yTqM9xZ.js} +1 -1
- package/assets/{index-BOxK6fGr.js → index-B04ndUbB.js} +2 -2
- package/assets/{index-BCJ8zpyP.js → index-B3vzzuVP.js} +1 -1
- package/assets/{index-DHR1PStF.js → index-B4OkjZ5Z.js} +3 -3
- package/assets/{index-DsA36hey.js → index-B4p2eLga.js} +1 -1
- package/assets/index-BBuZMaWr.js +231 -0
- package/assets/{index-CAlaPEFD.js → index-BCGZozX2.js} +1 -1
- package/assets/{index-CEE7Cn_g.js → index-BDRB8FDm.js} +1 -1
- package/assets/{index-m29akl6f.js → index-BDfpUFpd.js} +1 -1
- package/assets/{index-5c0GQ1Nl.js → index-BMFRmVon.js} +1 -1
- package/assets/{index-DJ4kGSWA.js → index-BQwZ_U1w.js} +1 -1
- package/assets/{index-BX4FwzVP.js → index-BSjx8-a9.js} +1 -1
- package/assets/{index-CqiRo3Zn.js → index-BmxotHif.js} +1 -1
- package/assets/{index-E8b-gnkf.js → index-BtmcJRGy.js} +1 -1
- package/assets/{index-Hi72v_of.js → index-BuMOiAUw.js} +1 -1
- package/assets/{index-BJi9mWLa.js → index-BufR0bxC.js} +1 -1
- package/assets/{index-nLudmUJ4.js → index-C7VPGrdO.js} +1 -1
- package/assets/{index-BLFpf7VZ.js → index-CN5ZLDnc.js} +1 -1
- package/assets/{index-CthUHORI.js → index-CTwiT5J0.js} +1 -1
- package/assets/{index-B2az3PiP.js → index-CWuMb79R.js} +3 -3
- package/assets/{index-BVNelofo.js → index-CXYokVDz.js} +1 -1
- package/assets/{index-BVLvW024.js → index-C_jKIil3.js} +1 -1
- package/assets/{index-BqZuhkNd.js → index-CaHcCfyv.js} +1 -1
- package/assets/{index-WmhNuNqi.js → index-CcJuo_B4.js} +1 -1
- package/assets/{index-CnR9-WYz.js → index-CdfmzGmf.js} +1 -1
- package/assets/{index-DNGMKwFA.js → index-Cmi7sq59.js} +1 -1
- package/assets/{index-B0v1VfMr.js → index-Cr7q_wI-.js} +1 -1
- package/assets/{index-BoOFl8c5.js → index-CtzfdSwK.js} +1 -1
- package/assets/{index-ygPPQNgl.js → index-Cuf2In7m.js} +1 -1
- package/assets/{index-BR727Jzt.js → index-Cuq6iGY1.js} +1 -1
- package/assets/{index-BJMmq_1b.js → index-Cv6TsksD.js} +1 -1
- package/assets/{index-DM2l6nmY.js → index-CwWLPHI8.js} +1 -1
- package/assets/{index-g4vOnab2.js → index-CzDOjIXr.js} +1 -1
- package/assets/{index-BWP2Fumx.js → index-DJsdR_Dh.js} +1 -1
- package/assets/{index-ChULorg8.js → index-Da6whmyR.js} +1 -1
- package/assets/{index-Dt2sCUK8.js → index-DfnBxBKK.js} +2 -2
- package/assets/{index-BhjB6g3C.js → index-Dhu9IXc1.js} +1 -1
- package/assets/{index-BRDfjRE7.js → index-DkfyzgR8.js} +1 -1
- package/assets/{index-BT3aLy2n.js → index-Do7lLz-O.js} +1 -1
- package/assets/{index-1HD-ZiOz.js → index-FUu8bz4c.js} +1 -1
- package/assets/{index-CXBJ9EIH.js → index-PGZV0u8x.js} +1 -1
- package/assets/index-PISx9bvm.css +1 -0
- package/assets/{index-D51Jnqov.js → index-Y6b_vUQr.js} +1 -1
- package/assets/{index-Bu8ostX3.js → index-fOZ3JG1l.js} +1 -1
- package/assets/{index-MuXuv7Gk.js → index-g3sxw2b2.js} +2 -2
- package/assets/{index-rvOCdvOD.js → index-goSkKmOv.js} +1 -1
- package/assets/{index-CqSBxYu9.js → index-gvpjFbR1.js} +1 -1
- package/assets/{index-DJoRdzge.js → index-mfpj9mGL.js} +1 -1
- package/assets/{index-DI8CjH9V.js → index-nRbKhfJe.js} +2 -2
- package/assets/{index-td4pFZfG.js → index-tKIgdudq.js} +1 -1
- package/assets/{index.es-Bvwb44-d.js → index.es-BsTkmkjS.js} +1 -1
- package/assets/{index.es-C7AZp5D9.js → index.es-CiHN99GO.js} +1 -1
- package/assets/{index.es-F7YT6EP3.js → index.es-Dvmu0NoU.js} +4 -4
- package/assets/loader-logo-CK-TcJ-S.js +1 -0
- package/assets/{localBatchGatewayRequest-zR7Ha1uQ.js → localBatchGatewayRequest-Cej95COc.js} +1 -1
- package/assets/{mana-rate-B9PgPeC4.js → mana-rate-Disk-ReT.js} +1 -1
- package/assets/{networks-dXDx9gAD.js → networks-Dapm2cWP.js} +1 -1
- package/assets/{onramp-fNtRJPac.js → onramp-DLQLHSLI.js} +1 -1
- package/assets/{openzeppelin-sYEux5UU.js → openzeppelin-B2ua0Itn.js} +1 -1
- package/assets/{ownerOf-CnmeWudT.js → ownerOf-DOppg2jR.js} +1 -1
- package/assets/{parseNft-T29OsJ6m.js → parseNft-D_8M9mfO.js} +2 -2
- package/assets/{parseSignature-D06Xu3Gf.js → parseSignature-BUx9b-zW.js} +3 -3
- package/assets/{parseSignature-C6Ri9jBZ.js → parseSignature-O3FZfUUc.js} +1 -1
- package/assets/{pay-with-exchange-BoMmA1Tj.js → pay-with-exchange-DaiVhZAg.js} +1 -1
- package/assets/{qr-overlay-beGwyXqx.js → qr-overlay-CGmkZvV0.js} +1 -1
- package/assets/{receive-D4ql0UiI.js → receive-DVL3YCyE.js} +1 -1
- package/assets/{resolveImplementation-DQuU7tt4.js → resolveImplementation-06H3horI.js} +1 -1
- package/assets/{rpc-dvg5kHBi.js → rpc-q1fg-PaK.js} +1 -1
- package/assets/{secp256k1-BRQHdiKx.js → secp256k1-D6rN1PGV.js} +1 -1
- package/assets/{secp256k1-BiBpjJ-Y.js → secp256k1-DT5nTJQH.js} +1 -1
- package/assets/{secp256k1-DzCAsKA4.js → secp256k1-Dj-unqH_.js} +1 -1
- package/assets/{send-DsvtMOwS.js → send-CjhoocaG.js} +1 -1
- package/assets/{send-batch-transaction-BI7PszNe.js → send-batch-transaction-Bbiva6rb.js} +1 -1
- package/assets/{send-eip712-transaction-DkDZjHS-.js → send-eip712-transaction-NxK7USDp.js} +2 -2
- package/assets/{send-gasless-transaction-BWiIvBJH.js → send-gasless-transaction-x5mofsoE.js} +2 -2
- package/assets/{sendRawTransaction-CJYjLdky.js → sendRawTransaction-CxX-WJOv.js} +3 -3
- package/assets/{serializeTransaction-DsE3bqzt.js → serializeTransaction-KtBgxNjB.js} +1 -1
- package/assets/{session-proposal-C87UteoU.js → session-proposal-KoaDAo-a.js} +1 -1
- package/assets/{session-request-Dp0rC7zH.js → session-request-CSef7ndM.js} +2 -2
- package/assets/{sha256-D0Lh0Apw.js → sha256-DkPvB4om.js} +1 -1
- package/assets/{signing-BPU6VB4U.js → signing-B9F_g0GG.js} +4 -4
- package/assets/{socials-DS6Oy5zA.js → socials-BqxUUXtR.js} +1 -1
- package/assets/{swaps-D1v4d6OG.js → swaps-EDZta6zk.js} +1 -1
- package/assets/{thirdweb-C4HaRY0z.js → thirdweb-D99mQjH-.js} +3 -3
- package/assets/{totalSupply-BeKwmSJ8.js → totalSupply-BhpAtMjH.js} +1 -1
- package/assets/{trade-encoding-DWEKE2_D.js → trade-encoding-CWytSFjw.js} +1 -1
- package/assets/{transactionReceipt-hL0wb2x7.js → transactionReceipt-OilL7-NS.js} +1 -1
- package/assets/{transactions-D8hLtdUl.js → transactions-CGvL3Aj1.js} +1 -1
- package/assets/useInfiniteGrid-CpiD11c4.js +1 -0
- package/assets/{useStore-JJzXYl67.js → useStore-CQIJvFZA.js} +1 -1
- package/assets/useTheme-6tr3eE7K.js +1 -0
- package/assets/useTheme-Dpdkvivv.js +1 -0
- package/assets/{verifyHash-8JWQpVAA.js → verifyHash-2hJaw2xF.js} +1 -1
- package/assets/{w3m-modal-BsLEDK_w.js → w3m-modal-CXTIrAhw.js} +1 -1
- package/assets/{w3m-modal-C6EBRfim.js → w3m-modal-DZpfNka8.js} +1 -1
- package/assets/{wait-for-tx-receipt-Dwtf8AK-.js → wait-for-tx-receipt-Dt-8wYDQ.js} +1 -1
- package/assets/{wallets-gXvJ-4C5.js → wallets-v6YyPYY8.js} +6 -6
- package/assets/{web-connector-DF_01FjF.js → web-connector-DBKfHuJF.js} +3 -3
- package/assets/{writeContract-w2MHfkK2.js → writeContract-CJkUo9D7.js} +1 -1
- package/assets/{zoraTestnet-B_HTvQOr.js → zoraTestnet-CRD_79WO.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Assets-C_Pb_gKM.js +0 -503
- package/assets/Creator-CXMSNUos.js +0 -1
- package/assets/GetCredits-Dc4MRaep.js +0 -1
- package/assets/ItemDetail-CGF_X4b-.js +0 -48
- package/assets/ItemDetail-CV-0-ZkB.css +0 -1
- package/assets/MarketCheckout-Cec3x9i9.js +0 -3
- package/assets/PrimaryListModal-Ca5_30gC.js +0 -1
- package/assets/collection-DPrYZX6W.js +0 -1
- package/assets/emotion-styled.browser.esm-exjoQmBi.js +0 -1
- package/assets/index-BqifAYYN.css +0 -1
- package/assets/index-T-zasmbE.js +0 -231
- package/assets/loader-logo-sfRgTXGv.js +0 -1
- package/assets/useInfiniteGrid-DtqZsW6Q.js +0 -1
- package/assets/useTheme-B1XbAz3A.js +0 -1
- package/assets/useTheme-Cke4HwaD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{
|
|
1
|
+
import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{a2 as N,s as v,a3 as Z,I as J,t,g as V,m as W,c as X,u as ee,A as ae,av as te,h as re,aw as se}from"./index-BBuZMaWr.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DHOETntw.js";import{u as de}from"./useStore-CQIJvFZA.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,e as ue,c as R,d as ge}from"./categories-DQ55lr2p.js";import{L as xe}from"./LoadMore-QYabEF53.js";import{u as he}from"./useInfiniteGrid-CpiD11c4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -42,4 +42,4 @@ import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{a8 as N,s as
|
|
|
42
42
|
padding: 24px 16px;
|
|
43
43
|
font-size: 26px;
|
|
44
44
|
}
|
|
45
|
-
`;function ye({name:r,creator:a}){const{data:i}=de(a),n=(i==null?void 0:i.cover)||ie;return e.jsxs(be,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(ve,{children:[e.jsx(fe,{src:n,alt:"",loading:"eager"}),e.jsx(je,{"aria-hidden":!0})]}),e.jsx(Ne,{"data-testid":"collection-hero-title",children:r})]})}function Ce({address:r}){var h,c;const{data:a}=Z(r),[i,n]=p.useState(!1);if(!r)return null;const l=(a==null?void 0:a.name)||E(r),u=(c=(h=a==null?void 0:a.avatar)==null?void 0:h.snapshots)==null?void 0:c.face256,g=`${V.profileUrl}/${r}`,x=ce(ne({name:a==null?void 0:a.name,hasClaimedName:a==null?void 0:a.hasClaimedName,ethAddress:(a==null?void 0:a.ethAddress)??r}));async function d(){try{await navigator.clipboard.writeText(r),n(!0),window.setTimeout(()=>n(!1),1500)}catch(f){W(f,{flow:"copy_creator_address"})}}return e.jsxs("div",{className:"creator-card","data-testid":"creator-card",children:[u?e.jsx("img",{className:"creator-card__ava",src:u,alt:"",loading:"eager",style:{backgroundColor:x}}):e.jsx("span",{className:"creator-card__ava creator-card__ava--ph","aria-hidden":!0,style:{backgroundColor:x}}),e.jsx("h2",{className:"creator-card__name",title:l,children:l}),e.jsxs("button",{type:"button",className:"creator-card__account",onClick:()=>void d(),title:i?t("collection.copied"):t("collection.copyAddress"),"aria-label":i?t("collection.copied"):t("collection.copyAddress"),children:[e.jsx("span",{className:"creator-card__account-text",children:E(r)}),e.jsx(J,{name:"copy",size:16})]}),e.jsx("a",{className:"creator-card__view","data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:t("collection.viewProfile")})]})}const _e=48;function
|
|
45
|
+
`;function ye({name:r,creator:a}){const{data:i}=de(a),n=(i==null?void 0:i.cover)||ie;return e.jsxs(be,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(ve,{children:[e.jsx(fe,{src:n,alt:"",loading:"eager"}),e.jsx(je,{"aria-hidden":!0})]}),e.jsx(Ne,{"data-testid":"collection-hero-title",children:r})]})}function Ce({address:r}){var h,c;const{data:a}=Z(r),[i,n]=p.useState(!1);if(!r)return null;const l=(a==null?void 0:a.name)||E(r),u=(c=(h=a==null?void 0:a.avatar)==null?void 0:h.snapshots)==null?void 0:c.face256,g=`${V.profileUrl}/${r}`,x=ce(ne({name:a==null?void 0:a.name,hasClaimedName:a==null?void 0:a.hasClaimedName,ethAddress:(a==null?void 0:a.ethAddress)??r}));async function d(){try{await navigator.clipboard.writeText(r),n(!0),window.setTimeout(()=>n(!1),1500)}catch(f){W(f,{flow:"copy_creator_address"})}}return e.jsxs("div",{className:"creator-card","data-testid":"creator-card",children:[u?e.jsx("img",{className:"creator-card__ava",src:u,alt:"",loading:"eager",style:{backgroundColor:x}}):e.jsx("span",{className:"creator-card__ava creator-card__ava--ph","aria-hidden":!0,style:{backgroundColor:x}}),e.jsx("h2",{className:"creator-card__name",title:l,children:l}),e.jsxs("button",{type:"button",className:"creator-card__account",onClick:()=>void d(),title:i?t("collection.copied"):t("collection.copyAddress"),"aria-label":i?t("collection.copied"):t("collection.copyAddress"),children:[e.jsx("span",{className:"creator-card__account-text",children:E(r)}),e.jsx(J,{name:"copy",size:16})]}),e.jsx("a",{className:"creator-card__view","data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:t("collection.viewProfile")})]})}const _e=48;function Le(){var T;const{contractAddress:r}=Q(),a=Y(),[i,n]=p.useState("wearable"),[l,u]=p.useState(null),[g,x]=p.useState([]),[d,h]=p.useState(""),[c,f]=p.useState(""),[C,$]=p.useState("newest"),_=d&&!Number.isNaN(Number(d))?Number(d):void 0,w=c&&!Number.isNaN(Number(c))?Number(c):void 0,I=l?ge[l]:void 0,z=(F.find(s=>s.key===C)??F[0]).server,S={category:i,rarities:g.length?g:void 0,wearableCategories:I,minPriceCredits:_,maxPriceCredits:w,sortBy:z},{items:b,total:B,isLoading:j,error:A,hasNextPage:L,isFetchingNextPage:P,fetchNextPage:U}=he(["collection-page",r,S],s=>te(r,{...S,first:_e,skip:s}),{enabled:!!r}),{data:o}=X({queryKey:["collection-meta",r],queryFn:()=>se(r),enabled:!!r,staleTime:5*6e4}),k=(o==null?void 0:o.name)||t("collection.fallbackTitle");ee({title:o==null?void 0:o.name,description:o!=null&&o.name?t("seo.collection.description",{name:o.name}):void 0});const M=(o==null?void 0:o.creator)||((T=b[0])==null?void 0:T.creator);function q(s){n(s),u(null)}function G(s){x(m=>m.includes(s)?m.filter(O=>O!==s):[...m,s])}function H(){n("wearable"),u(null),x([]),h(""),f("")}const y=!!(_||w),K=y?`${d||"0"}–${c||"∞"}`:t("filter.price"),D=i!=="wearable"||!!l||g.length>0||y;return e.jsxs("div",{className:"collection-page","data-testid":"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":t("collection.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>a("/assets"),children:t("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:k})]}),e.jsx(ye,{name:k,creator:M}),e.jsxs("div",{className:"browse browse--sidebar collection-page__browse","data-testid":"browse",children:[e.jsxs("aside",{className:"browse__sidebar","data-testid":"browse-sidebar",children:[e.jsx(Ce,{address:M}),e.jsx(me,{category:i,subCategory:l,onCategory:q,onSub:u,title:t("collection.category"),flat:!0})]}),e.jsxs("div",{className:"browse__main",children:[!j&&b.length>0?e.jsx(le,{items:b,source:"collection"}):null,e.jsx(pe,{rarities:g,onToggleRarity:G,sort:C,onSort:$,total:B,loading:j,anyActive:D,onClear:H,renderTrailing:s=>e.jsx(ue,{panelKey:"price",label:K,active:y,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":t("collection.priceMin"),placeholder:t("collection.priceMinPlaceholder"),value:d,onChange:m=>h(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("collection.priceMax"),placeholder:t("collection.priceMaxPlaceholder"),value:c,onChange:m=>f(m.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:t("collection.priceHint",{currency:re.name})})]})})}),A?e.jsx(oe,{message:t("collection.error")}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:j?e.jsx(R,{count:15}):e.jsxs(e.Fragment,{children:[b.map(s=>e.jsx(ae,{item:s},s.id)),P?e.jsx(R,{count:6}):null]})}),e.jsx(xe,{hasNextPage:L,isFetching:P,onLoadMore:()=>void U()}),!j&&!A&&b.length===0?e.jsx("p",{className:"muted",children:t("collection.empty")}):null]})]})]})}export{Le as Collection,Le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as t}from"./react-C51i12iP.js";import{t as s,I as k,
|
|
1
|
+
import{r as o,j as t}from"./react-C51i12iP.js";import{t as s,I as k,w as f,A as N}from"./index-BBuZMaWr.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,w]=o.useState(!0),[C,b]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),w(e<=1),b(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function p(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:C,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>p(e)},e))}):null]})}export{L as C};
|
|
@@ -0,0 +1 @@
|
|
|
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{ax as oe,ay as ce,an as le,t as a,az as E,B as ne,a3 as z,b as ie,I,g as de,u as me,A as ue,ar as he,aA as ge,h as xe}from"./index-BBuZMaWr.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-DHOETntw.js";import{u as be,L as fe}from"./useStore-CQIJvFZA.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-DQ55lr2p.js";import{L as B}from"./LoadMore-QYabEF53.js";import{u as R}from"./useInfiniteGrid-CpiD11c4.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";import"./emotion-CSxEP8yM.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 Ge(){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{Ge as Creator,Ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b9 as U,ba as Ue,E as C,bb as qe,bc as Ye,O as Qe,bd as Je,aY as Xe,D as R,b1 as K,b0 as Te,be as a,bf as Ze,bg as Le,T as et,b7 as tt}from"./index-BBuZMaWr.js";import{R as rt,g as ot}from"./getOverlayAlpha-B_CoLTSj.js";import{j as T,r as y}from"./react-C51i12iP.js";import{u as nt,a as Be}from"./useTheme-6tr3eE7K.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
2
2
|
try {
|
|
3
3
|
var mode = localStorage.getItem('${s}') || '${o}';
|
|
4
4
|
var colorScheme = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-
|
|
1
|
+
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-BWjqHbac.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-B4OkjZ5Z.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as $,b as q,r as i,j as e}from"./react-C51i12iP.js";import{u as H,t as s,b as Q,n as V,o as g,h as d,m as P,X as I,C as W,ag as z}from"./index-BBuZMaWr.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-C3WNM4cy.js";import{u as J,p as X,c as Z,l as ee,i as se}from"./loader-logo-CK-TcJ-S.js";import{C as te}from"./CircularProgress-Bf7cTa84.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-29869835587.commit-e6e6578/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29869835587.commit-e6e6578/assets/credit-coin-CmcTCd5i.webp",ae="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",C=se()?"mock":"stripe",ce={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function M(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function xe(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=$(),{session:r,signIn:m}=Q(),n=V(),[k,S]=q(),{packs:F,isLoading:T}=J(),[p,l]=i.useState("select"),[c,w]=i.useState(null),[E,R]=i.useState(null),[U,_]=i.useState(null),[K,N]=i.useState(!1),f=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=i.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=i.useCallback(async t=>{l("processing");const a=new AbortController;f.current=a;try{const u=await X(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const j=u.creditsGranted??(c==null?void 0:c.credits)??0;R(j>0?j:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:j>0?j:null,provider:C}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const A=sessionStorage.getItem(G);if(A){sessionStorage.removeItem(G);const h=JSON.parse(A),B=h.tokenId??h.itemId;if(h.contractAddress&&B){o(`/item/${h.contractAddress}/${B}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),_(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),_(M(u)),l("error")}},[c,r,n,o]),O=i.useCallback(async t=>{if(!r){m();return}_(null),N(!1),w(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await Z(t.id,{address:r.address,identity:r.identity});if(a.mock)b(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),_(M(a)),l("error")}},[r,m,b]),y=i.useRef(!1);i.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),l("select"),w(null),R(null),_(null),N(!1)}const Y=p==="select";return e.jsxs("div",{className:"getcredits",children:[Y&&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:ne,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"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:ee,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"})]})]})]}),p==="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:ae,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})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,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:v,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")})]})]}),p==="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:v,children:s("getCredits.done")})]})]}),p==="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:v,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:o,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>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"})]})},n))}):e.jsx("div",{className:"packs",children:o.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.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:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{xe as GetCredits,xe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-
|
|
1
|
+
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BQwZ_U1w.js";import{d as g,r as v}from"./index-B4OkjZ5Z.js";import{C as c}from"./ConstantsUtil-CJUlyS7R.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BWjqHbac.js";import{au as y}from"./NetworkUtil-Xp0fNa8X.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{u as K,r as u,j as e,L as B}from"./react-C51i12iP.js";import{t as s,h as w,B as k,C as L,
|
|
1
|
+
import{u as K,r as u,j as e,L as B}from"./react-C51i12iP.js";import{t as s,h as w,B as k,C as L,o as $,m as A,u as P,b as U,n as W,c as O,s as Q,r as z}from"./index-BBuZMaWr.js";import{i as Y,R as D,f as G}from"./import-CWsWpkUA.js";import{s as H}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./buy-C5_gzZWJ.js";import"./trade-encoding-CWytSFjw.js";import"./index-HN6Rk25C.js";import"./mana-rate-Disk-ReT.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,M]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await Y(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof D)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||M("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
|
|
2
2
|
margin-top: 10px;
|
|
3
3
|
`,V=Q(k)`
|
|
4
4
|
padding: 13px 24px;
|
|
5
|
-
`,X=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub"}];function me(){P({title:s("seo.import.title"),noindex:!0});const{session:n,signIn:T,restore:j}=U(),h=W(),N=n==null?void 0:n.address;u.useEffect(()=>{j()},[j]);const{data:d,isLoading:m}=
|
|
5
|
+
`,X=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub"}];function me(){P({title:s("seo.import.title"),noindex:!0});const{session:n,signIn:T,restore:j}=U(),h=W(),N=n==null?void 0:n.address;u.useEffect(()=>{j()},[j]);const{data:d,isLoading:m}=O({queryKey:["importable",N],queryFn:()=>G(N),enabled:!!N}),[f,I]=u.useState({}),[M,S]=u.useState(new Set),[_,v]=u.useState(null),x=u.useMemo(()=>[...(d==null?void 0:d.creations)??[],...(d==null?void 0:d.owned)??[]],[d]);u.useEffect(()=>{x.length&&I(a=>{const l={...a};for(const i of x)l[i.oldTradeId]==null&&(l[i.oldTradeId]=i.suggestedCredits);return l})},[x]);const y=a=>!M.has(a),t=a=>f[a.oldTradeId]??a.suggestedCredits,c=x.filter(a=>y(a.oldTradeId)),r=c.reduce((a,l)=>a+t(l),0);function p(a,l){const i=l.replace(/[^\d]/g,"");I(C=>({...C,[a]:i===""?0:parseInt(i,10)}))}function g(a){S(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function o(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function b(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["unified-listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),z.success(s("importListings.toastUpdated"))}return n?!m&&x.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:s("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:s("importListings.emptyBody")}),e.jsx(F,{as:B,to:"/my-assets",variant:"purple",children:s("importListings.goToMyAssets")})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:s("importListings.eyebrow")}),e.jsxs("h1",{className:"imp__title",children:[s("importListings.titleLead")," ",e.jsx("span",{className:"imp__grad",children:s("importListings.titleAccent")})]}),e.jsx("p",{className:"imp__lede",children:s("importListings.lede",{currency:w.name})})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(L,{className:"ccy-mark imp__diamond"})," ",s("importListings.rate",{currency:w.nameSingular})]}),m?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,l)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},l))}):X.map(a=>{const l=(d==null?void 0:d[a.key])??[];return l.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:s(a.title)}),e.jsx("span",{className:"imp__section-sub",children:s(a.sub)})]}),e.jsx("div",{className:"imp__list",children:l.map(i=>{const C=t(i),R=C!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${y(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:y(i.oldTradeId),onChange:()=>g(i.oldTradeId),"aria-label":s("importListings.includeItem",{name:i.name})}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||s("importListings.itemFallback")}),e.jsx("span",{className:"imp-chip",children:i.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(L,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input","data-testid":"imp-price-input",inputMode:"numeric",value:C.toLocaleString(),onChange:E=>p(i.oldTradeId,E.target.value),"aria-label":s("importListings.priceAria",{currency:w.name,name:i.name})})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(C*.1).toFixed(2)]}),R?e.jsxs("button",{className:"imp-price__reset",onClick:()=>I(E=>({...E,[i.oldTradeId]:i.suggestedCredits})),children:[s("importListings.resetTo")," ",e.jsx(L,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx(k,{size:"sm",className:"imp-row__list",disabled:!y(i.oldTradeId),onClick:()=>v(o([i])),children:s("importListings.list")})})]},i.oldTradeId)})})]},a.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(L,{className:"ccy-mark imp__diamond"})," ",r.toLocaleString()]}),e.jsx("div",{className:"imp-dock__sub",children:s("importListings.selectedSummary",{count:c.length,usd:(r*.1).toFixed(2)})})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsx(V,{variant:"purple",disabled:c.length===0,onClick:()=>v(o(c)),children:s("importListings.listAll",{count:c.length})})]})}),_&&n?e.jsx(J,{queue:_,session:n,onClose:()=>v(null),onDone:b}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:s("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:s("importListings.signInBody")}),e.jsx(F,{variant:"purple",onClick:()=>T(),children:s("storeSettings.signIn")})]})}export{me as ImportListings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.notify{display:flex;flex-direction:column;gap:8px;width:100%}.notify__label{font-size:14px;color:var(--text)}.notify__row{display:flex;align-items:stretch;gap:8px}.notify__input{flex:1;min-width:0;height:42px;padding:0 16px;border:1px solid var(--muted);border-radius:8px;background:#fff;font-size:16px;color:var(--text)}.notify__input::placeholder{color:var(--muted-2)}.notify__input:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.notify__btn{flex-shrink:0;height:42px;padding:0 16px;border:0;border-radius:8px;background:var(--accent);color:var(--soft-white);font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:opacity .15s ease}.notify__btn:hover:not(:disabled){opacity:.9}.notify__btn:disabled{opacity:.5;cursor:default}.notify__signin{width:100%;height:42px;padding:0 16px;border:0;border-radius:8px;background:var(--accent);color:var(--soft-white);font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:opacity .15s ease}.notify__signin:hover{opacity:.9}.notify__done{flex-direction:row;align-items:center;gap:16px;padding:12px;border-radius:16px;background:#c1eecf80}.notify__done-check{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;border-radius:50%;background:#34ce76;color:#fff}.notify__done-text{font-size:16px;line-height:1.5;color:var(--text-2)}.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__stock-value--out{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.02em;color:var(--muted-1)}.item-detail__price-label{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:0;color:var(--muted-1)}.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{display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--text)}.item-detail__price-info{display:inline-flex;color:var(--muted-2);cursor:help}.item-detail__price-info:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}.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}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CtzfdSwK.js","assets/react-C51i12iP.js","assets/dcl-schemas-BICTSpB5.js","assets/index-BBuZMaWr.js","assets/sentry-DKBoGDXH.js","assets/ethers-BeFqf2KO.js","assets/intl-CBcMB1D2.js","assets/index-PISx9bvm.css","assets/emotion-styled.browser.esm-ClqtCiJQ.js","assets/useTheme-6tr3eE7K.js","assets/CircularProgress-Bf7cTa84.js","assets/index-DfnBxBKK.js","assets/useTheme-Dpdkvivv.js","assets/CssVarsProvider-DQXUaIP8.js","assets/getOverlayAlpha-B_CoLTSj.js","assets/index-BDfpUFpd.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as pe,r as c,j as e,d as ua,a as ha,L as _a}from"./react-C51i12iP.js";import{b as Y,ae as ya,n as Ge,t,ap as pa,i as fa,j as ba,ai as xa,af as ie,o as V,X as Re,aj as _e,aq as ja,m as le,C as M,am as ne,_ as ye,a3 as va,a6 as ga,a5 as Na,aC as wa,a9 as ka,g as fe,aD as Ca,W as He,c as R,aE as Ia,I as F,a2 as O,s as z,aF as Aa,aG as Sa,aH as Ma,ab as Pa,ak as qe,a as $e,aI as Ea,aJ as Fa,aK as La,aL as Da,aM as Ta,al as Ba,u as Ra,aN as qa,aO as $a,aP as Oa,an as za,aQ as Oe,aR as Ka,B as be,e as Wa,r as Va,av as Qa,aS as Ua,aT as Ga,aw as Ha,aU as Ja,aV as Ya}from"./index-BBuZMaWr.js";import{d as Q}from"./dcl-schemas-BICTSpB5.js";import{b as ze,c as Xa}from"./buy-C5_gzZWJ.js";import{S as Za,P as et,f as at}from"./PrimaryListModal-D6DU8-ZC.js";import{g as tt,b as st,w as it,S as rt,G as nt}from"./buy-gasless-Cxx1jwuH.js";import{u as lt,l as dt,c as ot}from"./loader-logo-CK-TcJ-S.js";import{R as Ke}from"./resume-buy-Bf0zIH7y.js";import{a as ct,f as We,i as mt}from"./errors-BLIsDEoc.js";import{E as xe}from"./ErrorNotice-C7soUjRV.js";import{C as ut}from"./CircularProgress-Bf7cTa84.js";import{T as Je,u as ht,M as _t}from"./MarketCheckout-B1QbAQBC.js";import{s as yt}from"./address-DrURAr9O.js";import{C as pt}from"./CollectionCarousel-BaK4BZqg.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CWytSFjw.js";import"./index-HN6Rk25C.js";import"./wallet-kind-B9P1TeIH.js";import"./mana-rate-Disk-ReT.js";import"./emotion-CSxEP8yM.js";function ft({item:s,onClose:n,resume:i=!1}){var Z,ee;const{session:d}=Y(),{data:o}=ya(d),h=Ge(),v=pe(),x=lt().packs.slice(0,3),[m,l]=c.useState("loading"),[a,k]=c.useState(null),[y,g]=c.useState(""),[L,f]=c.useState(s.priceCredits),[p,D]=c.useState(null),P=c.useRef(null),I=(p==null?void 0:p.credits)??L,X=(o==null?void 0:o.credits)??0;c.useEffect(()=>{let u=!1;if(!d){l("error"),k(t("buyModal.signInToCheckout"));return}const N=_=>{const w=_-((o==null?void 0:o.credits)??0),b=x.find(T=>T.credits>=w)??x[x.length-1];g(b.id),V("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,w)}),l("nofunds")};return(async()=>{var _,w;try{const b=await pa(s);if(!b)throw new Error("not for sale");if(fa(b,d.address))throw new Error("You can't buy your own listing.");const T=ba((w=(_=b.received)==null?void 0:_[0])==null?void 0:w.amount);if(!Number.isFinite(T)||T<=0)throw new Error("price unavailable");const K=Math.ceil(T/10);if(u)return;if(f(K),o!=null&&o.credits<K){N(K);return}try{const{credit:C,maxCreditedValue:G,usdCents:$}=await xa(d.identity,T,b.id);if(u){ie(d.identity,[C.id]).catch(()=>{});return}P.current=C.id;const ae=Math.ceil($/10);f(ae);const W={trade:b,credit:C,maxCreditedValue:G,usdCents:$,credits:ae};D(W),i?U(W):l("ready")}catch(C){if(u)return;if(ct(C)){N(K);return}throw C}}catch(b){if(u)return;V(_e(b)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Re(b)}),l("error"),k(We(b,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{u=!0,P.current&&d&&(ie(d.identity,[P.current]).catch(()=>{}),P.current=null)}},[]);async function U(u=p){if(!d||!u)return;l("processing"),k(null);let N=!1;try{const _={trade:u.trade,buyer:d.address,signer:d.signer,credits:[u.credit],maxCreditedValue:u.maxCreditedValue};let w;if(tt())try{w=await st(_),await it(w),N=!0}catch(b){if(b instanceof rt)N=!0;else if(b instanceof nt)w=await ze(_);else throw b}else w=await ze(_);P.current=null,V("Shop Completed Purchase",{...ja([s]),payment_type:"credits",no_crypto_step:N,transaction_hash:w??null}),h.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){_e(_)||le(_,{flow:"buy",step:"submit",gasless:N}),ie(d.identity,[u.credit.id]).catch(()=>{}),P.current=null,V(_e(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Re(_)}),h.invalidateQueries({queryKey:["usd-balance"]}),k(We(_,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function de(){if(!(!y||!d)){try{sessionStorage.setItem(Ke,JSON.stringify(s))}catch{}p&&ie(d.identity,[p.credit.id]).catch(()=>{}),P.current=null,l("loading");try{const u=await ot(y,{address:d.address,identity:d.identity});if(u.url){window.location.href=u.url;return}v("/credits")}catch(u){le(u,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ke)}catch{}k(t("buyModal.error.creditsCheckout")),l("error")}}}const q=m==="processing",E=m==="complete"?t("buyModal.titleComplete"):m==="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:s.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:q?void 0:n,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${m==="processing"||m==="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:E}),!q&&e.jsx("button",{className:"buy-modal__x",onClick:n,"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:m==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(M,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ne(X)})]})]}),m==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(ut,{size:44})}),m==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(xe,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:n,children:t("buyModal.close")})})]}),m==="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,I-X)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(Ve,{item:s,priceCredits:I}),e.jsx("div",{className:"buy-modal__packs",children:x.map(u=>{const N=u.credits,_=u.id===y;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>g(u.id),children:[e.jsx(M,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ne(N)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",u.usd.toFixed(2),")"]})]},u.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(M,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ne(((Z=x.find(u=>u.id===y))==null?void 0:Z.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((ee=x.find(u=>u.id===y))==null?void 0:ee.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:n,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void de(),children:t("buyModal.buy")})]})]}),m==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ve,{item:s,priceCredits:I}),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 U(),children:t("buyModal.buy")})})]}),m==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:dt,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"})})]}),m==="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:()=>v("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:n,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 Ve({item:s,priceCredits:n}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:s.thumbnail?e.jsx("img",{src:s.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:s.name,children:s.name||t("buyModal.itemFallback")}),s.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:t("search.byCreator",{name:s.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(M,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ne(n)})]})]})]})}const bt=c.lazy(async()=>{const[{EmoteControls:s},{Experimental_CssVarsProvider:n},{light:i}]=await Promise.all([ye(()=>import("./index-CtzfdSwK.js").then(d=>d.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ye(()=>import("./index-DfnBxBKK.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ye(()=>import("./index-BDfpUFpd.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:d=>e.jsx(n,{theme:i,children:e.jsx(s,{...d})})}});function xt(s){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(bt,{...s})})}function jt({item:s}){const n=Y(p=>{var D;return(D=p.session)==null?void 0:D.address}),{data:i,isLoading:d}=va(n),o=n&&i?n:"default",h=s.category==="emote",[v,x]=c.useState("item"),m=!h&&v==="item",l=m||!d,[a,k]=c.useState(!0);c.useEffect(()=>{k(!0)},[s.id,m]);const y=!!n&&!!i,g=y&&ga(s,Na(i)),L=wa(s)[0],f=y&&!g&&!h;return e.jsxs(e.Fragment,{children:[l?e.jsx(ka,{id:"shop-item-preview",contractAddress:s.contractAddress,tokenId:s.tokenId??void 0,itemId:s.tokenId?void 0:s.itemId??void 0,profile:m?void 0:g?o:"default",bodyShape:m||g?void 0:L,type:h?void 0:m?Q.PreviewType.WEARABLE:Q.PreviewType.AVATAR,emote:h||m?void 0:Q.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:h?1.5:void 0,wheelStart:h?100:void 0,dev:fe.chainId===80002,onLoad:()=>k(!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,f&&!m?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:Ca(L)})}):null,h?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(xt,{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:v==="avatar"?"is-active":"","aria-pressed":v==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>x("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:v==="item"?"is-active":"","aria-pressed":v==="item","aria-label":t("itemPreview.item"),onClick:()=>x("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")})]})]})]})}function Ye(){return fe.shopServerUrl||(typeof window<"u"?window.location.origin:"")}async function vt(s,n,i){const d=new URLSearchParams({contractAddress:s,itemId:n}),o=`${Ye()}/notify-requests?${d.toString()}`,h=await He(o,{method:"GET",identity:i,metadata:{}});if(!h.ok)throw new Error(`getNotifyRequest ${h.status}`);return h.json()}async function gt(s,n){const i=`${Ye()}/notify-requests`,d=await He(i,{method:"POST",identity:n,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok)throw new Error(`createNotifyRequest ${d.status}: ${await d.text()}`);await d.json().catch(()=>{})}function Qe(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())}function Nt({item:s}){const n=Y(f=>f.session),i=Y(f=>f.signIn),[d,o]=c.useState(""),[h,v]=c.useState(!1),[x,m]=c.useState(!1),[l,a]=c.useState(null),k=!!n&&!!s.contractAddress&&!!s.itemId,{data:y}=R({queryKey:["notify-request",s.contractAddress,s.itemId,n==null?void 0:n.address],enabled:k,queryFn:()=>vt(s.contractAddress,s.itemId,n.identity)});c.useEffect(()=>{y!=null&&y.email&&o(f=>f||y.email)},[y==null?void 0:y.email]),c.useEffect(()=>{if(!n)return;let f=!1;return Ia().then(p=>{!f&&p&&o(D=>D||p)}),()=>{f=!0}},[n]);const g=x||!!(y!=null&&y.subscribed);async function L(f){if(f.preventDefault(),!(!n||!s.itemId||!Qe(d)||h)){v(!0),a(null);try{await gt({contractAddress:s.contractAddress,itemId:s.itemId,chainId:s.chainId,email:d.trim()},n.identity),m(!0)}catch(p){le(p,{flow:"notify-me",contractAddress:s.contractAddress,itemId:s.itemId}),a(t("notifyMe.error"))}finally{v(!1)}}}return n?g?e.jsxs("div",{className:"notify notify__done","data-testid":"notify-subscribed",children:[e.jsx("span",{className:"notify__done-check","aria-hidden":!0,children:e.jsx(F,{name:"check",size:12})}),e.jsx("span",{className:"notify__done-text",children:t("notifyMe.subscribedBody")})]}):e.jsxs("form",{className:"notify",onSubmit:L,"data-testid":"notify",children:[e.jsx("label",{className:"notify__label",htmlFor:"notify-email",children:t("notifyMe.label")}),e.jsxs("div",{className:"notify__row",children:[e.jsx("input",{id:"notify-email",className:"notify__input",type:"email",inputMode:"email",autoComplete:"email",placeholder:t("notifyMe.placeholder"),value:d,onChange:f=>o(f.target.value),"data-testid":"notify-email"}),e.jsx("button",{type:"submit",className:"notify__btn",disabled:!Qe(d)||h,"data-testid":"notify-submit",children:h?t("notifyMe.working"):t("notifyMe.cta")})]}),e.jsx(xe,{message:l})]}):e.jsx("div",{className:"notify","data-testid":"notify",children:e.jsx("button",{type:"button",className:"notify__signin",onClick:i,"data-testid":"notify-signin",children:t("notifyMe.signInCta")})})}const wt=z.button`
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
gap: 8px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 40px;
|
|
9
|
+
padding: 0 12px;
|
|
10
|
+
border: 2px solid #c640cd;
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
background: transparent;
|
|
13
|
+
color: ${O.colors.accent};
|
|
14
|
+
font-family: ${O.font.sans};
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
font-size: 15px;
|
|
17
|
+
line-height: 24px;
|
|
18
|
+
letter-spacing: 0.46px;
|
|
19
|
+
text-transform: uppercase;
|
|
20
|
+
cursor: not-allowed;
|
|
21
|
+
opacity: 0.55;
|
|
22
|
+
transition: opacity 0.15s ease;
|
|
23
|
+
|
|
24
|
+
&:hover,
|
|
25
|
+
&:focus-visible {
|
|
26
|
+
opacity: 0.75;
|
|
27
|
+
}
|
|
28
|
+
&:focus-visible {
|
|
29
|
+
outline: 2px solid ${O.colors.accent};
|
|
30
|
+
outline-offset: 2px;
|
|
31
|
+
}
|
|
32
|
+
`;function kt({item:s}){return e.jsx(Je,{block:!0,content:t("makeOffer.comingSoon"),onShow:()=>V("Shop Make Offer Tooltip Shown",{contractAddress:s.contractAddress,itemId:s.itemId}),children:e.jsxs(wt,{type:"button","aria-disabled":!0,onClick:n=>n.preventDefault(),"data-testid":"make-offer",children:[e.jsx(F,{name:"offer",size:20,"aria-hidden":!0}),e.jsx("span",{children:t("makeOffer.cta")})]})})}const Ct=z(Aa)`
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
gap: 1px;
|
|
37
|
+
background: ${O.colors.lineStrong};
|
|
38
|
+
`;function It({contractAddress:s,name:n,items:i,className:d}){const o=pe();if(!s||!n)return null;const h=(i??[]).map(m=>m.thumbnail).filter(m=>!!m).slice(0,4),v=h.slice(0,2),x=h.slice(2,4);return e.jsxs(Sa,{as:"button","data-link":!0,className:d,"data-testid":"creator",onClick:m=>{m.stopPropagation(),o(`/collection/${s}`)},children:[h.length>0?e.jsxs(Ct,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${x.length===0?" collection-collage__row--full":""}`,children:v.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}),x.length>0?e.jsx("span",{className:"collection-collage__row",children:x.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}):null]}):null,e.jsx(Ma,{"data-testid":"creator-name",children:Pa(n)})]})}const At=z(be)`
|
|
39
|
+
margin-top: 6px;
|
|
40
|
+
`,re=z(be)`
|
|
41
|
+
&& {
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 48px;
|
|
44
|
+
font-size: 15px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
letter-spacing: 0.46px;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
gap: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
${O.media.down("lg")} {
|
|
54
|
+
.item-detail__ctas--dual && {
|
|
55
|
+
flex: 1 1 auto;
|
|
56
|
+
width: auto;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`,St=z("div")`
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 10px;
|
|
63
|
+
width: 100%;
|
|
64
|
+
`,Mt=z(be)`
|
|
65
|
+
&& {
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 44px;
|
|
68
|
+
}
|
|
69
|
+
`,Pt=z("p")`
|
|
70
|
+
margin: 4px 0 0;
|
|
71
|
+
font-size: 13px;
|
|
72
|
+
color: ${O.colors.muted};
|
|
73
|
+
|
|
74
|
+
a {
|
|
75
|
+
color: ${O.colors.accent};
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
}
|
|
78
|
+
`;function Et(s){return Object.values(Q.Rarity).includes(s)}function Ft(s){return s==="male"?t("itemDetail.genderMale"):s==="female"?t("itemDetail.genderFemale"):s==="unisex"?t("itemDetail.genderUnisex"):null}function Ue(s){return s.wearableCategory?s.wearableCategory.replace(/_/g," "):s.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function is(){var Te;const{contractAddress:s,tokenId:n}=ua(),{state:i}=ha(),d=pe(),o=!!(i!=null&&i.market),h=(i==null?void 0:i.marketPriceCredits)??null,v=qe(r=>r.add),x=qe(r=>r.items),m=$e(r=>r.toggle),{session:l}=Y(),[a,k]=c.useState(()=>i!=null&&i.item?{...i.item,tradeId:i.tradeId??i.item.tradeId}:{id:`${s}-${n}`,name:"",creator:"",contractAddress:s??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:fe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:n??void 0,tradeId:i==null?void 0:i.tradeId}),[y,g]=c.useState(!1),[L,f]=c.useState(!!(i!=null&&i.resumeBuy));c.useEffect(()=>{i!=null&&i.resumeBuy&&g(!0)},[i==null?void 0:i.resumeBuy]);const{data:p=[],isFetched:D}=R({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>Qa(a.contractAddress,{first:20}).then(r=>r.items)}),P=a.available==null&&!a.tokenId,{data:I,isLoading:X}=R({queryKey:["shop-item",a.contractAddress,n],enabled:!o&&!!a.contractAddress&&!!n&&(!(i!=null&&i.item)||P),queryFn:()=>Ua(a.contractAddress,n)});c.useEffect(()=>{I&&k(r=>r.tradeId?r.available!=null&&r.wearableCategory?r:{...r,available:r.available??I.available,wearableCategory:r.wearableCategory??I.wearableCategory}:{...I})},[I]);const[U,de]=c.useState(!1),{data:q=""}=R({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Ga(a.contractAddress,a.itemId)}),{data:E}=R({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Ha(a.contractAddress)});c.useEffect(()=>{if(a.name||I||p.length===0)return;const r=n&&p.find(j=>j.tokenId===n||j.itemId===n)||p.find(j=>j.contractAddress===a.contractAddress);r&&k(j=>({...r,tradeId:j.tradeId??r.tradeId}))},[p,I]);const Z=c.useMemo(()=>{const r=new Set,j=[];for(const A of p){if(A.id===a.id||a.itemId&&A.itemId===a.itemId||a.tokenId&&A.tokenId===a.tokenId)continue;const Be=`${A.contractAddress}-${A.itemId??A.tokenId??A.id}`;r.has(Be)||(r.add(Be),j.push(A))}return j},[p,a.id,a.itemId,a.tokenId]),{data:ee,isLoading:u}=R({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 r=await Ja(a.contractAddress,a.itemId);return(r==null?void 0:r.id)??null}return null}}),N=a.tradeId??ee??void 0,_=!!N,{data:w}=ht(o),b=c.useMemo(()=>{if(!o||!(i!=null&&i.item))return null;const r=i.item;return r.manaWei?{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei,available:1,network:r.network,chainId:r.chainId,createdAt:0}:null},[o,i==null?void 0:i.item]),T=o&&h!=null&&!!w&&!!b,K=Ea({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),C=c.useMemo(()=>({...a,tradeId:N,id:N??a.id}),[a,N]),G=x.some(r=>r.id===C.id),$=!C.tokenId,ae=((Te=x.find(r=>r.id===C.id))==null?void 0:Te.quantity)??0,W=$&&typeof a.available=="number"&&ae>=a.available,B=$e(r=>!!r.items[a.id]),je=c.useRef(null);c.useEffect(()=>{!a.name||u||je.current===a.id||(je.current=a.id,V("Shop Viewed Item",{...Fa(a),for_sale:_}),La(a))},[a.id,a.name,u,_]);const te=`${s}/${n}`,ve=c.useRef(te);c.useEffect(()=>{ve.current!==te&&(ve.current=te,i!=null&&i.item&&k({...i.item,tradeId:i.tradeId??i.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[te]);function Xe(){!_||ce||u||!$&&G||W||v(C,"item_detail")}const oe=Et(a.rarity)?a.rarity:Q.Rarity.COMMON,ge=Ft(a.gender),Ne=Da(a),we=Ta(a.gender),Ze=_&&K,ea=t("itemDetail.moreFromCollection"),ce=Ba(a,l==null?void 0:l.address),se=Ge(),[aa,ke]=c.useState(!1),[ta,Ce]=c.useState(!1),[H,Ie]=c.useState(!1),[sa,Ae]=c.useState(null),{data:S}=R({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!o&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?Ya(l.address,a.contractAddress,a.tokenId):null}),{data:me}=R({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:ce&&!!l&&!!a.itemId,queryFn:async()=>l?(await at(l.address,l.identity)).find(j=>j.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&j.blockchainItemId===a.itemId)??null:null}),J=!!S,ue=!o&&(ce||J),ia=J?!!(S!=null&&S.isOnSale):_,he=J?S==null?void 0:S.tradeId:N,Se=J?!!S:!!me;async function Me(){await Promise.all([se.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),se.invalidateQueries({queryKey:["detail-trade"]}),se.invalidateQueries({queryKey:["shop-item"]}),se.invalidateQueries({queryKey:["collection-sale-state"]})])}async function Pe(r={}){if(!l||!he)return!1;Ae(null),Ie(!0);try{const j=await Wa(he);return await Xa({trade:j,signer:l.signer}),r.silent||Va.success(t("myAssets.removedFromSale",{name:a.name})),await Me(),!0}catch(j){const A=mt(j);return A||le(j,{flow:"remove-listing",tradeId:he}),Ae(A?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{Ie(!1)}}function Ee(){J?ke(!0):Ce(!0)}async function ra(){await Pe({silent:!0})&&Ee()}function Fe(){ke(!1),Ce(!1),Me()}const Le=_?u?t("itemDetail.checking"):W?t("itemDetail.maxInCart"):!$&&G?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),na=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!o,la=!o&&!a.tokenId&&a.available===0,da=!ue&&_&&!o,oa=o||!ue,ca=X||!!a.contractAddress&&!D,De=!a.name&&!ca,ma=/^https?:\/\//i.test(a.thumbnail);return Ra(De?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:q||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ue(a),creator:yt(a.creator)}),image:ma?a.thumbnail:void 0,type:"product"}:{}),De?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(F,{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(At,{variant:"purple",onClick:()=>d("/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:()=>d("/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(jt,{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${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"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${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:Oa(oe),color:$a(oe)},title:qa(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[Ne?e.jsx(F,{name:Ne,size:18,color:"var(--text-2)"}):null,Ue(a)]}),ge?e.jsxs("span",{className:"chip item-detail__chip",children:[we?e.jsx(F,{name:we,size:18,color:"var(--text-2)"}):null,ge]}):null]}),q?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${U?" is-expanded":""}`,children:q}),q.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>de(r=>!r),children:U?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||E!=null&&E.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(za,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,E!=null&&E.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(It,{contractAddress:a.contractAddress,name:E.name,items:p,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:[o||_?e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}):null,o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:h==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(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:h})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):_?Ze?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(M,{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(M,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),Oe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:Oe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Ka,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsxs("div",{className:"item-detail__price item-detail__price--none",children:[e.jsx("span",{children:t("itemDetail.notForSale")}),e.jsx(Je,{content:t("itemDetail.notForSaleHint"),children:e.jsx("span",{className:"item-detail__price-info",tabIndex:0,role:"img","aria-label":t("itemDetail.notForSaleHint"),children:e.jsx(F,{name:"info",size:14})})})]})]}),na?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(),"/",Q.Rarity.getMaxSupply(oe).toLocaleString()]})]}):la?e.jsx("div",{className:"item-detail__stock-col",children:e.jsx("div",{className:"item-detail__stock-value item-detail__stock-value--out","data-testid":"out-of-stock",children:t("itemDetail.outOfStock")})}):null]})}),e.jsx("div",{className:`item-detail__ctas${oa?" item-detail__ctas--buttons":""}${da?" item-detail__ctas--dual":""}`,children:o?e.jsxs(re,{variant:"purple",onClick:()=>g(!0),disabled:!T,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),h!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),h]}):null]}):ue?e.jsxs(St,{"data-testid":"manage-actions",children:[e.jsx(xe,{message:sa}),ia?e.jsxs(e.Fragment,{children:[e.jsx(re,{variant:"purple",onClick:()=>void ra(),disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:H?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(Mt,{variant:"ghost",onClick:()=>void Pe(),disabled:H,children:H?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(re,{variant:"purple",onClick:Ee,disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(Pt,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(_a,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):_?e.jsxs(e.Fragment,{children:[e.jsxs(re,{variant:"purple",onClick:()=>g(!0),disabled:u,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(M,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}),e.jsxs("button",{className:"item-detail__addcart",onClick:Xe,disabled:u||($?W:G),"aria-label":Le,children:[e.jsx(F,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:Le})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{item:a}),e.jsx(kt,{item:a})]})})]}):e.jsx(Lt,{})})]}),e.jsx(pt,{title:ea,items:Z,onViewAll:a.contractAddress?()=>d(`/collection/${a.contractAddress}`):void 0}),y&&o&&b&&w?e.jsx(_t,{listing:b,rate:w,onClose:()=>g(!1),onSold:()=>g(!1)}):y&&!o?e.jsx(ft,{item:C,resume:L,onClose:()=>{g(!1),f(!1)}}):null,aa&&S&&l?e.jsx(Za,{asset:S,session:l,onClose:Fe}):null,ta&&me&&l?e.jsx(et,{item:me,session:l,onClose:Fe}):null]})}function Lt(){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{is as ItemDetail,is as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as c}from"./react-C51i12iP.js";import{s as u,B as p,t as d}from"./index-
|
|
1
|
+
import{r as l,j as c}from"./react-C51i12iP.js";import{s as u,B as p,t as d}from"./index-BBuZMaWr.js";const a=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
padding: 28px 0 8px;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import{c as K,g as B,s as F,a2 as v,b as V,ae as H,n as D,t as s,af as _,C as I,ag as A,ah as J,h as P,e as Z,i as ee,ai as te,o as j,X as T,aj as U,B as ae}from"./index-BBuZMaWr.js";import{r as re,a as M}from"./mana-rate-Disk-ReT.js";import{r as o,j as t,u as se}from"./react-C51i12iP.js";import{n as L}from"./emotion-CSxEP8yM.js";import{b as W}from"./buy-C5_gzZWJ.js";import{g as ne,b as oe,w as ie,S as ce,G as de}from"./buy-gasless-Cxx1jwuH.js";import{i as le}from"./errors-BLIsDEoc.js";import{E as ue}from"./ErrorNotice-C7soUjRV.js";function je(e=!0){return K({queryKey:["mana-rate",B.chainId],queryFn:()=>re(B.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}const me=F("span",L("block"))`
|
|
2
|
+
position: relative;
|
|
3
|
+
display: ${({block:e})=>e?"flex":"inline-flex"};
|
|
4
|
+
${({block:e})=>e?"width: 100%;":""}
|
|
5
|
+
`,he=F("span",L("placement"))`
|
|
6
|
+
position: absolute;
|
|
7
|
+
left: 50%;
|
|
8
|
+
z-index: 30;
|
|
9
|
+
${({placement:e})=>e==="top"?"bottom: calc(100% + 8px);":"top: calc(100% + 8px);"}
|
|
10
|
+
transform: translateX(-50%) translateY(${({placement:e})=>e==="top"?"4px":"-4px"});
|
|
11
|
+
width: max-content;
|
|
12
|
+
max-width: 240px;
|
|
13
|
+
padding: 8px 10px;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
background: ${v.colors.text};
|
|
16
|
+
color: #fff;
|
|
17
|
+
font-family: ${v.font.sans};
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
line-height: 1.4;
|
|
21
|
+
text-align: center;
|
|
22
|
+
text-transform: none;
|
|
23
|
+
letter-spacing: 0;
|
|
24
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
|
|
25
|
+
opacity: 0;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
transition:
|
|
28
|
+
opacity 0.14s ease,
|
|
29
|
+
transform 0.14s ease;
|
|
30
|
+
|
|
31
|
+
&[data-open] {
|
|
32
|
+
opacity: 1;
|
|
33
|
+
transform: translateX(-50%) translateY(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&::after {
|
|
37
|
+
content: '';
|
|
38
|
+
position: absolute;
|
|
39
|
+
left: 50%;
|
|
40
|
+
transform: translateX(-50%);
|
|
41
|
+
border: 5px solid transparent;
|
|
42
|
+
${({placement:e})=>e==="top"?`top: 100%; border-top-color: ${v.colors.text};`:`bottom: 100%; border-bottom-color: ${v.colors.text};`}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (prefers-reduced-motion: reduce) {
|
|
46
|
+
transition: none;
|
|
47
|
+
}
|
|
48
|
+
`;function ge({content:e,children:i,placement:g="top",block:w,onShow:a,className:c}){const[f,k]=o.useState(!1),x=o.useId(),y=o.useRef(!1),u=o.useCallback(()=>{k(!0),y.current||(y.current=!0,a==null||a())},[a]),p=o.useCallback(()=>k(!1),[]);return t.jsxs(me,{className:c,block:w,onMouseEnter:u,onMouseLeave:p,onFocus:u,onBlur:p,children:[o.cloneElement(i,{"aria-describedby":f?x:void 0}),t.jsx(he,{role:"tooltip",id:x,placement:g,"aria-hidden":!f,...f?{"data-open":""}:{},children:e})]})}const q=F(ae)`
|
|
49
|
+
flex: 1;
|
|
50
|
+
`;function z(e){if(le(e))return s("errors.rejected");const i=(e.message??"").toLowerCase();return i.includes("insufficient")?s("marketCheckout.error.insufficient",{currency:P.name}):i.includes("not found")||i.includes("no active listing")||i.includes("404")?s("marketCheckout.error.soldOrRemoved"):i.includes("your own listing")?s("errors.cantBuyOwn"):s("marketCheckout.error.generic")}function pe(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 we({listing:e,rate:i,onClose:g,onSold:w}){const{session:a}=V(),{data:c,isError:f}=H(a),k=D(),x=se(),[y,u]=o.useState("confirm"),[p,R]=o.useState(s("marketCheckout.lockingPrice")),[G,b]=o.useState(null),[r,O]=o.useState(null),l=o.useRef(null),Q=Math.ceil(M(e.manaWei,i)/10);o.useEffect(()=>{let m=!1;if(!a){u("error"),b(s("buyModal.signInToCheckout"));return}return(async()=>{try{const n=await Z(e.tradeId);if(!n)throw new Error("not found");if(ee(n,a.address))throw new Error("You can't buy your own listing.");const h=M(e.manaWei,i);if(!Number.isFinite(h)||h<=0)throw new Error("price unavailable");const{credit:E,maxCreditedValue:Y,usdCents:$}=await te(a.identity,h,e.tradeId);if(m){_(a.identity,[E.id]).catch(()=>{});return}l.current=E.id,O({trade:n,credit:E,maxCreditedValue:Y,usdCents:$,credits:Math.ceil($/10)}),R("")}catch(n){if(m)return;console.error("[market] authorize failed",n),j(U(n)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:T(n),value_usd:Math.round(M(e.manaWei,i))/100}),u("error"),b(z(n))}})(),()=>{m=!0,l.current&&a&&(_(a.identity,[l.current]).catch(()=>{}),l.current=null)}},[]);const N=!!r&&c!=null&&c.credits<r.credits;async function X(){if(!a||!r)return;if(N){j("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:r.credits,credits_balance:(c==null?void 0:c.credits)??0,shortfall:Math.max(0,r.credits-((c==null?void 0:c.credits)??0))}),_(a.identity,[r.credit.id]).catch(()=>{}),l.current=null,x("/credits");return}u("working"),b(null);let m=!1;try{R(s("marketCheckout.confirming"));const d={trade:r.trade,buyer:a.address,signer:a.signer,credits:[r.credit],maxCreditedValue:r.maxCreditedValue};let n;if(ne())try{n=await oe(d),await ie(n),m=!0}catch(h){if(h instanceof ce)m=!0;else if(h instanceof de)n=await W(d);else throw h}else n=await W(d);l.current=null,j("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:r.usdCents/100}],value_credits:r.credits,value_usd:r.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:m,transaction_hash:n??null}),k.invalidateQueries({queryKey:["usd-balance"]}),x("/success",{state:{items:[pe(e)],txHash:n}})}catch(d){console.error("[market] buy now failed",d),_(a.identity,[r.credit.id]).catch(()=>{}),l.current=null,j(U(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:T(d),value_usd:r.usdCents/100}),k.invalidateQueries({queryKey:["usd-balance"]}),b(z(d)),u("error");const n=(d.message??"").toLowerCase();(n.includes("not found")||n.includes("no active listing")||n.includes("404"))&&w()}}function S(){a&&r&&_(a.identity,[r.credit.id]).catch(()=>{}),l.current=null,g()}const C=y==="working";return t.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":s("buyModal.dialogAria",{name:e.name}),children:[t.jsx("div",{className:"mkt-modal__scrim",onClick:C?void 0:S,"aria-hidden":!0}),t.jsxs("div",{className:"mkt-modal__card",children:[t.jsxs("div",{className:"mkt-modal__head",children:[t.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:""}):null}),t.jsxs("div",{children:[t.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||s("buyModal.itemFallback")}),t.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),t.jsx("div",{className:"mkt-modal__price",children:r?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mkt-modal__price-label",children:s("marketCheckout.finalPrice")}),t.jsxs("div",{className:"mkt-modal__price-value",children:[t.jsx(I,{className:"mkt-modal__diamond"}),A(r.credits)]}),t.jsxs("div",{className:"mkt-modal__price-sub muted",children:[s("marketCheckout.lockedForPurchase")," · $",(r.usdCents/100).toFixed(2)]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mkt-modal__price-label",children:s("marketCheckout.todaysPrice")}),t.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[t.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),t.jsx(I,{className:"mkt-modal__diamond"}),A(Q)]}),t.jsx("div",{className:"mkt-modal__price-sub muted",children:p||s("marketCheckout.lockingPrice")})]})}),a?t.jsxs("div",{className:"mkt-modal__balance muted",children:[s("marketCheckout.yourBalance")," ",t.jsx(I,{className:"ccy-mark"})," ",J(c,f)]}):null,N?t.jsx("p",{className:"muted mkt-modal__note",children:s("marketCheckout.needMore",{currency:P.name})}):null,p&&y==="working"?t.jsx("p",{className:"muted mkt-modal__note",children:p}):null,t.jsx(ue,{message:G,className:"mkt-modal__note"}),t.jsxs("div",{className:"mkt-modal__actions",children:[t.jsx(q,{variant:"ghost",onClick:S,disabled:C,children:s("buyModal.cancel")}),t.jsx(q,{variant:"purple",onClick:()=>void X(),disabled:C||!r,children:C?s("marketCheckout.buying"):N?s("nav.getCredits",{currency:P.name}):s("marketCheckout.confirmPurchase")})]})]})]})}export{we as M,ge as T,je as u};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{u as J,r as o,j as s,L as V}from"./react-C51i12iP.js";import{u as X,t,b as ss,
|
|
1
|
+
import{u as J,r as o,j as s,L as V}from"./react-C51i12iP.js";import{u as X,t,b as ss,n as es,c as N,B as y,C as T,o as O,q as as,s as B,e as ns,r as ts,m as is,g as rs,h as cs,v as ls}from"./index-BBuZMaWr.js";import{f as os}from"./import-CWsWpkUA.js";import{S as ds,P as ms,f as hs}from"./PrimaryListModal-D6DU8-ZC.js";import{c as us}from"./buy-C5_gzZWJ.js";import{L as ps}from"./LoadMore-QYabEF53.js";import{u as ys}from"./useInfiniteGrid-CpiD11c4.js";import{E as _}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./mana-rate-Disk-ReT.js";import"./index-HN6Rk25C.js";import"./trade-encoding-CWytSFjw.js";import"./errors-BLIsDEoc.js";import"./wallet-kind-B9P1TeIH.js";const gs=B(y)`
|
|
2
2
|
margin-top: 8px;
|
|
3
3
|
width: 100%;
|
|
4
|
-
`,
|
|
4
|
+
`,K=B(y)`
|
|
5
5
|
margin-top: auto;
|
|
6
6
|
width: 100%;
|
|
7
|
-
`,xs=48;function js(n){return{id:n.id,name:n.name,creator:"",contractAddress:n.contractAddress,itemId:n.itemId,category:n.category,rarity:n.rarity??"common",network:n.network,chainId:n.chainId,thumbnail:n.image,priceCredits:n.listingPrice??0,gender:null,isSmart:!1,tokenId:n.tokenId}}function
|
|
7
|
+
`,xs=48;function js(n){return{id:n.id,name:n.name,creator:"",contractAddress:n.contractAddress,itemId:n.itemId,category:n.category,rarity:n.rarity??"common",network:n.network,chainId:n.chainId,thumbnail:n.image,priceCredits:n.listingPrice??0,gender:null,isSmart:!1,tokenId:n.tokenId}}function z(n){return{id:`${n.contractAddress}-${n.blockchainItemId}`,name:n.name,creator:"",contractAddress:n.contractAddress,itemId:n.blockchainItemId,category:n.category,rarity:n.rarity,network:"MATIC",chainId:rs.chainId,thumbnail:n.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function Fs(){X({title:t("nav.myAssets"),noindex:!0});const{session:n,error:Q,signIn:R,restore:v}=ss(),G=J(),A=es(),[I,f]=o.useState(null),[k,S]=o.useState(null),[h,C]=o.useState(null),[D,w]=o.useState(null);function g(e){const a=e.tokenId??e.itemId??"";!e.contractAddress||!a||G(`/item/${e.contractAddress}/${a}`,{state:{item:e}})}async function E(e,a,i){if(n){w(null),C(i);try{const r=await ns(e);await us({trade:r,signer:n.signer}),ts.success(t("myAssets.removedFromSale",{name:a})),await A.invalidateQueries({queryKey:["my-assets",n.address]}),await A.invalidateQueries({queryKey:["collection-sale-state"]})}catch(r){const u=r,p=(u.message??"").toLowerCase(),F=u.code===4001||p.includes("reject")||p.includes("denied");F||is(r,{flow:"remove-listing",tradeId:e}),w(F?t("getCredits.errorCanceled"):t("myAssets.removeListingError"))}finally{C(null)}}}o.useEffect(()=>{v()},[v]);const c=n==null?void 0:n.address,{items:P,isLoading:$,error:U,hasNextPage:W,isFetchingNextPage:L,fetchNextPage:Y}=ys(["my-assets",c],e=>as(c,{first:xs,skip:e}).then(a=>({items:a.assets,total:a.total})),{enabled:!!c}),{data:d}=N({queryKey:["importable",c],queryFn:()=>os(c),enabled:!!c}),q=((d==null?void 0:d.creations.length)??0)+((d==null?void 0:d.owned.length)??0),{data:m,isLoading:Z,isError:H}=N({queryKey:["publishable-items",c],queryFn:()=>hs(c,n.identity),enabled:!!n,retry:!1}),x=o.useMemo(()=>[...new Set((m??[]).map(e=>e.contractAddress))],[m]),{data:l}=N({queryKey:["collection-sale-state",c,x],enabled:x.length>0,queryFn:async()=>{const e=await Promise.all(x.map(async i=>[i,await ls(i)])),a={};for(const[i,r]of e)for(const[u,p]of Object.entries(r))a[`${i}-${u}`]=p;return a}}),j=e=>l==null?void 0:l[`${e.contractAddress}-${e.blockchainItemId}`],b=o.useMemo(()=>(m??[]).filter(e=>{var a;return(a=j(e))==null?void 0:a.isOnSale}),[m,l]),M=o.useMemo(()=>{var a;const e=new Map;for(const i of m??[]){if((a=l==null?void 0:l[`${i.contractAddress}-${i.blockchainItemId}`])!=null&&a.isOnSale)continue;const r=e.get(i.collectionId)??{id:i.collectionId,name:i.collectionName,items:[]};r.items.push(i),e.set(i.collectionId,r)}return[...e.values()]},[m,l]);return n?s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:t("nav.myAssets")}),q>0?s.jsxs(V,{className:"import-banner",to:"/import",children:[s.jsx("span",{className:"import-banner__ico","aria-hidden":!0,children:"📦"}),s.jsxs("span",{className:"import-banner__text",children:[s.jsx("strong",{children:t("myAssets.importTitle")}),s.jsx("span",{className:"import-banner__sub",children:t("myAssets.importSub",{count:q})})]}),s.jsx("span",{className:"import-banner__cta",children:t("myAssets.import")})]}):null,s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:t("myAssets.ownedTitle")}),s.jsx("p",{className:"myassets__section-sub",children:t("myAssets.ownedSub")})]}),U?s.jsx(_,{message:t("myAssets.ownedError")}):null,s.jsx(_,{message:D}),s.jsxs("div",{className:"asset-grid",children:[$?Array.from({length:8}).map((e,a)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`sk-${a}`)):P.map(e=>s.jsxs("article",{className:"asset-card asset-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":t("myAssets.viewItem",{name:e.name}),onClick:()=>g(js(e))}),s.jsx("div",{className:"asset-card__img",children:e.image?s.jsx("img",{src:e.image,alt:e.name}):null}),s.jsx("div",{className:"asset-card__name",title:e.name,children:e.name}),e.isOnSale?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"asset-card__listed",children:[s.jsxs("span",{className:"asset-card__price",children:[s.jsx(T,{className:"ccy-mark"})," ",e.listingPrice]}),s.jsx("span",{className:"badge",children:t("myAssets.onSale")})]}),s.jsx(gs,{size:"sm",variant:"ghost",disabled:h===e.id||!e.tradeId,onClick:a=>{a.stopPropagation(),e.tradeId&&E(e.tradeId,e.name,e.id)},children:h===e.id?t("myAssets.removing"):t("myAssets.removeListing")})]}):s.jsx(y,{size:"sm",onClick:a=>{a.stopPropagation(),O("Shop Started Listing",{listing_type:"secondary",item_id:e.itemId??e.tokenId??null}),f(e)},children:t("myAssets.putOnSale")})]},e.id)),L?Array.from({length:4}).map((e,a)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`msk-${a}`)):null]}),s.jsx(ps,{hasNextPage:W,isFetching:L,onLoadMore:()=>void Y()}),!$&&P.length===0?s.jsx("p",{className:"muted",children:t("myAssets.ownedEmpty")}):null]}),s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:t("myAssets.creationsTitle")}),s.jsx("p",{className:"myassets__section-sub",children:t("myAssets.creationsSub",{currency:cs.name})})]}),Z?s.jsx("div",{className:"publish-grid",children:Array.from({length:4}).map((e,a)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`pub-sk-${a}`))}):H?s.jsx("p",{className:"publish-empty",children:t("myAssets.collectionsError")}):b.length===0&&M.length===0?s.jsx("p",{className:"publish-empty",children:t("myAssets.nothingToPublish")}):s.jsxs(s.Fragment,{children:[b.length>0?s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:t("myAssets.onSale")}),s.jsx("div",{className:"publish-grid",children:b.map(e=>{var a;return s.jsxs("article",{className:"publish-card publish-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":t("myAssets.viewItem",{name:e.name}),onClick:()=>g(z(e))}),s.jsx("div",{className:"publish-card__img",children:e.thumbnail?s.jsx("img",{src:e.thumbnail,alt:e.name}):null}),s.jsx("div",{className:"publish-card__name",title:e.name,children:e.name}),s.jsxs("div",{className:"publish-card__listed",children:[s.jsxs("span",{className:"publish-card__price",children:[s.jsx(T,{className:"ccy-mark"})," ",((a=j(e))==null?void 0:a.priceCredits)??0]}),s.jsx("span",{className:"badge",children:t("myAssets.onSale")})]}),s.jsx(K,{size:"sm",variant:"ghost",disabled:h===e.id,onClick:i=>{i.stopPropagation();const r=j(e);r!=null&&r.tradeId&&E(r.tradeId,e.name,e.id)},children:h===e.id?t("myAssets.removing"):t("myAssets.removeListing")})]},`${e.contractAddress}-${e.blockchainItemId}`)})})]}):null,M.map(e=>s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:e.name}),s.jsx("div",{className:"publish-grid",children:e.items.map(a=>s.jsxs("article",{className:"publish-card publish-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":t("myAssets.viewItem",{name:a.name}),onClick:()=>g(z(a))}),s.jsx("div",{className:"publish-card__img",children:a.thumbnail?s.jsx("img",{src:a.thumbnail,alt:a.name}):null}),s.jsx("div",{className:"publish-card__name",title:a.name,children:a.name}),s.jsxs("div",{className:"publish-card__meta",children:[s.jsx("span",{className:"publish-chip publish-chip--rarity",children:a.rarity}),s.jsx("span",{className:"publish-card__supply",children:t("myAssets.available",{count:a.remainingSupply})})]}),s.jsx(K,{size:"sm",variant:"purple",onClick:i=>{i.stopPropagation(),O("Shop Started Listing",{listing_type:"primary",item_id:a.blockchainItemId}),S(a)},children:t("myAssets.putOnSale")})]},`${a.contractAddress}-${a.blockchainItemId}`))})]},e.id))]})]}),I?s.jsx(ds,{asset:I,session:n,onClose:()=>f(null)}):null,k?s.jsx(ms,{item:k,session:n,onClose:()=>S(null)}):null]}):s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:t("nav.myAssets")}),s.jsx("p",{className:"muted",children:t("myAssets.signInPrompt")}),s.jsx("div",{className:"connect-row",children:s.jsx(y,{variant:"purple",onClick:()=>R(),children:t("storeSettings.signIn")})}),s.jsx(_,{message:Q})]})}export{Fs as MyAssets};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as n,j as s,L as m}from"./react-C51i12iP.js";import{u as c,t,a as l,I as d,A as p,s as v,B as x}from"./index-
|
|
1
|
+
import{r as n,j as s,L as m}from"./react-C51i12iP.js";import{u as c,t,a as l,I as d,A as p,s as v,B as x}from"./index-BBuZMaWr.js";import{L as u}from"./LoadMore-QYabEF53.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const h=v(x)`
|
|
2
2
|
margin-top: 12px;
|
|
3
3
|
`,r=24;function E(){c({title:t("nav.myFavorites"),noindex:!0});const a=l(e=>Object.values(e.items)),[i,o]=n.useState(r);return a.length===0?s.jsxs("div",{className:"favorites-empty",children:[s.jsx(d,{name:"heart",size:40,color:"var(--muted-2)"}),s.jsx("p",{className:"favorites-empty__title",children:t("myFavorites.emptyTitle")}),s.jsx("p",{className:"muted",children:t("myFavorites.emptyBody")}),s.jsx(h,{as:m,to:"/assets",variant:"purple",children:t("notFound.cta")})]}):s.jsxs("section",{className:"favorites",children:[s.jsxs("div",{className:"favorites__head",children:[s.jsx("h1",{children:t("nav.myFavorites")}),s.jsx("span",{className:"favorites__count",children:t("myFavorites.itemCount",{count:a.length})})]}),s.jsx("div",{className:"grid",children:a.slice(0,i).map(e=>s.jsx(p,{item:e},e.id))}),s.jsx(u,{hasNextPage:i<a.length,isFetching:!1,onLoadMore:()=>o(e=>e+r)})]})}export{E as MyFavorites};
|