@dcl/shop 1.0.2-31055297774.commit-b808071 → 1.0.2-31061650925.commit-fa244eb

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.
Files changed (178) hide show
  1. package/_assets/{Activity-BGVAnqbp.js → Activity-DAMRT2bN.js} +3 -3
  2. package/_assets/{AnimatedBackground-BacIzfr9.js → AnimatedBackground-N_wcSf6D.js} +1 -1
  3. package/_assets/{Assets-Bs3sIn09.js → Assets-7wgiv5MU.js} +10 -9
  4. package/_assets/{Assets.styles-CkO8eYMZ.js → Assets.styles-9R6ppWqo.js} +1 -1
  5. package/_assets/Authorizations-DCP2Yevg.js +191 -0
  6. package/_assets/{Cart-CfbLgf8G.js → Cart-CpLaRQWb.js} +2 -2
  7. package/_assets/{CircularProgress-1YXgiQtT.js → CircularProgress-BYXbDw8X.js} +1 -1
  8. package/_assets/{Collection-DKA_h7HO.js → Collection-CA94Ylrk.js} +1 -1
  9. package/_assets/{CollectionCarousel-COMBJtj4.js → CollectionCarousel-BkFV4le7.js} +1 -1
  10. package/_assets/{Confetti-BSUE6v15.js → Confetti-D7bsXMqQ.js} +1 -1
  11. package/_assets/{Creator-Chfg4XCW.js → Creator-DWKYxWTB.js} +1 -1
  12. package/_assets/{ErrorNotice-aOead5te.js → ErrorNotice-CCsvrT3H.js} +1 -1
  13. package/_assets/{ExchangeController-D9wO5y3j.js → ExchangeController-KIbY1TeV.js} +1 -1
  14. package/_assets/{Faq-BUcIgNDP.js → Faq-YyrvPI25.js} +1 -1
  15. package/_assets/{GetCredits-BLECOB-N.js → GetCredits-gCz6CMY3.js} +1 -1
  16. package/_assets/{Grow-zqUJtnL7.js → Grow-B6W2xyXd.js} +1 -1
  17. package/_assets/{HelpersUtil-BrmwLkkp.js → HelpersUtil-BmHoBPAz.js} +1 -1
  18. package/_assets/{ItemDetail-B2vKg-9Z.js → ItemDetail-DsP2PTh3.js} +234 -229
  19. package/_assets/LazyEmoteControls-lVtDIvME.js +2 -0
  20. package/_assets/{LoadMore-Cy9OoEJz.js → LoadMore-ChGcAM1i.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-B9-hTa3D.js → ManaPricingBanner.styles-CZgGH3OR.js} +1 -1
  22. package/_assets/{MyAssets-CHgc1ZcI.js → MyAssets-jgTQywGo.js} +2 -2
  23. package/_assets/{MyFavorites-DWo1mliw.js → MyFavorites-B_oQzUR9.js} +1 -1
  24. package/_assets/NotFound-CjDp1Ys_.js +17 -0
  25. package/_assets/{NotificationsBell-Cg5PqU4H.js → NotificationsBell-Dkr9JB0w.js} +1 -1
  26. package/_assets/{OutfitDetail-DF87HN6H.js → OutfitDetail-BNlw-NwV.js} +1 -1
  27. package/_assets/{OutfitPreview-IPt5zFQ2.js → OutfitPreview-J5m3e8Gl.js} +1 -1
  28. package/_assets/OutfitStudio-xpf5tPAA.js +556 -0
  29. package/_assets/StoreSettings-BkFED3xP.js +243 -0
  30. package/_assets/{Success-B_ZedKxN.js → Success-lmJVKgtL.js} +1 -1
  31. package/_assets/{SwapController-DEl6q4-5.js → SwapController-DKvQsgHw.js} +1 -1
  32. package/_assets/{Tooltip-CfAbMWhJ.js → Tooltip-BBYuQHQb.js} +1 -1
  33. package/_assets/{TradeService-DCGCUpYo.js → TradeService-CkbprpVw.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-BEUP6hLZ.js → W3MFrameProviderSingleton-6oL2Do5B.js} +3 -3
  35. package/_assets/{WebCryptoP256-2ShtCeVF.js → WebCryptoP256-6t0_XFco.js} +1 -1
  36. package/_assets/{authorizations-B17B7Njo.js → authorizations-CbXH-W_L.js} +1 -1
  37. package/_assets/{basic-Dr3bEQfu.js → basic-DSLXBfxu.js} +1 -1
  38. package/_assets/{biconomy-3Y8X7VlC.js → biconomy-DKrndD59.js} +1 -1
  39. package/_assets/{builder-jjuFCu3k.js → builder-CVMQir9d.js} +1 -1
  40. package/_assets/{buy-wdud8pnf.js → buy-BllmT-mt.js} +1 -1
  41. package/_assets/{buy-gasless-DoSh-tFa.js → buy-gasless-BuzErI_K.js} +1 -1
  42. package/_assets/{categories-DGIg36Oc.js → categories-Bjf-PXbG.js} +1 -1
  43. package/_assets/{ccip-BKrghWQj.js → ccip-DI15Urx-.js} +1 -1
  44. package/_assets/{ccip-CXCfMVYe.js → ccip-DyRqdu6M.js} +1 -1
  45. package/_assets/{collectionPage.styles-DwFPJPce.js → collectionPage.styles-BgKDi1Aa.js} +2 -2
  46. package/_assets/{controller-DdgkWKgL.js → controller-BSVA5WKe.js} +2 -2
  47. package/_assets/{core-C8S2mN1s.js → core-CflNwoXZ.js} +4 -4
  48. package/_assets/{createSvgIcon-Cg8ZliIm.js → createSvgIcon-BCgRSx6l.js} +1 -1
  49. package/_assets/{custom-X9wHG9wg.js → custom-ekboJ4XZ.js} +1 -1
  50. package/_assets/{data-capture-BgPNXS18.js → data-capture-C00Edv8o.js} +1 -1
  51. package/_assets/{email-BGdZRw8p.js → email-D7bKqbcO.js} +1 -1
  52. package/_assets/{embedded-wallet-CqIU9APg.js → embedded-wallet-BgZe_e0-.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-DZbIWeAZ.js → emotion-styled.browser.esm-BsZP4P-B.js} +1 -1
  54. package/_assets/{engine-CBG8_pF-.js → engine-Cnqy1olA.js} +1 -1
  55. package/_assets/{errors-BruxKfZB.js → errors-BXmP5k3l.js} +1 -1
  56. package/_assets/{estimate-l1-fee-k3exg7PR.js → estimate-l1-fee-9ryWwmxC.js} +1 -1
  57. package/_assets/{execute-RjH3kC63.js → execute-CY4XWL-J.js} +2 -2
  58. package/_assets/{features-BnDZm8if.js → features-MG4MlDMD.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-CdUuHqIj.js → fetchTokenMetadata-qCCUs6iE.js} +2 -2
  60. package/_assets/{field.styles-l0zobCFG.js → field.styles-DEvu6yNO.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-DALoL3Hc.js → get-ecosystem-wallet-info-DEImAnzE.js} +1 -1
  62. package/_assets/{getBalance-CefhuKko.js → getBalance-J5grsfOj.js} +1 -1
  63. package/_assets/{getNFT-D-L5zgdP.js → getNFT-ByNh7y6k.js} +1 -1
  64. package/_assets/{getNFT-nev9rcin.js → getNFT-Dm5aL9u2.js} +1 -1
  65. package/_assets/{grid.styles-DhFwhKRo.js → grid.styles-CtrXwvIr.js} +1 -1
  66. package/_assets/{hashTypedData-li6aoa3o.js → hashTypedData-BxKbqj1M.js} +1 -1
  67. package/_assets/{hashTypedData-BEKwcmlS.js → hashTypedData-CgttwS7E.js} +1 -1
  68. package/_assets/{in-app-DUJu2O6v.js → in-app-DF-fkkCZ.js} +1 -1
  69. package/_assets/{in-app-wallet-calls-C9Jxi05O.js → in-app-wallet-calls-D9z1I0uV.js} +1 -1
  70. package/_assets/{index-DAnXL5-b.js → index--tlhUPhu.js} +1 -1
  71. package/_assets/{index-BfqVu35d.js → index-7eX0SEVb.js} +1 -1
  72. package/_assets/{index-zDqeLkyG.js → index-B5TGt1q8.js} +1 -1
  73. package/_assets/{index-ChBwA1h2.js → index-B6xwPPMs.js} +1 -1
  74. package/_assets/{index-5uftLGuI.js → index-B7Mvi-Fg.js} +3 -3
  75. package/_assets/{index-CkF3QZy9.js → index-B7sgFJOZ.js} +1 -1
  76. package/_assets/{index-CpjzOH1b.js → index-BDPRDW4c.js} +1 -1
  77. package/_assets/{index-DU9MjygG.js → index-BFgGvh7x.js} +1 -1
  78. package/_assets/{index-syneNMGM.js → index-BKC-pfo2.js} +1 -1
  79. package/_assets/{index-DDLK5XSq.js → index-BSmKDErh.js} +1 -1
  80. package/_assets/{index-1nKs4-Ix.js → index-BZNkhtbZ.js} +1 -1
  81. package/_assets/{index-3_UdO-zA.js → index-BcQ98rhd.js} +1 -1
  82. package/_assets/{index-DecRfVMx.js → index-BcW0TBOx.js} +1 -1
  83. package/_assets/{index-d570G5B7.js → index-BiSRuBrK.js} +1 -1
  84. package/_assets/{index-CFEHIoaL.js → index-BlIt7KpC.js} +1 -1
  85. package/_assets/{index-C2_mL_dX.js → index-BsD9lKdu.js} +1 -1
  86. package/_assets/{index-CvPkDtGf.js → index-BybKxZca.js} +3 -3
  87. package/_assets/{index-vQ65olfe.js → index-C0xt2SIQ.js} +1 -1
  88. package/_assets/{index-BwjISY1Q.js → index-C2s-_3dE.js} +1 -1
  89. package/_assets/{index-Dd4KtrAw.js → index-C5fUw5Ha.js} +1 -1
  90. package/_assets/{index-BOgrc04A.js → index-C6RxhKIE.js} +1 -1
  91. package/_assets/{index-HaAGk4bQ.js → index-CAj85Mcv.js} +1 -1
  92. package/_assets/{index-C7AFAxAx.js → index-CAzui_hj.js} +1 -1
  93. package/_assets/{index-DXWzE47h.js → index-CIKoh-oU.js} +1 -1
  94. package/_assets/{index-Xuxrb8Q0.js → index-CKXjZ-Kd.js} +1 -1
  95. package/_assets/{index-DWiRe-sp.js → index-CbQYrUIv.js} +1 -1
  96. package/_assets/{index-DrWim4p_.js → index-Cbj1bJsc.js} +1 -1
  97. package/_assets/{index-DoVK9CTx.js → index-CgKz1pmK.js} +1 -1
  98. package/_assets/{index-dr6fXYBx.js → index-CjSsletQ.js} +1 -1
  99. package/_assets/{index-WSwhnTRZ.js → index-CkHS5p_Q.js} +1 -1
  100. package/_assets/{index-JG0FDNiP.js → index-CpxvlmGa.js} +1 -1
  101. package/_assets/{index-1wf8L6YU.js → index-CszjRehO.js} +1 -1
  102. package/_assets/{index-CV1_E3wb.js → index-CuZ7SJno.js} +1 -1
  103. package/_assets/{index-AKUvJK7K.js → index-CuZGDrIM.js} +1 -1
  104. package/_assets/{index-B2O7gZoQ.js → index-D20327nw.js} +1 -1
  105. package/_assets/{index-D-wVNkf3.js → index-D5jN8YQk.js} +2 -2
  106. package/_assets/{index-CTfBCyyR.js → index-D7dTUoYt.js} +319 -315
  107. package/_assets/{index-3PUZ8U0R.js → index-D7foy_c1.js} +3 -3
  108. package/_assets/{index-BlmfBcG1.js → index-DRjhhI6j.js} +1 -1
  109. package/_assets/{index-Bl-qZqD6.js → index-DVJFosyx.js} +1 -1
  110. package/_assets/{index-CE124P9G.js → index-DXpGefPo.js} +1 -1
  111. package/_assets/{index-Ctoo8CLR.js → index-DYQXXAKt.js} +1 -1
  112. package/_assets/{index-z7leYudl.js → index-D_a1Dj89.js} +2 -2
  113. package/_assets/{index-Dar3bPlr.js → index-DbCIWeQF.js} +2 -2
  114. package/_assets/{index-BBNLswz5.js → index-Dc_jl2yy.js} +1 -1
  115. package/_assets/{index-BXykQ7Kr.js → index-DlewIau_.js} +1 -1
  116. package/_assets/{index-1--tLqz8.js → index-Fn-DLeUg.js} +1 -1
  117. package/_assets/{index-CVqec2h5.js → index-Z6tclw43.js} +1 -1
  118. package/_assets/{index-DjqUHVKK.js → index-gbxeK1C-.js} +1 -1
  119. package/_assets/{index-DbrCcWJ3.js → index-gmA5M3R1.js} +1 -1
  120. package/_assets/{index-n49vue3k.js → index-lIySTE8R.js} +1 -1
  121. package/_assets/{index-BAyG95nG.js → index-zG9t0hxJ.js} +1 -1
  122. package/_assets/{index.es-yWYRmppU.js → index.es-11O0MAa5.js} +4 -4
  123. package/_assets/{index.es-DbgkC7jp.js → index.es-6tzroQMk.js} +1 -1
  124. package/_assets/{index.es-CE2sG7i4.js → index.es-BOuSF7GL.js} +1 -1
  125. package/_assets/{localBatchGatewayRequest-VK-lqBeb.js → localBatchGatewayRequest-CByVkxJB.js} +1 -1
  126. package/_assets/{networks-DlOv_Jl5.js → networks-CLAHX11r.js} +1 -1
  127. package/_assets/{onramp-15oxC79b.js → onramp-X6DWjNa-.js} +1 -1
  128. package/_assets/{openzeppelin-BpuVaBDh.js → openzeppelin-DWrLU4le.js} +1 -1
  129. package/_assets/{parseNft-D06uX5gG.js → parseNft-C0F1eSr9.js} +2 -2
  130. package/_assets/{parseSignature-DGgCDYUH.js → parseSignature-B1BDTVRI.js} +1 -1
  131. package/_assets/{parseSignature-CnSs3XPr.js → parseSignature-Cfa0bf3p.js} +3 -3
  132. package/_assets/{passkeys-B8jZMST_.js → passkeys-Bq7ndAcy.js} +1 -1
  133. package/_assets/{pay-with-exchange-DzV0qz9m.js → pay-with-exchange-DU8q52b9.js} +1 -1
  134. package/_assets/{qr-overlay-FhG6DCeK.js → qr-overlay-2pcgXiq0.js} +1 -1
  135. package/_assets/{receive-Bf8iJtVw.js → receive-UZ0WD1OR.js} +1 -1
  136. package/_assets/{resolveImplementation-DdV3P3Xk.js → resolveImplementation-C5KIPshP.js} +1 -1
  137. package/_assets/{rpc-BZX60R_2.js → rpc-q5JetAPC.js} +1 -1
  138. package/_assets/{secp256k1-BLNizqyz.js → secp256k1-C35ing1J.js} +1 -1
  139. package/_assets/{secp256k1-ChfCRMNj.js → secp256k1-C79pdbKP.js} +1 -1
  140. package/_assets/{secp256k1-BpFoXgJs.js → secp256k1-CYrjGZQC.js} +1 -1
  141. package/_assets/{send-CE26RsoC.js → send-_ymraJKw.js} +1 -1
  142. package/_assets/{send-batch-transaction-CdcLTVn2.js → send-batch-transaction-DkYVZ1xj.js} +1 -1
  143. package/_assets/{send-eip712-transaction-DFbUyBnM.js → send-eip712-transaction-BzZBuy56.js} +2 -2
  144. package/_assets/{send-gasless-transaction-IULoS1Vn.js → send-gasless-transaction-ByRZPFH6.js} +2 -2
  145. package/_assets/{send-transaction-vCrIjEYg.js → send-transaction-CUkh0xRu.js} +2 -2
  146. package/_assets/{sendMetaTransaction-C5CWJOs0.js → sendMetaTransaction-De85nOcx.js} +1 -1
  147. package/_assets/{sendRawTransaction-BnXA-t5g.js → sendRawTransaction-D5RykxPX.js} +3 -3
  148. package/_assets/{serializeTransaction-BuP136Wz.js → serializeTransaction-EYy94JNM.js} +1 -1
  149. package/_assets/{session-proposal-CnATfxsE.js → session-proposal-Bf_Po3Sl.js} +1 -1
  150. package/_assets/{session-request-PJjSNFhP.js → session-request-DEDmAqA-.js} +2 -2
  151. package/_assets/{signing-DVSxcG9z.js → signing-DqKP5KUZ.js} +3 -3
  152. package/_assets/{skeleton.styles-CLtTv572.js → skeleton.styles-CVQk0siV.js} +1 -1
  153. package/_assets/{socials-Bf2bVkOp.js → socials-3pLrS-E7.js} +1 -1
  154. package/_assets/{styled-DUDTxrNz.js → styled-8pFgehSd.js} +1 -1
  155. package/_assets/{swaps-CfzGwDGN.js → swaps-C-dgABl9.js} +1 -1
  156. package/_assets/{thirdweb-fPfEaf4k.js → thirdweb-C6_KggNb.js} +3 -3
  157. package/_assets/{to-serializable-transaction-DXr6jbkS.js → to-serializable-transaction-BWUJjZdO.js} +2 -2
  158. package/_assets/{transactionReceipt-eQP54mTE.js → transactionReceipt-DmwkwkkP.js} +1 -1
  159. package/_assets/{transactions-CGh5C6RL.js → transactions-BSJMdJi4.js} +1 -1
  160. package/_assets/{useCreditPacks-CasKnCD5.js → useCreditPacks-DQxqJepP.js} +1 -1
  161. package/_assets/{useImportable-SR1m5Hwh.js → useImportable-Co0AaRPY.js} +1 -1
  162. package/_assets/{useInfiniteGrid-Cy1tipbK.js → useInfiniteGrid-UHC0Jjfu.js} +1 -1
  163. package/_assets/{useTheme-BvkrK9YA.js → useTheme-B-55uBZP.js} +1 -1
  164. package/_assets/{verifyHash-Bi_3pzoI.js → verifyHash-BGJh7VH4.js} +1 -1
  165. package/_assets/{w3m-modal-D57uPD-0.js → w3m-modal-CjXODL26.js} +1 -1
  166. package/_assets/{w3m-modal-DAkUUjAI.js → w3m-modal-CwXD068w.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-ByVNtVUa.js → wait-for-tx-receipt-DRA8zhkS.js} +1 -1
  168. package/_assets/{wallets-DHJBT8N-.js → wallets-DOXRX-PZ.js} +5 -5
  169. package/_assets/{web-connector-zzH3rfgh.js → web-connector-CXxJTFl4.js} +3 -3
  170. package/_assets/{writeContract-BeuidFa5.js → writeContract-BdEWRAPa.js} +1 -1
  171. package/_assets/{zoraTestnet-D4oN56a_.js → zoraTestnet-CzfX948o.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/Authorizations-CLC0gP2S.js +0 -188
  175. package/_assets/LazyEmoteControls-DnvyzyyY.js +0 -2
  176. package/_assets/NotFound-CIGIbTGI.js +0 -13
  177. package/_assets/OutfitStudio-DHyzlXbm.js +0 -537
  178. package/_assets/StoreSettings-SFcLGWm7.js +0 -239
@@ -1,537 +0,0 @@
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,aI 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,aJ as Q,aK as ee,aL as ie,aM as V,a5 as se,a6 as oe,a3 as ae,a4 as ne,U as It,a9 as re,aN as ot,aO as de,aP as le,aQ as ue,E as F,aR as Et,aS as Lt,aT as O,F as at,aU as nt,aV as ce,aW as pe,aX as fe,$ as me,aY as he,aZ as xe,ag as ge}from"./index-CTfBCyyR.js";import{E as H}from"./ErrorNotice-aOead5te.js";import{L as be}from"./LoadMore-Cy9OoEJz.js";import{u as ye}from"./useInfiniteGrid-Cy1tipbK.js";import{O as je}from"./OutfitPreview-IPt5zFQ2.js";import{T as ve}from"./skeleton.styles-CLtTv572.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:h,radius:X,media:we}=dt,$e=o.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 12px;
5
- `,Se=o.div`
6
- display: flex;
7
- align-items: center;
8
- gap: 8px;
9
- border: 1px solid ${h.lineStrong};
10
- border-radius: ${X.pill};
11
- padding: 0 14px;
12
- height: 44px;
13
-
14
- input {
15
- flex: 1;
16
- min-width: 0;
17
- border: 0;
18
- outline: 0;
19
- background: none;
20
- font: inherit;
21
- color: ${h.text};
22
- }
23
- `,ke=o.div`
24
- display: flex;
25
- gap: 8px;
26
- `,Te=o.button`
27
- min-height: 44px;
28
- padding: 0 16px;
29
- border-radius: ${X.pill};
30
- border: 1px solid ${h.lineStrong};
31
- background: none;
32
- font: inherit;
33
- font-weight: 600;
34
- color: ${h.text};
35
- cursor: pointer;
36
-
37
- &[data-selected] {
38
- border-color: ${h.accent};
39
- background: ${h.accent};
40
- color: ${h.white};
41
- }
42
- `,jt=o.div`
43
- display: grid;
44
- grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
45
- gap: 10px;
46
-
47
- ${we.maxWidth("mobile")} {
48
- grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
49
- }
50
- `,Ce=o.span`
51
- height: 190px;
52
- border-radius: ${X.card};
53
- `,Ie=o.button`
54
- position: relative;
55
- display: flex;
56
- flex-direction: column;
57
- gap: 6px;
58
- padding: 8px;
59
- background: ${h.bg};
60
- border: 1px solid ${h.line};
61
- border-radius: ${X.card};
62
- text-align: left;
63
- font: inherit;
64
- color: ${h.text};
65
- cursor: pointer;
66
-
67
- &:hover:not(:disabled) {
68
- border-color: ${h.magenta};
69
- }
70
-
71
- &[data-selected] {
72
- border-color: ${h.accent};
73
- box-shadow: 0 0 0 1px ${h.accent};
74
- }
75
-
76
- &:disabled {
77
- opacity: 0.5;
78
- cursor: default;
79
- }
80
- `,Ee=o.img`
81
- width: 100%;
82
- aspect-ratio: 1;
83
- object-fit: cover;
84
- border-radius: 8px;
85
- background: ${h.media};
86
- `,Le=o.span`
87
- font-size: 13px;
88
- font-weight: 600;
89
- white-space: nowrap;
90
- overflow: hidden;
91
- text-overflow: ellipsis;
92
- `,Ne=o.span`
93
- display: inline-flex;
94
- align-items: center;
95
- gap: 4px;
96
- font-size: 12px;
97
- color: ${h.muted};
98
- `,Re=o(K)`
99
- position: absolute;
100
- top: 12px;
101
- right: 12px;
102
- color: ${h.accent};
103
- background: ${h.bg};
104
- border-radius: 50%;
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
- max-width: 1200px;
107
- margin: 0 auto;
108
- display: flex;
109
- flex-direction: column;
110
- gap: 20px;
111
- `,P=o.div`
112
- min-height: 52vh;
113
- display: flex;
114
- flex-direction: column;
115
- align-items: center;
116
- justify-content: center;
117
- text-align: center;
118
- gap: 14px;
119
- `,vt=o.h1`
120
- font-size: 24px;
121
- `,Rt=o.div`
122
- display: flex;
123
- align-items: center;
124
- gap: 12px;
125
- `,zt=o.h1`
126
- font-size: 24px;
127
- font-weight: 800;
128
- margin-right: auto;
129
- `,Ae=o(A)`
130
- display: inline-flex;
131
- align-items: center;
132
- justify-content: center;
133
- width: 44px;
134
- height: 44px;
135
- border-radius: 50%;
136
- color: ${a.text};
137
-
138
- &:hover {
139
- background: ${a.panel};
140
- }
141
- `,Pt=o.span`
142
- font-size: 12px;
143
- font-weight: 700;
144
- text-transform: uppercase;
145
- letter-spacing: 0.03em;
146
- padding: 3px 10px;
147
- border-radius: ${w.pill};
148
- background: ${a.chip};
149
- color: ${a.muted1};
150
-
151
- &[data-state='published'] {
152
- background: rgba(30, 166, 114, 0.14);
153
- color: ${a.okStrong};
154
- }
155
- `,wt=o.div`
156
- display: flex;
157
- flex-direction: column;
158
- gap: 10px;
159
- `,Fe=o.span`
160
- height: 76px;
161
- border-radius: ${w.card};
162
- `,Be=o.div`
163
- display: flex;
164
- align-items: center;
165
- gap: 14px;
166
- padding: 12px;
167
- border: 1px solid ${a.line};
168
- border-radius: ${w.card};
169
-
170
- ${B.maxWidth("mobile")} {
171
- flex-wrap: wrap;
172
- }
173
- `,Ot=kt`
174
- width: 52px;
175
- height: 52px;
176
- border-radius: 8px;
177
- background: ${a.media};
178
- flex-shrink: 0;
179
- `,Me=o.div`
180
- ${Ot};
181
- overflow: hidden;
182
-
183
- img {
184
- width: 100%;
185
- height: 100%;
186
- object-fit: cover;
187
- display: block;
188
- }
189
- `,Ue=o.span`
190
- ${Ot};
191
- display: inline-block;
192
- `,De=o.div`
193
- flex: 1;
194
- min-width: 0;
195
- display: flex;
196
- flex-direction: column;
197
- gap: 4px;
198
- `,He=o.span`
199
- font-size: 15px;
200
- font-weight: 700;
201
- white-space: nowrap;
202
- overflow: hidden;
203
- text-overflow: ellipsis;
204
- `,Ke=o.span`
205
- display: inline-flex;
206
- align-items: center;
207
- gap: 8px;
208
- font-size: 13px;
209
- color: ${a.muted};
210
- `,We=o.div`
211
- display: flex;
212
- align-items: center;
213
- gap: 8px;
214
-
215
- ${B.maxWidth("mobile")} {
216
- width: 100%;
217
- justify-content: flex-end;
218
- }
219
- `,_e=o.button`
220
- display: inline-flex;
221
- align-items: center;
222
- justify-content: center;
223
- width: 44px;
224
- height: 44px;
225
- border: 0;
226
- background: none;
227
- border-radius: 50%;
228
- color: ${a.muted};
229
- cursor: pointer;
230
-
231
- &:hover {
232
- color: ${a.errStrong};
233
- background: ${a.panel};
234
- }
235
-
236
- &:disabled {
237
- opacity: 0.5;
238
- cursor: default;
239
- }
240
- `,Ge=o.div`
241
- position: fixed;
242
- inset: 0;
243
- z-index: ${Oe.overlay};
244
- display: grid;
245
- place-items: center;
246
- padding: 16px;
247
- `,qe=o.div`
248
- position: absolute;
249
- inset: 0;
250
- background: rgba(22, 21, 24, 0.5);
251
- `,Qe=o.div`
252
- position: relative;
253
- background: ${a.bg};
254
- border-radius: ${w.card};
255
- padding: 24px;
256
- max-width: 420px;
257
- width: 100%;
258
- display: flex;
259
- flex-direction: column;
260
- gap: 12px;
261
- `,Ve=o.h2`
262
- font-size: 18px;
263
- font-weight: 800;
264
- `,Je=o.div`
265
- display: flex;
266
- flex-wrap: wrap;
267
- gap: 10px;
268
- margin-top: 6px;
269
- `,Xe=o.div`
270
- display: grid;
271
- grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
272
- gap: 32px;
273
- align-items: start;
274
-
275
- ${B.maxWidth("mobile")} {
276
- grid-template-columns: 1fr;
277
- gap: 20px;
278
- }
279
- `,Ye=o.div`
280
- display: flex;
281
- flex-direction: column;
282
- gap: 18px;
283
- `,Ze=o.div`
284
- display: flex;
285
- flex-direction: column;
286
- gap: 18px;
287
- `,ti=o.div`
288
- position: relative;
289
- aspect-ratio: 3 / 4;
290
- border-radius: 16px;
291
- overflow: hidden;
292
- background: ${a.media};
293
-
294
- ${B.maxWidth("mobile")} {
295
- aspect-ratio: 1 / 1;
296
- }
297
-
298
- & iframe {
299
- width: 100%;
300
- height: 100%;
301
- border: 0;
302
- display: block;
303
- }
304
-
305
- [data-preview-viewport] {
306
- position: absolute;
307
- inset: 0;
308
- pointer-events: none;
309
- }
310
- `,ei=o.p`
311
- position: absolute;
312
- inset: 0;
313
- display: grid;
314
- place-items: center;
315
- padding: 24px;
316
- text-align: center;
317
- `,R=o.div`
318
- display: flex;
319
- flex-direction: column;
320
- gap: 8px;
321
- `,z=o.label`
322
- font-size: 13px;
323
- font-weight: 700;
324
- letter-spacing: 0.04em;
325
- text-transform: uppercase;
326
- color: ${a.muted1};
327
- `,ii=o.div`
328
- display: flex;
329
- gap: 8px;
330
- `,si=o.button`
331
- min-height: 44px;
332
- padding: 0 16px;
333
- border-radius: ${w.pill};
334
- border: 1px solid ${a.lineStrong};
335
- background: none;
336
- font: inherit;
337
- font-weight: 600;
338
- color: ${a.text};
339
- cursor: pointer;
340
-
341
- &[data-selected] {
342
- border-color: ${a.accent};
343
- background: ${a.accent};
344
- color: ${a.white};
345
- }
346
- `,oi=o.div`
347
- width: 240px;
348
- aspect-ratio: 3 / 4;
349
- border-radius: ${w.card};
350
- overflow: hidden;
351
- background: ${a.media};
352
-
353
- &[data-busy] {
354
- opacity: 0.6;
355
- }
356
-
357
- img {
358
- width: 100%;
359
- height: 100%;
360
- object-fit: cover;
361
- display: block;
362
- }
363
- `,ai=o.div`
364
- display: flex;
365
- align-items: center;
366
- gap: 12px;
367
- flex-wrap: wrap;
368
- `,ni=o.div`
369
- display: flex;
370
- align-items: center;
371
- gap: 8px;
372
- `,ri=o.input`
373
- width: 44px;
374
- height: 44px;
375
- padding: 2px;
376
- border: 1px solid ${a.lineStrong};
377
- border-radius: ${w.btn};
378
- background: none;
379
- cursor: pointer;
380
-
381
- &::-webkit-color-swatch-wrapper {
382
- padding: 0;
383
- }
384
- &::-webkit-color-swatch {
385
- border: 0;
386
- border-radius: 4px;
387
- }
388
- `,di=o.div`
389
- display: flex;
390
- flex-direction: column;
391
- gap: 2px;
392
- font-size: 12px;
393
- color: ${a.muted};
394
- `,li=o.input`
395
- width: 88px;
396
- height: 26px;
397
- padding: 0 6px;
398
- border: 1px solid ${a.line};
399
- border-radius: ${w.chip};
400
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
401
- font-size: 12px;
402
- color: ${a.text};
403
- text-transform: lowercase;
404
-
405
- &[data-invalid] {
406
- border-color: ${a.errStrong};
407
- }
408
- `,ui=o.div`
409
- width: 281px;
410
- max-width: 100%;
411
- `,ci=o(x)`
412
- align-self: flex-start;
413
- `,pi=o.div`
414
- display: flex;
415
- align-items: stretch;
416
- gap: 8px;
417
-
418
- input {
419
- flex: 1;
420
- min-width: 0;
421
- }
422
- `,$t=o.input`
423
- height: 44px;
424
- padding: 0 14px;
425
- border: 1px solid ${a.lineStrong};
426
- border-radius: ${w.btn};
427
- font: inherit;
428
- color: ${a.text};
429
-
430
- &:focus {
431
- outline: 2px solid ${a.accent};
432
- outline-offset: -1px;
433
- }
434
- `,fi=o.ul`
435
- list-style: none;
436
- margin: 0;
437
- padding: 0;
438
- display: flex;
439
- flex-direction: column;
440
- gap: 6px;
441
- `,mi=o.li`
442
- display: flex;
443
- align-items: center;
444
- gap: 10px;
445
- padding: 6px 8px;
446
- border: 1px solid ${a.line};
447
- border-radius: ${w.card};
448
-
449
- ${B.maxWidth("mobile")} {
450
- flex-wrap: wrap;
451
- }
452
-
453
- &[data-missing] {
454
- opacity: 0.6;
455
- }
456
- `,At=kt`
457
- width: 40px;
458
- height: 40px;
459
- border-radius: 8px;
460
- background: ${a.media};
461
- flex-shrink: 0;
462
- `,hi=o.img`
463
- ${At};
464
- object-fit: cover;
465
- `,xi=o.span`
466
- ${At};
467
- display: inline-block;
468
- `,gi=o.span`
469
- flex: 1;
470
- min-width: 0;
471
- font-size: 14px;
472
- font-weight: 600;
473
- white-space: nowrap;
474
- overflow: hidden;
475
- text-overflow: ellipsis;
476
- `,bi=o.span`
477
- flex: none;
478
- padding: 2px 8px;
479
- border-radius: ${w.pill};
480
- border: 1px solid ${a.lineStrong};
481
- font-size: 11px;
482
- font-weight: 600;
483
- color: ${a.muted};
484
- white-space: nowrap;
485
-
486
- ${B.maxWidth("mobile")} {
487
- order: 1;
488
- margin-left: 50px;
489
- }
490
- `,yi=o.span`
491
- display: inline-flex;
492
- align-items: center;
493
- gap: 4px;
494
- font-size: 13px;
495
- color: ${a.muted};
496
- white-space: nowrap;
497
- `,ji=o.div`
498
- display: flex;
499
- align-items: center;
500
- justify-content: space-between;
501
- padding-top: 10px;
502
- border-top: 1px solid ${a.line};
503
- font-size: 13px;
504
- font-weight: 700;
505
- `,vi=o.span`
506
- display: inline-flex;
507
- align-items: center;
508
- gap: 4px;
509
- font-size: 15px;
510
- font-weight: 700;
511
- `,wi=o.button`
512
- display: inline-flex;
513
- align-items: center;
514
- justify-content: center;
515
- width: 40px;
516
- height: 40px;
517
- border: 0;
518
- background: none;
519
- border-radius: 50%;
520
- color: ${a.muted};
521
- cursor: pointer;
522
-
523
- &:hover {
524
- color: ${a.errStrong};
525
- background: ${a.panel};
526
- }
527
- `,$i=o.div`
528
- display: flex;
529
- flex-direction: column;
530
- gap: 8px;
531
- padding-top: 16px;
532
- border-top: 1px solid ${a.line};
533
- `,Si=o.div`
534
- display: flex;
535
- flex-wrap: wrap;
536
- gap: 10px;
537
- `;function Hi(){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(H,{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(De,{children:[t.jsx(He,{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[D,mt]=d.useState(!1),[Dt,ht]=d.useState(null),et=!!s&&s.name.trim().length>0&&s.name.length<=60,Ht=!!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&&Ht&&xt&&s.items.length>=ie&&s.items.length<=V;async function it(i){if(!(!c||!s||D)){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(H,{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(H,{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(H,{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(H,{message:Dt,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:D||!et,onClick:()=>void it(s.published),children:D?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:D,onClick:()=>void it(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"purple","data-testid":"outfit-studio-publish",disabled:D||!gt,onClick:()=>void it(!0),children:e("outfits.studio.publish")})]})]})]})}export{Hi as OutfitStudio,Hi as default};