@dcl/shop 1.2.1-31142410827.commit-447715b → 1.3.0
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-CxjV6VXk.js → Activity-ew3XpoT3.js} +4 -4
- package/_assets/{AnimatedBackground-BiXIwT8i.js → AnimatedBackground-D_nEuM-e.js} +1 -1
- package/_assets/{Assets-DVK807CG.js → Assets-cBlMqNjz.js} +18 -18
- package/_assets/{Assets.styles-A3yRI2MU.js → Assets.styles-CLwfDCDf.js} +1 -1
- package/_assets/{Authorizations-D1FoQR5j.js → Authorizations-Cs0nL4Oz.js} +3 -3
- package/_assets/Cart-BO4t_lkf.js +696 -0
- package/_assets/{CircularProgress-D5sNhvlC.js → CircularProgress-GqV7M35A.js} +4 -4
- package/_assets/{Collection-Bqw8AoVr.js → Collection-dJYcennk.js} +7 -7
- package/_assets/CollectionCarousel-uJ5UjL8j.js +872 -0
- package/_assets/{Confetti-CDwPqeLK.js → Confetti-CFn9Pw72.js} +1 -1
- package/_assets/{Creator-6eREKFWS.js → Creator-CuGxdrmY.js} +23 -23
- package/_assets/{ErrorNotice-BQwK_TDE.js → ErrorNotice-CJ7LbSaM.js} +1 -1
- package/_assets/{ExchangeController-BX6K_R7F.js → ExchangeController-CwGAtelJ.js} +1 -1
- package/_assets/{Faq-D_JBmT_h.js → Faq-CDhDmUOq.js} +1 -1
- package/_assets/{GetCredits-Q0Mgpypn.js → GetCredits-1I-xEtGF.js} +18 -18
- package/_assets/{Grow-DXIhfb0h.js → Grow-CVnVH5HV.js} +1 -1
- package/_assets/{HelpersUtil-BTJgul2J.js → HelpersUtil-DeEtn4Uv.js} +1 -1
- package/_assets/ItemDetail-R2KchS-D.js +3577 -0
- package/_assets/LazyEmoteControls-C8q58ZLn.js +2 -0
- package/_assets/{LoadMore-D20OD6Vd.js → LoadMore-CRwBs35r.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-DGbgCot9.js → ManaPricingBanner.styles-BlUs3NYz.js} +1 -1
- package/_assets/{MyAssets-D-pR6nEY.js → MyAssets-Crv1OZqH.js} +5 -5
- package/_assets/{MyFavorites-BZJTE-15.js → MyFavorites-BsDoGy_0.js} +1 -1
- package/_assets/{NotFound-CY50b1nf.js → NotFound-CTrYO3ch.js} +1 -1
- package/_assets/{NotificationsBell-B4g5IIot.js → NotificationsBell-DRGgz2iS.js} +1 -1
- package/_assets/{OutfitDetail-BVF3gVX4.js → OutfitDetail-PIgUTZD2.js} +13 -13
- package/_assets/{OutfitPreview-BH8Vtdqe.js → OutfitPreview-B7Y1-68b.js} +2 -2
- package/_assets/{OutfitStudio-CkkYfM7v.js → OutfitStudio-Bsv8_JeA.js} +11 -11
- package/_assets/{StoreSettings-ByjR6E4Q.js → StoreSettings-BH1LqeM8.js} +5 -5
- package/_assets/{Success-ChdN3XnW.js → Success-C0JqrNNn.js} +4 -4
- package/_assets/{SwapController-BSn7c8IX.js → SwapController-B403gwlM.js} +1 -1
- package/_assets/{Tooltip-C20chtvP.js → Tooltip-Bb6q6TxX.js} +1 -1
- package/_assets/TradeService-BsjSuIVy.js +1 -0
- package/_assets/{W3MFrameProviderSingleton-DM1LkzC3.js → W3MFrameProviderSingleton-B6S06Y_H.js} +3 -3
- package/_assets/{WebCryptoP256-DtXjN3TD.js → WebCryptoP256-CI6-qWGK.js} +1 -1
- package/_assets/authorizations-CRcoV7f0.js +1 -0
- package/_assets/{basic-CKrSeG36.js → basic-DEn_IlUm.js} +1 -1
- package/_assets/{biconomy-CraeH257.js → biconomy-DvPM-XBT.js} +1 -1
- package/_assets/{builder-C8bXNaZ5.js → builder-Npez-0pQ.js} +1 -1
- package/_assets/buy-CRR9-X2w.js +1 -0
- package/_assets/buy-gasless-Cj1VGZpP.js +1 -0
- package/_assets/{categories-C5jojgbc.js → categories-CMYRFP-3.js} +4 -4
- package/_assets/{ccip-BTuFCSPg.js → ccip-Bvp_nKL6.js} +1 -1
- package/_assets/{ccip-Bb0XTJKs.js → ccip-DFr4gxX6.js} +1 -1
- package/_assets/{collectionPage.styles-BQBK8RFg.js → collectionPage.styles-B4iEFMy_.js} +1 -1
- package/_assets/{controller-BslzK_oR.js → controller-CgyRh-Bw.js} +2 -2
- package/_assets/{core-A4i7e9_h.js → core-B7wRtbuZ.js} +4 -4
- package/_assets/{createSvgIcon-DtyE83ul.js → createSvgIcon-Bo9WJgq_.js} +4 -4
- package/_assets/{custom-IpjkpKYP.js → custom-CH6sSlIL.js} +1 -1
- package/_assets/{data-capture-BylIfDOD.js → data-capture-DreW3nks.js} +1 -1
- package/_assets/{email-C_gUvpJ8.js → email-pIKOIyQR.js} +1 -1
- package/_assets/{embedded-wallet-BZVHH3C_.js → embedded-wallet-CLmF0Kdd.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-BvfQxvDt.js → emotion-styled.browser.esm-BqTQ5SYv.js} +1 -1
- package/_assets/{engine-B73Qkzgt.js → engine-D64OXa1r.js} +1 -1
- package/_assets/{errors-CX9EJ2UZ.js → errors-BbwwHm_0.js} +1 -1
- package/_assets/{estimate-l1-fee-Bjxio48q.js → estimate-l1-fee-BU85AjOG.js} +1 -1
- package/_assets/{execute-BR9GMA2A.js → execute-BozDg2yb.js} +2 -2
- package/_assets/{features-CoryLSMJ.js → features-BDTF_ohu.js} +1 -1
- package/_assets/{fetchTokenMetadata-BcVWHlEL.js → fetchTokenMetadata-BT4wvs8u.js} +2 -2
- package/_assets/{field.styles-BX2ce_24.js → field.styles-C3qh-tZ2.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-BFR9-DCg.js → get-ecosystem-wallet-info-BlqgcGd0.js} +1 -1
- package/_assets/{getBalance-OP0XWTi2.js → getBalance-B89LWv-k.js} +1 -1
- package/_assets/{getNFT-BsALO_-5.js → getNFT-CMlAXi2W.js} +1 -1
- package/_assets/{getNFT--XquMmAd.js → getNFT-Cy5QJvSJ.js} +1 -1
- package/_assets/{grid.styles-D3oxiL_A.js → grid.styles-B2Eu32l1.js} +1 -1
- package/_assets/{hashTypedData-BZTDP8kP.js → hashTypedData-5hKkNljV.js} +1 -1
- package/_assets/{hashTypedData-CJy6tOpf.js → hashTypedData-CVMcc6Hz.js} +1 -1
- package/_assets/{in-app-bTj5LvvL.js → in-app-BiD_q7tQ.js} +1 -1
- package/_assets/{in-app-wallet-calls-V54KdLrU.js → in-app-wallet-calls-BxK-hX9G.js} +1 -1
- package/_assets/{index-D-JDvnI6.js → index-2KdRKXEu.js} +1 -1
- package/_assets/{index-B6qDcfLC.js → index-69aWe7LF.js} +1 -1
- package/_assets/{index-YzDw7lnB.js → index-BCSwRUu3.js} +1 -1
- package/_assets/{index-PfvTvnFS.js → index-BLQrxn9F.js} +1 -1
- package/_assets/{index-UKtYEQEQ.js → index-BNtwDdqR.js} +1 -1
- package/_assets/{index-DV6xJ5R3.js → index-BS9mRV4X.js} +1 -1
- package/_assets/{index-C8Kc50nN.js → index-BU93X1R1.js} +1 -1
- package/_assets/{index-zp7bpiif.js → index-Baqe51s4.js} +1 -1
- package/_assets/{index-Bs-rgt8S.js → index-BawFzGfz.js} +1 -1
- package/_assets/{index-Ceqm243m.js → index-BbAhN-VL.js} +1 -1
- package/_assets/{index-gDU5HG0M.js → index-BfrZo6vI.js} +1 -1
- package/_assets/{index-C8xBYuq6.js → index-Bj_Y4oBT.js} +1 -1
- package/_assets/{index-BfDKCK-b.js → index-Brr2CMye.js} +1 -1
- package/_assets/{index-CEAo9zba.js → index-BvQGZppV.js} +1 -1
- package/_assets/{index-CfuAIPVB.js → index-BwVlQTGw.js} +1 -1
- package/_assets/{index-CWbpUhbz.js → index-ByMxSKoO.js} +1 -1
- package/_assets/{index-DSeFRPGN.js → index-C0Tjm6c2.js} +2 -2
- package/_assets/{index-D8uCQOfi.js → index-C54j1-wd.js} +1 -1
- package/_assets/{index-BzlJrLzv.js → index-CD88wagS.js} +1 -1
- package/_assets/{index-CLKNbQ2Y.js → index-CGyHa-8V.js} +1 -1
- package/_assets/{index-0lnGEb9H.js → index-CKJapgfm.js} +1 -1
- package/_assets/{index-B2t9sa1E.js → index-CKK-zMqi.js} +72 -72
- package/_assets/{index-Bam-2vzo.js → index-CL_zZiR1.js} +1 -1
- package/_assets/{index-md2wV3Vc.js → index-COl_MS2X.js} +1 -1
- package/_assets/{index-DReHody5.js → index-CRNF_QU5.js} +1 -1
- package/_assets/{index-Tv4r9Lwx.js → index-CU54HyHs.js} +1 -1
- package/_assets/{index-w6ENWwBi.js → index-CdmghwAv.js} +1 -1
- package/_assets/{index-rkAdeG6n.js → index-CgPj91Wh.js} +1 -1
- package/_assets/{index-Bi2VdHZq.js → index-CoC4ZTSB.js} +3 -3
- package/_assets/{index-Cf_haBRI.js → index-D2gLfWlc.js} +1 -1
- package/_assets/{index-CNeTXjRv.js → index-D4mfZpjO.js} +2 -2
- package/_assets/{index-BFqY25SM.js → index-D6N8FICT.js} +2 -2
- package/_assets/{index-CJKoD8At.js → index-D7-5iUKs.js} +1 -1
- package/_assets/{index-BhMQwy2J.js → index-DKDGLsyf.js} +1 -1
- package/_assets/{index-Bu1qaX74.js → index-DQT21rdJ.js} +1 -1
- package/_assets/{index-DVvKTSOr.js → index-DRZIPiLU.js} +11 -11
- package/_assets/{index-2eCGZaTL.js → index-DRwratoB.js} +1 -1
- package/_assets/{index-D9DKKnsH.js → index-DmJfaFSK.js} +1 -1
- package/_assets/{index-Brb4suFu.js → index-DnZSYmpU.js} +1 -1
- package/_assets/{index-Bc5nlTSa.js → index-DnhjRPd0.js} +1 -1
- package/_assets/{index-iQ7iCCBF.js → index-DnlLS_ys.js} +1 -1
- package/_assets/{index-lkLKW4IC.js → index-DsKwbNYL.js} +1 -1
- package/_assets/{index-Coc88CNs.js → index-DxKuqcFg.js} +1 -1
- package/_assets/{index-BQGrMQAe.js → index-Dy-uR3t4.js} +1 -1
- package/_assets/{index-BTO7S5s4.js → index-E4Z_g959.js} +3 -3
- package/_assets/{index-BsvoYnWP.js → index-Eas9yoRi.js} +1 -1
- package/_assets/{index-BAAdKhhE.js → index-GomvWLkv.js} +1 -1
- package/_assets/{index-CNfRDyX8.js → index-UWPTFHML.js} +1 -1
- package/_assets/{index-CoZGIPvy.js → index-Xe0zG67j.js} +2 -2
- package/_assets/{index-Dz2XpmN8.js → index-bVwIZVq2.js} +1 -1
- package/_assets/{index-CD7rVCS9.js → index-hnGTtZoN.js} +3 -3
- package/_assets/{index-CVzFwkR2.js → index-tt5vpwow.js} +1 -1
- package/_assets/{index.es-Cf1qw100.js → index.es-BYW_XSuo.js} +4 -4
- package/_assets/{index.es-D8QRPbHG.js → index.es-D0J6Rjn_.js} +1 -1
- package/_assets/{index.es-D-iJF_vP.js → index.es-wL4nLZcl.js} +1 -1
- package/_assets/{localBatchGatewayRequest-mmyGx97_.js → localBatchGatewayRequest-CBnpaR4-.js} +1 -1
- package/_assets/{networks-auA2rGBi.js → networks-D41xdN6D.js} +1 -1
- package/_assets/{onramp-DnEfmJx7.js → onramp-DR5Lm3nA.js} +1 -1
- package/_assets/{openzeppelin-IGdhY6bS.js → openzeppelin-B19X12pO.js} +1 -1
- package/_assets/{parseNft-BiFdLjSe.js → parseNft-BHr3f8D7.js} +2 -2
- package/_assets/{parseSignature-J8MdklGZ.js → parseSignature-CRruTE7l.js} +1 -1
- package/_assets/{parseSignature-QJftY_rY.js → parseSignature-Cz1WFGnm.js} +3 -3
- package/_assets/{passkeys-D2Xshh23.js → passkeys-BAR54cJC.js} +1 -1
- package/_assets/{pay-with-exchange-Cu035sqT.js → pay-with-exchange-zDCz8UbG.js} +1 -1
- package/_assets/{qr-overlay-DYgMyv1Q.js → qr-overlay-DXWbTjg8.js} +1 -1
- package/_assets/{receive-CsNpdfnW.js → receive-B3ivhPV_.js} +1 -1
- package/_assets/{resolveImplementation-DTQI53AV.js → resolveImplementation-ASrjiSw-.js} +1 -1
- package/_assets/{rpc-KnP3VACd.js → rpc-r3GlqTct.js} +1 -1
- package/_assets/{secp256k1-CNuJw6t5.js → secp256k1-B5NNIaFX.js} +1 -1
- package/_assets/{secp256k1-D9mIimtB.js → secp256k1-Ch2QO1Jw.js} +1 -1
- package/_assets/{secp256k1-HByYfqH7.js → secp256k1-ChcROQU5.js} +1 -1
- package/_assets/{send-CMCnYIdY.js → send-6dgb2b7F.js} +1 -1
- package/_assets/{send-batch-transaction-C1sbN2my.js → send-batch-transaction-D_JGI6Rn.js} +1 -1
- package/_assets/{send-eip712-transaction-BAJeY5fb.js → send-eip712-transaction-BAt6mbHJ.js} +2 -2
- package/_assets/{send-gasless-transaction-B44KlVWh.js → send-gasless-transaction-B6-du22J.js} +2 -2
- package/_assets/{send-transaction-DT0LgivN.js → send-transaction-CWeSxAY3.js} +2 -2
- package/_assets/{sendMetaTransaction-etVFqqtW.js → sendMetaTransaction-Ds4_qSVu.js} +1 -1
- package/_assets/{sendRawTransaction-CP59S8fY.js → sendRawTransaction-lB8XtpQV.js} +3 -3
- package/_assets/{serializeTransaction-D82eIJpu.js → serializeTransaction-sBiqyBXY.js} +1 -1
- package/_assets/{session-proposal-CTk25Dr-.js → session-proposal-CtX3xmD3.js} +1 -1
- package/_assets/{session-request-C1qUxOZG.js → session-request-TgRSx-rm.js} +2 -2
- package/_assets/{signing-D2OJn6T_.js → signing-BLltMKaw.js} +3 -3
- package/_assets/{skeleton.styles-CEQXSxcg.js → skeleton.styles-CHtcYOO2.js} +1 -1
- package/_assets/{socials-Clt3JNMD.js → socials-C-PWl5ol.js} +1 -1
- package/_assets/{styled-DRUYplNz.js → styled-ByfFVW_J.js} +1 -1
- package/_assets/{swaps-hOclSX6h.js → swaps-cy6g7st6.js} +1 -1
- package/_assets/{thirdweb-DH3-POmB.js → thirdweb-Dw1AnBJt.js} +3 -3
- package/_assets/{to-serializable-transaction-CTdC8nHQ.js → to-serializable-transaction-BYNNGJgk.js} +2 -2
- package/_assets/{transactionReceipt-u3fxiMLd.js → transactionReceipt-D3t9P89G.js} +1 -1
- package/_assets/{transactions-CrPkr7No.js → transactions-Ci41fiMj.js} +1 -1
- package/_assets/useCreditPacks-DnkAdSB8.js +1 -0
- package/_assets/useImportable-DTHq6mob.js +1 -0
- package/_assets/{useInfiniteGrid-BJjThIIr.js → useInfiniteGrid-C5_gVX8O.js} +1 -1
- package/_assets/useTheme-pA484HjF.js +1 -0
- package/_assets/{verifyHash-GC24awPW.js → verifyHash-Bwromxoc.js} +1 -1
- package/_assets/{w3m-modal-D8ODxmhx.js → w3m-modal-JLRA_T5o.js} +1 -1
- package/_assets/{w3m-modal-C_4LJHJd.js → w3m-modal-yFiS_Jze.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DxjVHpLa.js → wait-for-tx-receipt-BXBtEFR-.js} +1 -1
- package/_assets/{wallets-CLONLSgR.js → wallets-DB4fTO2e.js} +5 -5
- package/_assets/{web-connector-Bg3R-MOR.js → web-connector-CwHeziUM.js} +3 -3
- package/_assets/{writeContract-B0hqGC9P.js → writeContract-lzu9ejzj.js} +1 -1
- package/_assets/{zoraTestnet-BrHNrHjI.js → zoraTestnet-Bhmm9a22.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-CMAKp-wK.js +0 -696
- package/_assets/CollectionCarousel-DMTJO3vn.js +0 -872
- package/_assets/ItemDetail--g9bExAk.js +0 -3577
- package/_assets/LazyEmoteControls-DLE3wPcI.js +0 -2
- package/_assets/TradeService-C1HwlfJG.js +0 -1
- package/_assets/authorizations-BIUtCNZm.js +0 -1
- package/_assets/buy-Dvc_dX-A.js +0 -1
- package/_assets/buy-gasless-C2CSfMz_.js +0 -1
- package/_assets/useCreditPacks-BKNj_K3V.js +0 -1
- package/_assets/useImportable-Dxzd_Mzq.js +0 -1
- package/_assets/useTheme-Rk_Pnmot.js +0 -1
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t as de,s as i,b as s,K as le,aw as ia,ax as ze,ay as ra,H as oa,I as O,y as Tt,J as Le,w as ca,W as G,al as ot,n as la,o as da,q as ua,az as ha,z as pa,aA as ga,am as ma,aB as xa,aC as ct,aD as fa,aE as ya,x as ba,aF as lt,Y as D,aG as dt,aH as va,E as ae,r as wa,c as ut,aI as Ca,C as ja,aJ as ht,aK as Ee,aL as ka,aM as fe,aN as ye,aO as pt,g as gt,f as mt,aP as $a}from"./index-CKK-zMqi.js";import{M as Sa,S as Ma,C as Ta,H as Ia,a as Pa,T as Aa,X as za,b as Ea,B as Ra,c as Ba,d as xt,e as qa,f as Ce,P as It,m as _a,g as Fa,h as Wa,i as La,j as Ka,k as Pt,l as je,L as Na,n as Qa,o as ft,p as yt,W as Ua,q as Ha,r as Ga,s as Oa,A as Va,t as Da,u as Ja,v as Ya,w as Xa,x as Za,y as es,z as ts,D as as,E as ss,F as ns,G as is,I as rs,J as os,K as cs,N as ls,O as ds,Q as Re,R as us,U as hs,V as ps,Y as gs,Z as bt,_ as vt,$ as ms,a0 as xs,a1 as fs,a2 as ys,a3 as wt,a4 as bs}from"./CollectionCarousel-uJ5UjL8j.js";import{f as vs,h as ws,a as Cs,n as js,i as ks,A as $s}from"./authorizations-CRcoV7f0.js";import{g as Ss,h as Be,p as Ms}from"./buy-CRR9-X2w.js";import{b as Ts,w as Is,S as Ct,G as Ps}from"./buy-gasless-Cj1VGZpP.js";import{u as As,M as zs,R as be,r as Es,c as Rs,p as jt,a as qe}from"./useCreditPacks-DnkAdSB8.js";import{i as Bs,a as qs}from"./errors-BbwwHm_0.js";import{E as _s}from"./ErrorNotice-CJ7LbSaM.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-Ds4_qSVu.js";const{colors:se,radius:Fs}=de,Ws=i.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,Ls=i.span`
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: ${se.text2};
|
|
11
|
+
text-transform: capitalize;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
`,Ks=i.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 12px;
|
|
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: ${Fs.btn};
|
|
38
|
+
}
|
|
39
|
+
`,Ns=i.span`
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: ${se.muted};
|
|
44
|
+
`,Qs=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
|
+
`;function Us(o){const{phase:d,balanceCredits:P,onClose:A}=o,F=d==="processing",J=d==="error"?s("cartCheckout.errorTitle"):d==="nofunds"?s("cartCheckout.titleNoFunds"):d==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=d==="processing";return e.jsxs(Sa,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(Ma,{onClick:F?void 0:A,"aria-hidden":!0}),e.jsxs(Ta,{"data-tall":Y||void 0,children:[e.jsxs(Ia,{children:[e.jsxs(Pa,{children:[e.jsx(Aa,{children:J}),!F&&e.jsx(za,{onClick:A,"aria-label":s("buyModal.close"),children:e.jsx(Ea,{})})]}),e.jsxs(Ra,{children:[e.jsx(Ba,{children:d==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(qa,{children:le(P)})]})]}),d==="choose"&&e.jsxs(Ce,{children:[e.jsxs(Qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),le(o.totalCredits??0)]})]}),e.jsx(It,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const z=_a(o.totalCents??0,o.totalManaWei??0n);return z!=null?s("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(Hs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),d==="nofunds"&&e.jsx(Gs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:A}),d==="error"&&e.jsxs(Ce,{children:[e.jsxs(Fa,{"data-testid":"buy-error",children:[e.jsx(Wa,{src:La,alt:"",width:64,height:80}),e.jsxs(Ka,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(Pt,{children:[e.jsx(je,{"data-variant":"outline",onClick:A,children:s("buyModal.cancel")}),e.jsx(je,{"data-variant":"purple",onClick:o.onRetry??A,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Hs({stage:o,step:d,total:P,isSelfCustody:A,signatures:F}){const J=o==="reserving",Y=P>0?Math.min(100,Math.round(d/P*100)):0,z=A&&F&&F.total>1,ne=o==="awaiting-signature"?A?z?s("cartCheckout.confirmMultiple",{current:F.current,total:F.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(Ce,{"data-processing":!0,children:[e.jsx(Na,{src:ia,alt:"",width:61,height:61}),e.jsx(Qa,{children:ne}),J?e.jsxs(Ws,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),P>1?e.jsxs(Ls,{children:[d,"/",P]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Gs({lines:o,shortfallCredits:d,packs:P,selectedPack:A,onSelectPack:F,onBuyPacks:J,onCancel:Y}){const z=P.find(n=>n.id===A),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(Ce,{children:[e.jsxs(Ua,{"data-testid":"nofunds-warning",children:[e.jsx(Ha,{}),e.jsxs(Ga,{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:ne}),ze()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Oa,{href:ra("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),e.jsx(Ks,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Va,{children:[e.jsx(Da,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ja,{children:[e.jsxs("div",{children:[e.jsxs(Ya,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Ns,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Xa,{address:n.item.creator}):null]}),e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),ze()?null:e.jsxs(e.Fragment,{children:[e.jsx(ts,{children:P.map(n=>{const L=n.id===A;return e.jsxs(as,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>F(n.id),children:[e.jsx(ss,{src:ns,alt:""}),e.jsx(is,{children:le(n.credits)}),e.jsxs(rs,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(os,{children:[e.jsxs(cs,{children:[e.jsx(ls,{}),e.jsx("span",{children:le((z==null?void 0:z.credits)??0)})]}),e.jsxs(ds,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]})]}),e.jsxs(Pt,{children:[e.jsx(je,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),ze()?null:e.jsx(je,{"data-variant":"gradient",onClick:J,children:s("buyModal.buy")})]})]})}const{colors:c,gradients:Os,radius:te}=de,At="@media (max-width: 1080px)",I="@media (max-width: 880px)",kt=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
|
+
${I} {
|
|
72
|
+
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
+
}
|
|
74
|
+
`,$t=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: ${c.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: ${c.accent};
|
|
92
|
+
}
|
|
93
|
+
& .ico {
|
|
94
|
+
width: 18px;
|
|
95
|
+
height: 18px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${I} {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
`,Vs=i.div`
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
align-items: start;
|
|
106
|
+
|
|
107
|
+
${At} {
|
|
108
|
+
grid-template-columns: 1fr;
|
|
109
|
+
}
|
|
110
|
+
`,St=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
|
+
/* Gray below the panels so the band never hugs the last card: Figma's band runs y152–950 with the
|
|
118
|
+
content ending at 854. The min-height above only covers a SHORT cart — once the list outgrows it
|
|
119
|
+
the band tracks the content, and without this padding it would butt straight into the purple. */
|
|
120
|
+
padding-bottom: 96px;
|
|
121
|
+
|
|
122
|
+
&::before {
|
|
123
|
+
content: '';
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: -28px;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
left: 50%;
|
|
128
|
+
width: 100vw;
|
|
129
|
+
transform: translateX(-50%);
|
|
130
|
+
background: ${c.media};
|
|
131
|
+
z-index: 0;
|
|
132
|
+
}
|
|
133
|
+
& > * {
|
|
134
|
+
position: relative;
|
|
135
|
+
z-index: 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
${I} {
|
|
139
|
+
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
140
|
+
the bottom of it — a floor here would only add empty gray. */
|
|
141
|
+
min-height: 0;
|
|
142
|
+
|
|
143
|
+
/* The fixed summary bar already reserves room at the bottom on mobile (see Checkout). */
|
|
144
|
+
padding-bottom: 32px;
|
|
145
|
+
|
|
146
|
+
&::before {
|
|
147
|
+
top: -16px; /* .page's mobile padding */
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`,Ds=i.div`
|
|
151
|
+
min-width: 0;
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
gap: 12px;
|
|
155
|
+
`,Js=i.div`
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: space-between;
|
|
159
|
+
gap: 12px;
|
|
160
|
+
background: ${c.white};
|
|
161
|
+
border-radius: 16px;
|
|
162
|
+
padding: 12px 12px 12px 24px;
|
|
163
|
+
|
|
164
|
+
${I} {
|
|
165
|
+
gap: 8px;
|
|
166
|
+
padding: 8px 16px;
|
|
167
|
+
}
|
|
168
|
+
`,zt=i.section`
|
|
169
|
+
min-width: 0;
|
|
170
|
+
background: ${c.white};
|
|
171
|
+
border-radius: 16px;
|
|
172
|
+
padding: 24px;
|
|
173
|
+
|
|
174
|
+
${I} {
|
|
175
|
+
padding: 16px;
|
|
176
|
+
}
|
|
177
|
+
`,Ys=i(zt)`
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
gap: 24px;
|
|
183
|
+
min-height: 420px;
|
|
184
|
+
padding: 48px 16px;
|
|
185
|
+
text-align: center;
|
|
186
|
+
color: ${c.text};
|
|
187
|
+
|
|
188
|
+
${de.media.maxWidth("mobile")} {
|
|
189
|
+
min-height: 320px;
|
|
190
|
+
padding: 32px 16px;
|
|
191
|
+
}
|
|
192
|
+
`,Xs=i.div`
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: 12px;
|
|
197
|
+
padding-bottom: 16px;
|
|
198
|
+
`,Zs=i.p`
|
|
199
|
+
margin: 0;
|
|
200
|
+
font-size: 24px;
|
|
201
|
+
font-weight: 700;
|
|
202
|
+
line-height: 1.6;
|
|
203
|
+
|
|
204
|
+
${de.media.maxWidth("mobile")} {
|
|
205
|
+
font-size: 20px;
|
|
206
|
+
}
|
|
207
|
+
`,en=i.p`
|
|
208
|
+
margin: 0;
|
|
209
|
+
font-size: 20px;
|
|
210
|
+
font-weight: 400;
|
|
211
|
+
line-height: 1.6;
|
|
212
|
+
|
|
213
|
+
${de.media.maxWidth("mobile")} {
|
|
214
|
+
font-size: 16px;
|
|
215
|
+
}
|
|
216
|
+
`,tn=i(We)`
|
|
217
|
+
display: inline-flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
justify-content: center;
|
|
220
|
+
width: 310px;
|
|
221
|
+
max-width: 100%;
|
|
222
|
+
height: 56px;
|
|
223
|
+
padding: 0 12px;
|
|
224
|
+
border-radius: ${te.card};
|
|
225
|
+
background: ${c.accent};
|
|
226
|
+
color: ${c.softWhite};
|
|
227
|
+
font-size: 15px;
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
line-height: 24px;
|
|
230
|
+
letter-spacing: 0.46px;
|
|
231
|
+
text-transform: uppercase;
|
|
232
|
+
text-decoration: none;
|
|
233
|
+
transition: background 0.15s ease;
|
|
234
|
+
|
|
235
|
+
&:hover {
|
|
236
|
+
background: ${c.accentHover};
|
|
237
|
+
}
|
|
238
|
+
&:focus-visible {
|
|
239
|
+
outline: 2px solid ${c.accent};
|
|
240
|
+
outline-offset: 2px;
|
|
241
|
+
}
|
|
242
|
+
`,an=i.button`
|
|
243
|
+
display: none;
|
|
244
|
+
|
|
245
|
+
${I} {
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
flex-shrink: 0;
|
|
249
|
+
border: 0;
|
|
250
|
+
background: none;
|
|
251
|
+
padding: 0;
|
|
252
|
+
color: ${c.text};
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
|
|
255
|
+
& .ico {
|
|
256
|
+
width: 20px;
|
|
257
|
+
height: 20px;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
`,sn=i.h1`
|
|
261
|
+
margin: 0;
|
|
262
|
+
font-size: 14px;
|
|
263
|
+
font-weight: 600;
|
|
264
|
+
line-height: 1.57;
|
|
265
|
+
color: ${c.text};
|
|
266
|
+
|
|
267
|
+
${I} {
|
|
268
|
+
flex: 1;
|
|
269
|
+
min-width: 0;
|
|
270
|
+
font-size: 16px;
|
|
271
|
+
}
|
|
272
|
+
`,nn=i.button`
|
|
273
|
+
display: inline-flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
justify-content: center;
|
|
276
|
+
gap: 8px;
|
|
277
|
+
height: 40px;
|
|
278
|
+
padding: 0 12px;
|
|
279
|
+
border: 2px solid ${c.text2};
|
|
280
|
+
border-radius: ${te.btn};
|
|
281
|
+
background: none;
|
|
282
|
+
color: ${c.text2};
|
|
283
|
+
font-size: 13px;
|
|
284
|
+
font-weight: 600;
|
|
285
|
+
line-height: 24px;
|
|
286
|
+
letter-spacing: 0.46px;
|
|
287
|
+
text-transform: uppercase;
|
|
288
|
+
white-space: nowrap;
|
|
289
|
+
cursor: pointer;
|
|
290
|
+
transition:
|
|
291
|
+
background 0.15s ease,
|
|
292
|
+
filter 0.15s ease;
|
|
293
|
+
|
|
294
|
+
/* Mixed from currentColor so the wash cannot drift from the border colour. */
|
|
295
|
+
&:hover:not(:disabled) {
|
|
296
|
+
background: color-mix(in srgb, currentColor 6%, transparent);
|
|
297
|
+
}
|
|
298
|
+
&:active:not(:disabled) {
|
|
299
|
+
filter: brightness(0.97);
|
|
300
|
+
}
|
|
301
|
+
&:disabled {
|
|
302
|
+
opacity: 0.55;
|
|
303
|
+
cursor: default;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* Mobile keeps the full 40px button and thins the outline to 1px (1182:236892) rather than shrinking
|
|
307
|
+
the type, which had it reading smaller than the row title beside it. */
|
|
308
|
+
${I} {
|
|
309
|
+
border-width: 1px;
|
|
310
|
+
border-color: ${c.text};
|
|
311
|
+
color: ${c.text};
|
|
312
|
+
}
|
|
313
|
+
`,rn=i.div`
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-direction: column;
|
|
316
|
+
gap: 24px;
|
|
317
|
+
`,on=i.div`
|
|
318
|
+
position: relative;
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: stretch;
|
|
321
|
+
gap: 12px;
|
|
322
|
+
background: ${c.white};
|
|
323
|
+
border: 1px solid ${c.gray4};
|
|
324
|
+
border-radius: ${te.card};
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
|
|
327
|
+
&[data-unavailable] [data-thumb] {
|
|
328
|
+
opacity: 0.5;
|
|
329
|
+
}
|
|
330
|
+
&[data-unavailable] [data-check] {
|
|
331
|
+
display: none;
|
|
332
|
+
}
|
|
333
|
+
&[data-unavailable] [data-desc] {
|
|
334
|
+
opacity: 0.7;
|
|
335
|
+
}
|
|
336
|
+
`,cn=i.div`
|
|
337
|
+
position: relative;
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
width: 137.5px;
|
|
340
|
+
height: 137px;
|
|
341
|
+
background: ${c.media};
|
|
342
|
+
border-radius: ${te.card};
|
|
343
|
+
display: grid;
|
|
344
|
+
place-items: center;
|
|
345
|
+
overflow: hidden;
|
|
346
|
+
|
|
347
|
+
& img {
|
|
348
|
+
width: 83%;
|
|
349
|
+
height: 83%;
|
|
350
|
+
object-fit: contain;
|
|
351
|
+
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
${I} {
|
|
355
|
+
width: 120px;
|
|
356
|
+
height: 120px;
|
|
357
|
+
}
|
|
358
|
+
`,ln=i(We)`
|
|
359
|
+
position: absolute;
|
|
360
|
+
inset: 0;
|
|
361
|
+
display: grid;
|
|
362
|
+
place-items: center;
|
|
363
|
+
`,dn=i.span`
|
|
364
|
+
position: absolute;
|
|
365
|
+
top: 7.5px;
|
|
366
|
+
left: 7.5px;
|
|
367
|
+
width: 20px;
|
|
368
|
+
height: 20px;
|
|
369
|
+
border-radius: 50%;
|
|
370
|
+
background: #34ce77;
|
|
371
|
+
display: grid;
|
|
372
|
+
place-items: center;
|
|
373
|
+
`,un=i.div`
|
|
374
|
+
flex: 1;
|
|
375
|
+
min-width: 0;
|
|
376
|
+
display: flex;
|
|
377
|
+
flex-direction: column;
|
|
378
|
+
justify-content: space-between;
|
|
379
|
+
gap: 8px;
|
|
380
|
+
padding: 16px 8px;
|
|
381
|
+
|
|
382
|
+
${I} {
|
|
383
|
+
padding: 12px 4px 12px 0;
|
|
384
|
+
}
|
|
385
|
+
`,hn=i.div`
|
|
386
|
+
display: flex;
|
|
387
|
+
flex-direction: column;
|
|
388
|
+
gap: 4px;
|
|
389
|
+
min-width: 0;
|
|
390
|
+
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
391
|
+
`,Et=Le`
|
|
392
|
+
display: block;
|
|
393
|
+
font-size: 16px;
|
|
394
|
+
font-weight: 600;
|
|
395
|
+
line-height: 1.2;
|
|
396
|
+
color: ${c.text};
|
|
397
|
+
text-decoration: none;
|
|
398
|
+
overflow: hidden;
|
|
399
|
+
text-overflow: ellipsis;
|
|
400
|
+
white-space: nowrap;
|
|
401
|
+
|
|
402
|
+
a&:hover {
|
|
403
|
+
color: ${c.accent};
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
${I} {
|
|
407
|
+
white-space: normal;
|
|
408
|
+
display: -webkit-box;
|
|
409
|
+
-webkit-line-clamp: 2;
|
|
410
|
+
line-clamp: 2;
|
|
411
|
+
-webkit-box-orient: vertical;
|
|
412
|
+
}
|
|
413
|
+
`,pn=i.div`
|
|
414
|
+
${Et};
|
|
415
|
+
`,gn=i(We)`
|
|
416
|
+
${Et};
|
|
417
|
+
`,mn=i(oa)`
|
|
418
|
+
font-size: 10px;
|
|
419
|
+
line-height: 1.43;
|
|
420
|
+
color: ${c.muted};
|
|
421
|
+
|
|
422
|
+
& [data-avatar] {
|
|
423
|
+
display: none;
|
|
424
|
+
}
|
|
425
|
+
& [data-testid='creator-name'] {
|
|
426
|
+
font-size: 10px;
|
|
427
|
+
line-height: 1.43;
|
|
428
|
+
}
|
|
429
|
+
`,xn=i.div`
|
|
430
|
+
display: flex;
|
|
431
|
+
align-items: center;
|
|
432
|
+
justify-content: space-between;
|
|
433
|
+
gap: 12px;
|
|
434
|
+
padding-right: 8px;
|
|
435
|
+
`,fn=i.div`
|
|
436
|
+
display: inline-flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
gap: 8px;
|
|
439
|
+
padding: 6px;
|
|
440
|
+
border: 0.5px solid ${c.muted2};
|
|
441
|
+
border-radius: ${te.pill};
|
|
442
|
+
`,Mt=i.button`
|
|
443
|
+
display: grid;
|
|
444
|
+
place-items: center;
|
|
445
|
+
width: 16px;
|
|
446
|
+
height: 16px;
|
|
447
|
+
padding: 0;
|
|
448
|
+
border: 0;
|
|
449
|
+
background: none;
|
|
450
|
+
color: ${c.text};
|
|
451
|
+
cursor: pointer;
|
|
452
|
+
|
|
453
|
+
&:disabled {
|
|
454
|
+
color: ${c.muted2};
|
|
455
|
+
cursor: default;
|
|
456
|
+
}
|
|
457
|
+
`,yn=i.span`
|
|
458
|
+
min-width: 12px;
|
|
459
|
+
font-size: 14px;
|
|
460
|
+
font-weight: 500;
|
|
461
|
+
line-height: 1.2;
|
|
462
|
+
color: ${c.text};
|
|
463
|
+
text-align: center;
|
|
464
|
+
`,bn=i.div`
|
|
465
|
+
display: inline-flex;
|
|
466
|
+
align-items: center;
|
|
467
|
+
gap: 4px;
|
|
468
|
+
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
469
|
+
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
470
|
+
margin-left: auto;
|
|
471
|
+
font-size: 24px;
|
|
472
|
+
font-weight: 600;
|
|
473
|
+
color: ${c.text2};
|
|
474
|
+
|
|
475
|
+
${I} {
|
|
476
|
+
font-size: 20px;
|
|
477
|
+
}
|
|
478
|
+
`,vn=i(Tt)`
|
|
479
|
+
width: 24px;
|
|
480
|
+
height: 24px;
|
|
481
|
+
background: ${c.text};
|
|
482
|
+
|
|
483
|
+
${I} {
|
|
484
|
+
width: 20px;
|
|
485
|
+
height: 20px;
|
|
486
|
+
}
|
|
487
|
+
`,wn=i.span`
|
|
488
|
+
margin-left: 6px;
|
|
489
|
+
font-size: 14px;
|
|
490
|
+
font-weight: 500;
|
|
491
|
+
color: ${c.muted};
|
|
492
|
+
text-decoration: line-through;
|
|
493
|
+
`,Cn=i.div`
|
|
494
|
+
position: absolute;
|
|
495
|
+
top: 9px;
|
|
496
|
+
right: 7px;
|
|
497
|
+
display: flex;
|
|
498
|
+
align-items: flex-start;
|
|
499
|
+
gap: 12px;
|
|
500
|
+
`,jn=i.span`
|
|
501
|
+
display: inline-flex;
|
|
502
|
+
align-items: center;
|
|
503
|
+
gap: 4px;
|
|
504
|
+
font-size: 12px;
|
|
505
|
+
font-weight: 600;
|
|
506
|
+
line-height: 1;
|
|
507
|
+
text-transform: uppercase;
|
|
508
|
+
color: ${c.text2};
|
|
509
|
+
`,kn=i(O)`
|
|
510
|
+
color: #f48221;
|
|
511
|
+
`,$n=i.span`
|
|
512
|
+
align-self: flex-start;
|
|
513
|
+
display: inline-flex;
|
|
514
|
+
align-items: center;
|
|
515
|
+
gap: 4px;
|
|
516
|
+
padding: 2px 4px;
|
|
517
|
+
border-radius: ${te.chip};
|
|
518
|
+
background: #f4e9ff;
|
|
519
|
+
font-size: 10px;
|
|
520
|
+
font-weight: 400;
|
|
521
|
+
line-height: 14px;
|
|
522
|
+
color: ${c.text};
|
|
523
|
+
`,Sn=i(O)`
|
|
524
|
+
width: 11.31px;
|
|
525
|
+
height: 10.94px;
|
|
526
|
+
background: ${c.text};
|
|
527
|
+
`,Rt=Le`
|
|
528
|
+
display: grid;
|
|
529
|
+
place-items: center;
|
|
530
|
+
width: 24px;
|
|
531
|
+
height: 24px;
|
|
532
|
+
padding: 0;
|
|
533
|
+
border: 0;
|
|
534
|
+
background: none;
|
|
535
|
+
color: ${c.muted};
|
|
536
|
+
cursor: pointer;
|
|
537
|
+
transition: color 0.12s ease;
|
|
538
|
+
|
|
539
|
+
&:disabled {
|
|
540
|
+
opacity: 0.5;
|
|
541
|
+
cursor: default;
|
|
542
|
+
}
|
|
543
|
+
`,Mn=i.button`
|
|
544
|
+
${Rt};
|
|
545
|
+
|
|
546
|
+
&:hover:not(:disabled) {
|
|
547
|
+
color: ${c.text};
|
|
548
|
+
}
|
|
549
|
+
&[data-on] {
|
|
550
|
+
color: ${c.dclRed};
|
|
551
|
+
}
|
|
552
|
+
`,Tn=i.button`
|
|
553
|
+
${Rt};
|
|
554
|
+
|
|
555
|
+
&:hover:not(:disabled) {
|
|
556
|
+
color: ${c.dclRed};
|
|
557
|
+
}
|
|
558
|
+
`,In=i.div`
|
|
559
|
+
display: flex;
|
|
560
|
+
gap: 20px;
|
|
561
|
+
margin-top: 16px;
|
|
562
|
+
|
|
563
|
+
& .link {
|
|
564
|
+
font-size: 13px;
|
|
565
|
+
color: ${c.muted};
|
|
566
|
+
font-weight: 600;
|
|
567
|
+
}
|
|
568
|
+
& .link:hover:not(:disabled) {
|
|
569
|
+
color: ${c.text};
|
|
570
|
+
}
|
|
571
|
+
`,Pn=i.aside`
|
|
572
|
+
position: sticky;
|
|
573
|
+
top: 172px;
|
|
574
|
+
display: flex;
|
|
575
|
+
flex-direction: column;
|
|
576
|
+
background: ${c.white};
|
|
577
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
578
|
+
border-radius: 16px;
|
|
579
|
+
padding: 16px;
|
|
580
|
+
|
|
581
|
+
${At} {
|
|
582
|
+
position: static;
|
|
583
|
+
}
|
|
584
|
+
${I} {
|
|
585
|
+
position: fixed;
|
|
586
|
+
left: 0;
|
|
587
|
+
right: 0;
|
|
588
|
+
top: auto;
|
|
589
|
+
bottom: 0;
|
|
590
|
+
z-index: 30;
|
|
591
|
+
border: 0;
|
|
592
|
+
/* Square and hard-edged against the page (1182:236910): it is a bar docked to the bottom, not a sheet
|
|
593
|
+
lifted off it. */
|
|
594
|
+
border-radius: 0;
|
|
595
|
+
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
|
|
596
|
+
}
|
|
597
|
+
`,An=i.h2`
|
|
598
|
+
margin: 0 0 24px;
|
|
599
|
+
padding-bottom: 16px;
|
|
600
|
+
border-bottom: 1px solid ${c.gray4};
|
|
601
|
+
font-size: 24px;
|
|
602
|
+
font-weight: 600;
|
|
603
|
+
color: ${c.text};
|
|
604
|
+
|
|
605
|
+
${I} {
|
|
606
|
+
margin-bottom: 12px;
|
|
607
|
+
padding-bottom: 8px;
|
|
608
|
+
font-size: 16px;
|
|
609
|
+
line-height: 1.6;
|
|
610
|
+
}
|
|
611
|
+
`,zn=i.div`
|
|
612
|
+
display: flex;
|
|
613
|
+
flex-direction: column;
|
|
614
|
+
gap: 12px;
|
|
615
|
+
`,En=i.div`
|
|
616
|
+
display: flex;
|
|
617
|
+
align-items: flex-start;
|
|
618
|
+
justify-content: space-between;
|
|
619
|
+
gap: 12px;
|
|
620
|
+
`,Rn=i.span`
|
|
621
|
+
font-size: 14px;
|
|
622
|
+
font-weight: 600;
|
|
623
|
+
line-height: 1.57;
|
|
624
|
+
color: ${c.muted1};
|
|
625
|
+
`,Bn=i.span`
|
|
626
|
+
display: inline-flex;
|
|
627
|
+
align-items: center;
|
|
628
|
+
gap: 8px;
|
|
629
|
+
font-size: 24px;
|
|
630
|
+
font-weight: 700;
|
|
631
|
+
color: ${c.text};
|
|
632
|
+
`,qn=i.span`
|
|
633
|
+
display: flex;
|
|
634
|
+
flex-direction: column;
|
|
635
|
+
align-items: flex-end;
|
|
636
|
+
justify-content: center;
|
|
637
|
+
gap: 4px;
|
|
638
|
+
`;i.span`
|
|
639
|
+
font-size: 12px;
|
|
640
|
+
font-weight: 400;
|
|
641
|
+
line-height: 1;
|
|
642
|
+
color: ${c.muted};
|
|
643
|
+
`;const _n=i(Tt)`
|
|
644
|
+
width: 30px;
|
|
645
|
+
height: 30px;
|
|
646
|
+
background: ${c.text};
|
|
647
|
+
-webkit-mask-size: 24px 24px;
|
|
648
|
+
mask-size: 24px 24px;
|
|
649
|
+
-webkit-mask-position: left center;
|
|
650
|
+
mask-position: left center;
|
|
651
|
+
`;i.button`
|
|
652
|
+
width: 100%;
|
|
653
|
+
height: 56px;
|
|
654
|
+
border: 0;
|
|
655
|
+
border-radius: ${te.btn};
|
|
656
|
+
background: ${Os.buyBtn};
|
|
657
|
+
color: ${c.softWhite};
|
|
658
|
+
font-size: 15px;
|
|
659
|
+
font-weight: 600;
|
|
660
|
+
letter-spacing: 0.046em;
|
|
661
|
+
text-transform: uppercase;
|
|
662
|
+
cursor: pointer;
|
|
663
|
+
transition: background-image 0.15s ease;
|
|
664
|
+
|
|
665
|
+
/* Primary hover/pressed is the solid Primary red (Figma 738:53252 / 738:53262) — the gradient is
|
|
666
|
+
the RESTING fill only. Painted as a flat GRADIENT, not a background-color: the shorthand can't
|
|
667
|
+
interpolate background-image, so gradient -> colour dropped the image midway while the colour was
|
|
668
|
+
still half transparent and the button visibly blinked. Same property both ends = a clean swap. */
|
|
669
|
+
&:hover:not(:disabled),
|
|
670
|
+
&:active:not(:disabled) {
|
|
671
|
+
background-image: linear-gradient(${c.dclRed}, ${c.dclRed});
|
|
672
|
+
}
|
|
673
|
+
&:disabled {
|
|
674
|
+
opacity: 0.6;
|
|
675
|
+
cursor: default;
|
|
676
|
+
}
|
|
677
|
+
`;const Bt=Le`
|
|
678
|
+
margin: 0;
|
|
679
|
+
font-size: 13px;
|
|
680
|
+
`,ve=i.p`
|
|
681
|
+
${Bt};
|
|
682
|
+
`,Fn=i(_s)`
|
|
683
|
+
${Bt};
|
|
684
|
+
`,Wn=i.div`
|
|
685
|
+
position: relative;
|
|
686
|
+
flex: 1 0 auto;
|
|
687
|
+
margin-top: 48px;
|
|
688
|
+
/* Below the gray band the cross-sell sits straight on the purple field (Figma) — hence no band of its
|
|
689
|
+
own. The padding is the whole gap from the top of the section to the heading; the shared carousel's
|
|
690
|
+
own top margin is zeroed below so the two don't stack. */
|
|
691
|
+
padding: 47px 0 24px;
|
|
692
|
+
|
|
693
|
+
& section {
|
|
694
|
+
margin-top: 0;
|
|
695
|
+
}
|
|
696
|
+
`;function _e(o){if(Bs(o))return s("errors.rejected");const d=(o.message??"").toLowerCase();return d.includes("insufficient")?s("cart.error.insufficient",{currency:ja.name}):d.includes("no active listing")||d.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const Ln=12e4;function Kn(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 Fe=o=>o.reduce((d,P)=>d+P.priceCredits*P.quantity,0),we=o=>o.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function ai(){ca({title:s("nav.cart"),noindex:!0});const o=G(t=>t.items),d=G(t=>t.remove),P=G(t=>t.increment),A=G(t=>t.decrement),F=G(t=>t.clear),J=G(t=>t.restore),Y=G(t=>t.setFittingOpen),z=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=la(),qt=da(),ue=As().packs.slice(0,zs);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const _t=o.some(t=>t.category!=="emote"),{data:ke}=ua({queryKey:["upsell-listings"],queryFn:()=>$a({first:40}),staleTime:6e4}),{data:k}=ha(n),v=pa(),X=sa(),{state:E}=na(),[Ft,ie]=M.useState(null),[Ke,he]=M.useState(null),[Wt,B]=M.useState(!1),[q,V]=M.useState(null),Ne=M.useRef(0),[p,j]=M.useState(null),{data:pe}=ga(n),{data:re}=ma(!0),[$e,Qe]=M.useState(""),oe=M.useRef(null),Ue=xa(o),He=t=>lt(Ue[t.id]),Se=o.filter(He),Ge=o.length>0&&Se.length===0,Lt=Se.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Nt=Se.reduce((t,a)=>t+a.quantity,0),Oe=q?q.liveTotalCredits:Lt,Qt=new Set(o.map(t=>t.id)),Ve=((ke==null?void 0:ke.items)??[]).filter(t=>!Qt.has(t.id)).slice(0,12),Ut=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),ge=(k==null?void 0:k.credits)??0,Me=Oe*10,Ht=re?ct(Me,re):0n,Te=Re({priceCents:Me,priceManaWei:Ht,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n}),Gt=t=>t.flatMap(a=>{const l=qe(a);return l.kind==="store"?[l.mint]:[]}),Ot=t=>t.flatMap(a=>a.acquisition==="trade"?[a.trade]:[]),Vt=va,Dt=t=>Ca(t.contractAddress,String(t.itemId));function me(t){t(),V(null),he(null),ie(null)}function Jt(){j(null),B(!1)}function De(t){const a=Fe(t),l=Math.max(0,a-ge),r=ue.find(u=>u.credits>=l)??ue[ue.length-1];Qe(r.id),D("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:l}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),B(!1)}async function Ie(t){if(!n||t.length===0)return;const a=we(t),l=a.map(g=>({...g.item,priceCredits:g.priceCredits})),r=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let m="authorize";const $=new Set,K=new Set,W=new Set,_=[];let w=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const g=[];for(let x=0;x<a.length;x++){const h=a[x];j({phase:"processing",stage:"reserving",step:x+1,total:a.length});try{const C=h.acquisition==="trade"?h.trade.id:void 0,b=h.item.contractAddress&&h.item.itemId!=null?{contractAddress:h.item.contractAddress,itemId:String(h.item.itemId)}:void 0,{credit:T,maxCreditedValue:U}=await ht(n.identity,h.usdCents,C,b);u.push({salt:T.id,itemId:h.item.id}),g.push(h.acquisition==="store"?{kind:"store",item:{collection:h.item.contractAddress,itemId:String(h.item.itemId),priceWei:h.priceWei},credits:[T],maxCreditedValue:U,chainId:h.item.chainId}:{kind:"trade",trade:h.trade,credits:[T],maxCreditedValue:U})}catch(C){if(qs(C)){if(u.length){try{await Ee(n.identity,u.map(b=>b.salt))}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(t);return}throw C}}m="submit";const S=Ss(g).length,N=x=>S>1?{current:x,total:S}:void 0,H=(x,h)=>j({phase:"processing",stage:x,step:a.length,total:a.length,signatures:N(h)}),Q=x=>x<S?H("awaiting-signature",x+1):H("settling",S);H("awaiting-signature",1);let f=[];if(vs())try{const x=new Map;f=await Ts({purchases:g,buyer:n.address,signer:n.signer,onSigned:()=>Q(S),onBroadcast:({txHash:b,salts:T})=>{x.set(b,T),T.forEach(U=>$.add(U))}});const h=await Promise.allSettled(f.map(b=>Is(b)));h.forEach((b,T)=>{const U=x.get(f[T])??[];b.status==="fulfilled"?(U.forEach(ce=>K.add(ce)),_.push(f[T])):b.reason instanceof Ct||U.forEach(ce=>W.add(ce))});const C=h.flatMap(b=>b.status==="rejected"?[b.reason]:[]);if(C.length&&!C.some(b=>b instanceof Ct))throw C[0];w=!0}catch(x){if(!(x instanceof Ps)||!ka(n.providerType))throw x;f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:h})=>h.forEach(C=>$.add(C)),onSettled:({txHash:h,salts:C})=>{C.forEach(b=>K.add(b)),_.push(h)},onReverted:({salts:h})=>h.forEach(C=>W.add(C))})}else f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:x})=>x.forEach(h=>$.add(h)),onSettled:({txHash:x,salts:h})=>{h.forEach(C=>K.add(C)),_.push(x)},onReverted:({salts:x})=>x.forEach(h=>W.add(h))});t.forEach(x=>d(x.item.id)),V(null),D("Shop Completed Purchase",{...fe(l),payment_type:"credits",no_crypto_step:w,transaction_hash:f[0]??null}),vt(v);const y=oe.current;oe.current=null,j(null),B(!1);const R={items:r,txHash:f[0]??void 0,txHashes:f,settled:!0,...y?{creditsAdded:y}:{}};X("/success",{state:R,replace:!0})}catch(g){ye(g)||ae(g,{flow:"cart_checkout",step:m,cart_size:t.length});const S=new Set([...$].filter(y=>!W.has(y))),{toRelease:N,boughtItemIds:H}=jt({reservations:u,spent:S,settled:K}),Q=l.filter(y=>H.includes(y.id)),f=l.filter(y=>!H.includes(y.id));if(D(ye(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:m,error_code:pt(g),value_usd:dt(f.reduce((y,R)=>y+R.priceCredits,0)),cart_size:a.length,partial:Q.length>0}),N.length)try{await Ee(n.identity,N)}catch(y){ae(y,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),Q.length>0){H.forEach(y=>d(y)),V(null),vt(v),D("Shop Completed Purchase",{...fe(Q),payment_type:"credits",no_crypto_step:w,transaction_hash:_[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:_e(g)})}}function Je(t,a){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const l=oe.current;oe.current=null,j(null),B(!1);const r={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...l?{creditsAdded:l}:{}};X("/success",{state:r,replace:!0})}function Ye(t,a){ye(t)||ae(t,{flow:a,step:"submit"}),D(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:_e(t)}),B(!1)}async function Yt(t,a){const l=gt(mt.MANAToken,a),r=gt(mt.CreditsManager,a);await ks({auth:{kind:$s.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:a},signer:t})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>wa(ut.chainId),staleTime:6e4})}catch{return}}async function Xt(t){const a=we(t).reduce((m,$)=>m+$.usdCents,0),r=(pe??0n)>0n?await Xe():re,u=r?ct(a,r):0n;return{totalCents:a,manaWei:u}}async function Ze(t,a){const l=Fe(t),{totalCents:r,manaWei:u}=await Xt(t),m=Re({priceCents:r,priceManaWei:u,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n});if(a&&m.options.some($=>$.method===a)){if(a==="credits"){Ie(t);return}await Ae(et(a,t),()=>a==="mana"?void tt(t):void at(t,r,u));return}if(m.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:r,manaWei:u}),B(!1);return}if(k!=null&&k.credits<l){De(t);return}Ie(t)}function Zt(t){return Re({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n})}const[Pe,xe]=M.useState(null);function et(t,a){const l=new Map;for(const r of a){const u=ms(t,qe(r));l.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...l.values()]}async function Ae(t,a){const[l,...r]=t;if(!l){a();return}await ea(l.spender,l.chainId,()=>void Ae(r,a))}async function ea(t,a,l){const r=ws(a,t),u=n?await Cs(r,n.address).catch(()=>!0):!0;if(js(n==null?void 0:n.providerType,u)){B(!1),xe({auth:r,run:l});return}l()}function ta(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:l,manaWei:r}=p;if(t==="credits"){Ie(a);return}Ae(et(t,a),()=>t==="mana"?void tt(a):void at(a,l,r))}async function tt(t){if(!n||t.length===0)return;const a=we(t),l=a.map(m=>({...m.item,priceCredits:m.priceCredits})),r=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.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 m=await xs({trades:Ot(a),mints:Gt(a),buyer:n.address,signer:n.signer,onSigned:u});t.forEach($=>d($.item.id)),V(null),D("Shop Completed Purchase",{...fe(l),payment_type:"mana",transaction_hash:m[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(r,m)}catch(m){Ye(m,"buy_cart_mana")}}async function at(t,a,l){if(!n||t.length===0)return;const r=we(t),u=r.map(w=>({...w.item,priceCredits:w.priceCredits})),m=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),$=fs(r.map(w=>w.usdCents),(k==null?void 0:k.balanceCents)??0),K=[],W=new Set,_=new Set;j({phase:"processing",stage:"reserving",step:1,total:r.length});try{const w=r.map(qe),g=[],S=new Map,N=new Map;for(let f=0;f<r.length;f++){const y=r[f],R=w[f],x=$[f],h=ys(Math.max(0,y.usdCents-x),a,l);let C;if(x<=0)C=wt(R,[],"0");else{j({phase:"processing",stage:"reserving",step:f+1,total:r.length});const T=y.item,{credit:U,maxCreditedValue:ce}=await ht(n.identity,x,R.kind==="trade"?R.trade.id:void 0,T.contractAddress&&T.itemId!=null?{contractAddress:T.contractAddress,itemId:String(T.itemId)}:void 0);K.push({salt:U.id,itemId:T.id}),C=wt(R,[U],ce)}const b=Ms(C);S.set(b,(S.get(b)??0n)+h),N.has(b)||N.set(b,g.length),g.push(C)}for(const[f,y]of S){const R=N.get(f);R==null||y<=0n||(g[R]={...g[R],maxCreditedValue:(BigInt(g[R].maxCreditedValue)+y).toString()})}await Yt(n.signer,bs(w[0]));const H=()=>j({phase:"processing",stage:"settling",step:r.length,total:r.length});j({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const Q=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:H,onBroadcast:({salts:f})=>f.forEach(y=>W.add(y)),onReverted:({salts:f})=>f.forEach(y=>_.add(y))});t.forEach(f=>d(f.item.id)),V(null),D("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:Q[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(m,Q)}catch(w){const{toRelease:g}=jt({reservations:K,spent:new Set([...W].filter(S=>!_.has(S))),settled:new Set});g.length&&Ee(n.identity,g).catch(()=>{}),K.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Ye(w,"buy_cart_combined")}}async function Z(t){if(!n){bt({type:"cart-checkout"}),L();return}const a=G.getState().items.filter(He);if(a.length===0)return;ie(null),he(null),B(!0);const l=a.reduce((r,u)=>r+u.priceCredits*u.quantity,0);D("Shop Started Checkout",{cart_size:a.length,cart_value_credits:l,cart_value_usd:dt(l),has_sufficient_credits:ge>=l});try{const r=await Es(a,n.address,Vt,await Xe(),Dt),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(m=>d(m.id)),he(Kn(r))),r.buyable.length===0){ie(s("cart.error.noneAvailable")),V(null);return}if(r.orderChanged){V(r),Ne.current=Date.now();return}await Ze(r.buyable,t)}catch(r){ae(r,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(_e(r))}finally{B(!1)}}async function st(){if(q){if(!n){bt({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>Ln){V(null),he(null),await Z();return}ie(null),Ze(q.buyable)}}async function aa(){if($e){try{sessionStorage.setItem(be,JSON.stringify(G.getState().items))}catch{}B(!0);try{const t=await Rs($e,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(be)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const nt=M.useRef(!1);M.useEffect(()=>{if(!n||nt.current||!us("cart-checkout"))return;nt.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const it=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||it.current)return;it.current=!0,oe.current=E.creditsAdded??null;try{const a=sessionStorage.getItem(be);if(a){sessionStorage.removeItem(be);const l=JSON.parse(a);Array.isArray(l)&&l.length&&J(l)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const rt=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.startCheckout)||rt.current)return;rt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const ee=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(kt,{children:e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ys,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Xs,{children:[e.jsx(Zs,{children:s("cart.empty.title")}),e.jsx(en,{children:s("cart.empty.body")})]}),e.jsx(tn,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(kt,{children:[e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Vs,{children:[e.jsxs(Ds,{children:[e.jsxs(Js,{children:[e.jsx(an,{onClick:()=>X(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(sn,{children:s("cart.panelTitle",{count:Kt})}),_t?e.jsxs(nn,{onClick:()=>Y(!0),disabled:ee,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(zt,{children:[e.jsx(rn,{children:o.map(t=>{const a=Ut.get(t.id),l=a?a.priceCredits:t.priceCredits,r=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,m=t.quantity,$=typeof t.available=="number"&&m>=t.available,K=l*m,W=fa(t),_=!!W&&!!z[W],w=ya(t),g=Ue[t.id],S=!lt(g),N=g==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(on,{"data-unavailable":S||void 0,children:[e.jsxs(cn,{"data-thumb":!0,children:[w?e.jsx(ln,{to:w,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(dn,{"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(un,{children:[e.jsxs(hn,{"data-desc":!0,children:[w?e.jsx(gn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(pn,{title:t.name,children:t.name}),t.creator?e.jsx(mn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs($n,{"data-testid":"cart-creator-tag",children:[e.jsx(Sn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(xn,{children:S?e.jsxs(jn,{children:[e.jsx(kn,{name:"warning-fill",size:24}),N]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(fn,{children:[e.jsx(Mt,{onClick:()=>me(()=>A(t.id)),disabled:ee||m<=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(yn,{children:m}),e.jsx(Mt,{onClick:()=>me(()=>P(t.id)),disabled:ee||$,"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(bn,{children:[e.jsx(vn,{})," ",K,r?e.jsx(wn,{children:t.priceCredits*m}):null]})]})})]}),e.jsxs(Cn,{children:[W?e.jsx(Mn,{"data-on":_||void 0,onClick:()=>ne(t),"aria-label":_?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:_?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:_?"heart-solid":"heart"})}):null,e.jsx(Tn,{onClick:()=>me(()=>d(t.id)),disabled:ee,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(In,{children:e.jsx("button",{className:"link",onClick:()=>me(F),disabled:ee,children:s("cart.clearCart")})})]})]}),e.jsxs(Pn,{children:[e.jsx(An,{children:s("cart.purchaseSummary")}),e.jsxs(zn,{children:[e.jsxs(En,{children:[e.jsx(Rn,{children:s("cart.totalItems",{count:Nt})}),e.jsx(qn,{children:e.jsxs(Bn,{children:[e.jsx(_n,{})," ",Oe]})})]}),e.jsx(It,{options:Te.options,totalCents:Me,shortfall:Te.manaShortfall,showCreditsAmount:!1,creditsLabel:q?s("marketCheckout.confirmPurchase"):Te.options.length>1?s("cart.buyWithCredits"):s("cart.checkout"),busy:ee||Ge,onPay:t=>void(q?st():Z(t)),creditsFallback:{label:ee?s("cart.working"):q?s("marketCheckout.confirmPurchase"):s("cart.checkout"),onClick:()=>void(q?st():Z())}}),Ge?e.jsx(ve,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:s("cart.signInHint")}),q?e.jsx(ve,{className:"muted",children:s("cart.priceChanged")}):null,Ke?e.jsx(ve,{className:"muted",children:Ke}):null,e.jsx(Fn,{message:Ft})]})]})]})]}),Ve.length>0?e.jsx(Wn,{children:e.jsx(hs,{title:s("cart.youMightAlsoLike"),items:Ve})}):null,Pe&&n?e.jsx(ps,{auth:Pe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:gs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Pe;xe(null),t()},onCancel:()=>xe(null),onClose:()=>xe(null)}):null,p?e.jsx(Us,{phase:p.phase,balanceCredits:ge,onClose:Jt,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:ba(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Zt(p).options:void 0,onPay:ta,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Fe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:$e,onSelectPack:Qe,onBuyPacks:()=>void aa(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void Z()}):null]})}export{ai as Cart};
|