@dcl/shop 0.1.0-28945852206.commit-364949f → 0.1.0-29002316303.commit-bd5d006

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 (201) hide show
  1. package/assets/AnimatedBackground-CiurwFBv.css +1 -0
  2. package/assets/AnimatedBackground-DwJTekmu.js +80 -0
  3. package/assets/{Assets-CBO-k6RL.js → Assets-CPKwtXeG.js} +1 -1
  4. package/assets/Button-B97LSmPW.js +74 -0
  5. package/assets/{Cart-DjeHyHVH.js → Cart-B4-XSYhj.js} +1 -1
  6. package/assets/{CircularProgress-iejXOpI6.js → CircularProgress-BtAdS3mK.js} +1 -1
  7. package/assets/{Collection-CM4rdqj5.js → Collection-BITbBunr.js} +1 -1
  8. package/assets/{ConstantsUtil-DOBrEopM.js → ConstantsUtil-DrWe0yob.js} +1 -1
  9. package/assets/{Creator-ZF8mQkd8.js → Creator-DpWvb_eV.js} +1 -1
  10. package/assets/DCL_LogoPattern-BryBPc3d.png +0 -0
  11. package/assets/{ExchangeController-DboaUneu.js → ExchangeController-CLNl7X0L.js} +1 -1
  12. package/assets/{FilterBar-CGgARS4S.js → FilterBar-CdU8B66A.js} +1 -1
  13. package/assets/GetCredits-XZdYVDK_.js +2 -0
  14. package/assets/{HelpersUtil-Zw_zzRiU.js → HelpersUtil-U7ylXlSU.js} +1 -1
  15. package/assets/{ImportListings-k9j5J1Zo.js → ImportListings-vVpgd0RJ.js} +1 -1
  16. package/assets/ItemDetail-C-RZG-7m.css +1 -0
  17. package/assets/ItemDetail-CagXeXhf.js +2 -0
  18. package/assets/{LoadMore-Cae84rui.js → LoadMore-BOCtgPLI.js} +1 -1
  19. package/assets/{Market-aDtWDkNw.js → Market-D9b86TWl.js} +1 -1
  20. package/assets/MenuItem-BaS9dwAb.js +9 -0
  21. package/assets/{MyAssets-Bw4serZG.js → MyAssets-LesZayzn.js} +1 -1
  22. package/assets/{MyFavorites-Dy0hokpG.js → MyFavorites-BFGd3qul.js} +1 -1
  23. package/assets/{MyPurchases-zeAdPUpL.js → MyPurchases-4O1sYgPa.js} +1 -1
  24. package/assets/{NetworkUtil-aE1iGnVj.js → NetworkUtil-Ddexw9-U.js} +1 -1
  25. package/assets/{NotFound-DjhNP5fN.js → NotFound-jVMYZTzX.js} +1 -1
  26. package/assets/{RealCheckout-DRBUykjl.js → RealCheckout-Emv2rnKJ.js} +1 -1
  27. package/assets/{ShopFooterInner-C7h1YCHA.js → ShopFooterInner-B7Kra_gV.js} +3 -3
  28. package/assets/{SkeletonCards-D9qg3FUs.js → SkeletonCards-BysJEVmg.js} +1 -1
  29. package/assets/{Success-fnmEnGG5.js → Success-CL0-vvGw.js} +1 -1
  30. package/assets/SvgIcon-Bjkj3_CR.js +1 -0
  31. package/assets/{SwapController-SlgG4aYU.js → SwapController-3n2vq1CX.js} +1 -1
  32. package/assets/{TradeService-DcE__a6G.js → TradeService-DlzFKIi0.js} +1 -1
  33. package/assets/{W3MFrameProviderSingleton-_PrcmI1q.js → W3MFrameProviderSingleton-DFy8mL1o.js} +3 -3
  34. package/assets/{WebCryptoP256-CHjsiX4E.js → WebCryptoP256-CdfoKLvV.js} +1 -1
  35. package/assets/{basic-B54y0zeq.js → basic-DF0x-8j0.js} +1 -1
  36. package/assets/{biconomy-BHmdMe5c.js → biconomy-uNfxxgSz.js} +1 -1
  37. package/assets/{browser-Ch1J123w.js → browser-DHYOtFa8.js} +1 -1
  38. package/assets/{browser-ponyfill-Be08WuKC.js → browser-ponyfill-rND5WOqr.js} +1 -1
  39. package/assets/{buy-DwyjMqAP.js → buy-BmZCwbRH.js} +1 -1
  40. package/assets/{buy-gasless-op4cwmiR.js → buy-gasless-BMlSkNzH.js} +1 -1
  41. package/assets/{ccip-BSpZndDt.js → ccip-BN7uV5yj.js} +1 -1
  42. package/assets/{ccip-BmtH9SqU.js → ccip-DILTAFEl.js} +1 -1
  43. package/assets/{chains-BQfW7JAQ.js → chains-CMJ6lVMG.js} +1 -1
  44. package/assets/{collection-Bpot6wpS.js → collection-DjHYkCfI.js} +1 -1
  45. package/assets/{common-CcOIK3mx.js → common-GsSQn_vD.js} +1 -1
  46. package/assets/{controller-uIUMKWEt.js → controller-49iaLet1.js} +2 -2
  47. package/assets/{core-DXdcP5HZ.js → core-yZGJ8DUA.js} +4 -4
  48. package/assets/{custom-BUnwkQ6N.js → custom-CFJfKM8I.js} +1 -1
  49. package/assets/{data-capture-U7pMB_F-.js → data-capture-C_3s7u5X.js} +1 -1
  50. package/assets/{decimals-CoSJIqdK.js → decimals-BOuBNygx.js} +1 -1
  51. package/assets/decimals-Bw5QzAzB.js +1 -0
  52. package/assets/{detectExtension-Ro6Acqan.js → detectExtension-By3YFrnI.js} +1 -1
  53. package/assets/{email-K4smfBfY.js → email-_2DjjRcX.js} +1 -1
  54. package/assets/{embedded-wallet-Cs_MXcVd.js → embedded-wallet-d37hEAVQ.js} +1 -1
  55. package/assets/{engine-DmFYY-M_.js → engine-CgBHIO_B.js} +1 -1
  56. package/assets/{estimate-l1-fee-CKgprc5I.js → estimate-l1-fee-DKPdSv11.js} +1 -1
  57. package/assets/eth_estimateGas-BNAPD8y1.js +1 -0
  58. package/assets/{eth_getStorageAt-uqzo0gxD.js → eth_getStorageAt-D4Oc0EWh.js} +1 -1
  59. package/assets/eth_getTransactionCount-BuGy0oh_.js +1 -0
  60. package/assets/{ethereum-XjVKsXdf.js → ethereum-CjiWK1L5.js} +1 -1
  61. package/assets/{ethers-CU3Ctw5k.js → ethers-DHDSyreX.js} +1 -1
  62. package/assets/{extractIPFS-DKs0_Rn8.js → extractIPFS-Djm4b9om.js} +1 -1
  63. package/assets/{features-DUP0GPvE.js → features-Nu8ft-DR.js} +1 -1
  64. package/assets/{fetchTokenMetadata-CM9v3KgQ.js → fetchTokenMetadata-C9gZA1VK.js} +2 -2
  65. package/assets/{fortmatic-86Dpmkig.js → fortmatic-B9IU5L1m.js} +1 -1
  66. package/assets/{generateUtilityClasses-DFV3l_aJ.js → generateUtilityClasses-wRCEHwkd.js} +2 -2
  67. package/assets/get-ecosystem-wallet-info-BKi9d9La.js +1 -0
  68. package/assets/{getBalance-Cq9qlbkZ.js → getBalance-VU8hTXaX.js} +2 -2
  69. package/assets/{getInstalledModules-DTAAMaer.js → getInstalledModules-BfvNNyZ9.js} +1 -1
  70. package/assets/{getNFT-CyrvaTLz.js → getNFT-BX-0ukXu.js} +2 -2
  71. package/assets/{getNFT-CbGyPAMP.js → getNFT-xdz2YHeO.js} +1 -1
  72. package/assets/{hashTypedData-DT7LRNGX.js → hashTypedData-Bw8VSnQz.js} +1 -1
  73. package/assets/{hashTypedData-DqXDddu6.js → hashTypedData-D3ppM4iK.js} +1 -1
  74. package/assets/{import-C06P5lQP.js → import-DXI6xe8g.js} +1 -1
  75. package/assets/{in-app-wallet-calls-D39FiW4T.js → in-app-wallet-calls-a76AHLUS.js} +1 -1
  76. package/assets/{index-B-MtbhtE.js → index-3d5QRDC9.js} +1 -1
  77. package/assets/{index-BXZD6JAt.js → index-91ey6P2k.js} +1 -1
  78. package/assets/index-B5srtbdi.js +1 -0
  79. package/assets/{index-D0hi13Mt.js → index-B9vZwW3s.js} +1 -1
  80. package/assets/{index-dcqyW0WV.js → index-BBK9Y4XF.js} +1 -1
  81. package/assets/{index-6zlIHhqj.js → index-BBKLOgxD.js} +3 -3
  82. package/assets/{index-HY-n-iGV.js → index-BLPu_LFY.js} +1 -1
  83. package/assets/{index-Cf-JuzPM.js → index-BMs28WEG.js} +1 -1
  84. package/assets/{index-BeQ4HGyd.js → index-BOA0blvN.js} +1 -1
  85. package/assets/{index-bJ6HAtiK.js → index-BOwZsNrV.js} +1 -1
  86. package/assets/{index-BXpN2yVg.js → index-BWvbpA_w.js} +2 -2
  87. package/assets/{index-D4A2vLZe.js → index-BX5dsPOx.js} +1 -1
  88. package/assets/{index-DYadknN5.js → index-B_Kzpf8Y.js} +1 -1
  89. package/assets/{index-NtdsSD1v.js → index-Bdx6iTiN.js} +1 -1
  90. package/assets/{index-DJNHtfkh.js → index-BhOVY5qU.js} +1 -1
  91. package/assets/{index-CuQf8IZi.js → index-BjjXbPFz.js} +2 -2
  92. package/assets/{index-Ctj09Wx6.js → index-BuKyqX4w.js} +1 -1
  93. package/assets/{index-B2uqMBh5.js → index-BuWxIV02.js} +1 -1
  94. package/assets/{index-CfzzJJMt.js → index-BwiZgchN.js} +41 -41
  95. package/assets/{index-B1aJy0sz.js → index-C1uNu9ax.js} +1 -1
  96. package/assets/{index-KtEbmQ9R.js → index-C5AZvu78.js} +1 -1
  97. package/assets/{index-DHG_C-Ye.js → index-CENZ1Xjd.js} +1 -1
  98. package/assets/{index-D3oE2u-n.js → index-CLIR3TTD.js} +1 -1
  99. package/assets/{index-C96Ea4xU.js → index-CLhk7eut.js} +1 -1
  100. package/assets/index-CMVEud4W.js +1 -0
  101. package/assets/index-CQB-2hib.js +1 -0
  102. package/assets/index-CVHG3ouX.js +4 -0
  103. package/assets/{index-Bzp10dDD.js → index-CWcJTahC.js} +1 -1
  104. package/assets/{index-DCL3fwlO.js → index-CWf2wa-0.js} +1 -1
  105. package/assets/{index-B4UqUY5v.js → index-CXT4WA4W.js} +1 -1
  106. package/assets/{index-B67hpoq5.js → index-CdfeQ7YK.js} +1 -1
  107. package/assets/{index-DWdlpiTK.js → index-Ce5-l4iN.js} +1 -1
  108. package/assets/{index-CpSpQjqZ.js → index-CeNkoKMh.js} +1 -1
  109. package/assets/{index-FBZIs89O.js → index-CjhsNe2w.js} +1 -1
  110. package/assets/index-Ck71AH1s.js +1 -0
  111. package/assets/{index-DrMJP1yU.js → index-Cl7b1h3u.js} +1 -1
  112. package/assets/{index-dh6reMW-.js → index-ClHveqxo.js} +2 -2
  113. package/assets/{index-DjnwGukw.js → index-Cxqt8VVu.js} +2 -2
  114. package/assets/{index-GfCqBMFv.js → index-D0eai65M.js} +1 -1
  115. package/assets/{index-AZRtL5LY.js → index-D8G2r3X0.js} +1 -1
  116. package/assets/{index-Pws_ODuR.css → index-DCrqkiFN.css} +1 -1
  117. package/assets/{index-R2A2Tsb5.js → index-DFiTZkQC.js} +1 -1
  118. package/assets/{index-wIIslmBs.js → index-DQv23Ja8.js} +1 -1
  119. package/assets/{index-RGDeneKO.js → index-DVAU0FU0.js} +1 -1
  120. package/assets/{index-BvQulWAh.js → index-DVS4Kd2_.js} +1 -1
  121. package/assets/{index-UKUxTJut.js → index-DXx-pvKF.js} +1 -1
  122. package/assets/{index-D2JbRvDH.js → index-DYJKRlpr.js} +1 -1
  123. package/assets/{index-B4-zOmOU.js → index-DZvqB6PN.js} +1 -1
  124. package/assets/{index-KgDMcyiH.js → index-DdnPAJ5X.js} +3 -3
  125. package/assets/{index-jHvjWNz3.js → index-DgQBo3-C.js} +1 -1
  126. package/assets/{index-7JsVFE1i.js → index-DmD_WwXV.js} +1 -1
  127. package/assets/{index-D6ZedYGB.js → index-Dr4xkIv9.js} +1 -1
  128. package/assets/{index-BezcXh9b.js → index-DstXS_u0.js} +1 -1
  129. package/assets/{index-As-Txuxb.js → index-DxOJU9tq.js} +1 -1
  130. package/assets/{index-Bh6YeyyZ.js → index-KJnoTXad.js} +1 -1
  131. package/assets/{index-BqYDk5ru.js → index-N4GX97C1.js} +1 -1
  132. package/assets/{index-BLYpV6KR.js → index-PHWeiOni.js} +1 -1
  133. package/assets/{index-BF1X-WT8.js → index-YHrFkKjE.js} +1 -1
  134. package/assets/{index-hD37wRqx.js → index-cp9iLCgk.js} +1 -1
  135. package/assets/{index-Csetv3rX.js → index-fG-RLqf5.js} +1 -1
  136. package/assets/{index.es-C9d_vRP1.js → index.es-CJd9j6O2.js} +1 -1
  137. package/assets/{index.es-CEk3CBed.js → index.es-DiOmCt3r.js} +1 -1
  138. package/assets/{index.es-C10dslGN.js → index.es-DtnPa4kO.js} +4 -4
  139. package/assets/{localBatchGatewayRequest-CApKBgKG.js → localBatchGatewayRequest-Boe2Uu3X.js} +1 -1
  140. package/assets/{mana-rate-B_AigQrJ.js → mana-rate-DwCj8Lv7.js} +1 -1
  141. package/assets/{native-zogUBnfz.js → native-7uSYstXA.js} +1 -1
  142. package/assets/network-CAHzpPTI.js +1 -0
  143. package/assets/{networks-WXiQTrmA.js → networks-BXNVDVMe.js} +1 -1
  144. package/assets/{onramp-DLUqlNox.js → onramp-tCaDlitG.js} +1 -1
  145. package/assets/{openzeppelin-D_HjTS73.js → openzeppelin-DM-htEyG.js} +1 -1
  146. package/assets/{ownerOf-Ci3JqZI5.js → ownerOf-DuQIqO9x.js} +1 -1
  147. package/assets/{parseNft-COofrAtZ.js → parseNft-DmhbhONn.js} +2 -2
  148. package/assets/{parseSignature-C7yfhyNP.js → parseSignature-B1dR6bl6.js} +1 -1
  149. package/assets/{parseSignature-C0keamKq.js → parseSignature-DYYcQU1L.js} +3 -3
  150. package/assets/{pay-with-exchange-BVqcnBHV.js → pay-with-exchange-BVaMyGE7.js} +1 -1
  151. package/assets/{qr-overlay-DEPZuNZC.js → qr-overlay-CiH5yqmN.js} +3 -3
  152. package/assets/{react-4iaCnQ6n.js → react-Vu6nbGi5.js} +1 -1
  153. package/assets/{receive-hhpMkrCL.js → receive-Bavon8LG.js} +1 -1
  154. package/assets/{resolveImplementation-DB2tcWZT.js → resolveImplementation-DRvgKkHA.js} +1 -1
  155. package/assets/{rpc-DNO_-y8Q.js → rpc-XOogimcY.js} +1 -1
  156. package/assets/{secp256k1-BWXD__Q8.js → secp256k1-Ct-bO2J8.js} +1 -1
  157. package/assets/{secp256k1-usszAGLN.js → secp256k1-DC-J_61z.js} +1 -1
  158. package/assets/{secp256k1-DZOOdD3Q.js → secp256k1-sRaQf1d2.js} +1 -1
  159. package/assets/{send-Byn9_n_O.js → send-DnIZiu_D.js} +1 -1
  160. package/assets/{send-batch-transaction-Bkc9_kF5.js → send-batch-transaction-CPO0kOsY.js} +1 -1
  161. package/assets/{send-eip712-transaction-BkODwgBt.js → send-eip712-transaction-8M5PxXck.js} +2 -2
  162. package/assets/{send-gasless-transaction-0f2bzvrP.js → send-gasless-transaction-xI_ZhuLr.js} +2 -2
  163. package/assets/{sendRawTransaction-Ba02Lf24.js → sendRawTransaction-Ch9UQm_d.js} +3 -3
  164. package/assets/{serializeTransaction-CThdmJTZ.js → serializeTransaction-BxoemPoM.js} +1 -1
  165. package/assets/{session-proposal-C83uyR0w.js → session-proposal-jGuqVux9.js} +1 -1
  166. package/assets/{session-request-CKcNt3Lr.js → session-request-Cz0M4rti.js} +2 -2
  167. package/assets/{sha256-eKX6fnZH.js → sha256-CXOl0v9Q.js} +1 -1
  168. package/assets/{signing-D5FLtKXR.js → signing-COLj5Qif.js} +5 -5
  169. package/assets/{socials-C05TGQGD.js → socials-D55PbtcI.js} +1 -1
  170. package/assets/{swaps-s_YkxYBU.js → swaps-BlC7Enst.js} +1 -1
  171. package/assets/{thirdweb-B1YFOwK8.js → thirdweb-BLwDJ3T1.js} +3 -3
  172. package/assets/{totalSupply-DHVqx3Ji.js → totalSupply-CPrbwtW0.js} +1 -1
  173. package/assets/{transactionReceipt-CP7NvOEq.js → transactionReceipt-DqVp3Jfu.js} +1 -1
  174. package/assets/{transactions-Dd6SRcZw.js → transactions-CdBXyHvH.js} +1 -1
  175. package/assets/{useInfiniteGrid-lpWOvlaw.js → useInfiniteGrid-DQrjB0ET.js} +1 -1
  176. package/assets/{utils-kxirIM46.js → utils-nbkSUjEy.js} +1 -1
  177. package/assets/{verifyHash-efCoX5Y3.js → verifyHash-C_IzpMMF.js} +1 -1
  178. package/assets/{w3m-modal-BQF6p0Ie.js → w3m-modal-Cc-pA8Rt.js} +1 -1
  179. package/assets/{w3m-modal-Dhnf-2iF.js → w3m-modal-DMA1xH6X.js} +1 -1
  180. package/assets/{wait-for-tx-receipt-Dw-8-Kbu.js → wait-for-tx-receipt-F3kc-N-x.js} +1 -1
  181. package/assets/{wallet-kind-CgOBZALj.js → wallet-kind-DKOf0fdN.js} +1 -1
  182. package/assets/{wallets-BLWl9mlK.js → wallets-BsJncPFm.js} +6 -6
  183. package/assets/{web-connector-Cal0nABQ.js → web-connector-B9GX2O4t.js} +3 -3
  184. package/assets/{writeContract-eZ5pUdOF.js → writeContract-CzKKPc3I.js} +1 -1
  185. package/assets/{zora-sepolia-BMTSsYE9.js → zora-sepolia-BQEmh41Y.js} +1 -1
  186. package/assets/{zoraTestnet-DXStMuC6.js → zoraTestnet-BPw878mz.js} +1 -1
  187. package/index.html +8 -8
  188. package/package.json +2 -2
  189. package/assets/GetCredits-D08lmol7.js +0 -2
  190. package/assets/ItemDetail-4CYAKZlG.js +0 -1
  191. package/assets/ItemDetail-BLC5ggDg.css +0 -1
  192. package/assets/MenuItem-D_L9-mYI.js +0 -82
  193. package/assets/SvgIcon-D5EgVDYB.js +0 -1
  194. package/assets/decimals-DmGKmjRg.js +0 -1
  195. package/assets/eth_estimateGas-Cndo_DpW.js +0 -1
  196. package/assets/eth_getTransactionCount-C_xmVKuS.js +0 -1
  197. package/assets/get-ecosystem-wallet-info-Bs87Pcvd.js +0 -1
  198. package/assets/index-DEpc43-h.js +0 -1
  199. package/assets/index-ZxkJeEpU.js +0 -1
  200. package/assets/index-hJaqTa7S.js +0 -4
  201. package/assets/network-CNeSRpun.js +0 -1
