@dcl/shop 0.1.0-30565861644.commit-86fa62d → 0.1.0-30631213700.commit-6a36b1d
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-YIu0M1Kf.js → Activity-9H_Nw9g2.js} +1 -1
- package/assets/{AnimatedBackground-BrxVl8X0.js → AnimatedBackground-Dl4OPt3I.js} +1 -1
- package/assets/{Assets-Dwlho6_C.js → Assets-hIVs4QX5.js} +7 -7
- package/assets/{Assets.styles-CfTWTkg9.js → Assets.styles-DxYgoIuy.js} +1 -1
- package/assets/{Authorizations-BMPo5lsC.js → Authorizations-7_r3pX8t.js} +1 -1
- package/assets/Cart-D0AduPfq.js +695 -0
- package/assets/{CircularProgress-BrgD7rFE.js → CircularProgress-4d3-DQmu.js} +1 -1
- package/assets/{Collection-wJlJYfNj.js → Collection-jJGlXbaI.js} +1 -1
- package/assets/{CollectionCarousel-Bns794gp.js → CollectionCarousel-Cf-VTi1F.js} +1 -1
- package/assets/{Creator-Bz4Ol9VJ.js → Creator-C7C3IC7M.js} +2 -2
- package/assets/{ErrorNotice-Z0D8os9s.js → ErrorNotice-B02EvdVc.js} +1 -1
- package/assets/{ExchangeController-DWJqUlaQ.js → ExchangeController-_mEAVfMP.js} +1 -1
- package/assets/{GetCredits-DaqSIDEt.js → GetCredits-DATwdND2.js} +97 -60
- package/assets/{HelpersUtil-BmEt66tk.js → HelpersUtil-B9-8MjrT.js} +1 -1
- package/assets/{ImportListings-tR_OXub1.js → ImportListings-Brvy0E2Q.js} +8 -8
- package/assets/{ItemDetail-n9hpow28.js → ItemDetail-iIR1rraN.js} +3 -3
- package/assets/{LoadMore-DI4Wyn-C.js → LoadMore-DmJy1HhZ.js} +1 -1
- package/assets/{MenuList-CYC3zRYf.js → MenuList-DaaQcK3Y.js} +1 -1
- package/assets/{MyAssets-CRBhFPGQ.js → MyAssets-BNDWBTvM.js} +1 -1
- package/assets/{MyFavorites-B6grtRZj.js → MyFavorites-DsQJRQwa.js} +1 -1
- package/assets/{NotFound-0L1xj8db.js → NotFound-DLfA3_kx.js} +1 -1
- package/assets/{NotificationsBell-B5Q9EIqa.js → NotificationsBell-BFpFtQ3R.js} +1 -1
- package/assets/{StoreSettings-CUyzwheq.js → StoreSettings-g8hG7Zop.js} +1 -1
- package/assets/Success-MIHHTcKK.js +276 -0
- package/assets/{SwapController-CP6wYtUi.js → SwapController-DR2uYAaA.js} +1 -1
- package/assets/{Tooltip-BbHzoPIy.js → Tooltip-gJZXgo0b.js} +1 -1
- package/assets/{TradeService-CbR5e6j8.js → TradeService-CY3xpaff.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-CAciSeGb.js → W3MFrameProviderSingleton-DSb_b_EZ.js} +3 -3
- package/assets/{WebCryptoP256-BJObUJ75.js → WebCryptoP256-CDxnkGVK.js} +1 -1
- package/assets/{authorizations-B6wWjXdQ.js → authorizations-BPcNtN-P.js} +1 -1
- package/assets/{basic-PrtqXBMx.js → basic-C5_ZcnK9.js} +1 -1
- package/assets/{biconomy-CXoNqd-Z.js → biconomy-CvmOdG97.js} +1 -1
- package/assets/{browseLayout.styles-B_NNL83E.js → browseLayout.styles-C9FVX_ZJ.js} +5 -5
- package/assets/{builder-DJzcrQAM.js → builder-CLIpwOL9.js} +1 -1
- package/assets/buy-B0vN0t4_.js +1 -0
- package/assets/{buy-gasless-CmOMFX1L.js → buy-gasless-DLYP_J55.js} +1 -1
- package/assets/{categories-CX6i4K78.js → categories-Ci0NfrXM.js} +1 -1
- package/assets/{ccip-Dd-dexDO.js → ccip-EF1o04u9.js} +1 -1
- package/assets/{ccip-w3FPfxqw.js → ccip-kyPwi4iD.js} +1 -1
- package/assets/{clsx-BRGjhjlu.js → clsx-CPW1aX4x.js} +2 -2
- package/assets/{controller-DwX-jKZc.js → controller-DC-xBsw3.js} +2 -2
- package/assets/{core-D2eU58P9.js → core-C7azBZfw.js} +4 -4
- package/assets/{createSvgIcon-BVcvIe2E.js → createSvgIcon-CE_QXUPt.js} +3 -3
- package/assets/{custom-C8kunAUg.js → custom-C7OSaKW8.js} +1 -1
- package/assets/{data-capture-5SXe7x0r.js → data-capture-D90UA04z.js} +1 -1
- package/assets/{email-Bn0Sv8j4.js → email-DdwMxrSu.js} +1 -1
- package/assets/{embedded-wallet-C8c_78Uv.js → embedded-wallet-CLTSxZAJ.js} +1 -1
- package/assets/{emotion-styled.browser.esm-3ejjGoWk.js → emotion-styled.browser.esm-C4PVOCRF.js} +1 -1
- package/assets/{engine-CNGw5SdF.js → engine-D-dAvXbf.js} +1 -1
- package/assets/{errors-BYKPLdNJ.js → errors-BSoF7pTC.js} +1 -1
- package/assets/{estimate-l1-fee-BrG1mArn.js → estimate-l1-fee-Cw86yh3k.js} +1 -1
- package/assets/{execute-BuBESW09.js → execute-CiNfIIwI.js} +2 -2
- package/assets/{features-DJEePSdY.js → features-CrsLW0vi.js} +1 -1
- package/assets/{fetchTokenMetadata-DbJ4fJYd.js → fetchTokenMetadata-DdYtEXX-.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-BVDQHXZz.js → get-ecosystem-wallet-info-B9Lyre9K.js} +1 -1
- package/assets/{getBalance-Dwa97iHq.js → getBalance-C-EmBEJE.js} +1 -1
- package/assets/{getNFT-KnOGHpCx.js → getNFT-BQlxSGM2.js} +1 -1
- package/assets/{getNFT-8vTqe5mx.js → getNFT-ytL1936_.js} +1 -1
- package/assets/{getThemeProps-BkCaIJdf.js → getThemeProps-BGg8uFXd.js} +1 -1
- package/assets/{grid.styles-Cflo-ZKg.js → grid.styles-DMgsxY7L.js} +1 -1
- package/assets/{hashTypedData-ByA_PXdL.js → hashTypedData-BasXuEvC.js} +1 -1
- package/assets/{hashTypedData-zHAZUnlP.js → hashTypedData-j5fdDs4Y.js} +1 -1
- package/assets/{import-Da_I6gAZ.js → import-Dm0CsIi0.js} +1 -1
- package/assets/{in-app-DAfU34Xj.js → in-app-BEVydnuY.js} +1 -1
- package/assets/{in-app-wallet-calls-C8MSEj6u.js → in-app-wallet-calls-BY3W5GQ0.js} +1 -1
- package/assets/{index-Dla9ohqE.js → index-1J_FpndO.js} +2 -2
- package/assets/{index-IEBvb9g0.js → index-8VXxtKF1.js} +1 -1
- package/assets/{index-CRiWMT-r.js → index-B13XAdNZ.js} +1 -1
- package/assets/{index-Azrqm6Av.js → index-B1aFfP1l.js} +1 -1
- package/assets/{index-I6AhOucd.js → index-B3KRDhro.js} +1 -1
- package/assets/{index-vQ_2c6zv.js → index-B7JR23Ob.js} +1 -1
- package/assets/{index-Ddw9OYjW.js → index-BAljEUxu.js} +1 -1
- package/assets/{index-Q9aqPNo3.js → index-BE79xpUL.js} +1 -1
- package/assets/{index-CzKTIGRh.js → index-BFDvoquz.js} +2 -2
- package/assets/{index-DX8GIl1w.js → index-BLchEKaw.js} +2 -2
- package/assets/{index-DJk-Gyy6.js → index-BO8tonq1.js} +1 -1
- package/assets/{index-DeUn3r_V.js → index-BO95Zc7f.js} +1 -1
- package/assets/{index-DWsuciPI.js → index-BOKR1ZSE.js} +1 -1
- package/assets/{index-CkshIr8A.js → index-BRa-XcLg.js} +1 -1
- package/assets/{index-SG2QR9w5.js → index-BSBIVFxM.js} +3 -3
- package/assets/{index-Kl09Ztwk.js → index-BUmLgBCF.js} +1 -1
- package/assets/{index-DTtN3FMo.js → index-B_OIhLt0.js} +1 -1
- package/assets/{index-MmxQtN7S.js → index-Be7WGkuv.js} +1 -1
- package/assets/{index-BnWc8jyR.js → index-BgUZsiWa.js} +1 -1
- package/assets/{index-D34PBlHH.js → index-BkTT5bsx.js} +1 -1
- package/assets/{index-CkqeusMi.js → index-BwKYmXD4.js} +1 -1
- package/assets/{index-DMlJeY00.js → index-C1XoasUk.js} +1 -1
- package/assets/{index-BCGTwY9C.js → index-C9UOpi9s.js} +1 -1
- package/assets/{index-CGd-1UpW.js → index-CBgMGilO.js} +1 -1
- package/assets/{index-B6EsaBwe.js → index-CQm9diQZ.js} +1 -1
- package/assets/{index-DQwfF15K.js → index-CVglB0vh.js} +1 -1
- package/assets/{index-Dltarl5j.js → index-CYLjPyy6.js} +1 -1
- package/assets/{index-1YMH7MTk.js → index-CaRubzmQ.js} +1 -1
- package/assets/{index-DTvh0ZYF.js → index-CcaSnuYK.js} +1 -1
- package/assets/{index-MBO4iF-x.js → index-Ce4-q8Tn.js} +1 -1
- package/assets/{index-Dl_EomMH.js → index-ChgR_gSr.js} +1 -1
- package/assets/{index-DhHGVFYf.js → index-Cm1rAYH-.js} +1 -1
- package/assets/{index-BkQsw_6m.js → index-CqHixIDx.js} +1 -1
- package/assets/{index-Bvsc2jDb.js → index-CtyORnm3.js} +1 -1
- package/assets/{index-BOei64ey.js → index-D4au8-Sv.js} +1 -1
- package/assets/{index-CSAUfzci.js → index-D8fCyz4G.js} +1 -1
- package/assets/{index-CgmlJw-S.js → index-DCMoy5ft.js} +1 -1
- package/assets/{index-DiUDVsbw.js → index-DCNmX8Jr.js} +3 -3
- package/assets/{index-CkzcSx5U.js → index-DSjn_4OZ.js} +1 -1
- package/assets/{index-BzmmiLep.js → index-D_M6bHMQ.js} +1 -1
- package/assets/{index-BRBJXQFj.js → index-Df6G0l6L.js} +3 -3
- package/assets/{index-CuYL-Baw.js → index-DjDUzcsH.js} +2 -2
- package/assets/{index-BnbwrW-6.js → index-DzVTWEvS.js} +252 -252
- package/assets/{index-CVY0sxwP.js → index-I1HziGSE.js} +1 -1
- package/assets/{index-CfiHgp7t.js → index-NfzBgkBr.js} +2 -2
- package/assets/{index-BFQ3WGPq.js → index-O4GwlnrF.js} +1 -1
- package/assets/{index-BKmu2o-E.js → index-RrRV6pR_.js} +1 -1
- package/assets/{index-CvD8tr1x.js → index-S4WGeB0l.js} +1 -1
- package/assets/{index-DmUPrDg1.js → index-g7wbqJm1.js} +1 -1
- package/assets/{index-BBHWbqVq.js → index-t2owpKkf.js} +1 -1
- package/assets/{index-DHNHHzGW.js → index-uOJSYwZG.js} +1 -1
- package/assets/{index.es-Dcl8xzFM.js → index.es-B3rSZSDt.js} +4 -4
- package/assets/{index.es-1Eex98-c.js → index.es-DM2qW0lw.js} +1 -1
- package/assets/{index.es-8mJw4ztI.js → index.es-Dienktq9.js} +1 -1
- package/assets/{localBatchGatewayRequest-DLZcpxp5.js → localBatchGatewayRequest-DuHrf2MN.js} +1 -1
- package/assets/{mana-convert-Bc7WVBn5.js → mana-convert-CHkCsdrS.js} +1 -1
- package/assets/{mana-rate-CFfqtCHS.js → mana-rate-Dt1fufbZ.js} +1 -1
- package/assets/{networks-C9v8SYzv.js → networks-KCk_6KCy.js} +1 -1
- package/assets/{onramp-vHeI0Bdi.js → onramp-DIsBeuYv.js} +1 -1
- package/assets/{openzeppelin-yMR9b1FL.js → openzeppelin-DNjbwrBL.js} +1 -1
- package/assets/{parseNft-DOgBlFyM.js → parseNft-BftD-FxK.js} +2 -2
- package/assets/{parseSignature-CCtT275H.js → parseSignature-BWVrkDRs.js} +3 -3
- package/assets/{parseSignature-B_BQDXEi.js → parseSignature-znC0lvc7.js} +1 -1
- package/assets/{passkeys-DC9ui3MW.js → passkeys-BJPRW0V_.js} +1 -1
- package/assets/{pay-with-exchange-DzS3VV5h.js → pay-with-exchange-oV9YjYRd.js} +1 -1
- package/assets/{qr-overlay-DBMFsWbT.js → qr-overlay-BYTSXp-R.js} +1 -1
- package/assets/{receive-DL6eap6Y.js → receive-DWXEUP1p.js} +1 -1
- package/assets/{resolveImplementation-CbIwAEHk.js → resolveImplementation-D6NoPFBv.js} +1 -1
- package/assets/{rpc-4rFMN8E0.js → rpc-BRol_aMy.js} +1 -1
- package/assets/{secp256k1-CJEeTac_.js → secp256k1-BIRnWaVR.js} +1 -1
- package/assets/{secp256k1-7K_lKgAG.js → secp256k1-DnitHy6K.js} +1 -1
- package/assets/{secp256k1-Cc-OBcqq.js → secp256k1-xEJ152PU.js} +1 -1
- package/assets/{send-LziflfC8.js → send-IjXisfbb.js} +1 -1
- package/assets/{send-batch-transaction-cPuMc9MS.js → send-batch-transaction-DPQqc2pa.js} +1 -1
- package/assets/{send-eip712-transaction-DrVlY4sm.js → send-eip712-transaction-D0KKXrDM.js} +2 -2
- package/assets/{send-gasless-transaction-C7GQuNPZ.js → send-gasless-transaction-DEZ5jsUe.js} +2 -2
- package/assets/{send-transaction-DsHae-07.js → send-transaction-DSWW1MHr.js} +2 -2
- package/assets/{sendMetaTransaction-DVALeVb8.js → sendMetaTransaction-Ci7WU1n2.js} +1 -1
- package/assets/{sendRawTransaction-BwoXNrfy.js → sendRawTransaction-BhLbtdw6.js} +3 -3
- package/assets/{serializeTransaction-HjwgZYgE.js → serializeTransaction-BpvjoWlt.js} +1 -1
- package/assets/{session-proposal-D2B7jyYw.js → session-proposal-CySo5Ayx.js} +1 -1
- package/assets/{session-request-qG7jHYd4.js → session-request-CcKMNi2Y.js} +2 -2
- package/assets/{signing-2d-SxI7E.js → signing-1MEhDZTe.js} +3 -3
- package/assets/{socials-C5lHDsWb.js → socials-BxeqgBhJ.js} +1 -1
- package/assets/{swaps-D-FCeao1.js → swaps-gmJBWPLn.js} +1 -1
- package/assets/{thirdweb-BzCYZVQU.js → thirdweb-D1mOG5l6.js} +3 -3
- package/assets/{to-serializable-transaction-mtITaKz7.js → to-serializable-transaction-B0ueqSml.js} +2 -2
- package/assets/trade-encoding-8_nNixrP.js +1 -0
- package/assets/{transactionReceipt-C0Zt7siR.js → transactionReceipt-C4bedM4w.js} +1 -1
- package/assets/{transactions-3oKW7X2A.js → transactions-OfZRD4zD.js} +1 -1
- package/assets/useCreditPacks-By64V7Im.js +1 -0
- package/assets/{useInfiniteGrid-DxkPmxZ9.js → useInfiniteGrid-BRS4FUdG.js} +1 -1
- package/assets/useManaRate-B_yvKRm8.js +1 -0
- package/assets/{useSecondarySales-uafEfAWN.js → useSecondarySales-DvaILn1P.js} +1 -1
- package/assets/{useStore-HaFF1p2U.js → useStore-DT6_uEJ5.js} +1 -1
- package/assets/{useTheme-DVLL-c1A.js → useTheme-DxD5b5GX.js} +1 -1
- package/assets/{verifyHash-DR9pCFUe.js → verifyHash-B6ZBhWEY.js} +1 -1
- package/assets/{w3m-modal-B4U6A0YE.js → w3m-modal-BDgG1mEs.js} +1 -1
- package/assets/{w3m-modal-CaY0gxk7.js → w3m-modal-cY_JeRk0.js} +1 -1
- package/assets/{wait-for-tx-receipt-BDXxYIXq.js → wait-for-tx-receipt-BtuweTJB.js} +1 -1
- package/assets/{wallets-Y1872Ad0.js → wallets-7MiPMysL.js} +5 -5
- package/assets/{web-connector-CYEfuYp5.js → web-connector-UMu-oPn4.js} +3 -3
- package/assets/{writeContract-DrFAVNON.js → writeContract-Byuqugox.js} +1 -1
- package/assets/{zoraTestnet-CZflXjbY.js → zoraTestnet-CkN0XqkJ.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-DS3i-ZcL.js +0 -695
- package/assets/Success-DXPvtMrB.js +0 -276
- package/assets/buy-D3hY4JG8.js +0 -1
- package/assets/trade-encoding-ZhCceq00.js +0 -1
- package/assets/useCreditPacks-DTZSsQrR.js +0 -1
- package/assets/useManaRate-DJlj41tJ.js +0 -1
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
import{j as e,L as ve,r as S,b as Ot,a as Ht}from"./react-vyZjIDcS.js";import{t as ne,s as i,e as s,J as se,aj as Vt,G as Gt,I as W,z as yt,H as Ee,m as Dt,ak as R,Q as st,n as Yt,u as Jt,al as Xt,E as Zt,am as ea,an as ta,ao as aa,ap as sa,y as na,aq as nt,ar as O,as as it,at as ia,l as Y,c as rt,au as ra,h as oa,av as ot,aw as Pe,ax as ze,ay as pe,az as ct,a as ge,b as ca,C as Ie,aA as la}from"./index-DzVTWEvS.js";import{M as da,S as ua,C as ha,H as pa,a as ga,T as xa,X as ma,b as fa,B as ya,c as ba,d as lt,e as va,f as ye,P as bt,m as wa,g as Ca,h as ja,i as ka,j as vt,k as be,L as $a,l as Sa,n as dt,o as ut,W as Ma,p as Ta,q as Pa,A as za,r as Ia,s as Aa,t as qa,u as _a,v as Ba,w as Ea,x as Ra,y as Wa,z as Fa,D as La,E as Ka,F as Na,G as Qa,I as Ua,J as Oa,K as Ae,N as Ha,O as Va,Q as Ga,R as Da,U as ht,V as Ya,Y as Ja,Z as Xa,_ as Za}from"./CollectionCarousel-Cf-VTi1F.js";import{u as es}from"./useManaRate-B_yvKRm8.js";import{r as ts}from"./mana-rate-Dt1fufbZ.js";import{i as as,j as ss,f as ns,n as is,h as rs,A as os}from"./authorizations-BPcNtN-P.js";import{g as cs,b as qe}from"./buy-B0vN0t4_.js";import{b as ls,w as ds,S as us,G as hs}from"./buy-gasless-DLYP_J55.js";import{u as ps,M as gs,R as xe,r as xs,c as ms}from"./useCreditPacks-By64V7Im.js";import{i as fs,a as ys}from"./errors-BSoF7pTC.js";import{E as bs}from"./ErrorNotice-B02EvdVc.js";import{u as pt}from"./mana-convert-CHkCsdrS.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-8_nNixrP.js";import"./sendMetaTransaction-Ci7WU1n2.js";const{colors:J,radius:vs}=ne,ws=i.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,Cs=i.span`
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: ${J.text2};
|
|
11
|
+
text-transform: capitalize;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
`,js=i.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
/* The list is the modal's elastic region: inside a viewport-capped card it gives up height first, so
|
|
18
|
+
the pack picker, total and Cancel/Buy below it stay on screen without scrolling. The floor is an
|
|
19
|
+
explicit ~one row because a scroll container's automatic minimum size is zero — it would otherwise
|
|
20
|
+
collapse to nothing on a short screen. */
|
|
21
|
+
min-height: 120px;
|
|
22
|
+
max-height: 360px;
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
width: 100%;
|
|
25
|
+
scrollbar-width: thin;
|
|
26
|
+
scrollbar-color: #a2a2a2 ${J.media};
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar {
|
|
29
|
+
width: 8px;
|
|
30
|
+
}
|
|
31
|
+
&::-webkit-scrollbar-track {
|
|
32
|
+
background: ${J.media};
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
}
|
|
35
|
+
&::-webkit-scrollbar-thumb {
|
|
36
|
+
background: #a2a2a2;
|
|
37
|
+
border-radius: ${vs.btn};
|
|
38
|
+
}
|
|
39
|
+
`,ks=i.span`
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: ${J.muted};
|
|
44
|
+
`,$s=i.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
gap: 12px;
|
|
49
|
+
padding: 0 0 12px;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
color: ${J.muted};
|
|
52
|
+
|
|
53
|
+
& strong {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 6px;
|
|
57
|
+
font-size: 20px;
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
color: ${J.text};
|
|
60
|
+
}
|
|
61
|
+
`,Ss="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/buy-error-22UunaPC.png";function Ms(o){const{phase:d,balanceCredits:$,onClose:M}=o,q=d==="processing",L=d==="error"?s("cartCheckout.errorTitle"):d==="nofunds"?s("cartCheckout.titleNoFunds"):d==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),K=d==="processing";return e.jsxs(da,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(ua,{onClick:q?void 0:M,"aria-hidden":!0}),e.jsxs(ha,{"data-tall":K||void 0,children:[e.jsxs(pa,{children:[e.jsxs(ga,{children:[e.jsx(xa,{children:L}),!q&&e.jsx(ma,{onClick:M,"aria-label":s("buyModal.close"),children:e.jsx(fa,{})})]}),e.jsxs(ya,{children:[e.jsx(ba,{children:d==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(lt,{}),e.jsx(va,{children:se($)})]})]}),d==="choose"&&e.jsxs(ye,{children:[e.jsxs($s,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(lt,{}),se(o.totalCredits??0)]})]}),e.jsx(bt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const T=wa(o.totalCents??0,o.totalManaWei??0n);return T!=null?s("buyModal.manaRate",{mana:T.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(Ts,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),d==="nofunds"&&e.jsx(Ps,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:M}),d==="error"&&e.jsxs(ye,{children:[e.jsxs(Ca,{"data-testid":"buy-error",children:[e.jsx(ja,{src:Ss,alt:"",width:64,height:80}),e.jsxs(ka,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",s("cartCheckout.errorBody")]})]}),e.jsxs(vt,{children:[e.jsx(be,{"data-variant":"outline",onClick:M,children:s("buyModal.cancel")}),e.jsx(be,{"data-variant":"purple",onClick:o.onRetry??M,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Ts({stage:o,step:d,total:$,isSelfCustody:M,signatures:q}){const L=o==="reserving",K=$>0?Math.min(100,Math.round(d/$*100)):0,T=M&&q&&q.total>1,X=o==="awaiting-signature"?M?T?s("cartCheckout.confirmMultiple",{current:q.current,total:q.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ye,{"data-processing":!0,children:[e.jsx($a,{src:Vt,alt:"",width:61,height:61}),e.jsx(Sa,{children:X}),L?e.jsxs(ws,{children:[e.jsx(dt,{"aria-hidden":!0,children:e.jsx(ut,{"data-step":!0,style:{width:`${K}%`}})}),$>1?e.jsxs(Cs,{children:[d,"/",$]}):null]}):e.jsx(dt,{"aria-hidden":!0,children:e.jsx(ut,{})})]})}function Ps({lines:o,shortfallCredits:d,packs:$,selectedPack:M,onSelectPack:q,onBuyPacks:L,onCancel:K}){const T=$.find(n=>n.id===M),X=o.reduce((n,E)=>n+(E.quantity??1),0);return e.jsxs(ye,{children:[e.jsxs(Ma,{"data-testid":"nofunds-warning",children:[e.jsx(Ta,{}),e.jsxs(Pa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",s("buyModal.warningToPurchase",{count:X})]})]}),e.jsx(js,{children:o.map(n=>{const E=n.quantity??1;return e.jsxs(za,{children:[e.jsx(Ia,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Aa,{children:[e.jsxs("div",{children:[e.jsxs(qa,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),E>1?e.jsx(ks,{children:s("cartCheckout.qty",{count:E})}):null]}),n.item.creator?e.jsx(_a,{address:n.item.creator}):null]}),e.jsxs(Ba,{children:[e.jsx(Ea,{}),e.jsx("span",{children:se(n.priceCredits*E)})]})]})]},n.item.id)})}),e.jsx(Ra,{children:$.map(n=>{const E=n.id===M;return e.jsxs(Wa,{"data-testid":"credit-pack","data-on":E||void 0,onClick:()=>q(n.id),children:[e.jsx(Fa,{}),e.jsx(La,{children:se(n.credits)}),e.jsxs(Ka,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Na,{children:[e.jsxs(Qa,{children:[e.jsx(Ua,{}),e.jsx("span",{children:se((T==null?void 0:T.credits)??0)})]}),e.jsxs(Oa,{children:["$",((T==null?void 0:T.usd)??0).toFixed(2)]})]}),e.jsxs(vt,{children:[e.jsx(be,{"data-variant":"outline",onClick:K,children:s("buyModal.cancel")}),e.jsx(be,{"data-variant":"gradient",onClick:L,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:wt,radius:H}=ne,Ct="@media (max-width: 1080px)",k="@media (max-width: 880px)",gt=i.div`
|
|
62
|
+
max-width: 1510px;
|
|
63
|
+
margin: 0 auto;
|
|
64
|
+
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
65
|
+
the footer rather than leaving a gray strip. Needs .page[data-route="/cart"] to be a flex column. */
|
|
66
|
+
width: 100%;
|
|
67
|
+
flex: 1 0 auto;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
|
|
71
|
+
${k} {
|
|
72
|
+
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
+
}
|
|
74
|
+
`,xt=i.button`
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
gap: 6px;
|
|
78
|
+
margin: 0 0 16px;
|
|
79
|
+
padding: 0;
|
|
80
|
+
border: 0;
|
|
81
|
+
background: none;
|
|
82
|
+
color: ${r.text2};
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
letter-spacing: 0.02em;
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
transition: color 0.15s ease;
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
color: ${r.accent};
|
|
92
|
+
}
|
|
93
|
+
& .ico {
|
|
94
|
+
width: 18px;
|
|
95
|
+
height: 18px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${k} {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
`,zs=i.div`
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
align-items: start;
|
|
106
|
+
|
|
107
|
+
${Ct} {
|
|
108
|
+
grid-template-columns: 1fr;
|
|
109
|
+
}
|
|
110
|
+
`,mt=i.div`
|
|
111
|
+
position: relative;
|
|
112
|
+
/* The gray band is 733px in Figma (1553-317103) — taller than the panels inside it, deliberately. Without
|
|
113
|
+
this it collapsed to the panels' height, and the page shell's own viewport-filling min-height then padded
|
|
114
|
+
the page out BELOW the cross-sell, so a strip of gray showed under "You might also like" instead of the
|
|
115
|
+
footer. Giving the band its designed height puts the leftover space where the design wants it. */
|
|
116
|
+
min-height: 733px;
|
|
117
|
+
|
|
118
|
+
${k} {
|
|
119
|
+
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
120
|
+
the bottom of it — a floor here would only add empty gray. */
|
|
121
|
+
min-height: 0;
|
|
122
|
+
}
|
|
123
|
+
`,Is=i.div`
|
|
124
|
+
min-width: 0;
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
gap: 12px;
|
|
128
|
+
`,As=i.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
gap: 12px;
|
|
133
|
+
background: ${r.white};
|
|
134
|
+
border-radius: 16px;
|
|
135
|
+
padding: 12px 12px 12px 24px;
|
|
136
|
+
|
|
137
|
+
${k} {
|
|
138
|
+
gap: 8px;
|
|
139
|
+
padding: 12px;
|
|
140
|
+
}
|
|
141
|
+
`,jt=i.section`
|
|
142
|
+
min-width: 0;
|
|
143
|
+
background: ${r.white};
|
|
144
|
+
border-radius: 16px;
|
|
145
|
+
padding: 24px;
|
|
146
|
+
|
|
147
|
+
${k} {
|
|
148
|
+
padding: 16px;
|
|
149
|
+
}
|
|
150
|
+
`,qs=i(jt)`
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
gap: 24px;
|
|
156
|
+
min-height: 420px;
|
|
157
|
+
padding: 48px 16px;
|
|
158
|
+
text-align: center;
|
|
159
|
+
color: ${r.text};
|
|
160
|
+
|
|
161
|
+
${ne.media.maxWidth("mobile")} {
|
|
162
|
+
min-height: 320px;
|
|
163
|
+
padding: 32px 16px;
|
|
164
|
+
}
|
|
165
|
+
`,_s=i.div`
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: 12px;
|
|
170
|
+
padding-bottom: 16px;
|
|
171
|
+
`,Bs=i.p`
|
|
172
|
+
margin: 0;
|
|
173
|
+
font-size: 24px;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
line-height: 1.6;
|
|
176
|
+
|
|
177
|
+
${ne.media.maxWidth("mobile")} {
|
|
178
|
+
font-size: 20px;
|
|
179
|
+
}
|
|
180
|
+
`,Es=i.p`
|
|
181
|
+
margin: 0;
|
|
182
|
+
font-size: 20px;
|
|
183
|
+
font-weight: 400;
|
|
184
|
+
line-height: 1.6;
|
|
185
|
+
|
|
186
|
+
${ne.media.maxWidth("mobile")} {
|
|
187
|
+
font-size: 16px;
|
|
188
|
+
}
|
|
189
|
+
`,Rs=i(ve)`
|
|
190
|
+
display: inline-flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
width: 310px;
|
|
194
|
+
max-width: 100%;
|
|
195
|
+
height: 56px;
|
|
196
|
+
padding: 0 12px;
|
|
197
|
+
border-radius: ${H.card};
|
|
198
|
+
background: ${r.accent};
|
|
199
|
+
color: ${r.softWhite};
|
|
200
|
+
font-size: 15px;
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
line-height: 24px;
|
|
203
|
+
letter-spacing: 0.46px;
|
|
204
|
+
text-transform: uppercase;
|
|
205
|
+
text-decoration: none;
|
|
206
|
+
transition: background 0.15s ease;
|
|
207
|
+
|
|
208
|
+
&:hover {
|
|
209
|
+
background: ${r.accentHover};
|
|
210
|
+
}
|
|
211
|
+
&:focus-visible {
|
|
212
|
+
outline: 2px solid ${r.accent};
|
|
213
|
+
outline-offset: 2px;
|
|
214
|
+
}
|
|
215
|
+
`,Ws=i.button`
|
|
216
|
+
display: none;
|
|
217
|
+
|
|
218
|
+
${k} {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
flex-shrink: 0;
|
|
222
|
+
border: 0;
|
|
223
|
+
background: none;
|
|
224
|
+
padding: 0;
|
|
225
|
+
color: ${r.text};
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
|
|
228
|
+
& .ico {
|
|
229
|
+
width: 20px;
|
|
230
|
+
height: 20px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
`,Fs=i.h1`
|
|
234
|
+
margin: 0;
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
line-height: 1.57;
|
|
238
|
+
color: ${r.text};
|
|
239
|
+
|
|
240
|
+
${k} {
|
|
241
|
+
flex: 1;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
font-size: 16px;
|
|
244
|
+
}
|
|
245
|
+
`,Ls=i.button`
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
gap: 8px;
|
|
250
|
+
height: 40px;
|
|
251
|
+
padding: 0 12px;
|
|
252
|
+
border: 2px solid transparent;
|
|
253
|
+
border-radius: ${H.btn};
|
|
254
|
+
background:
|
|
255
|
+
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
256
|
+
${wt.amethyst} border-box;
|
|
257
|
+
color: ${r.accent};
|
|
258
|
+
font-size: 13px;
|
|
259
|
+
font-weight: 600;
|
|
260
|
+
line-height: 24px;
|
|
261
|
+
letter-spacing: 0.46px;
|
|
262
|
+
text-transform: uppercase;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
transition:
|
|
266
|
+
box-shadow 0.15s ease,
|
|
267
|
+
filter 0.15s ease;
|
|
268
|
+
|
|
269
|
+
&:hover:not(:disabled) {
|
|
270
|
+
box-shadow: 0 0 8px 0 rgba(165, 36, 179, 0.35);
|
|
271
|
+
}
|
|
272
|
+
&:active:not(:disabled) {
|
|
273
|
+
filter: brightness(0.97);
|
|
274
|
+
}
|
|
275
|
+
&:disabled {
|
|
276
|
+
opacity: 0.55;
|
|
277
|
+
cursor: default;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
${k} {
|
|
281
|
+
height: 36px;
|
|
282
|
+
padding: 0 10px;
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
}
|
|
285
|
+
`,Ks=i.div`
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
gap: 24px;
|
|
289
|
+
`,Ns=i.div`
|
|
290
|
+
position: relative;
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: stretch;
|
|
293
|
+
gap: 12px;
|
|
294
|
+
background: ${r.white};
|
|
295
|
+
border: 1px solid ${r.gray4};
|
|
296
|
+
border-radius: ${H.card};
|
|
297
|
+
overflow: hidden;
|
|
298
|
+
|
|
299
|
+
&[data-unavailable] [data-thumb] {
|
|
300
|
+
opacity: 0.5;
|
|
301
|
+
}
|
|
302
|
+
&[data-unavailable] [data-check] {
|
|
303
|
+
display: none;
|
|
304
|
+
}
|
|
305
|
+
&[data-unavailable] [data-desc] {
|
|
306
|
+
opacity: 0.7;
|
|
307
|
+
}
|
|
308
|
+
`,Qs=i.div`
|
|
309
|
+
position: relative;
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
width: 137.5px;
|
|
312
|
+
height: 137px;
|
|
313
|
+
background: ${r.media};
|
|
314
|
+
border-radius: ${H.card};
|
|
315
|
+
display: grid;
|
|
316
|
+
place-items: center;
|
|
317
|
+
overflow: hidden;
|
|
318
|
+
|
|
319
|
+
& img {
|
|
320
|
+
width: 83%;
|
|
321
|
+
height: 83%;
|
|
322
|
+
object-fit: contain;
|
|
323
|
+
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
${k} {
|
|
327
|
+
width: 120px;
|
|
328
|
+
height: 120px;
|
|
329
|
+
}
|
|
330
|
+
`,Us=i(ve)`
|
|
331
|
+
position: absolute;
|
|
332
|
+
inset: 0;
|
|
333
|
+
display: grid;
|
|
334
|
+
place-items: center;
|
|
335
|
+
`,Os=i.span`
|
|
336
|
+
position: absolute;
|
|
337
|
+
top: 7.5px;
|
|
338
|
+
left: 7.5px;
|
|
339
|
+
width: 20px;
|
|
340
|
+
height: 20px;
|
|
341
|
+
border-radius: 50%;
|
|
342
|
+
background: #34ce77;
|
|
343
|
+
display: grid;
|
|
344
|
+
place-items: center;
|
|
345
|
+
`,Hs=i.div`
|
|
346
|
+
flex: 1;
|
|
347
|
+
min-width: 0;
|
|
348
|
+
display: flex;
|
|
349
|
+
flex-direction: column;
|
|
350
|
+
justify-content: space-between;
|
|
351
|
+
gap: 8px;
|
|
352
|
+
padding: 16px 8px;
|
|
353
|
+
|
|
354
|
+
${k} {
|
|
355
|
+
padding: 12px 4px 12px 0;
|
|
356
|
+
}
|
|
357
|
+
`,Vs=i.div`
|
|
358
|
+
display: flex;
|
|
359
|
+
flex-direction: column;
|
|
360
|
+
gap: 4px;
|
|
361
|
+
min-width: 0;
|
|
362
|
+
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
+
`,kt=Ee`
|
|
364
|
+
display: block;
|
|
365
|
+
font-size: 16px;
|
|
366
|
+
font-weight: 600;
|
|
367
|
+
line-height: 1.2;
|
|
368
|
+
color: ${r.text};
|
|
369
|
+
text-decoration: none;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
text-overflow: ellipsis;
|
|
372
|
+
white-space: nowrap;
|
|
373
|
+
|
|
374
|
+
a&:hover {
|
|
375
|
+
color: ${r.accent};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
${k} {
|
|
379
|
+
white-space: normal;
|
|
380
|
+
display: -webkit-box;
|
|
381
|
+
-webkit-line-clamp: 2;
|
|
382
|
+
line-clamp: 2;
|
|
383
|
+
-webkit-box-orient: vertical;
|
|
384
|
+
}
|
|
385
|
+
`,Gs=i.div`
|
|
386
|
+
${kt};
|
|
387
|
+
`,Ds=i(ve)`
|
|
388
|
+
${kt};
|
|
389
|
+
`,Ys=i(Gt)`
|
|
390
|
+
font-size: 10px;
|
|
391
|
+
line-height: 1.43;
|
|
392
|
+
color: ${r.muted};
|
|
393
|
+
|
|
394
|
+
& [data-avatar] {
|
|
395
|
+
display: none;
|
|
396
|
+
}
|
|
397
|
+
& [data-testid='creator-name'] {
|
|
398
|
+
font-size: 10px;
|
|
399
|
+
line-height: 1.43;
|
|
400
|
+
}
|
|
401
|
+
`,Js=i.div`
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: space-between;
|
|
405
|
+
gap: 12px;
|
|
406
|
+
padding-right: 8px;
|
|
407
|
+
`,Xs=i.div`
|
|
408
|
+
display: inline-flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 8px;
|
|
411
|
+
padding: 6px;
|
|
412
|
+
border: 0.5px solid ${r.muted2};
|
|
413
|
+
border-radius: ${H.pill};
|
|
414
|
+
`,ft=i.button`
|
|
415
|
+
display: grid;
|
|
416
|
+
place-items: center;
|
|
417
|
+
width: 16px;
|
|
418
|
+
height: 16px;
|
|
419
|
+
padding: 0;
|
|
420
|
+
border: 0;
|
|
421
|
+
background: none;
|
|
422
|
+
color: ${r.text};
|
|
423
|
+
cursor: pointer;
|
|
424
|
+
|
|
425
|
+
&:disabled {
|
|
426
|
+
color: ${r.muted2};
|
|
427
|
+
cursor: default;
|
|
428
|
+
}
|
|
429
|
+
`,Zs=i.span`
|
|
430
|
+
min-width: 12px;
|
|
431
|
+
font-size: 14px;
|
|
432
|
+
font-weight: 500;
|
|
433
|
+
line-height: 1.2;
|
|
434
|
+
color: ${r.text};
|
|
435
|
+
text-align: center;
|
|
436
|
+
`,en=i.div`
|
|
437
|
+
display: inline-flex;
|
|
438
|
+
align-items: center;
|
|
439
|
+
gap: 4px;
|
|
440
|
+
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
441
|
+
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
442
|
+
margin-left: auto;
|
|
443
|
+
font-size: 24px;
|
|
444
|
+
font-weight: 600;
|
|
445
|
+
color: ${r.text2};
|
|
446
|
+
|
|
447
|
+
${k} {
|
|
448
|
+
font-size: 20px;
|
|
449
|
+
}
|
|
450
|
+
`,tn=i(yt)`
|
|
451
|
+
width: 24px;
|
|
452
|
+
height: 24px;
|
|
453
|
+
background: ${r.text};
|
|
454
|
+
|
|
455
|
+
${k} {
|
|
456
|
+
width: 20px;
|
|
457
|
+
height: 20px;
|
|
458
|
+
}
|
|
459
|
+
`,an=i.span`
|
|
460
|
+
margin-left: 6px;
|
|
461
|
+
font-size: 14px;
|
|
462
|
+
font-weight: 500;
|
|
463
|
+
color: ${r.muted};
|
|
464
|
+
text-decoration: line-through;
|
|
465
|
+
`,sn=i.div`
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 9px;
|
|
468
|
+
right: 7px;
|
|
469
|
+
display: flex;
|
|
470
|
+
align-items: flex-start;
|
|
471
|
+
gap: 12px;
|
|
472
|
+
`,nn=i.span`
|
|
473
|
+
display: inline-flex;
|
|
474
|
+
align-items: center;
|
|
475
|
+
gap: 4px;
|
|
476
|
+
font-size: 12px;
|
|
477
|
+
font-weight: 600;
|
|
478
|
+
line-height: 1;
|
|
479
|
+
text-transform: uppercase;
|
|
480
|
+
color: ${r.text2};
|
|
481
|
+
`,rn=i(W)`
|
|
482
|
+
color: #f48221;
|
|
483
|
+
`,on=i(ve)`
|
|
484
|
+
font-size: 12px;
|
|
485
|
+
font-weight: 600;
|
|
486
|
+
line-height: 24px;
|
|
487
|
+
letter-spacing: 0.46px;
|
|
488
|
+
text-transform: uppercase;
|
|
489
|
+
text-decoration: underline;
|
|
490
|
+
color: ${r.accent};
|
|
491
|
+
|
|
492
|
+
&:hover {
|
|
493
|
+
color: ${r.accentHover};
|
|
494
|
+
}
|
|
495
|
+
&:focus-visible {
|
|
496
|
+
outline: 2px solid ${r.accent};
|
|
497
|
+
outline-offset: 2px;
|
|
498
|
+
}
|
|
499
|
+
`,cn=i.span`
|
|
500
|
+
align-self: flex-start;
|
|
501
|
+
display: inline-flex;
|
|
502
|
+
align-items: center;
|
|
503
|
+
gap: 4px;
|
|
504
|
+
padding: 2px 4px;
|
|
505
|
+
border-radius: ${H.chip};
|
|
506
|
+
background: #f4e9ff;
|
|
507
|
+
font-size: 10px;
|
|
508
|
+
font-weight: 400;
|
|
509
|
+
line-height: 14px;
|
|
510
|
+
color: ${r.text};
|
|
511
|
+
`,ln=i(W)`
|
|
512
|
+
width: 11.31px;
|
|
513
|
+
height: 10.94px;
|
|
514
|
+
background: ${r.text};
|
|
515
|
+
`,$t=Ee`
|
|
516
|
+
display: grid;
|
|
517
|
+
place-items: center;
|
|
518
|
+
width: 24px;
|
|
519
|
+
height: 24px;
|
|
520
|
+
padding: 0;
|
|
521
|
+
border: 0;
|
|
522
|
+
background: none;
|
|
523
|
+
color: ${r.muted};
|
|
524
|
+
cursor: pointer;
|
|
525
|
+
transition: color 0.12s ease;
|
|
526
|
+
|
|
527
|
+
&:disabled {
|
|
528
|
+
opacity: 0.5;
|
|
529
|
+
cursor: default;
|
|
530
|
+
}
|
|
531
|
+
`,dn=i.button`
|
|
532
|
+
${$t};
|
|
533
|
+
|
|
534
|
+
&:hover:not(:disabled) {
|
|
535
|
+
color: ${r.text};
|
|
536
|
+
}
|
|
537
|
+
&[data-on] {
|
|
538
|
+
color: ${r.dclRed};
|
|
539
|
+
}
|
|
540
|
+
`,un=i.button`
|
|
541
|
+
${$t};
|
|
542
|
+
|
|
543
|
+
&:hover:not(:disabled) {
|
|
544
|
+
color: ${r.dclRed};
|
|
545
|
+
}
|
|
546
|
+
`,hn=i.div`
|
|
547
|
+
display: flex;
|
|
548
|
+
gap: 20px;
|
|
549
|
+
margin-top: 16px;
|
|
550
|
+
|
|
551
|
+
& .link {
|
|
552
|
+
font-size: 13px;
|
|
553
|
+
color: ${r.muted};
|
|
554
|
+
font-weight: 600;
|
|
555
|
+
}
|
|
556
|
+
& .link:hover:not(:disabled) {
|
|
557
|
+
color: ${r.text};
|
|
558
|
+
}
|
|
559
|
+
`,pn=i.aside`
|
|
560
|
+
position: sticky;
|
|
561
|
+
top: 172px;
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
background: ${r.white};
|
|
565
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
566
|
+
border-radius: 16px;
|
|
567
|
+
padding: 16px;
|
|
568
|
+
|
|
569
|
+
${Ct} {
|
|
570
|
+
position: static;
|
|
571
|
+
}
|
|
572
|
+
${k} {
|
|
573
|
+
position: fixed;
|
|
574
|
+
left: 0;
|
|
575
|
+
right: 0;
|
|
576
|
+
top: auto;
|
|
577
|
+
bottom: 0;
|
|
578
|
+
z-index: 30;
|
|
579
|
+
border: 0;
|
|
580
|
+
border-radius: 16px 16px 0 0;
|
|
581
|
+
box-shadow: 0 -4px 20px rgba(22, 21, 24, 0.12);
|
|
582
|
+
}
|
|
583
|
+
`,gn=i.h2`
|
|
584
|
+
margin: 0 0 24px;
|
|
585
|
+
padding-bottom: 16px;
|
|
586
|
+
border-bottom: 1px solid ${r.gray4};
|
|
587
|
+
font-size: 24px;
|
|
588
|
+
font-weight: 600;
|
|
589
|
+
color: ${r.text};
|
|
590
|
+
|
|
591
|
+
${k} {
|
|
592
|
+
margin-bottom: 12px;
|
|
593
|
+
padding-bottom: 12px;
|
|
594
|
+
}
|
|
595
|
+
`,xn=i.div`
|
|
596
|
+
display: flex;
|
|
597
|
+
flex-direction: column;
|
|
598
|
+
gap: 12px;
|
|
599
|
+
`,mn=i.div`
|
|
600
|
+
display: flex;
|
|
601
|
+
align-items: flex-start;
|
|
602
|
+
justify-content: space-between;
|
|
603
|
+
gap: 12px;
|
|
604
|
+
`,fn=i.span`
|
|
605
|
+
font-size: 14px;
|
|
606
|
+
font-weight: 600;
|
|
607
|
+
line-height: 1.57;
|
|
608
|
+
color: ${r.muted1};
|
|
609
|
+
`,yn=i.span`
|
|
610
|
+
display: inline-flex;
|
|
611
|
+
align-items: center;
|
|
612
|
+
gap: 8px;
|
|
613
|
+
font-size: 24px;
|
|
614
|
+
font-weight: 700;
|
|
615
|
+
color: ${r.text};
|
|
616
|
+
`,bn=i.span`
|
|
617
|
+
display: flex;
|
|
618
|
+
flex-direction: column;
|
|
619
|
+
align-items: flex-end;
|
|
620
|
+
justify-content: center;
|
|
621
|
+
gap: 4px;
|
|
622
|
+
`;i.span`
|
|
623
|
+
font-size: 12px;
|
|
624
|
+
font-weight: 400;
|
|
625
|
+
line-height: 1;
|
|
626
|
+
color: ${r.muted};
|
|
627
|
+
`;const vn=i(yt)`
|
|
628
|
+
width: 30px;
|
|
629
|
+
height: 30px;
|
|
630
|
+
background: ${r.text};
|
|
631
|
+
-webkit-mask-size: 24px 24px;
|
|
632
|
+
mask-size: 24px 24px;
|
|
633
|
+
-webkit-mask-position: left center;
|
|
634
|
+
mask-position: left center;
|
|
635
|
+
`,wn=i.button`
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: 56px;
|
|
638
|
+
border: 0;
|
|
639
|
+
border-radius: ${H.btn};
|
|
640
|
+
background: ${wt.amethyst};
|
|
641
|
+
color: ${r.softWhite};
|
|
642
|
+
font-size: 15px;
|
|
643
|
+
font-weight: 600;
|
|
644
|
+
letter-spacing: 0.046em;
|
|
645
|
+
text-transform: uppercase;
|
|
646
|
+
cursor: pointer;
|
|
647
|
+
transition:
|
|
648
|
+
background 0.15s ease,
|
|
649
|
+
filter 0.15s ease;
|
|
650
|
+
|
|
651
|
+
&:hover:not(:disabled) {
|
|
652
|
+
background: ${r.accent};
|
|
653
|
+
}
|
|
654
|
+
&:active:not(:disabled) {
|
|
655
|
+
filter: brightness(0.95);
|
|
656
|
+
}
|
|
657
|
+
&:disabled {
|
|
658
|
+
opacity: 0.6;
|
|
659
|
+
cursor: default;
|
|
660
|
+
}
|
|
661
|
+
`,St=Ee`
|
|
662
|
+
margin: 0;
|
|
663
|
+
font-size: 13px;
|
|
664
|
+
`,me=i.p`
|
|
665
|
+
${St};
|
|
666
|
+
`,Cn=i(bs)`
|
|
667
|
+
${St};
|
|
668
|
+
`,jn=i.div`
|
|
669
|
+
position: relative;
|
|
670
|
+
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
671
|
+
flex: 1 0 auto;
|
|
672
|
+
margin-top: 48px;
|
|
673
|
+
/* The whole gap from the top of the cross-sell to the "You might also like" heading — the shared
|
|
674
|
+
carousel's own top margin is zeroed below so this padding isn't stacked on top of it. */
|
|
675
|
+
padding: 47px 0 24px;
|
|
676
|
+
|
|
677
|
+
&::before {
|
|
678
|
+
content: '';
|
|
679
|
+
position: absolute;
|
|
680
|
+
top: 0;
|
|
681
|
+
bottom: -80px; /* eat .page's bottom padding so the white reaches the footer */
|
|
682
|
+
left: 50%;
|
|
683
|
+
width: 100vw;
|
|
684
|
+
transform: translateX(-50%);
|
|
685
|
+
background: ${r.bg};
|
|
686
|
+
z-index: 0;
|
|
687
|
+
}
|
|
688
|
+
& > * {
|
|
689
|
+
position: relative;
|
|
690
|
+
z-index: 1;
|
|
691
|
+
}
|
|
692
|
+
& section {
|
|
693
|
+
margin-top: 0;
|
|
694
|
+
}
|
|
695
|
+
`;function _e(o){if(fs(o))return s("errors.rejected");const d=(o.message??"").toLowerCase();return d.includes("insufficient")?s("cart.error.insufficient",{currency:oa.name}):d.includes("no active listing")||d.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const kn=12e4;function $n(o){const d=[];return o.unavailable.length&&d.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&d.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:d.join(` ${s("cart.drop.and")} `)})}const Be=o=>o.reduce((d,$)=>d+$.priceCredits*$.quantity,0),fe=o=>o.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function Un(){Dt({title:s("nav.cart"),noindex:!0});const o=R(t=>t.items),d=R(t=>t.remove),$=R(t=>t.increment),M=R(t=>t.decrement),q=R(t=>t.clear),L=R(t=>t.restore),K=R(t=>t.setFittingOpen),T=st(t=>t.items),X=st(t=>t.toggle),{session:n,signIn:E}=Yt(),ie=ps().packs.slice(0,gs);S.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Mt=o.some(t=>t.category!=="emote"),{data:we}=Jt({queryKey:["upsell-listings"],queryFn:()=>la({first:40}),staleTime:6e4}),{data:y}=Xt(n),f=Zt(),V=Ot(),{state:N}=Ht(),[Tt,Z]=S.useState(null),[Re,re]=S.useState(null),[Pt,_]=S.useState(!1),[P,Q]=S.useState(null),We=S.useRef(0),[p,b]=S.useState(null),{data:oe}=ea(n),{data:ee}=es(!0),[Ce,Fe]=S.useState(""),te=S.useRef(null),Le=ta(o),Ke=t=>nt(Le[t.id]),je=o.filter(Ke),ke=o.length>0&&je.length===0,zt=je.reduce((t,a)=>t+a.priceCredits*a.quantity,0),It=o.reduce((t,a)=>t+a.quantity,0),At=je.reduce((t,a)=>t+a.quantity,0),Ne=P?P.liveTotalCredits:zt,qt=new Set(o.map(t=>t.id)),Qe=((we==null?void 0:we.items)??[]).filter(t=>!qt.has(t.id)).slice(0,12),_t=new Map(P==null?void 0:P.buyable.map(t=>[t.item.id,t])),ce=(y==null?void 0:y.credits)??0,$e=Ne*10,Bt=ee?pt($e,ee):0n,le=Ae({priceCents:$e,priceManaWei:Bt,balanceCents:(y==null?void 0:y.balanceCents)??0,manaBalanceWei:oe??0n}),Et=t=>t.some(a=>a.acquisition==="store"),Se=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Rt=ia,Wt=t=>ra(t.contractAddress,String(t.itemId));function de(t){t(),Q(null),re(null),Z(null)}function Ft(){b(null),_(!1)}function Ue(t){const a=Be(t),l=Math.max(0,a-ce),c=ie.find(u=>u.credits>=l)??ie[ie.length-1];Fe(c.id),O("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ce,shortfall:l}),b({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),_(!1)}async function Me(t){if(!n||t.length===0)return;const a=fe(t),l=a.map(g=>({...g.item,priceCredits:g.priceCredits})),c=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let h="authorize",v=!1;b({phase:"processing",stage:"reserving",step:1,total:a.length});try{const g=[];for(let m=0;m<a.length;m++){const j=a[m];b({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const B=j.acquisition==="trade"?j.trade.id:void 0,{credit:ae,maxCreditedValue:at}=await ot(n.identity,j.usdCents,B);u.push(ae.id),g.push(j.acquisition==="store"?{kind:"store",item:{collection:j.item.contractAddress,itemId:String(j.item.itemId),priceWei:j.priceWei},credits:[ae],maxCreditedValue:at,chainId:j.item.chainId}:{kind:"trade",trade:j.trade,credits:[ae],maxCreditedValue:at})}catch(B){if(ys(B)){if(u.length){try{await Pe(n.identity,u)}catch(ae){Y(ae,{flow:"cart_checkout",step:"release"})}f.invalidateQueries({queryKey:["usd-balance"]})}Ue(t);return}throw B}}h="submit";const w=cs(g).length,z=m=>w>1?{current:m,total:w}:void 0,x=(m,j)=>b({phase:"processing",stage:m,step:a.length,total:a.length,signatures:z(j)}),C=m=>m<w?x("awaiting-signature",m+1):x("settling",w);x("awaiting-signature",1);let I=[];const D=g.some(m=>m.kind==="store"),A=g.flatMap(m=>m.kind==="trade"?[m]:[]);if(as()&&!D)try{I=await ls({purchases:A,buyer:n.address,signer:n.signer,onSigned:()=>C(w)});const j=(await Promise.allSettled(I.map(B=>ds(B)))).flatMap(B=>B.status==="rejected"?[B.reason]:[]);if(j.length&&!j.some(B=>B instanceof us))throw j[0];v=!0}catch(m){if(!(m instanceof hs))throw m;I=await qe({purchases:g,buyer:n.address,signer:n.signer,onSigned:C})}else I=await qe({purchases:g,buyer:n.address,signer:n.signer,onSigned:C});t.forEach(m=>d(m.item.id)),Q(null),O("Shop Completed Purchase",{...ze(l),payment_type:"credits",no_crypto_step:v,transaction_hash:I[0]??null}),Ya(f);const U=te.current;te.current=null,b(null),_(!1);const he={items:c,txHash:I[0]??void 0,txHashes:I,settled:!0,...U?{creditsAdded:U}:{}};V("/success",{state:he,replace:!0})}catch(g){if(pe(g)||Y(g,{flow:"cart_checkout",step:h,cart_size:t.length}),O(pe(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:ct(g),value_usd:it(l.reduce((w,z)=>w+z.priceCredits,0)),cart_size:a.length}),u.length){try{await Pe(n.identity,u)}catch(w){Y(w,{flow:"cart_checkout",step:"release"})}f.invalidateQueries({queryKey:["usd-balance"]})}b({phase:"error",message:_e(g)})}}function Oe(t,a){f.invalidateQueries({queryKey:["usd-balance"]}),f.invalidateQueries({queryKey:["detail-trade"]}),f.invalidateQueries({queryKey:["shop-item"]}),f.invalidateQueries({queryKey:["owned-token"]}),f.invalidateQueries({queryKey:["public-token"]}),f.invalidateQueries({queryKey:["item-resales"]}),f.invalidateQueries({queryKey:["shop-items"]}),f.invalidateQueries({queryKey:["catalog-items"]}),f.invalidateQueries({queryKey:["my-assets"]}),f.invalidateQueries({queryKey:["purchases"]}),f.invalidateQueries({queryKey:["owned-item-count"]}),f.invalidateQueries({queryKey:["overview-listings"]}),f.invalidateQueries({queryKey:["upsell-listings"]});const l=te.current;te.current=null,b(null),_(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...l?{creditsAdded:l}:{}};V("/success",{state:c,replace:!0})}function He(t,a){pe(t)||Y(t,{flow:a,step:"submit"}),O(pe(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ct(t)}),b({phase:"error",message:_e(t)}),_(!1)}async function Lt(t,a){const l=ge(Ie.MANAToken,a),c=ge(Ie.CreditsManager,a);await rs({auth:{kind:os.Allowance,contractAddress:l.address,spenderAddress:c.address,chainId:a},signer:t})}async function Ve(){if(ee)return ee;try{return await f.fetchQuery({queryKey:["mana-rate",rt.chainId],queryFn:()=>ts(rt.chainId),staleTime:6e4})}catch{return}}async function Kt(t){const a=fe(t).reduce((h,v)=>h+v.usdCents,0),c=(oe??0n)>0n?await Ve():ee,u=c?pt(a,c):0n;return{totalCents:a,manaWei:u}}async function Ge(t,a){const l=Be(t),{totalCents:c,manaWei:u}=await Kt(t),h=Ae({priceCents:c,priceManaWei:u,balanceCents:(y==null?void 0:y.balanceCents)??0,manaBalanceWei:oe??0n}),v=Et(t)?{...h,options:h.options.filter(g=>g.method==="credits")}:h;if(a&&v.options.some(g=>g.method===a)){if(a==="credits"){Me(t);return}const{spender:g,chainId:w}=De(a,t);await Ye(g,w,()=>a==="mana"?void Je(t):void Xe(t,c,u));return}if(v.options.some(g=>g.method==="mana"||g.method==="combined")){b({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if(y!=null&&y.credits<l){Ue(t);return}Me(t)}function Nt(t){return Ae({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(y==null?void 0:y.balanceCents)??0,manaBalanceWei:oe??0n})}const[Te,ue]=S.useState(null);function De(t,a){const l=Se(a)[0].trade;return{spender:t==="mana"?ge(ca(l.contract),l.chainId).address:ge(Ie.CreditsManager,l.chainId).address,chainId:l.chainId}}async function Ye(t,a,l){const c=ss(a,t),u=n?await ns(c,n.address).catch(()=>!0):!0;if(is(n==null?void 0:n.providerType,u)){_(!1),ue({auth:c,run:l});return}l()}function Qt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:l,manaWei:c}=p;if(t==="credits"){Me(a);return}const{spender:u,chainId:h}=De(t,a);Ye(u,h,()=>t==="mana"?void Je(a):void Xe(a,l,c))}async function Je(t){if(!n||t.length===0)return;const a=fe(t),l=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>b({phase:"processing",stage:"settling",step:a.length,total:a.length});b({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await Ja({trades:Se(a).map(v=>v.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(v=>d(v.item.id)),Q(null),O("Shop Completed Purchase",{...ze(l),payment_type:"mana",transaction_hash:h[0]??null}),f.invalidateQueries({queryKey:["mana-balance"]}),Oe(c,h)}catch(h){He(h,"buy_cart_mana")}}async function Xe(t,a,l){if(!n||t.length===0)return;const c=fe(t),u=c.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),v=Xa(c.map(x=>x.usdCents),(y==null?void 0:y.balanceCents)??0),g=v.reduce((x,C)=>x+C,0),w=Za(Math.max(0,a-g),a,l),z=[];b({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=Se(c),C=[];for(let A=0;A<x.length;A++){const U=v[A];if(U<=0)continue;b({phase:"processing",stage:"reserving",step:A+1,total:x.length});const{credit:he,maxCreditedValue:m}=await ot(n.identity,U,x[A].trade.id);z.push(he.id),C.push({kind:"trade",trade:x[A].trade,credits:[he],maxCreditedValue:m})}x.forEach((A,U)=>{v[U]<=0&&C.push({kind:"trade",trade:A.trade,credits:[],maxCreditedValue:"0"})}),C[0]={...C[0],maxCreditedValue:(BigInt(C[0].maxCreditedValue)+w).toString()},await Lt(n.signer,x[0].trade.chainId);const I=()=>b({phase:"processing",stage:"settling",step:c.length,total:c.length});b({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const D=await qe({purchases:C,buyer:n.address,signer:n.signer,onSigned:I});t.forEach(A=>d(A.item.id)),Q(null),O("Shop Completed Purchase",{...ze(u),payment_type:"credits_and_mana",transaction_hash:D[0]??null}),f.invalidateQueries({queryKey:["mana-balance"]}),Oe(h,D)}catch(x){z.length&&(Pe(n.identity,z).catch(()=>{}),f.invalidateQueries({queryKey:["usd-balance"]})),He(x,"buy_cart_combined")}}async function G(t){if(!n){ht({type:"cart-checkout"}),E();return}const a=R.getState().items.filter(Ke);if(a.length===0)return;Z(null),re(null),_(!0);const l=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);O("Shop Started Checkout",{cart_size:a.length,cart_value_credits:l,cart_value_usd:it(l),has_sufficient_credits:ce>=l});try{const c=await xs(a,n.address,Rt,await Ve(),Wt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>d(h.id)),re($n(c))),c.buyable.length===0){Z(s("cart.error.noneAvailable")),Q(null);return}if(c.orderChanged){Q(c),We.current=Date.now();return}await Ge(c.buyable,t)}catch(c){Y(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),Z(_e(c))}finally{_(!1)}}async function Ze(){if(P){if(!n){ht({type:"cart-checkout"}),E();return}if(Date.now()-We.current>kn){Q(null),re(null),await G();return}Z(null),Ge(P.buyable)}}async function Ut(){if(Ce){try{sessionStorage.setItem(xe,JSON.stringify(R.getState().items))}catch{}_(!0);try{const t=await ms(Ce,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}V("/credits")}catch(t){try{sessionStorage.removeItem(xe)}catch{}Y(t,{flow:"cart_buy_credits"}),b({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const et=S.useRef(!1);S.useEffect(()=>{if(!n||et.current||!Ha("cart-checkout"))return;et.current=!0;const t=setTimeout(()=>void G(),0);return()=>clearTimeout(t)},[n]);const tt=S.useRef(!1);S.useEffect(()=>{if(!(N!=null&&N.resumeCheckout)||tt.current)return;tt.current=!0,te.current=N.creditsAdded??null;try{const a=sessionStorage.getItem(xe);if(a){sessionStorage.removeItem(xe);const l=JSON.parse(a);Array.isArray(l)&&l.length&&L(l)}}catch{}f.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void G(),0);return()=>clearTimeout(t)},[N==null?void 0:N.resumeCheckout]);const F=Pt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(gt,{children:e.jsxs(mt,{children:[e.jsxs(xt,{onClick:()=>V(-1),type:"button",children:[e.jsx(W,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(qs,{"data-testid":"cart-empty",children:[e.jsx(W,{name:"cart-plus",size:110}),e.jsxs(_s,{children:[e.jsx(Bs,{children:s("cart.empty.title")}),e.jsx(Es,{children:s("cart.empty.body")})]}),e.jsx(Rs,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(gt,{children:[e.jsxs(mt,{children:[e.jsxs(xt,{onClick:()=>V(-1),type:"button",children:[e.jsx(W,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(zs,{children:[e.jsxs(Is,{children:[e.jsxs(As,{children:[e.jsx(Ws,{onClick:()=>V(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(W,{name:"arrow-left"})}),e.jsx(Fs,{children:s("cart.panelTitle",{count:It})}),Mt?e.jsxs(Ls,{onClick:()=>K(!0),disabled:F,children:[e.jsx(W,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(jt,{children:[e.jsx(Ks,{children:o.map(t=>{const a=_t.get(t.id),l=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,v=typeof t.available=="number"&&h>=t.available,g=l*h,w=aa(t),z=!!w&&!!T[w],x=sa(t),C=Le[t.id],I=!nt(C),D=C==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ns,{"data-unavailable":I||void 0,children:[e.jsxs(Qs,{"data-thumb":!0,children:[x?e.jsx(Us,{to:x,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(Os,{"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(Hs,{children:[e.jsxs(Vs,{"data-desc":!0,children:[x?e.jsx(Ds,{to:x,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Gs,{title:t.name,children:t.name}),t.creator?e.jsx(Ys,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(cn,{"data-testid":"cart-creator-tag",children:[e.jsx(ln,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(Js,{children:I?e.jsxs(e.Fragment,{children:[e.jsxs(nn,{children:[e.jsx(rn,{name:"warning-fill",size:24}),D]}),x?e.jsx(on,{to:x,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Xs,{children:[e.jsx(ft,{onClick:()=>de(()=>M(t.id)),disabled:F||h<=1,"aria-label":s("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(Zs,{children:h}),e.jsx(ft,{onClick:()=>de(()=>$(t.id)),disabled:F||v,"aria-label":s("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(en,{children:[e.jsx(tn,{})," ",g,c?e.jsx(an,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(sn,{children:[w?e.jsx(dn,{"data-on":z||void 0,onClick:()=>X(t),"aria-label":z?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:z?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(W,{name:z?"heart-solid":"heart"})}):null,e.jsx(un,{onClick:()=>de(()=>d(t.id)),disabled:F,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(W,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(hn,{children:e.jsx("button",{className:"link",onClick:()=>de(q),disabled:F,children:s("cart.clearCart")})})]})]}),e.jsxs(pn,{children:[e.jsx(gn,{children:s("cart.purchaseSummary")}),e.jsxs(xn,{children:[e.jsxs(mn,{children:[e.jsx(fn,{children:s("cart.totalItems",{count:At})}),e.jsx(bn,{children:e.jsxs(yn,{children:[e.jsx(vn,{})," ",Ne]})})]}),le.options.length>0||le.manaShortfall?e.jsx(bt,{options:le.options,totalCents:$e,shortfall:le.manaShortfall,creditsLabel:P?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:F||ke,onPay:t=>void(P?Ze():G(t))}):e.jsx(wn,{onClick:()=>void(P?Ze():G()),disabled:F||ke,children:F?s("cart.working"):P?s("marketCheckout.confirmPurchase"):s("assetCard.buyNow")}),ke?e.jsx(me,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(me,{className:"muted",children:s("cart.signInHint")}),P?e.jsx(me,{className:"muted",children:s("cart.priceChanged")}):null,Re?e.jsx(me,{className:"muted",children:Re}):null,e.jsx(Cn,{message:Tt})]})]})]})]}),Qe.length>0?e.jsx(jn,{children:e.jsx(Va,{title:s("cart.youMightAlsoLike"),items:Qe})}):null,Te&&n?e.jsx(Ga,{auth:Te.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:Da,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Te;ue(null),t()},onCancel:()=>ue(null),onClose:()=>ue(null)}):null,p?e.jsx(Ms,{phase:p.phase,balanceCredits:ce,onClose:Ft,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:na(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Nt(p).options:void 0,onPay:Qt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Be(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ie,selectedPack:Ce,onSelectPack:Fe,onBuyPacks:()=>void Ut(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void G()}):null]})}export{Un as Cart};
|