@dcl/shop 0.1.0-30635983356.commit-a8e9459 → 0.1.0-30805756836.commit-b10a0ac
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-B4y9NUBI.js → Activity-G9zJvmPI.js} +1 -1
- package/_assets/{AnimatedBackground-CxADM-5J.js → AnimatedBackground-Cj9oFh-J.js} +1 -1
- package/_assets/{Assets-C3cWvBGe.js → Assets-mW5CCWG2.js} +2 -2
- package/_assets/{Assets.styles-SNOULQeJ.js → Assets.styles-Bgn_x0Ss.js} +1 -1
- package/_assets/{Authorizations-CvW5usoP.js → Authorizations-D1k47ikz.js} +1 -1
- package/_assets/Cart-BqOp14he.js +695 -0
- package/_assets/{CircularProgress-C8Q1J2_T.js → CircularProgress-CORSbufO.js} +1 -1
- package/_assets/{Collection-DZgMeY2J.js → Collection-CSLe2ejR.js} +1 -1
- package/_assets/{CollectionCarousel-d3gMIYq5.js → CollectionCarousel-D5pSydH6.js} +1 -1
- package/_assets/{Creator-C3IOB2-s.js → Creator-2epzTmnc.js} +1 -1
- package/_assets/{ErrorNotice-DYkIPemd.js → ErrorNotice-CGArNL-E.js} +1 -1
- package/_assets/{ExchangeController-C7C1Z5An.js → ExchangeController-DYht3_WE.js} +1 -1
- package/_assets/{GetCredits-BtFsihcb.js → GetCredits-CJokFm22.js} +1 -1
- package/_assets/{HelpersUtil-Ckmbyhof.js → HelpersUtil-BTNAIgt_.js} +1 -1
- package/_assets/{ImportListings-BpPDJWn3.js → ImportListings-D7uOag2_.js} +1 -1
- package/_assets/{ItemDetail-BKFZuj-Z.js → ItemDetail-D6AKzbeY.js} +3 -3
- package/_assets/{LoadMore-h8PnRe8Q.js → LoadMore-BaRMKeAe.js} +1 -1
- package/_assets/{MenuList-PMkEwZp8.js → MenuList-Cs4FBYPj.js} +1 -1
- package/_assets/{MyAssets-D68gkWlv.js → MyAssets-D5zEJUBI.js} +1 -1
- package/_assets/{MyFavorites-lzeuyPwU.js → MyFavorites-LArY6a-e.js} +1 -1
- package/_assets/{NotFound-DB_y_Z_s.js → NotFound-ByAg4XFz.js} +1 -1
- package/_assets/{NotificationsBell-CnmtrJ32.js → NotificationsBell-CGFRV5dg.js} +1 -1
- package/_assets/{StoreSettings-CGdGsXfM.js → StoreSettings-B-5h8khw.js} +1 -1
- package/_assets/{Success-BPa6R_y7.js → Success-WtdmYzqq.js} +1 -1
- package/_assets/{SwapController-DTaoSWcm.js → SwapController-B06dfOof.js} +1 -1
- package/_assets/{Tooltip-D6SxCt3L.js → Tooltip-BmUhsRQ4.js} +1 -1
- package/_assets/{TradeService-CWMA10hp.js → TradeService-BBaiKRjC.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-Up9j0_9e.js → W3MFrameProviderSingleton-DgVLAVdI.js} +3 -3
- package/_assets/{WebCryptoP256-DToW1FZN.js → WebCryptoP256-DgRMEbAt.js} +1 -1
- package/_assets/{authorizations-l2pjp6ra.js → authorizations-CF0Jz7zc.js} +1 -1
- package/_assets/{basic-Cty0Hn3n.js → basic-DhtfgC6H.js} +1 -1
- package/_assets/{biconomy-BNQq871u.js → biconomy-DDKaByAB.js} +1 -1
- package/_assets/{browseLayout.styles-BTdWCtmC.js → browseLayout.styles-B4v7hmwf.js} +1 -1
- package/_assets/{builder-Di3-_L-M.js → builder-ChhBoKFF.js} +1 -1
- package/_assets/buy-CmG8tf3H.js +1 -0
- package/_assets/buy-gasless-DSmUCqlW.js +1 -0
- package/_assets/{categories-CllZxtAd.js → categories-CSOiZzd4.js} +1 -1
- package/_assets/{ccip-D_VJyqVH.js → ccip-CJAvou1M.js} +1 -1
- package/_assets/{ccip-BqmnC0MC.js → ccip-LHlVm2wr.js} +1 -1
- package/_assets/{clsx-CWa7LSwg.js → clsx-ZCrIBec8.js} +1 -1
- package/_assets/{controller-NZEGD8Sk.js → controller-DwE4g_2M.js} +2 -2
- package/_assets/{core-Cf89Y33y.js → core-BA8_g96V.js} +4 -4
- package/_assets/{createSvgIcon-BMWFEF8o.js → createSvgIcon-Uk0jby9l.js} +1 -1
- package/_assets/{custom-DevxItCm.js → custom-nMD7l25w.js} +1 -1
- package/_assets/{data-capture-BfmytewB.js → data-capture-BVNWhwZ1.js} +1 -1
- package/_assets/{email-M7-J6szQ.js → email-BZ8uIRtY.js} +1 -1
- package/_assets/{embedded-wallet-wT68YqvA.js → embedded-wallet-DoNYzvwH.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CUE0cLeS.js → emotion-styled.browser.esm-BFowzigV.js} +1 -1
- package/_assets/{engine-CfkuiYg8.js → engine-qPcXRd9M.js} +1 -1
- package/_assets/{errors-KUxsPjc1.js → errors-BSroDJv9.js} +1 -1
- package/_assets/{estimate-l1-fee-DgEDdWaG.js → estimate-l1-fee-_BDqdTd7.js} +1 -1
- package/_assets/{execute-CRHmgg19.js → execute-BQ1A-drl.js} +2 -2
- package/_assets/{features-Cg8KYE1g.js → features-Bf3CwXQj.js} +1 -1
- package/_assets/{fetchTokenMetadata-Brt7iJuI.js → fetchTokenMetadata-DM7mIFSO.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-DHwNkN-f.js → get-ecosystem-wallet-info-BxLHY-gg.js} +1 -1
- package/_assets/{getBalance-Coyl4v8z.js → getBalance-Cc1LECvV.js} +1 -1
- package/_assets/{getNFT-BKewD_XC.js → getNFT-C3N0w-oZ.js} +1 -1
- package/_assets/{getNFT-BhZQcTHF.js → getNFT-vfcV98co.js} +1 -1
- package/_assets/{getThemeProps-BleO2d8s.js → getThemeProps-KHmQwg_K.js} +1 -1
- package/_assets/{grid.styles-B_J9ea9g.js → grid.styles-DXgszB2_.js} +1 -1
- package/_assets/{hashTypedData-BbVOxwVx.js → hashTypedData-BNo5UTY9.js} +1 -1
- package/_assets/{hashTypedData-wikBKILq.js → hashTypedData-HULEGyjx.js} +1 -1
- package/_assets/{import-DRTXBO-H.js → import-ZIDUEKbG.js} +1 -1
- package/_assets/{in-app-B8k-OxsR.js → in-app-B9iICrzz.js} +1 -1
- package/_assets/{in-app-wallet-calls-D2yLkLKO.js → in-app-wallet-calls-CX2g12F1.js} +1 -1
- package/_assets/{index-BpH8IsVt.js → index-0j8XZkp-.js} +1 -1
- package/_assets/{index-BnwtKDC1.js → index-1d3-x1rh.js} +1 -1
- package/_assets/{index-DkW5d1J_.js → index-8LAOzxc6.js} +1 -1
- package/_assets/{index-D3KlXzVo.js → index-B3eXZooe.js} +1 -1
- package/_assets/{index-BTXvPglS.js → index-B7fpmmRp.js} +1 -1
- package/_assets/{index-BTCix11o.js → index-BDK-ARPZ.js} +1 -1
- package/_assets/{index-B4bY23Ch.js → index-BFwmcdNv.js} +1 -1
- package/_assets/{index-C7RAQf_k.js → index-BJ-5-45E.js} +1 -1
- package/_assets/{index-CvWiBNPK.js → index-BWz3it-f.js} +1 -1
- package/_assets/{index-Bfu_5Xfq.js → index-BcBsWJbF.js} +3 -3
- package/_assets/{index-DzmKFBug.js → index-Bj0T75Zb.js} +1 -1
- package/_assets/{index-DzyAcfNQ.js → index-BkjJan1L.js} +1 -1
- package/_assets/{index-a8qdptJt.js → index-Bm0tlsLz.js} +1 -1
- package/_assets/{index-BnUB8DIO.js → index-BmLor9GB.js} +1 -1
- package/_assets/{index-3TPWDixa.js → index-Bxc2_IRT.js} +1 -1
- package/_assets/{index-xLnNEcRT.js → index-BzrDs4Td.js} +1 -1
- package/_assets/{index-mJus6QV8.js → index-C037yeS-.js} +2 -2
- package/_assets/{index-D519dauQ.js → index-C0tjY7vU.js} +1 -1
- package/_assets/{index-BwMuQO6X.js → index-C4gV4KjJ.js} +1 -1
- package/_assets/{index-D1ByR6fU.js → index-C7lcq4Tv.js} +1 -1
- package/_assets/{index-Cuo7ZZaI.js → index-CEk6kTmL.js} +1 -1
- package/_assets/{index-B0ZCBL9f.js → index-CGETkZSz.js} +1 -1
- package/_assets/{index-DM1pntlB.js → index-CH1d-JeS.js} +1 -1
- package/_assets/{index-D-KNV28z.js → index-CNnBAXWS.js} +1 -1
- package/_assets/{index-BvfmNSpH.js → index-CSA4TC8H.js} +1 -1
- package/_assets/{index-SnatkYlW.js → index-CTgTPfau.js} +47 -47
- package/_assets/{index-CVuxedLW.js → index-CU_IDDYv.js} +1 -1
- package/_assets/{index-CJagtSlr.js → index-Cf5lMjiv.js} +1 -1
- package/_assets/{index-DBbdruUG.js → index-Cf7_dbcw.js} +1 -1
- package/_assets/{index-G3Ryecli.js → index-Cjy5_x2c.js} +1 -1
- package/_assets/{index-C2epIPF0.js → index-CnbvqgkW.js} +1 -1
- package/_assets/{index-BBqenras.js → index-CtBrQu_x.js} +1 -1
- package/_assets/{index-O5vqGJvg.js → index-CyssULnt.js} +2 -2
- package/_assets/{index-a5E5obaq.js → index-DD02_fiR.js} +1 -1
- package/_assets/{index-BEZy2kiZ.js → index-DDer0-bc.js} +1 -1
- package/_assets/{index-CTNKpIIA.js → index-DbyCzlir.js} +2 -2
- package/_assets/{index-CVyf8XnA.js → index-Di2SThjr.js} +1 -1
- package/_assets/{index-CErJOCk2.js → index-DiV5E2Po.js} +1 -1
- package/_assets/{index-BnCW_xNv.js → index-DlHvoEXp.js} +1 -1
- package/_assets/{index-_V3tt-3H.js → index-Ds5bxoqI.js} +3 -3
- package/_assets/{index-BNwHqnqL.js → index-DsBlZ8tD.js} +1 -1
- package/_assets/{index-B0lxP1DD.js → index-FmQQUGYi.js} +1 -1
- package/_assets/{index-Cw6JZm5x.js → index-G3mcVVeX.js} +1 -1
- package/_assets/{index-B8V1K3Kv.js → index-Tgg_ps7g.js} +1 -1
- package/_assets/{index-BWiYg5Rl.js → index-ULQalB3y.js} +1 -1
- package/_assets/{index-BvtRZe5k.js → index-Uq1rqDyA.js} +1 -1
- package/_assets/{index-CndgbGyL.js → index-VRxHxxdJ.js} +1 -1
- package/_assets/{index-BfbzCqVh.js → index-mxM_6Uej.js} +1 -1
- package/_assets/{index-BasWfxS1.js → index-w_HUbD8-.js} +3 -3
- package/_assets/{index-6PDE0uos.js → index-yRkhEq4H.js} +1 -1
- package/_assets/{index-NvkQ05pR.js → index-yvV-m3yt.js} +1 -1
- package/_assets/{index.es-Ssx_pD4W.js → index.es-BB0mhjKh.js} +1 -1
- package/_assets/{index.es-DJ2J7PmC.js → index.es-Cq9-SMU6.js} +1 -1
- package/_assets/{index.es-Dmr4kGvf.js → index.es-DCMF5xca.js} +4 -4
- package/_assets/{localBatchGatewayRequest-DQ23aY3O.js → localBatchGatewayRequest-B7JF9w3d.js} +1 -1
- package/_assets/{mana-convert-BfTFhCWx.js → mana-convert-BLzyDqwI.js} +1 -1
- package/_assets/{mana-rate-DQvXAW-r.js → mana-rate-BuRu4Dbb.js} +1 -1
- package/_assets/{networks-Blk7C537.js → networks-DYC4Jira.js} +1 -1
- package/_assets/{onramp-BviXYSBr.js → onramp-lB0gtFXb.js} +1 -1
- package/_assets/{openzeppelin-6dKRPdCc.js → openzeppelin-DczPwLsZ.js} +1 -1
- package/_assets/{parseNft-CtRKTWE9.js → parseNft-Xx1jcq1t.js} +2 -2
- package/_assets/{parseSignature-DLEbnOTW.js → parseSignature-B_ywiUgW.js} +3 -3
- package/_assets/{parseSignature-BINJ7GPa.js → parseSignature-CvsR0nWX.js} +1 -1
- package/_assets/{passkeys-Bmwq8w9j.js → passkeys-BorDfQEt.js} +1 -1
- package/_assets/{pay-with-exchange-BGI4bEs2.js → pay-with-exchange-D-lAYAST.js} +1 -1
- package/_assets/{qr-overlay-Bf6_zg17.js → qr-overlay-8uLAtEic.js} +1 -1
- package/_assets/{receive-A7FcFUgY.js → receive-BjdE5CiW.js} +1 -1
- package/_assets/{resolveImplementation-BEP8PoBl.js → resolveImplementation-BTVpSr1L.js} +1 -1
- package/_assets/{rpc-Cz8kqv2P.js → rpc-B0EzNjPI.js} +1 -1
- package/_assets/{secp256k1-COS0u8tH.js → secp256k1-C3Bgsx-A.js} +1 -1
- package/_assets/{secp256k1-DkfX7UfL.js → secp256k1-GAuYrMZg.js} +1 -1
- package/_assets/{secp256k1-BICKEbsl.js → secp256k1-QiPyD_fs.js} +1 -1
- package/_assets/{send-C1bOQmru.js → send-BNKRlWjs.js} +1 -1
- package/_assets/{send-batch-transaction-CTKHdu5I.js → send-batch-transaction-Ct4Z2yZa.js} +1 -1
- package/_assets/{send-eip712-transaction-xrNQTMCo.js → send-eip712-transaction-DUKkJwby.js} +2 -2
- package/_assets/{send-gasless-transaction-Ct7GIvVu.js → send-gasless-transaction-CLZsc_C3.js} +2 -2
- package/_assets/{send-transaction-D32Nt_MU.js → send-transaction-DjedQNrB.js} +2 -2
- package/_assets/{sendMetaTransaction-BazAYyjj.js → sendMetaTransaction-Bwds-XF_.js} +1 -1
- package/_assets/{sendRawTransaction-B7gCMfmV.js → sendRawTransaction-CYzsBrK5.js} +3 -3
- package/_assets/{serializeTransaction-CDMVosJ8.js → serializeTransaction-DJcAcQb3.js} +1 -1
- package/_assets/{session-proposal-C7FOdfm-.js → session-proposal-B-D3yWr1.js} +1 -1
- package/_assets/{session-request-Bbpt6ucy.js → session-request-CFw9hsoK.js} +2 -2
- package/_assets/{signing-DHE_GQfk.js → signing-3yV1YTdS.js} +3 -3
- package/_assets/{socials-yuX7-67Q.js → socials-Ux_0_Guq.js} +1 -1
- package/_assets/{swaps-DVEpS93p.js → swaps-Du_IonW5.js} +1 -1
- package/_assets/{thirdweb-DTL_1hCo.js → thirdweb-Dto6kXDX.js} +3 -3
- package/_assets/{to-serializable-transaction-BvJIy5Zl.js → to-serializable-transaction-CCJZxhM6.js} +2 -2
- package/_assets/{trade-encoding-27XruNjb.js → trade-encoding-C5_Qc6q5.js} +1 -1
- package/_assets/{transactionReceipt-BjbJcaw1.js → transactionReceipt-BUOeDR9-.js} +1 -1
- package/_assets/{transactions-CK838wy6.js → transactions-CIX4Ko-U.js} +1 -1
- package/_assets/useCreditPacks-DuYdU54_.js +1 -0
- package/_assets/{useInfiniteGrid-BtKbEsLc.js → useInfiniteGrid-GTSHBqBp.js} +1 -1
- package/_assets/useManaRate-CAVBb8P6.js +1 -0
- package/_assets/{useSecondarySales-H09-0v6A.js → useSecondarySales-keni21Uk.js} +1 -1
- package/_assets/{useStore-C3kED1kY.js → useStore-CNlO4piy.js} +1 -1
- package/_assets/{useTheme-DvS9QiwE.js → useTheme-ucfeAXGm.js} +1 -1
- package/_assets/{verifyHash-3R0ho2ZX.js → verifyHash-G83SSWVH.js} +1 -1
- package/_assets/{w3m-modal-CbE-vkW2.js → w3m-modal-D0kzWk0t.js} +1 -1
- package/_assets/{w3m-modal-DFuSKjsw.js → w3m-modal-K2V3STJK.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BCDL4fay.js → wait-for-tx-receipt-nSP3CsF4.js} +1 -1
- package/_assets/{wallets-B239PApP.js → wallets-CHRtCYWT.js} +5 -5
- package/_assets/{web-connector-Io0X-xXE.js → web-connector-CIcgciEI.js} +3 -3
- package/_assets/{writeContract-CjmZVeKM.js → writeContract-Bu8cH2_h.js} +1 -1
- package/_assets/{zoraTestnet-CKPGiW2H.js → zoraTestnet-B4HBXh-2.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-4EoClBeZ.js +0 -695
- package/_assets/buy-Ac54hNqf.js +0 -1
- package/_assets/buy-gasless-Lul2eVlm.js +0 -1
- package/_assets/useCreditPacks-DBXU0y25.js +0 -1
- package/_assets/useManaRate-Bl28IAka.js +0 -1
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t as le,s as i,e as s,J as de,aj as aa,G as sa,I as H,z as Mt,H as Qe,m as na,ak as U,Q as dt,n as ia,u as ra,al as oa,E as ca,am as da,an as la,ao as ua,ap as ha,y as pa,aq as lt,ar as G,as as ut,at as ga,l as ae,c as ht,au as xa,h as ma,av as pt,aw as _e,ax as ye,ay as be,az as gt,a as ve,b as fa,C as We,aA as ya}from"./index-CTgTPfau.js";import{M as ba,S as va,C as wa,H as Ca,a as ja,T as ka,X as $a,b as Sa,B as Ma,c as Ta,d as xt,e as Ia,f as ke,P as Tt,m as Pa,g as za,h as Aa,i as Ea,j as It,k as $e,L as qa,l as Ba,n as mt,o as ft,W as Ra,p as _a,q as Wa,A as Fa,r as La,s as Ka,t as Na,u as Qa,v as Ua,w as Ha,x as Oa,y as Va,z as Ga,D as Da,E as Ya,F as Ja,G as Xa,I as Za,J as es,K as Fe,N as ts,O as as,Q as ss,R as ns,U as yt,V as bt,Y as is,Z as rs,_ as os}from"./CollectionCarousel-D5pSydH6.js";import{u as cs}from"./useManaRate-CAVBb8P6.js";import{r as ds}from"./mana-rate-BuRu4Dbb.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-CF0Jz7zc.js";import{g as ms,b as Le}from"./buy-CmG8tf3H.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-DSmUCqlW.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-DuYdU54_.js";import{i as ks,a as $s}from"./errors-BSroDJv9.js";import{E as Ss}from"./ErrorNotice-CGArNL-E.js";import{u as Ct}from"./mana-convert-BLzyDqwI.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-C5_Qc6q5.js";import"./sendMetaTransaction-Bwds-XF_.js";const{colors:se,radius:Ms}=le,Ts=i.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,Is=i.span`
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: ${se.text2};
|
|
11
|
+
text-transform: capitalize;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
`,Ps=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 ${se.media};
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar {
|
|
29
|
+
width: 8px;
|
|
30
|
+
}
|
|
31
|
+
&::-webkit-scrollbar-track {
|
|
32
|
+
background: ${se.media};
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
}
|
|
35
|
+
&::-webkit-scrollbar-thumb {
|
|
36
|
+
background: #a2a2a2;
|
|
37
|
+
border-radius: ${Ms.btn};
|
|
38
|
+
}
|
|
39
|
+
`,zs=i.span`
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: ${se.muted};
|
|
44
|
+
`,As=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: ${se.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: ${se.text};
|
|
60
|
+
}
|
|
61
|
+
`,Es="https://cdn.decentraland.org/@dcl/shop/0.1.0-30805756836.commit-b10a0ac/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ba,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(va,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(wa,{"data-tall":Y||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:D}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Sa,{})})]}),e.jsxs(Ma,{children:[e.jsx(Ta,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ia,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(As,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Pa(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Bs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Rs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(za,{"data-testid":"buy-error",children:[e.jsx(Aa,{src:Es,alt:"",width:64,height:80}),e.jsxs(Ea,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Bs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(qa,{src:aa,alt:"",width:61,height:61}),e.jsx(Ba,{children:ne}),D?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Is,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Rs({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ra,{"data-testid":"nofunds-warning",children:[e.jsx(_a,{}),e.jsxs(Wa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(Ps,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Fa,{children:[e.jsx(La,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ka,{children:[e.jsxs("div",{children:[e.jsxs(Na,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(zs,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Qa,{address:n.item.creator}):null]}),e.jsxs(Ua,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Oa,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Va,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ga,{}),e.jsx(Da,{children:de(n.credits)}),e.jsxs(Ya,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Ja,{children:[e.jsxs(Xa,{children:[e.jsx(Za,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(es,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
|
+
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
|
+
${T} {
|
|
72
|
+
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
+
}
|
|
74
|
+
`,kt=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
|
+
${T} {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
`,_s=i.div`
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
align-items: start;
|
|
106
|
+
|
|
107
|
+
${zt} {
|
|
108
|
+
grid-template-columns: 1fr;
|
|
109
|
+
}
|
|
110
|
+
`,$t=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
|
+
${T} {
|
|
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
|
+
`,Ws=i.div`
|
|
124
|
+
min-width: 0;
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
gap: 12px;
|
|
128
|
+
`,Fs=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
|
+
${T} {
|
|
138
|
+
gap: 8px;
|
|
139
|
+
padding: 12px;
|
|
140
|
+
}
|
|
141
|
+
`,At=i.section`
|
|
142
|
+
min-width: 0;
|
|
143
|
+
background: ${r.white};
|
|
144
|
+
border-radius: 16px;
|
|
145
|
+
padding: 24px;
|
|
146
|
+
|
|
147
|
+
${T} {
|
|
148
|
+
padding: 16px;
|
|
149
|
+
}
|
|
150
|
+
`,Ls=i(At)`
|
|
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
|
+
${le.media.maxWidth("mobile")} {
|
|
162
|
+
min-height: 320px;
|
|
163
|
+
padding: 32px 16px;
|
|
164
|
+
}
|
|
165
|
+
`,Ks=i.div`
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: 12px;
|
|
170
|
+
padding-bottom: 16px;
|
|
171
|
+
`,Ns=i.p`
|
|
172
|
+
margin: 0;
|
|
173
|
+
font-size: 24px;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
line-height: 1.6;
|
|
176
|
+
|
|
177
|
+
${le.media.maxWidth("mobile")} {
|
|
178
|
+
font-size: 20px;
|
|
179
|
+
}
|
|
180
|
+
`,Qs=i.p`
|
|
181
|
+
margin: 0;
|
|
182
|
+
font-size: 20px;
|
|
183
|
+
font-weight: 400;
|
|
184
|
+
line-height: 1.6;
|
|
185
|
+
|
|
186
|
+
${le.media.maxWidth("mobile")} {
|
|
187
|
+
font-size: 16px;
|
|
188
|
+
}
|
|
189
|
+
`,Us=i(Se)`
|
|
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: ${Z.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
|
+
`,Hs=i.button`
|
|
216
|
+
display: none;
|
|
217
|
+
|
|
218
|
+
${T} {
|
|
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
|
+
`,Os=i.h1`
|
|
234
|
+
margin: 0;
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
line-height: 1.57;
|
|
238
|
+
color: ${r.text};
|
|
239
|
+
|
|
240
|
+
${T} {
|
|
241
|
+
flex: 1;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
font-size: 16px;
|
|
244
|
+
}
|
|
245
|
+
`,Vs=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: ${Z.btn};
|
|
254
|
+
background:
|
|
255
|
+
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
256
|
+
${Pt.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
|
+
${T} {
|
|
281
|
+
height: 36px;
|
|
282
|
+
padding: 0 10px;
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
}
|
|
285
|
+
`,Gs=i.div`
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
gap: 24px;
|
|
289
|
+
`,Ds=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: ${Z.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
|
+
`,Ys=i.div`
|
|
309
|
+
position: relative;
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
width: 137.5px;
|
|
312
|
+
height: 137px;
|
|
313
|
+
background: ${r.media};
|
|
314
|
+
border-radius: ${Z.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
|
+
${T} {
|
|
327
|
+
width: 120px;
|
|
328
|
+
height: 120px;
|
|
329
|
+
}
|
|
330
|
+
`,Js=i(Se)`
|
|
331
|
+
position: absolute;
|
|
332
|
+
inset: 0;
|
|
333
|
+
display: grid;
|
|
334
|
+
place-items: center;
|
|
335
|
+
`,Xs=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
|
+
`,Zs=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
|
+
${T} {
|
|
355
|
+
padding: 12px 4px 12px 0;
|
|
356
|
+
}
|
|
357
|
+
`,en=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
|
+
`,Et=Qe`
|
|
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
|
+
${T} {
|
|
379
|
+
white-space: normal;
|
|
380
|
+
display: -webkit-box;
|
|
381
|
+
-webkit-line-clamp: 2;
|
|
382
|
+
line-clamp: 2;
|
|
383
|
+
-webkit-box-orient: vertical;
|
|
384
|
+
}
|
|
385
|
+
`,tn=i.div`
|
|
386
|
+
${Et};
|
|
387
|
+
`,an=i(Se)`
|
|
388
|
+
${Et};
|
|
389
|
+
`,sn=i(sa)`
|
|
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
|
+
`,nn=i.div`
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: space-between;
|
|
405
|
+
gap: 12px;
|
|
406
|
+
padding-right: 8px;
|
|
407
|
+
`,rn=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: ${Z.pill};
|
|
414
|
+
`,St=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
|
+
`,on=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
|
+
`,cn=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
|
+
${T} {
|
|
448
|
+
font-size: 20px;
|
|
449
|
+
}
|
|
450
|
+
`,dn=i(Mt)`
|
|
451
|
+
width: 24px;
|
|
452
|
+
height: 24px;
|
|
453
|
+
background: ${r.text};
|
|
454
|
+
|
|
455
|
+
${T} {
|
|
456
|
+
width: 20px;
|
|
457
|
+
height: 20px;
|
|
458
|
+
}
|
|
459
|
+
`,ln=i.span`
|
|
460
|
+
margin-left: 6px;
|
|
461
|
+
font-size: 14px;
|
|
462
|
+
font-weight: 500;
|
|
463
|
+
color: ${r.muted};
|
|
464
|
+
text-decoration: line-through;
|
|
465
|
+
`,un=i.div`
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 9px;
|
|
468
|
+
right: 7px;
|
|
469
|
+
display: flex;
|
|
470
|
+
align-items: flex-start;
|
|
471
|
+
gap: 12px;
|
|
472
|
+
`,hn=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
|
+
`,pn=i(H)`
|
|
482
|
+
color: #f48221;
|
|
483
|
+
`,gn=i(Se)`
|
|
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
|
+
`,xn=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: ${Z.chip};
|
|
506
|
+
background: #f4e9ff;
|
|
507
|
+
font-size: 10px;
|
|
508
|
+
font-weight: 400;
|
|
509
|
+
line-height: 14px;
|
|
510
|
+
color: ${r.text};
|
|
511
|
+
`,mn=i(H)`
|
|
512
|
+
width: 11.31px;
|
|
513
|
+
height: 10.94px;
|
|
514
|
+
background: ${r.text};
|
|
515
|
+
`,qt=Qe`
|
|
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
|
+
`,fn=i.button`
|
|
532
|
+
${qt};
|
|
533
|
+
|
|
534
|
+
&:hover:not(:disabled) {
|
|
535
|
+
color: ${r.text};
|
|
536
|
+
}
|
|
537
|
+
&[data-on] {
|
|
538
|
+
color: ${r.dclRed};
|
|
539
|
+
}
|
|
540
|
+
`,yn=i.button`
|
|
541
|
+
${qt};
|
|
542
|
+
|
|
543
|
+
&:hover:not(:disabled) {
|
|
544
|
+
color: ${r.dclRed};
|
|
545
|
+
}
|
|
546
|
+
`,bn=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
|
+
`,vn=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
|
+
${zt} {
|
|
570
|
+
position: static;
|
|
571
|
+
}
|
|
572
|
+
${T} {
|
|
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
|
+
`,wn=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
|
+
${T} {
|
|
592
|
+
margin-bottom: 12px;
|
|
593
|
+
padding-bottom: 12px;
|
|
594
|
+
}
|
|
595
|
+
`,Cn=i.div`
|
|
596
|
+
display: flex;
|
|
597
|
+
flex-direction: column;
|
|
598
|
+
gap: 12px;
|
|
599
|
+
`,jn=i.div`
|
|
600
|
+
display: flex;
|
|
601
|
+
align-items: flex-start;
|
|
602
|
+
justify-content: space-between;
|
|
603
|
+
gap: 12px;
|
|
604
|
+
`,kn=i.span`
|
|
605
|
+
font-size: 14px;
|
|
606
|
+
font-weight: 600;
|
|
607
|
+
line-height: 1.57;
|
|
608
|
+
color: ${r.muted1};
|
|
609
|
+
`,$n=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
|
+
`,Sn=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 Mn=i(Mt)`
|
|
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
|
+
`,Tn=i.button`
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: 56px;
|
|
638
|
+
border: 0;
|
|
639
|
+
border-radius: ${Z.btn};
|
|
640
|
+
background: ${Pt.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
|
+
`,Bt=Qe`
|
|
662
|
+
margin: 0;
|
|
663
|
+
font-size: 13px;
|
|
664
|
+
`,Ce=i.p`
|
|
665
|
+
${Bt};
|
|
666
|
+
`,In=i(Ss)`
|
|
667
|
+
${Bt};
|
|
668
|
+
`,Pn=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 Ke(o){if(ks(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ma.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const zn=12e4;function An(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ne=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Jn(){na({title:s("nav.cart"),noindex:!0});const o=U(t=>t.items),l=U(t=>t.remove),I=U(t=>t.increment),z=U(t=>t.decrement),W=U(t=>t.clear),D=U(t=>t.restore),Y=U(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ia(),ue=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(t=>t.category!=="emote"),{data:Me}=ra({queryKey:["upsell-listings"],queryFn:()=>ya({first:40}),staleTime:6e4}),{data:$}=oa(n),b=ca(),ee=ea(),{state:J}=ta(),[_t,ie]=P.useState(null),[Ue,he]=P.useState(null),[Wt,B]=P.useState(!1),[R,O]=P.useState(null),He=P.useRef(0),[p,j]=P.useState(null),{data:pe}=da(n),{data:re}=cs(!0),[Te,Oe]=P.useState(""),oe=P.useRef(null),Ve=la(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Ft=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Lt=o.reduce((t,a)=>t+a.quantity,0),Kt=Ie.reduce((t,a)=>t+a.quantity,0),De=R?R.liveTotalCredits:Ft,Nt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Ut=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Ut,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Ot=ga,Vt=t=>xa(t.contractAddress,String(t.itemId));function me(t){t(),O(null),he(null),ie(null)}function Gt(){j(null),B(!1)}function Je(t){const a=Ne(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Oe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:Q,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:Q.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[Q],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[Q],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await _e(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ms(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),N=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ls()&&!v)try{const m=new Map;f=await fs({purchases:N,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:Q})=>{m.set(C,Q),Q.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>ys(C)));x.forEach((C,Q)=>{const X=m.get(f[Q])??[];C.status==="fulfilled"?(X.forEach(Re=>S.add(Re)),E.push(f[Q])):C.reason instanceof vt||X.forEach(Re=>_.add(Re))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof bs))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>_.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>_.add(x))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),B(!1);const Be={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Be,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!_.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,N)=>v+N.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await _e(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),O(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),B(!1)}async function Dt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await gs({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ds(ht.chainId),staleTime:6e4})}catch{return}}async function Yt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ne(t),{totalCents:c,manaWei:u}=await Yt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:_}=at(a,t);await st(S,_,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Jt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(fa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=us(a,t),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){B(!1),fe({auth:c,run:d});return}d()}function Xt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await is({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=rs(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),_=os(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const N=g[f].item,{credit:ce,maxCreditedValue:Be}=await pt(n.identity,v,g[f].trade.id,N.contractAddress&&N.itemId!=null?{contractAddress:N.contractAddress,itemId:String(N.itemId)}:void 0);E.push({salt:ce.id,itemId:N.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Be})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Dt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&_e(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=U.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),B(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await Cs(a,n.address,Ot,await et(),Vt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(An(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),He.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{B(!1)}}async function rt(){if(R){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-He.current>zn){O(null),he(null),await te();return}ie(null),tt(R.buyable)}}async function Zt(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(U.getState().items))}catch{}B(!0);try{const t=await js(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!ts("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ls,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Ks,{children:[e.jsx(Ns,{children:s("cart.empty.title")}),e.jsx(Qs,{children:s("cart.empty.body")})]}),e.jsx(Us,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(_s,{children:[e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsx(Hs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Os,{children:s("cart.panelTitle",{count:Lt})}),Rt?e.jsxs(Vs,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Gs,{children:o.map(t=>{const a=Qt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,_=ua(t),E=!!_&&!!A[_],q=ha(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ds,{"data-unavailable":g||void 0,children:[e.jsxs(Ys,{"data-thumb":!0,children:[q?e.jsx(Js,{to:q,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(Xs,{"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(Zs,{children:[e.jsxs(en,{"data-desc":!0,children:[q?e.jsx(an,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(tn,{title:t.name,children:t.name}),t.creator?e.jsx(sn,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(xn,{"data-testid":"cart-creator-tag",children:[e.jsx(mn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(nn,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(hn,{children:[e.jsx(pn,{name:"warning-fill",size:24}),k]}),q?e.jsx(gn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(rn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||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(on,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"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(cn,{children:[e.jsx(dn,{})," ",S,c?e.jsx(ln,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(un,{children:[_?e.jsx(fn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(yn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(bn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(vn,{children:[e.jsx(wn,{children:s("cart.purchaseSummary")}),e.jsxs(Cn,{children:[e.jsxs(jn,{children:[e.jsx(kn,{children:s("cart.totalItems",{count:Kt})}),e.jsx(Sn,{children:e.jsxs($n,{children:[e.jsx(Mn,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:R?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(R?rt():te(t))}):e.jsx(Tn,{onClick:()=>void(R?rt():te()),disabled:V||Pe,children:V?s("cart.working"):R?s("marketCheckout.confirmPurchase"):s("assetCard.buyNow")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),R?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Ue?e.jsx(Ce,{className:"muted",children:Ue}):null,e.jsx(In,{message:_t})]})]})]})]}),Ye.length>0?e.jsx(Pn,{children:e.jsx(as,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ss,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:ns,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(qs,{phase:p.phase,balanceCredits:ge,onClose:Gt,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:pa(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Jt(p).options:void 0,onPay:Xt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ne(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:Oe,onBuyPacks:()=>void Zt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Jn as Cart};
|