@dcl/shop 0.10.1-31029565525.commit-8eeaa8f → 0.10.1-31032606668.commit-30914a5
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-BnUTRccC.js → Activity-CBQ0_5Gp.js} +3 -3
- package/_assets/{AnimatedBackground-CFxGJrvr.js → AnimatedBackground-DzU3vjuD.js} +1 -1
- package/_assets/{Assets-DKArlsdV.js → Assets-Bm8xT-wK.js} +48 -48
- package/_assets/{Assets.styles-Crxo5ZgZ.js → Assets.styles-D_DUFdKV.js} +56 -56
- package/_assets/{Authorizations-BVsBhVRE.js → Authorizations-YCl9mcd9.js} +1 -1
- package/_assets/{Cart-DGWIQa7u.js → Cart-BRPkkQw3.js} +13 -13
- package/_assets/{CircularProgress-C2EMA-WY.js → CircularProgress-BvMoYOvy.js} +1 -1
- package/_assets/Collection-D7bUo9dI.js +162 -0
- package/_assets/{CollectionCarousel-BfWdU9TS.js → CollectionCarousel-Bs4fBuN6.js} +18 -18
- package/_assets/{Confetti-2clep845.js → Confetti-Bf7aP0NE.js} +1 -1
- package/_assets/Creator-DctbYEDT.js +306 -0
- package/_assets/{ErrorNotice-DuUZx_7m.js → ErrorNotice-BU7FyT1W.js} +1 -1
- package/_assets/{ExchangeController-d78CG8uk.js → ExchangeController-D7v6FLdb.js} +1 -1
- package/_assets/{Faq-CD5Cn1w0.js → Faq-DBZpkL9P.js} +1 -1
- package/_assets/{GetCredits-DByVocxz.js → GetCredits-DEsgS54C.js} +14 -14
- package/_assets/{Grow-pVAVq4p8.js → Grow-GSOfEN2l.js} +1 -1
- package/_assets/{HelpersUtil-OmexlG_i.js → HelpersUtil-CkBhbL_r.js} +1 -1
- package/_assets/{ItemDetail-BB7--DmF.js → ItemDetail-B3yupLtb.js} +209 -209
- package/_assets/LazyEmoteControls-DLcKgwgu.js +2 -0
- package/_assets/{LoadMore-Bka3px9r.js → LoadMore-i3u3Pyt6.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-05aOeHWK.js → ManaPricingBanner.styles-C18BesFl.js} +1 -1
- package/_assets/MyAssets-C-lv91w7.js +381 -0
- package/_assets/{MyFavorites-CdmRx3i0.js → MyFavorites-U-UxHb-o.js} +2 -2
- package/_assets/{NotFound-Cv_WsqDu.js → NotFound-DkcTAlkz.js} +1 -1
- package/_assets/{NotificationsBell-B_4w5VLE.js → NotificationsBell-DDCAY3l-.js} +1 -1
- package/_assets/{OutfitDetail-BlE4dNxL.js → OutfitDetail-BFmRzzjx.js} +4 -4
- package/_assets/{OutfitPreview-BjiO0VsO.js → OutfitPreview-DPS3H3_3.js} +2 -2
- package/_assets/{OutfitStudio-D9LQ_WGt.js → OutfitStudio-CrgVuCXP.js} +59 -59
- package/_assets/{StoreSettings-DpevQbL3.js → StoreSettings-BLndphwX.js} +43 -43
- package/_assets/Success-BY9OhkKm.js +280 -0
- package/_assets/{SwapController-BCq8cczu.js → SwapController-DXYjEOyv.js} +1 -1
- package/_assets/{Tooltip-BSg8PAuJ.js → Tooltip-BajbwTea.js} +1 -1
- package/_assets/{TradeService-DnRblc5X.js → TradeService-Cv02JkEQ.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BkgMeT5j.js → W3MFrameProviderSingleton-A5mBxhYF.js} +3 -3
- package/_assets/{WebCryptoP256-5hLL6y4k.js → WebCryptoP256-CnQALEMv.js} +1 -1
- package/_assets/{authorizations-BZabD414.js → authorizations-Xqbnmu9x.js} +1 -1
- package/_assets/{basic-CID-Qs3b.js → basic-CvPWviGS.js} +1 -1
- package/_assets/{biconomy-BWK8rG_e.js → biconomy-glo4y4ek.js} +1 -1
- package/_assets/{builder-C0HXHDnK.js → builder-BqnhdDxo.js} +1 -1
- package/_assets/{buy-DMMwBXQK.js → buy-Cq5r6s_d.js} +1 -1
- package/_assets/{buy-gasless-DkT1GvmP.js → buy-gasless-CaSmt8Rn.js} +1 -1
- package/_assets/{categories-LpPpJwMX.js → categories-Cc9LF1R4.js} +44 -50
- package/_assets/{ccip-CmVA7LRy.js → ccip-DtPCxwhK.js} +1 -1
- package/_assets/{ccip-CTHaF-0F.js → ccip-HLzoBWhd.js} +1 -1
- package/_assets/{collectionPage.styles-C0OU97Vl.js → collectionPage.styles-rLItNGdu.js} +2 -2
- package/_assets/{controller-BSCAkC53.js → controller-DLVCl98j.js} +2 -2
- package/_assets/{core-BY58gAaC.js → core-BoCM39Dc.js} +4 -4
- package/_assets/{createSvgIcon-Co2I3KNE.js → createSvgIcon-CF6VIRxG.js} +1 -1
- package/_assets/{custom-BFUJnR6C.js → custom-BQJpm4NP.js} +1 -1
- package/_assets/{data-capture-BcT9TYL5.js → data-capture-CPxjWW7W.js} +1 -1
- package/_assets/{email-zKJhfKOQ.js → email-DglJsBXd.js} +1 -1
- package/_assets/{embedded-wallet-DZzfkRu7.js → embedded-wallet-CRWhciW5.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-dvplhB66.js → emotion-styled.browser.esm-BATaYRNB.js} +1 -1
- package/_assets/{engine-B3Mf1brx.js → engine-CRPW7FqE.js} +1 -1
- package/_assets/{errors-BGVCQOMz.js → errors-D4C9kv7B.js} +1 -1
- package/_assets/{estimate-l1-fee-DMFrbofF.js → estimate-l1-fee-aOXZ8ihZ.js} +1 -1
- package/_assets/{execute-DCGV6tDo.js → execute-k2RZ2hTw.js} +2 -2
- package/_assets/{features-DqHFEBDx.js → features-BmdkdPP-.js} +1 -1
- package/_assets/{fetchTokenMetadata-D6K4KP_4.js → fetchTokenMetadata-Bmcczr66.js} +2 -2
- package/_assets/{field.styles-DcKQ_iNz.js → field.styles-DQVBZTuq.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-D6HzrmoJ.js → get-ecosystem-wallet-info-BbJRcc1t.js} +1 -1
- package/_assets/{getBalance-LGdYuyxa.js → getBalance-DC-t3UhM.js} +1 -1
- package/_assets/{getNFT-Cw0O3Ml9.js → getNFT-BlzNSmnK.js} +1 -1
- package/_assets/{getNFT-CuZyZceA.js → getNFT-DwruUWap.js} +1 -1
- package/_assets/{grid.styles-BoDTH9-L.js → grid.styles-2-Lphh1_.js} +1 -1
- package/_assets/{hashTypedData-CM__DDH2.js → hashTypedData-BLMgL5Vz.js} +1 -1
- package/_assets/{hashTypedData-qqC1Tbni.js → hashTypedData-D6ew3JpS.js} +1 -1
- package/_assets/{in-app-BwohLVFE.js → in-app-BRl8aLUS.js} +1 -1
- package/_assets/{in-app-wallet-calls-DkQZMb0p.js → in-app-wallet-calls-Cf8UnG06.js} +1 -1
- package/_assets/{index-D8uSGtoz.js → index-B2N5oNn8.js} +1 -1
- package/_assets/{index-DplFHsVz.js → index-BBOn5orP.js} +1 -1
- package/_assets/{index-CRUz-lFa.js → index-BD25cQD4.js} +1 -1
- package/_assets/{index-C4OULSnf.js → index-BDzGigH2.js} +1 -1
- package/_assets/{index-txSbIXUX.js → index-BISFLA3c.js} +1 -1
- package/_assets/{index-DY-CJBBw.js → index-BJovGEvB.js} +1 -1
- package/_assets/{index-CwEAusBk.js → index-BKj0f9wi.js} +1 -1
- package/_assets/{index-BeHXNx4l.js → index-BTkQgQDi.js} +1 -1
- package/_assets/{index-BHs8Nm1v.js → index-BXzvQW0o.js} +1 -1
- package/_assets/{index-jQ98hJsI.js → index-BZL5qpA4.js} +2 -2
- package/_assets/{index-BOCGS4MY.js → index-B_PIYV8c.js} +2 -2
- package/_assets/{index-BDKp6O92.js → index-BelRIVeb.js} +1 -1
- package/_assets/{index-BSioXpnp.js → index-BkspOCIc.js} +1 -1
- package/_assets/{index-unjRyi-x.js → index-Bq_9XM9n.js} +1 -1
- package/_assets/{index-CVEw6hKC.js → index-C-WOsJGb.js} +1 -1
- package/_assets/{index-CvJmHkgv.js → index-C0tIouBf.js} +3 -3
- package/_assets/{index-DVP9mmy0.js → index-C6G5Ojpz.js} +1 -1
- package/_assets/{index-MhPhsWP8.js → index-C7hGN0lI.js} +1 -1
- package/_assets/{index-CFjdvXcL.js → index-CBe4gtAt.js} +2 -2
- package/_assets/{index-DOmua37r.js → index-CFypPkBr.js} +1 -1
- package/_assets/{index-dguKxdA7.js → index-CHb52k2r.js} +2 -2
- package/_assets/{index-DnafkRIs.js → index-CN8WHGrH.js} +1 -1
- package/_assets/{index-CDV3IoQm.js → index-COY9dHV9.js} +1 -1
- package/_assets/{index-DqogjYMl.js → index-CPTPmsi2.js} +1 -1
- package/_assets/{index-CM4gYpZ8.js → index-CPhcLOEq.js} +1 -1
- package/_assets/{index-Dg22Nieo.js → index-Ch87wzNg.js} +1 -1
- package/_assets/index-CqRUWZDq.js +1 -0
- package/_assets/{index-Dij6LJf6.js → index-CuSvjeNM.js} +1 -1
- package/_assets/{index-BLKe1fxG.js → index-CwFxxSc1.js} +299 -299
- package/_assets/{index-CRd1XuYs.js → index-CwKi0BcO.js} +1 -1
- package/_assets/{index-B9zvMdI0.js → index-CxTgEmAp.js} +1 -1
- package/_assets/{index-BPqobsB6.js → index-CyQd3Dif.js} +1 -1
- package/_assets/{index-BRZA_fuK.js → index-D7TrWXvV.js} +1 -1
- package/_assets/{index-BSFFapHO.js → index-DCZ36akI.js} +1 -1
- package/_assets/{index-CCenxE7k.js → index-DFNARVN7.js} +1 -1
- package/_assets/{index-Bo-edPJM.js → index-DGXzZsJb.js} +1 -1
- package/_assets/{index-CSHbp-r-.js → index-DKKo0LoX.js} +11 -11
- package/_assets/{index-MuXfi5UE.js → index-DOGInGKk.js} +1 -1
- package/_assets/{index-BsgL3ujL.js → index-DQ1Y3Whz.js} +1 -1
- package/_assets/{index-BzVWz4Tj.js → index-DRKYu1B3.js} +1 -1
- package/_assets/{index-DlhJ9Qox.js → index-DRyHPso7.js} +1 -1
- package/_assets/{index-UR9Qpju9.js → index-DSJJjIyM.js} +3 -3
- package/_assets/{index-B-2CvxPO.js → index-DSQSVjLs.js} +1 -1
- package/_assets/{index-CVIbA-VT.js → index-DdL-MVH6.js} +1 -1
- package/_assets/{index-CTenZZ8l.js → index-DgkGEui6.js} +1 -1
- package/_assets/{index-LP5Of-SX.js → index-Sn4izkWE.js} +1 -1
- package/_assets/index-UdM3HuhV.js +1 -0
- package/_assets/{index-CWhL4zBo.js → index-e3mxlGeM.js} +1 -1
- package/_assets/{index-Bo5HGYUE.js → index-fRwny2zx.js} +1 -1
- package/_assets/{index-0DS7nWrl.js → index-fvtPPVdt.js} +1 -1
- package/_assets/{index-ShFdgjrK.js → index-j8jUDLYS.js} +1 -1
- package/_assets/{index-BBrm4kwZ.js → index-rj2Zyfmj.js} +3 -3
- package/_assets/{index.es-WFmF4El-.js → index.es-C7evsiQb.js} +4 -4
- package/_assets/{index.es-CM1g4yN5.js → index.es-DF_rXR3Q.js} +1 -1
- package/_assets/{index.es-C61rbBYw.js → index.es-DYP1_xK_.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DGjQ1weV.js → localBatchGatewayRequest-BXykDIjc.js} +1 -1
- package/_assets/{networks-C1UzX1Sm.js → networks-DKlZyT-L.js} +1 -1
- package/_assets/{onramp-Fd2Cj3wL.js → onramp-ByQtA-xO.js} +1 -1
- package/_assets/{openzeppelin-BYo8OyKm.js → openzeppelin-CroDtw4s.js} +1 -1
- package/_assets/{parseNft-Gein49L0.js → parseNft-BH0wDTt0.js} +2 -2
- package/_assets/{parseSignature-k67zYFy4.js → parseSignature-DgaK7Nqy.js} +1 -1
- package/_assets/{parseSignature-DaGe9UWu.js → parseSignature-VSsiOnpe.js} +3 -3
- package/_assets/{passkeys-D3J4DzgH.js → passkeys-C1oIb99i.js} +1 -1
- package/_assets/{pay-with-exchange-CbWF1HDJ.js → pay-with-exchange-CttWQzQs.js} +1 -1
- package/_assets/{qr-overlay-nWKGC2_v.js → qr-overlay-DHUyjo36.js} +1 -1
- package/_assets/{receive-bg6fMaP3.js → receive-BKxXWv2t.js} +1 -1
- package/_assets/{resolveImplementation-3oaoK01c.js → resolveImplementation-X7KhKw3S.js} +1 -1
- package/_assets/{rpc-BohETOPd.js → rpc-CLJ9sbD8.js} +1 -1
- package/_assets/{secp256k1-DDb2NhqN.js → secp256k1-Cbp19gqh.js} +1 -1
- package/_assets/{secp256k1-DTNpVYCz.js → secp256k1-DPi4cvKJ.js} +1 -1
- package/_assets/{secp256k1-C-hoA_Tn.js → secp256k1-DxA18vH5.js} +1 -1
- package/_assets/{send-CmaFLfs9.js → send-EgTowmAZ.js} +1 -1
- package/_assets/{send-batch-transaction-BGvy0zyD.js → send-batch-transaction-wEk0AI7v.js} +1 -1
- package/_assets/{send-eip712-transaction-hYvHM7vZ.js → send-eip712-transaction-BBM2idYc.js} +2 -2
- package/_assets/{send-gasless-transaction-QyhmnHZB.js → send-gasless-transaction-UdxWKrE2.js} +2 -2
- package/_assets/{send-transaction-CtZe85mL.js → send-transaction-DEvt9fmJ.js} +2 -2
- package/_assets/{sendMetaTransaction-C5SAvbei.js → sendMetaTransaction-BYbBPih_.js} +1 -1
- package/_assets/{sendRawTransaction-B2WHhB1D.js → sendRawTransaction-D5OSt6IO.js} +3 -3
- package/_assets/{serializeTransaction-BwuobXgs.js → serializeTransaction-Blc5JuIS.js} +1 -1
- package/_assets/{session-proposal-pdBgnfq3.js → session-proposal-BOLRFjK9.js} +1 -1
- package/_assets/{session-request-DVhv1Cj8.js → session-request-CRjXklwV.js} +2 -2
- package/_assets/{signing-BRSDIb8-.js → signing-B3rrMiJs.js} +3 -3
- package/_assets/skeleton.styles-D3iPDKdT.js +7 -0
- package/_assets/{socials-D7ScJClR.js → socials-QIa2OQ6D.js} +1 -1
- package/_assets/{styled-CrSAMFFb.js → styled-CMJUrQY2.js} +1 -1
- package/_assets/{swaps-wmzxaVLP.js → swaps-DIftYDvd.js} +1 -1
- package/_assets/{thirdweb-WdIIt1R4.js → thirdweb-C0YKMkrc.js} +3 -3
- package/_assets/{to-serializable-transaction-Dcp4UJq5.js → to-serializable-transaction-Cjnw6yJ0.js} +2 -2
- package/_assets/{transactionReceipt-CX5pZ3y-.js → transactionReceipt-BCryC1fM.js} +1 -1
- package/_assets/{transactions-CP64yjJv.js → transactions-p19NlOdG.js} +1 -1
- package/_assets/{useCreditPacks-BtlA3bsY.js → useCreditPacks-DL0joeDc.js} +1 -1
- package/_assets/{useImportable-30ssdgwW.js → useImportable-CXGXlKVj.js} +1 -1
- package/_assets/{useInfiniteGrid-DwOzTLpA.js → useInfiniteGrid-DCnfT2gg.js} +1 -1
- package/_assets/{useTheme-BTDb7mvT.js → useTheme-vYv6two9.js} +1 -1
- package/_assets/{verifyHash-C6FN0xpS.js → verifyHash-Dnb3FmXs.js} +1 -1
- package/_assets/{w3m-modal-Bq0A97y3.js → w3m-modal-BPKpwX5-.js} +1 -1
- package/_assets/{w3m-modal-DoKC93v3.js → w3m-modal-CQfqosvf.js} +1 -1
- package/_assets/{wait-for-tx-receipt-25yHA4Ha.js → wait-for-tx-receipt-H6RTv4Cw.js} +1 -1
- package/_assets/{wallets-CLLcXEAl.js → wallets-C2vtueR8.js} +5 -5
- package/_assets/{web-connector-CXNgxhSL.js → web-connector-Cc4ShgT6.js} +3 -3
- package/_assets/{writeContract-78bJpqls.js → writeContract-B_DvmCjk.js} +1 -1
- package/_assets/{zoraTestnet-CNk9bURD.js → zoraTestnet-TFaEQBOe.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Collection-D6DIMkEd.js +0 -162
- package/_assets/Creator-k4PUSiKV.js +0 -306
- package/_assets/LazyEmoteControls-CtiNE6Cc.js +0 -2
- package/_assets/MyAssets-_v0xxc8e.js +0 -381
- package/_assets/Success-rROJaYNs.js +0 -280
- package/_assets/index-CLm02-HM.js +0 -1
- package/_assets/index-zCa2boac.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as k,d as te,j as e,r as p}from"./react-BYHuwl8r.js";import{s as t,I as j,t as ie,
|
|
1
|
+
import{L as k,d as te,j as e,r as p}from"./react-BYHuwl8r.js";import{s as t,I as j,t as ie,O as se,P as ae,Q as ne,B as w,R as oe,o as B,S as re,v as le,x as de,b as a,U as M,V as F,W as ce,X as pe,Y as he,Z as me,$ as xe,a0 as ue,a1 as ge,a2 as fe,a3 as be,a4 as ve,a5 as ye,a6 as je,a7 as we,a8 as ke,a9 as Ie,aa as $e,z as E,ab as Ce,ac as Ee,ad as ze,ae as Le,af as Oe,ag as Se}from"./index-CwFxxSc1.js";import{E as _}from"./ErrorNotice-BU7FyT1W.js";import{E as Ae}from"./LazyEmoteControls-DLcKgwgu.js";import{O as Fe}from"./OutfitPreview-DPS3H3_3.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./disposePreview-C6zVmkpS.js";const{colors:o,radius:Ne,media:d}=ie,H=t.div`
|
|
2
2
|
max-width: 1721px;
|
|
3
3
|
margin: 0 auto;
|
|
4
4
|
`,Te=t.nav`
|
|
@@ -8,7 +8,7 @@ import{L as k,d as te,j as e,r as p}from"./react-BYHuwl8r.js";import{s as t,I as
|
|
|
8
8
|
font-size: 13px;
|
|
9
9
|
color: ${o.muted};
|
|
10
10
|
margin-bottom: 18px;
|
|
11
|
-
`,
|
|
11
|
+
`,N=t(k)`
|
|
12
12
|
color: ${o.muted};
|
|
13
13
|
|
|
14
14
|
&:hover {
|
|
@@ -231,7 +231,7 @@ import{L as k,d as te,j as e,r as p}from"./react-BYHuwl8r.js";import{s as t,I as
|
|
|
231
231
|
font-size: 12px;
|
|
232
232
|
font-weight: 400;
|
|
233
233
|
padding: 2px 8px;
|
|
234
|
-
border-radius: ${
|
|
234
|
+
border-radius: ${Ne.chip};
|
|
235
235
|
background: ${o.chip};
|
|
236
236
|
color: ${o.text2};
|
|
237
237
|
white-space: nowrap;
|
|
@@ -331,4 +331,4 @@ import{L as k,d as te,j as e,r as p}from"./react-BYHuwl8r.js";import{s as t,I as
|
|
|
331
331
|
opacity: 0.4;
|
|
332
332
|
`,nt=t.h1`
|
|
333
333
|
font-size: 24px;
|
|
334
|
-
`,R="outfit-detail-preview";function bt(){const{id:i}=te(),n=B(f=>f.session),c=re(),g=c==="creator",{data:r,isError:I,refetch:m}=le({queryKey:["outfit",i,g],enabled:
|
|
334
|
+
`,R="outfit-detail-preview";function bt(){const{id:i}=te(),n=B(f=>f.session),c=re(),g=c==="creator",{data:r,isError:I,refetch:m}=le({queryKey:["outfit",i,g],enabled:F()&&!!i,staleTime:6e4,queryFn:()=>Se(i,g&&n?n.identity:void 0)}),l=!F()||!i||r===null&&c!=="pending";return de(l?{title:a("seo.outfit.notFoundTitle"),noindex:!0}:r?{title:r.name,image:M(r.thumbnailHash)??void 0}:{}),l?e.jsxs(W,{"data-testid":"outfit-notfound",children:[e.jsx(at,{name:"cart",size:44}),e.jsx(nt,{children:a("outfits.detail.notFoundTitle")}),e.jsx("p",{className:"muted",children:a("outfits.detail.notFoundBody")}),e.jsx(w,{as:k,to:"/items",variant:"purple",children:a("notFound.cta")})]}):I?e.jsxs(W,{"data-testid":"outfit-detail-error",children:[e.jsx(_,{message:a("outfits.errors.generic")}),e.jsx(w,{variant:"purple",onClick:()=>void m(),children:a("outfits.detail.retry")})]}):r?e.jsx(rt,{outfit:r}):e.jsx(H,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(K,{children:[e.jsx(D,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(U,{children:[e.jsx("span",{className:"skeleton",style:{width:"60%",height:32},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"40%",height:16},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"100%",height:48},"aria-hidden":!0})]})]})})}function ot({item:i}){const n=Ce(i),c=Ee(i.gender);return e.jsxs(Qe,{children:[i.rarity?e.jsx(y,{"data-variant":"rarity",style:{background:Oe(i.rarity),color:Le(i.rarity)},title:ze(i.rarity),children:i.rarity}):null,i.isSmart?e.jsxs(y,{"data-variant":"smart",children:[e.jsx(j,{name:"smart",size:13}),a("assetCard.smart")]}):null,n?e.jsx(y,{"data-variant":"icon",children:e.jsx(j,{name:n})}):null,c?e.jsx(y,{"data-variant":"icon",children:e.jsx(j,{name:c})}):null]})}function rt({outfit:i}){const n=ce(i),{split:c,availableCount:g,totalCredits:r,addOutfit:I,isAdding:m}=pe(i,n),l=B(s=>{var u;return(u=s.session)==null?void 0:u.address}),f=he(s=>s.items),L=p.useMemo(()=>new Set(f.map(me)),[f]),O=M(i.thumbnailHash),S=p.useRef(null);p.useEffect(()=>{S.current!==i.id&&(S.current=i.id,xe("Shop Outfit Viewed",{outfit_id:i.id,item_count:i.items.length}))},[i.id,i.items.length]);const $=p.useMemo(()=>i.items.map(s=>{const u=ue(s),C=n.byKey.get(u)??null;return{key:u,item:C,state:C?ge(C,{address:l,cartKeys:L}):"missing"}}),[i,n.byKey,l,L]),{data:V,isFetched:q}=fe(l),G=!l||q,Q=!!l&&!!V,X=i.bodyShape==="female"?be:i.bodyShape==="male"?ve:void 0,x=p.useMemo(()=>$.map(s=>s.item).filter(s=>!!s),[$]),A=p.useMemo(()=>ye(x),[x]),Y=p.useMemo(()=>!!je(x),[x]),Z=p.useMemo(()=>x.map(s=>we(s)??"").filter(Boolean),[x]),h=ke({address:l,tryOnUrns:A,tryOnCategories:Z}),J=i.items.length,ee=!n.isLoading&&!n.isError,b=c.purchasable.length;return e.jsxs(H,{"data-testid":"outfit-detail",children:[e.jsxs(Te,{"aria-label":a("outfits.detail.breadcrumbAria"),children:[e.jsx(N,{to:"/overview",children:a("nav.overview")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(N,{to:"/overview",children:a("outfits.detail.breadcrumbLooks")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pe,{children:i.name})]}),e.jsxs(K,{children:[e.jsx(D,{"data-testid":"outfit-detail-preview",style:{background:Ie(i)},children:O&&!n.isLoading&&A.length===0?e.jsx(Re,{src:O,alt:i.name}):e.jsx(Fe,{id:R,profile:h.profile,bodyShape:h.bodyShape??(Q?void 0:X),urns:h.urns,skin:h.skin,hair:h.hair,eyes:h.eyes,enabled:G&&!h.isLoading&&!n.isLoading,controls:Y?e.jsx(We,{"data-testid":"outfit-emote-controls",children:e.jsx(Ae,{wearablePreviewId:R,hideFrameInput:!0})}):null})}),e.jsxs(U,{children:[e.jsx(Be,{children:i.name}),e.jsx(Me,{"data-testid":"outfit-detail-meta",children:a("outfits.detail.itemsCount",{count:J})}),n.isError?e.jsxs(Ye,{children:[e.jsx(_,{message:a("outfits.detail.resolveError"),testId:"outfit-detail-resolve-error"}),e.jsx(w,{variant:"outline","data-testid":"outfit-detail-retry",onClick:n.retry,children:a("outfits.detail.retry")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(_e,{children:[e.jsx(He,{children:$.map(s=>e.jsx(Ke,{"data-testid":"outfit-detail-item","data-state":s.state,children:s.item?e.jsxs(e.Fragment,{children:[e.jsx(De,{to:`/item/${s.item.contractAddress}/${s.item.itemId}`,state:{item:s.item},"aria-label":s.item.name}),e.jsx(Ue,{src:s.item.thumbnail,alt:"",loading:"lazy"}),e.jsxs(T,{children:[e.jsx(z,{children:s.item.name}),s.item.creator?e.jsx(qe,{to:`/items/creator/${s.item.creator}`,children:e.jsx($e,{address:s.item.creator})}):null,e.jsxs(P,{children:[s.state!=="unavailable"?e.jsxs(Ge,{children:[e.jsx(E,{size:15}),s.item.priceCredits.toLocaleString()]}):null,s.state==="unavailable"?e.jsx(v,{children:a("outfits.card.unavailable")}):s.state==="own_listing"?e.jsx(v,{children:a("outfits.detail.yourListing")}):s.state==="in_cart"?e.jsx(v,{children:a("outfits.detail.inCart")}):null,e.jsx(ot,{item:s.item})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{className:n.isLoading?"skeleton":void 0,"aria-hidden":!0}),e.jsx(T,{children:n.isLoading?e.jsx(z,{children:e.jsx("span",{className:"skeleton",style:{display:"block",width:"70%",height:14}})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"muted",children:a("outfits.card.unavailable")}),e.jsx(P,{children:e.jsx(v,{children:a("outfits.card.unavailable")})})]})})]})},s.key))}),ee&&c.ownListing.length>0?e.jsx(Xe,{className:"muted small",children:a("outfits.detail.yourListingHint")}):null]}),e.jsxs(Ze,{"data-testid":"outfit-detail-ctabar",children:[e.jsxs(Je,{children:[e.jsx(et,{children:a("outfits.detail.totalPrice")}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:64,height:26},"aria-hidden":!0}):e.jsxs(tt,{children:[e.jsx(E,{size:22}),r.toLocaleString()]})]}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:"100%",height:52,borderRadius:26},"aria-hidden":!0}):e.jsxs(it,{variant:"purple","data-testid":"outfit-detail-cta",onClick:I,disabled:m||b===0,"aria-busy":m||void 0,children:[m?a("outfits.card.adding"):b>0?a("outfits.detail.addCount",{count:b}):g>0?a("outfits.detail.nothingToAdd"):a("outfits.card.unavailable"),!m&&b>0?e.jsxs(st,{children:[e.jsx(E,{size:16}),r.toLocaleString()]}):null]})]})]})]})]})]})}export{bt as OutfitDetail,bt as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r,j as n}from"./react-BYHuwl8r.js";import{d as
|
|
1
|
+
import{r,j as n}from"./react-BYHuwl8r.js";import{d as v}from"./dcl-schemas-CmtP3U6y.js";import{s as P,Y as R,c as F,ah as O,b as S}from"./index-CwFxxSc1.js";import{u as B,d as W}from"./disposePreview-C6zVmkpS.js";const H=P.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
inset: 0;
|
|
4
4
|
display: grid;
|
|
5
5
|
place-items: center;
|
|
6
|
-
`;function q({id:a,profile:i,bodyShape:
|
|
6
|
+
`;function q({id:a,profile:i,bodyShape:g,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=R(t=>t.fittingOpen),{ref:h,active:x}=B(),e=c&&s.length>0&&x&&!E,y=s.length>0?s[0].includes(":amoy:"):F.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[b,m]=r.useState(!1);r.useEffect(()=>{if(!e){m(!1);return}let t=0,I=0;const p=()=>{document.getElementById(a)?m(!0):I++<300&&(t=requestAnimationFrame(p))};return p(),()=>cancelAnimationFrame(t)},[e,a]);const u=r.useRef(null);return r.useEffect(()=>{if(e)return()=>{W(u.current),u.current=null}},[e]),n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:h,"data-preview-viewport":!0,"aria-hidden":!0}),e?n.jsx(O,{id:a,profile:i,bodyShape:g,urns:s,skin:l,hair:f,eyes:d,type:v.PreviewType.AVATAR,emote:v.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:y,onLoad:()=>{var t;o(!0),u.current=((t=document.getElementById(a))==null?void 0:t.contentWindow)??null}},i):null,b?w:null,c&&s.length===0?null:!e||!j?n.jsx(H,{"aria-busy":"true","aria-label":S("spinner.loading"),children:n.jsx("span",{className:"spinner","aria-hidden":!0})}):null]})}export{q as O};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as d,j as t,L as
|
|
1
|
+
import{r as d,j as t,L as A,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";import{s as o,t as dt,I as K,aG as Xt,b as e,z as st,B as x,K as kt,o as J,S as Yt,x as Zt,A as Tt,v as Ct,W as te,a0 as N,aH as Q,aI as ee,aJ as ie,aK as V,a5 as se,a6 as oe,a3 as ae,a4 as ne,U as It,a9 as re,aL as ot,aM as de,aN as le,aO as ue,E as F,aP as Et,aQ as Lt,aR as O,F as at,aS as nt,aT as ce,aU as pe,aV as fe,$ as me,aW as he,aX as xe,ag as ge}from"./index-CwFxxSc1.js";import{E as D}from"./ErrorNotice-BU7FyT1W.js";import{L as be}from"./LoadMore-i3u3Pyt6.js";import{u as ye}from"./useInfiniteGrid-DCnfT2gg.js";import{O as je}from"./OutfitPreview-DPS3H3_3.js";import{T as ve}from"./skeleton.styles-D3iPDKdT.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./disposePreview-C6zVmkpS.js";const{colors:h,radius:X,media:we}=dt,$e=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
5
|
-
|
|
5
|
+
`,Se=o.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
gap: 8px;
|
|
@@ -20,10 +20,10 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
20
20
|
font: inherit;
|
|
21
21
|
color: ${h.text};
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,ke=o.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
gap: 8px;
|
|
26
|
-
`,
|
|
26
|
+
`,Te=o.button`
|
|
27
27
|
min-height: 44px;
|
|
28
28
|
padding: 0 16px;
|
|
29
29
|
border-radius: ${X.pill};
|
|
@@ -44,13 +44,13 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
44
44
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
45
45
|
gap: 10px;
|
|
46
46
|
|
|
47
|
-
${
|
|
47
|
+
${we.maxWidth("mobile")} {
|
|
48
48
|
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
50
|
+
`,Ce=o.span`
|
|
51
51
|
height: 190px;
|
|
52
52
|
border-radius: ${X.card};
|
|
53
|
-
`,
|
|
53
|
+
`,Ie=o.button`
|
|
54
54
|
position: relative;
|
|
55
55
|
display: flex;
|
|
56
56
|
flex-direction: column;
|
|
@@ -77,32 +77,32 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
77
77
|
opacity: 0.5;
|
|
78
78
|
cursor: default;
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,Ee=o.img`
|
|
81
81
|
width: 100%;
|
|
82
82
|
aspect-ratio: 1;
|
|
83
83
|
object-fit: cover;
|
|
84
84
|
border-radius: 8px;
|
|
85
85
|
background: ${h.media};
|
|
86
|
-
`,
|
|
86
|
+
`,Le=o.span`
|
|
87
87
|
font-size: 13px;
|
|
88
88
|
font-weight: 600;
|
|
89
89
|
white-space: nowrap;
|
|
90
90
|
overflow: hidden;
|
|
91
91
|
text-overflow: ellipsis;
|
|
92
|
-
`,
|
|
92
|
+
`,Ne=o.span`
|
|
93
93
|
display: inline-flex;
|
|
94
94
|
align-items: center;
|
|
95
95
|
gap: 4px;
|
|
96
96
|
font-size: 12px;
|
|
97
97
|
color: ${h.muted};
|
|
98
|
-
`,
|
|
98
|
+
`,Re=o(K)`
|
|
99
99
|
position: absolute;
|
|
100
100
|
top: 12px;
|
|
101
101
|
right: 12px;
|
|
102
102
|
color: ${h.accent};
|
|
103
103
|
background: ${h.bg};
|
|
104
104
|
border-radius: 50%;
|
|
105
|
-
`,
|
|
105
|
+
`,ze=[{key:"wearable",labelKey:"categories.wearables"},{key:"emote",labelKey:"categories.emotes"}];function Pe({selectedKeys:r,onPick:m,canPick:f}){const[c,y]=d.useState("wearable"),[j,b]=d.useState(""),[s,L]=d.useState("");d.useEffect(()=>{const l=setTimeout(()=>L(j.trim()),300);return()=>clearTimeout(l)},[j]);const{items:T,isLoading:C,isPlaceholderData:u,isError:S,hasNextPage:I,isFetchingNextPage:Y,fetchNextPage:$}=ye(["outfit-picker",c,s],l=>Xt({search:s||void 0,category:c,onSale:!0,listingType:"primary",first:24,skip:l,sortBy:"cheapest"})),g=e(c==="emote"?"outfits.studio.searchEmotes":"outfits.studio.searchWearables"),W=new Set,M=T.filter(l=>{if(!l.itemId)return!1;const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`;return W.has(v)?!1:(W.add(v),!0)});return t.jsxs($e,{"data-testid":"outfit-picker",children:[t.jsx(ke,{role:"group","aria-label":e("outfits.studio.pickerCategory"),"data-testid":"outfit-picker-category",children:ze.map(({key:l,labelKey:v})=>t.jsx(Te,{type:"button","data-category":l,"data-selected":c===l||void 0,"aria-pressed":c===l,onClick:()=>{y(l),b("")},children:e(v)},l))}),t.jsxs(Se,{children:[t.jsx(K,{name:"search",color:dt.colors.muted}),t.jsx("input",{value:j,placeholder:g,"aria-label":g,onChange:l=>b(l.target.value),"data-testid":"outfit-picker-search"})]}),S?t.jsx("p",{className:"muted small",children:e("outfits.errors.generic")}):C||u?t.jsx(jt,{"aria-busy":"true",children:Array.from({length:8},(l,v)=>t.jsx(Ce,{className:"skeleton","aria-hidden":!0},v))}):M.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noResults")}):t.jsx(jt,{children:M.map(l=>{const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`,U=r.has(v);return t.jsxs(Ie,{type:"button","data-testid":"outfit-picker-item","data-selected":U||void 0,disabled:!U&&!f(l),onClick:()=>m(l),title:l.name,children:[t.jsx(Ee,{src:l.thumbnail,alt:"",loading:"lazy"}),t.jsx(Le,{children:l.name}),t.jsxs(Ne,{children:[t.jsx(st,{size:12}),l.priceCredits.toLocaleString()]}),U?t.jsx(Re,{name:"check-rounded",size:18}):null]},v)})}),!S&&!C&&!u?t.jsx(be,{auto:!1,hasNextPage:!!I,isFetching:Y,onLoadMore:()=>void $()}):null]})}const{colors:a,radius:w,media:B,z:Oe}=dt,Nt=o.div`
|
|
106
106
|
max-width: 1200px;
|
|
107
107
|
margin: 0 auto;
|
|
108
108
|
display: flex;
|
|
@@ -126,7 +126,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
126
126
|
font-size: 24px;
|
|
127
127
|
font-weight: 800;
|
|
128
128
|
margin-right: auto;
|
|
129
|
-
`,
|
|
129
|
+
`,Ae=o(A)`
|
|
130
130
|
display: inline-flex;
|
|
131
131
|
align-items: center;
|
|
132
132
|
justify-content: center;
|
|
@@ -159,7 +159,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
159
159
|
`,Fe=o.span`
|
|
160
160
|
height: 76px;
|
|
161
161
|
border-radius: ${w.card};
|
|
162
|
-
`,
|
|
162
|
+
`,Be=o.div`
|
|
163
163
|
display: flex;
|
|
164
164
|
align-items: center;
|
|
165
165
|
gap: 14px;
|
|
@@ -176,7 +176,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
176
176
|
border-radius: 8px;
|
|
177
177
|
background: ${a.media};
|
|
178
178
|
flex-shrink: 0;
|
|
179
|
-
`,
|
|
179
|
+
`,Me=o.div`
|
|
180
180
|
${Ot};
|
|
181
181
|
overflow: hidden;
|
|
182
182
|
|
|
@@ -186,28 +186,28 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
186
186
|
object-fit: cover;
|
|
187
187
|
display: block;
|
|
188
188
|
}
|
|
189
|
-
`,
|
|
189
|
+
`,Ue=o.span`
|
|
190
190
|
${Ot};
|
|
191
191
|
display: inline-block;
|
|
192
|
-
`,
|
|
192
|
+
`,He=o.div`
|
|
193
193
|
flex: 1;
|
|
194
194
|
min-width: 0;
|
|
195
195
|
display: flex;
|
|
196
196
|
flex-direction: column;
|
|
197
197
|
gap: 4px;
|
|
198
|
-
`,
|
|
198
|
+
`,De=o.span`
|
|
199
199
|
font-size: 15px;
|
|
200
200
|
font-weight: 700;
|
|
201
201
|
white-space: nowrap;
|
|
202
202
|
overflow: hidden;
|
|
203
203
|
text-overflow: ellipsis;
|
|
204
|
-
`,
|
|
204
|
+
`,Ke=o.span`
|
|
205
205
|
display: inline-flex;
|
|
206
206
|
align-items: center;
|
|
207
207
|
gap: 8px;
|
|
208
208
|
font-size: 13px;
|
|
209
209
|
color: ${a.muted};
|
|
210
|
-
`,
|
|
210
|
+
`,We=o.div`
|
|
211
211
|
display: flex;
|
|
212
212
|
align-items: center;
|
|
213
213
|
gap: 8px;
|
|
@@ -216,7 +216,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
216
216
|
width: 100%;
|
|
217
217
|
justify-content: flex-end;
|
|
218
218
|
}
|
|
219
|
-
`,
|
|
219
|
+
`,_e=o.button`
|
|
220
220
|
display: inline-flex;
|
|
221
221
|
align-items: center;
|
|
222
222
|
justify-content: center;
|
|
@@ -237,18 +237,18 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
237
237
|
opacity: 0.5;
|
|
238
238
|
cursor: default;
|
|
239
239
|
}
|
|
240
|
-
`,
|
|
240
|
+
`,Ge=o.div`
|
|
241
241
|
position: fixed;
|
|
242
242
|
inset: 0;
|
|
243
|
-
z-index: ${
|
|
243
|
+
z-index: ${Oe.overlay};
|
|
244
244
|
display: grid;
|
|
245
245
|
place-items: center;
|
|
246
246
|
padding: 16px;
|
|
247
|
-
`,
|
|
247
|
+
`,qe=o.div`
|
|
248
248
|
position: absolute;
|
|
249
249
|
inset: 0;
|
|
250
250
|
background: rgba(22, 21, 24, 0.5);
|
|
251
|
-
`,
|
|
251
|
+
`,Qe=o.div`
|
|
252
252
|
position: relative;
|
|
253
253
|
background: ${a.bg};
|
|
254
254
|
border-radius: ${w.card};
|
|
@@ -258,15 +258,15 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 12px;
|
|
261
|
-
`,
|
|
261
|
+
`,Ve=o.h2`
|
|
262
262
|
font-size: 18px;
|
|
263
263
|
font-weight: 800;
|
|
264
|
-
`,
|
|
264
|
+
`,Je=o.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-wrap: wrap;
|
|
267
267
|
gap: 10px;
|
|
268
268
|
margin-top: 6px;
|
|
269
|
-
`,
|
|
269
|
+
`,Xe=o.div`
|
|
270
270
|
display: grid;
|
|
271
271
|
grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
|
|
272
272
|
gap: 32px;
|
|
@@ -276,15 +276,15 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
276
276
|
grid-template-columns: 1fr;
|
|
277
277
|
gap: 20px;
|
|
278
278
|
}
|
|
279
|
-
`,
|
|
279
|
+
`,Ye=o.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
gap: 18px;
|
|
283
|
-
`,
|
|
283
|
+
`,Ze=o.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
gap: 18px;
|
|
287
|
-
`,
|
|
287
|
+
`,ti=o.div`
|
|
288
288
|
position: relative;
|
|
289
289
|
aspect-ratio: 3 / 4;
|
|
290
290
|
border-radius: 16px;
|
|
@@ -307,7 +307,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
307
307
|
inset: 0;
|
|
308
308
|
pointer-events: none;
|
|
309
309
|
}
|
|
310
|
-
`,
|
|
310
|
+
`,ei=o.p`
|
|
311
311
|
position: absolute;
|
|
312
312
|
inset: 0;
|
|
313
313
|
display: grid;
|
|
@@ -324,10 +324,10 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
324
324
|
letter-spacing: 0.04em;
|
|
325
325
|
text-transform: uppercase;
|
|
326
326
|
color: ${a.muted1};
|
|
327
|
-
`,
|
|
327
|
+
`,ii=o.div`
|
|
328
328
|
display: flex;
|
|
329
329
|
gap: 8px;
|
|
330
|
-
`,
|
|
330
|
+
`,si=o.button`
|
|
331
331
|
min-height: 44px;
|
|
332
332
|
padding: 0 16px;
|
|
333
333
|
border-radius: ${w.pill};
|
|
@@ -343,7 +343,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
343
343
|
background: ${a.accent};
|
|
344
344
|
color: ${a.white};
|
|
345
345
|
}
|
|
346
|
-
`,
|
|
346
|
+
`,oi=o.div`
|
|
347
347
|
width: 240px;
|
|
348
348
|
aspect-ratio: 3 / 4;
|
|
349
349
|
border-radius: ${w.card};
|
|
@@ -360,16 +360,16 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
360
360
|
object-fit: cover;
|
|
361
361
|
display: block;
|
|
362
362
|
}
|
|
363
|
-
`,
|
|
363
|
+
`,ai=o.div`
|
|
364
364
|
display: flex;
|
|
365
365
|
align-items: center;
|
|
366
366
|
gap: 12px;
|
|
367
367
|
flex-wrap: wrap;
|
|
368
|
-
`,
|
|
368
|
+
`,ni=o.div`
|
|
369
369
|
display: flex;
|
|
370
370
|
align-items: center;
|
|
371
371
|
gap: 8px;
|
|
372
|
-
`,
|
|
372
|
+
`,ri=o.input`
|
|
373
373
|
width: 44px;
|
|
374
374
|
height: 44px;
|
|
375
375
|
padding: 2px;
|
|
@@ -385,13 +385,13 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
385
385
|
border: 0;
|
|
386
386
|
border-radius: 4px;
|
|
387
387
|
}
|
|
388
|
-
`,
|
|
388
|
+
`,di=o.div`
|
|
389
389
|
display: flex;
|
|
390
390
|
flex-direction: column;
|
|
391
391
|
gap: 2px;
|
|
392
392
|
font-size: 12px;
|
|
393
393
|
color: ${a.muted};
|
|
394
|
-
`,
|
|
394
|
+
`,li=o.input`
|
|
395
395
|
width: 88px;
|
|
396
396
|
height: 26px;
|
|
397
397
|
padding: 0 6px;
|
|
@@ -405,12 +405,12 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
405
405
|
&[data-invalid] {
|
|
406
406
|
border-color: ${a.errStrong};
|
|
407
407
|
}
|
|
408
|
-
`,
|
|
408
|
+
`,ui=o.div`
|
|
409
409
|
width: 281px;
|
|
410
410
|
max-width: 100%;
|
|
411
|
-
`,
|
|
411
|
+
`,ci=o(x)`
|
|
412
412
|
align-self: flex-start;
|
|
413
|
-
`,
|
|
413
|
+
`,pi=o.div`
|
|
414
414
|
display: flex;
|
|
415
415
|
align-items: stretch;
|
|
416
416
|
gap: 8px;
|
|
@@ -431,14 +431,14 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
431
431
|
outline: 2px solid ${a.accent};
|
|
432
432
|
outline-offset: -1px;
|
|
433
433
|
}
|
|
434
|
-
`,
|
|
434
|
+
`,fi=o.ul`
|
|
435
435
|
list-style: none;
|
|
436
436
|
margin: 0;
|
|
437
437
|
padding: 0;
|
|
438
438
|
display: flex;
|
|
439
439
|
flex-direction: column;
|
|
440
440
|
gap: 6px;
|
|
441
|
-
`,
|
|
441
|
+
`,mi=o.li`
|
|
442
442
|
display: flex;
|
|
443
443
|
align-items: center;
|
|
444
444
|
gap: 10px;
|
|
@@ -453,19 +453,19 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
453
453
|
&[data-missing] {
|
|
454
454
|
opacity: 0.6;
|
|
455
455
|
}
|
|
456
|
-
`,
|
|
456
|
+
`,At=kt`
|
|
457
457
|
width: 40px;
|
|
458
458
|
height: 40px;
|
|
459
459
|
border-radius: 8px;
|
|
460
460
|
background: ${a.media};
|
|
461
461
|
flex-shrink: 0;
|
|
462
|
-
`,
|
|
463
|
-
${
|
|
462
|
+
`,hi=o.img`
|
|
463
|
+
${At};
|
|
464
464
|
object-fit: cover;
|
|
465
|
-
`,hi=o.span`
|
|
466
|
-
${Ft};
|
|
467
|
-
display: inline-block;
|
|
468
465
|
`,xi=o.span`
|
|
466
|
+
${At};
|
|
467
|
+
display: inline-block;
|
|
468
|
+
`,gi=o.span`
|
|
469
469
|
flex: 1;
|
|
470
470
|
min-width: 0;
|
|
471
471
|
font-size: 14px;
|
|
@@ -473,7 +473,7 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
473
473
|
white-space: nowrap;
|
|
474
474
|
overflow: hidden;
|
|
475
475
|
text-overflow: ellipsis;
|
|
476
|
-
`,
|
|
476
|
+
`,bi=o.span`
|
|
477
477
|
flex: none;
|
|
478
478
|
padding: 2px 8px;
|
|
479
479
|
border-radius: ${w.pill};
|
|
@@ -487,14 +487,14 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
487
487
|
order: 1;
|
|
488
488
|
margin-left: 50px;
|
|
489
489
|
}
|
|
490
|
-
`,
|
|
490
|
+
`,yi=o.span`
|
|
491
491
|
display: inline-flex;
|
|
492
492
|
align-items: center;
|
|
493
493
|
gap: 4px;
|
|
494
494
|
font-size: 13px;
|
|
495
495
|
color: ${a.muted};
|
|
496
496
|
white-space: nowrap;
|
|
497
|
-
`,
|
|
497
|
+
`,ji=o.div`
|
|
498
498
|
display: flex;
|
|
499
499
|
align-items: center;
|
|
500
500
|
justify-content: space-between;
|
|
@@ -502,13 +502,13 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
502
502
|
border-top: 1px solid ${a.line};
|
|
503
503
|
font-size: 13px;
|
|
504
504
|
font-weight: 700;
|
|
505
|
-
`,
|
|
505
|
+
`,vi=o.span`
|
|
506
506
|
display: inline-flex;
|
|
507
507
|
align-items: center;
|
|
508
508
|
gap: 4px;
|
|
509
509
|
font-size: 15px;
|
|
510
510
|
font-weight: 700;
|
|
511
|
-
`,
|
|
511
|
+
`,wi=o.button`
|
|
512
512
|
display: inline-flex;
|
|
513
513
|
align-items: center;
|
|
514
514
|
justify-content: center;
|
|
@@ -524,14 +524,14 @@ import{r as d,j as t,L as F,d as Qt,a as Vt,b as Jt}from"./react-BYHuwl8r.js";im
|
|
|
524
524
|
color: ${a.errStrong};
|
|
525
525
|
background: ${a.panel};
|
|
526
526
|
}
|
|
527
|
-
|
|
527
|
+
`,$i=o.div`
|
|
528
528
|
display: flex;
|
|
529
529
|
flex-direction: column;
|
|
530
530
|
gap: 8px;
|
|
531
531
|
padding-top: 16px;
|
|
532
532
|
border-top: 1px solid ${a.line};
|
|
533
|
-
|
|
533
|
+
`,Si=o.div`
|
|
534
534
|
display: flex;
|
|
535
535
|
flex-wrap: wrap;
|
|
536
536
|
gap: 10px;
|
|
537
|
-
`;function Ui(){const{id:r}=Qt(),{pathname:m}=Vt(),f=J(b=>b.session),c=J(b=>b.signIn),y=Yt();Zt({title:e("outfits.studio.title"),noindex:!0});const j=m.endsWith("/new")?"new":r?"edit":"list";return y==="pending"?t.jsx(P,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?y!=="creator"?t.jsxs(P,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:F,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(ki,{}):t.jsx(Ii,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(P,{"data-testid":"outfit-studio-signin",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"purple",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Si({outfit:r}){const m=It(r.thumbnailHash);return m?t.jsx(Be,{style:{background:le(r)},children:t.jsx("img",{src:m,alt:"",loading:"lazy"})}):t.jsx(Me,{"aria-hidden":!0})}function ki(){const r=J(u=>u.session),m=Tt(),[f,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:s,isError:L,refetch:T}=Ct({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>xe(r.identity)});async function C(u,S){if(r){j(u.id);try{S==="delete"?(await ue(u.id,r.identity),A.success(e("outfits.studio.deleted"))):(await Et({...rt(u),published:!1},r.identity,"update"),A.success(e("outfits.studio.unpublished"))),Lt(m)}catch(I){I instanceof O||at(I,{flow:`outfit-${S}`}),A.error(e(I instanceof O?nt(I.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Nt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Rt,{children:[t.jsx(zt,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:F,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Fe,{className:"skeleton","aria-hidden":!0},S))}):L?t.jsxs(P,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void T(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(wt,{children:b.map(u=>t.jsxs(Ae,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Si,{outfit:u}),t.jsxs(Ue,{children:[t.jsx(He,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(De,{children:[t.jsx(Pt,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ke,{children:[u.published?t.jsx(x,{as:F,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:F,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(We,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),f?t.jsxs(_e,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ge,{onClick:()=>c(null)}),t.jsxs(qe,{children:[t.jsx(Qe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ve,{children:[f.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===f.id,onClick:()=>void C(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===f.id,onClick:()=>void C(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const St=["image/png","image/jpeg","image/webp"];function Ti(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:ot.from,gradientTo:ot.to,published:!1}}function rt(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function Ci(r){try{const m=sessionStorage.getItem(r);return m?JSON.parse(m):null}catch{return null}}function Ii({outfitId:r}){const m=r===null,f=`outfit-draft:${r??"new"}`,c=J(i=>i.session),y=Tt(),j=Jt(),[b]=d.useState(()=>Ci(f)),[s,L]=d.useState(()=>b??(m?Ti():null)),[T,C]=d.useState(!!b),{data:u,isLoading:S,isError:I,refetch:Y}=Ct({queryKey:["outfit",r,!0],enabled:!m&&!!c,staleTime:0,queryFn:()=>ge(r,c.identity)});d.useEffect(()=>{u&&L(i=>i??rt(u))},[u]);function $(i){L(n=>n&&{...n,...i}),C(!0)}d.useEffect(()=>{if(!(!s||!T))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,T,f]),d.useEffect(()=>{if(!T)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[T]),d.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const g=te(s??void 0),W=d.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(N)),[s]),M=i=>he((s==null?void 0:s.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=V;function v(i){!s||!l(i)||$({items:M(i)})}const[U,lt]=d.useState(null),E=d.useRef(null),Z=d.useRef(!0);d.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]);const[_,ut]=d.useState(!1),[At,G]=d.useState(null),[tt,ct]=d.useState(""),[Bt,pt]=d.useState(null),[k,Mt]=d.useState();d.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ft(){const i=fe(tt);if(!i){pt(e("outfits.studio.importError"));return}pt(null),ct(""),Mt(i.colors),$({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),A.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ut(i){if(!i||!c)return;if(G(null),!St.includes(i.type)){G(e("outfits.errors.unsupportedType"));return}if(i.size>ce){G(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,lt(n),ut(!0);try{const p=await pe(i,c.identity);$({thumbnailHash:p})}catch(p){p instanceof O||at(p,{flow:"outfit-thumbnail"}),G(e(p instanceof O?nt(p.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),lt(null)}finally{ut(!1)}}const[H,mt]=d.useState(!1),[Ht,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Dt=!!s&&Q(s.gradientFrom)&&Q(s.gradientTo),xt=!!s&&s.items.some(i=>{const n=g.byKey.get(N(i));return!n||ee(n)}),gt=!!s&&et&&!!s.thumbnailHash&&Dt&&xt&&s.items.length>=ie&&s.items.length<=V;async function it(i){if(!(!c||!s||H)){mt(!0),ht(null);try{const n=await Et({...s,published:i},c.identity,m?"create":"update");if(!Z.current)return;sessionStorage.removeItem(f),L(rt(n)),C(!1),Lt(y),i&&!s.published?(me("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),A.success(e("outfits.studio.publishedToast"))):A.success(e("outfits.studio.saved")),m&&(y.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof O||at(n,{flow:"outfit-save"}),ht(e(n instanceof O?nt(n.code):"outfits.errors.generic"))}finally{mt(!1)}}}const q=d.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>g.byKey.get(N(i))).filter(i=>!!i),[s,g.byKey]),bt=d.useMemo(()=>se(q),[q]),Kt=d.useMemo(()=>{const i=oe(q);return i!=null&&i.itemId?N({contractAddress:i.contractAddress,itemId:i.itemId}):null},[q]),Wt=(s==null?void 0:s.bodyShape)==="female"?ae:(s==null?void 0:s.bodyShape)==="male"?ne:void 0;if(!c)return null;if(!s)return I?t.jsxs(P,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void Y(),children:e("outfits.detail.retry")})]}):!S&&u===null?t.jsxs(P,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(x,{as:F,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(P,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const yt=U??It(s.thumbnailHash),_t={...s,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Gt=s.items.reduce((i,n)=>{var p;return i+(((p=g.byKey.get(N(n)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Nt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Rt,{children:[t.jsx(Oe,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(zt,{children:m?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Pt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Je,{children:[t.jsxs(Xe,{children:[t.jsxs(Ze,{"data-testid":"outfit-studio-preview",style:{background:re(s)},children:[t.jsx(je,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Wt,urns:bt,skin:k==null?void 0:k.skin,hair:k==null?void 0:k.hair,eyes:k==null?void 0:k.eyes,enabled:!g.isLoading}),bt.length===0&&!g.isLoading?t.jsx(ti,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(ei,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ii,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>$({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(oi,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(ai,{children:[t.jsx(ni,{type:"color",value:Q(s[i])?s[i]:ot.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>$({[i]:n.target.value.toLowerCase()})}),t.jsxs(ri,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(di,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!Q(s[i])||void 0,onChange:n=>{const p=n.target.value.trim().toLowerCase();$({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.thumbnail")}),yt?t.jsx(si,{"data-busy":_||void 0,children:t.jsx("img",{src:yt,alt:""})}):null,t.jsxs(ui,{as:"label",variant:"outline",size:"sm","data-busy":_||void 0,children:[_?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:St.join(","),hidden:!0,disabled:_,onChange:i=>{var n;return void Ut((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:At,testId:"outfit-studio-thumb-error"})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(li,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(de,{outfit:_t,resolution:g})})]})]}),t.jsxs(Ye,{children:[t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(ci,{children:[t.jsx($t,{id:"outfit-import",value:tt,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>ct(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:tt.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(D,{message:Bt,testId:"outfit-studio-import-error"})]}),t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx($t,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>$({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(R,{children:[t.jsxs(z,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",V,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(pi,{children:s.items.map(i=>{const n=N(i),p=g.byKey.get(n);return t.jsxs(fi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(mi,{src:p.thumbnail,alt:""}):t.jsx(hi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(xi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?"…":e("outfits.card.unavailable")}),n===Kt?t.jsx(gi,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(bi,{children:[t.jsx(st,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(vi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>$({items:s.items.filter(qt=>N(qt)!==n)}),children:t.jsx(K,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(yi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ji,{children:[t.jsx(st,{size:14}),Gt.toLocaleString()]})]}):null,s.items.length>=V?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ze,{selectedKeys:W,onPick:v,canPick:l})]})]}),t.jsxs(wi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Ht,testId:"outfit-studio-save-error"}),et?!gt&&!s.published?t.jsx("p",{className:"muted small","data-testid":"outfit-studio-publish-hint",children:!xt&&s.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs($i,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:H||!et,onClick:()=>void it(s.published),children:H?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:H,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:H||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ui as OutfitStudio,Ui as default};
|
|
537
|
+
`;function Di(){const{id:r}=Qt(),{pathname:m}=Vt(),f=J(b=>b.session),c=J(b=>b.signIn),y=Yt();Zt({title:e("outfits.studio.title"),noindex:!0});const j=m.endsWith("/new")?"new":r?"edit":"list";return y==="pending"?t.jsx(P,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?y!=="creator"?t.jsxs(P,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:A,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(Ti,{}):t.jsx(Ei,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(P,{"data-testid":"outfit-studio-signin",children:[t.jsx(vt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"purple",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function ki({outfit:r}){const m=It(r.thumbnailHash);return m?t.jsx(Me,{style:{background:le(r)},children:t.jsx("img",{src:m,alt:"",loading:"lazy"})}):t.jsx(Ue,{"aria-hidden":!0})}function Ti(){const r=J(u=>u.session),m=Tt(),[f,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:s,isError:L,refetch:T}=Ct({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>xe(r.identity)});async function C(u,S){if(r){j(u.id);try{S==="delete"?(await ue(u.id,r.identity),F.success(e("outfits.studio.deleted"))):(await Et({...rt(u),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Lt(m)}catch(I){I instanceof O||at(I,{flow:`outfit-${S}`}),F.error(e(I instanceof O?nt(I.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Nt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Rt,{children:[t.jsx(zt,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:A,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Fe,{className:"skeleton","aria-hidden":!0},S))}):L?t.jsxs(P,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void T(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(wt,{children:b.map(u=>t.jsxs(Be,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(ki,{outfit:u}),t.jsxs(He,{children:[t.jsx(De,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(Ke,{children:[t.jsx(Pt,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(We,{children:[u.published?t.jsx(x,{as:A,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:A,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(_e,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),f?t.jsxs(Ge,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(qe,{onClick:()=>c(null)}),t.jsxs(Qe,{children:[t.jsx(Ve,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Je,{children:[f.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===f.id,onClick:()=>void C(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===f.id,onClick:()=>void C(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const St=["image/png","image/jpeg","image/webp"];function Ci(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:ot.from,gradientTo:ot.to,published:!1}}function rt(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function Ii(r){try{const m=sessionStorage.getItem(r);return m?JSON.parse(m):null}catch{return null}}function Ei({outfitId:r}){const m=r===null,f=`outfit-draft:${r??"new"}`,c=J(i=>i.session),y=Tt(),j=Jt(),[b]=d.useState(()=>Ii(f)),[s,L]=d.useState(()=>b??(m?Ci():null)),[T,C]=d.useState(!!b),{data:u,isLoading:S,isError:I,refetch:Y}=Ct({queryKey:["outfit",r,!0],enabled:!m&&!!c,staleTime:0,queryFn:()=>ge(r,c.identity)});d.useEffect(()=>{u&&L(i=>i??rt(u))},[u]);function $(i){L(n=>n&&{...n,...i}),C(!0)}d.useEffect(()=>{if(!(!s||!T))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,T,f]),d.useEffect(()=>{if(!T)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[T]),d.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const g=te(s??void 0),W=d.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(N)),[s]),M=i=>he((s==null?void 0:s.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=V;function v(i){!s||!l(i)||$({items:M(i)})}const[U,lt]=d.useState(null),E=d.useRef(null),Z=d.useRef(!0);d.useEffect(()=>(Z.current=!0,()=>{Z.current=!1}),[]);const[_,ut]=d.useState(!1),[Ft,G]=d.useState(null),[tt,ct]=d.useState(""),[Bt,pt]=d.useState(null),[k,Mt]=d.useState();d.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ft(){const i=fe(tt);if(!i){pt(e("outfits.studio.importError"));return}pt(null),ct(""),Mt(i.colors),$({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ut(i){if(!i||!c)return;if(G(null),!St.includes(i.type)){G(e("outfits.errors.unsupportedType"));return}if(i.size>ce){G(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,lt(n),ut(!0);try{const p=await pe(i,c.identity);$({thumbnailHash:p})}catch(p){p instanceof O||at(p,{flow:"outfit-thumbnail"}),G(e(p instanceof O?nt(p.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),lt(null)}finally{ut(!1)}}const[H,mt]=d.useState(!1),[Ht,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Dt=!!s&&Q(s.gradientFrom)&&Q(s.gradientTo),xt=!!s&&s.items.some(i=>{const n=g.byKey.get(N(i));return!n||ee(n)}),gt=!!s&&et&&!!s.thumbnailHash&&Dt&&xt&&s.items.length>=ie&&s.items.length<=V;async function it(i){if(!(!c||!s||H)){mt(!0),ht(null);try{const n=await Et({...s,published:i},c.identity,m?"create":"update");if(!Z.current)return;sessionStorage.removeItem(f),L(rt(n)),C(!1),Lt(y),i&&!s.published?(me("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),m&&(y.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof O||at(n,{flow:"outfit-save"}),ht(e(n instanceof O?nt(n.code):"outfits.errors.generic"))}finally{mt(!1)}}}const q=d.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>g.byKey.get(N(i))).filter(i=>!!i),[s,g.byKey]),bt=d.useMemo(()=>se(q),[q]),Kt=d.useMemo(()=>{const i=oe(q);return i!=null&&i.itemId?N({contractAddress:i.contractAddress,itemId:i.itemId}):null},[q]),Wt=(s==null?void 0:s.bodyShape)==="female"?ae:(s==null?void 0:s.bodyShape)==="male"?ne:void 0;if(!c)return null;if(!s)return I?t.jsxs(P,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"purple",onClick:()=>void Y(),children:e("outfits.detail.retry")})]}):!S&&u===null?t.jsxs(P,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(x,{as:A,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(P,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const yt=U??It(s.thumbnailHash),_t={...s,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Gt=s.items.reduce((i,n)=>{var p;return i+(((p=g.byKey.get(N(n)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Nt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Rt,{children:[t.jsx(Ae,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(zt,{children:m?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Pt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Xe,{children:[t.jsxs(Ye,{children:[t.jsxs(ti,{"data-testid":"outfit-studio-preview",style:{background:re(s)},children:[t.jsx(je,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Wt,urns:bt,skin:k==null?void 0:k.skin,hair:k==null?void 0:k.hair,eyes:k==null?void 0:k.eyes,enabled:!g.isLoading}),bt.length===0&&!g.isLoading?t.jsx(ei,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(ii,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(si,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>$({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(ai,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(ni,{children:[t.jsx(ri,{type:"color",value:Q(s[i])?s[i]:ot.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>$({[i]:n.target.value.toLowerCase()})}),t.jsxs(di,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(li,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!Q(s[i])||void 0,onChange:n=>{const p=n.target.value.trim().toLowerCase();$({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.thumbnail")}),yt?t.jsx(oi,{"data-busy":_||void 0,children:t.jsx("img",{src:yt,alt:""})}):null,t.jsxs(ci,{as:"label",variant:"outline",size:"sm","data-busy":_||void 0,children:[_?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:St.join(","),hidden:!0,disabled:_,onChange:i=>{var n;return void Ut((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:Ft,testId:"outfit-studio-thumb-error"})]}),t.jsxs(R,{children:[t.jsx(z,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(ui,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(de,{outfit:_t,resolution:g})})]})]}),t.jsxs(Ze,{children:[t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(pi,{children:[t.jsx($t,{id:"outfit-import",value:tt,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>ct(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:tt.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(D,{message:Bt,testId:"outfit-studio-import-error"})]}),t.jsxs(R,{children:[t.jsx(z,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx($t,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>$({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(R,{children:[t.jsxs(z,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",V,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(fi,{children:s.items.map(i=>{const n=N(i),p=g.byKey.get(n);return t.jsxs(mi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(hi,{src:p.thumbnail,alt:""}):t.jsx(xi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(gi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?t.jsx(ve,{className:"skeleton",width:96,"aria-hidden":!0}):e("outfits.card.unavailable")}),n===Kt?t.jsx(bi,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(yi,{children:[t.jsx(st,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(wi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>$({items:s.items.filter(qt=>N(qt)!==n)}),children:t.jsx(K,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(ji,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(vi,{children:[t.jsx(st,{size:14}),Gt.toLocaleString()]})]}):null,s.items.length>=V?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(Pe,{selectedKeys:W,onPick:v,canPick:l})]})]}),t.jsxs($i,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Ht,testId:"outfit-studio-save-error"}),et?!gt&&!s.published?t.jsx("p",{className:"muted small","data-testid":"outfit-studio-publish-hint",children:!xt&&s.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs(Si,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:H||!et,onClick:()=>void it(s.published),children:H?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:H,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:H||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Di as OutfitStudio,Di as default};
|