@@ -0,0 +1 @@
1
+ .AnimatedBackground{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.AnimatedBackground__fallback{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}.AnimatedBackground__canvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}
@@ -0,0 +1,80 @@
1
+ import{r as l,j as v}from"./react-Vu6nbGi5.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29002316303.commit-bd5d006/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29002316303.commit-bd5d006/assets/DCL_LogoPattern-BryBPc3d.png",b=`
2
+ attribute vec2 a_position;
3
+ varying vec2 v_uv;
4
+ void main() {
5
+ v_uv = a_position * 0.5 + 0.5;
6
+ gl_Position = vec4(a_position, 0.0, 1.0);
7
+ }
8
+ `,U=`
9
+ precision highp float;
10
+
11
+ uniform float u_time;
12
+ uniform vec2 u_resolution;
13
+ uniform sampler2D u_overlayTex;
14
+
15
+ varying vec2 v_uv;
16
+
17
+ const vec4 innerColor = vec4(0.749, 0.0, 1.0, 1.0);
18
+ const vec4 outerColor = vec4(0.3176, 0.0235, 0.5176, 1.0);
19
+ const float vignetteRadius = 0.167;
20
+ const float vignetteSmoothness = 0.5;
21
+ const vec4 overlayColor = vec4(1.0, 1.0, 1.0, 1.0);
22
+ const float overlayTiling = 1.66;
23
+ const vec2 overlayDirection = vec2(1.0, -1.25);
24
+ const float overlaySpeed = 0.06;
25
+ const float overlayAlpha = 0.573;
26
+ const vec4 glowColor = vec4(0.5725, 0.0588, 0.6392, 1.0);
27
+ const float glowStrength = 0.17;
28
+ const vec2 glowRadiusVec = vec2(0.05, 0.13);
29
+ const float glowSmoothness = 3.61;
30
+ const vec2 glowCenter = vec2(0.68, 0.5);
31
+ const float luminosityStrength = 0.541;
32
+
33
+ vec3 rgb2hsv(vec3 c) {
34
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
35
+ vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
36
+ vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
37
+ float d = q.x - min(q.w, q.y);
38
+ float e = 1e-10;
39
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
40
+ }
41
+
42
+ vec3 hsv2rgb(vec3 c) {
43
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
44
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
45
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
46
+ }
47
+
48
+ void main() {
49
+ vec2 uv = v_uv;
50
+
51
+ vec2 centerUV = uv - 0.5;
52
+ float rad = length(centerUV);
53
+ float mask = smoothstep(vignetteRadius + vignetteSmoothness, vignetteRadius, rad);
54
+ vec4 vignette = mix(outerColor, innerColor, mask);
55
+
56
+ float aspect = u_resolution.x / u_resolution.y;
57
+ vec2 overlayUV = uv;
58
+ overlayUV.x *= overlayTiling * aspect;
59
+ overlayUV.y *= overlayTiling;
60
+ overlayUV += u_time * overlayDirection * overlaySpeed;
61
+ vec4 overlay = texture2D(u_overlayTex, overlayUV) * overlayColor;
62
+ overlay.a *= overlayAlpha * mask;
63
+
64
+ vec3 vignetteHSV = rgb2hsv(vignette.rgb);
65
+ vec3 overlayHSV = rgb2hsv(overlay.rgb);
66
+ float val = mix(0.5, 1.0, overlayHSV.z);
67
+ vec3 luminosityBlend = hsv2rgb(vec3(vignetteHSV.x, vignetteHSV.y, val));
68
+ float luminosityBlendAmount = overlay.a * luminosityStrength;
69
+ vec4 result = vec4(mix(vignette.rgb, luminosityBlend, luminosityBlendAmount), 1.0);
70
+
71
+ vec2 glowDelta = (uv - glowCenter) / glowRadiusVec;
72
+ glowDelta.x *= aspect;
73
+ float glowDist = length(glowDelta);
74
+ float glowMask = 1.0 - smoothstep(1.0, 1.0 + glowSmoothness, glowDist);
75
+ vec4 glow = glowColor * glowMask * glowStrength;
76
+ result.rgb += glow.rgb * glow.a;
77
+
78
+ gl_FragColor = result;
79
+ }
80
+ `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,b),c=g(e,e.FRAGMENT_SHADER,U);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
@@ -1 +1 @@
1
- import{r as i,j as e,b as D}from"./react-4iaCnQ6n.js";import{m as F,l as I,A as K,B as J}from"./index-CfzzJJMt.js";import{S as A,F as W,a as Y}from"./FilterBar-CGgARS4S.js";import{S as M}from"./SkeletonCards-D9qg3FUs.js";import{L as Z}from"./LoadMore-Cae84rui.js";import{u as z}from"./useInfiniteGrid-lpWOvlaw.js";import"./ethers-CU3Ctw5k.js";const Q=[{key:"all",label:"Shop All"},{key:"wearable",label:"Wearables",expandable:!0,subs:[{key:"Head",label:"Head",icon:"cat-head"},{key:"Upper Body",label:"Upper Body",icon:"cat-upper"},{key:"Handwear",label:"Handwear",icon:"cat-handwear"},{key:"Lower Body",label:"Lower Body",icon:"cat-lower"},{key:"Feet",label:"Feet",icon:"cat-feet"},{key:"Accessories",label:"Accessories",icon:"cat-accessories"},{key:"Skins",label:"Skins",icon:"cat-skins"}]},{key:"emote",label:"Emotes",expandable:!0,subs:[{key:"Dance",label:"Dance",icon:"emote-dance"},{key:"Stunt",label:"Stunt",icon:"emote-stunt"},{key:"Greetings",label:"Greetings",icon:"emote-greetings"},{key:"Fun",label:"Fun",icon:"emote-fun"},{key:"Poses",label:"Poses",icon:"emote-poses"},{key:"Reactions",label:"Reactions",icon:"emote-reactions"},{key:"Horror",label:"Horror",icon:"emote-horror"},{key:"Miscellaneous",label:"Miscellaneous",icon:"emote-misc"}]}];function V({category:f,subCategory:n,onCategory:l,onSub:x}){const[c,b]=i.useState(()=>f==="wearable"?"wearable":null);function o(s){s.subs?b(t=>{const u=t!==s.key;return u&&l(s.key),u?s.key:null}):(l(s.key),b(null))}return e.jsx("div",{className:"catfilter",children:Q.map(s=>{const t=c===s.key&&!!s.subs,u=s.key===f;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${t?" is-expanded":""}${u?" is-selected":""}`,onClick:()=>o(s),children:[e.jsx("span",{className:"catfilter__cat-label",children:s.label}),s.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${t?" is-up":""}`,"aria-hidden":!0}):null]}),s.subs?e.jsx("div",{className:`catfilter__subs${t?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:s.subs.map(r=>e.jsx("button",{type:"button",className:`catfilter__sub${n===r.key?" is-active":""}`,onClick:()=>x(n===r.key?null:r.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${r.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:r.label})]})},r.key))})}):null]},s.key)})})}const X=48,ee={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"],Dance:["dance"],Stunt:["stunt"],Greetings:["greetings"],Fun:["fun"],Poses:["poses"],Reactions:["reactions"],Horror:["horror"],Miscellaneous:["miscellaneous"]};function ce(){const[f]=D(),n=(f.get("q")??"").trim().toLowerCase(),[l,x]=i.useState("wearable"),[c,b]=i.useState(null),[o,s]=i.useState([]),[t,u]=i.useState(""),[r,N]=i.useState(""),[p,R]=i.useState("newest"),y=t&&!Number.isNaN(Number(t))?Number(t):void 0,h=r&&!Number.isNaN(Number(r))?Number(r):void 0,E=c?ee[c]:void 0,B=(A.find(a=>a.key===p)??A[0]).server,j={category:l,rarities:o.length?o:void 0,wearableCategories:E,minPriceCredits:y,maxPriceCredits:h,search:n||void 0,sortBy:B},{items:S,total:w,isLoading:d,error:v,hasNextPage:L,isFetchingNextPage:C,fetchNextPage:H}=z(["listings",j],a=>J({...j,first:X,skip:a})),_=w,P=i.useRef(null);i.useEffect(()=>{d||!n||P.current===n||(P.current=n,F("Shop Searched",{query:n,result_count:_}))},[n,d,_]);const g=i.useRef("__init__");i.useEffect(()=>{if(d)return;const a=JSON.stringify({category:l,subCategory:c,rarities:o,min:y,max:h,sort:p});if(g.current==="__init__"||g.current===a){g.current=a;return}g.current=a,F("Shop Applied Filter",{filters:{category:l,sub_category:c,rarities:o,min_price_credits:y??null,max_price_credits:h??null,sort:p},result_count:_})},[l,c,o,y,h,p,d,_]);function $(a){x(a),b(null)}function G(a){s(m=>m.includes(a)?m.filter(O=>O!==a):[...m,a])}function T(){x("wearable"),b(null),s([]),u(""),N("")}const k=!!(y||h),U=k?`${t||"0"}–${r||"∞"}`:"Price",q=l!=="wearable"||!!c||o.length>0||k;return e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(V,{category:l,subCategory:c,onCategory:$,onSub:b})}),e.jsxs("div",{className:"browse__main",children:[e.jsx(W,{rarities:o,onToggleRarity:G,sort:p,onSort:R,total:w,loading:d,query:n,anyActive:q,onClear:T,renderTrailing:a=>e.jsx(Y,{panelKey:"price",label:U,active:k,panel:a,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":"Minimum price",placeholder:"Min",value:t,onChange:m=>u(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"Max",value:r,onChange:m=>N(m.target.value)})]}),e.jsxs("p",{className:"filter-pop__hint",children:["Price in ",I.name]})]})})}),v?e.jsx("p",{className:"error",children:v.message}):null,e.jsx("div",{className:"grid",children:d?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[S.map(a=>e.jsx(K,{item:a},a.id)),C?e.jsx(M,{count:6}):null]})}),e.jsx(Z,{hasNextPage:L,isFetching:C,onLoadMore:()=>H()}),!d&&S.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]})]})}export{ce as Assets};
1
+ import{r as i,j as e,b as D}from"./react-Vu6nbGi5.js";import{m as F,l as I,A as K,B as J}from"./index-BwiZgchN.js";import{S as A,F as W,a as Y}from"./FilterBar-CdU8B66A.js";import{S as M}from"./SkeletonCards-BysJEVmg.js";import{L as Z}from"./LoadMore-BOCtgPLI.js";import{u as z}from"./useInfiniteGrid-DQrjB0ET.js";import"./ethers-DHDSyreX.js";const Q=[{key:"all",label:"Shop All"},{key:"wearable",label:"Wearables",expandable:!0,subs:[{key:"Head",label:"Head",icon:"cat-head"},{key:"Upper Body",label:"Upper Body",icon:"cat-upper"},{key:"Handwear",label:"Handwear",icon:"cat-handwear"},{key:"Lower Body",label:"Lower Body",icon:"cat-lower"},{key:"Feet",label:"Feet",icon:"cat-feet"},{key:"Accessories",label:"Accessories",icon:"cat-accessories"},{key:"Skins",label:"Skins",icon:"cat-skins"}]},{key:"emote",label:"Emotes",expandable:!0,subs:[{key:"Dance",label:"Dance",icon:"emote-dance"},{key:"Stunt",label:"Stunt",icon:"emote-stunt"},{key:"Greetings",label:"Greetings",icon:"emote-greetings"},{key:"Fun",label:"Fun",icon:"emote-fun"},{key:"Poses",label:"Poses",icon:"emote-poses"},{key:"Reactions",label:"Reactions",icon:"emote-reactions"},{key:"Horror",label:"Horror",icon:"emote-horror"},{key:"Miscellaneous",label:"Miscellaneous",icon:"emote-misc"}]}];function V({category:f,subCategory:n,onCategory:l,onSub:x}){const[c,b]=i.useState(()=>f==="wearable"?"wearable":null);function o(s){s.subs?b(t=>{const u=t!==s.key;return u&&l(s.key),u?s.key:null}):(l(s.key),b(null))}return e.jsx("div",{className:"catfilter",children:Q.map(s=>{const t=c===s.key&&!!s.subs,u=s.key===f;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${t?" is-expanded":""}${u?" is-selected":""}`,onClick:()=>o(s),children:[e.jsx("span",{className:"catfilter__cat-label",children:s.label}),s.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${t?" is-up":""}`,"aria-hidden":!0}):null]}),s.subs?e.jsx("div",{className:`catfilter__subs${t?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:s.subs.map(r=>e.jsx("button",{type:"button",className:`catfilter__sub${n===r.key?" is-active":""}`,onClick:()=>x(n===r.key?null:r.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${r.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:r.label})]})},r.key))})}):null]},s.key)})})}const X=48,ee={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"],Dance:["dance"],Stunt:["stunt"],Greetings:["greetings"],Fun:["fun"],Poses:["poses"],Reactions:["reactions"],Horror:["horror"],Miscellaneous:["miscellaneous"]};function ce(){const[f]=D(),n=(f.get("q")??"").trim().toLowerCase(),[l,x]=i.useState("wearable"),[c,b]=i.useState(null),[o,s]=i.useState([]),[t,u]=i.useState(""),[r,N]=i.useState(""),[p,R]=i.useState("newest"),y=t&&!Number.isNaN(Number(t))?Number(t):void 0,h=r&&!Number.isNaN(Number(r))?Number(r):void 0,E=c?ee[c]:void 0,B=(A.find(a=>a.key===p)??A[0]).server,j={category:l,rarities:o.length?o:void 0,wearableCategories:E,minPriceCredits:y,maxPriceCredits:h,search:n||void 0,sortBy:B},{items:S,total:w,isLoading:d,error:v,hasNextPage:L,isFetchingNextPage:C,fetchNextPage:H}=z(["listings",j],a=>J({...j,first:X,skip:a})),_=w,P=i.useRef(null);i.useEffect(()=>{d||!n||P.current===n||(P.current=n,F("Shop Searched",{query:n,result_count:_}))},[n,d,_]);const g=i.useRef("__init__");i.useEffect(()=>{if(d)return;const a=JSON.stringify({category:l,subCategory:c,rarities:o,min:y,max:h,sort:p});if(g.current==="__init__"||g.current===a){g.current=a;return}g.current=a,F("Shop Applied Filter",{filters:{category:l,sub_category:c,rarities:o,min_price_credits:y??null,max_price_credits:h??null,sort:p},result_count:_})},[l,c,o,y,h,p,d,_]);function $(a){x(a),b(null)}function G(a){s(m=>m.includes(a)?m.filter(O=>O!==a):[...m,a])}function T(){x("wearable"),b(null),s([]),u(""),N("")}const k=!!(y||h),U=k?`${t||"0"}–${r||"∞"}`:"Price",q=l!=="wearable"||!!c||o.length>0||k;return e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(V,{category:l,subCategory:c,onCategory:$,onSub:b})}),e.jsxs("div",{className:"browse__main",children:[e.jsx(W,{rarities:o,onToggleRarity:G,sort:p,onSort:R,total:w,loading:d,query:n,anyActive:q,onClear:T,renderTrailing:a=>e.jsx(Y,{panelKey:"price",label:U,active:k,panel:a,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":"Minimum price",placeholder:"Min",value:t,onChange:m=>u(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"Max",value:r,onChange:m=>N(m.target.value)})]}),e.jsxs("p",{className:"filter-pop__hint",children:["Price in ",I.name]})]})})}),v?e.jsx("p",{className:"error",children:v.message}):null,e.jsx("div",{className:"grid",children:d?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[S.map(a=>e.jsx(K,{item:a},a.id)),C?e.jsx(M,{count:6}):null]})}),e.jsx(Z,{hasNextPage:L,isFetching:C,onLoadMore:()=>H()}),!d&&S.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]})]})}export{ce as Assets};
@@ -0,0 +1,74 @@
1
+ import{r as a,i as st,j as z,e as lt,R as H}from"./react-Vu6nbGi5.js";import{b as m,C as Ne,d as M,T as ut,t as ct,v as dt,x as pt,y as ft,_ as Y,c as I,a as ee,u as fe,s as A,k as he,g as Se,e as Ve,n as ht,z as mt,A as bt,q as gt,p as J}from"./generateUtilityClasses-wRCEHwkd.js";import{S as Ce}from"./SvgIcon-Bjkj3_CR.js";var se={};function vt(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function xt(e,t=166){let n;function o(...r){const i=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(i,t)}return o.clear=()=>{clearTimeout(n)},o}function yt(e,t){return()=>null}function Ct(e,t){var n,o;return a.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}function ke(e){return e&&e.ownerDocument||document}function Rt(e){return ke(e).defaultView||window}function Et(e,t){return()=>null}function Le(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const _e=typeof window<"u"?a.useLayoutEffect:a.useEffect;let Re=0;function It(e){const[t,n]=a.useState(e),o=e||t;return a.useEffect(()=>{t==null&&(Re+=1,n(`mui-${Re}`))},[t]),o}const Ee=st.useId;function Tt(e){if(Ee!==void 0){const t=Ee();return e??t}return It(e)}function Mt(e,t,n,o,r){return null}function zt({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=a.useRef(e!==void 0),[i,s]=a.useState(t),c=r?e:i,u=a.useCallback(d=>{r||s(d)},[]);return[c,u]}function X(e){const t=a.useRef(e);return _e(()=>{t.current=e}),a.useRef((...n)=>(0,t.current)(...n)).current}function ue(...e){return a.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Le(n,t)})},e)}const Ie={};function $t(e,t){const n=a.useRef(Ie);return n.current===Ie&&(n.current=e(t)),n}const Bt=[];function Pt(e){a.useEffect(e,Bt)}class te{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new te}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Nt(){const e=$t(te.create).current;return Pt(e.disposeEffect),e}let ne=!0,ce=!1;const St=new te,Vt={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function kt(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Vt[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Lt(e){e.metaKey||e.altKey||e.ctrlKey||(ne=!0)}function le(){ne=!1}function _t(){this.visibilityState==="hidden"&&ce&&(ne=!0)}function Ft(e){e.addEventListener("keydown",Lt,!0),e.addEventListener("mousedown",le,!0),e.addEventListener("pointerdown",le,!0),e.addEventListener("touchstart",le,!0),e.addEventListener("visibilitychange",_t,!0)}function Dt(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ne||kt(t)}function Fe(){const e=a.useCallback(r=>{r!=null&&Ft(r.ownerDocument)},[]),t=a.useRef(!1);function n(){return t.current?(ce=!0,St.start(100,()=>{ce=!1}),t.current=!1,!0):!1}function o(r){return Dt(r)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:o,onBlur:n,ref:e}}function jt(e,t){function n(o,r){return z.jsx(Ce,m({"data-testid":`${t}Icon`,ref:r},o,{children:e}))}return n.muiName=Ce.muiName,a.memo(a.forwardRef(n))}const Ot={configure:e=>{Ne.configure(e)}},Ut=Object.freeze(Object.defineProperty({__proto__:null,capitalize:M,createChainedFunction:vt,createSvgIcon:jt,debounce:xt,deprecatedPropType:yt,isMuiElement:Ct,ownerDocument:ke,ownerWindow:Rt,requirePropFactory:Et,setRef:Le,unstable_ClassNameGenerator:Ot,unstable_useEnhancedEffect:_e,unstable_useId:Tt,unsupportedProp:Mt,useControlled:zt,useEventCallback:X,useForkRef:ue,useIsFocusVisible:Fe},Symbol.toStringTag,{value:"Module"})),Wt=lt(Ut);var Te;function Vn(){return Te||(Te=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Wt})(se)),se}function wt(e){return Object.keys(e).length===0}function At(e=null){const t=a.useContext(ut);return!t||wt(t)?e:t}const Kt=ct();function Gt(e=Kt){return At(e)}function De(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=De(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ht(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=De(e))&&(o&&(o+=" "),o+=t);return o}const Xt=["className","component"];function Yt(e={}){const{themeId:t,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:r}=e,i=dt("div",{shouldForwardProp:c=>c!=="theme"&&c!=="sx"&&c!=="as"})(pt);return a.forwardRef(function(u,d){const f=Gt(n),b=ft(u),{className:g,component:x="div"}=b,h=Y(b,Xt);return z.jsx(i,m({as:x,ref:d,className:Ht(g,r?r(o):o),theme:t&&f[t]||f},h))})}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},de(e,t)}function qt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,de(e,t)}const Me=H.createContext(null);function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e,t){var n=function(i){return t&&a.isValidElement(i)?t(i):i},o=Object.create(null);return e&&a.Children.map(e,function(r){return r}).forEach(function(r){o[r.key]=n(r)}),o}function Jt(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var o=Object.create(null),r=[];for(var i in e)i in t?r.length&&(o[i]=r,r=[]):r.push(i);var s,c={};for(var u in t){if(o[u])for(s=0;s<o[u].length;s++){var d=o[u][s];c[o[u][s]]=n(d)}c[u]=n(u)}for(s=0;s<r.length;s++)c[r[s]]=n(r[s]);return c}function w(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Qt(e,t){return me(e.children,function(n){return a.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:w(n,"appear",e),enter:w(n,"enter",e),exit:w(n,"exit",e)})})}function en(e,t,n){var o=me(e.children),r=Jt(t,o);return Object.keys(r).forEach(function(i){var s=r[i];if(a.isValidElement(s)){var c=i in t,u=i in o,d=t[i],f=a.isValidElement(d)&&!d.props.in;u&&(!c||f)?r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:w(s,"exit",e),enter:w(s,"enter",e)}):!u&&c&&!f?r[i]=a.cloneElement(s,{in:!1}):u&&c&&a.isValidElement(d)&&(r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:d.props.in,exit:w(s,"exit",e),enter:w(s,"enter",e)}))}}),r}var tn=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},nn={component:"div",childFactory:function(t){return t}},be=(function(e){qt(t,e);function t(o,r){var i;i=e.call(this,o,r)||this;var s=i.handleExited.bind(Zt(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(r,i){var s=i.children,c=i.handleExited,u=i.firstRender;return{children:u?Qt(r,c):en(r,s,c),firstRender:!1}},n.handleExited=function(r,i){var s=me(this.props.children);r.key in s||(r.props.onExited&&r.props.onExited(i),this.mounted&&this.setState(function(c){var u=m({},c.children);return delete u[r.key],{children:u}}))},n.render=function(){var r=this.props,i=r.component,s=r.childFactory,c=Y(r,["component","childFactory"]),u=this.state.contextValue,d=tn(this.state.children).map(s);return delete c.appear,delete c.enter,delete c.exit,i===null?H.createElement(Me.Provider,{value:u},d):H.createElement(Me.Provider,{value:u},H.createElement(i,c,d))},t})(H.Component);be.propTypes={};be.defaultProps=nn;function on(e){const{className:t,classes:n,pulsate:o=!1,rippleX:r,rippleY:i,rippleSize:s,in:c,onExited:u,timeout:d}=e,[f,b]=a.useState(!1),g=I(t,n.ripple,n.rippleVisible,o&&n.ripplePulsate),x={width:s,height:s,top:-(s/2)+i,left:-(s/2)+r},h=I(n.child,f&&n.childLeaving,o&&n.childPulsate);return!c&&!f&&b(!0),a.useEffect(()=>{if(!c&&u!=null){const C=setTimeout(u,d);return()=>{clearTimeout(C)}}},[u,c,d]),z.jsx("span",{className:g,style:x,children:z.jsx("span",{className:h})})}const T=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),rn=["center","classes","className"];let oe=e=>e,ze,$e,Be,Pe;const pe=550,an=80,sn=he(ze||(ze=oe`
2
+ 0% {
3
+ transform: scale(0);
4
+ opacity: 0.1;
5
+ }
6
+
7
+ 100% {
8
+ transform: scale(1);
9
+ opacity: 0.3;
10
+ }
11
+ `)),ln=he($e||($e=oe`
12
+ 0% {
13
+ opacity: 1;
14
+ }
15
+
16
+ 100% {
17
+ opacity: 0;
18
+ }
19
+ `)),un=he(Be||(Be=oe`
20
+ 0% {
21
+ transform: scale(1);
22
+ }
23
+
24
+ 50% {
25
+ transform: scale(0.92);
26
+ }
27
+
28
+ 100% {
29
+ transform: scale(1);
30
+ }
31
+ `)),cn=A("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),dn=A(on,{name:"MuiTouchRipple",slot:"Ripple"})(Pe||(Pe=oe`
32
+ opacity: 0;
33
+ position: absolute;
34
+
35
+ &.${0} {
36
+ opacity: 0.3;
37
+ transform: scale(1);
38
+ animation-name: ${0};
39
+ animation-duration: ${0}ms;
40
+ animation-timing-function: ${0};
41
+ }
42
+
43
+ &.${0} {
44
+ animation-duration: ${0}ms;
45
+ }
46
+
47
+ & .${0} {
48
+ opacity: 1;
49
+ display: block;
50
+ width: 100%;
51
+ height: 100%;
52
+ border-radius: 50%;
53
+ background-color: currentColor;
54
+ }
55
+
56
+ & .${0} {
57
+ opacity: 0;
58
+ animation-name: ${0};
59
+ animation-duration: ${0}ms;
60
+ animation-timing-function: ${0};
61
+ }
62
+
63
+ & .${0} {
64
+ position: absolute;
65
+ /* @noflip */
66
+ left: 0px;
67
+ top: 0;
68
+ animation-name: ${0};
69
+ animation-duration: 2500ms;
70
+ animation-timing-function: ${0};
71
+ animation-iteration-count: infinite;
72
+ animation-delay: 200ms;
73
+ }
74
+ `),T.rippleVisible,sn,pe,({theme:e})=>e.transitions.easing.easeInOut,T.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,T.child,T.childLeaving,ln,pe,({theme:e})=>e.transitions.easing.easeInOut,T.childPulsate,un,({theme:e})=>e.transitions.easing.easeInOut),pn=a.forwardRef(function(t,n){const o=fe({props:t,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:s}=o,c=Y(o,rn),[u,d]=a.useState([]),f=a.useRef(0),b=a.useRef(null);a.useEffect(()=>{b.current&&(b.current(),b.current=null)},[u]);const g=a.useRef(!1),x=Nt(),h=a.useRef(null),C=a.useRef(null),j=a.useCallback(p=>{const{pulsate:R,rippleX:v,rippleY:y,rippleSize:L,cb:O}=p;d(E=>[...E,z.jsx(dn,{classes:{ripple:I(i.ripple,T.ripple),rippleVisible:I(i.rippleVisible,T.rippleVisible),ripplePulsate:I(i.ripplePulsate,T.ripplePulsate),child:I(i.child,T.child),childLeaving:I(i.childLeaving,T.childLeaving),childPulsate:I(i.childPulsate,T.childPulsate)},timeout:pe,pulsate:R,rippleX:v,rippleY:y,rippleSize:L},f.current)]),f.current+=1,b.current=O},[i]),V=a.useCallback((p={},R={},v=()=>{})=>{const{pulsate:y=!1,center:L=r||R.pulsate,fakeElement:O=!1}=R;if((p==null?void 0:p.type)==="mousedown"&&g.current){g.current=!1;return}(p==null?void 0:p.type)==="touchstart"&&(g.current=!0);const E=O?null:C.current,_=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,F,D;if(L||p===void 0||p.clientX===0&&p.clientY===0||!p.clientX&&!p.touches)P=Math.round(_.width/2),F=Math.round(_.height/2);else{const{clientX:U,clientY:N}=p.touches&&p.touches.length>0?p.touches[0]:p;P=Math.round(U-_.left),F=Math.round(N-_.top)}if(L)D=Math.sqrt((2*_.width**2+_.height**2)/3),D%2===0&&(D+=1);else{const U=Math.max(Math.abs((E?E.clientWidth:0)-P),P)*2+2,N=Math.max(Math.abs((E?E.clientHeight:0)-F),F)*2+2;D=Math.sqrt(U**2+N**2)}p!=null&&p.touches?h.current===null&&(h.current=()=>{j({pulsate:y,rippleX:P,rippleY:F,rippleSize:D,cb:v})},x.start(an,()=>{h.current&&(h.current(),h.current=null)})):j({pulsate:y,rippleX:P,rippleY:F,rippleSize:D,cb:v})},[r,j,x]),k=a.useCallback(()=>{V({},{pulsate:!0})},[V]),B=a.useCallback((p,R)=>{if(x.clear(),(p==null?void 0:p.type)==="touchend"&&h.current){h.current(),h.current=null,x.start(0,()=>{B(p,R)});return}h.current=null,d(v=>v.length>0?v.slice(1):v),b.current=R},[x]);return a.useImperativeHandle(n,()=>({pulsate:k,start:V,stop:B}),[k,V,B]),z.jsx(cn,m({className:I(T.root,i.root,s),ref:C},c,{children:z.jsx(be,{component:null,exit:!0,children:u})}))});function fn(e){return Se("MuiButtonBase",e)}const hn=ee("MuiButtonBase",["root","disabled","focusVisible"]),mn=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],bn=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:o,classes:r}=e,s=Ve({root:["root",t&&"disabled",n&&"focusVisible"]},fn,r);return n&&o&&(s.root+=` ${o}`),s},gn=A("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${hn.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),vn=a.forwardRef(function(t,n){const o=fe({props:t,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:s,className:c,component:u="button",disabled:d=!1,disableRipple:f=!1,disableTouchRipple:b=!1,focusRipple:g=!1,LinkComponent:x="a",onBlur:h,onClick:C,onContextMenu:j,onDragLeave:V,onFocus:k,onFocusVisible:B,onKeyDown:p,onKeyUp:R,onMouseDown:v,onMouseLeave:y,onMouseUp:L,onTouchEnd:O,onTouchMove:E,onTouchStart:_,tabIndex:P=0,TouchRippleProps:F,touchRippleRef:D,type:U}=o,N=Y(o,mn),K=a.useRef(null),$=a.useRef(null),Oe=ue($,D),{isFocusVisibleRef:ge,onFocus:Ue,onBlur:We,ref:we}=Fe(),[W,q]=a.useState(!1);d&&W&&q(!1),a.useImperativeHandle(r,()=>({focusVisible:()=>{q(!0),K.current.focus()}}),[]);const[re,Ae]=a.useState(!1);a.useEffect(()=>{Ae(!0)},[]);const Ke=re&&!f&&!d;a.useEffect(()=>{W&&g&&!f&&re&&$.current.pulsate()},[f,g,W,re]);function S(l,xe,at=b){return X(ye=>(xe&&xe(ye),!at&&$.current&&$.current[l](ye),!0))}const Ge=S("start",v),He=S("stop",j),Xe=S("stop",V),Ye=S("stop",L),qe=S("stop",l=>{W&&l.preventDefault(),y&&y(l)}),Ze=S("start",_),Je=S("stop",O),Qe=S("stop",E),et=S("stop",l=>{We(l),ge.current===!1&&q(!1),h&&h(l)},!1),tt=X(l=>{K.current||(K.current=l.currentTarget),Ue(l),ge.current===!0&&(q(!0),B&&B(l)),k&&k(l)}),ie=()=>{const l=K.current;return u&&u!=="button"&&!(l.tagName==="A"&&l.href)},ae=a.useRef(!1),nt=X(l=>{g&&!ae.current&&W&&$.current&&l.key===" "&&(ae.current=!0,$.current.stop(l,()=>{$.current.start(l)})),l.target===l.currentTarget&&ie()&&l.key===" "&&l.preventDefault(),p&&p(l),l.target===l.currentTarget&&ie()&&l.key==="Enter"&&!d&&(l.preventDefault(),C&&C(l))}),ot=X(l=>{g&&l.key===" "&&$.current&&W&&!l.defaultPrevented&&(ae.current=!1,$.current.stop(l,()=>{$.current.pulsate(l)})),R&&R(l),C&&l.target===l.currentTarget&&ie()&&l.key===" "&&!l.defaultPrevented&&C(l)});let Z=u;Z==="button"&&(N.href||N.to)&&(Z=x);const G={};Z==="button"?(G.type=U===void 0?"button":U,G.disabled=d):(!N.href&&!N.to&&(G.role="button"),d&&(G["aria-disabled"]=d));const rt=ue(n,we,K),ve=m({},o,{centerRipple:i,component:u,disabled:d,disableRipple:f,disableTouchRipple:b,focusRipple:g,tabIndex:P,focusVisible:W}),it=bn(ve);return z.jsxs(gn,m({as:Z,className:I(it.root,c),ownerState:ve,onBlur:et,onClick:C,onContextMenu:He,onFocus:tt,onKeyDown:nt,onKeyUp:ot,onMouseDown:Ge,onMouseLeave:qe,onMouseUp:Ye,onDragLeave:Xe,onTouchEnd:Je,onTouchMove:Qe,onTouchStart:Ze,ref:rt,tabIndex:d?-1:P,type:U},G,N,{children:[s,Ke?z.jsx(pn,m({ref:Oe,center:i},F)):null]}))}),xn=ee("MuiBox",["root"]),yn=mt(),kn=Yt({themeId:ht,defaultTheme:yn,defaultClassName:xn.root,generateClassName:Ne.generate});function Cn(e){return Se("MuiButton",e)}const Q=ee("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Rn=a.createContext({}),En=a.createContext(void 0),In=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Tn=e=>{const{color:t,disableElevation:n,fullWidth:o,size:r,variant:i,classes:s}=e,c={root:["root",i,`${i}${M(t)}`,`size${M(r)}`,`${i}Size${M(r)}`,`color${M(t)}`,n&&"disableElevation",o&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${M(r)}`],endIcon:["icon","endIcon",`iconSize${M(r)}`]},u=Ve(c,Cn,s);return m({},s,u)},je=e=>m({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Mn=A(vn,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${M(n.color)}`],t[`size${M(n.size)}`],t[`${n.variant}Size${M(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,o;const r=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return m({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":m({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":m({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Q.focusVisible}`]:m({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Q.disabled}`]:m({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${J.alpha(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(o=e.palette).getContrastText)==null?void 0:n.call(o,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:r,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Q.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Q.disabled}`]:{boxShadow:"none"}}),zn=A("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${M(n.size)}`]]}})(({ownerState:e})=>m({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},je(e))),$n=A("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${M(n.size)}`]]}})(({ownerState:e})=>m({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},je(e))),Ln=a.forwardRef(function(t,n){const o=a.useContext(Rn),r=a.useContext(En),i=bt(o,t),s=fe({props:i,name:"MuiButton"}),{children:c,color:u="primary",component:d="button",className:f,disabled:b=!1,disableElevation:g=!1,disableFocusRipple:x=!1,endIcon:h,focusVisibleClassName:C,fullWidth:j=!1,size:V="medium",startIcon:k,type:B,variant:p="text"}=s,R=Y(s,In),v=m({},s,{color:u,component:d,disabled:b,disableElevation:g,disableFocusRipple:x,fullWidth:j,size:V,type:B,variant:p}),y=Tn(v),L=k&&z.jsx(zn,{className:y.startIcon,ownerState:v,children:k}),O=h&&z.jsx($n,{className:y.endIcon,ownerState:v,children:h}),E=r||"";return z.jsxs(Mn,m({ownerState:v,className:I(o.className,y.root,f,E),component:d,disabled:b,focusRipple:!x,focusVisibleClassName:I(y.focusVisible,C),ref:n,type:B},R,{classes:y,children:[L,c,O]}))});export{vn as B,Me as T,qt as _,ue as a,_e as b,Nt as c,At as d,Tt as e,Rt as f,X as g,vt as h,xt as i,Ln as j,kn as k,zt as l,Fe as m,Rn as n,ke as o,En as p,Vn as r,Le as s,Gt as u};
@@ -1 +1 @@
1
- import{a as $,r as g,j as e,L as I}from"./react-4iaCnQ6n.js";import{i as _,a as A,c as K,j as O,k as M,t as j,C as H,d as v,l as R,A as V,m as N,n as P,g as D,o as J,q as X,r as Z,s as ee,v as q,w as F,x as se,y as ae,z as te,B as re}from"./index-CfzzJJMt.js";import{f as z}from"./buy-DwyjMqAP.js";import{g as ce,b as ie,w as ne,G as le}from"./buy-gasless-op4cwmiR.js";import"./ethers-CU3Ctw5k.js";import"./index-As-Txuxb.js";function oe(a){const o=a,i=(o.message??"").toLowerCase();return o.code===4001||i.includes("reject")||i.includes("denied")||i.includes("cancel")?"You cancelled the request.":i.includes("insufficient")?`You don't have enough ${R.name} — get more first.`:i.includes("no active listing")||i.includes("your own listing")?o.message:"Couldn't complete checkout — please try again."}function de(a){return te(a.received[0].amount)}function fe(){const a=_(s=>s.items),o=_(s=>s.remove),i=_(s=>s.clear),U=_(s=>s.setFittingOpen),{session:t}=A(),Y=a.some(s=>s.category!=="emote"),{data:y}=K({queryKey:["upsell-listings"],queryFn:()=>re({first:40}),staleTime:6e4}),{data:l}=O(t),b=M(),G=$(),[C,m]=g.useState(null),[w,f]=g.useState(null),[h,k]=g.useState(!1),d=a.reduce((s,u)=>s+u.priceCredits,0),B=new Set(a.map(s=>s.id)),S=((y==null?void 0:y.items)??[]).filter(s=>!B.has(s.id)).slice(0,6);async function L(){if(!t){f("Sign in to check out.");return}f(null),k(!0),N("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:P(d),has_sufficient_credits:((l==null?void 0:l.credits)??0)>=d});const s=a.slice(),u=[];let x="authorize",E=!1;try{m("Preparing your order…");const c=[];for(const r of a){const p=r.tradeId?await D(r.tradeId):await J(r.contractAddress,r.itemId??"");if(!p)throw new Error(`No active listing for ${r.name}.`);if(X(p,t.address))throw new Error(`You can't buy your own listing: ${r.name}.`);const Q=de(p),{credit:T,maxCreditedValue:W}=await Z(t.identity,Q,r.tradeId);u.push(T.id),c.push({trade:p,credits:[T],maxCreditedValue:W})}m("Confirming your purchase…"),x="submit";let n=[];if(ce())try{n=await ie({purchases:c,buyer:t.address,signer:t.signer}),await Promise.all(n.map(r=>ne(r))),E=!0}catch(r){if(!(r instanceof le))throw r;n=await z({purchases:c,buyer:t.address,signer:t.signer})}else n=await z({purchases:c,buyer:t.address,signer:t.signer});i(),m("Purchased! 🎉"),N("Shop Completed Purchase",{...ee(s),payment_type:"credits",no_crypto_step:E,transaction_hash:n[0]??null}),b.invalidateQueries({queryKey:["usd-balance"]}),G("/success",{state:{items:s,txHash:n[0]}})}catch(c){if(q(c)||F(c,{flow:"cart_checkout",step:x,cart_size:a.length}),N(q(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:x,error_code:se(c),value_usd:P(d),cart_size:a.length}),u.length){try{await ae(t.identity,u)}catch(n){F(n,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}f(oe(c)),m(null)}finally{k(!1)}}return a.length===0?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"cart-empty__title",children:j("cart.empty.title")}),e.jsx("p",{className:"muted",children:j("cart.empty.body")}),e.jsx(I,{className:"btn btn--purple",to:"/assets",children:j("cart.empty.cta")})]}):e.jsxs("div",{className:"cart",children:[e.jsxs("h1",{children:["Cart (",a.length,")"]}),e.jsx("div",{className:"cart__list",children:a.map(s=>e.jsxs("div",{className:"cart__row",children:[e.jsx("div",{className:"cart__thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}),e.jsxs("div",{className:"cart__info",children:[e.jsx("div",{className:"cart__name",children:s.name}),s.creator?e.jsx(H,{address:s.creator,className:"cart__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"cart__price",children:[e.jsx(v,{className:"ccy-mark"})," ",s.priceCredits]}),e.jsx("button",{className:"cart__remove",onClick:()=>o(s.id),disabled:h,"aria-label":`Remove ${s.name}`,title:"Remove",children:e.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},s.id))}),e.jsxs("div",{className:"cart__foot",children:[e.jsxs("div",{className:"cart__total",children:[e.jsxs("div",{className:"cart__total-line",children:["Total ",e.jsxs("strong",{children:[e.jsx(v,{className:"ccy-mark"})," ",d]})]}),t?e.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",e.jsx(v,{className:"ccy-mark"})," ",(l==null?void 0:l.credits)??0]}):null]}),e.jsxs("div",{className:"cart__actions",children:[Y?e.jsx("button",{className:"btn btn--ghost",onClick:()=>U(!0),disabled:h,children:"Try on outfit"}):null,e.jsxs(I,{className:"btn btn--ghost",to:"/credits",children:["Get ",R.name]}),e.jsx("button",{className:"btn btn--purple cart__checkout",onClick:L,disabled:h,children:"Checkout"})]})]}),e.jsxs("div",{className:"cart__utils",children:[e.jsx("button",{className:"link",onClick:i,disabled:h,children:"Clear cart"}),null]}),C?e.jsx("p",{className:"muted",style:{marginTop:12},children:C}):null,w?e.jsx("p",{className:"error",style:{marginTop:12},children:w}):null,S.length>0?e.jsxs("section",{className:"row cart-upsell",children:[e.jsx("div",{className:"row__head",children:e.jsx("h2",{className:"row__title",children:"You might also like"})}),e.jsx("div",{className:"row__track",children:S.map(s=>e.jsx(V,{item:s},s.id))})]}):null]})}export{fe as Cart};
1
+ import{a as $,r as g,j as e,L as I}from"./react-Vu6nbGi5.js";import{i as _,a as A,c as K,j as O,k as M,t as j,C as H,d as v,l as R,A as V,m as N,n as P,g as D,o as J,q as X,r as Z,s as ee,v as q,w as F,x as se,y as ae,z as te,B as re}from"./index-BwiZgchN.js";import{f as z}from"./buy-BmZCwbRH.js";import{g as ce,b as ie,w as ne,G as le}from"./buy-gasless-BMlSkNzH.js";import"./ethers-DHDSyreX.js";import"./index-DxOJU9tq.js";function oe(a){const o=a,i=(o.message??"").toLowerCase();return o.code===4001||i.includes("reject")||i.includes("denied")||i.includes("cancel")?"You cancelled the request.":i.includes("insufficient")?`You don't have enough ${R.name} — get more first.`:i.includes("no active listing")||i.includes("your own listing")?o.message:"Couldn't complete checkout — please try again."}function de(a){return te(a.received[0].amount)}function fe(){const a=_(s=>s.items),o=_(s=>s.remove),i=_(s=>s.clear),U=_(s=>s.setFittingOpen),{session:t}=A(),Y=a.some(s=>s.category!=="emote"),{data:y}=K({queryKey:["upsell-listings"],queryFn:()=>re({first:40}),staleTime:6e4}),{data:l}=O(t),b=M(),G=$(),[C,m]=g.useState(null),[w,f]=g.useState(null),[h,k]=g.useState(!1),d=a.reduce((s,u)=>s+u.priceCredits,0),B=new Set(a.map(s=>s.id)),S=((y==null?void 0:y.items)??[]).filter(s=>!B.has(s.id)).slice(0,6);async function L(){if(!t){f("Sign in to check out.");return}f(null),k(!0),N("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:P(d),has_sufficient_credits:((l==null?void 0:l.credits)??0)>=d});const s=a.slice(),u=[];let x="authorize",E=!1;try{m("Preparing your order…");const c=[];for(const r of a){const p=r.tradeId?await D(r.tradeId):await J(r.contractAddress,r.itemId??"");if(!p)throw new Error(`No active listing for ${r.name}.`);if(X(p,t.address))throw new Error(`You can't buy your own listing: ${r.name}.`);const Q=de(p),{credit:T,maxCreditedValue:W}=await Z(t.identity,Q,r.tradeId);u.push(T.id),c.push({trade:p,credits:[T],maxCreditedValue:W})}m("Confirming your purchase…"),x="submit";let n=[];if(ce())try{n=await ie({purchases:c,buyer:t.address,signer:t.signer}),await Promise.all(n.map(r=>ne(r))),E=!0}catch(r){if(!(r instanceof le))throw r;n=await z({purchases:c,buyer:t.address,signer:t.signer})}else n=await z({purchases:c,buyer:t.address,signer:t.signer});i(),m("Purchased! 🎉"),N("Shop Completed Purchase",{...ee(s),payment_type:"credits",no_crypto_step:E,transaction_hash:n[0]??null}),b.invalidateQueries({queryKey:["usd-balance"]}),G("/success",{state:{items:s,txHash:n[0]}})}catch(c){if(q(c)||F(c,{flow:"cart_checkout",step:x,cart_size:a.length}),N(q(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:x,error_code:se(c),value_usd:P(d),cart_size:a.length}),u.length){try{await ae(t.identity,u)}catch(n){F(n,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}f(oe(c)),m(null)}finally{k(!1)}}return a.length===0?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"cart-empty__title",children:j("cart.empty.title")}),e.jsx("p",{className:"muted",children:j("cart.empty.body")}),e.jsx(I,{className:"btn btn--purple",to:"/assets",children:j("cart.empty.cta")})]}):e.jsxs("div",{className:"cart",children:[e.jsxs("h1",{children:["Cart (",a.length,")"]}),e.jsx("div",{className:"cart__list",children:a.map(s=>e.jsxs("div",{className:"cart__row",children:[e.jsx("div",{className:"cart__thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}),e.jsxs("div",{className:"cart__info",children:[e.jsx("div",{className:"cart__name",children:s.name}),s.creator?e.jsx(H,{address:s.creator,className:"cart__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"cart__price",children:[e.jsx(v,{className:"ccy-mark"})," ",s.priceCredits]}),e.jsx("button",{className:"cart__remove",onClick:()=>o(s.id),disabled:h,"aria-label":`Remove ${s.name}`,title:"Remove",children:e.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},s.id))}),e.jsxs("div",{className:"cart__foot",children:[e.jsxs("div",{className:"cart__total",children:[e.jsxs("div",{className:"cart__total-line",children:["Total ",e.jsxs("strong",{children:[e.jsx(v,{className:"ccy-mark"})," ",d]})]}),t?e.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",e.jsx(v,{className:"ccy-mark"})," ",(l==null?void 0:l.credits)??0]}):null]}),e.jsxs("div",{className:"cart__actions",children:[Y?e.jsx("button",{className:"btn btn--ghost",onClick:()=>U(!0),disabled:h,children:"Try on outfit"}):null,e.jsxs(I,{className:"btn btn--ghost",to:"/credits",children:["Get ",R.name]}),e.jsx("button",{className:"btn btn--purple cart__checkout",onClick:L,disabled:h,children:"Checkout"})]})]}),e.jsxs("div",{className:"cart__utils",children:[e.jsx("button",{className:"link",onClick:i,disabled:h,children:"Clear cart"}),null]}),C?e.jsx("p",{className:"muted",style:{marginTop:12},children:C}):null,w?e.jsx("p",{className:"error",style:{marginTop:12},children:w}):null,S.length>0?e.jsxs("section",{className:"row cart-upsell",children:[e.jsx("div",{className:"row__head",children:e.jsx("h2",{className:"row__title",children:"You might also like"})}),e.jsx("div",{className:"row__track",children:S.map(s=>e.jsx(V,{item:s},s.id))})]}):null]})}export{fe as Cart};
@@ -1,4 +1,4 @@
1
- import{g as N,a as U,u as w,_ as z,b as o,c as E,d as n,e as I,s as v,f as D,k as _}from"./generateUtilityClasses-DFV3l_aJ.js";import{r as F,j as g}from"./react-4iaCnQ6n.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=_(P||(P=l`
1
+ import{g as N,a as U,u as w,_ as z,b as o,c as E,d as n,e as I,s as v,f as D,k as _}from"./generateUtilityClasses-wRCEHwkd.js";import{r as F,j as g}from"./react-Vu6nbGi5.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=_(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1 +1 @@
1
- import{u as g,a as h,j as e}from"./react-4iaCnQ6n.js";import{C as x,A as j,f as _}from"./index-CfzzJJMt.js";import{A as N}from"./collection-Bpot6wpS.js";import{S as m}from"./SkeletonCards-D9qg3FUs.js";import{L as f}from"./LoadMore-Cae84rui.js";import{u as C}from"./useInfiniteGrid-lpWOvlaw.js";import"./ethers-CU3Ctw5k.js";const b=48;function F(){var i;const{contractAddress:o}=g(),d=h(),{items:s,total:t,isLoading:a,error:c,hasNextPage:u,isFetchingNextPage:n,fetchNextPage:p}=C(["collection-page",o],l=>_(o,{first:b,skip:l}),{enabled:!!o}),r=(i=s[0])==null?void 0:i.creator;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>d("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Collection"})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:"Collection"}),r?e.jsx(x,{address:r,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:a?"…":`${t.toLocaleString()} item${t===1?"":"s"}`})]}),!a&&s.length>0?e.jsx(N,{items:s,source:"collection"}):null,c?e.jsx("p",{className:"error",children:c.message}):null,e.jsx("div",{className:"grid",children:a?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[s.map(l=>e.jsx(j,{item:l},l.id)),n?e.jsx(m,{count:6}):null]})}),e.jsx(f,{hasNextPage:u,isFetching:n,onLoadMore:()=>p()}),!a&&!c&&s.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{F as Collection,F as default};
1
+ import{u as g,a as h,j as e}from"./react-Vu6nbGi5.js";import{C as x,A as j,f as _}from"./index-BwiZgchN.js";import{A as N}from"./collection-DjHYkCfI.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as f}from"./LoadMore-BOCtgPLI.js";import{u as C}from"./useInfiniteGrid-DQrjB0ET.js";import"./ethers-DHDSyreX.js";const b=48;function F(){var i;const{contractAddress:o}=g(),d=h(),{items:s,total:t,isLoading:a,error:c,hasNextPage:u,isFetchingNextPage:n,fetchNextPage:p}=C(["collection-page",o],l=>_(o,{first:b,skip:l}),{enabled:!!o}),r=(i=s[0])==null?void 0:i.creator;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>d("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Collection"})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:"Collection"}),r?e.jsx(x,{address:r,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:a?"…":`${t.toLocaleString()} item${t===1?"":"s"}`})]}),!a&&s.length>0?e.jsx(N,{items:s,source:"collection"}):null,c?e.jsx("p",{className:"error",children:c.message}):null,e.jsx("div",{className:"grid",children:a?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[s.map(l=>e.jsx(j,{item:l},l.id)),n?e.jsx(m,{count:6}):null]})}),e.jsx(f,{hasNextPage:u,isFetching:n,onLoadMore:()=>p()}),!a&&!c&&s.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{F as Collection,F as default};
@@ -1 +1 @@
1
- import{p as t}from"./ethers-CU3Ctw5k.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
1
+ import{p as t}from"./ethers-DHDSyreX.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
@@ -1 +1 @@
1
- import{j as e,u as g,a as p}from"./react-4iaCnQ6n.js";import{G as i,C as h,A as x,H as j}from"./index-CfzzJJMt.js";import{A as f}from"./collection-Bpot6wpS.js";import{S as m}from"./SkeletonCards-D9qg3FUs.js";import{L as N}from"./LoadMore-Cae84rui.js";import{u as b}from"./useInfiniteGrid-lpWOvlaw.js";import"./ethers-CU3Ctw5k.js";function _({address:s,className:r=""}){const o=i(t=>t.followed.includes(s.toLowerCase())),a=i(t=>t.toggle);return s?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?"Unfollow creator":"Follow creator",onClick:()=>a(s),children:o?"Following":"Follow"}):null}const C=48;function S(){const{address:s}=g(),r=p(),{items:o,total:a,isLoading:t,error:n,hasNextPage:u,isFetchingNextPage:c,fetchNextPage:d}=b(["creator-page",s],l=>j(s,{first:C,skip:l}),{enabled:!!s});return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Creator"})]}),e.jsxs("header",{className:"collection-page__head",children:[s?e.jsx(h,{address:s,className:"collection-page__title-creator"}):null,s?e.jsx(_,{address:s}):null,e.jsx("span",{className:"muted collection-page__count",children:t?"…":`${a.toLocaleString()} item${a===1?"":"s"}`})]}),!t&&o.length>0?e.jsx(f,{items:o,source:"creator"}):null,n?e.jsx("p",{className:"error",children:n.message}):null,e.jsx("div",{className:"grid",children:t?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[o.map(l=>e.jsx(x,{item:l},l.id)),c?e.jsx(m,{count:6}):null]})}),e.jsx(N,{hasNextPage:u,isFetching:c,onLoadMore:()=>d()}),!t&&!n&&o.length===0?e.jsx("p",{className:"muted",children:"This creator has no items to show yet."}):null]})}export{S as Creator,S as default};
1
+ import{j as e,u as g,a as p}from"./react-Vu6nbGi5.js";import{G as i,C as h,A as x,H as j}from"./index-BwiZgchN.js";import{A as f}from"./collection-DjHYkCfI.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as N}from"./LoadMore-BOCtgPLI.js";import{u as b}from"./useInfiniteGrid-DQrjB0ET.js";import"./ethers-DHDSyreX.js";function _({address:s,className:r=""}){const o=i(t=>t.followed.includes(s.toLowerCase())),a=i(t=>t.toggle);return s?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?"Unfollow creator":"Follow creator",onClick:()=>a(s),children:o?"Following":"Follow"}):null}const C=48;function S(){const{address:s}=g(),r=p(),{items:o,total:a,isLoading:t,error:n,hasNextPage:u,isFetchingNextPage:c,fetchNextPage:d}=b(["creator-page",s],l=>j(s,{first:C,skip:l}),{enabled:!!s});return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Creator"})]}),e.jsxs("header",{className:"collection-page__head",children:[s?e.jsx(h,{address:s,className:"collection-page__title-creator"}):null,s?e.jsx(_,{address:s}):null,e.jsx("span",{className:"muted collection-page__count",children:t?"…":`${a.toLocaleString()} item${a===1?"":"s"}`})]}),!t&&o.length>0?e.jsx(f,{items:o,source:"creator"}):null,n?e.jsx("p",{className:"error",children:n.message}):null,e.jsx("div",{className:"grid",children:t?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[o.map(l=>e.jsx(x,{item:l},l.id)),c?e.jsx(m,{count:6}):null]})}),e.jsx(N,{hasNextPage:u,isFetching:c,onLoadMore:()=>d()}),!t&&!n&&o.length===0?e.jsx("p",{className:"muted",children:"This creator has no items to show yet."}):null]})}export{S as Creator,S as default};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-_PrcmI1q.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-6zlIHhqj.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-DFy8mL1o.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BBKLOgxD.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1 +1 @@
1
- import{r as N,j as e}from"./react-4iaCnQ6n.js";const k=["common","uncommon","rare","epic","legendary","mythic","unique","exotic"],y=[{key:"newest",label:"Newest",server:"newest"},{key:"price-asc",label:"Price: Low to High",server:"cheapest"},{key:"price-desc",label:"Price: High to Low",server:"most_expensive"},{key:"name",label:"Name (A–Z)",server:"name"}];function _({panelKey:a,label:o,active:p,badge:t,align:h="left",panel:c,children:r}){const i=c.open===a,n=h==="right"?"filterbar__sort":"filterbar__trigger";return e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`${n}${i?" is-open":""}${p?" is-active":""}`,onClick:()=>c.toggle(a),children:[o," ",t?e.jsx("span",{className:"filterbar__badge",children:t}):null," ",e.jsx("span",{className:`ico ico-chevron filterbar__chev${i?" is-up":""}`,"aria-hidden":!0})]}),i?r:null]})}function $({rarities:a,onToggleRarity:o,rarityOptions:p=k,sort:t,onSort:h,sortOptions:c=y,total:r,loading:i,query:n,anyActive:f,onClear:d,renderLeading:m,renderTrailing:b}){const[x,u]=N.useState(null),s={open:x,toggle:l=>u(v=>v===l?null:l),close:()=>u(null)},j=c.find(l=>l.key===t)??c[0];return e.jsxs(e.Fragment,{children:[x?e.jsx("div",{className:"filterbar__scrim",onClick:s.close,"aria-hidden":!0}):null,e.jsxs("div",{className:"filterbar",children:[e.jsxs("div",{className:"filterbar__filters",children:[m==null?void 0:m(s),e.jsx(_,{panelKey:"rarity",label:"Rarity",active:a.length>0,badge:a.length||void 0,panel:s,children:e.jsx("div",{className:"filter-pop filter-pop--rarity",children:p.map(l=>e.jsxs("label",{className:"filter-pop__check",children:[e.jsx("input",{type:"checkbox",checked:a.includes(l),onChange:()=>o(l)}),e.jsx("span",{children:l})]},l))})}),b==null?void 0:b(s),f?e.jsx("button",{className:"filterbar__clear",onClick:()=>{d(),s.close()},children:"Clear all"}):null]}),e.jsxs("div",{className:"filterbar__right",children:[e.jsxs("span",{className:"filterbar__count",children:[i?"…":`${r.toLocaleString()} item${r===1?"":"s"}`,n?` for “${n}”`:""]}),e.jsx(_,{panelKey:"sort",label:`Sort by: ${j.label}`,align:"right",panel:s,children:e.jsx("div",{className:"filter-pop filter-pop--sort",children:c.map(l=>e.jsx("button",{className:`filter-pop__sort${l.key===t?" is-active":""}`,onClick:()=>{h(l.key),s.close()},children:l.label},l.key))})})]})]})]})}export{$ as F,y as S,_ as a};
1
+ import{r as N,j as e}from"./react-Vu6nbGi5.js";const k=["common","uncommon","rare","epic","legendary","mythic","unique","exotic"],y=[{key:"newest",label:"Newest",server:"newest"},{key:"price-asc",label:"Price: Low to High",server:"cheapest"},{key:"price-desc",label:"Price: High to Low",server:"most_expensive"},{key:"name",label:"Name (A–Z)",server:"name"}];function _({panelKey:a,label:o,active:p,badge:t,align:h="left",panel:c,children:r}){const i=c.open===a,n=h==="right"?"filterbar__sort":"filterbar__trigger";return e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`${n}${i?" is-open":""}${p?" is-active":""}`,onClick:()=>c.toggle(a),children:[o," ",t?e.jsx("span",{className:"filterbar__badge",children:t}):null," ",e.jsx("span",{className:`ico ico-chevron filterbar__chev${i?" is-up":""}`,"aria-hidden":!0})]}),i?r:null]})}function $({rarities:a,onToggleRarity:o,rarityOptions:p=k,sort:t,onSort:h,sortOptions:c=y,total:r,loading:i,query:n,anyActive:f,onClear:d,renderLeading:m,renderTrailing:b}){const[x,u]=N.useState(null),s={open:x,toggle:l=>u(v=>v===l?null:l),close:()=>u(null)},j=c.find(l=>l.key===t)??c[0];return e.jsxs(e.Fragment,{children:[x?e.jsx("div",{className:"filterbar__scrim",onClick:s.close,"aria-hidden":!0}):null,e.jsxs("div",{className:"filterbar",children:[e.jsxs("div",{className:"filterbar__filters",children:[m==null?void 0:m(s),e.jsx(_,{panelKey:"rarity",label:"Rarity",active:a.length>0,badge:a.length||void 0,panel:s,children:e.jsx("div",{className:"filter-pop filter-pop--rarity",children:p.map(l=>e.jsxs("label",{className:"filter-pop__check",children:[e.jsx("input",{type:"checkbox",checked:a.includes(l),onChange:()=>o(l)}),e.jsx("span",{children:l})]},l))})}),b==null?void 0:b(s),f?e.jsx("button",{className:"filterbar__clear",onClick:()=>{d(),s.close()},children:"Clear all"}):null]}),e.jsxs("div",{className:"filterbar__right",children:[e.jsxs("span",{className:"filterbar__count",children:[i?"…":`${r.toLocaleString()} item${r===1?"":"s"}`,n?` for “${n}”`:""]}),e.jsx(_,{panelKey:"sort",label:`Sort by: ${j.label}`,align:"right",panel:s,children:e.jsx("div",{className:"filter-pop filter-pop--sort",children:c.map(l=>e.jsx("button",{className:`filter-pop__sort${l.key===t?" is-active":""}`,onClick:()=>{h(l.key),s.close()},children:l.label},l.key))})})]})]})]})}export{$ as F,y as S,_ as a};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-Emv2rnKJ.js","assets/react-Vu6nbGi5.js","assets/index-BwiZgchN.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css"])))=>i.map(i=>d[i]);
2
+ import{R as P,h as y,S as F,a as O,k as V,m as _,w as v,x as S,l as u,d as C,K as $,_ as K}from"./index-BwiZgchN.js";import{a as Y,r as l,j as e}from"./react-Vu6nbGi5.js";import{C as N}from"./CircularProgress-BtAdS3mK.js";import"./ethers-DHDSyreX.js";import"./generateUtilityClasses-wRCEHwkd.js";function R(){return y.shopServerUrl||y.creditsServerUrl}async function z(t,s){const r=await P(`${R()}/credits/checkout`,{method:"POST",identity:s,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({packId:t})});if(!r.ok)throw new Error(`checkout ${r.status}: ${await r.text()}`);const{orderId:a,clientSecret:n}=await r.json();return{orderId:a,clientSecret:n,mock:!1}}async function L(t,s,r={}){const{intervalMs:a=1500,timeoutMs:n=6e4,signal:i}=r,c=Date.now()+n;for(;;){if(i!=null&&i.aborted)throw new DOMException("Aborted","AbortError");const m=await q(t,s,i);if(m.status!=="processing")return m;if(Date.now()>c)return{status:"failed",error:"Timed out waiting for your credits."};await J(a,i)}}async function q(t,s,r){const a=await P(`${R()}/credits/orders/${t}`,{method:"GET",identity:s,metadata:{},signal:r});if(!a.ok)throw new Error(`order status ${a.status}`);return a.json()}function J(t,s){return new Promise((r,a)=>{const n=setTimeout(r,t);s==null||s.addEventListener("abort",()=>{clearTimeout(n),a(new DOMException("Aborted","AbortError"))})})}const Q=.1,G=[{id:"pack_5",usd:5,credits:x(5)},{id:"pack_10",usd:10,credits:x(10)},{id:"pack_25",usd:25,credits:x(25),bestValue:!0},{id:"pack_50",usd:50,credits:x(50)}];function x(t){return Math.round(t/Q)}function T(t){return G.find(s=>s.id===t)}const j="mock_cs_";function M(){return!y.stripePublishableKey||!y.shopServerUrl}async function W(t,s){const r=T(t);if(!r)throw new Error("Unknown pack");if(M())return H(r);if(!(s!=null&&s.identity))throw new Error("Sign in to get credits.");return z(t,s.identity)}async function X(t,s={}){const{intervalMs:r,timeoutMs:a,signal:n,identity:i}=s;if(t.startsWith(j)||M())return Z(t,s);if(!i)throw new Error("Sign in to get credits.");return L(t,i,{intervalMs:r,timeoutMs:a,signal:n})}function H(t){const s=`${j}${t.id}_${Date.now()}`;return D(400).then(()=>({orderId:s,clientSecret:`${j}${t.id}`,mock:!0}))}async function Z(t,s={}){await D(s.intervalMs??900);const r=t.replace(j,"").replace(/_\d+$/,""),a=T(r),n=(a==null?void 0:a.credits)??0;if(s.address&&a)try{const i=await F(s.address,Math.round(a.usd*100));return{status:"credited",creditsGranted:n,newBalance:i.credits}}catch(i){return{status:"failed",error:i.message}}return{status:"credited",creditsGranted:n,newBalance:n}}function D(t,s){return new Promise((r,a)=>{setTimeout(r,t)})}const b=y.shopServerUrl?"stripe":"mock",ee=l.lazy(()=>K(()=>import("./RealCheckout-Emv2rnKJ.js"),__vite__mapDeps([0,1,2,3,4])));function E(t){const s=t;if((s==null?void 0:s.name)==="AbortError")return"You cancelled the request.";const r=((s==null?void 0:s.message)??"").toLowerCase();return r.includes("sign in")?`Sign in to get ${u.name}.`:r.includes("timed out")?`This is taking longer than usual — your ${u.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function oe(){const t=Y(),{session:s,signIn:r}=O(),a=V(),[n,i]=l.useState("select"),[c,m]=l.useState(null),[h,k]=l.useState(null),[I,w]=l.useState(null),[A,p]=l.useState(null),f=l.useRef(null);l.useEffect(()=>()=>{var d;return(d=f.current)==null?void 0:d.abort()},[]);const B=l.useCallback(async d=>{if(!s){r();return}p(null),m(d),i("paying"),_("Shop Started Buy Credits",{pack_usd:d.usd,credits:d.credits,provider:b});try{const o=await W(d.id,{address:s.address,identity:s.identity});k(o)}catch(o){v(o,{flow:"get_credits",step:"checkout",provider:b}),_("Shop Buy Credits Failed",{step:"checkout",error_code:S(o),pack_usd:d.usd}),p(E(o)),i("error")}},[s,r]),U=l.useCallback(async()=>{if(!h)return;i("processing");const d=new AbortController;f.current=d;try{const o=await X(h.orderId,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});o.status==="credited"?(w(o.creditsGranted??(c==null?void 0:c.credits)??0),i("success"),_("Shop Completed Buy Credits",{order_id:h.orderId,pack_usd:(c==null?void 0:c.usd)??null,credits:o.creditsGranted??(c==null?void 0:c.credits)??0,provider:b}),a.invalidateQueries({queryKey:["usd-balance"]})):(_("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),p(o.error??`Couldn't add your ${u.name} — please try again.`),i("error"))}catch(o){v(o,{flow:"get_credits",step:"grant",order_id:h.orderId}),_("Shop Buy Credits Failed",{step:"grant",error_code:S(o),pack_usd:(c==null?void 0:c.usd)??null}),p(E(o)),i("error")}},[h,c,s,a]);function g(){var d;(d=f.current)==null||d.abort(),i("select"),m(null),k(null),w(null),p(null)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",u.name]}),e.jsxs("p",{className:"muted",children:["Add ",u.name," to your account to shop. Pay with any card."]})]}),s?e.jsxs(e.Fragment,{children:[n==="select"&&e.jsx(se,{onSelect:B}),n==="paying"&&c&&e.jsx(te,{pack:c,checkout:h,onPaid:U,onCancel:g}),n==="processing"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:40}),e.jsxs("p",{className:"getcredits__status-title",children:["Adding your ",u.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),n==="success"&&e.jsxs("div",{className:"getcredits__status getcredits__status--ok",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"getcredits__confetti","aria-hidden":!0,children:"🎉"}),e.jsx("p",{className:"getcredits__status-title",children:"You’re all set!"}),e.jsxs("p",{className:"muted",children:[e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",I]})," ",u.name," added to your account."]}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>t("/cart"),children:"Back to cart"}),e.jsxs("button",{className:"btn btn--ghost",onClick:g,children:["Get more ",u.name]})]})]}),n==="error"&&e.jsxs("div",{className:"getcredits__status getcredits__status--err",role:"alert",children:[e.jsx("p",{className:"getcredits__status-title",children:"Something went wrong"}),e.jsx("p",{className:"error",children:A}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn",onClick:g,children:"Try again"})})]})]}):e.jsxs("div",{className:"getcredits__status",role:"status",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Sign in to get ",u.name]}),e.jsxs("p",{className:"muted",children:["Connect your account to buy ",u.name," and start shopping."]}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn btn--purple",onClick:r,children:"Sign in"})})]})]})}function se({onSelect:t}){return e.jsx("div",{className:"packs",children:G.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,onClick:()=>t(s),"aria-label":`Get ${$(s.credits)} for $${s.usd}`,children:[s.bestValue&&e.jsx("span",{className:"pack__ribbon",children:"Best value"}),e.jsxs("span",{className:"pack__credits",children:[e.jsx(C,{className:"pack__credits-ico"}),s.credits]}),e.jsx("span",{className:"pack__label",children:u.name}),e.jsxs("span",{className:"pack__price",children:["$",s.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",u.name]})]},s.id))})}function te({pack:t,checkout:s,onPaid:r,onCancel:a}){return e.jsxs("div",{className:"pay",children:[e.jsxs("div",{className:"pay__summary",children:[e.jsx("button",{className:"link",onClick:a,children:"← Choose a different pack"}),e.jsxs("div",{className:"pay__summary-row",children:[e.jsx("span",{children:"You’ll get"}),e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",$(t.credits)]})]}),e.jsxs("div",{className:"pay__summary-row pay__summary-row--total",children:[e.jsx("span",{children:"You pay"}),e.jsxs("strong",{children:["$",t.usd]})]})]}),e.jsx("div",{className:"pay__form",children:s?s.mock?e.jsx(re,{onPaid:r,amountUsd:t.usd}):e.jsx(l.Suspense,{fallback:e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]}),children:e.jsx(ee,{clientSecret:s.clientSecret,onComplete:r})}):e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]})})]})}function re({onPaid:t,amountUsd:s}){const[r,a]=l.useState("4242 4242 4242 4242"),[n,i]=l.useState(!1);function c(){i(!0),setTimeout(()=>t(),700)}return e.jsxs("div",{className:"card-form","aria-label":"Payment details",children:[e.jsx("p",{className:"muted small card-form__note",children:"Demo mode — no real charge is made."}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Card number"}),e.jsx("input",{value:r,onChange:m=>a(m.target.value),disabled:n,inputMode:"numeric"})]}),e.jsxs("div",{className:"card-form__row",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Expiry"}),e.jsx("input",{defaultValue:"12 / 34",disabled:n})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"CVC"}),e.jsx("input",{defaultValue:"123",disabled:n,inputMode:"numeric"})]})]}),e.jsx("button",{className:"btn btn--purple card-form__pay",onClick:c,disabled:n,children:n?"Processing…":`Pay $${s}`})]})}export{oe as GetCredits,oe as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-UKUxTJut.js";import{d as g,r as v}from"./index-6zlIHhqj.js";import{C as c}from"./ConstantsUtil-DOBrEopM.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-_PrcmI1q.js";import{au as y}from"./NetworkUtil-aE1iGnVj.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-DXx-pvKF.js";import{d as g,r as v}from"./index-BBKLOgxD.js";import{C as c}from"./ConstantsUtil-DrWe0yob.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-DFy8mL1o.js";import{au as y}from"./NetworkUtil-Ddexw9-U.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1 +1 @@
1
- import{a as E,r as d,j as e,L as M}from"./react-4iaCnQ6n.js";import{m as Q,w as A,l as w,d as v,a as K,k as F,c as P,I as R}from"./index-CfzzJJMt.js";import{i as W,f as Y}from"./import-C06P5lQP.js";import{s as O}from"./wallet-kind-CgOBZALj.js";import"./ethers-CU3Ctw5k.js";import"./buy-DwyjMqAP.js";import"./index-As-Txuxb.js";import"./mana-rate-B_AigQrJ.js";function B({queue:n,session:k,onClose:j,onDone:u}){const N=E(),l=O(k.providerType),[c,f]=d.useState(()=>n.map(()=>"pending")),[y,C]=d.useState("running"),I=d.useRef(!1);d.useEffect(()=>{if(I.current)return;I.current=!0;let a=!1;return(async()=>{for(let i=0;i<n.length;i++){if(a)return;f(o=>o.map((p,h)=>h===i?"active":p));try{await W(n[i].item,n[i].priceCredits,k),Q("Shop Migrated Listing",{item_id:n[i].item.itemId??n[i].item.oldTradeId??null,contract_address:n[i].item.contractAddress,new_price_credits:n[i].priceCredits,new_price_usd:n[i].priceCredits/10}),a||f(o=>o.map((p,h)=>h===i?"done":p))}catch(o){const p=o,h=p.code===4001||/reject|denied|cancel/i.test(p.message??"");h||A(o,{flow:"import_listing",itemId:n[i].item.itemId??n[i].item.oldTradeId}),a||f(S=>S.map((T,t)=>t===i?h?"skipped":"failed":T))}}a||C("finished")})(),()=>{a=!0}},[]);const m=c.filter(a=>a==="done").length,g=c.findIndex(a=>a==="active"),_=Math.round(c.filter(a=>a!=="pending"&&a!=="active").length/n.length*100);function x(){u(),j()}if(y==="finished"){const a=c.filter(i=>i==="skipped"||i==="failed").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:m>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[m>0?`${m} ${m===1?"item is":"items are"} now for sale with ${w.name}.`:"No items were listed.",a>0?` ${a} skipped — you can try those again anytime.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:x,children:"Done"}),m>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{u(),j(),N("/assets")},children:"View in Shop"}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:"Listing your items"}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[l?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",g>=0?`${g+1} of ${n.length}`:""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${_}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((a,i)=>e.jsxs("li",{className:`migrate__row migrate__row--${c[i]}`,children:[e.jsx("span",{className:"migrate__thumb",children:a.item.thumbnail?e.jsx("img",{src:a.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:a.item.name,children:a.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",a.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:c[i]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",l?"Confirm…":"Adding…"]}):c[i]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):c[i]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):c[i]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},a.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:l?"A couple of quick confirmations pop up per item (take down + re-list). Keep this open.":"This only takes a moment — keep this open."})]})})}const D=[{key:"creations",title:"Your creations",sub:"Items you made. Put them on sale in the Shop."},{key:"owned",title:"Items you own",sub:"Things you've bought elsewhere — resell them in the Shop."}];function q(){const{session:n,signIn:k,restore:j}=K(),u=F(),N=n==null?void 0:n.address;d.useEffect(()=>{j()},[j]);const{data:l,isLoading:c}=P({queryKey:["importable",N],queryFn:()=>Y(N),enabled:!!N}),[f,y]=d.useState({}),[C,I]=d.useState(new Set),[m,g]=d.useState(null),_=d.useMemo(()=>[...(l==null?void 0:l.creations)??[],...(l==null?void 0:l.owned)??[]],[l]);d.useEffect(()=>{_.length&&y(t=>{const r={...t};for(const s of _)r[s.oldTradeId]==null&&(r[s.oldTradeId]=s.suggestedCredits);return r})},[_]);const x=t=>!C.has(t),a=t=>f[t.oldTradeId]??t.suggestedCredits,i=_.filter(t=>x(t.oldTradeId)),o=i.reduce((t,r)=>t+a(r),0);function p(t,r){const s=r.replace(/[^\d]/g,"");y(b=>({...b,[t]:s===""?0:parseInt(s,10)}))}function h(t){I(r=>{const s=new Set(r);return s.has(t)?s.delete(t):s.add(t),s})}function S(t){return t.map(r=>({item:r,priceCredits:Math.max(1,a(r))}))}function T(){u.invalidateQueries({queryKey:["importable"]}),u.invalidateQueries({queryKey:["listings"]}),u.invalidateQueries({queryKey:["my-assets"]}),u.invalidateQueries({queryKey:["collection-sale-state"]}),R.success("Your Shop is updated.")}return n?!c&&_.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:"You're all caught up"}),e.jsx("p",{className:"muted",children:"Everything you sell is already in the Shop — nothing to import."}),e.jsx(M,{className:"btn btn--purple",to:"/my-assets",children:"Go to My Assets"})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:"Import to the Shop"}),e.jsxs("h1",{className:"imp__title",children:["Bring your listings ",e.jsx("span",{className:"imp__grad",children:"into the Shop"})]}),e.jsxs("p",{className:"imp__lede",children:["These items are already for sale elsewhere. We suggested a price in ",w.name," for each — matched to today's rate and rounded up. Adjust anything, then list them."]})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," 1 ",w.nameSingular," = $0.10 · prices rounded up"]}),c?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},r))}):D.map(t=>{const r=(l==null?void 0:l[t.key])??[];return r.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:t.title}),e.jsx("span",{className:"imp__section-sub",children:t.sub})]}),e.jsx("div",{className:"imp__list",children:r.map(s=>{const b=a(s),L=b!==s.suggestedCredits;return e.jsxs("article",{className:`imp-row${x(s.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:x(s.oldTradeId),onChange:()=>h(s.oldTradeId),"aria-label":`Include ${s.name}`}),e.jsx("div",{className:"imp-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:s.name,children:s.name||"Item"}),e.jsx("span",{className:"imp-chip",children:s.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(v,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:b.toLocaleString(),onChange:$=>p(s.oldTradeId,$.target.value),"aria-label":`Price in ${w.name} for ${s.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(b*.1).toFixed(2)]}),L?e.jsxs("button",{className:"imp-price__reset",onClick:()=>y($=>({...$,[s.oldTradeId]:s.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!x(s.oldTradeId),onClick:()=>g(S([s])),children:"List"})})]},s.oldTradeId)})})]},t.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," ",o.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[i.length," item",i.length===1?"":"s"," selected · $",(o*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:i.length===0,onClick:()=>g(S(i)),children:["List all (",i.length,")"]})]})}),m&&n?e.jsx(B,{queue:m,session:n,onClose:()=>g(null),onDone:T}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:"Import your listings"}),e.jsx("p",{className:"muted",children:"Sign in to bring the items you already sell into the Shop."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>k(),children:"Sign in"})]})}export{q as ImportListings};
1
+ import{a as E,r as d,j as e,L as M}from"./react-Vu6nbGi5.js";import{m as Q,w as A,l as w,d as v,a as K,k as F,c as P,I as R}from"./index-BwiZgchN.js";import{i as W,f as Y}from"./import-DXI6xe8g.js";import{s as O}from"./wallet-kind-DKOf0fdN.js";import"./ethers-DHDSyreX.js";import"./buy-BmZCwbRH.js";import"./index-DxOJU9tq.js";import"./mana-rate-DwCj8Lv7.js";function B({queue:n,session:k,onClose:j,onDone:u}){const N=E(),l=O(k.providerType),[c,f]=d.useState(()=>n.map(()=>"pending")),[y,C]=d.useState("running"),I=d.useRef(!1);d.useEffect(()=>{if(I.current)return;I.current=!0;let a=!1;return(async()=>{for(let i=0;i<n.length;i++){if(a)return;f(o=>o.map((p,h)=>h===i?"active":p));try{await W(n[i].item,n[i].priceCredits,k),Q("Shop Migrated Listing",{item_id:n[i].item.itemId??n[i].item.oldTradeId??null,contract_address:n[i].item.contractAddress,new_price_credits:n[i].priceCredits,new_price_usd:n[i].priceCredits/10}),a||f(o=>o.map((p,h)=>h===i?"done":p))}catch(o){const p=o,h=p.code===4001||/reject|denied|cancel/i.test(p.message??"");h||A(o,{flow:"import_listing",itemId:n[i].item.itemId??n[i].item.oldTradeId}),a||f(S=>S.map((T,t)=>t===i?h?"skipped":"failed":T))}}a||C("finished")})(),()=>{a=!0}},[]);const m=c.filter(a=>a==="done").length,g=c.findIndex(a=>a==="active"),_=Math.round(c.filter(a=>a!=="pending"&&a!=="active").length/n.length*100);function x(){u(),j()}if(y==="finished"){const a=c.filter(i=>i==="skipped"||i==="failed").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:m>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[m>0?`${m} ${m===1?"item is":"items are"} now for sale with ${w.name}.`:"No items were listed.",a>0?` ${a} skipped — you can try those again anytime.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:x,children:"Done"}),m>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{u(),j(),N("/assets")},children:"View in Shop"}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:"Listing your items"}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[l?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",g>=0?`${g+1} of ${n.length}`:""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${_}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((a,i)=>e.jsxs("li",{className:`migrate__row migrate__row--${c[i]}`,children:[e.jsx("span",{className:"migrate__thumb",children:a.item.thumbnail?e.jsx("img",{src:a.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:a.item.name,children:a.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",a.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:c[i]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",l?"Confirm…":"Adding…"]}):c[i]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):c[i]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):c[i]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},a.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:l?"A couple of quick confirmations pop up per item (take down + re-list). Keep this open.":"This only takes a moment — keep this open."})]})})}const D=[{key:"creations",title:"Your creations",sub:"Items you made. Put them on sale in the Shop."},{key:"owned",title:"Items you own",sub:"Things you've bought elsewhere — resell them in the Shop."}];function q(){const{session:n,signIn:k,restore:j}=K(),u=F(),N=n==null?void 0:n.address;d.useEffect(()=>{j()},[j]);const{data:l,isLoading:c}=P({queryKey:["importable",N],queryFn:()=>Y(N),enabled:!!N}),[f,y]=d.useState({}),[C,I]=d.useState(new Set),[m,g]=d.useState(null),_=d.useMemo(()=>[...(l==null?void 0:l.creations)??[],...(l==null?void 0:l.owned)??[]],[l]);d.useEffect(()=>{_.length&&y(t=>{const r={...t};for(const s of _)r[s.oldTradeId]==null&&(r[s.oldTradeId]=s.suggestedCredits);return r})},[_]);const x=t=>!C.has(t),a=t=>f[t.oldTradeId]??t.suggestedCredits,i=_.filter(t=>x(t.oldTradeId)),o=i.reduce((t,r)=>t+a(r),0);function p(t,r){const s=r.replace(/[^\d]/g,"");y(b=>({...b,[t]:s===""?0:parseInt(s,10)}))}function h(t){I(r=>{const s=new Set(r);return s.has(t)?s.delete(t):s.add(t),s})}function S(t){return t.map(r=>({item:r,priceCredits:Math.max(1,a(r))}))}function T(){u.invalidateQueries({queryKey:["importable"]}),u.invalidateQueries({queryKey:["listings"]}),u.invalidateQueries({queryKey:["my-assets"]}),u.invalidateQueries({queryKey:["collection-sale-state"]}),R.success("Your Shop is updated.")}return n?!c&&_.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:"You're all caught up"}),e.jsx("p",{className:"muted",children:"Everything you sell is already in the Shop — nothing to import."}),e.jsx(M,{className:"btn btn--purple",to:"/my-assets",children:"Go to My Assets"})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:"Import to the Shop"}),e.jsxs("h1",{className:"imp__title",children:["Bring your listings ",e.jsx("span",{className:"imp__grad",children:"into the Shop"})]}),e.jsxs("p",{className:"imp__lede",children:["These items are already for sale elsewhere. We suggested a price in ",w.name," for each — matched to today's rate and rounded up. Adjust anything, then list them."]})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," 1 ",w.nameSingular," = $0.10 · prices rounded up"]}),c?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},r))}):D.map(t=>{const r=(l==null?void 0:l[t.key])??[];return r.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:t.title}),e.jsx("span",{className:"imp__section-sub",children:t.sub})]}),e.jsx("div",{className:"imp__list",children:r.map(s=>{const b=a(s),L=b!==s.suggestedCredits;return e.jsxs("article",{className:`imp-row${x(s.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:x(s.oldTradeId),onChange:()=>h(s.oldTradeId),"aria-label":`Include ${s.name}`}),e.jsx("div",{className:"imp-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:s.name,children:s.name||"Item"}),e.jsx("span",{className:"imp-chip",children:s.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(v,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:b.toLocaleString(),onChange:$=>p(s.oldTradeId,$.target.value),"aria-label":`Price in ${w.name} for ${s.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(b*.1).toFixed(2)]}),L?e.jsxs("button",{className:"imp-price__reset",onClick:()=>y($=>({...$,[s.oldTradeId]:s.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!x(s.oldTradeId),onClick:()=>g(S([s])),children:"List"})})]},s.oldTradeId)})})]},t.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," ",o.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[i.length," item",i.length===1?"":"s"," selected · $",(o*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:i.length===0,onClick:()=>g(S(i)),children:["List all (",i.length,")"]})]})}),m&&n?e.jsx(B,{queue:m,session:n,onClose:()=>g(null),onDone:T}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:"Import your listings"}),e.jsx("p",{className:"muted",children:"Sign in to bring the items you already sell into the Shop."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>k(),children:"Sign in"})]})}export{q as ImportListings};
@@ -0,0 +1 @@
1
+ .item-detail{max-width:1721px;margin:0 auto}.item-detail__crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:22px}.item-detail__crumb-link{background:none;border:0;padding:0;font:inherit;color:var(--muted)}.item-detail__crumb-link:hover{color:var(--text)}.item-detail__crumb-sep{color:var(--muted-2)}.item-detail__crumb-current{color:var(--text);font-weight:600}.item-detail__main{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(320px,522px);gap:40px;align-items:start}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr}}.item-detail__preview{position:relative;height:min(752px,70vh);border-radius:var(--radius-card);overflow:hidden;background:var(--media)}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;display:inline-flex;gap:2px;padding:3px;background:#ffffffeb;border:1px solid var(--line);border-radius:999px;box-shadow:0 1px 4px #0000001f}.item-preview__toggle button{border:0;background:none;cursor:pointer;padding:6px 16px;border-radius:999px;font-weight:600;font-size:13px;color:var(--muted);transition:background .12s ease,color .12s ease}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:not(.is-active):hover{color:var(--text)}.item-detail__preview>.item-preview__emote-controls{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:92%;display:flex;align-items:center;background:#ffffffeb;border:1px solid var(--line);border-radius:12px;padding:6px 10px;box-shadow:0 1px 4px #0000001f}.item-detail__preview>.item-preview__note{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:88%;margin:0;text-align:center;background:#161518c7;color:#fff;font-size:12px;font-weight:500;padding:6px 12px;border-radius:999px}.item-detail__description{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:1.55;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}.item-detail__desc-text.is-expanded{-webkit-line-clamp:unset;overflow:visible}.item-detail__desc-toggle{font-size:13px;align-self:flex-start}.item-detail__info{display:flex;flex-direction:column;gap:14px}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:clamp(24px,2.4vw,34px);font-weight:700;line-height:1.15;color:var(--text)}.item-detail__fav{flex:none;width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:#fff;display:grid;place-items:center;color:var(--text)}.item-detail__fav{cursor:pointer;transition:color .12s ease,border-color .12s ease}.item-detail__fav.is-on{color:var(--dcl-red);border-color:var(--dcl-red)}.item-detail__fav .ico-heart{width:18px;height:18px}.item-detail__creator{color:var(--muted);font-size:14px;margin-top:-6px}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.item-detail__card{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius-card);padding:20px;display:flex;flex-direction:column;gap:16px;background:#fff}.item-detail__price-block{display:flex;flex-direction:column;gap:6px}.item-detail__price-label{font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text-2)}.item-detail__diamond{width:28px;height:28px;color:var(--text-2)}.item-detail__price-value{font-size:34px;line-height:1}.item-detail__price--none{font-size:18px;color:var(--muted)}.item-detail__price--sale{flex-wrap:wrap;gap:10px 14px}.item-detail__price--sale .item-detail__price,.item-detail__price--sale .item-detail__price-value,.item-detail__price--sale .item-detail__diamond{color:var(--dcl-red)}.item-detail__price-was{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:line-through;font-weight:600;font-size:20px}.item-detail__diamond--was{width:18px;height:18px;color:var(--muted)}.item-detail__sale-badge{display:inline-flex;align-items:center;background:var(--dcl-red);color:#fff;font-weight:800;font-size:13px;letter-spacing:.03em;text-transform:uppercase;border-radius:6px;padding:4px 10px}.item-detail__countdown{display:inline-flex;align-items:center;gap:5px;background:var(--rarity-bg);color:var(--accent);font-size:13px;font-weight:700;border-radius:6px;padding:4px 10px;white-space:nowrap}.item-detail__countdown .sale-countdown__ico{width:14px;height:14px}.item-detail__balance{font-size:13px}.item-detail__ctas{display:flex;flex-direction:column;gap:12px}.item-detail__cta{width:100%;height:44px;text-align:center}.item-detail__addcart{width:100%;height:44px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:var(--radius-btn);font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.046em}.item-detail__addcart:disabled{opacity:.55;cursor:default}.item-detail__addcart-ico{width:20px;height:20px}.item-detail__status{margin:0;font-size:13px}.item-detail__own-note{margin:0;font-size:14px}.item-detail__own-note a{color:var(--accent);font-weight:600}.collection-carousel{margin-top:56px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:20px;font-weight:600;color:var(--text)}.collection-carousel__head-right{display:flex;align-items:center;gap:16px}.collection-carousel__viewall{background:none;border:0;padding:0;color:var(--accent);font-weight:600;font-size:13px;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__arrows{display:flex;gap:10px}.collection-carousel__arrow{width:44px;height:44px;border-radius:50%;border:0;background:#fff;color:var(--text);font-size:22px;line-height:1;display:grid;place-items:center;box-shadow:0 6px 16px #16151829;transition:transform .12s ease,box-shadow .12s ease}.collection-carousel__arrow:hover{transform:scale(1.06);box-shadow:0 8px 20px #16151833}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}.collection-carousel__track{display:flex;gap:16px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x proximity}.collection-carousel__card{flex:0 0 220px;scroll-snap-align:start;text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius-card);overflow:hidden;padding:0;display:flex;flex-direction:column;transition:box-shadow .15s ease,transform .15s ease}.collection-carousel__card:hover{transform:translateY(-2px);box-shadow:0 0 0 2px var(--brand-violet),0 10px 30px #a524b347}.collection-carousel__card.is-active{box-shadow:0 0 0 2px var(--accent)}.collection-carousel__media{position:relative;aspect-ratio:1 / 1;background:var(--media)}.collection-carousel__img{width:100%;height:100%;object-fit:contain;display:block}.collection-carousel__body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:8px}.collection-carousel__name{font-weight:600;font-size:14px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.collection-carousel__meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.collection-carousel__price{display:flex;align-items:center;gap:5px;font-weight:600;font-size:15px;color:var(--text-2)}.collection-carousel__diamond{width:14px;height:14px;color:var(--text-2)}.collection-carousel__chips{display:flex;align-items:center;gap:6px}.collection-carousel__na{color:var(--muted);font-weight:600;font-size:13px}.collection-carousel__card{cursor:pointer}.collection-carousel__card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.collection-carousel__add{position:absolute;bottom:10px;right:10px;z-index:2;width:34px;height:34px;border-radius:50%;border:0;background:var(--accent);color:#fff;display:grid;place-items:center;box-shadow:0 4px 12px #691fa959;transition:transform .12s ease,background .15s ease}.collection-carousel__add:hover{transform:scale(1.08)}.collection-carousel__add:disabled{background:var(--muted-2);cursor:default;box-shadow:none}.collection-carousel__add .ico{width:18px;height:18px}.item-detail--notfound{min-height:46vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}.item-detail__notfound-ico{width:44px;height:44px;opacity:.4}.item-detail__notfound-title{font-size:22px}.item-detail--notfound .btn{margin-top:6px}
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B5srtbdi.js","assets/react-Vu6nbGi5.js","assets/index-BwiZgchN.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css","assets/generateUtilityClasses-wRCEHwkd.js","assets/Button-B97LSmPW.js","assets/SvgIcon-Bjkj3_CR.js","assets/CircularProgress-BtAdS3mK.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as d,u as pe,d as fe,a as ve,L as xe}from"./react-Vu6nbGi5.js";import{_ as je,a as Q,V as be,X as Ne,Y as ye,Z as Ie,W as ge,D as C,h as X,$ as we,i as P,d as T,I as Ce,u as Y,j as Ae,c as L,m as V,a0 as ke,a1 as Ee,a2 as Se,a3 as Te,C as Le,a4 as K,a5 as Pe,g as Fe,q as Re,z as $e,r as Be,s as qe,v as H,w as Me,y as Ve,n as De,x as Oe,l as We,f as Ue,a6 as ze,a7 as Ge,o as Ye}from"./index-BwiZgchN.js";import{h as Z}from"./buy-BmZCwbRH.js";import{g as Ke,a as He,w as Ze,G as Qe}from"./buy-gasless-BMlSkNzH.js";import"./ethers-DHDSyreX.js";import"./index-DxOJU9tq.js";const Xe=d.lazy(()=>je(()=>import("./index-B5srtbdi.js").then(i=>i.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(i=>({default:i.EmoteControls})));function Je(i){return e.jsx(d.Suspense,{fallback:null,children:e.jsx(Xe,{...i})})}function es({item:i}){const c=Q(j=>{var b;return(b=j.session)==null?void 0:b.address}),{data:r}=be(c),h=c&&r?c:"default",u=i.category==="emote",[_,I]=d.useState("avatar"),n=!u&&_==="item",x=!!c&&!!r,s=x&&Ne(i,ye(r)),a=Ie(i)[0],o=x&&!s&&!u;return e.jsxs(e.Fragment,{children:[e.jsx(ge,{id:"shop-item-preview",contractAddress:i.contractAddress,tokenId:i.tokenId??void 0,itemId:i.tokenId?void 0:i.itemId??void 0,profile:n?void 0:s?h:"default",bodyShape:n||s?void 0:a,type:u?void 0:n?C.PreviewType.WEARABLE:C.PreviewType.AVATAR,emote:u||n?void 0:C.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:u?1.5:void 0,wheelStart:u?100:void 0,dev:X.chainId===80002,disableFadeEffect:!0},i.id),o&&!n?e.jsxs("p",{className:"item-preview__note",children:["Shown on a ",we(a)," body — this item isn’t made for your avatar’s shape."]}):null,u?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(Je,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":"Preview mode",children:[e.jsx("button",{type:"button",className:_==="avatar"?"is-active":"","aria-pressed":_==="avatar",onClick:()=>I("avatar"),children:"On avatar"}),e.jsx("button",{type:"button",className:_==="item"?"is-active":"","aria-pressed":_==="item",onClick:()=>I("item"),children:"Item"})]})]})}function ss(i){return i==="male"?"♂":i==="female"?"♀":i==="unisex"?"⚥":""}function ts({title:i,items:c,activeId:r,onSelect:h,onViewAll:u}){const _=d.useRef(null),I=P(a=>a.add),n=P(a=>a.items.map(o=>o.id));if(c.length===0)return null;function x(a){I(a,"carousel"),Ce.success(`“${a.name}” added to your cart.`)}function s(a){const o=_.current;o&&o.scrollBy({left:a*Math.round(o.clientWidth*.8),behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:i}),e.jsxs("div",{className:"collection-carousel__head-right",children:[u?e.jsx("button",{className:"collection-carousel__viewall",onClick:u,children:"View all"}):null,e.jsxs("div",{className:"collection-carousel__arrows",children:[e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(-1),"aria-label":"Scroll left",children:"‹"}),e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(1),"aria-label":"Scroll right",children:"›"})]})]})]}),e.jsx("div",{className:"collection-carousel__track",ref:_,children:c.map(a=>{const o=ss(a.gender),j=a.id===r,b=a.priceCredits>0,p=n.includes(a.id);return e.jsxs("article",{className:`collection-carousel__card${j?" is-active":""}`,onClick:()=>h(a),role:"button",tabIndex:0,"aria-current":j||void 0,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),h(a))},children:[e.jsxs("div",{className:"collection-carousel__media",children:[a.thumbnail?e.jsx("img",{className:"collection-carousel__img",src:a.thumbnail,alt:a.name,loading:"lazy"}):null,b?e.jsx("button",{className:"collection-carousel__add",disabled:p,"aria-label":p?"In cart":`Add ${a.name} to cart`,title:p?"In cart":"Add to cart",onClick:N=>{N.stopPropagation(),p||x(a)},children:e.jsx("span",{className:`ico ${p?"ico-cart-solid":"ico-cart"}`,"aria-hidden":!0})}):null]}),e.jsxs("div",{className:"collection-carousel__body",children:[e.jsx("div",{className:"collection-carousel__name",title:a.name,children:a.name}),e.jsxs("div",{className:"collection-carousel__meta",children:[b?e.jsxs("span",{className:"collection-carousel__price",children:[e.jsx(T,{className:"collection-carousel__diamond"}),a.priceCredits]}):e.jsx("span",{className:"collection-carousel__price collection-carousel__na",children:"Not listed"}),e.jsxs("span",{className:"collection-carousel__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:a.rarity}),o?e.jsx("span",{className:"chip chip--icon",children:o}):null]})]})]})]},a.id)})})]})}function as(i){return Object.values(C.Rarity).includes(i)}function is(i){return i==="male"?"Male":i==="female"?"Female":i==="unisex"?"Unisex":null}function rs(i){const c=i,r=(c.message??"").toLowerCase();return c.code===4001||r.includes("reject")||r.includes("denied")||r.includes("cancel")?"You cancelled the request.":r.includes("insufficient")?`You don't have enough ${We.name} — get more first.`:r.includes("no active listing")||r.includes("not for sale")?"This item is not for sale right now.":"Couldn't complete checkout — please try again."}function ms(){const{contractAddress:i,tokenId:c}=pe(),{state:r}=fe(),h=ve(),u=P(t=>t.add),_=P(t=>t.items),I=Y(t=>t.toggle),{session:n}=Q(),{data:x}=Ae(n),[s,a]=d.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${i}-${c}`,name:"",creator:"",contractAddress:i??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:X.chainId,thumbnail:"",priceCredits:0,gender:null,tokenId:c??void 0,tradeId:r==null?void 0:r.tradeId}),[o,j]=d.useState(!1),[b,p]=d.useState(null),[N,A]=d.useState(null),{data:g=[],isFetched:J}=L({queryKey:["collection-items",s.contractAddress],enabled:!!s.contractAddress,queryFn:()=>Ue(s.contractAddress,{first:20}).then(t=>t.items)}),{data:F,isLoading:ee}=L({queryKey:["shop-item",s.contractAddress,c],enabled:!(r!=null&&r.item)&&!!s.contractAddress&&!!c,queryFn:()=>ze(s.contractAddress,c)});d.useEffect(()=>{F&&a(t=>t.tradeId?t:{...F})},[F]);const[D,se]=d.useState(!1),{data:R=""}=L({queryKey:["item-desc",s.contractAddress,s.itemId],enabled:!!s.contractAddress&&!!s.itemId,staleTime:5*6e4,queryFn:()=>Ge(s.contractAddress,s.itemId)});d.useEffect(()=>{if(s.name||g.length===0)return;const t=c&&g.find(l=>l.tokenId===c||l.itemId===c)||g.find(l=>l.contractAddress===s.contractAddress);t&&a(l=>({...t,tradeId:l.tradeId??t.tradeId}))},[g]);const te=d.useMemo(()=>{const t=new Set,l=[];for(const m of g){if(m.id===s.id||s.itemId&&m.itemId===s.itemId||s.tokenId&&m.tokenId===s.tokenId)continue;const S=`${m.contractAddress}-${m.itemId??m.tokenId??m.id}`;t.has(S)||(t.add(S),l.push(m))}return l},[g,s.id,s.itemId,s.tokenId]),{data:ae,isLoading:k}=L({queryKey:["detail-trade",s.id,s.tradeId,s.contractAddress,s.itemId],enabled:!!s.contractAddress,queryFn:async()=>{if(s.tradeId)return s.tradeId;if(s.itemId){const t=await Ye(s.contractAddress,s.itemId);return(t==null?void 0:t.id)??null}return null}}),y=s.tradeId??ae??void 0,v=!!y,E=d.useMemo(()=>({...s,tradeId:y,id:y??s.id}),[s,y]),$=_.some(t=>t.id===E.id),B=Y(t=>!!t.items[s.id]);d.useEffect(()=>{p(null),A(null)},[s.id]);const O=d.useRef(null);d.useEffect(()=>{!s.name||k||O.current===s.id||(O.current=s.id,V("Shop Viewed Item",{...ke(s),for_sale:v}),Ee(s))},[s.id,s.name,k,v]);function ie(t){a(t);const l=t.tokenId??t.itemId;t.contractAddress&&l&&h(`/item/${t.contractAddress}/${l}`,{replace:!0,state:{item:t}}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}function re(){!v||$||U||u(E,"item_detail")}async function ce(){var S;if(!v||!y)return;if(!n){A("Sign in to check out.");return}A(null),j(!0);let t,l="authorize",m=!1;try{p(`Buying ${s.name||"item"}…`);const f=await Fe(y);if(!f)throw new Error("not for sale");if(Re(f,n.address)){A("You can't buy your own listing."),p(null),j(!1);return}const q=(S=f.received)==null?void 0:S[0],he=$e(q==null?void 0:q.amount),{credit:z,maxCreditedValue:_e}=await Be(n.identity,he,y);t=z.id,l="submit";const M={trade:f,buyer:n.address,signer:n.signer,credits:[z],maxCreditedValue:_e};let w;if(Ke())try{w=await He(M),await Ze(w),m=!0}catch(G){if(!(G instanceof Qe))throw G;w=await Z(M)}else w=await Z(M);t=void 0,V("Shop Completed Purchase",{...qe([E]),payment_type:"credits",no_crypto_step:m,transaction_hash:w??null}),h("/success",{state:{items:[E],txHash:w}})}catch(f){H(f)||Me(f,{flow:"buy",step:l,gasless:m}),t&&Ve(n.identity,[t]).catch(()=>{}),V(H(f)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:l,error_code:Oe(f),value_usd:De(E.priceCredits)}),A(rs(f)),p(null)}finally{j(!1)}}const ne=as(s.rarity)?s.rarity:C.Rarity.COMMON,[le]=C.Rarity.getGradient(ne),W=is(s.gender),de=v&&Se({priceCredits:s.priceCredits,compareAtCredits:s.compareAtCredits,saleEndsAt:s.saleEndsAt}),oe="More from this collection",U=Te(s,n==null?void 0:n.address),ue=v?$?"In cart":k?"Checking…":"Add to cart":"Not for sale",me=ee||!!s.contractAddress&&!J;return!s.name&&!me?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx("span",{className:"ico ico-cart item-detail__notfound-ico","aria-hidden":!0}),e.jsx("h1",{className:"item-detail__notfound-title",children:"This item isn’t available"}),e.jsx("p",{className:"muted",children:"It may have been delisted or moved. Browse Collectibles for something else."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>h("/assets"),children:"Browse Collectibles"})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>h("/assets"),children:"Collectibles"}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:s.name||"Item"})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsx("div",{className:"item-detail__preview",style:{background:`radial-gradient(circle at 50% 38%, ${le}33 0%, var(--media) 68%)`},children:e.jsx(es,{item:s})}),e.jsxs("div",{className:"item-detail__info",children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:s.name||"Loading…"}),e.jsx("button",{className:`item-detail__fav${B?" is-on":""}`,onClick:()=>I(s),"aria-pressed":B,"aria-label":B?"Remove from favorites":"Add to favorites",children:e.jsx("span",{className:"ico ico-heart","aria-hidden":!0})})]}),s.creator?e.jsx(Le,{address:s.creator,className:"item-detail__creator",linkToProfile:!0}):null,e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:s.rarity}),e.jsx("span",{className:"chip",children:s.category==="emote"?"Emote":"Wearable"}),W?e.jsx("span",{className:"chip",children:W}):null]}),R?e.jsxs("div",{className:"item-detail__description",children:[e.jsx("p",{className:`item-detail__desc-text${D?" is-expanded":""}`,children:R}),R.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>se(t=>!t),children:D?"Show less":"Read more"}):null]}):null,e.jsxs("div",{className:"item-detail__card",children:[e.jsxs("div",{className:"item-detail__price-block",children:[e.jsx("div",{className:"item-detail__price-label",children:"Price"}),v?de?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(T,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(T,{className:"item-detail__diamond item-detail__diamond--was"}),s.compareAtCredits]}),K(s.compareAtCredits,s.priceCredits)>0?e.jsxs("span",{className:"item-detail__sale-badge",children:["SALE -",K(s.compareAtCredits,s.priceCredits),"%"]}):null,e.jsx(Pe,{endsAt:s.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(T,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:"Not for sale"}),n?e.jsxs("div",{className:"item-detail__balance muted",children:["Your balance: ",e.jsx(T,{className:"ccy-mark"})," ",(x==null?void 0:x.credits)??0]}):null]}),e.jsx("div",{className:"item-detail__ctas",children:U?e.jsxs("p",{className:"item-detail__own-note muted",children:["This is your item — manage it in ",e.jsx(xe,{to:"/my-assets",children:"My Assets"}),"."]}):e.jsxs(e.Fragment,{children:[v?e.jsx("button",{className:"btn btn--purple item-detail__cta",onClick:ce,disabled:o||k,children:o?"Buying…":"Buy now"}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:re,disabled:!v||$||k||o,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),ue]})]})}),b?e.jsx("p",{className:"muted item-detail__status",children:b}):null,N?e.jsx("p",{className:"error item-detail__status",children:N}):null]})]})]}),e.jsx(ts,{title:oe,items:te,activeId:s.id,onSelect:ie,onViewAll:s.contractAddress?()=>h(`/collection/${s.contractAddress}`):void 0})]})}export{ms as ItemDetail,ms as default};
@@ -1 +1 @@
1
- import{r as i,j as l}from"./react-4iaCnQ6n.js";function a({hasNextPage:e,isFetching:r,onLoadMore:n}){const t=i.useRef(null);return i.useEffect(()=>{const s=t.current;if(!s||!e)return;const o=new IntersectionObserver(u=>{var c;(c=u[0])!=null&&c.isIntersecting&&!r&&n()},{rootMargin:"600px 0px"});return o.observe(s),()=>o.disconnect()},[e,r,n]),e?l.jsx("div",{className:"load-more",ref:t,children:l.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:r,children:r?"Loading…":"Load more"})}):null}export{a as L};
1
+ import{r as i,j as l}from"./react-Vu6nbGi5.js";function a({hasNextPage:e,isFetching:r,onLoadMore:n}){const t=i.useRef(null);return i.useEffect(()=>{const s=t.current;if(!s||!e)return;const o=new IntersectionObserver(u=>{var c;(c=u[0])!=null&&c.isIntersecting&&!r&&n()},{rootMargin:"600px 0px"});return o.observe(s),()=>o.disconnect()},[e,r,n]),e?l.jsx("div",{className:"load-more",ref:t,children:l.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:r,children:r?"Loading…":"Load more"})}):null}export{a as L};