@dcl/shop 0.5.1-30941423866.commit-16bb43e → 0.5.1-30942080363.commit-5a008a2
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-D6HGEkBY.js → Activity-CfohBp0y.js} +6 -6
- package/_assets/{AnimatedBackground-Bz6-eXM-.js → AnimatedBackground-gpCse7EH.js} +2 -2
- package/_assets/{Assets-91-VU1Yf.js → Assets-IY2PmVDp.js} +7 -7
- package/_assets/{Assets.styles-nkCcUHhi.js → Assets.styles-DU_WP2lv.js} +1 -1
- package/_assets/{Authorizations-CEIgVod3.js → Authorizations-DgmmTCT_.js} +3 -3
- package/_assets/{Cart-bL5VUwar.js → Cart-gTkEGP_-.js} +22 -22
- package/_assets/{CircularProgress-t5C2xMSa.js → CircularProgress-1fPr054_.js} +3 -3
- package/_assets/Collection-BRcUPhzB.js +119 -0
- package/_assets/{CollectionCarousel-BofN3PUd.js → CollectionCarousel-CMmb6-ne.js} +17 -17
- package/_assets/{Creator-BvEpySRn.js → Creator-CFYVnbbD.js} +9 -9
- package/_assets/{ErrorNotice-SoCdrSmZ.js → ErrorNotice-D6PKmOXM.js} +1 -1
- package/_assets/{ExchangeController-CfUvjqK_.js → ExchangeController-DrcHwQX8.js} +1 -1
- package/_assets/{GetCredits-DoaG2_0N.js → GetCredits-X1fDrfGZ.js} +12 -12
- package/_assets/{HelpersUtil-BMGSbn7T.js → HelpersUtil-JE28M1o7.js} +1 -1
- package/_assets/{ItemDetail-DgqMo17C.js → ItemDetail-DeXvVWPr.js} +3 -3
- package/_assets/{LoadMore-QZxbtyl3.js → LoadMore-B2K4UDfe.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-CfeNfvcw.js → ManaPricingBanner.styles-eLx-8UKH.js} +3 -3
- package/_assets/{MenuList-3Ove0Kax.js → MenuList-CnBRd37k.js} +1 -1
- package/_assets/{MyAssets-Dfi9GJY7.js → MyAssets-DdRWkVS3.js} +1 -1
- package/_assets/{MyFavorites-4NZPS72p.js → MyFavorites-BlGmxMaR.js} +1 -1
- package/_assets/NotFound-Bz-rDcjH.js +13 -0
- package/_assets/{NotificationsBell-C3ZVZms3.js → NotificationsBell-BrZbQAvI.js} +1 -1
- package/_assets/{OutfitDetail-BnpYR8Sn.js → OutfitDetail-B249K3hQ.js} +4 -4
- package/_assets/{OutfitPreview-Ds73Fyio.js → OutfitPreview-Cdl7SceL.js} +2 -2
- package/_assets/{OutfitStudio-BcZDs5Sw.js → OutfitStudio-YxiNgnnh.js} +13 -13
- package/_assets/{StoreSettings-DgkB-s8z.js → StoreSettings-DopfDTeB.js} +43 -43
- package/_assets/{Success-CFrayKii.js → Success-C5omXUBX.js} +6 -6
- package/_assets/{SwapController-B0I2SBMi.js → SwapController-Bjmuyz_j.js} +1 -1
- package/_assets/{Tooltip-DrwaXxlg.js → Tooltip-D3wp0OFx.js} +1 -1
- package/_assets/{TradeService-wTgWWF_f.js → TradeService-1mcj7EiB.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-DmUcIZ1-.js → W3MFrameProviderSingleton-DHrNy8cB.js} +3 -3
- package/_assets/{WebCryptoP256-Bh90kMb3.js → WebCryptoP256-D9oW_qyA.js} +1 -1
- package/_assets/{authorizations-LULzuipv.js → authorizations-Bx-uumVM.js} +1 -1
- package/_assets/{basic-BJTMzaq4.js → basic-B39QAUZJ.js} +1 -1
- package/_assets/{biconomy-DwCfSXz5.js → biconomy-Bx6Ho69d.js} +1 -1
- package/_assets/browseLayout.styles-DXLz-YlY.js +91 -0
- package/_assets/{builder-CsWf7X7a.js → builder-Czq1-krd.js} +1 -1
- package/_assets/{buy-Cs1e8dwt.js → buy-BDTufK8m.js} +1 -1
- package/_assets/{buy-gasless-nMph8utE.js → buy-gasless-CXKZGuta.js} +1 -1
- package/_assets/{categories-Al7TFiZ3.js → categories-3pKh51AH.js} +1 -1
- package/_assets/{ccip-BwXOtHnt.js → ccip-BDfDn3iK.js} +1 -1
- package/_assets/{ccip-D1z2vDZ1.js → ccip-Co2XroO9.js} +1 -1
- package/_assets/{clsx-CF2rJgou.js → clsx-FFNUV-WB.js} +2 -2
- package/_assets/{controller-Dd98YdMj.js → controller-Bpa17ZZP.js} +2 -2
- package/_assets/{core-D1SojbPa.js → core-BAfyWlVX.js} +4 -4
- package/_assets/{createSvgIcon-BD9EM61r.js → createSvgIcon-B10djVRg.js} +3 -3
- package/_assets/{custom-COzYkjQL.js → custom-B06rMK4w.js} +1 -1
- package/_assets/{data-capture-BjEF_GLG.js → data-capture-BkYxbz02.js} +1 -1
- package/_assets/{email-ps4Ivz5i.js → email-Bknt0jHD.js} +1 -1
- package/_assets/{embedded-wallet-CVLG0kXZ.js → embedded-wallet-o7x5DbDu.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CDuZD50Q.js → emotion-styled.browser.esm-Dpa1iAyn.js} +1 -1
- package/_assets/{engine-pr6_tb_z.js → engine-BNOXJug7.js} +1 -1
- package/_assets/{errors-5vlAB2Zg.js → errors-Cg4Fnsf8.js} +1 -1
- package/_assets/{estimate-l1-fee-B3g-FnFs.js → estimate-l1-fee-DXNJIfzL.js} +1 -1
- package/_assets/{execute-Cel7d92K.js → execute-BFeK7M_Y.js} +2 -2
- package/_assets/{features-D5rLpDoE.js → features-DCfBaiy_.js} +1 -1
- package/_assets/{fetchTokenMetadata-DryrCOLG.js → fetchTokenMetadata-aKrX_QaT.js} +2 -2
- package/_assets/{field.styles-C90By0S4.js → field.styles-tnDxAMEw.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-DS2uBDFK.js → get-ecosystem-wallet-info-CCTUHx5Y.js} +1 -1
- package/_assets/{getBalance-DzSIaYv8.js → getBalance-CxkeTHxS.js} +1 -1
- package/_assets/{getNFT-B_38vu3d.js → getNFT-CYunBlyN.js} +1 -1
- package/_assets/{getNFT-BYs-Lc0M.js → getNFT-Dy6NXKIb.js} +1 -1
- package/_assets/{getThemeProps-CMN_iN9O.js → getThemeProps-Bz6-UTTf.js} +1 -1
- package/_assets/{grid.styles-_dq0Z7zy.js → grid.styles-BjSrL-3s.js} +1 -1
- package/_assets/{hashTypedData-U2WpRL9J.js → hashTypedData-Ckb55FUP.js} +1 -1
- package/_assets/{hashTypedData-nZ5SahOR.js → hashTypedData-jiOsNHGE.js} +1 -1
- package/_assets/{in-app-CrkxD8Cc.js → in-app-CBFCQ5yP.js} +1 -1
- package/_assets/{in-app-wallet-calls-Li6zp_GH.js → in-app-wallet-calls-Buf5QRM_.js} +1 -1
- package/_assets/{index-uA72jFdu.js → index-9iEI2jn0.js} +1 -1
- package/_assets/{index-Crfc7kEB.js → index-B0lN-Mk6.js} +2 -2
- package/_assets/{index-BfJ9y_zu.js → index-B14yGzKq.js} +1 -1
- package/_assets/{index-CycLf6t0.js → index-B4h2Nw0d.js} +1 -1
- package/_assets/{index-DNQcT8i8.js → index-BUTTEIUm.js} +3 -3
- package/_assets/{index-EbRcCO2e.js → index-BUelAUn3.js} +1 -1
- package/_assets/{index-AnVlYA8W.js → index-BWaeHJs2.js} +1 -1
- package/_assets/{index-1geQS8z5.js → index-BYy-feq3.js} +1 -1
- package/_assets/{index-CVaetlkF.js → index-Bc5IBzFc.js} +1 -1
- package/_assets/{index-onFl5MgF.js → index-BoBgM1AD.js} +3 -3
- package/_assets/{index-CroRq_48.js → index-BzOyUlEA.js} +1 -1
- package/_assets/{index-Dl3xGhv0.js → index-C3IX0bEG.js} +1 -1
- package/_assets/{index-Cnjifnkg.js → index-C4PvJvch.js} +1 -1
- package/_assets/{index-DhVlJ1ll.js → index-CAP79hiU.js} +1 -1
- package/_assets/{index-BzjKhN7Z.js → index-CMaqcpip.js} +1 -1
- package/_assets/{index-BjGq2FUA.js → index-CWKNVQns.js} +1 -1
- package/_assets/{index-B-cFSgSm.js → index-CWsWvJQR.js} +1 -1
- package/_assets/{index-BRUTO6r3.js → index-CXO-pG6w.js} +1 -1
- package/_assets/{index-C23YPWAe.js → index-Cab_9Z0c.js} +1 -1
- package/_assets/{index-B7jpRyRq.js → index-CcfifGLA.js} +1 -1
- package/_assets/{index-DptqVcuN.js → index-CfiJexEY.js} +2 -2
- package/_assets/{index-BzJy8rqx.js → index-ChdOnCl5.js} +1 -1
- package/_assets/{index-BB2cIvLa.js → index-CpshLABR.js} +1 -1
- package/_assets/{index-BZWjyqNw.js → index-CtMN6sQa.js} +1 -1
- package/_assets/{index-CbbOEMBd.js → index-D2bvSzer.js} +1 -1
- package/_assets/{index-Cl61ltQF.js → index-D7Ov3BOT.js} +1 -1
- package/_assets/{index-DfH6m-Ar.js → index-DG0maXsi.js} +1 -1
- package/_assets/{index-ChlDHmTZ.js → index-DHfu_49i.js} +1 -1
- package/_assets/{index-CkDVG_a0.js → index-DI8pHoj5.js} +1 -1
- package/_assets/{index-DI5MJwtI.js → index-DUecvlpK.js} +1 -1
- package/_assets/{index-CtSdDkYg.js → index-DZq6_deL.js} +2 -2
- package/_assets/{index-Dy8SH7iw.js → index-DcGjcsc6.js} +1 -1
- package/_assets/{index-B5d3bUu8.js → index-DinK4F_L.js} +3 -3
- package/_assets/{index-T4DelPen.js → index-Dl80d6_E.js} +1 -1
- package/_assets/{index-CIJrlsx5.js → index-DmwDbAPX.js} +1 -1
- package/_assets/{index-DxPgc0KP.js → index-Dokx6uQZ.js} +1 -1
- package/_assets/{index-C9YePsjK.js → index-Dt_NBFaG.js} +1 -1
- package/_assets/{index-CZ-oyr8d.js → index-DvFfsS8l.js} +1 -1
- package/_assets/{index-Bie49yv7.js → index-DxEYKwRl.js} +2 -2
- package/_assets/{index-CPEW56oC.js → index-DzJCqD2K.js} +1 -1
- package/_assets/{index-3p-1HM0o.js → index-RDFBoQxi.js} +1 -1
- package/_assets/{index-BXLMe2R7.js → index-RQ6uZEar.js} +1 -1
- package/_assets/{index-DqDSn6aV.js → index-SERS6_dB.js} +1 -1
- package/_assets/{index-18uEK4oZ.js → index-STO6kbYe.js} +1 -1
- package/_assets/index-UGlpWu7U.js +3306 -0
- package/_assets/{index-BpktVBiY.js → index-_RCROc0P.js} +1 -1
- package/_assets/{index-voVSpMmf.js → index-he_m0Fl-.js} +1 -1
- package/_assets/{index-3swvxeAv.js → index-nI7p19n6.js} +1 -1
- package/_assets/{index-YQoU1Oij.js → index-nuT17Odj.js} +1 -1
- package/_assets/{index-Ccc-pGrt.js → index-qGfC-M8O.js} +1 -1
- package/_assets/{index-Z5BMZOu5.js → index-sItL3uzy.js} +16 -16
- package/_assets/{index-C6vWyFJn.js → index-wxVvLfDd.js} +2 -2
- package/_assets/{index.es-CToxxyBw.js → index.es-DThH2vFQ.js} +1 -1
- package/_assets/{index.es-DRByKX1-.js → index.es-MdcUrD81.js} +4 -4
- package/_assets/{index.es-CvbAgxyC.js → index.es-v1HXELTh.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DTJgI3xj.js → localBatchGatewayRequest-CgJUOzba.js} +1 -1
- package/_assets/{mana-convert-BvzeO7sG.js → mana-convert-C0Bze7yJ.js} +1 -1
- package/_assets/{networks-CFK3bJYy.js → networks-D-bNskAV.js} +1 -1
- package/_assets/{onramp-okVUuWV0.js → onramp-B_PP9t-6.js} +1 -1
- package/_assets/{openzeppelin-De_HqqIc.js → openzeppelin-CP5bQyOk.js} +1 -1
- package/_assets/{parseNft-q8FmdH8G.js → parseNft-Dj-N28Ic.js} +2 -2
- package/_assets/{parseSignature-CqPrGTDR.js → parseSignature-DlXx8lne.js} +3 -3
- package/_assets/{parseSignature-B5R6ASNp.js → parseSignature-Dp9TGASb.js} +1 -1
- package/_assets/{passkeys-DSnfSnMU.js → passkeys-D4vOQZOp.js} +1 -1
- package/_assets/{pay-with-exchange-W6o_xhiT.js → pay-with-exchange-BlkoZTrJ.js} +1 -1
- package/_assets/{qr-overlay-yLQ0IoEW.js → qr-overlay-B77wg9uX.js} +1 -1
- package/_assets/{receive-B1if_96A.js → receive-fChjzOcU.js} +1 -1
- package/_assets/{resolveImplementation-DO2_Regw.js → resolveImplementation-DB1To9fC.js} +1 -1
- package/_assets/{rpc-Byx0dACz.js → rpc-Dtph7Sn-.js} +1 -1
- package/_assets/{secp256k1-qgQXh0MJ.js → secp256k1-7hf5kymY.js} +1 -1
- package/_assets/{secp256k1-DZugY34I.js → secp256k1-B54M-EJX.js} +1 -1
- package/_assets/{secp256k1-DdXA0G93.js → secp256k1-RKrSZRhb.js} +1 -1
- package/_assets/{send-batch-transaction-_L7mjvMY.js → send-batch-transaction-Dsnq3698.js} +1 -1
- package/_assets/{send-eip712-transaction-DurwgWTK.js → send-eip712-transaction-Bk870_4c.js} +2 -2
- package/_assets/{send-DtosPy0k.js → send-ekbhdMTX.js} +1 -1
- package/_assets/{send-gasless-transaction-B3bmXUxJ.js → send-gasless-transaction-mhZcHIOy.js} +2 -2
- package/_assets/{send-transaction-CZKkuF5l.js → send-transaction-DLfuM_nJ.js} +2 -2
- package/_assets/{sendMetaTransaction-4my7kZiF.js → sendMetaTransaction-CbxpNfVY.js} +1 -1
- package/_assets/{sendRawTransaction-BwVANbYg.js → sendRawTransaction-Dq6iLNOF.js} +3 -3
- package/_assets/{serializeTransaction-cVp_FJox.js → serializeTransaction-D0Ct49e0.js} +1 -1
- package/_assets/{session-proposal-CYvptxU7.js → session-proposal-C_FAURhx.js} +1 -1
- package/_assets/{session-request-Bn37Dem4.js → session-request-Bdn2jF6v.js} +2 -2
- package/_assets/{signing-DEItZ-F3.js → signing-BKBKIDWR.js} +3 -3
- package/_assets/{socials-CdpDKKrQ.js → socials-DDmkzfIp.js} +1 -1
- package/_assets/{swaps-DnenFD5w.js → swaps-BZjTE4Lo.js} +1 -1
- package/_assets/{thirdweb-Bp130Dcj.js → thirdweb-BRgX__sH.js} +3 -3
- package/_assets/{to-serializable-transaction-CcF0iJ96.js → to-serializable-transaction-D0EMGY08.js} +2 -2
- package/_assets/{trade-encoding-BRe43PSw.js → trade-encoding-Dw1x271X.js} +1 -1
- package/_assets/{transactionReceipt-lMu7BRwr.js → transactionReceipt-MJ3mbhdi.js} +1 -1
- package/_assets/{transactions-B14lINkM.js → transactions-DaDqXmUP.js} +1 -1
- package/_assets/{useCreditPacks-C5VR3CBS.js → useCreditPacks-CPOVN7Gq.js} +1 -1
- package/_assets/{useImportable-B5bQ22LQ.js → useImportable-BElQRFOW.js} +1 -1
- package/_assets/{useInfiniteGrid-eJ_aRWUt.js → useInfiniteGrid-7hiVU_K4.js} +1 -1
- package/_assets/useManaRate-bDKCffp4.js +1 -0
- package/_assets/{useTheme--KekSHIk.js → useTheme-C7dqsuDI.js} +1 -1
- package/_assets/{verifyHash-Bt7jFOSN.js → verifyHash-DcTMzSLu.js} +1 -1
- package/_assets/{w3m-modal-Dn7of9MZ.js → w3m-modal-Qporq01P.js} +1 -1
- package/_assets/{w3m-modal-CDIk6daa.js → w3m-modal-gRdkhlg8.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BUw9UtP4.js → wait-for-tx-receipt-Zm4DabEW.js} +1 -1
- package/_assets/{wallets-A7pRwPiu.js → wallets-vgey4Pk4.js} +5 -5
- package/_assets/{web-connector-P4z47D9H.js → web-connector-DkrfZGZ4.js} +3 -3
- package/_assets/{writeContract-Bx4xVEvO.js → writeContract-CYVoU1GT.js} +1 -1
- package/_assets/{zoraTestnet-CuzBONzv.js → zoraTestnet-B5TlluZS.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Collection-B3QlNwPP.js +0 -119
- package/_assets/NotFound-BJON5Kwq.js +0 -13
- package/_assets/browseLayout.styles-Cb1bSjYL.js +0 -91
- package/_assets/index-CqLzAYYu.js +0 -3482
- package/_assets/useManaRate-CEsFS4D7.js +0 -1
- package/_assets/useStore-BZhz06Vz.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as j,u as J,j as e,r as m}from"./react-DehiWSvs.js";import{s as t,I as y,t as X,
|
|
1
|
+
import{L as j,u as J,j as e,r as m}from"./react-DehiWSvs.js";import{s as t,I as y,t as X,E as Y,F as Z,G as ee,B as v,H as te,l as P,J as ie,u as se,n as ae,b as a,K as A,L as ne,M as re,N as oe,O as le,P as de,Q as ce,R as pe,S as he,V as me,W as xe,X as ue,Y as ge,Z as fe,$ as be,q as I,a0 as ye,a1 as ve,a2 as je,a3 as we,a4 as $e,a5 as ke}from"./index-UGlpWu7U.js";import{E as R}from"./ErrorNotice-D6PKmOXM.js";import{O as Ie}from"./OutfitPreview-Cdl7SceL.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./disposePreview-DIA1G1eQ.js";const{colors:r,radius:Ce,media:l}=X,B=t.div`
|
|
2
2
|
max-width: 1721px;
|
|
3
3
|
margin: 0 auto;
|
|
4
4
|
`,ze=t.nav`
|
|
@@ -14,7 +14,7 @@ import{L as j,u as J,j as e,r as m}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
14
14
|
&:hover {
|
|
15
15
|
color: ${r.text};
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,Ee=t.span`
|
|
18
18
|
color: ${r.text};
|
|
19
19
|
font-weight: 600;
|
|
20
20
|
overflow: hidden;
|
|
@@ -56,7 +56,7 @@ import{L as j,u as J,j as e,r as m}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
56
56
|
inset: 0;
|
|
57
57
|
pointer-events: none;
|
|
58
58
|
}
|
|
59
|
-
`,
|
|
59
|
+
`,Le=t.img`
|
|
60
60
|
position: absolute;
|
|
61
61
|
inset: 0;
|
|
62
62
|
width: 100%;
|
|
@@ -323,4 +323,4 @@ import{L as j,u as J,j as e,r as m}from"./react-DehiWSvs.js";import{s as t,I as
|
|
|
323
323
|
opacity: 0.4;
|
|
324
324
|
`,Je=t.h1`
|
|
325
325
|
font-size: 24px;
|
|
326
|
-
`,Xe="outfit-detail-preview";function dt(){const{id:i}=J(),n=P(u=>u.session),d=ie(),x=d==="creator",{data:c,isError:w,refetch:p}=se({queryKey:["outfit",i,x],enabled:A()&&!!i,staleTime:6e4,queryFn:()=>ke(i,x&&n?n.identity:void 0)}),o=!A()||!i||c===null&&d!=="pending";return ae(o?{title:a("seo.outfit.notFoundTitle"),noindex:!0}:c?{title:c.name}:{}),o?e.jsxs(W,{"data-testid":"outfit-notfound",children:[e.jsx(Ue,{name:"cart",size:44}),e.jsx(Je,{children:a("outfits.detail.notFoundTitle")}),e.jsx("p",{className:"muted",children:a("outfits.detail.notFoundBody")}),e.jsx(v,{as:j,to:"/items",variant:"purple",children:a("notFound.cta")})]}):w?e.jsxs(W,{"data-testid":"outfit-detail-error",children:[e.jsx(R,{message:a("outfits.errors.generic")}),e.jsx(v,{variant:"purple",onClick:()=>void p(),children:a("outfits.detail.retry")})]}):c?e.jsx(Ze,{outfit:c}):e.jsx(B,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(M,{children:[e.jsx(_,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(K,{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 Ye({item:i}){const n=ye(i),d=ve(i.gender);return e.jsxs(Me,{children:[i.rarity?e.jsx(b,{"data-variant":"rarity",style:{background:$e(i.rarity),color:we(i.rarity)},title:je(i.rarity),children:i.rarity}):null,i.isSmart?e.jsxs(b,{"data-variant":"smart",children:[e.jsx(y,{name:"smart",size:13}),a("assetCard.smart")]}):null,n?e.jsx(b,{"data-variant":"icon",children:e.jsx(y,{name:n})}):null,d?e.jsx(b,{"data-variant":"icon",children:e.jsx(y,{name:d})}):null]})}function Ze({outfit:i}){const n=ne(i),{split:d,availableCount:x,totalCredits:c,addOutfit:w,isAdding:p}=re(i,n),o=P(s=>{var h;return(h=s.session)==null?void 0:h.address}),u=oe(s=>s.items),z=m.useMemo(()=>new Set(u.map(le)),[u]),
|
|
326
|
+
`,Xe="outfit-detail-preview";function dt(){const{id:i}=J(),n=P(u=>u.session),d=ie(),x=d==="creator",{data:c,isError:w,refetch:p}=se({queryKey:["outfit",i,x],enabled:A()&&!!i,staleTime:6e4,queryFn:()=>ke(i,x&&n?n.identity:void 0)}),o=!A()||!i||c===null&&d!=="pending";return ae(o?{title:a("seo.outfit.notFoundTitle"),noindex:!0}:c?{title:c.name}:{}),o?e.jsxs(W,{"data-testid":"outfit-notfound",children:[e.jsx(Ue,{name:"cart",size:44}),e.jsx(Je,{children:a("outfits.detail.notFoundTitle")}),e.jsx("p",{className:"muted",children:a("outfits.detail.notFoundBody")}),e.jsx(v,{as:j,to:"/items",variant:"purple",children:a("notFound.cta")})]}):w?e.jsxs(W,{"data-testid":"outfit-detail-error",children:[e.jsx(R,{message:a("outfits.errors.generic")}),e.jsx(v,{variant:"purple",onClick:()=>void p(),children:a("outfits.detail.retry")})]}):c?e.jsx(Ze,{outfit:c}):e.jsx(B,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(M,{children:[e.jsx(_,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(K,{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 Ye({item:i}){const n=ye(i),d=ve(i.gender);return e.jsxs(Me,{children:[i.rarity?e.jsx(b,{"data-variant":"rarity",style:{background:$e(i.rarity),color:we(i.rarity)},title:je(i.rarity),children:i.rarity}):null,i.isSmart?e.jsxs(b,{"data-variant":"smart",children:[e.jsx(y,{name:"smart",size:13}),a("assetCard.smart")]}):null,n?e.jsx(b,{"data-variant":"icon",children:e.jsx(y,{name:n})}):null,d?e.jsx(b,{"data-variant":"icon",children:e.jsx(y,{name:d})}):null]})}function Ze({outfit:i}){const n=ne(i),{split:d,availableCount:x,totalCredits:c,addOutfit:w,isAdding:p}=re(i,n),o=P(s=>{var h;return(h=s.session)==null?void 0:h.address}),u=oe(s=>s.items),z=m.useMemo(()=>new Set(u.map(le)),[u]),E=de(i.thumbnailHash),L=m.useRef(null);m.useEffect(()=>{L.current!==i.id&&(L.current=i.id,ce("Shop Outfit Viewed",{outfit_id:i.id,item_count:i.items.length}))},[i.id,i.items.length]);const $=m.useMemo(()=>i.items.map(s=>{const h=pe(s),k=n.byKey.get(h)??null;return{key:h,item:k,state:k?he(k,{address:o,cartKeys:z}):"missing"}}),[i,n.byKey,o,z]),{data:H,isFetched:q}=me(o),D=!o||q,S=!!o&&!!H,V=S?o:"default",G=i.bodyShape==="female"?xe:i.bodyShape==="male"?ue:void 0,N=m.useMemo(()=>$.map(s=>s.item?ge(s.item):null).filter(s=>!!s),[$]),Q=i.items.length,U=!n.isLoading&&!n.isError,g=d.purchasable.length;return e.jsxs(B,{"data-testid":"outfit-detail",children:[e.jsxs(ze,{"aria-label":a("outfits.detail.breadcrumbAria"),children:[e.jsx(F,{to:"/overview",children:a("nav.overview")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(F,{to:"/overview",children:a("outfits.detail.breadcrumbLooks")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Ee,{children:i.name})]}),e.jsxs(M,{children:[e.jsx(_,{"data-testid":"outfit-detail-preview",style:{background:fe(i)},children:E&&!n.isLoading&&N.length===0?e.jsx(Le,{src:E,alt:i.name}):e.jsx(Ie,{id:Xe,profile:V,bodyShape:S?void 0:G,urns:N,enabled:D&&!n.isLoading})}),e.jsxs(K,{children:[e.jsx(Se,{children:i.name}),e.jsx(Ne,{"data-testid":"outfit-detail-meta",children:a("outfits.detail.itemsCount",{count:Q})}),n.isError?e.jsxs(Ke,{children:[e.jsx(R,{message:a("outfits.detail.resolveError"),testId:"outfit-detail-resolve-error"}),e.jsx(v,{variant:"outline","data-testid":"outfit-detail-retry",onClick:n.retry,children:a("outfits.detail.retry")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Ae,{children:[e.jsx(Fe,{children:$.map(s=>e.jsx(Oe,{"data-testid":"outfit-detail-item","data-state":s.state,children:s.item?e.jsxs(e.Fragment,{children:[e.jsx(Te,{to:`/item/${s.item.contractAddress}/${s.item.itemId}`,state:{item:s.item},"aria-label":s.item.name}),e.jsx(We,{src:s.item.thumbnail,alt:"",loading:"lazy"}),e.jsxs(O,{children:[e.jsx(C,{children:s.item.name}),s.item.creator?e.jsx(Re,{to:`/items/creator/${s.item.creator}`,children:e.jsx(be,{address:s.item.creator})}):null,e.jsxs(T,{children:[s.state!=="unavailable"?e.jsxs(Be,{children:[e.jsx(I,{size:15}),s.item.priceCredits.toLocaleString()]}):null,s.state==="unavailable"?e.jsx(f,{children:a("outfits.card.unavailable")}):s.state==="own_listing"?e.jsx(f,{children:a("outfits.detail.yourListing")}):s.state==="in_cart"?e.jsx(f,{children:a("outfits.detail.inCart")}):null,e.jsx(Ye,{item:s.item})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:n.isLoading?"skeleton":void 0,"aria-hidden":!0}),e.jsx(O,{children:n.isLoading?e.jsx(C,{children:e.jsx("span",{className:"skeleton",style:{display:"block",width:"70%",height:14}})}):e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"muted",children:a("outfits.card.unavailable")}),e.jsx(T,{children:e.jsx(f,{children:a("outfits.card.unavailable")})})]})})]})},s.key))}),U&&d.ownListing.length>0?e.jsx(_e,{className:"muted small",children:a("outfits.detail.yourListingHint")}):null]}),e.jsxs(He,{"data-testid":"outfit-detail-ctabar",children:[e.jsxs(qe,{children:[e.jsx(De,{children:a("outfits.detail.totalPrice")}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:64,height:26},"aria-hidden":!0}):e.jsxs(Ve,{children:[e.jsx(I,{size:22}),c.toLocaleString()]})]}),n.isLoading?e.jsx("span",{className:"skeleton",style:{width:"100%",height:52,borderRadius:26},"aria-hidden":!0}):e.jsxs(Ge,{variant:"purple","data-testid":"outfit-detail-cta",onClick:w,disabled:p||g===0,"aria-busy":p||void 0,children:[p?a("outfits.card.adding"):g>0?a("outfits.detail.addCount",{count:g}):x>0?a("outfits.detail.nothingToAdd"):a("outfits.card.unavailable"),!p&&g>0?e.jsxs(Qe,{children:[e.jsx(I,{size:16}),c.toLocaleString()]}):null]})]})]})]})]})]})}export{dt as OutfitDetail,dt as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as i,j as r}from"./react-DehiWSvs.js";import{d as u}from"./dcl-schemas-Dr9BTjb7.js";import{s as j,
|
|
1
|
+
import{r as i,j as r}from"./react-DehiWSvs.js";import{d as u}from"./dcl-schemas-Dr9BTjb7.js";import{s as j,N as P,c as h,a6 as A,b as R}from"./index-UGlpWu7U.js";import{u as b,d as O}from"./disposePreview-DIA1G1eQ.js";const F=j.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
inset: 0;
|
|
4
4
|
display: grid;
|
|
5
5
|
place-items: center;
|
|
6
|
-
`;function
|
|
6
|
+
`;function S({id:d,profile:s,bodyShape:m,urns:e,enabled:c=!0,skin:l,hair:f,eyes:p}){const v=P(n=>n.fittingOpen),{ref:g,active:w}=b(),t=c&&e.length>0&&w&&!v,y=e.length>0?e[0].includes(":amoy:"):h.chainId===80002,[E,a]=i.useState(!1),x=e.join(",");i.useEffect(()=>{a(!1)},[x,s,l,f,p]),i.useEffect(()=>{t&&a(!1)},[t]);const o=i.useRef(null);return i.useEffect(()=>{if(t)return()=>{O(o.current),o.current=null}},[t]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:g,"data-preview-viewport":!0,"aria-hidden":!0}),t?r.jsx(A,{id:d,profile:s,bodyShape:m,urns:e,skin:l,hair:f,eyes:p,type:u.PreviewType.AVATAR,emote:u.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:y,unity:!0,unityMode:u.PreviewUnityMode.MARKETPLACE,onLoad:()=>{var n;a(!0),o.current=((n=document.getElementById(d))==null?void 0:n.contentWindow)??null}},s):null,c&&e.length===0?null:!t||!E?r.jsx(F,{"aria-busy":"true","aria-label":R("spinner.loading"),children:r.jsx("span",{className:"spinner","aria-hidden":!0})}):null]})}export{S as O};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";import{s as o,t as st,I as
|
|
1
|
+
import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";import{s as o,t as st,I as U,as as Qt,b as e,q as Y,B as m,ab as vt,l as q,J as Jt,n as Vt,v as wt,u as $t,L as Xt,R as B,at as K,au as Yt,av as G,Y as Zt,W as te,X as ee,P as St,Z as ie,aw as Z,ax as se,ay as oe,az as ae,x as F,aA as kt,aB as Tt,aC as P,y as tt,aD as et,aE as ne,aF as re,aG as de,Q as le,aH as ue,aI as ce,a5 as pe}from"./index-UGlpWu7U.js";import{E as D}from"./ErrorNotice-D6PKmOXM.js";import{L as fe}from"./LoadMore-B2K4UDfe.js";import{u as he}from"./useInfiniteGrid-7hiVU_K4.js";import{O as me}from"./OutfitPreview-Cdl7SceL.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./disposePreview-DIA1G1eQ.js";const{colors:x,radius:ot,media:xe}=st,ge=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -76,20 +76,20 @@ import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
76
76
|
gap: 4px;
|
|
77
77
|
font-size: 12px;
|
|
78
78
|
color: ${x.muted};
|
|
79
|
-
`,Se=o(
|
|
79
|
+
`,Se=o(U)`
|
|
80
80
|
position: absolute;
|
|
81
81
|
top: 12px;
|
|
82
82
|
right: 12px;
|
|
83
83
|
color: ${x.accent};
|
|
84
84
|
background: ${x.bg};
|
|
85
85
|
border-radius: 50%;
|
|
86
|
-
`;function ke({selectedKeys:r,onPick:h,canPick:f}){const[p,g]=u.useState(""),[j,b]=u.useState("");u.useEffect(()=>{const d=setTimeout(()=>b(p.trim()),300);return()=>clearTimeout(d)},[p]);const{items:s,isLoading:k,isPlaceholderData:w,isError:T,hasNextPage:l,isFetchingNextPage:C,fetchNextPage:I}=he(["outfit-picker",j],d=>Qt({search:j||void 0,category:"wearable",onSale:!0,listingType:"primary",first:24,skip:d,sortBy:"cheapest"})),
|
|
86
|
+
`;function ke({selectedKeys:r,onPick:h,canPick:f}){const[p,g]=u.useState(""),[j,b]=u.useState("");u.useEffect(()=>{const d=setTimeout(()=>b(p.trim()),300);return()=>clearTimeout(d)},[p]);const{items:s,isLoading:k,isPlaceholderData:w,isError:T,hasNextPage:l,isFetchingNextPage:C,fetchNextPage:I}=he(["outfit-picker",j],d=>Qt({search:j||void 0,category:"wearable",onSale:!0,listingType:"primary",first:24,skip:d,sortBy:"cheapest"})),H=new Set,y=s.filter(d=>{if(!d.itemId)return!1;const $=`${d.contractAddress.toLowerCase()}-${d.itemId}`;return H.has($)?!1:(H.add($),!0)});return t.jsxs(ge,{"data-testid":"outfit-picker",children:[t.jsxs(be,{children:[t.jsx(U,{name:"search",color:st.colors.muted}),t.jsx("input",{value:p,placeholder:e("outfits.studio.searchPlaceholder"),"aria-label":e("outfits.studio.searchPlaceholder"),onChange:d=>g(d.target.value),"data-testid":"outfit-picker-search"})]}),T?t.jsx("p",{className:"muted small",children:e("outfits.errors.generic")}):k||w?t.jsx(xt,{"aria-busy":"true",children:Array.from({length:8},(d,$)=>t.jsx(ye,{className:"skeleton","aria-hidden":!0},$))}):y.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noResults")}):t.jsx(xt,{children:y.map(d=>{const $=`${d.contractAddress.toLowerCase()}-${d.itemId}`,z=r.has($);return t.jsxs(je,{type:"button","data-testid":"outfit-picker-item","data-selected":z||void 0,disabled:!z&&!f(d),onClick:()=>h(d),title:d.name,children:[t.jsx(ve,{src:d.thumbnail,alt:"",loading:"lazy"}),t.jsx(we,{children:d.name}),t.jsxs($e,{children:[t.jsx(Y,{size:12}),d.priceCredits.toLocaleString()]}),z?t.jsx(Se,{name:"check-rounded",size:18}):null]},$)})}),!T&&!k&&!w?t.jsx(fe,{auto:!1,hasNextPage:!!l,isFetching:C,onLoadMore:()=>void I()}):null]})}const{colors:a,radius:v,media:W,z:Te}=st,Ct=o.div`
|
|
87
87
|
max-width: 1200px;
|
|
88
88
|
margin: 0 auto;
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
gap: 20px;
|
|
92
|
-
`,
|
|
92
|
+
`,R=o.div`
|
|
93
93
|
min-height: 52vh;
|
|
94
94
|
display: flex;
|
|
95
95
|
flex-direction: column;
|
|
@@ -170,13 +170,13 @@ import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
170
170
|
`,Ne=o.span`
|
|
171
171
|
${Nt};
|
|
172
172
|
display: inline-block;
|
|
173
|
-
`,
|
|
173
|
+
`,Re=o.div`
|
|
174
174
|
flex: 1;
|
|
175
175
|
min-width: 0;
|
|
176
176
|
display: flex;
|
|
177
177
|
flex-direction: column;
|
|
178
178
|
gap: 4px;
|
|
179
|
-
`,
|
|
179
|
+
`,ze=o.span`
|
|
180
180
|
font-size: 15px;
|
|
181
181
|
font-weight: 700;
|
|
182
182
|
white-space: nowrap;
|
|
@@ -239,15 +239,15 @@ import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
239
239
|
display: flex;
|
|
240
240
|
flex-direction: column;
|
|
241
241
|
gap: 12px;
|
|
242
|
-
`,
|
|
242
|
+
`,Ue=o.h2`
|
|
243
243
|
font-size: 18px;
|
|
244
244
|
font-weight: 800;
|
|
245
|
-
`,
|
|
245
|
+
`,He=o.div`
|
|
246
246
|
display: flex;
|
|
247
247
|
flex-wrap: wrap;
|
|
248
248
|
gap: 10px;
|
|
249
249
|
margin-top: 6px;
|
|
250
|
-
`,
|
|
250
|
+
`,Me=o.div`
|
|
251
251
|
display: grid;
|
|
252
252
|
grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
|
|
253
253
|
gap: 32px;
|
|
@@ -430,17 +430,17 @@ import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
430
430
|
&[data-missing] {
|
|
431
431
|
opacity: 0.6;
|
|
432
432
|
}
|
|
433
|
-
`,
|
|
433
|
+
`,Rt=vt`
|
|
434
434
|
width: 40px;
|
|
435
435
|
height: 40px;
|
|
436
436
|
border-radius: 8px;
|
|
437
437
|
background: ${a.media};
|
|
438
438
|
flex-shrink: 0;
|
|
439
439
|
`,ni=o.img`
|
|
440
|
-
${
|
|
440
|
+
${Rt};
|
|
441
441
|
object-fit: cover;
|
|
442
442
|
`,ri=o.span`
|
|
443
|
-
${
|
|
443
|
+
${Rt};
|
|
444
444
|
display: inline-block;
|
|
445
445
|
`,di=o.span`
|
|
446
446
|
flex: 1;
|
|
@@ -497,4 +497,4 @@ import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
497
497
|
display: flex;
|
|
498
498
|
flex-wrap: wrap;
|
|
499
499
|
gap: 10px;
|
|
500
|
-
`;function Ni(){const{id:r}=Gt(),{pathname:h}=qt(),f=q(b=>b.session),p=q(b=>b.signIn),g=Jt();Vt({title:e("outfits.studio.title"),noindex:!0});const j=h.endsWith("/new")?"new":r?"edit":"list";return g==="pending"?t.jsx(z,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?g!=="creator"?t.jsxs(z,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(m,{as:O,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(xi,{}):t.jsx(yi,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(z,{"data-testid":"outfit-studio-signin",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(m,{variant:"purple",onClick:()=>p(),children:e("outfits.studio.signIn")})]})}function mi({outfit:r}){const h=St(r.thumbnailHash);return h?t.jsx(Le,{style:{background:oe(r)},children:t.jsx("img",{src:h,alt:"",loading:"lazy"})}):t.jsx(Ne,{"aria-hidden":!0})}function xi(){const r=q(l=>l.session),h=wt(),[f,p]=u.useState(null),[g,j]=u.useState(null),{data:b=[],isLoading:s,isError:k,refetch:w}=$t({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>ce(r.identity)});async function T(l,C){if(r){j(l.id);try{C==="delete"?(await ae(l.id,r.identity),F.success(e("outfits.studio.deleted"))):(await kt({...it(l),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Tt(h)}catch(I){I instanceof P||tt(I,{flow:`outfit-${C}`}),F.error(e(I instanceof P?et(I.code):"outfits.errors.generic"))}finally{j(null),p(null)}}}return t.jsxs(Ct,{"data-testid":"outfit-studio-list",children:[t.jsxs(It,{children:[t.jsx(Et,{children:e("outfits.studio.myOutfits")}),t.jsx(m,{as:O,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(bt,{"aria-busy":"true",children:Array.from({length:3},(l,C)=>t.jsx(Ie,{className:"skeleton","aria-hidden":!0},C))}):k?t.jsxs(z,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void w(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(bt,{children:b.map(l=>t.jsxs(Ee,{"data-testid":"outfit-studio-row","data-published":l.published||void 0,children:[t.jsx(mi,{outfit:l}),t.jsxs(ze,{children:[t.jsx(Re,{children:l.name||e("outfits.studio.untitled")}),t.jsxs(Pe,{children:[t.jsx(Lt,{"data-state":l.published?"published":"draft",children:l.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:l.items.length})]})]}),t.jsxs(Oe,{children:[l.published?t.jsx(m,{as:O,to:`/items/outfits/${l.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(m,{as:O,to:`/outfits/${l.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(Fe,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:g===l.id,onClick:()=>p(l),children:t.jsx(M,{name:"trash",size:18})})]})]},l.id))}),f?t.jsxs(Ae,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Be,{onClick:()=>p(null)}),t.jsxs(De,{children:[t.jsx(Me,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ue,{children:[f.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:g===f.id,onClick:()=>void T(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(m,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:g===f.id,onClick:()=>void T(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(m,{variant:"ghost",onClick:()=>p(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const jt=["image/png","image/jpeg","image/webp"];function gi(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:Z.from,gradientTo:Z.to,published:!1}}function it(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 bi(r){try{const h=sessionStorage.getItem(r);return h?JSON.parse(h):null}catch{return null}}function yi({outfitId:r}){const h=r===null,f=`outfit-draft:${r??"new"}`,p=q(i=>i.session),g=wt(),j=Wt(),[b]=u.useState(()=>bi(f)),[s,k]=u.useState(()=>b??(h?gi():null)),[w,T]=u.useState(!!b),{data:l,isLoading:C,isError:I,refetch:U}=$t({queryKey:["outfit",r,!0],enabled:!h&&!!p,staleTime:0,queryFn:()=>pe(r,p.identity)});u.useEffect(()=>{l&&k(i=>i??it(l))},[l]);function y(i){k(n=>n&&{...n,...i}),T(!0)}u.useEffect(()=>{if(!(!s||!w))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,w,f]),u.useEffect(()=>{if(!w)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[w]),u.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const d=Xt(s??void 0),$=u.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(B)),[s]),R=i=>ue((s==null?void 0:s.items)??[],i,d.byKey),at=i=>!!i.itemId&&R(i).length<=G;function Rt(i){!s||!at(i)||y({items:R(i)})}const[Pt,nt]=u.useState(null),E=u.useRef(null),Q=u.useRef(!0);u.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const[H,rt]=u.useState(!1),[Ot,_]=u.useState(null),[J,dt]=u.useState(""),[Ft,lt]=u.useState(null),[S,At]=u.useState();u.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ut(){const i=de(J);if(!i){lt(e("outfits.studio.importError"));return}lt(null),dt(""),At(i.colors),y({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Bt(i){if(!i||!p)return;if(_(null),!jt.includes(i.type)){_(e("outfits.errors.unsupportedType"));return}if(i.size>ne){_(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,nt(n),rt(!0);try{const c=await re(i,p.identity);y({thumbnailHash:c})}catch(c){c instanceof P||tt(c,{flow:"outfit-thumbnail"}),_(e(c instanceof P?et(c.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),nt(null)}finally{rt(!1)}}const[A,ct]=u.useState(!1),[Dt,pt]=u.useState(null),V=!!s&&s.name.trim().length>0&&s.name.length<=60,Mt=!!s&&K(s.gradientFrom)&&K(s.gradientTo),ft=!!s&&V&&!!s.thumbnailHash&&Mt&&s.items.length>=Yt&&s.items.length<=G;async function X(i){if(!(!p||!s||A)){ct(!0),pt(null);try{const n=await kt({...s,published:i},p.identity,h?"create":"update");if(!Q.current)return;sessionStorage.removeItem(f),k(it(n)),T(!1),Tt(g),i&&!s.published?(le("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),h&&(g.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof P||tt(n,{flow:"outfit-save"}),pt(e(n instanceof P?et(n.code):"outfits.errors.generic"))}finally{ct(!1)}}}const ht=u.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>d.byKey.get(B(i))).map(i=>i?Zt(i):null).filter(i=>!!i),[s,d.byKey]),Ut=(s==null?void 0:s.bodyShape)==="female"?te:(s==null?void 0:s.bodyShape)==="male"?ee:void 0;if(!p)return null;if(!s)return I?t.jsxs(z,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void U(),children:e("outfits.detail.retry")})]}):!C&&l===null?t.jsxs(z,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(m,{as:O,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(z,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const mt=Pt??St(s.thumbnailHash),Ht={...s,authorAddress:(p==null?void 0:p.address)??"",createdAt:0,updatedAt:0},_t=s.items.reduce((i,n)=>{var c;return i+(((c=d.byKey.get(B(n)))==null?void 0:c.priceCredits)??0)},0);return t.jsxs(Ct,{"data-testid":"outfit-studio-editor",children:[t.jsxs(It,{children:[t.jsx(Ce,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(M,{name:"arrow-left",size:18})}),t.jsx(Et,{children:h?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Lt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(He,{children:[t.jsxs(_e,{children:[t.jsxs(Ge,{"data-testid":"outfit-studio-preview",style:{background:ie(s)},children:[t.jsx(me,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Ut,urns:ht,skin:S==null?void 0:S.skin,hair:S==null?void 0:S.hair,eyes:S==null?void 0:S.eyes,enabled:!d.isLoading}),ht.length===0&&!d.isLoading?t.jsx(qe,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(We,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(Qe,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>y({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(Ve,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(Xe,{children:[t.jsx(Ye,{type:"color",value:K(s[i])?s[i]:Z.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=>y({[i]:n.target.value.toLowerCase()})}),t.jsxs(Ze,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(ti,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!K(s[i])||void 0,onChange:n=>{const c=n.target.value.trim().toLowerCase();y({[i]:c.startsWith("#")||c===""?c:`#${c}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.thumbnail")}),mt?t.jsx(Je,{"data-busy":H||void 0,children:t.jsx("img",{src:mt,alt:""})}):null,t.jsxs(ii,{as:"label",variant:"outline",size:"sm","data-busy":H||void 0,children:[H?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:jt.join(","),hidden:!0,disabled:H,onChange:i=>{var n;return void Bt((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:Ot,testId:"outfit-studio-thumb-error"})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(ei,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(se,{outfit:Ht,resolution:d})})]})]}),t.jsxs(Ke,{children:[t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(si,{children:[t.jsx(yt,{id:"outfit-import",value:J,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>dt(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ut()},"data-testid":"outfit-studio-import"}),t.jsx(m,{variant:"outline",size:"sm",onClick:ut,disabled:J.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:Ft,testId:"outfit-studio-import-error"})]}),t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(yt,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>y({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(L,{children:[t.jsxs(N,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",G,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(oi,{children:s.items.map(i=>{const n=B(i),c=d.byKey.get(n);return t.jsxs(ai,{"data-testid":"outfit-studio-selected","data-missing":!c||void 0,children:[c?t.jsx(ni,{src:c.thumbnail,alt:""}):t.jsx(ri,{className:d.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(di,{className:c?void 0:"muted",children:c?c.name:d.isLoading?"…":e("outfits.card.unavailable")}),c?t.jsxs(li,{children:[t.jsx(Y,{size:12}),c.priceCredits.toLocaleString()]}):null,t.jsx(pi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>y({items:s.items.filter(Kt=>B(Kt)!==n)}),children:t.jsx(M,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(ui,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ci,{children:[t.jsx(Y,{size:14}),_t.toLocaleString()]})]}):null,s.items.length>=G?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ke,{selectedKeys:$,onPick:Rt,canPick:at})]})]}),t.jsxs(fi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Dt,testId:"outfit-studio-save-error"}),V?!ft&&!s.published?t.jsx("p",{className:"muted small",children:e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs(hi,{children:[t.jsx(m,{variant:"outline","data-testid":"outfit-studio-save",disabled:A||!V,onClick:()=>void X(s.published),children:A?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:A,onClick:()=>void X(!1),children:e("outfits.studio.unpublish")}):t.jsx(m,{variant:"purple","data-testid":"outfit-studio-publish",disabled:A||!ft,onClick:()=>void X(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ni as OutfitStudio,Ni as default};
|
|
500
|
+
`;function Ni(){const{id:r}=Gt(),{pathname:h}=qt(),f=q(b=>b.session),p=q(b=>b.signIn),g=Jt();Vt({title:e("outfits.studio.title"),noindex:!0});const j=h.endsWith("/new")?"new":r?"edit":"list";return g==="pending"?t.jsx(R,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?g!=="creator"?t.jsxs(R,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(m,{as:O,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(xi,{}):t.jsx(yi,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(R,{"data-testid":"outfit-studio-signin",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(m,{variant:"purple",onClick:()=>p(),children:e("outfits.studio.signIn")})]})}function mi({outfit:r}){const h=St(r.thumbnailHash);return h?t.jsx(Le,{style:{background:oe(r)},children:t.jsx("img",{src:h,alt:"",loading:"lazy"})}):t.jsx(Ne,{"aria-hidden":!0})}function xi(){const r=q(l=>l.session),h=wt(),[f,p]=u.useState(null),[g,j]=u.useState(null),{data:b=[],isLoading:s,isError:k,refetch:w}=$t({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>ce(r.identity)});async function T(l,C){if(r){j(l.id);try{C==="delete"?(await ae(l.id,r.identity),F.success(e("outfits.studio.deleted"))):(await kt({...it(l),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Tt(h)}catch(I){I instanceof P||tt(I,{flow:`outfit-${C}`}),F.error(e(I instanceof P?et(I.code):"outfits.errors.generic"))}finally{j(null),p(null)}}}return t.jsxs(Ct,{"data-testid":"outfit-studio-list",children:[t.jsxs(It,{children:[t.jsx(Et,{children:e("outfits.studio.myOutfits")}),t.jsx(m,{as:O,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(bt,{"aria-busy":"true",children:Array.from({length:3},(l,C)=>t.jsx(Ie,{className:"skeleton","aria-hidden":!0},C))}):k?t.jsxs(R,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void w(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(bt,{children:b.map(l=>t.jsxs(Ee,{"data-testid":"outfit-studio-row","data-published":l.published||void 0,children:[t.jsx(mi,{outfit:l}),t.jsxs(Re,{children:[t.jsx(ze,{children:l.name||e("outfits.studio.untitled")}),t.jsxs(Pe,{children:[t.jsx(Lt,{"data-state":l.published?"published":"draft",children:l.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:l.items.length})]})]}),t.jsxs(Oe,{children:[l.published?t.jsx(m,{as:O,to:`/items/outfits/${l.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(m,{as:O,to:`/outfits/${l.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(Fe,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:g===l.id,onClick:()=>p(l),children:t.jsx(U,{name:"trash",size:18})})]})]},l.id))}),f?t.jsxs(Ae,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Be,{onClick:()=>p(null)}),t.jsxs(De,{children:[t.jsx(Ue,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(He,{children:[f.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:g===f.id,onClick:()=>void T(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(m,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:g===f.id,onClick:()=>void T(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(m,{variant:"ghost",onClick:()=>p(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const jt=["image/png","image/jpeg","image/webp"];function gi(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:Z.from,gradientTo:Z.to,published:!1}}function it(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 bi(r){try{const h=sessionStorage.getItem(r);return h?JSON.parse(h):null}catch{return null}}function yi({outfitId:r}){const h=r===null,f=`outfit-draft:${r??"new"}`,p=q(i=>i.session),g=wt(),j=Wt(),[b]=u.useState(()=>bi(f)),[s,k]=u.useState(()=>b??(h?gi():null)),[w,T]=u.useState(!!b),{data:l,isLoading:C,isError:I,refetch:H}=$t({queryKey:["outfit",r,!0],enabled:!h&&!!p,staleTime:0,queryFn:()=>pe(r,p.identity)});u.useEffect(()=>{l&&k(i=>i??it(l))},[l]);function y(i){k(n=>n&&{...n,...i}),T(!0)}u.useEffect(()=>{if(!(!s||!w))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,w,f]),u.useEffect(()=>{if(!w)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[w]),u.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const d=Xt(s??void 0),$=u.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(B)),[s]),z=i=>ue((s==null?void 0:s.items)??[],i,d.byKey),at=i=>!!i.itemId&&z(i).length<=G;function zt(i){!s||!at(i)||y({items:z(i)})}const[Pt,nt]=u.useState(null),E=u.useRef(null),Q=u.useRef(!0);u.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const[M,rt]=u.useState(!1),[Ot,_]=u.useState(null),[J,dt]=u.useState(""),[Ft,lt]=u.useState(null),[S,At]=u.useState();u.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ut(){const i=de(J);if(!i){lt(e("outfits.studio.importError"));return}lt(null),dt(""),At(i.colors),y({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Bt(i){if(!i||!p)return;if(_(null),!jt.includes(i.type)){_(e("outfits.errors.unsupportedType"));return}if(i.size>ne){_(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,nt(n),rt(!0);try{const c=await re(i,p.identity);y({thumbnailHash:c})}catch(c){c instanceof P||tt(c,{flow:"outfit-thumbnail"}),_(e(c instanceof P?et(c.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),nt(null)}finally{rt(!1)}}const[A,ct]=u.useState(!1),[Dt,pt]=u.useState(null),V=!!s&&s.name.trim().length>0&&s.name.length<=60,Ut=!!s&&K(s.gradientFrom)&&K(s.gradientTo),ft=!!s&&V&&!!s.thumbnailHash&&Ut&&s.items.length>=Yt&&s.items.length<=G;async function X(i){if(!(!p||!s||A)){ct(!0),pt(null);try{const n=await kt({...s,published:i},p.identity,h?"create":"update");if(!Q.current)return;sessionStorage.removeItem(f),k(it(n)),T(!1),Tt(g),i&&!s.published?(le("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),h&&(g.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof P||tt(n,{flow:"outfit-save"}),pt(e(n instanceof P?et(n.code):"outfits.errors.generic"))}finally{ct(!1)}}}const ht=u.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>d.byKey.get(B(i))).map(i=>i?Zt(i):null).filter(i=>!!i),[s,d.byKey]),Ht=(s==null?void 0:s.bodyShape)==="female"?te:(s==null?void 0:s.bodyShape)==="male"?ee:void 0;if(!p)return null;if(!s)return I?t.jsxs(R,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void H(),children:e("outfits.detail.retry")})]}):!C&&l===null?t.jsxs(R,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(m,{as:O,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(R,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const mt=Pt??St(s.thumbnailHash),Mt={...s,authorAddress:(p==null?void 0:p.address)??"",createdAt:0,updatedAt:0},_t=s.items.reduce((i,n)=>{var c;return i+(((c=d.byKey.get(B(n)))==null?void 0:c.priceCredits)??0)},0);return t.jsxs(Ct,{"data-testid":"outfit-studio-editor",children:[t.jsxs(It,{children:[t.jsx(Ce,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(U,{name:"arrow-left",size:18})}),t.jsx(Et,{children:h?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Lt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Me,{children:[t.jsxs(_e,{children:[t.jsxs(Ge,{"data-testid":"outfit-studio-preview",style:{background:ie(s)},children:[t.jsx(me,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Ht,urns:ht,skin:S==null?void 0:S.skin,hair:S==null?void 0:S.hair,eyes:S==null?void 0:S.eyes,enabled:!d.isLoading}),ht.length===0&&!d.isLoading?t.jsx(qe,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(We,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(Qe,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>y({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(Ve,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(Xe,{children:[t.jsx(Ye,{type:"color",value:K(s[i])?s[i]:Z.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=>y({[i]:n.target.value.toLowerCase()})}),t.jsxs(Ze,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(ti,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!K(s[i])||void 0,onChange:n=>{const c=n.target.value.trim().toLowerCase();y({[i]:c.startsWith("#")||c===""?c:`#${c}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.thumbnail")}),mt?t.jsx(Je,{"data-busy":M||void 0,children:t.jsx("img",{src:mt,alt:""})}):null,t.jsxs(ii,{as:"label",variant:"outline",size:"sm","data-busy":M||void 0,children:[M?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:jt.join(","),hidden:!0,disabled:M,onChange:i=>{var n;return void Bt((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:Ot,testId:"outfit-studio-thumb-error"})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(ei,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(se,{outfit:Mt,resolution:d})})]})]}),t.jsxs(Ke,{children:[t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(si,{children:[t.jsx(yt,{id:"outfit-import",value:J,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>dt(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ut()},"data-testid":"outfit-studio-import"}),t.jsx(m,{variant:"outline",size:"sm",onClick:ut,disabled:J.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:Ft,testId:"outfit-studio-import-error"})]}),t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(yt,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>y({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(L,{children:[t.jsxs(N,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",G,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(oi,{children:s.items.map(i=>{const n=B(i),c=d.byKey.get(n);return t.jsxs(ai,{"data-testid":"outfit-studio-selected","data-missing":!c||void 0,children:[c?t.jsx(ni,{src:c.thumbnail,alt:""}):t.jsx(ri,{className:d.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(di,{className:c?void 0:"muted",children:c?c.name:d.isLoading?"…":e("outfits.card.unavailable")}),c?t.jsxs(li,{children:[t.jsx(Y,{size:12}),c.priceCredits.toLocaleString()]}):null,t.jsx(pi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>y({items:s.items.filter(Kt=>B(Kt)!==n)}),children:t.jsx(U,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(ui,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ci,{children:[t.jsx(Y,{size:14}),_t.toLocaleString()]})]}):null,s.items.length>=G?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ke,{selectedKeys:$,onPick:zt,canPick:at})]})]}),t.jsxs(fi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Dt,testId:"outfit-studio-save-error"}),V?!ft&&!s.published?t.jsx("p",{className:"muted small",children:e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs(hi,{children:[t.jsx(m,{variant:"outline","data-testid":"outfit-studio-save",disabled:A||!V,onClick:()=>void X(s.published),children:A?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:A,onClick:()=>void X(!1),children:e("outfits.studio.unpublish")}):t.jsx(m,{variant:"purple","data-testid":"outfit-studio-publish",disabled:A||!ft,onClick:()=>void X(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ni as OutfitStudio,Ni as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t as w,s as
|
|
1
|
+
import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t as w,s as n,m as ce,B as q,n as de,l as pe,v as ue,aX as ge,bo as me,bp as xe,bm as he,bq as F,I as z,br as f,bs as fe,x as A}from"./index-UGlpWu7U.js";import{E as M}from"./ErrorNotice-D6PKmOXM.js";import{F as j}from"./field.styles-tnDxAMEw.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const ve="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/template-cover-1-BETekfHg.jpeg",be="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/template-cover-2-Dni9s0i_.jpeg",je=Object.assign({"../assets/creator-covers/template-cover-1.jpeg":ve,"../assets/creator-covers/template-cover-2.jpeg":be}),v=Object.entries(je).sort(([r],[u])=>r.localeCompare(u)).map(([r,u])=>({name:r.split("/").pop(),url:u})),we=ce`
|
|
2
2
|
to {
|
|
3
3
|
transform: rotate(360deg);
|
|
4
4
|
}
|
|
5
|
-
`,Se=
|
|
5
|
+
`,Se=n.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
@@ -16,7 +16,7 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
16
16
|
flex-direction: column;
|
|
17
17
|
text-align: center;
|
|
18
18
|
}
|
|
19
|
-
`,ke=
|
|
19
|
+
`,ke=n.span`
|
|
20
20
|
flex: none;
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
border-style: solid;
|
|
@@ -43,18 +43,18 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
43
43
|
@media (prefers-reduced-motion: reduce) {
|
|
44
44
|
animation-duration: 2s;
|
|
45
45
|
}
|
|
46
|
-
`,$e=
|
|
46
|
+
`,$e=n.span`
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
font-weight: 600;
|
|
49
|
-
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:
|
|
49
|
+
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:a,radius:_e,media:G}=w,Ee=n(ye)`
|
|
50
50
|
display: grid;
|
|
51
51
|
place-items: center;
|
|
52
52
|
min-height: 60vh;
|
|
53
|
-
`,
|
|
53
|
+
`,Ne=n(q)`
|
|
54
54
|
align-self: center;
|
|
55
55
|
min-width: 200px;
|
|
56
56
|
margin-top: 8px;
|
|
57
|
-
`,O=
|
|
57
|
+
`,O=n.section`
|
|
58
58
|
max-width: 640px;
|
|
59
59
|
margin: 0 auto;
|
|
60
60
|
padding: 8px 0 48px;
|
|
@@ -72,50 +72,50 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
72
72
|
|
|
73
73
|
& .field__label {
|
|
74
74
|
font-weight: 700;
|
|
75
|
-
color: ${
|
|
75
|
+
color: ${a.text};
|
|
76
76
|
}
|
|
77
77
|
& textarea {
|
|
78
|
-
background: ${
|
|
79
|
-
border: 1px solid ${
|
|
78
|
+
background: ${a.white};
|
|
79
|
+
border: 1px solid ${a.lineStrong};
|
|
80
80
|
border-radius: 8px;
|
|
81
81
|
padding: 10px 12px;
|
|
82
|
-
color: ${
|
|
82
|
+
color: ${a.text};
|
|
83
83
|
font: inherit;
|
|
84
84
|
resize: vertical;
|
|
85
85
|
min-height: 88px;
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,ze=n.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: baseline;
|
|
90
90
|
justify-content: space-between;
|
|
91
91
|
gap: 16px;
|
|
92
92
|
flex-wrap: wrap;
|
|
93
|
-
`,
|
|
93
|
+
`,Ce=n.div`
|
|
94
94
|
display: flex;
|
|
95
95
|
align-items: center;
|
|
96
96
|
gap: 10px;
|
|
97
|
-
`,
|
|
97
|
+
`,Le=n(oe)`
|
|
98
98
|
display: flex;
|
|
99
99
|
align-items: center;
|
|
100
100
|
justify-content: center;
|
|
101
|
-
color: ${
|
|
101
|
+
color: ${a.text};
|
|
102
102
|
transition: color 0.15s linear;
|
|
103
103
|
|
|
104
104
|
&:hover {
|
|
105
|
-
color: ${
|
|
105
|
+
color: ${a.accent};
|
|
106
106
|
}
|
|
107
107
|
& .ico {
|
|
108
108
|
width: 22px;
|
|
109
109
|
height: 22px;
|
|
110
110
|
}
|
|
111
|
-
`,D=
|
|
111
|
+
`,D=n.h1`
|
|
112
112
|
font-size: 24px;
|
|
113
113
|
font-weight: 800;
|
|
114
|
-
`,He=
|
|
114
|
+
`,He=n.a`
|
|
115
115
|
display: inline-flex;
|
|
116
116
|
align-items: center;
|
|
117
117
|
gap: 6px;
|
|
118
|
-
color: ${
|
|
118
|
+
color: ${a.accent};
|
|
119
119
|
font-weight: 700;
|
|
120
120
|
font-size: 14px;
|
|
121
121
|
text-decoration: none;
|
|
@@ -127,13 +127,13 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
127
127
|
width: 15px;
|
|
128
128
|
height: 15px;
|
|
129
129
|
}
|
|
130
|
-
`,Ie=
|
|
130
|
+
`,Ie=n.div`
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: stretch;
|
|
133
|
-
border: 1px solid ${
|
|
133
|
+
border: 1px solid ${a.lineStrong};
|
|
134
134
|
border-radius: 8px;
|
|
135
135
|
overflow: hidden;
|
|
136
|
-
background: ${
|
|
136
|
+
background: ${a.white};
|
|
137
137
|
|
|
138
138
|
& input {
|
|
139
139
|
border: 0 !important;
|
|
@@ -141,16 +141,16 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
141
141
|
flex: 1;
|
|
142
142
|
min-width: 0;
|
|
143
143
|
}
|
|
144
|
-
`,Te=
|
|
144
|
+
`,Te=n.span`
|
|
145
145
|
display: flex;
|
|
146
146
|
align-items: center;
|
|
147
147
|
padding: 0 10px;
|
|
148
148
|
background: rgba(0, 0, 0, 0.04);
|
|
149
|
-
color: ${
|
|
149
|
+
color: ${a.muted};
|
|
150
150
|
font-size: 13px;
|
|
151
151
|
white-space: nowrap;
|
|
152
|
-
border-right: 1px solid ${
|
|
153
|
-
`,Be=
|
|
152
|
+
border-right: 1px solid ${a.lineStrong};
|
|
153
|
+
`,Be=n.div`
|
|
154
154
|
display: grid;
|
|
155
155
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
156
156
|
gap: 12px;
|
|
@@ -158,14 +158,14 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
158
158
|
${G.maxWidth("mobile")} {
|
|
159
159
|
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
160
160
|
}
|
|
161
|
-
`,
|
|
161
|
+
`,C=n.button`
|
|
162
162
|
position: relative;
|
|
163
163
|
padding: 0;
|
|
164
|
-
border: 2px solid ${
|
|
164
|
+
border: 2px solid ${a.lineStrong};
|
|
165
165
|
border-radius: ${_e.card};
|
|
166
166
|
overflow: hidden;
|
|
167
167
|
aspect-ratio: 16 / 9;
|
|
168
|
-
background: ${
|
|
168
|
+
background: ${a.media};
|
|
169
169
|
cursor: pointer;
|
|
170
170
|
|
|
171
171
|
& img {
|
|
@@ -176,8 +176,8 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
&[data-selected='true'] {
|
|
179
|
-
border-color: ${
|
|
180
|
-
box-shadow: 0 0 0 2px ${
|
|
179
|
+
border-color: ${a.accent};
|
|
180
|
+
box-shadow: 0 0 0 2px ${a.accent};
|
|
181
181
|
}
|
|
182
182
|
&[data-selected='true']::after {
|
|
183
183
|
content: '✓';
|
|
@@ -189,8 +189,8 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
189
189
|
display: grid;
|
|
190
190
|
place-items: center;
|
|
191
191
|
border-radius: 50%;
|
|
192
|
-
background: ${
|
|
193
|
-
color: ${
|
|
192
|
+
background: ${a.accent};
|
|
193
|
+
color: ${a.white};
|
|
194
194
|
font-size: 13px;
|
|
195
195
|
font-weight: 700;
|
|
196
196
|
}
|
|
@@ -202,38 +202,38 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
202
202
|
justify-content: center;
|
|
203
203
|
gap: 6px;
|
|
204
204
|
border-style: dashed;
|
|
205
|
-
color: ${
|
|
205
|
+
color: ${a.muted};
|
|
206
206
|
font-size: 13px;
|
|
207
207
|
font-weight: 700;
|
|
208
|
-
background: ${
|
|
208
|
+
background: ${a.white};
|
|
209
209
|
}
|
|
210
210
|
&[data-variant='upload'] .ico {
|
|
211
211
|
width: 22px;
|
|
212
212
|
height: 22px;
|
|
213
|
-
background: ${
|
|
213
|
+
background: ${a.muted};
|
|
214
214
|
}
|
|
215
215
|
&[data-variant='upload']:hover {
|
|
216
|
-
border-color: ${
|
|
217
|
-
color: ${
|
|
216
|
+
border-color: ${a.accent};
|
|
217
|
+
color: ${a.accent};
|
|
218
218
|
}
|
|
219
219
|
&[data-variant='upload']:hover .ico {
|
|
220
|
-
background: ${
|
|
220
|
+
background: ${a.accent};
|
|
221
221
|
}
|
|
222
|
-
`,Pe=
|
|
222
|
+
`,Pe=n.input`
|
|
223
223
|
position: absolute;
|
|
224
224
|
width: 1px;
|
|
225
225
|
height: 1px;
|
|
226
226
|
opacity: 0;
|
|
227
227
|
pointer-events: none;
|
|
228
|
-
`,Re=
|
|
228
|
+
`,Re=n.div`
|
|
229
229
|
display: flex;
|
|
230
230
|
justify-content: flex-end;
|
|
231
231
|
gap: 12px;
|
|
232
232
|
margin-top: 8px;
|
|
233
|
-
`,Fe=
|
|
233
|
+
`,Fe=n(q)`
|
|
234
234
|
min-width: 180px;
|
|
235
235
|
|
|
236
236
|
${G.maxWidth("mobile")} {
|
|
237
237
|
width: 100%;
|
|
238
238
|
}
|
|
239
|
-
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function
|
|
239
|
+
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function Ge(){de({title:s("seo.storeSettings.title"),noindex:!0});const{session:r,signIn:u}=pe(),S=le(),k=ue(),p=r==null?void 0:r.address,{data:$,isLoading:K}=ge(p),[o,g]=l.useState(W),[L,H]=l.useState(W),[y,x]=l.useState(),[h,I]=l.useState(!1),[c,_]=l.useState(null),[b,X]=l.useState({}),T=l.useRef(null);l.useEffect(()=>{if($){const e=me($);g(e),H(e),x(void 0),_(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[$]),l.useEffect(()=>{let e=!1;return Promise.all(v.map(async i=>[i.name,await xe(i.url)])).then(i=>{e||X(Object.fromEntries(i))}).catch(()=>{}),()=>{e=!0}},[]);const E=l.useMemo(()=>{const e=v.find(d=>o.coverName===`cover/${d.name}`);if(e)return e.name;const i=o.coverHash?v.find(d=>b[d.name]===o.coverHash):void 0;return i==null?void 0:i.name},[o.coverName,o.coverHash,b]);l.useEffect(()=>{c!=null&&c.hash&&v.some(e=>b[e.name]===c.hash)&&_(null)},[b,c]);const B=y!==void 0&&y>V,J=l.useMemo(()=>he.filter(e=>!F(e,o.links[e])),[o.links]),Q=B||J.length>0,N=l.useMemo(()=>JSON.stringify(o)!==JSON.stringify(L),[o,L]),U=N&&!Q&&!h;if(l.useEffect(()=>{if(!N)return;const e=i=>{i.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[N]),!r)return t.jsxs(O,{"data-signin":!0,"aria-label":s("storeSettings.title"),children:[t.jsx(D,{children:s("storeSettings.title")}),t.jsx("p",{className:"muted",children:s("storeSettings.signInPrompt")}),t.jsx(Ne,{variant:"purple",onClick:u,children:s("storeSettings.signIn")})]});function Z(e,i){x(void 0),g(d=>({...d,cover:i,coverName:`cover/${e}`,coverHash:""}))}const ee=["image/png","image/jpeg","image/webp"];function te(e){var P;const i=(P=e.target.files)==null?void 0:P[0];if(!i||!ee.includes(i.type))return;x(i.size);const d=`cover/${i.name}`,m=new FileReader;m.onload=()=>{const R=m.result;_({url:R,name:d,hash:""}),g(re=>({...re,cover:R,coverName:d,coverHash:""}))},m.readAsDataURL(i)}function ie(){c&&(x(void 0),g(e=>({...e,cover:c.url,coverName:c.name,coverHash:c.hash})))}function se(e,i){const d=i?(f[e]+i).replace(/\s/g,""):"";g(m=>({...m,links:{...m.links,[e]:d}}))}function ae(e){const i=o.links[e];return e==="website"?i:i.replace(f[e],"")}async function ne(){if(!(!p||!r)){I(!0);try{await fe(p,o,r.identity),H(o),x(void 0),await k.invalidateQueries({queryKey:["store",p.toLowerCase()]}),A.success(s("storeSettings.saved")),S(`/items/creator/${p}`)}catch{A.error(s("storeSettings.saveError"))}finally{I(!1)}}}return t.jsxs(O,{"aria-label":s("storeSettings.title"),children:[t.jsxs(ze,{children:[t.jsxs(Ce,{children:[p?t.jsx(Le,{to:`/items/creator/${p}`,title:s("storeSettings.back"),"aria-label":s("storeSettings.back"),children:t.jsx(z,{name:"arrow-left"})}):null,t.jsx(D,{children:s("storeSettings.title")})]}),p?t.jsxs(He,{href:`/items/creator/${p}`,target:"_blank",rel:"noopener noreferrer",children:[s("storeSettings.seeAsGuest"),t.jsx(z,{name:"external-link"})]}):null]}),K?t.jsx(Ee,{size:"large",label:s("storeSettings.loading")}):t.jsxs(t.Fragment,{children:[t.jsxs(j,{children:[t.jsx("span",{className:"field__label",children:s("storeSettings.cover")}),t.jsxs(Be,{role:"group","aria-label":s("storeSettings.cover"),children:[v.map(e=>{const i=E===e.name;return t.jsx(C,{type:"button","data-testid":"cover-picker-tile","data-selected":i,"aria-pressed":i,onClick:()=>Z(e.name,e.url),children:t.jsx("img",{src:e.url,alt:"",loading:"lazy"})},e.name)}),c?t.jsx(C,{type:"button","data-testid":"cover-picker-tile","data-variant":"custom","data-selected":!E,"aria-pressed":!E,onClick:ie,children:t.jsx("img",{src:c.url,alt:""})}):null,t.jsxs(C,{type:"button","data-testid":"cover-picker-tile","data-variant":"upload",onClick:()=>{var e;return(e=T.current)==null?void 0:e.click()},children:[t.jsx(z,{name:"upload"}),t.jsx("span",{children:s("storeSettings.upload")})]}),t.jsx(Pe,{ref:T,type:"file",accept:"image/png, image/jpeg, image/webp","data-testid":"cover-picker-input",onChange:te})]}),B?t.jsx(M,{message:s("storeSettings.sizeError",{max:Y(V),current:Y(y)})}):null]}),t.jsxs(j,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.description")}),t.jsx("textarea",{value:o.description,rows:4,disabled:h,onChange:e=>g(i=>({...i,description:e.target.value}))})]}),t.jsxs(j,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.website")}),t.jsx("input",{type:"url",value:o.links.website,placeholder:f.website,disabled:h,onChange:e=>g(i=>({...i,links:{...i.links,website:e.target.value.replace(/\s/g,"")}}))}),F("website",o.links.website)?null:t.jsx(M,{message:s("storeSettings.linkError",{value:f.website})})]}),["twitter","discord","facebook"].map(e=>t.jsxs(j,{as:"label",children:[t.jsx("span",{className:"field__label",children:s(`storeSettings.${e}`)}),t.jsxs(Ie,{children:[t.jsx(Te,{children:f[e]}),t.jsx("input",{type:"text",value:ae(e),disabled:h,onChange:i=>se(e,i.target.value)})]})]},e)),t.jsx(Re,{children:t.jsx(Fe,{variant:"purple","data-testid":"store-settings-save",onClick:()=>void ne(),disabled:!U,children:h?s("storeSettings.saving"):s("storeSettings.save")})})]})]})}export{Ge as StoreSettings,Ge as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-DQ3AciL_.js","_assets/react-DehiWSvs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as t,_ as I,t as F,
|
|
2
|
+
import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as t,_ as I,t as F,q as _,ap as O,ab as W,l as D,n as q,b as n,o as U,C as V,aq as H,c as B,B as J,ar as X}from"./index-UGlpWu7U.js";import{w as G,S as K}from"./buy-gasless-CXKZGuta.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./authorizations-Bx-uumVM.js";import"./sendMetaTransaction-CbxpNfVY.js";import"./trade-encoding-Dw1x271X.js";const Q=t.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|
|
@@ -125,12 +125,12 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
125
125
|
width: 30px;
|
|
126
126
|
height: 30px;
|
|
127
127
|
color: ${s.text};
|
|
128
|
-
`,
|
|
128
|
+
`,pe=t.p`
|
|
129
129
|
display: inline-flex;
|
|
130
130
|
align-items: baseline;
|
|
131
131
|
gap: 6px;
|
|
132
132
|
margin: 0;
|
|
133
|
-
`,
|
|
133
|
+
`,he=t.span`
|
|
134
134
|
font-size: 24px;
|
|
135
135
|
font-weight: 700;
|
|
136
136
|
text-transform: capitalize;
|
|
@@ -201,7 +201,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
201
201
|
font-weight: 600;
|
|
202
202
|
font-size: 13px;
|
|
203
203
|
color: ${s.muted};
|
|
204
|
-
`,
|
|
204
|
+
`,ye=t(O)`
|
|
205
205
|
position: relative;
|
|
206
206
|
z-index: 1;
|
|
207
207
|
color: ${s.muted};
|
|
@@ -210,7 +210,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
210
210
|
& [data-avatar] {
|
|
211
211
|
display: none;
|
|
212
212
|
}
|
|
213
|
-
`,
|
|
213
|
+
`,ve=t.div`
|
|
214
214
|
flex-shrink: 0;
|
|
215
215
|
display: flex;
|
|
216
216
|
align-items: center;
|
|
@@ -293,4 +293,4 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
293
293
|
`,R=t(J)`
|
|
294
294
|
min-width: 160px;
|
|
295
295
|
text-align: center;
|
|
296
|
-
`;function Ae(c){return null}const Se=c=>new Promise(r=>setTimeout(r,c));function Ie(c,r){const[i,a]=g.useState(c?"pending":"confirmed"),x=r?`${r.owner}-${r.contractAddress}-${r.itemId}`:"";return g.useEffect(()=>{if(!c)return;let l=!1;return(async()=>{let f=!1;for(let o=0;o<20&&!l;o++)try{await G(c,{timeoutMs:15e3}),f=!0;break}catch(
|
|
296
|
+
`;function Ae(c){return null}const Se=c=>new Promise(r=>setTimeout(r,c));function Ie(c,r){const[i,a]=g.useState(c?"pending":"confirmed"),x=r?`${r.owner}-${r.contractAddress}-${r.itemId}`:"";return g.useEffect(()=>{if(!c)return;let l=!1;return(async()=>{let f=!1;for(let o=0;o<20&&!l;o++)try{await G(c,{timeoutMs:15e3}),f=!0;break}catch(v){if(v instanceof K)continue;l||a("failed");return}if(!l){if(!f){a("timed-out");return}if(!r){a("confirmed");return}a("indexing");for(let o=0;o<40&&!l;o++){if(await X(r.owner,r.contractAddress,r.itemId)){l||a("confirmed");return}await Se(3e3)}l||a("timed-out")}})(),()=>{l=!0}},[c,x]),i}const Le=B.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump",Te=B.chainId===80002?"https://amoy.polygonscan.com/tx/":"https://polygonscan.com/tx/";function Ue(){var S;const{state:c,search:r}=P(),i=c??Ae(),a=N(),{session:x}=D(),l=i==null?void 0:i.txHash,y=(i==null?void 0:i.items)??[],f=i!=null&&i.creditsAdded&&i.creditsAdded>0?i.creditsAdded:null,o=y[0],v=x!=null&&x.address&&(o!=null&&o.contractAddress)&&(o!=null&&o.itemId)?{owner:x.address,contractAddress:o.contractAddress,itemId:o.itemId}:null,u=Ie(i!=null&&i.settled?void 0:l,v);q({title:n("seo.success.title"),noindex:!0});const h=y;if(h.length===0)return e.jsx(M,{to:"/items",replace:!0});const A=h[0],w=(S=i==null?void 0:i.txHashes)!=null&&S.length?i.txHashes:l?[l]:[],p=w.length>0&&U(x==null?void 0:x.providerType)?w.map((d,k)=>e.jsx(ne,{href:`${Te}${d}`,target:"_blank",rel:"noreferrer",children:w.length>1?n("success.viewTransactionNumbered",{n:k+1,total:w.length}):n("success.viewTransaction")},d)):null;return u!=="confirmed"?e.jsx(L,{children:e.jsx(ee,{children:u==="pending"||u==="indexing"?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"spinner","aria-hidden":!0}),e.jsx(C,{children:u==="indexing"?n("success.finalizing"):n("success.processing")}),e.jsx(z,{children:u==="indexing"?e.jsxs(e.Fragment,{children:[n("success.indexingBefore")," ",h.length===1?e.jsx("strong",{children:A.name}):n("success.itemCount",{count:h.length})," ",n("success.indexingAfter")]}):e.jsxs(e.Fragment,{children:[n("success.confirmingBefore")," ",h.length===1?e.jsx("strong",{children:A.name}):n("success.itemCount",{count:h.length})," ",n("success.confirmingAfter")]})}),p?e.jsx(b,{children:p}):null]}):u==="timed-out"?e.jsxs(e.Fragment,{children:[e.jsx(C,{children:n("success.stillProcessingTitle")}),e.jsxs(z,{children:[n("success.timedOutBefore")," ",e.jsx("button",{className:"link",onClick:()=>a("/activity"),children:n("nav.activity")})," ",n("success.timedOutAfter")]}),p?e.jsx(b,{children:p}):null,e.jsxs(T,{children:[e.jsx(R,{variant:"purple",onClick:()=>a("/activity"),children:n("success.viewActivity")}),e.jsx(R,{variant:"ghost",onClick:()=>a("/items"),children:n("success.keepShopping")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{children:n("success.failedTitle")}),e.jsx(z,{children:n("success.failedBody")}),p?e.jsx(b,{children:p}):null,e.jsx(T,{children:e.jsx(R,{variant:"purple",onClick:()=>a("/items"),children:n("success.backToShop")})})]})})}):e.jsxs(L,{children:[e.jsx(Z,{}),e.jsxs(ie,{children:[e.jsxs(se,{role:"status",children:[e.jsx(re,{"aria-hidden":!0,children:e.jsxs("svg",{viewBox:"0 0 60 60",width:"60",height:"60",children:[e.jsx("circle",{cx:"30",cy:"30",r:"30",fill:"#34ce77"}),e.jsx("path",{d:"M18 31l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxs(oe,{children:[e.jsx("b",{children:n("success.bannerTitle")})," ",n("success.bannerBody")]})]}),e.jsxs(ce,{children:[f?e.jsxs(le,{"data-testid":"success-credits",children:[e.jsx(xe,{}),e.jsxs(pe,{children:[e.jsx(he,{children:n("getCredits.creditsAmount",{credits:f,currency:V.name})})," ",e.jsx(ue,{children:n("getCredits.creditsAdded")})]})]}):null,h.map((d,k)=>{const $=d.quantity??1;return e.jsxs(ae,{children:[k>0?e.jsx(de,{"aria-hidden":!0}):null,e.jsxs(fe,{children:[e.jsxs(ge,{children:[d.thumbnail?e.jsx("img",{src:d.thumbnail,alt:""}):null,e.jsx(me,{"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(je,{children:[e.jsxs(we,{title:d.name,children:[d.name||n("buyModal.itemFallback"),$>1?e.jsx(be,{children:n("cartCheckout.qty",{count:$})}):null]}),d.creator?e.jsx(ye,{address:d.creator,linkToProfile:!0}):null]}),e.jsxs(ve,{children:[e.jsx(ke,{}),e.jsx("span",{children:H(d.priceCredits*$)})]})]})]},d.id)})]}),p?e.jsx(b,{"data-receipt":!0,children:p}):null,e.jsxs($e,{children:[e.jsx(Ce,{"data-variant":"ghost",onClick:()=>a("/my-items"),children:n("success.myAssets")}),e.jsxs(ze,{"data-variant":"ruby",href:Le,target:"_blank",rel:"noreferrer",children:[n("success.tryInWorld"),e.jsx(Re,{"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]})]})}export{Ue as Success,Ue as default};
|