@dcl/shop 0.1.0-30546268577.commit-51c9020 → 0.1.0-30565861644.commit-86fa62d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Activity-CjSEeiSV.js → Activity-YIu0M1Kf.js} +4 -4
- package/assets/{AnimatedBackground-BTiUO6oZ.js → AnimatedBackground-BrxVl8X0.js} +1 -1
- package/assets/{Assets-BakwJdNE.js → Assets-Dwlho6_C.js} +2 -2
- package/assets/{Assets.styles-DPfy47Yz.js → Assets.styles-CfTWTkg9.js} +1 -1
- package/assets/{Authorizations-_yZR7wlJ.js → Authorizations-BMPo5lsC.js} +1 -1
- package/assets/{Cart-NESueVBd.js → Cart-DS3i-ZcL.js} +62 -62
- package/assets/{CircularProgress-B838AFJT.js → CircularProgress-BrgD7rFE.js} +1 -1
- package/assets/{Collection-BPHP1zi6.js → Collection-wJlJYfNj.js} +1 -1
- package/assets/{CollectionCarousel-CipJZ4Jp.js → CollectionCarousel-Bns794gp.js} +1 -1
- package/assets/{Creator-iyC-uTI8.js → Creator-Bz4Ol9VJ.js} +2 -2
- package/assets/{ErrorNotice-BDPNfqx0.js → ErrorNotice-Z0D8os9s.js} +1 -1
- package/assets/{ExchangeController-CVMU9e-y.js → ExchangeController-DWJqUlaQ.js} +1 -1
- package/assets/{GetCredits-CCPnCpLE.js → GetCredits-DaqSIDEt.js} +7 -7
- package/assets/{HelpersUtil-CLRWW-JG.js → HelpersUtil-BmEt66tk.js} +1 -1
- package/assets/{ImportListings-kvaDCP0o.js → ImportListings-tR_OXub1.js} +6 -6
- package/assets/{ItemDetail-Bli253Mg.js → ItemDetail-n9hpow28.js} +197 -197
- package/assets/{LoadMore-Bg1WdJa_.js → LoadMore-DI4Wyn-C.js} +1 -1
- package/assets/{MenuList-DyNPpfN8.js → MenuList-CYC3zRYf.js} +1 -1
- package/assets/{MyAssets-BQi5bsrn.js → MyAssets-CRBhFPGQ.js} +1 -1
- package/assets/{MyFavorites-jnBBqCpp.js → MyFavorites-B6grtRZj.js} +44 -17
- package/assets/{NotFound-BXC5nxMj.js → NotFound-0L1xj8db.js} +1 -1
- package/assets/{NotificationsBell-HKxgY3NU.js → NotificationsBell-B5Q9EIqa.js} +1 -1
- package/assets/{StoreSettings-DF4mEasf.js → StoreSettings-CUyzwheq.js} +1 -1
- package/assets/{Success-B-8PxhyV.js → Success-DXPvtMrB.js} +1 -1
- package/assets/{SwapController-DdH70j30.js → SwapController-CP6wYtUi.js} +1 -1
- package/assets/{Tooltip-Nt-DyBD0.js → Tooltip-BbHzoPIy.js} +1 -1
- package/assets/{TradeService-CL3q5o0U.js → TradeService-CbR5e6j8.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-Bum-DrEQ.js → W3MFrameProviderSingleton-CAciSeGb.js} +3 -3
- package/assets/{WebCryptoP256-CyVP2wWt.js → WebCryptoP256-BJObUJ75.js} +1 -1
- package/assets/{authorizations-CRss4Km2.js → authorizations-B6wWjXdQ.js} +1 -1
- package/assets/{basic-DHCLMBzG.js → basic-PrtqXBMx.js} +1 -1
- package/assets/{biconomy-D3-_U8ud.js → biconomy-CXoNqd-Z.js} +1 -1
- package/assets/{browseLayout.styles-B9TM0sjQ.js → browseLayout.styles-B_NNL83E.js} +8 -8
- package/assets/{builder-B_9KaS-W.js → builder-DJzcrQAM.js} +1 -1
- package/assets/{buy-CQDvi-Z2.js → buy-D3hY4JG8.js} +1 -1
- package/assets/{buy-gasless-D0882Rr8.js → buy-gasless-CmOMFX1L.js} +1 -1
- package/assets/{categories-B6c_VHlD.js → categories-CX6i4K78.js} +1 -1
- package/assets/{ccip-tmXFoKyG.js → ccip-Dd-dexDO.js} +1 -1
- package/assets/{ccip-W9GWssu_.js → ccip-w3FPfxqw.js} +1 -1
- package/assets/{clsx-DvvcJE_g.js → clsx-BRGjhjlu.js} +2 -2
- package/assets/{controller-DIzv_zYO.js → controller-DwX-jKZc.js} +2 -2
- package/assets/{core-D28BQIc2.js → core-D2eU58P9.js} +4 -4
- package/assets/{createSvgIcon-CWSm-SRl.js → createSvgIcon-BVcvIe2E.js} +2 -2
- package/assets/{custom-DZpHgkVB.js → custom-C8kunAUg.js} +1 -1
- package/assets/{data-capture-pK_Tv-hz.js → data-capture-5SXe7x0r.js} +1 -1
- package/assets/{email-CtVQSJFe.js → email-Bn0Sv8j4.js} +1 -1
- package/assets/{embedded-wallet-ZDQSZ5fJ.js → embedded-wallet-C8c_78Uv.js} +1 -1
- package/assets/{emotion-styled.browser.esm-ObtTAShi.js → emotion-styled.browser.esm-3ejjGoWk.js} +1 -1
- package/assets/{engine-CZ-Hi_lm.js → engine-CNGw5SdF.js} +1 -1
- package/assets/{errors-Bq2Mu6G5.js → errors-BYKPLdNJ.js} +1 -1
- package/assets/{estimate-l1-fee-nbXW8n0n.js → estimate-l1-fee-BrG1mArn.js} +1 -1
- package/assets/{execute-Dn81thV4.js → execute-BuBESW09.js} +2 -2
- package/assets/{features-Cd8utqE-.js → features-DJEePSdY.js} +1 -1
- package/assets/{fetchTokenMetadata-C6h4HQcG.js → fetchTokenMetadata-DbJ4fJYd.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-BJFL8Ls9.js → get-ecosystem-wallet-info-BVDQHXZz.js} +1 -1
- package/assets/{getBalance--wLYv_Wi.js → getBalance-Dwa97iHq.js} +1 -1
- package/assets/{getNFT-DuSw54F-.js → getNFT-8vTqe5mx.js} +1 -1
- package/assets/{getNFT-a1Nf-Yxw.js → getNFT-KnOGHpCx.js} +1 -1
- package/assets/{getThemeProps-ClN2Fv_K.js → getThemeProps-BkCaIJdf.js} +1 -1
- package/assets/{grid.styles-DxJ1n2rK.js → grid.styles-Cflo-ZKg.js} +1 -1
- package/assets/{hashTypedData-BtiwfEFc.js → hashTypedData-ByA_PXdL.js} +1 -1
- package/assets/{hashTypedData-D_etcs5u.js → hashTypedData-zHAZUnlP.js} +1 -1
- package/assets/{import-CYD98Dph.js → import-Da_I6gAZ.js} +1 -1
- package/assets/{in-app-3OV_nmgG.js → in-app-DAfU34Xj.js} +1 -1
- package/assets/{in-app-wallet-calls-VcctZRek.js → in-app-wallet-calls-C8MSEj6u.js} +1 -1
- package/assets/{index-B8KoR7hy.js → index-1YMH7MTk.js} +1 -1
- package/assets/{index-DifXdg7h.js → index-Azrqm6Av.js} +1 -1
- package/assets/{index-BXrG6gz_.js → index-B6EsaBwe.js} +1 -1
- package/assets/{index-C1A_3mRS.js → index-BBHWbqVq.js} +1 -1
- package/assets/{index-D7eID9fV.js → index-BCGTwY9C.js} +1 -1
- package/assets/{index-o9-JIK9h.js → index-BFQ3WGPq.js} +1 -1
- package/assets/{index-CHPRaB-Z.js → index-BKmu2o-E.js} +1 -1
- package/assets/{index-9rhkaWrx.js → index-BOei64ey.js} +1 -1
- package/assets/{index-B6-ez4HU.js → index-BRBJXQFj.js} +3 -3
- package/assets/{index-DrNdDAUt.js → index-BkQsw_6m.js} +1 -1
- package/assets/{index-B5xVJZSj.js → index-BnWc8jyR.js} +1 -1
- package/assets/index-BnbwrW-6.js +2815 -0
- package/assets/{index-D_Cr3ySt.js → index-Bvsc2jDb.js} +1 -1
- package/assets/{index-CwxgWYVj.js → index-BzmmiLep.js} +1 -1
- package/assets/{index-CQK1zDT_.js → index-CGd-1UpW.js} +1 -1
- package/assets/{index-EP1NKxUH.js → index-CRiWMT-r.js} +1 -1
- package/assets/{index-Big9wV9m.js → index-CSAUfzci.js} +1 -1
- package/assets/{index-BAeAH5ly.js → index-CVY0sxwP.js} +1 -1
- package/assets/{index-D5SkK98O.js → index-CfiHgp7t.js} +2 -2
- package/assets/{index-C2ozFumj.js → index-CgmlJw-S.js} +1 -1
- package/assets/{index-CKfkRfuc.js → index-CkqeusMi.js} +1 -1
- package/assets/{index-B9JrHlPn.js → index-CkshIr8A.js} +1 -1
- package/assets/{index-Bc6CsYH5.js → index-CkzcSx5U.js} +1 -1
- package/assets/{index-D2jvGNN0.js → index-CuYL-Baw.js} +2 -2
- package/assets/{index-C5WX4daB.js → index-CvD8tr1x.js} +1 -1
- package/assets/{index-BbB-EGIL.js → index-CzKTIGRh.js} +2 -2
- package/assets/{index-uVZf2hjB.js → index-D34PBlHH.js} +1 -1
- package/assets/{index-D3byoEP7.js → index-DHNHHzGW.js} +1 -1
- package/assets/{index-b_M0YiWv.js → index-DJk-Gyy6.js} +1 -1
- package/assets/{index-BQr6Gfsp.js → index-DMlJeY00.js} +1 -1
- package/assets/{index-pRcoDIl4.js → index-DQwfF15K.js} +1 -1
- package/assets/{index-LUHXTqk6.js → index-DTtN3FMo.js} +1 -1
- package/assets/{index-Dw57E0gA.js → index-DTvh0ZYF.js} +1 -1
- package/assets/{index-B_LIxJKB.js → index-DWsuciPI.js} +1 -1
- package/assets/{index-iWo5bwxy.js → index-DX8GIl1w.js} +2 -2
- package/assets/{index-Bzfa0XEQ.js → index-Ddw9OYjW.js} +1 -1
- package/assets/{index-D2kMWo74.js → index-DeUn3r_V.js} +1 -1
- package/assets/{index-ChIdc3F1.js → index-DhHGVFYf.js} +1 -1
- package/assets/{index-CVlJa6t_.js → index-DiUDVsbw.js} +3 -3
- package/assets/{index-DkEIacBh.js → index-Dl_EomMH.js} +1 -1
- package/assets/{index-Fc-0pErb.js → index-Dla9ohqE.js} +2 -2
- package/assets/{index-DFxWOBf7.js → index-Dltarl5j.js} +1 -1
- package/assets/{index-9ijpZr49.js → index-DmUPrDg1.js} +1 -1
- package/assets/{index-BWmQWw6Q.js → index-I6AhOucd.js} +1 -1
- package/assets/{index-C_jjojzc.js → index-IEBvb9g0.js} +1 -1
- package/assets/{index-CFKKYXej.js → index-Kl09Ztwk.js} +1 -1
- package/assets/{index-C4pQJ4un.js → index-MBO4iF-x.js} +1 -1
- package/assets/{index-ZpNI2gFx.js → index-MmxQtN7S.js} +1 -1
- package/assets/{index-BWzFwNSL.js → index-Q9aqPNo3.js} +1 -1
- package/assets/{index-D4TqGnX3.js → index-SG2QR9w5.js} +3 -3
- package/assets/{index-qo50HoTd.js → index-vQ_2c6zv.js} +1 -1
- package/assets/{index.es-C7AM-hAJ.js → index.es-1Eex98-c.js} +1 -1
- package/assets/{index.es-DeL8MDY5.js → index.es-8mJw4ztI.js} +1 -1
- package/assets/{index.es-Dm_DN_o8.js → index.es-Dcl8xzFM.js} +4 -4
- package/assets/{localBatchGatewayRequest-D_Kxo5IY.js → localBatchGatewayRequest-DLZcpxp5.js} +1 -1
- package/assets/{mana-convert-CTsR_3Ej.js → mana-convert-Bc7WVBn5.js} +1 -1
- package/assets/{mana-rate-C115gAGh.js → mana-rate-CFfqtCHS.js} +1 -1
- package/assets/{networks-_4OAhcxm.js → networks-C9v8SYzv.js} +1 -1
- package/assets/{onramp-CSUyuOLB.js → onramp-vHeI0Bdi.js} +1 -1
- package/assets/{openzeppelin-CRfl-P-Y.js → openzeppelin-yMR9b1FL.js} +1 -1
- package/assets/{parseNft-NH_oxr1p.js → parseNft-DOgBlFyM.js} +2 -2
- package/assets/{parseSignature-BKPTd0Wp.js → parseSignature-B_BQDXEi.js} +1 -1
- package/assets/{parseSignature-Dv5iREVh.js → parseSignature-CCtT275H.js} +3 -3
- package/assets/{passkeys-BOKQqJLG.js → passkeys-DC9ui3MW.js} +1 -1
- package/assets/{pay-with-exchange-Dqf9Unk5.js → pay-with-exchange-DzS3VV5h.js} +1 -1
- package/assets/{qr-overlay-BBzE6d4w.js → qr-overlay-DBMFsWbT.js} +1 -1
- package/assets/{receive-DTcWvXo9.js → receive-DL6eap6Y.js} +1 -1
- package/assets/{resolveImplementation-B4run9SA.js → resolveImplementation-CbIwAEHk.js} +1 -1
- package/assets/{rpc-BkTOb0Ae.js → rpc-4rFMN8E0.js} +1 -1
- package/assets/{secp256k1-D40VegOp.js → secp256k1-7K_lKgAG.js} +1 -1
- package/assets/{secp256k1-BKV5oKjd.js → secp256k1-CJEeTac_.js} +1 -1
- package/assets/{secp256k1-sDtHKyKa.js → secp256k1-Cc-OBcqq.js} +1 -1
- package/assets/{send-oN3YL-hJ.js → send-LziflfC8.js} +1 -1
- package/assets/{send-batch-transaction-D3IxN4nk.js → send-batch-transaction-cPuMc9MS.js} +1 -1
- package/assets/{send-eip712-transaction-Ceey9vq_.js → send-eip712-transaction-DrVlY4sm.js} +2 -2
- package/assets/{send-gasless-transaction-BksJzQiD.js → send-gasless-transaction-C7GQuNPZ.js} +2 -2
- package/assets/{send-transaction-B73fhwe5.js → send-transaction-DsHae-07.js} +2 -2
- package/assets/{sendMetaTransaction-BqrdflYy.js → sendMetaTransaction-DVALeVb8.js} +1 -1
- package/assets/{sendRawTransaction-CGYbLnZb.js → sendRawTransaction-BwoXNrfy.js} +3 -3
- package/assets/{serializeTransaction-D5Cac03m.js → serializeTransaction-HjwgZYgE.js} +1 -1
- package/assets/{session-proposal-CVgUeAZW.js → session-proposal-D2B7jyYw.js} +1 -1
- package/assets/{session-request-Di3dSSrI.js → session-request-qG7jHYd4.js} +2 -2
- package/assets/{signing-Bdc9gWZa.js → signing-2d-SxI7E.js} +3 -3
- package/assets/{socials-CmTeJTYn.js → socials-C5lHDsWb.js} +1 -1
- package/assets/{swaps-Wtea2NAu.js → swaps-D-FCeao1.js} +1 -1
- package/assets/{thirdweb-CERMcOXb.js → thirdweb-BzCYZVQU.js} +3 -3
- package/assets/{to-serializable-transaction-DdX40tW9.js → to-serializable-transaction-mtITaKz7.js} +2 -2
- package/assets/{trade-encoding-BoHXvOIc.js → trade-encoding-ZhCceq00.js} +1 -1
- package/assets/{transactionReceipt-ibp-LAsQ.js → transactionReceipt-C0Zt7siR.js} +1 -1
- package/assets/{transactions-CIBv0IDn.js → transactions-3oKW7X2A.js} +1 -1
- package/assets/{useCreditPacks-Erm2XH9O.js → useCreditPacks-DTZSsQrR.js} +1 -1
- package/assets/{useInfiniteGrid-D2N-648g.js → useInfiniteGrid-DxkPmxZ9.js} +1 -1
- package/assets/useManaRate-DJlj41tJ.js +1 -0
- package/assets/{useSecondarySales-i_ahcBp1.js → useSecondarySales-uafEfAWN.js} +1 -1
- package/assets/{useStore-qQrt-8mX.js → useStore-HaFF1p2U.js} +1 -1
- package/assets/{useTheme-DbdTKy8O.js → useTheme-DVLL-c1A.js} +1 -1
- package/assets/{verifyHash-SsYbACTo.js → verifyHash-DR9pCFUe.js} +1 -1
- package/assets/{w3m-modal-C6arh-dP.js → w3m-modal-B4U6A0YE.js} +1 -1
- package/assets/{w3m-modal-U9w4vwW2.js → w3m-modal-CaY0gxk7.js} +1 -1
- package/assets/{wait-for-tx-receipt-BeQkCkwD.js → wait-for-tx-receipt-BDXxYIXq.js} +1 -1
- package/assets/{wallets-CkbfkMFt.js → wallets-Y1872Ad0.js} +5 -5
- package/assets/{web-connector-mK5WyzBm.js → web-connector-CYEfuYp5.js} +3 -3
- package/assets/{writeContract-CzlvCXqK.js → writeContract-DrFAVNON.js} +1 -1
- package/assets/{zoraTestnet-uirxtXVm.js → zoraTestnet-CZflXjbY.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/index-Wf8RWpZ6.js +0 -2815
- package/assets/useManaRate-DAS3C4zo.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t as Z,s as i,e as a,J as X,aj as Ft,G as Lt,I as _,z as ut,H as
|
|
1
|
+
import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t as Z,s as i,e as a,J as X,aj as Ft,G as Lt,I as _,z as ut,H as Pe,m as Kt,ak as q,Q as Ye,n as Nt,u as Qt,al as Ut,E as Ot,am as Ht,an as Vt,ao as Gt,ap as Dt,y as Yt,aq as Je,ar as N,as as Xe,at as Jt,l as V,c as Ze,h as Xt,au as et,av as je,aw as ke,ax as oe,ay as tt,a as ce,b as Zt,C as $e,az as ea}from"./index-BnbwrW-6.js";import{M as ta,S as aa,C as sa,H as na,a as ia,T as ra,X as oa,b as ca,B as la,c as da,d as at,e as ua,f as he,P as ht,m as ha,g as pa,h as ga,i as xa,j as pt,k as pe,L as ma,l as fa,n as st,o as nt,W as ya,p as ba,q as va,A as Ca,r as wa,s as ja,t as ka,u as $a,v as Sa,w as Ma,x as Ta,y as za,z as Pa,D as Aa,E as Ia,F as qa,G as _a,I as Ba,J as Ea,K as Se,N as Ra,O as Wa,Q as Fa,R as La,U as it,V as Ka,Y as Na,Z as Qa,_ as Ua}from"./CollectionCarousel-Bns794gp.js";import{u as Oa}from"./useManaRate-DJlj41tJ.js";import{r as Ha}from"./mana-rate-CFfqtCHS.js";import{i as Va,j as Ga,f as Da,n as Ya,h as Ja,A as Xa}from"./authorizations-B6wWjXdQ.js";import{b as Me}from"./buy-D3hY4JG8.js";import{b as Za,w as es,S as ts,G as as}from"./buy-gasless-CmOMFX1L.js";import{u as ss,M as ns,R as le,r as is,c as rs}from"./useCreditPacks-DTZSsQrR.js";import{i as os,a as cs}from"./errors-BYKPLdNJ.js";import{E as ls}from"./ErrorNotice-Z0D8os9s.js";import{u as rt}from"./mana-convert-Bc7WVBn5.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-ZhCceq00.js";import"./sendMetaTransaction-DVALeVb8.js";const{colors:G,radius:ds}=Z,us=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
gap: 8px;
|
|
6
6
|
width: 100%;
|
|
7
|
-
`,
|
|
7
|
+
`,hs=i.span`
|
|
8
8
|
font-size: 16px;
|
|
9
9
|
line-height: 22px;
|
|
10
10
|
color: ${G.text2};
|
|
11
11
|
text-transform: capitalize;
|
|
12
12
|
white-space: nowrap;
|
|
13
|
-
`,
|
|
13
|
+
`,ps=i.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
gap: 8px;
|
|
@@ -34,14 +34,14 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
34
34
|
}
|
|
35
35
|
&::-webkit-scrollbar-thumb {
|
|
36
36
|
background: #a2a2a2;
|
|
37
|
-
border-radius: ${
|
|
37
|
+
border-radius: ${ds.btn};
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,gs=i.span`
|
|
40
40
|
margin-left: 8px;
|
|
41
41
|
font-size: 13px;
|
|
42
42
|
font-weight: 600;
|
|
43
43
|
color: ${G.muted};
|
|
44
|
-
`,
|
|
44
|
+
`,xs=i.div`
|
|
45
45
|
display: flex;
|
|
46
46
|
align-items: center;
|
|
47
47
|
justify-content: space-between;
|
|
@@ -58,7 +58,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${G.text};
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,ms="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/buy-error-22UunaPC.png";function fs(c){const{phase:d,balanceCredits:$,onClose:M}=c,B=d==="processing",W=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),F=d==="processing";return e.jsxs(ta,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(aa,{onClick:B?void 0:M,"aria-hidden":!0}),e.jsxs(sa,{"data-tall":F||void 0,children:[e.jsxs(na,{children:[e.jsxs(ia,{children:[e.jsx(ra,{children:W}),!B&&e.jsx(oa,{onClick:M,"aria-label":a("buyModal.close"),children:e.jsx(ca,{})})]}),e.jsxs(la,{children:[e.jsx(da,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(at,{}),e.jsx(ua,{children:X($)})]})]}),d==="choose"&&e.jsxs(he,{children:[e.jsxs(xs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(at,{}),X(c.totalCredits??0)]})]}),e.jsx(ht,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const P=ha(c.totalCents??0,c.totalManaWei??0n);return P!=null?a("buyModal.manaRate",{mana:P.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(ys,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),d==="nofunds"&&e.jsx(bs,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:M}),d==="error"&&e.jsxs(he,{children:[e.jsxs(pa,{"data-testid":"buy-error",children:[e.jsx(ga,{src:ms,alt:"",width:64,height:80}),e.jsxs(xa,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs(pt,{children:[e.jsx(pe,{"data-variant":"outline",onClick:M,children:a("buyModal.cancel")}),e.jsx(pe,{"data-variant":"purple",onClick:c.onRetry??M,children:a("cartCheckout.tryAgain")})]})]})]})]})}function ys({stage:c,step:d,total:$,isSelfCustody:M}){const B=c==="reserving",W=$>0?Math.min(100,Math.round(d/$*100)):0,F=c==="awaiting-signature"?M?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):c==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(he,{"data-processing":!0,children:[e.jsx(ma,{src:Ft,alt:"",width:61,height:61}),e.jsx(fa,{children:F}),B?e.jsxs(us,{children:[e.jsx(st,{"aria-hidden":!0,children:e.jsx(nt,{"data-step":!0,style:{width:`${W}%`}})}),$>1?e.jsxs(hs,{children:[d,"/",$]}):null]}):e.jsx(st,{"aria-hidden":!0,children:e.jsx(nt,{})})]})}function bs({lines:c,shortfallCredits:d,packs:$,selectedPack:M,onSelectPack:B,onBuyPacks:W,onCancel:F}){const P=$.find(n=>n.id===M),xe=c.reduce((n,I)=>n+(I.quantity??1),0);return e.jsxs(he,{children:[e.jsxs(ya,{"data-testid":"nofunds-warning",children:[e.jsx(ba,{}),e.jsxs(va,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:xe})]})]}),e.jsx(ps,{children:c.map(n=>{const I=n.quantity??1;return e.jsxs(Ca,{children:[e.jsx(wa,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(ja,{children:[e.jsxs("div",{children:[e.jsxs(ka,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),I>1?e.jsx(gs,{children:a("cartCheckout.qty",{count:I})}):null]}),n.item.creator?e.jsx($a,{address:n.item.creator}):null]}),e.jsxs(Sa,{children:[e.jsx(Ma,{}),e.jsx("span",{children:X(n.priceCredits*I)})]})]})]},n.item.id)})}),e.jsx(Ta,{children:$.map(n=>{const I=n.id===M;return e.jsxs(za,{"data-testid":"credit-pack","data-on":I||void 0,onClick:()=>B(n.id),children:[e.jsx(Pa,{}),e.jsx(Aa,{children:X(n.credits)}),e.jsxs(Ia,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(qa,{children:[e.jsxs(_a,{children:[e.jsx(Ba,{}),e.jsx("span",{children:X((P==null?void 0:P.credits)??0)})]}),e.jsxs(Ea,{children:["$",((P==null?void 0:P.usd)??0).toFixed(2)]})]}),e.jsxs(pt,{children:[e.jsx(pe,{"data-variant":"outline",onClick:F,children:a("buyModal.cancel")}),e.jsx(pe,{"data-variant":"gradient",onClick:W,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:gt,radius:Q}=Z,xt="@media (max-width: 1080px)",k="@media (max-width: 880px)",ot=i.div`
|
|
62
62
|
max-width: 1510px;
|
|
63
63
|
margin: 0 auto;
|
|
64
64
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -98,7 +98,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
98
98
|
${k} {
|
|
99
99
|
display: none;
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,vs=i.div`
|
|
102
102
|
display: grid;
|
|
103
103
|
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
104
|
gap: 24px;
|
|
@@ -120,12 +120,12 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
120
120
|
the bottom of it — a floor here would only add empty gray. */
|
|
121
121
|
min-height: 0;
|
|
122
122
|
}
|
|
123
|
-
`,
|
|
123
|
+
`,Cs=i.div`
|
|
124
124
|
min-width: 0;
|
|
125
125
|
display: flex;
|
|
126
126
|
flex-direction: column;
|
|
127
127
|
gap: 12px;
|
|
128
|
-
`,
|
|
128
|
+
`,ws=i.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
align-items: center;
|
|
131
131
|
justify-content: space-between;
|
|
@@ -147,7 +147,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
147
147
|
${k} {
|
|
148
148
|
padding: 16px;
|
|
149
149
|
}
|
|
150
|
-
`,
|
|
150
|
+
`,js=i(mt)`
|
|
151
151
|
display: flex;
|
|
152
152
|
flex-direction: column;
|
|
153
153
|
align-items: center;
|
|
@@ -162,13 +162,13 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
162
162
|
min-height: 320px;
|
|
163
163
|
padding: 32px 16px;
|
|
164
164
|
}
|
|
165
|
-
`,
|
|
165
|
+
`,ks=i.div`
|
|
166
166
|
display: flex;
|
|
167
167
|
flex-direction: column;
|
|
168
168
|
align-items: center;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding-bottom: 16px;
|
|
171
|
-
|
|
171
|
+
`,$s=i.p`
|
|
172
172
|
margin: 0;
|
|
173
173
|
font-size: 24px;
|
|
174
174
|
font-weight: 700;
|
|
@@ -177,7 +177,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
177
177
|
${Z.media.maxWidth("mobile")} {
|
|
178
178
|
font-size: 20px;
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
`,Ss=i.p`
|
|
181
181
|
margin: 0;
|
|
182
182
|
font-size: 20px;
|
|
183
183
|
font-weight: 400;
|
|
@@ -186,7 +186,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
186
186
|
${Z.media.maxWidth("mobile")} {
|
|
187
187
|
font-size: 16px;
|
|
188
188
|
}
|
|
189
|
-
`,
|
|
189
|
+
`,Ms=i(ge)`
|
|
190
190
|
display: inline-flex;
|
|
191
191
|
align-items: center;
|
|
192
192
|
justify-content: center;
|
|
@@ -194,7 +194,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
194
194
|
max-width: 100%;
|
|
195
195
|
height: 56px;
|
|
196
196
|
padding: 0 12px;
|
|
197
|
-
border-radius: ${
|
|
197
|
+
border-radius: ${Q.card};
|
|
198
198
|
background: ${o.accent};
|
|
199
199
|
color: ${o.softWhite};
|
|
200
200
|
font-size: 15px;
|
|
@@ -212,7 +212,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
212
212
|
outline: 2px solid ${o.accent};
|
|
213
213
|
outline-offset: 2px;
|
|
214
214
|
}
|
|
215
|
-
`,
|
|
215
|
+
`,Ts=i.button`
|
|
216
216
|
display: none;
|
|
217
217
|
|
|
218
218
|
${k} {
|
|
@@ -230,7 +230,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
230
230
|
height: 20px;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
`,
|
|
233
|
+
`,zs=i.h1`
|
|
234
234
|
margin: 0;
|
|
235
235
|
font-size: 14px;
|
|
236
236
|
font-weight: 600;
|
|
@@ -250,7 +250,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
250
250
|
height: 40px;
|
|
251
251
|
padding: 0 12px;
|
|
252
252
|
border: 2px solid transparent;
|
|
253
|
-
border-radius: ${
|
|
253
|
+
border-radius: ${Q.btn};
|
|
254
254
|
background:
|
|
255
255
|
linear-gradient(${o.white}, ${o.white}) padding-box,
|
|
256
256
|
${gt.amethyst} border-box;
|
|
@@ -282,18 +282,18 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
282
282
|
padding: 0 10px;
|
|
283
283
|
font-size: 12px;
|
|
284
284
|
}
|
|
285
|
-
`,
|
|
285
|
+
`,As=i.div`
|
|
286
286
|
display: flex;
|
|
287
287
|
flex-direction: column;
|
|
288
288
|
gap: 24px;
|
|
289
|
-
`,
|
|
289
|
+
`,Is=i.div`
|
|
290
290
|
position: relative;
|
|
291
291
|
display: flex;
|
|
292
292
|
align-items: stretch;
|
|
293
293
|
gap: 12px;
|
|
294
294
|
background: ${o.white};
|
|
295
295
|
border: 1px solid ${o.gray4};
|
|
296
|
-
border-radius: ${
|
|
296
|
+
border-radius: ${Q.card};
|
|
297
297
|
overflow: hidden;
|
|
298
298
|
|
|
299
299
|
&[data-unavailable] [data-thumb] {
|
|
@@ -305,13 +305,13 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
305
305
|
&[data-unavailable] [data-desc] {
|
|
306
306
|
opacity: 0.7;
|
|
307
307
|
}
|
|
308
|
-
`,
|
|
308
|
+
`,qs=i.div`
|
|
309
309
|
position: relative;
|
|
310
310
|
flex-shrink: 0;
|
|
311
311
|
width: 137.5px;
|
|
312
312
|
height: 137px;
|
|
313
313
|
background: ${o.media};
|
|
314
|
-
border-radius: ${
|
|
314
|
+
border-radius: ${Q.card};
|
|
315
315
|
display: grid;
|
|
316
316
|
place-items: center;
|
|
317
317
|
overflow: hidden;
|
|
@@ -327,12 +327,12 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
327
327
|
width: 120px;
|
|
328
328
|
height: 120px;
|
|
329
329
|
}
|
|
330
|
-
`,
|
|
330
|
+
`,_s=i(ge)`
|
|
331
331
|
position: absolute;
|
|
332
332
|
inset: 0;
|
|
333
333
|
display: grid;
|
|
334
334
|
place-items: center;
|
|
335
|
-
`,
|
|
335
|
+
`,Bs=i.span`
|
|
336
336
|
position: absolute;
|
|
337
337
|
top: 7.5px;
|
|
338
338
|
left: 7.5px;
|
|
@@ -342,7 +342,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
342
342
|
background: #34ce77;
|
|
343
343
|
display: grid;
|
|
344
344
|
place-items: center;
|
|
345
|
-
`,
|
|
345
|
+
`,Es=i.div`
|
|
346
346
|
flex: 1;
|
|
347
347
|
min-width: 0;
|
|
348
348
|
display: flex;
|
|
@@ -354,13 +354,13 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
354
354
|
${k} {
|
|
355
355
|
padding: 12px 4px 12px 0;
|
|
356
356
|
}
|
|
357
|
-
`,
|
|
357
|
+
`,Rs=i.div`
|
|
358
358
|
display: flex;
|
|
359
359
|
flex-direction: column;
|
|
360
360
|
gap: 4px;
|
|
361
361
|
min-width: 0;
|
|
362
362
|
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
-
`,ft=
|
|
363
|
+
`,ft=Pe`
|
|
364
364
|
display: block;
|
|
365
365
|
font-size: 16px;
|
|
366
366
|
font-weight: 600;
|
|
@@ -382,11 +382,11 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
382
382
|
line-clamp: 2;
|
|
383
383
|
-webkit-box-orient: vertical;
|
|
384
384
|
}
|
|
385
|
-
`,
|
|
385
|
+
`,Ws=i.div`
|
|
386
386
|
${ft};
|
|
387
|
-
`,
|
|
387
|
+
`,Fs=i(ge)`
|
|
388
388
|
${ft};
|
|
389
|
-
`,
|
|
389
|
+
`,Ls=i(Lt)`
|
|
390
390
|
font-size: 10px;
|
|
391
391
|
line-height: 1.43;
|
|
392
392
|
color: ${o.muted};
|
|
@@ -398,7 +398,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
398
398
|
font-size: 10px;
|
|
399
399
|
line-height: 1.43;
|
|
400
400
|
}
|
|
401
|
-
`,
|
|
401
|
+
`,Ks=i.div`
|
|
402
402
|
display: flex;
|
|
403
403
|
align-items: center;
|
|
404
404
|
justify-content: space-between;
|
|
@@ -410,7 +410,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
410
410
|
gap: 8px;
|
|
411
411
|
padding: 6px;
|
|
412
412
|
border: 0.5px solid ${o.muted2};
|
|
413
|
-
border-radius: ${
|
|
413
|
+
border-radius: ${Q.pill};
|
|
414
414
|
`,dt=i.button`
|
|
415
415
|
display: grid;
|
|
416
416
|
place-items: center;
|
|
@@ -433,7 +433,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
433
433
|
line-height: 1.2;
|
|
434
434
|
color: ${o.text};
|
|
435
435
|
text-align: center;
|
|
436
|
-
`,
|
|
436
|
+
`,Us=i.div`
|
|
437
437
|
display: inline-flex;
|
|
438
438
|
align-items: center;
|
|
439
439
|
gap: 4px;
|
|
@@ -447,7 +447,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
447
447
|
${k} {
|
|
448
448
|
font-size: 20px;
|
|
449
449
|
}
|
|
450
|
-
`,
|
|
450
|
+
`,Os=i(ut)`
|
|
451
451
|
width: 24px;
|
|
452
452
|
height: 24px;
|
|
453
453
|
background: ${o.text};
|
|
@@ -456,20 +456,20 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
456
456
|
width: 20px;
|
|
457
457
|
height: 20px;
|
|
458
458
|
}
|
|
459
|
-
`,
|
|
459
|
+
`,Hs=i.span`
|
|
460
460
|
margin-left: 6px;
|
|
461
461
|
font-size: 14px;
|
|
462
462
|
font-weight: 500;
|
|
463
463
|
color: ${o.muted};
|
|
464
464
|
text-decoration: line-through;
|
|
465
|
-
`,
|
|
465
|
+
`,Vs=i.div`
|
|
466
466
|
position: absolute;
|
|
467
467
|
top: 9px;
|
|
468
468
|
right: 7px;
|
|
469
469
|
display: flex;
|
|
470
470
|
align-items: flex-start;
|
|
471
471
|
gap: 12px;
|
|
472
|
-
`,
|
|
472
|
+
`,Gs=i.span`
|
|
473
473
|
display: inline-flex;
|
|
474
474
|
align-items: center;
|
|
475
475
|
gap: 4px;
|
|
@@ -478,9 +478,9 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
478
478
|
line-height: 1;
|
|
479
479
|
text-transform: uppercase;
|
|
480
480
|
color: ${o.text2};
|
|
481
|
-
`,
|
|
481
|
+
`,Ds=i(_)`
|
|
482
482
|
color: #f48221;
|
|
483
|
-
`,
|
|
483
|
+
`,Ys=i(ge)`
|
|
484
484
|
font-size: 12px;
|
|
485
485
|
font-weight: 600;
|
|
486
486
|
line-height: 24px;
|
|
@@ -496,23 +496,23 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
496
496
|
outline: 2px solid ${o.accent};
|
|
497
497
|
outline-offset: 2px;
|
|
498
498
|
}
|
|
499
|
-
`,
|
|
499
|
+
`,Js=i.span`
|
|
500
500
|
align-self: flex-start;
|
|
501
501
|
display: inline-flex;
|
|
502
502
|
align-items: center;
|
|
503
503
|
gap: 4px;
|
|
504
504
|
padding: 2px 4px;
|
|
505
|
-
border-radius: ${
|
|
505
|
+
border-radius: ${Q.chip};
|
|
506
506
|
background: #f4e9ff;
|
|
507
507
|
font-size: 10px;
|
|
508
508
|
font-weight: 400;
|
|
509
509
|
line-height: 14px;
|
|
510
510
|
color: ${o.text};
|
|
511
|
-
`,
|
|
511
|
+
`,Xs=i(_)`
|
|
512
512
|
width: 11.31px;
|
|
513
513
|
height: 10.94px;
|
|
514
514
|
background: ${o.text};
|
|
515
|
-
`,yt=
|
|
515
|
+
`,yt=Pe`
|
|
516
516
|
display: grid;
|
|
517
517
|
place-items: center;
|
|
518
518
|
width: 24px;
|
|
@@ -528,7 +528,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
528
528
|
opacity: 0.5;
|
|
529
529
|
cursor: default;
|
|
530
530
|
}
|
|
531
|
-
`,
|
|
531
|
+
`,Zs=i.button`
|
|
532
532
|
${yt};
|
|
533
533
|
|
|
534
534
|
&:hover:not(:disabled) {
|
|
@@ -537,13 +537,13 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
537
537
|
&[data-on] {
|
|
538
538
|
color: ${o.dclRed};
|
|
539
539
|
}
|
|
540
|
-
`,
|
|
540
|
+
`,en=i.button`
|
|
541
541
|
${yt};
|
|
542
542
|
|
|
543
543
|
&:hover:not(:disabled) {
|
|
544
544
|
color: ${o.dclRed};
|
|
545
545
|
}
|
|
546
|
-
`,
|
|
546
|
+
`,tn=i.div`
|
|
547
547
|
display: flex;
|
|
548
548
|
gap: 20px;
|
|
549
549
|
margin-top: 16px;
|
|
@@ -556,7 +556,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
556
556
|
& .link:hover:not(:disabled) {
|
|
557
557
|
color: ${o.text};
|
|
558
558
|
}
|
|
559
|
-
`,
|
|
559
|
+
`,an=i.aside`
|
|
560
560
|
position: sticky;
|
|
561
561
|
top: 172px;
|
|
562
562
|
display: flex;
|
|
@@ -580,7 +580,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
580
580
|
border-radius: 16px 16px 0 0;
|
|
581
581
|
box-shadow: 0 -4px 20px rgba(22, 21, 24, 0.12);
|
|
582
582
|
}
|
|
583
|
-
`,
|
|
583
|
+
`,sn=i.h2`
|
|
584
584
|
margin: 0 0 24px;
|
|
585
585
|
padding-bottom: 16px;
|
|
586
586
|
border-bottom: 1px solid ${o.gray4};
|
|
@@ -592,28 +592,28 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
592
592
|
margin-bottom: 12px;
|
|
593
593
|
padding-bottom: 12px;
|
|
594
594
|
}
|
|
595
|
-
`,
|
|
595
|
+
`,nn=i.div`
|
|
596
596
|
display: flex;
|
|
597
597
|
flex-direction: column;
|
|
598
598
|
gap: 12px;
|
|
599
|
-
`,
|
|
599
|
+
`,rn=i.div`
|
|
600
600
|
display: flex;
|
|
601
601
|
align-items: flex-start;
|
|
602
602
|
justify-content: space-between;
|
|
603
603
|
gap: 12px;
|
|
604
|
-
`,
|
|
604
|
+
`,on=i.span`
|
|
605
605
|
font-size: 14px;
|
|
606
606
|
font-weight: 600;
|
|
607
607
|
line-height: 1.57;
|
|
608
608
|
color: ${o.muted1};
|
|
609
|
-
`,
|
|
609
|
+
`,cn=i.span`
|
|
610
610
|
display: inline-flex;
|
|
611
611
|
align-items: center;
|
|
612
612
|
gap: 8px;
|
|
613
613
|
font-size: 24px;
|
|
614
614
|
font-weight: 700;
|
|
615
615
|
color: ${o.text};
|
|
616
|
-
`,
|
|
616
|
+
`,ln=i.span`
|
|
617
617
|
display: flex;
|
|
618
618
|
flex-direction: column;
|
|
619
619
|
align-items: flex-end;
|
|
@@ -624,7 +624,7 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
624
624
|
font-weight: 400;
|
|
625
625
|
line-height: 1;
|
|
626
626
|
color: ${o.muted};
|
|
627
|
-
`;const
|
|
627
|
+
`;const dn=i(ut)`
|
|
628
628
|
width: 30px;
|
|
629
629
|
height: 30px;
|
|
630
630
|
background: ${o.text};
|
|
@@ -632,11 +632,11 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
632
632
|
mask-size: 24px 24px;
|
|
633
633
|
-webkit-mask-position: left center;
|
|
634
634
|
mask-position: left center;
|
|
635
|
-
`,
|
|
635
|
+
`,un=i.button`
|
|
636
636
|
width: 100%;
|
|
637
637
|
height: 56px;
|
|
638
638
|
border: 0;
|
|
639
|
-
border-radius: ${
|
|
639
|
+
border-radius: ${Q.btn};
|
|
640
640
|
background: ${gt.amethyst};
|
|
641
641
|
color: ${o.softWhite};
|
|
642
642
|
font-size: 15px;
|
|
@@ -658,14 +658,14 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
658
658
|
opacity: 0.6;
|
|
659
659
|
cursor: default;
|
|
660
660
|
}
|
|
661
|
-
`,bt=
|
|
661
|
+
`,bt=Pe`
|
|
662
662
|
margin: 0;
|
|
663
663
|
font-size: 13px;
|
|
664
664
|
`,de=i.p`
|
|
665
665
|
${bt};
|
|
666
|
-
`,
|
|
666
|
+
`,hn=i(ls)`
|
|
667
667
|
${bt};
|
|
668
|
-
`,
|
|
668
|
+
`,pn=i.div`
|
|
669
669
|
position: relative;
|
|
670
670
|
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
671
671
|
flex: 1 0 auto;
|
|
@@ -692,4 +692,4 @@ import{j as e,L as ge,r as S,b as Rt,a as Wt}from"./react-vyZjIDcS.js";import{t
|
|
|
692
692
|
& section {
|
|
693
693
|
margin-top: 0;
|
|
694
694
|
}
|
|
695
|
-
`;function Te(c){if(rs(c))return a("errors.rejected");const d=(c.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Jt.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const pn=12e4;function gn(c){const d=[];return c.unavailable.length&&d.push(a("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&d.push(a("cart.drop.own",{count:c.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Pe=c=>c.reduce((d,$)=>d+$.priceCredits*$.quantity,0),ue=c=>c.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function qn(){Nt({title:a("nav.cart"),noindex:!0});const c=q(t=>t.items),d=q(t=>t.remove),$=q(t=>t.increment),T=q(t=>t.decrement),B=q(t=>t.clear),W=q(t=>t.restore),F=q(t=>t.setFittingOpen),z=Ye(t=>t.items),xe=Ye(t=>t.toggle),{session:n,signIn:I}=Qt(),ee=as().packs.slice(0,ss);S.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const vt=c.some(t=>t.category!=="emote"),{data:me}=Kt({queryKey:["upsell-listings"],queryFn:()=>Zt({first:40}),staleTime:6e4}),{data:C}=Ut(n),m=Ot(),U=Rt(),{state:L}=Wt(),[Ct,D]=S.useState(null),[Ae,te]=S.useState(null),[wt,A]=S.useState(!1),[P,N]=S.useState(null),Ie=S.useRef(0),[p,b]=S.useState(null),{data:ae}=Ht(n),{data:Y}=Ua(!0),[fe,qe]=S.useState(""),J=S.useRef(null),_e=Vt(c),Be=t=>Je(_e[t.id]),ye=c.filter(Be),be=c.length>0&&ye.length===0,jt=ye.reduce((t,s)=>t+s.priceCredits*s.quantity,0),kt=c.reduce((t,s)=>t+s.quantity,0),$t=ye.reduce((t,s)=>t+s.quantity,0),Ee=P?P.liveTotalCredits:jt,St=new Set(c.map(t=>t.id)),Re=((me==null?void 0:me.items)??[]).filter(t=>!St.has(t.id)).slice(0,12),Mt=new Map(P==null?void 0:P.buyable.map(t=>[t.item.id,t])),se=(C==null?void 0:C.credits)??0,ve=Ee*10,Tt=Y?rt(ve,Y):0n,ne=Se({priceCents:ve,priceManaWei:Tt,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:ae??0n}),Pt=Yt;function ie(t){t(),N(null),te(null),D(null)}function zt(){b(null),A(!1)}function We(t){const s=Pe(t),l=Math.max(0,s-se),r=ee.find(u=>u.credits>=l)??ee[ee.length-1];qe(r.id),Q("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:se,shortfall:l}),b({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),A(!1)}async function Ce(t){if(!n||t.length===0)return;const s=ue(t),l=s.map(x=>({...x.item,priceCredits:x.priceCredits})),r=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),u=[];let h="authorize",f=!1;b({phase:"processing",stage:"reserving",step:1,total:s.length});try{const x=[];for(let j=0;j<s.length;j++){const v=s[j];b({phase:"processing",stage:"reserving",step:j+1,total:s.length});try{const{credit:w,maxCreditedValue:H}=await et(n.identity,v.usdCents,v.trade.id);u.push(w.id),x.push({trade:v.trade,credits:[w],maxCreditedValue:H})}catch(w){if(os(w)){if(u.length){try{await je(n.identity,u)}catch(H){V(H,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}We(t);return}throw w}}h="submit";const M=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let y=[];if(Ha())try{y=await Xa({purchases:x,buyer:n.address,signer:n.signer,onSigned:M});const v=(await Promise.allSettled(y.map(w=>Za(w)))).flatMap(w=>w.status==="rejected"?[w.reason]:[]);if(v.length&&!v.some(w=>w instanceof es))throw v[0];f=!0}catch(j){if(!(j instanceof ts))throw j;y=await Me({purchases:x,buyer:n.address,signer:n.signer,onSigned:M})}else y=await Me({purchases:x,buyer:n.address,signer:n.signer});t.forEach(j=>d(j.item.id)),N(null),Q("Shop Completed Purchase",{...ke(l),payment_type:"credits",no_crypto_step:f,transaction_hash:y[0]??null}),La(m);const g=J.current;J.current=null,b(null),A(!1);const R={items:r,txHash:y[0]??void 0,settled:!0,...g?{creditsAdded:g}:{}};U("/success",{state:R,replace:!0})}catch(x){if(oe(x)||V(x,{flow:"cart_checkout",step:h,cart_size:t.length}),Q(oe(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:tt(x),value_usd:Xe(l.reduce((M,y)=>M+y.priceCredits,0)),cart_size:s.length}),u.length){try{await je(n.identity,u)}catch(M){V(M,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}b({phase:"error",message:Te(x)})}}function Fe(t,s){m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["detail-trade"]}),m.invalidateQueries({queryKey:["shop-item"]}),m.invalidateQueries({queryKey:["owned-token"]}),m.invalidateQueries({queryKey:["public-token"]}),m.invalidateQueries({queryKey:["item-resales"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["purchases"]}),m.invalidateQueries({queryKey:["owned-item-count"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]});const l=J.current;J.current=null,b(null),A(!1);const r={items:t,txHash:s[0]??void 0,settled:!0,...l?{creditsAdded:l}:{}};U("/success",{state:r,replace:!0})}function Le(t,s){oe(t)||V(t,{flow:s,step:"submit"}),Q(oe(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(t)}),b({phase:"error",message:Te(t)}),A(!1)}async function At(t,s){const l=ce($e.MANAToken,s),r=ce($e.CreditsManager,s);await Ya({auth:{kind:Ja.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:s},signer:t})}async function Ne(){if(Y)return Y;try{return await m.fetchQuery({queryKey:["mana-rate",Ze.chainId],queryFn:()=>Oa(Ze.chainId),staleTime:6e4})}catch{return}}async function It(t){const s=ue(t).reduce((h,f)=>h+f.usdCents,0),r=(ae??0n)>0n?await Ne():Y,u=r?rt(s,r):0n;return{totalCents:s,manaWei:u}}async function Qe(t,s){const l=Pe(t),{totalCents:r,manaWei:u}=await It(t),h=Se({priceCents:r,priceManaWei:u,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:ae??0n});if(s&&h.options.some(f=>f.method===s)){if(s==="credits"){Ce(t);return}const{spender:f,chainId:x}=Ke(s,t);await Ue(f,x,()=>s==="mana"?void Oe(t):void He(t,r,u));return}if(h.options.some(f=>f.method==="mana"||f.method==="combined")){b({phase:"choose",lines:t,totalCents:r,manaWei:u}),A(!1);return}if(C!=null&&C.credits<l){We(t);return}Ce(t)}function qt(t){return Se({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:ae??0n})}const[we,re]=S.useState(null);function Ke(t,s){const l=s[0].trade;return{spender:t==="mana"?ce(Xt(l.contract),l.chainId).address:ce($e.CreditsManager,l.chainId).address,chainId:l.chainId}}async function Ue(t,s,l){const r=Va(s,t),u=n?await Ga(r,n.address).catch(()=>!0):!0;if(Da(n==null?void 0:n.providerType,u)){A(!1),re({auth:r,run:l});return}l()}function _t(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:s,totalCents:l,manaWei:r}=p;if(t==="credits"){Ce(s);return}const{spender:u,chainId:h}=Ke(t,s);Ue(u,h,()=>t==="mana"?void Oe(s):void He(s,l,r))}async function Oe(t){if(!n||t.length===0)return;const s=ue(t),l=s.map(h=>({...h.item,priceCredits:h.priceCredits})),r=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await Na({trades:s.map(f=>f.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(f=>d(f.item.id)),N(null),Q("Shop Completed Purchase",{...ke(l),payment_type:"mana",transaction_hash:h[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Fe(r,h)}catch(h){Le(h,"buy_cart_mana")}}async function He(t,s,l){if(!n||t.length===0)return;const r=ue(t),u=r.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),f=Qa(r.map(g=>g.usdCents),(C==null?void 0:C.balanceCents)??0),x=f.reduce((g,R)=>g+R,0),M=Ka(Math.max(0,s-x),s,l),y=[];b({phase:"processing",stage:"reserving",step:1,total:r.length});try{const g=[];for(let v=0;v<r.length;v++){const w=f[v];if(w<=0)continue;b({phase:"processing",stage:"reserving",step:v+1,total:r.length});const{credit:H,maxCreditedValue:Et}=await et(n.identity,w,r[v].trade.id);y.push(H.id),g.push({trade:r[v].trade,credits:[H],maxCreditedValue:Et})}r.forEach((v,w)=>{f[w]<=0&&g.push({trade:v.trade,credits:[],maxCreditedValue:"0"})}),g[0]={...g[0],maxCreditedValue:(BigInt(g[0].maxCreditedValue)+M).toString()},await At(n.signer,r[0].trade.chainId);const R=()=>b({phase:"processing",stage:"settling",step:r.length,total:r.length});b({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const j=await Me({purchases:g,buyer:n.address,signer:n.signer,onSigned:R});t.forEach(v=>d(v.item.id)),N(null),Q("Shop Completed Purchase",{...ke(u),payment_type:"credits_and_mana",transaction_hash:j[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Fe(h,j)}catch(g){y.length&&(je(n.identity,y).catch(()=>{}),m.invalidateQueries({queryKey:["usd-balance"]})),Le(g,"buy_cart_combined")}}async function O(t){if(!n){it({type:"cart-checkout"}),I();return}const s=q.getState().items.filter(Be);if(s.length===0)return;D(null),te(null),A(!0);const l=s.reduce((r,u)=>r+u.priceCredits*u.quantity,0);Q("Shop Started Checkout",{cart_size:s.length,cart_value_credits:l,cart_value_usd:Xe(l),has_sufficient_credits:se>=l});try{const r=await ns(s,n.address,Pt,await Ne()),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(h=>d(h.id)),te(gn(r))),r.buyable.length===0){D(a("cart.error.noneAvailable")),N(null);return}if(r.orderChanged){N(r),Ie.current=Date.now();return}await Qe(r.buyable,t)}catch(r){V(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),D(Te(r))}finally{A(!1)}}async function Ve(){if(P){if(!n){it({type:"cart-checkout"}),I();return}if(Date.now()-Ie.current>pn){N(null),te(null),await O();return}D(null),Qe(P.buyable)}}async function Bt(){if(fe){try{sessionStorage.setItem(le,JSON.stringify(q.getState().items))}catch{}A(!0);try{const t=await is(fe,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}U("/credits")}catch(t){try{sessionStorage.removeItem(le)}catch{}V(t,{flow:"cart_buy_credits"}),b({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{A(!1)}}}const Ge=S.useRef(!1);S.useEffect(()=>{if(!n||Ge.current||!Ea("cart-checkout"))return;Ge.current=!0;const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[n]);const De=S.useRef(!1);S.useEffect(()=>{if(!(L!=null&&L.resumeCheckout)||De.current)return;De.current=!0,J.current=L.creditsAdded??null;try{const s=sessionStorage.getItem(le);if(s){sessionStorage.removeItem(le);const l=JSON.parse(s);Array.isArray(l)&&l.length&&W(l)}}catch{}m.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[L==null?void 0:L.resumeCheckout]);const E=wt||(p==null?void 0:p.phase)==="processing";return c.length===0&&!p?e.jsx(ot,{children:e.jsxs(lt,{children:[e.jsxs(ct,{onClick:()=>U(-1),type:"button",children:[e.jsx(_,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(ws,{"data-testid":"cart-empty",children:[e.jsx(_,{name:"cart-plus",size:110}),e.jsxs(js,{children:[e.jsx(ks,{children:a("cart.empty.title")}),e.jsx($s,{children:a("cart.empty.body")})]}),e.jsx(Ss,{to:"/assets",children:a("cart.empty.cta")})]})]})}):e.jsxs(ot,{children:[e.jsxs(lt,{children:[e.jsxs(ct,{onClick:()=>U(-1),type:"button",children:[e.jsx(_,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(bs,{children:[e.jsxs(vs,{children:[e.jsxs(Cs,{children:[e.jsx(Ms,{onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(_,{name:"arrow-left"})}),e.jsx(Ts,{children:a("cart.panelTitle",{count:kt})}),vt?e.jsxs(Ps,{onClick:()=>F(!0),disabled:E,children:[e.jsx(_,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(mt,{children:[e.jsx(zs,{children:c.map(t=>{const s=Mt.get(t.id),l=s?s.priceCredits:t.priceCredits,r=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,f=typeof t.available=="number"&&h>=t.available,x=l*h,M=!!z[t.id],y=Gt(t),g=_e[t.id],R=!Je(g),j=g==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(As,{"data-unavailable":R||void 0,children:[e.jsxs(Is,{"data-thumb":!0,children:[y?e.jsx(qs,{to:y,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(_s,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Bs,{children:[e.jsxs(Es,{"data-desc":!0,children:[y?e.jsx(Ws,{to:y,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Rs,{title:t.name,children:t.name}),t.creator?e.jsx(Fs,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(Ys,{"data-testid":"cart-creator-tag",children:[e.jsx(Js,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Ls,{children:R?e.jsxs(e.Fragment,{children:[e.jsxs(Vs,{children:[e.jsx(Gs,{name:"warning-fill",size:24}),j]}),y?e.jsx(Ds,{to:y,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Ns,{children:[e.jsx(dt,{onClick:()=>ie(()=>T(t.id)),disabled:E||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(Qs,{children:h}),e.jsx(dt,{onClick:()=>ie(()=>$(t.id)),disabled:E||f,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(Ks,{children:[e.jsx(Us,{})," ",x,r?e.jsx(Os,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(Hs,{children:[e.jsx(Xs,{"data-on":M||void 0,onClick:()=>xe(t),"aria-label":M?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:M?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(_,{name:M?"heart-solid":"heart"})}),e.jsx(Zs,{onClick:()=>ie(()=>d(t.id)),disabled:E,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(_,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(en,{children:e.jsx("button",{className:"link",onClick:()=>ie(B),disabled:E,children:a("cart.clearCart")})})]})]}),e.jsxs(tn,{children:[e.jsx(an,{children:a("cart.purchaseSummary")}),e.jsxs(sn,{children:[e.jsxs(nn,{children:[e.jsx(rn,{children:a("cart.totalItems",{count:$t})}),e.jsx(cn,{children:e.jsxs(on,{children:[e.jsx(ln,{})," ",Ee]})})]}),ne.options.length>0||ne.manaShortfall?e.jsx(ht,{options:ne.options,totalCents:ve,shortfall:ne.manaShortfall,creditsLabel:P?a("marketCheckout.confirmPurchase"):a("cart.buyWithCredits"),busy:E||be,onPay:t=>void(P?Ve():O(t))}):e.jsx(dn,{onClick:()=>void(P?Ve():O()),disabled:E||be,children:E?a("cart.working"):P?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),be?e.jsx(de,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(de,{className:"muted",children:a("cart.signInHint")}),P?e.jsx(de,{className:"muted",children:a("cart.priceChanged")}):null,Ae?e.jsx(de,{className:"muted",children:Ae}):null,e.jsx(un,{message:Ct})]})]})]})]}),Re.length>0?e.jsx(hn,{children:e.jsx(Ra,{title:a("cart.youMightAlsoLike"),items:Re})}):null,we&&n?e.jsx(Wa,{auth:we.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Fa,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=we;re(null),t()},onCancel:()=>re(null),onClose:()=>re(null)}):null,p?e.jsx(ms,{phase:p.phase,balanceCredits:se,onClose:zt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:Dt(n==null?void 0:n.providerType),options:p.phase==="choose"?qt(p).options:void 0,onPay:_t,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Pe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ee,selectedPack:fe,onSelectPack:qe,onBuyPacks:()=>void Bt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void O()}):null]})}export{qn as Cart};
|
|
695
|
+
`;function Te(c){if(os(c))return a("errors.rejected");const d=(c.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Xt.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const gn=12e4;function xn(c){const d=[];return c.unavailable.length&&d.push(a("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&d.push(a("cart.drop.own",{count:c.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const ze=c=>c.reduce((d,$)=>d+$.priceCredits*$.quantity,0),ue=c=>c.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function _n(){Kt({title:a("nav.cart"),noindex:!0});const c=q(t=>t.items),d=q(t=>t.remove),$=q(t=>t.increment),M=q(t=>t.decrement),B=q(t=>t.clear),W=q(t=>t.restore),F=q(t=>t.setFittingOpen),P=Ye(t=>t.items),xe=Ye(t=>t.toggle),{session:n,signIn:I}=Nt(),ee=ss().packs.slice(0,ns);S.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const vt=c.some(t=>t.category!=="emote"),{data:me}=Qt({queryKey:["upsell-listings"],queryFn:()=>ea({first:40}),staleTime:6e4}),{data:v}=Ut(n),m=Ot(),U=Rt(),{state:L}=Wt(),[Ct,D]=S.useState(null),[Ae,te]=S.useState(null),[wt,A]=S.useState(!1),[T,K]=S.useState(null),Ie=S.useRef(0),[p,b]=S.useState(null),{data:ae}=Ht(n),{data:Y}=Oa(!0),[fe,qe]=S.useState(""),J=S.useRef(null),_e=Vt(c),Be=t=>Je(_e[t.id]),ye=c.filter(Be),be=c.length>0&&ye.length===0,jt=ye.reduce((t,s)=>t+s.priceCredits*s.quantity,0),kt=c.reduce((t,s)=>t+s.quantity,0),$t=ye.reduce((t,s)=>t+s.quantity,0),Ee=T?T.liveTotalCredits:jt,St=new Set(c.map(t=>t.id)),Re=((me==null?void 0:me.items)??[]).filter(t=>!St.has(t.id)).slice(0,12),Mt=new Map(T==null?void 0:T.buyable.map(t=>[t.item.id,t])),se=(v==null?void 0:v.credits)??0,ve=Ee*10,Tt=Y?rt(ve,Y):0n,ne=Se({priceCents:ve,priceManaWei:Tt,balanceCents:(v==null?void 0:v.balanceCents)??0,manaBalanceWei:ae??0n}),zt=Jt;function ie(t){t(),K(null),te(null),D(null)}function Pt(){b(null),A(!1)}function We(t){const s=ze(t),l=Math.max(0,s-se),r=ee.find(u=>u.credits>=l)??ee[ee.length-1];qe(r.id),N("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:se,shortfall:l}),b({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),A(!1)}async function Ce(t){if(!n||t.length===0)return;const s=ue(t),l=s.map(x=>({...x.item,priceCredits:x.priceCredits})),r=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),u=[];let h="authorize",f=!1;b({phase:"processing",stage:"reserving",step:1,total:s.length});try{const x=[];for(let j=0;j<s.length;j++){const y=s[j];b({phase:"processing",stage:"reserving",step:j+1,total:s.length});try{const{credit:w,maxCreditedValue:H}=await et(n.identity,y.usdCents,y.trade.id);u.push(w.id),x.push({trade:y.trade,credits:[w],maxCreditedValue:H})}catch(w){if(cs(w)){if(u.length){try{await je(n.identity,u)}catch(H){V(H,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}We(t);return}throw w}}h="submit";const z=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let C=[];if(Va())try{C=await Za({purchases:x,buyer:n.address,signer:n.signer,onSigned:z});const y=(await Promise.allSettled(C.map(w=>es(w)))).flatMap(w=>w.status==="rejected"?[w.reason]:[]);if(y.length&&!y.some(w=>w instanceof ts))throw y[0];f=!0}catch(j){if(!(j instanceof as))throw j;C=await Me({purchases:x,buyer:n.address,signer:n.signer,onSigned:z})}else C=await Me({purchases:x,buyer:n.address,signer:n.signer});t.forEach(j=>d(j.item.id)),K(null),N("Shop Completed Purchase",{...ke(l),payment_type:"credits",no_crypto_step:f,transaction_hash:C[0]??null}),Ka(m);const g=J.current;J.current=null,b(null),A(!1);const R={items:r,txHash:C[0]??void 0,settled:!0,...g?{creditsAdded:g}:{}};U("/success",{state:R,replace:!0})}catch(x){if(oe(x)||V(x,{flow:"cart_checkout",step:h,cart_size:t.length}),N(oe(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:tt(x),value_usd:Xe(l.reduce((z,C)=>z+C.priceCredits,0)),cart_size:s.length}),u.length){try{await je(n.identity,u)}catch(z){V(z,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}b({phase:"error",message:Te(x)})}}function Fe(t,s){m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["detail-trade"]}),m.invalidateQueries({queryKey:["shop-item"]}),m.invalidateQueries({queryKey:["owned-token"]}),m.invalidateQueries({queryKey:["public-token"]}),m.invalidateQueries({queryKey:["item-resales"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["purchases"]}),m.invalidateQueries({queryKey:["owned-item-count"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]});const l=J.current;J.current=null,b(null),A(!1);const r={items:t,txHash:s[0]??void 0,settled:!0,...l?{creditsAdded:l}:{}};U("/success",{state:r,replace:!0})}function Le(t,s){oe(t)||V(t,{flow:s,step:"submit"}),N(oe(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(t)}),b({phase:"error",message:Te(t)}),A(!1)}async function At(t,s){const l=ce($e.MANAToken,s),r=ce($e.CreditsManager,s);await Ja({auth:{kind:Xa.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:s},signer:t})}async function Ke(){if(Y)return Y;try{return await m.fetchQuery({queryKey:["mana-rate",Ze.chainId],queryFn:()=>Ha(Ze.chainId),staleTime:6e4})}catch{return}}async function It(t){const s=ue(t).reduce((h,f)=>h+f.usdCents,0),r=(ae??0n)>0n?await Ke():Y,u=r?rt(s,r):0n;return{totalCents:s,manaWei:u}}async function Ne(t,s){const l=ze(t),{totalCents:r,manaWei:u}=await It(t),h=Se({priceCents:r,priceManaWei:u,balanceCents:(v==null?void 0:v.balanceCents)??0,manaBalanceWei:ae??0n});if(s&&h.options.some(f=>f.method===s)){if(s==="credits"){Ce(t);return}const{spender:f,chainId:x}=Qe(s,t);await Ue(f,x,()=>s==="mana"?void Oe(t):void He(t,r,u));return}if(h.options.some(f=>f.method==="mana"||f.method==="combined")){b({phase:"choose",lines:t,totalCents:r,manaWei:u}),A(!1);return}if(v!=null&&v.credits<l){We(t);return}Ce(t)}function qt(t){return Se({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(v==null?void 0:v.balanceCents)??0,manaBalanceWei:ae??0n})}const[we,re]=S.useState(null);function Qe(t,s){const l=s[0].trade;return{spender:t==="mana"?ce(Zt(l.contract),l.chainId).address:ce($e.CreditsManager,l.chainId).address,chainId:l.chainId}}async function Ue(t,s,l){const r=Ga(s,t),u=n?await Da(r,n.address).catch(()=>!0):!0;if(Ya(n==null?void 0:n.providerType,u)){A(!1),re({auth:r,run:l});return}l()}function _t(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:s,totalCents:l,manaWei:r}=p;if(t==="credits"){Ce(s);return}const{spender:u,chainId:h}=Qe(t,s);Ue(u,h,()=>t==="mana"?void Oe(s):void He(s,l,r))}async function Oe(t){if(!n||t.length===0)return;const s=ue(t),l=s.map(h=>({...h.item,priceCredits:h.priceCredits})),r=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await Na({trades:s.map(f=>f.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(f=>d(f.item.id)),K(null),N("Shop Completed Purchase",{...ke(l),payment_type:"mana",transaction_hash:h[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Fe(r,h)}catch(h){Le(h,"buy_cart_mana")}}async function He(t,s,l){if(!n||t.length===0)return;const r=ue(t),u=r.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),f=Qa(r.map(g=>g.usdCents),(v==null?void 0:v.balanceCents)??0),x=f.reduce((g,R)=>g+R,0),z=Ua(Math.max(0,s-x),s,l),C=[];b({phase:"processing",stage:"reserving",step:1,total:r.length});try{const g=[];for(let y=0;y<r.length;y++){const w=f[y];if(w<=0)continue;b({phase:"processing",stage:"reserving",step:y+1,total:r.length});const{credit:H,maxCreditedValue:Et}=await et(n.identity,w,r[y].trade.id);C.push(H.id),g.push({trade:r[y].trade,credits:[H],maxCreditedValue:Et})}r.forEach((y,w)=>{f[w]<=0&&g.push({trade:y.trade,credits:[],maxCreditedValue:"0"})}),g[0]={...g[0],maxCreditedValue:(BigInt(g[0].maxCreditedValue)+z).toString()},await At(n.signer,r[0].trade.chainId);const R=()=>b({phase:"processing",stage:"settling",step:r.length,total:r.length});b({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const j=await Me({purchases:g,buyer:n.address,signer:n.signer,onSigned:R});t.forEach(y=>d(y.item.id)),K(null),N("Shop Completed Purchase",{...ke(u),payment_type:"credits_and_mana",transaction_hash:j[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Fe(h,j)}catch(g){C.length&&(je(n.identity,C).catch(()=>{}),m.invalidateQueries({queryKey:["usd-balance"]})),Le(g,"buy_cart_combined")}}async function O(t){if(!n){it({type:"cart-checkout"}),I();return}const s=q.getState().items.filter(Be);if(s.length===0)return;D(null),te(null),A(!0);const l=s.reduce((r,u)=>r+u.priceCredits*u.quantity,0);N("Shop Started Checkout",{cart_size:s.length,cart_value_credits:l,cart_value_usd:Xe(l),has_sufficient_credits:se>=l});try{const r=await is(s,n.address,zt,await Ke()),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(h=>d(h.id)),te(xn(r))),r.buyable.length===0){D(a("cart.error.noneAvailable")),K(null);return}if(r.orderChanged){K(r),Ie.current=Date.now();return}await Ne(r.buyable,t)}catch(r){V(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),D(Te(r))}finally{A(!1)}}async function Ve(){if(T){if(!n){it({type:"cart-checkout"}),I();return}if(Date.now()-Ie.current>gn){K(null),te(null),await O();return}D(null),Ne(T.buyable)}}async function Bt(){if(fe){try{sessionStorage.setItem(le,JSON.stringify(q.getState().items))}catch{}A(!0);try{const t=await rs(fe,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}U("/credits")}catch(t){try{sessionStorage.removeItem(le)}catch{}V(t,{flow:"cart_buy_credits"}),b({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{A(!1)}}}const Ge=S.useRef(!1);S.useEffect(()=>{if(!n||Ge.current||!Ra("cart-checkout"))return;Ge.current=!0;const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[n]);const De=S.useRef(!1);S.useEffect(()=>{if(!(L!=null&&L.resumeCheckout)||De.current)return;De.current=!0,J.current=L.creditsAdded??null;try{const s=sessionStorage.getItem(le);if(s){sessionStorage.removeItem(le);const l=JSON.parse(s);Array.isArray(l)&&l.length&&W(l)}}catch{}m.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[L==null?void 0:L.resumeCheckout]);const E=wt||(p==null?void 0:p.phase)==="processing";return c.length===0&&!p?e.jsx(ot,{children:e.jsxs(lt,{children:[e.jsxs(ct,{onClick:()=>U(-1),type:"button",children:[e.jsx(_,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(js,{"data-testid":"cart-empty",children:[e.jsx(_,{name:"cart-plus",size:110}),e.jsxs(ks,{children:[e.jsx($s,{children:a("cart.empty.title")}),e.jsx(Ss,{children:a("cart.empty.body")})]}),e.jsx(Ms,{to:"/assets",children:a("cart.empty.cta")})]})]})}):e.jsxs(ot,{children:[e.jsxs(lt,{children:[e.jsxs(ct,{onClick:()=>U(-1),type:"button",children:[e.jsx(_,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vs,{children:[e.jsxs(Cs,{children:[e.jsxs(ws,{children:[e.jsx(Ts,{onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(_,{name:"arrow-left"})}),e.jsx(zs,{children:a("cart.panelTitle",{count:kt})}),vt?e.jsxs(Ps,{onClick:()=>F(!0),disabled:E,children:[e.jsx(_,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(mt,{children:[e.jsx(As,{children:c.map(t=>{const s=Mt.get(t.id),l=s?s.priceCredits:t.priceCredits,r=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,f=typeof t.available=="number"&&h>=t.available,x=l*h,z=Gt(t),C=!!z&&!!P[z],g=Dt(t),R=_e[t.id],j=!Je(R),y=R==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Is,{"data-unavailable":j||void 0,children:[e.jsxs(qs,{"data-thumb":!0,children:[g?e.jsx(_s,{to:g,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Bs,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Es,{children:[e.jsxs(Rs,{"data-desc":!0,children:[g?e.jsx(Fs,{to:g,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Ws,{title:t.name,children:t.name}),t.creator?e.jsx(Ls,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(Js,{"data-testid":"cart-creator-tag",children:[e.jsx(Xs,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Ks,{children:j?e.jsxs(e.Fragment,{children:[e.jsxs(Gs,{children:[e.jsx(Ds,{name:"warning-fill",size:24}),y]}),g?e.jsx(Ys,{to:g,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Ns,{children:[e.jsx(dt,{onClick:()=>ie(()=>M(t.id)),disabled:E||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(Qs,{children:h}),e.jsx(dt,{onClick:()=>ie(()=>$(t.id)),disabled:E||f,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(Us,{children:[e.jsx(Os,{})," ",x,r?e.jsx(Hs,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(Vs,{children:[z?e.jsx(Zs,{"data-on":C||void 0,onClick:()=>xe(t),"aria-label":C?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:C?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(_,{name:C?"heart-solid":"heart"})}):null,e.jsx(en,{onClick:()=>ie(()=>d(t.id)),disabled:E,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(_,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(tn,{children:e.jsx("button",{className:"link",onClick:()=>ie(B),disabled:E,children:a("cart.clearCart")})})]})]}),e.jsxs(an,{children:[e.jsx(sn,{children:a("cart.purchaseSummary")}),e.jsxs(nn,{children:[e.jsxs(rn,{children:[e.jsx(on,{children:a("cart.totalItems",{count:$t})}),e.jsx(ln,{children:e.jsxs(cn,{children:[e.jsx(dn,{})," ",Ee]})})]}),ne.options.length>0||ne.manaShortfall?e.jsx(ht,{options:ne.options,totalCents:ve,shortfall:ne.manaShortfall,creditsLabel:T?a("marketCheckout.confirmPurchase"):a("cart.buyWithCredits"),busy:E||be,onPay:t=>void(T?Ve():O(t))}):e.jsx(un,{onClick:()=>void(T?Ve():O()),disabled:E||be,children:E?a("cart.working"):T?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),be?e.jsx(de,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(de,{className:"muted",children:a("cart.signInHint")}),T?e.jsx(de,{className:"muted",children:a("cart.priceChanged")}):null,Ae?e.jsx(de,{className:"muted",children:Ae}):null,e.jsx(hn,{message:Ct})]})]})]})]}),Re.length>0?e.jsx(pn,{children:e.jsx(Wa,{title:a("cart.youMightAlsoLike"),items:Re})}):null,we&&n?e.jsx(Fa,{auth:we.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:La,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=we;re(null),t()},onCancel:()=>re(null),onClose:()=>re(null)}):null,p?e.jsx(fs,{phase:p.phase,balanceCredits:se,onClose:Pt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:Yt(n==null?void 0:n.providerType),options:p.phase==="choose"?qt(p).options:void 0,onPay:_t,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?ze(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ee,selectedPack:fe,onSelectPack:qe,onBuyPacks:()=>void Bt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void O()}):null]})}export{_n as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as N,N as U,O as o,P as n,H as D,x as M}from"./index-
|
|
1
|
+
import{M as N,N as U,O as o,P as n,H as D,x as M}from"./index-BnbwrW-6.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-BRGjhjlu.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,af as J,ag as z,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as E,A as ie,ah as se,ai as ne}from"./index-
|
|
1
|
+
import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,af as J,ag as z,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as E,A as ie,ah as se,ai as ne}from"./index-BnbwrW-6.js";import{E as ce}from"./ErrorNotice-Z0D8os9s.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-B_NNL83E.js";import{u as ve}from"./useStore-HaFF1p2U.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-CX6i4K78.js";import{L as $e}from"./LoadMore-DI4Wyn-C.js";import{u as Pe}from"./useInfiniteGrid-DxkPmxZ9.js";import{G as Me}from"./grid.styles-Cflo-ZKg.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${v.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,J as j,
|
|
1
|
+
import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,J as j,bc as C,h as G,x as Y,I as Q,l as X,a as W,C as B,b as J,bd as Z,be as F,A as q}from"./index-BnbwrW-6.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-B6wWjXdQ.js";import{i as ie}from"./errors-BYKPLdNJ.js";import{E as oe}from"./ErrorNotice-Z0D8os9s.js";import{a as se}from"./buy-D3hY4JG8.js";import{g as re,d as ce}from"./trade-encoding-ZhCceq00.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-DVALeVb8.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|