@dcl/shop 0.1.0-29406413150.commit-a91cd9f → 0.1.0-29486364190.commit-e3b7c10

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 (203) hide show
  1. package/assets/{AnimatedBackground-BnwRfsiv.js → AnimatedBackground-hgJbdv8o.js} +3 -3
  2. package/assets/Assets-iFxuz5_V.js +1 -0
  3. package/assets/Cart-BoZAV3Zy.js +1 -0
  4. package/assets/{CircularProgress-og3LyasF.js → CircularProgress-D2LB2Tot.js} +1 -1
  5. package/assets/{Collection-CbMYzkC9.js → Collection-BnxXZj1R.js} +1 -1
  6. package/assets/{ConstantsUtil-DrbbN8Db.js → ConstantsUtil-rB_9qX5U.js} +1 -1
  7. package/assets/{Creator-DQJPFH3p.js → Creator-BB-y4Ecj.js} +1 -1
  8. package/assets/{ExchangeController-qNcM_tdT.js → ExchangeController-ChlCwQw0.js} +1 -1
  9. package/assets/GetCredits-F9je0G_Y.js +2 -0
  10. package/assets/{HelpersUtil-DwV51RvI.js → HelpersUtil-DWHamXXu.js} +1 -1
  11. package/assets/{ImportListings-CM9NUDqh.js → ImportListings-DiSHmEqQ.js} +1 -1
  12. package/assets/ItemDetail--AzXh8S2.css +1 -0
  13. package/assets/ItemDetail-CRHBr8SV.js +2 -0
  14. package/assets/{LoadMore-7qZApSeo.js → LoadMore-8Dx5lULo.js} +1 -1
  15. package/assets/{MyAssets-DrTGapSq.js → MyAssets-BbfBsUnZ.js} +1 -1
  16. package/assets/{MyFavorites-DPxWR9i_.js → MyFavorites-Csfi_T9F.js} +1 -1
  17. package/assets/{MyPurchases-UlV2Ejo9.js → MyPurchases-CnzVyMic.js} +1 -1
  18. package/assets/{NetworkUtil-BI8jZwmc.js → NetworkUtil-Cm_KFCNa.js} +1 -1
  19. package/assets/{NotFound-dQCK8o3W.js → NotFound-rWNtnYXU.js} +1 -1
  20. package/assets/{RealCheckout-D9TYwWxz.js → RealCheckout-CXz68lrR.js} +1 -1
  21. package/assets/{SkeletonCards-DSpqiDzZ.js → SkeletonCards-BhzQlTiQ.js} +1 -1
  22. package/assets/{Success-Bad6c-Jo.js → Success-CT_TCK5T.js} +1 -1
  23. package/assets/{SwapController-CQZXQ4Q5.js → SwapController-T2_7I9w9.js} +1 -1
  24. package/assets/{TradeService-DuSSbU0G.js → TradeService-CprqG9em.js} +1 -1
  25. package/assets/{W3MFrameProviderSingleton-B6_3Zs6I.js → W3MFrameProviderSingleton-Dhy5L90S.js} +3 -3
  26. package/assets/{WebCryptoP256-CMFEoyaK.js → WebCryptoP256-CQO8V6dW.js} +1 -1
  27. package/assets/{basic-Dq5ood5R.js → basic-CUrKSXqx.js} +1 -1
  28. package/assets/{biconomy-C3pzeqHG.js → biconomy-BprwjyuM.js} +1 -1
  29. package/assets/{browser-D_5JuNNR.js → browser-BMhVVB-A.js} +1 -1
  30. package/assets/{browser-ponyfill-ClcxEFdz.js → browser-ponyfill-B39o65AB.js} +1 -1
  31. package/assets/{buy-BXsYo32e.js → buy-DK-hDYib.js} +1 -1
  32. package/assets/{buy-gasless-CB45oj-8.js → buy-gasless-BqKKprU3.js} +1 -1
  33. package/assets/{ccip-C2qRMCzb.js → ccip-D9kLikPl.js} +1 -1
  34. package/assets/{ccip-zOJ8fkH-.js → ccip-i3RPI9_7.js} +1 -1
  35. package/assets/{chains-BsN0T6nV.js → chains-ahXbxt0q.js} +1 -1
  36. package/assets/{collection-B34IwUC5.js → collection-BGWAmfIC.js} +1 -1
  37. package/assets/{common-TfzpxC2l.js → common-B5mo5Owz.js} +1 -1
  38. package/assets/{controller-0cnw-xyq.js → controller-Btue2UR6.js} +2 -2
  39. package/assets/{core-CRifUzKO.js → core-CuTrUx-L.js} +4 -4
  40. package/assets/{custom-BRRAon-U.js → custom-CUI9dLB8.js} +1 -1
  41. package/assets/{data-capture-cSGzOBZI.js → data-capture-5yvKgk9D.js} +1 -1
  42. package/assets/{decimals-DFdgeb5g.js → decimals-BEIdKTQm.js} +1 -1
  43. package/assets/decimals-DyV7oW3h.js +1 -0
  44. package/assets/{detectExtension-D3QIkn81.js → detectExtension-LiPeiloP.js} +1 -1
  45. package/assets/{email-Bt1Wqrpu.js → email-dHJudH5P.js} +1 -1
  46. package/assets/{embedded-wallet-BAvMzBcs.js → embedded-wallet-pLhtv_no.js} +1 -1
  47. package/assets/{emotion-styled.browser.esm-DeLQmdM_.js → emotion-styled.browser.esm-Cuau_-ln.js} +1 -1
  48. package/assets/{engine-C-4f510Q.js → engine-DClcsFWb.js} +1 -1
  49. package/assets/{estimate-l1-fee-TD6Eeaga.js → estimate-l1-fee-D1zggvjN.js} +1 -1
  50. package/assets/eth_estimateGas-BEfG-JZG.js +1 -0
  51. package/assets/{eth_getStorageAt-CiqYqck8.js → eth_getStorageAt-CxVMb6OQ.js} +1 -1
  52. package/assets/eth_getTransactionCount-Be3nPW6h.js +1 -0
  53. package/assets/{ethereum-A1QWZFDW.js → ethereum-CfGZ1o2B.js} +1 -1
  54. package/assets/{ethers-DXxh-eEm.js → ethers-D-4WUfRB.js} +1 -1
  55. package/assets/{extractIPFS-COa8X7sF.js → extractIPFS-BR5tloXr.js} +1 -1
  56. package/assets/{features-7-b4Om7J.js → features-lwpfjaXd.js} +1 -1
  57. package/assets/{fetchTokenMetadata-BTszSGhS.js → fetchTokenMetadata-BMgeeRkO.js} +2 -2
  58. package/assets/{fortmatic-Beo5lxXY.js → fortmatic-Be6frCcv.js} +1 -1
  59. package/assets/get-ecosystem-wallet-info-CqKNn3RZ.js +1 -0
  60. package/assets/{getBalance-BArf24DT.js → getBalance-DMIFpbol.js} +2 -2
  61. package/assets/{getInstalledModules-CzBtswDW.js → getInstalledModules-fpaoD92V.js} +1 -1
  62. package/assets/{getNFT-iLCDuS_Q.js → getNFT-CiyopSgD.js} +1 -1
  63. package/assets/{getNFT-CmB-EUw9.js → getNFT-D86xBZpd.js} +2 -2
  64. package/assets/{hashTypedData-Duzplq5M.js → hashTypedData-BqtZziXx.js} +1 -1
  65. package/assets/{hashTypedData-CoXLJrY2.js → hashTypedData-CHW-4SjU.js} +1 -1
  66. package/assets/hero-fashion-week-B9LOzkde.png +0 -0
  67. package/assets/{import-1qZmk-ve.js → import-Cicp42pB.js} +1 -1
  68. package/assets/{in-app-wallet-calls-B7ySKt0n.js → in-app-wallet-calls-CcJhWWJI.js} +1 -1
  69. package/assets/{index-BrsEF-BM.js → index--cPi4o8K.js} +1 -1
  70. package/assets/{index-TyqRL5ux.js → index-BBm1Gh-y.js} +1 -1
  71. package/assets/{index-BZDBkXn3.js → index-BBrMxcXw.js} +1 -1
  72. package/assets/{index-CTabxOqV.js → index-BD56aksA.js} +1 -1
  73. package/assets/{index-D3y-kuFx.js → index-BIiVsjKg.js} +1 -1
  74. package/assets/{index-cziX_kqw.js → index-BIxKztx0.js} +1 -1
  75. package/assets/{index-BW6d6BbH.js → index-BJ_QKI7g.js} +45 -45
  76. package/assets/{index-DfrLYsxF.js → index-BKKTIysr.js} +1 -1
  77. package/assets/{index-BOJUx2yW.js → index-BQkCy5n9.js} +1 -1
  78. package/assets/{index-BdDGInRO.js → index-BSJ2Bu7u.js} +1 -1
  79. package/assets/{index-DIkXA0Hv.js → index-BYMSEXnr.js} +1 -1
  80. package/assets/{index-BclUryz1.js → index-Ba1nPvJW.js} +1 -1
  81. package/assets/{index-Cc4Zz6Zy.js → index-BaSxcMLe.js} +1 -1
  82. package/assets/{index-DurG2hyR.js → index-Bho_nwZ6.js} +1 -1
  83. package/assets/{index-BHjzvMc_.js → index-BlSRcuid.js} +1 -1
  84. package/assets/{index-ScY6mRRU.js → index-BsQzSxCr.js} +1 -1
  85. package/assets/index-Bv7abT8U.js +1 -0
  86. package/assets/{index-BnIGy6dE.js → index-By3oDfDF.js} +1 -1
  87. package/assets/index-Bybrl6u1.js +74 -0
  88. package/assets/{index-C6WtN49a.js → index-C340qDw7.js} +1 -1
  89. package/assets/{index-DUM-eWFe.js → index-C3PaD0tV.js} +1 -1
  90. package/assets/{index-UB1Y0F7Y.js → index-C3_zjZ8P.js} +2 -2
  91. package/assets/{index-euu_zF1P.js → index-C7hEybuy.js} +1 -1
  92. package/assets/{index-hlRGU2X9.js → index-C7mvyx-2.js} +1 -1
  93. package/assets/{index-Be9jJ2sK.js → index-C9hpF5Zb.js} +1 -1
  94. package/assets/{index-DCd0GVdP.js → index-CDSbn3SW.js} +2 -2
  95. package/assets/{index-D-ixZxf4.js → index-CXl2e07e.js} +1 -1
  96. package/assets/{index-hzzqz-oN.js → index-CZ_Yva86.js} +1 -1
  97. package/assets/{index-D36yN0Bf.js → index-CaeVk9Dy.js} +2 -2
  98. package/assets/{index-CuI-U7nJ.js → index-CfK4LG22.js} +1 -1
  99. package/assets/{index-BGGbgdSQ.js → index-CgviKUZA.js} +1 -1
  100. package/assets/{index-C0dr4jyr.js → index-CijzbRBJ.js} +1 -1
  101. package/assets/{index-BBQ72VSQ.js → index-CkkiWu3m.js} +1 -1
  102. package/assets/{index-Di33sB2B.js → index-CpnYRmXG.js} +1 -1
  103. package/assets/index-Ctf6wteV.css +1 -0
  104. package/assets/{index-Cpy2Et_p.js → index-CvXPL5ul.js} +1 -1
  105. package/assets/{index-MbmnIks7.js → index-D5nkWH4b.js} +1 -1
  106. package/assets/index-D60X16p8.js +1 -0
  107. package/assets/{index-CwzaSU41.js → index-D7Wyaha_.js} +1 -1
  108. package/assets/{index-Bh_U9TSe.js → index-D7xFuNJh.js} +1 -1
  109. package/assets/{index-Cz2F4NKm.js → index-DDIGuWa_.js} +1 -1
  110. package/assets/{index-C3h4AdEY.js → index-DGCEPw6Q.js} +1 -1
  111. package/assets/{index-DnTfBax2.js → index-DLG2tqiB.js} +1 -1
  112. package/assets/{index-T3Ioic-d.js → index-DLvBdRwo.js} +1 -1
  113. package/assets/index-DQoqkX47.js +12 -0
  114. package/assets/{index-Bo1FAQNs.js → index-DjUJoQZC.js} +1 -1
  115. package/assets/{index-Ce0_-pFA.js → index-DmSIzgEH.js} +1 -1
  116. package/assets/{index-D6jFYOn4.js → index-Fy50YzQ3.js} +1 -1
  117. package/assets/{index-C92KiAOk.js → index-OXYaaX81.js} +1 -1
  118. package/assets/{index-BTusn-cp.js → index-SeURPzoq.js} +1 -1
  119. package/assets/{index-C344ardt.js → index-UPHX7Pfh.js} +1 -1
  120. package/assets/{index-Cw9pJ_Ha.js → index-Xlg0S1xP.js} +1 -1
  121. package/assets/{index-Bn1ikbQg.js → index-a9iM5Ppc.js} +3 -3
  122. package/assets/{index-BftIY8GG.js → index-f0ZcLHB4.js} +1 -1
  123. package/assets/{index-BdGF7Khq.js → index-hpL8NPIy.js} +1 -1
  124. package/assets/{index-BhrfOLeY.js → index-jmpN1CZn.js} +1 -1
  125. package/assets/{index-C2WEBoZJ.js → index-klXc-d9l.js} +1 -1
  126. package/assets/{index-C1X_Y6wr.js → index-qjYSTcyF.js} +3 -3
  127. package/assets/{index-BvrzCkDl.js → index-vw2pKkQA.js} +2 -2
  128. package/assets/{index-CbH9kfUc.js → index-wUFVtYuu.js} +1 -1
  129. package/assets/{index.es-DwtUIInR.js → index.es-DV1BuqVZ.js} +4 -4
  130. package/assets/{index.es-1POdP2bT.js → index.es-Z-qK52rV.js} +1 -1
  131. package/assets/{index.es-B3cqCuuu.js → index.es-lXpu4Zv4.js} +1 -1
  132. package/assets/{localBatchGatewayRequest-UGxosVgP.js → localBatchGatewayRequest-BVr46Pdr.js} +1 -1
  133. package/assets/{mana-rate-DbXjP8PT.js → mana-rate-nE0eZdyC.js} +1 -1
  134. package/assets/{native-B9_hMdpy.js → native-8V193B3S.js} +1 -1
  135. package/assets/network-Cc4BxKcP.js +1 -0
  136. package/assets/{networks-zejNBfN0.js → networks-CyKyAnnj.js} +1 -1
  137. package/assets/{onramp-uaAenXK_.js → onramp-D-CVQK10.js} +1 -1
  138. package/assets/{openzeppelin-CNJo1xvT.js → openzeppelin-CZBvYWQH.js} +1 -1
  139. package/assets/{ownerOf-ClGvWr7v.js → ownerOf-DpxlatB6.js} +1 -1
  140. package/assets/{parseNft-Dmi4dKW_.js → parseNft-BteugRHW.js} +2 -2
  141. package/assets/{parseSignature-DqHdoBSK.js → parseSignature-7MLI5FFb.js} +1 -1
  142. package/assets/{parseSignature-C2I1o9hQ.js → parseSignature-XWyL3GOI.js} +3 -3
  143. package/assets/{pay-with-exchange-CZLFCtg1.js → pay-with-exchange-Ct_mQI29.js} +1 -1
  144. package/assets/promo-best-rated-emotes-C6kNvB-a.png +0 -0
  145. package/assets/promo-week-selected-outfits-BBmkZYZx.png +0 -0
  146. package/assets/{qr-overlay-CLbuZX6n.js → qr-overlay-BqNftzdl.js} +3 -3
  147. package/assets/{react-CQ5qhqs6.js → react-iAgwec9M.js} +1 -1
  148. package/assets/{receive-lRcrhl2d.js → receive-CDy6Z42p.js} +1 -1
  149. package/assets/{resolveImplementation-CSXfyN2u.js → resolveImplementation-Bc0hVuIY.js} +1 -1
  150. package/assets/{rpc-B07HiX5J.js → rpc-boAlAOZR.js} +1 -1
  151. package/assets/{secp256k1-CbZoHEaI.js → secp256k1-By0xJ9f-.js} +1 -1
  152. package/assets/{secp256k1-BiQ03web.js → secp256k1-C4VLJ_Ul.js} +1 -1
  153. package/assets/{secp256k1-CwJslARV.js → secp256k1-D1h2lDQ6.js} +1 -1
  154. package/assets/{send-BViJVaUq.js → send-CiVTg7A8.js} +1 -1
  155. package/assets/{send-batch-transaction-CxjHPlkH.js → send-batch-transaction-CqZ6goZh.js} +1 -1
  156. package/assets/{send-eip712-transaction-BP9m4G9l.js → send-eip712-transaction-DJrgfOzh.js} +2 -2
  157. package/assets/{send-gasless-transaction-ChxzGYfX.js → send-gasless-transaction-lYt5N3_C.js} +2 -2
  158. package/assets/{sendRawTransaction-BN4kGE5P.js → sendRawTransaction-DmHNTzdc.js} +3 -3
  159. package/assets/{serializeTransaction-BcmfsEg1.js → serializeTransaction-0eBlvpQK.js} +1 -1
  160. package/assets/{session-proposal-BRstm0bQ.js → session-proposal-BSyh4SKk.js} +1 -1
  161. package/assets/{session-request-C4lEtLnN.js → session-request-DV94fpr9.js} +2 -2
  162. package/assets/{sha256-DkvO414S.js → sha256-YU3Zqsfv.js} +1 -1
  163. package/assets/{signing-D3pU2o1I.js → signing-D24XEdbq.js} +5 -5
  164. package/assets/{socials-DXBXCHxv.js → socials-rQJycNz4.js} +1 -1
  165. package/assets/{swaps-4ySgWDaa.js → swaps-BOwdKS6n.js} +1 -1
  166. package/assets/{thirdweb-DjdWszGQ.js → thirdweb-DH7tH_YY.js} +3 -3
  167. package/assets/{totalSupply-Cp-tbUyO.js → totalSupply-C0ZsfGnG.js} +1 -1
  168. package/assets/{trade-encoding-CgWHvMsc.js → trade-encoding-ELuUTRbi.js} +1 -1
  169. package/assets/{transactionReceipt-Y7v69biI.js → transactionReceipt-Dn2q3Bhv.js} +1 -1
  170. package/assets/{transactions-DHEcEI8t.js → transactions-BTj8wcwx.js} +1 -1
  171. package/assets/{useInfiniteGrid-Dvh83G5j.js → useInfiniteGrid-XR5F3f0o.js} +1 -1
  172. package/assets/{utils-CebgHLxz.js → utils-DmMVfaK5.js} +1 -1
  173. package/assets/{verifyHash-DYm9NRaH.js → verifyHash-BA1JKF0y.js} +1 -1
  174. package/assets/{w3m-modal-DO45d0QA.js → w3m-modal-CjQ_EDZs.js} +1 -1
  175. package/assets/{w3m-modal-BJW5AFLD.js → w3m-modal-DORychBC.js} +1 -1
  176. package/assets/{wait-for-tx-receipt-rpydharh.js → wait-for-tx-receipt-heRjFFnK.js} +1 -1
  177. package/assets/{wallet-kind-C_qy0E-X.js → wallet-kind-g2ENkqJ_.js} +1 -1
  178. package/assets/{wallets-Bl61iVPq.js → wallets-DHqgQa_5.js} +6 -6
  179. package/assets/{web-connector-BrGZ8Hxc.js → web-connector-IkMDp4Rj.js} +3 -3
  180. package/assets/{writeContract-sz1xzStO.js → writeContract-DKZmoUmz.js} +1 -1
  181. package/assets/{zora-sepolia-BXcKZl5q.js → zora-sepolia-6WiqQMBk.js} +1 -1
  182. package/assets/{zoraTestnet-U_QF4fFv.js → zoraTestnet-B0fxbkay.js} +1 -1
  183. package/index.html +8 -8
  184. package/package.json +2 -2
  185. package/assets/Assets-D-a9hqWT.js +0 -1
  186. package/assets/Button-Dywi_vIa.js +0 -74
  187. package/assets/Cart-DVjQHvBQ.js +0 -1
  188. package/assets/GetCredits-CrQ1Yqnd.js +0 -2
  189. package/assets/ItemDetail-Casltmsg.css +0 -1
  190. package/assets/ItemDetail-D8tmZfcC.js +0 -2
  191. package/assets/MenuItem-DVXN6fPs.js +0 -9
  192. package/assets/ShopFooterInner-Biy4Ywkz.js +0 -24
  193. package/assets/colors-LINLm1ux.js +0 -1
  194. package/assets/decimals-B19-5xj3.js +0 -1
  195. package/assets/eth_estimateGas-c0ilyWBq.js +0 -1
  196. package/assets/eth_getTransactionCount-CFplLmOA.js +0 -1
  197. package/assets/get-ecosystem-wallet-info-T0L6dsNV.js +0 -1
  198. package/assets/index-D3awFASU.js +0 -1
  199. package/assets/index-D5NMP22o.css +0 -1
  200. package/assets/index-DsCvbsUU.js +0 -1
  201. package/assets/index-r9qogMtw.js +0 -1
  202. package/assets/index-sdNj_XXp.js +0 -4
  203. package/assets/network-CnO47bm0.js +0 -1
@@ -1,11 +1,11 @@
1
- import{r as l,j as v}from"./react-CQ5qhqs6.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29406413150.commit-a91cd9f/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29406413150.commit-a91cd9f/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-iAgwec9M.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29486364190.commit-e3b7c10/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29486364190.commit-e3b7c10/assets/DCL_LogoPattern-BryBPc3d.png",b=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
5
5
  v_uv = a_position * 0.5 + 0.5;
6
6
  gl_Position = vec4(a_position, 0.0, 1.0);
7
7
  }
8
- `,b=`
8
+ `,U=`
9
9
  precision highp float;
10
10
 
11
11
  uniform float u_time;
@@ -77,4 +77,4 @@ void main() {
77
77
 
78
78
  gl_FragColor = result;
79
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,U),c=g(e,e.FRAGMENT_SHADER,b);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};
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};
@@ -0,0 +1 @@
1
+ import{r as l,j as e,a as fe,d as ye}from"./react-iAgwec9M.js";import{u as xe,i as z,c as ke,v as je,w as ae,h as Ne,q as ge,F as ve,J as A,z as R,I as D,H as V,e as E,aj as J,x as Ce,y as H,A as Z,am as we}from"./index-BJ_QKI7g.js";import{r as Se,a as U,m as Ee}from"./mana-rate-nE0eZdyC.js";import{S as X}from"./SkeletonCards-BhzQlTiQ.js";import{L as Ie}from"./LoadMore-8Dx5lULo.js";import{a as ee}from"./buy-DK-hDYib.js";import{g as Me,a as Fe,w as Pe,S as Ae,G as Re}from"./buy-gasless-BqKKprU3.js";import{u as $e}from"./useInfiniteGrid-XR5F3f0o.js";import"./ethers-D-4WUfRB.js";import"./index-CfK4LG22.js";import"./trade-encoding-ELuUTRbi.js";function Le(){return xe({queryKey:["mana-rate",z.chainId],queryFn:()=>Se(z.chainId),staleTime:6e4,refetchInterval:6e4,retry:1})}const Be=[{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 qe({category:s,subCategory:c,onCategory:o,onSub:b}){const[t,d]=l.useState(()=>s==="wearable"?"wearable":null);function y(r){r.subs?d(m=>{const h=m!==r.key;return h&&o(r.key),h?r.key:null}):(o(r.key),d(null))}return e.jsx("div",{className:"catfilter",children:Be.map(r=>{const m=t===r.key&&!!r.subs,h=r.key===s;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${m?" is-expanded":""}${h?" is-selected":""}`,onClick:()=>y(r),children:[e.jsx("span",{className:"catfilter__cat-label",children:r.label}),r.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${m?" is-up":""}`,"aria-hidden":!0}):null]}),r.subs?e.jsx("div",{className:`catfilter__subs${m?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:r.subs.map(i=>e.jsx("button",{type:"button",className:`catfilter__sub${c===i.key?" is-active":""}`,onClick:()=>b(c===i.key?null:i.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${i.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:i.label})]})},i.key))})}):null]},r.key)})})}const Te=["common","uncommon","rare","epic","legendary","mythic","unique","exotic"],K=[{key:"newest",label:"Newest",server:"newest"},{key:"price-asc",label:"Cheapest",server:"cheapest"},{key:"price-desc",label:"Most Expensive",server:"most_expensive"},{key:"name",label:"Name (A–Z)",server:"name"}];function We({panelKey:s,label:c,active:o,badge:b,align:t="left",panel:d,children:y}){const r=d.open===s,m=t==="right"?"filterbar__sort":"filterbar__trigger";return e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`${m}${r?" is-open":""}${o?" is-active":""}`,onClick:()=>d.toggle(s),children:[c," ",b?e.jsx("span",{className:"filterbar__badge",children:b}):null," ",e.jsx("span",{className:`ico ico-chevron filterbar__chev${r?" is-up":""}`,"aria-hidden":!0})]}),r?y:null]})}function Ge({sort:s,onSort:c,sortOptions:o=K,total:b,loading:t,query:d,onOpenFilters:y}){const[r,m]=l.useState(null),h={open:r,toggle:i=>m(j=>j===i?null:i),close:()=>m(null)};return e.jsxs(e.Fragment,{children:[r?e.jsx("div",{className:"filterbar__scrim",onClick:h.close,"aria-hidden":!0}):null,e.jsxs("div",{className:"browse__toolbar",children:[e.jsxs("span",{className:"browse__count",children:[t?"…":`${b.toLocaleString()} Item${b===1?"":"s"}`,d?` for “${d}”`:""]}),e.jsxs("div",{className:"browse__dropdowns",children:[y?e.jsxs("button",{type:"button",className:"browse__filters-btn",onClick:y,children:[e.jsx("span",{className:"ico ico-filter","aria-hidden":!0}),"Filters"]}):null,e.jsx(We,{panelKey:"sort",label:"Sort By",align:"right",panel:h,children:e.jsx("div",{className:"filter-pop filter-pop--sort",children:o.map(i=>e.jsx("button",{className:`filter-pop__sort${i.key===s?" is-active":""}`,onClick:()=>{c(i.key),h.close()},children:i.label},i.key))})})]})]})]})}function se(s){const c=s,o=(c.message??"").toLowerCase();return c.code===4001||o.includes("reject")||o.includes("denied")||o.includes("cancel")?"You cancelled the request.":o.includes("insufficient")?`Not enough ${H.name} — get more first.`:o.includes("not found")||o.includes("no active listing")||o.includes("404")?"This item was just sold or removed. Refreshing the market…":o.includes("your own listing")?"You can't buy your own listing.":"Couldn't complete checkout — please try again."}function Oe(s){return{id:s.tradeId,tradeId:s.tradeId,name:s.name,creator:s.creator,contractAddress:s.contractAddress,itemId:s.itemId,category:s.category,wearableCategory:s.wearableCategory??void 0,rarity:s.rarity,network:s.network,chainId:s.chainId,thumbnail:s.thumbnail,priceCredits:0,gender:null}}function Ue({listing:s,rate:c,onClose:o,onSold:b}){const{session:t}=ke(),{data:d,isError:y}=je(t),r=ae(),m=fe(),[h,i]=l.useState("confirm"),[j,I]=l.useState("Locking today’s price…"),[C,M]=l.useState(null),[n,G]=l.useState(null),f=l.useRef(null),S=Math.ceil(U(s.manaWei,c)/10);l.useEffect(()=>{let v=!1;if(!t){i("error"),M("Sign in to check out.");return}return(async()=>{try{const u=await Ne(s.tradeId);if(!u)throw new Error("not found");if(ge(u,t.address))throw new Error("You can't buy your own listing.");const p=U(s.manaWei,c);if(!Number.isFinite(p)||p<=0)throw new Error("price unavailable");const{credit:x,maxCreditedValue:$,usdCents:N}=await ve(t.identity,p,s.tradeId);if(v){A(t.identity,[x.id]).catch(()=>{});return}f.current=x.id,G({trade:u,credit:x,maxCreditedValue:$,usdCents:N,credits:Math.ceil(N/10)}),I("")}catch(u){if(v)return;console.error("[market] authorize failed",u),R(V(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:D(u),value_usd:Math.round(U(s.manaWei,c))/100}),i("error"),M(se(u))}})(),()=>{v=!0,f.current&&t&&(A(t.identity,[f.current]).catch(()=>{}),f.current=null)}},[]);const F=!!n&&d!=null&&d.credits<n.credits;async function P(){if(!t||!n)return;if(F){A(t.identity,[n.credit.id]).catch(()=>{}),f.current=null,m("/credits");return}i("working"),M(null);let v=!1;try{I("Confirming your purchase…");const u={trade:n.trade,buyer:t.address,signer:t.signer,credits:[n.credit],maxCreditedValue:n.maxCreditedValue};let p;if(Me())try{p=await Fe(u),await Pe(p),v=!0}catch(x){if(x instanceof Ae)v=!0;else if(x instanceof Re)p=await ee(u);else throw x}else p=await ee(u);f.current=null,R("Shop Completed Purchase",{items:[{item_id:s.itemId??null,contract_address:s.contractAddress,token_id:null,price_usd:n.usdCents/100}],value_credits:n.credits,value_usd:n.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:v,transaction_hash:p??null}),r.invalidateQueries({queryKey:["usd-balance"]}),m("/success",{state:{items:[Oe(s)],txHash:p}})}catch(u){console.error("[market] buy now failed",u),A(t.identity,[n.credit.id]).catch(()=>{}),f.current=null,R(V(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:D(u),value_usd:n.usdCents/100}),r.invalidateQueries({queryKey:["usd-balance"]});const p=se(u);M(p),i("error"),/sold or removed/i.test(p)&&b()}}function g(){t&&n&&A(t.identity,[n.credit.id]).catch(()=>{}),f.current=null,o()}const k=h==="working";return e.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":`Buy ${s.name}`,children:[e.jsx("div",{className:"mkt-modal__scrim",onClick:k?void 0:g,"aria-hidden":!0}),e.jsxs("div",{className:"mkt-modal__card",children:[e.jsxs("div",{className:"mkt-modal__head",children:[e.jsx("div",{className:"mkt-modal__thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{children:[e.jsx("div",{className:"mkt-modal__name",title:s.name,children:s.name||"Item"}),e.jsx("span",{className:"chip chip--rarity",children:s.rarity})]})]}),e.jsx("div",{className:"mkt-modal__price",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Final price"}),e.jsxs("div",{className:"mkt-modal__price-value",children:[e.jsx(E,{className:"mkt-modal__diamond"}),J(n.credits)]}),e.jsxs("div",{className:"mkt-modal__price-sub muted",children:["Locked for this purchase · $",(n.usdCents/100).toFixed(2)]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Today’s price"}),e.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[e.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),e.jsx(E,{className:"mkt-modal__diamond"}),J(S)]}),e.jsx("div",{className:"mkt-modal__price-sub muted",children:j||"Locking today’s price…"})]})}),t?e.jsxs("div",{className:"mkt-modal__balance muted",children:["Your balance: ",e.jsx(E,{className:"ccy-mark"})," ",Ce(d,y)]}):null,F?e.jsxs("p",{className:"muted mkt-modal__note",children:["You’ll need a few more ",H.name," to buy this."]}):null,j&&h==="working"?e.jsx("p",{className:"muted mkt-modal__note",children:j}):null,C?e.jsx("p",{className:"error mkt-modal__note",children:C}):null,e.jsxs("div",{className:"mkt-modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:g,disabled:k,children:"Cancel"}),e.jsx("button",{className:"btn btn--purple",onClick:P,disabled:k||!n,children:k?"Buying…":F?`Get ${H.name}`:"Confirm purchase"})]})]})]})}const He=48,w=1e5,Ke={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 Ye(s){return{tradeId:s.tradeId??s.id,listingType:"primary",contractAddress:s.contractAddress,itemId:s.itemId??"",name:s.name,thumbnail:s.thumbnail,rarity:s.rarity,category:s.category,wearableCategory:s.wearableCategory??null,creator:s.creator,manaWei:s.manaWei??"0",available:1,network:s.network,chainId:s.chainId,createdAt:0}}function ts(){const[s]=ye(),c=(s.get("q")??"").trim().toLowerCase(),o=ae(),[b,t]=l.useState("wearable"),[d,y]=l.useState(null),[r,m]=l.useState([]),[h,i]=l.useState(""),[j,I]=l.useState(""),[C,M]=l.useState("newest"),[n,G]=l.useState(!1),[f,S]=l.useState(!1),[F,P]=l.useState(null);l.useEffect(()=>{if(!f)return;const a=_=>{_.key==="Escape"&&S(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[f]);const g=h&&!Number.isNaN(Number(h))?Number(h):void 0,k=j&&!Number.isNaN(Number(j))?Number(j):void 0,v=d?Ke[d]:void 0,u=(K.find(a=>a.key===C)??K[0]).server,p={category:b,rarities:r.length?r:void 0,wearableCategories:v,minPriceCredits:g,maxPriceCredits:k,search:c||void 0,sortBy:u},{items:x,total:$,isLoading:N,error:re,hasNextPage:te,isFetchingNextPage:Y,fetchNextPage:ie}=$e(["unified-listings",p],a=>we({...p,first:He,skip:a})),L=$,{data:B,isError:ne}=Le(),le=a=>B&&a.manaWei?Ee(a.manaWei,B):null,Q=l.useRef(null);l.useEffect(()=>{N||!c||Q.current===c||(Q.current=c,R("Shop Searched",{query:c,result_count:L}))},[c,N,L]);const q=l.useRef("__init__");l.useEffect(()=>{if(N)return;const a=JSON.stringify({category:b,subCategory:d,rarities:r,min:g,max:k,sort:C});if(q.current==="__init__"||q.current===a){q.current=a;return}q.current=a,R("Shop Applied Filter",{filters:{category:b,sub_category:d,rarities:r,min_price_credits:g??null,max_price_credits:k??null,sort:C},result_count:L})},[b,d,r,g,k,C,N,L]);function ce(a){t(a),y(null)}function oe(a){m(_=>_.includes(a)?_.filter(O=>O!==a):[..._,a])}function de(){t("wearable"),y(null),m([]),i(""),I("")}function ue(a){const _=x.find(O=>O.id===a.id);_&&_.source==="legacy"&&_.manaWei&&P(Ye(_))}function me(){o.invalidateQueries({queryKey:["unified-listings"]})}const T=g!=null?Math.min(g,w):0,W=k!=null?Math.min(k,w):w,he=T/w*100,pe=W/w*100;function _e(a){const _=Math.min(a,W);i(_<=0?"":String(_))}function be(a){const _=Math.max(a,T);I(_>=w?"":String(_))}return e.jsxs("div",{className:"browse browse--sidebar",children:[f?e.jsx("div",{className:"browse__scrim",onClick:()=>S(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${f?" is-open":""}`,children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:"Filters"}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>S(!1),"aria-label":"Close filters",children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:"Category"}),e.jsx(qe,{category:b,subCategory:d,onCategory:ce,onSub:y}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:"Price"}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:"Min"}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(E,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":"Minimum price",placeholder:"0",value:h,onChange:a=>i(a.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:"to"}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:"Max"}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(E,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"0",value:j,onChange:a=>I(a.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${he}%`,"--max-pct":`${pe}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:w,value:T,"aria-label":"Minimum price slider",onChange:a=>_e(Number(a.target.value))}),e.jsx("input",{type:"range",min:0,max:w,value:W,"aria-label":"Maximum price slider",onChange:a=>be(Number(a.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(E,{className:"price-filter__coin"}),T.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(E,{className:"price-filter__coin"}),W.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","aria-expanded":n,onClick:()=>G(a=>!a),children:[e.jsx("span",{className:"sidebar__section-label",children:"Rarity"}),e.jsx("span",{className:`ico ico-chevron sidebar__section-chev${n?" is-up":""}`,"aria-hidden":!0})]}),n?e.jsx("div",{className:"rarity-filter",children:Te.map(a=>e.jsxs("label",{className:`rarity-filter__check${r.includes(a)?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:r.includes(a),onChange:()=>oe(a)}),e.jsx("span",{children:a})]},a))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:de,children:"Clear Filters"}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>S(!1),children:"Apply"})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(Ge,{sort:C,onSort:M,total:$,loading:N,query:c,onOpenFilters:()=>S(!0)}),ne&&x.some(a=>a.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:"Some market prices are temporarily unavailable — buying those items is paused for a moment. Please try again shortly."}):null,re?e.jsx("p",{className:"error",children:"Couldn’t load items — please try again."}):null,e.jsx("div",{className:"grid",children:N?e.jsx(X,{count:15}):e.jsxs(e.Fragment,{children:[x.map(a=>a.source==="legacy"?e.jsx(Z,{item:a,mode:"market",marketPriceCredits:le(a),onBuyNow:ue},a.id):e.jsx(Z,{item:a},a.id)),Y?e.jsx(X,{count:6}):null]})}),e.jsx(Ie,{hasNextPage:te,isFetching:Y,onLoadMore:()=>ie()}),!N&&x.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]}),F&&B?e.jsx(Ue,{listing:F,rate:B,onClose:()=>P(null),onSold:()=>{P(null),me()}}):null]})}export{ts as Assets};
@@ -0,0 +1 @@
1
+ import{a as se,r as v,j as s,L as B}from"./react-iAgwec9M.js";import{q as te,s as ae,m as R,c as re,u as ne,v as ce,w as ie,t as I,C as le,e as F,x as oe,y as H,A as de,z as L,D,E as q,F as ue,G as he,H as K,I as me,J as pe,h as fe,K as _e,L as ye}from"./index-BJ_QKI7g.js";import{b as O}from"./buy-DK-hDYib.js";import{g as ge,b as be,w as xe,S as ve,G as je}from"./buy-gasless-BqKKprU3.js";import"./ethers-D-4WUfRB.js";import"./trade-encoding-ELuUTRbi.js";import"./index-CfK4LG22.js";function Ce(t){return Math.ceil(t/10)}async function Ne(t,n,o){var S;const g=[],a=[],j=[];for(const r of t)try{const h=await o(r);if(!h){a.push(r);continue}if(te(h,n)){j.push(r);continue}const _=ae((S=h.received[0])==null?void 0:S.amount);if(!Number.isFinite(_)||_<=0){a.push(r);continue}g.push({item:r,trade:h,usdCents:_,priceCredits:Ce(_)})}catch{a.push(r)}const C=g.reduce((r,h)=>r+h.priceCredits,0),b=a.length>0||j.length>0||g.some(r=>r.priceCredits!==r.item.priceCredits);return{buyable:g,unavailable:a,own:j,liveTotalCredits:C,orderChanged:b}}function Q(t){const n=t,o=(n.message??"").toLowerCase();return n.code===4001||o.includes("reject")||o.includes("denied")||o.includes("cancel")?"You cancelled the request.":o.includes("insufficient")?`You don't have enough ${H.name} — get more first.`:o.includes("no active listing")||o.includes("your own listing")?n.message:"Couldn't complete checkout — please try again."}const we=12e4;function ke(t){const n=[];return t.unavailable.length&&n.push(`${t.unavailable.length} no longer available`),t.own.length&&n.push(`${t.own.length} you can't buy (your own listing)`),`Removed ${n.join(" and ")} from your cart.`}function Le(){const t=R(e=>e.items),n=R(e=>e.remove),o=R(e=>e.clear),g=R(e=>e.setFittingOpen),{session:a}=re(),j=t.some(e=>e.category!=="emote"),{data:C}=ne({queryKey:["upsell-listings"],queryFn:()=>ye({first:40}),staleTime:6e4}),{data:b,isError:S}=ce(a),r=ie(),h=se(),[_,m]=v.useState(null),[z,p]=v.useState(null),[G,E]=v.useState(null),[N,T]=v.useState(!1),[d,w]=v.useState(null),M=v.useRef(0),P=t.reduce((e,c)=>e+c.priceCredits,0),V=d?d.liveTotalCredits:P,J=new Set(t.map(e=>e.id)),U=((C==null?void 0:C.items)??[]).filter(e=>!J.has(e.id)).slice(0,6),X=new Map(d==null?void 0:d.buyable.map(e=>[e.item.id,e])),Z=e=>e.tradeId?fe(e.tradeId):_e(e.contractAddress,e.itemId??"");function W(e){e(),w(null),E(null),p(null)}async function Y(e){if(!a||e.length===0)return;const c=e.map(i=>({...i.item,priceCredits:i.priceCredits})),y=[];let k="authorize",A=!1;try{m("Preparing your order…");const i=[];for(const l of e){const{credit:x,maxCreditedValue:f}=await ue(a.identity,l.usdCents,l.item.tradeId);y.push(x.id),i.push({trade:l.trade,credits:[x],maxCreditedValue:f})}m("Confirming your purchase…"),k="submit";let u=[];if(ge())try{u=await be({purchases:i,buyer:a.address,signer:a.signer});const x=(await Promise.allSettled(u.map(f=>xe(f)))).flatMap(f=>f.status==="rejected"?[f.reason]:[]);if(x.length&&!x.some(f=>f instanceof ve))throw x[0];A=!0}catch(l){if(!(l instanceof je))throw l;u=await O({purchases:i,buyer:a.address,signer:a.signer})}else u=await O({purchases:i,buyer:a.address,signer:a.signer});e.forEach(l=>n(l.item.id)),w(null),m("Purchased! 🎉"),L("Shop Completed Purchase",{...he(c),payment_type:"credits",no_crypto_step:A,transaction_hash:u[0]??null}),r.invalidateQueries({queryKey:["usd-balance"]}),h("/success",{state:{items:c,txHash:u[0]}})}catch(i){if(K(i)||q(i,{flow:"cart_checkout",step:k,cart_size:e.length}),L(K(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:k,error_code:me(i),value_usd:D(c.reduce((u,l)=>u+l.priceCredits,0)),cart_size:e.length}),y.length){try{await pe(a.identity,y)}catch(u){q(u,{flow:"cart_checkout",step:"release"})}r.invalidateQueries({queryKey:["usd-balance"]})}p(Q(i)),m(null)}}async function $(){if(!a){p("Sign in to check out.");return}p(null),E(null),T(!0),L("Shop Started Checkout",{cart_size:t.length,cart_value_credits:P,cart_value_usd:D(P),has_sufficient_credits:((b==null?void 0:b.credits)??0)>=P});try{m("Reviewing your cart…");const e=await Ne(t,a.address,Z),c=[...e.unavailable,...e.own];if(c.length&&(c.forEach(y=>n(y.id)),E(ke(e))),e.buyable.length===0){p("None of these items are available to buy right now."),w(null),m(null);return}if(e.orderChanged){w(e),M.current=Date.now(),m(null);return}await Y(e.buyable)}catch(e){q(e,{flow:"cart_checkout",step:"review",cart_size:t.length}),p(Q(e)),m(null)}finally{T(!1)}}async function ee(){if(d){if(!a){p("Sign in to check out.");return}if(Date.now()-M.current>we){w(null),E(null),await $();return}p(null),T(!0);try{await Y(d.buyable)}finally{T(!1)}}}return t.length===0?s.jsxs("div",{className:"cart cart--empty",children:[s.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),s.jsx("p",{className:"cart-empty__title",children:I("cart.empty.title")}),s.jsx("p",{className:"muted",children:I("cart.empty.body")}),s.jsx(B,{className:"btn btn--purple",to:"/assets",children:I("cart.empty.cta")})]}):s.jsxs("div",{className:"cart",children:[s.jsxs("h1",{children:["Cart (",t.length,")"]}),s.jsxs("div",{className:"cart__body",children:[s.jsxs("div",{className:"cart__main",children:[s.jsx("div",{className:"cart__list",children:t.map(e=>{const c=X.get(e.id),y=c?c.priceCredits:e.priceCredits,k=!!c&&c.priceCredits!==e.priceCredits;return s.jsxs("div",{className:"cart__row",children:[s.jsx("div",{className:"cart__thumb",children:e.thumbnail?s.jsx("img",{src:e.thumbnail,alt:e.name}):null}),s.jsxs("div",{className:"cart__info",children:[s.jsx("div",{className:"cart__name",children:e.name}),e.creator?s.jsx(le,{address:e.creator,className:"cart__creator",linkToProfile:!0}):null]}),s.jsxs("div",{className:"cart__price",children:[s.jsx(F,{className:"ccy-mark"})," ",y,k?s.jsx("span",{className:"muted",style:{marginLeft:6,textDecoration:"line-through"},children:e.priceCredits}):null]}),s.jsx("button",{className:"cart__remove",onClick:()=>W(()=>n(e.id)),disabled:N,"aria-label":`Remove ${e.name}`,title:"Remove",children:s.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},e.id)})}),s.jsxs("div",{className:"cart__utils",children:[s.jsx("button",{className:"link",onClick:()=>W(o),disabled:N,children:"Clear cart"}),null]})]}),s.jsxs("aside",{className:"cart__summary",children:[s.jsx("h2",{className:"cart__summary-title",children:"Order summary"}),s.jsxs("div",{className:"cart__total",children:[s.jsxs("div",{className:"cart__total-line",children:[s.jsx("span",{children:"Total"}),s.jsxs("strong",{children:[s.jsx(F,{className:"ccy-mark"})," ",V]})]}),a?s.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",s.jsx(F,{className:"ccy-mark"})," ",oe(b,S)]}):null]}),s.jsxs("div",{className:"cart__actions",children:[s.jsx("button",{className:"btn btn--purple cart__checkout",onClick:d?ee:$,disabled:N,children:N?"Working…":d?"Confirm purchase":"Checkout"}),s.jsxs(B,{className:"btn btn--ghost",to:"/credits",children:["Get ",H.name]}),j?s.jsx("button",{className:"btn btn--ghost",onClick:()=>g(!0),disabled:N,children:"Try on outfit"}):null]}),d?s.jsx("p",{className:"muted cart__msg",children:"Prices or availability changed since you added these — review the updated total and confirm to buy."}):null,G?s.jsx("p",{className:"muted cart__msg",children:G}):null,_?s.jsx("p",{className:"muted cart__msg",children:_}):null,z?s.jsx("p",{className:"error cart__msg",children:z}):null]})]}),U.length>0?s.jsxs("section",{className:"row cart-upsell",children:[s.jsx("div",{className:"row__head",children:s.jsx("h2",{className:"row__title",children:"You might also like"})}),s.jsx("div",{className:"row__track",children:U.map(e=>s.jsx(de,{item:e},e.id))})]}):null]})}export{Le as Cart};
@@ -1,4 +1,4 @@
1
- import{S as N,T as U,U as w,V as z,X as o,Y as E,Z as c,$ as I,a0 as g,a1 as D,a2 as M}from"./index-BW6d6BbH.js";import{r as F,j as v}from"./react-CQ5qhqs6.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const V=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
1
+ import{T as N,U,V as w,X as z,Y as o,Z as E,$ as c,a0 as I,a1 as g,a2 as D,a3 as M}from"./index-BJ_QKI7g.js";import{r as F,j as v}from"./react-iAgwec9M.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const V=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1 +1 @@
1
- import{u as j,a as _,j as e}from"./react-CQ5qhqs6.js";import{u as N,t as u,C as f,A as b,f as C,a as A}from"./index-BW6d6BbH.js";import{A as v}from"./collection-B34IwUC5.js";import{S as h}from"./SkeletonCards-DSpqiDzZ.js";import{L as y}from"./LoadMore-7qZApSeo.js";import{u as L}from"./useInfiniteGrid-Dvh83G5j.js";import"./ethers-DXxh-eEm.js";const P=48;function B(){var d;const{contractAddress:a}=j(),p=_(),{items:t,total:o,isLoading:l,error:r,hasNextPage:g,isFetchingNextPage:n,fetchNextPage:x}=L(["collection-page",a],c=>C(a,{first:P,skip:c}),{enabled:!!a}),{data:s}=N({queryKey:["collection-meta",a],queryFn:()=>A(a),enabled:!!a,staleTime:5*6e4}),i=(s==null?void 0:s.name)||u("collection.fallbackTitle"),m=(s==null?void 0:s.creator)||((d=t[0])==null?void 0:d.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:()=>p("/assets"),children:u("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:i})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:i}),m?e.jsx(f,{address:m,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:l?"…":`${o.toLocaleString()} item${o===1?"":"s"}`})]}),!l&&t.length>0?e.jsx(v,{items:t,source:"collection"}):null,r?e.jsx("p",{className:"error",children:"Couldn’t load this collection — please try again."}):null,e.jsx("div",{className:"grid",children:l?e.jsx(h,{count:12}):e.jsxs(e.Fragment,{children:[t.map(c=>e.jsx(b,{item:c},c.id)),n?e.jsx(h,{count:6}):null]})}),e.jsx(y,{hasNextPage:g,isFetching:n,onLoadMore:()=>x()}),!l&&!r&&t.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{B as Collection,B as default};
1
+ import{u as j,a as _,j as e}from"./react-iAgwec9M.js";import{u as N,t as u,C as f,A as b,f as C,a as A}from"./index-BJ_QKI7g.js";import{A as v}from"./collection-BGWAmfIC.js";import{S as h}from"./SkeletonCards-BhzQlTiQ.js";import{L as y}from"./LoadMore-8Dx5lULo.js";import{u as L}from"./useInfiniteGrid-XR5F3f0o.js";import"./ethers-D-4WUfRB.js";const P=48;function B(){var d;const{contractAddress:a}=j(),p=_(),{items:t,total:o,isLoading:l,error:r,hasNextPage:g,isFetchingNextPage:n,fetchNextPage:x}=L(["collection-page",a],c=>C(a,{first:P,skip:c}),{enabled:!!a}),{data:s}=N({queryKey:["collection-meta",a],queryFn:()=>A(a),enabled:!!a,staleTime:5*6e4}),i=(s==null?void 0:s.name)||u("collection.fallbackTitle"),m=(s==null?void 0:s.creator)||((d=t[0])==null?void 0:d.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:()=>p("/assets"),children:u("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:i})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:i}),m?e.jsx(f,{address:m,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:l?"…":`${o.toLocaleString()} item${o===1?"":"s"}`})]}),!l&&t.length>0?e.jsx(v,{items:t,source:"collection"}):null,r?e.jsx("p",{className:"error",children:"Couldn’t load this collection — please try again."}):null,e.jsx("div",{className:"grid",children:l?e.jsx(h,{count:12}):e.jsxs(e.Fragment,{children:[t.map(c=>e.jsx(b,{item:c},c.id)),n?e.jsx(h,{count:6}):null]})}),e.jsx(y,{hasNextPage:g,isFetching:n,onLoadMore:()=>x()}),!l&&!r&&t.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{B as Collection,B as default};
@@ -1 +1 @@
1
- import{p as t}from"./ethers-DXxh-eEm.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-D-4WUfRB.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-CQ5qhqs6.js";import{k as i,C as h,A as x,l as j}from"./index-BW6d6BbH.js";import{A as f}from"./collection-B34IwUC5.js";import{S as m}from"./SkeletonCards-DSpqiDzZ.js";import{L as N}from"./LoadMore-7qZApSeo.js";import{u as b}from"./useInfiniteGrid-Dvh83G5j.js";import"./ethers-DXxh-eEm.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:"Couldn’t load this creator — please try again."}):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-iAgwec9M.js";import{k as i,C as h,A as x,l as j}from"./index-BJ_QKI7g.js";import{A as f}from"./collection-BGWAmfIC.js";import{S as m}from"./SkeletonCards-BhzQlTiQ.js";import{L as N}from"./LoadMore-8Dx5lULo.js";import{u as b}from"./useInfiniteGrid-XR5F3f0o.js";import"./ethers-D-4WUfRB.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:"Couldn’t load this creator — please try again."}):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-B6_3Zs6I.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Bn1ikbQg.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-Dhy5L90S.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-a9iM5Ppc.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};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-CXz68lrR.js","assets/react-iAgwec9M.js","assets/index-BJ_QKI7g.js","assets/ethers-D-4WUfRB.js","assets/index-Ctf6wteV.css"])))=>i.map(i=>d[i]);
2
+ import{ah as $,i as y,ai as U,c as F,w as L,z as p,E as S,I as E,y as l,e as k,aj as I,_ as V}from"./index-BJ_QKI7g.js";import{a as Y,r as u,j as e}from"./react-iAgwec9M.js";import{C as N}from"./CircularProgress-D2LB2Tot.js";import"./ethers-D-4WUfRB.js";function R(){return y.shopServerUrl||y.creditsServerUrl}async function K(t,s){const r=await $(`${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:i}=await r.json();return{orderId:a,clientSecret:i,mock:!1}}async function z(t,s,r={}){const{intervalMs:a=1500,timeoutMs:i=6e4,signal:c}=r,n=Date.now()+i;for(;;){if(c!=null&&c.aborted)throw new DOMException("Aborted","AbortError");const m=await q(t,s,c);if(m.status!=="processing")return m;if(Date.now()>n)return{status:"pending"};await Q(a,c)}}async function q(t,s,r){const a=await $(`${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 Q(t,s){return new Promise((r,a)=>{const i=setTimeout(r,t);s==null||s.addEventListener("abort",()=>{clearTimeout(i),a(new DOMException("Aborted","AbortError"))})})}const W=.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/W)}function M(t){return G.find(s=>s.id===t)}const j="mock_cs_",H=new Set([80002,11155111,1337,31337]);function C(){const t=!y.stripePublishableKey;if(t&&!H.has(y.chainId))throw new Error(`Stripe publishable key is missing on chainId=${y.chainId}, which is not a recognized test network. Refusing to fall back to mock payments in a real-money environment — configure STRIPE_PUBLISHABLE_KEY.`);return t}async function J(t,s){const r=M(t);if(!r)throw new Error("Unknown pack");if(C())return Z(r);if(!(s!=null&&s.identity))throw new Error("Sign in to get credits.");return K(t,s.identity)}async function X(t,s={}){const{intervalMs:r,timeoutMs:a,signal:i,identity:c}=s;if(C()||t.startsWith(j))return ee(t,s);if(!c)throw new Error("Sign in to get credits.");return z(t,c,{intervalMs:r,timeoutMs:a,signal:i})}function Z(t){const s=`${j}${t.id}_${Date.now()}`;return T(400).then(()=>({orderId:s,clientSecret:`${j}${t.id}`,mock:!0}))}async function ee(t,s={}){await T(s.intervalMs??900);const r=t.replace(j,"").replace(/_\d+$/,""),a=M(r),i=(a==null?void 0:a.credits)??0;if(s.address&&a)try{const c=await U(s.address,Math.round(a.usd*100));return{status:"credited",creditsGranted:i,newBalance:c.credits}}catch(c){return{status:"failed",error:c.message}}return{status:"credited",creditsGranted:i,newBalance:i}}function T(t,s){return new Promise((r,a)=>{setTimeout(r,t)})}const b=C()?"mock":"stripe",se=u.lazy(()=>V(()=>import("./RealCheckout-CXz68lrR.js"),__vite__mapDeps([0,1,2,3,4])));function P(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 ${l.name}.`:r.includes("timed out")?`This is taking longer than usual — your ${l.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function de(){const t=Y(),{session:s,signIn:r}=F(),a=L(),[i,c]=u.useState("select"),[n,m]=u.useState(null),[h,w]=u.useState(null),[B,v]=u.useState(null),[D,_]=u.useState(null),f=u.useRef(null);u.useEffect(()=>()=>{var d;return(d=f.current)==null?void 0:d.abort()},[]);const A=u.useCallback(async d=>{if(!s){r();return}_(null),m(d),c("paying"),p("Shop Started Buy Credits",{pack_usd:d.usd,credits:d.credits,provider:b});try{const o=await J(d.id,{address:s.address,identity:s.identity});w(o)}catch(o){S(o,{flow:"get_credits",step:"checkout",provider:b}),p("Shop Buy Credits Failed",{step:"checkout",error_code:E(o),pack_usd:d.usd}),_(P(o)),c("error")}},[s,r]),O=u.useCallback(async()=>{if(!h)return;c("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"?(v(o.creditsGranted??(n==null?void 0:n.credits)??0),c("success"),p("Shop Completed Buy Credits",{order_id:h.orderId,pack_usd:(n==null?void 0:n.usd)??null,credits:o.creditsGranted??(n==null?void 0:n.credits)??0,provider:b}),a.invalidateQueries({queryKey:["usd-balance"]})):o.status==="pending"?(p("Shop Buy Credits Pending",{step:"grant",pack_usd:(n==null?void 0:n.usd)??null}),a.invalidateQueries({queryKey:["usd-balance"]}),c("pending")):(p("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(n==null?void 0:n.usd)??null}),_(o.error??`Couldn't add your ${l.name} — please try again.`),c("error"))}catch(o){S(o,{flow:"get_credits",step:"grant",order_id:h.orderId}),p("Shop Buy Credits Failed",{step:"grant",error_code:E(o),pack_usd:(n==null?void 0:n.usd)??null}),_(P(o)),c("error")}},[h,n,s,a]);function g(){var d;(d=f.current)==null||d.abort(),c("select"),m(null),w(null),v(null),_(null)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",l.name]}),e.jsxs("p",{className:"muted",children:["Add ",l.name," to your account to shop. Pay with any card."]})]}),s?e.jsxs(e.Fragment,{children:[i==="select"&&e.jsx(te,{onSelect:A}),i==="paying"&&n&&e.jsx(re,{pack:n,checkout:h,onPaid:O,onCancel:g}),i==="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 ",l.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),i==="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(k,{className:"ccy-mark"})," ",B]})," ",l.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 ",l.name]})]})]}),i==="pending"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Your ",l.name," are on the way"]}),e.jsx("p",{className:"muted",children:"Your payment went through. It’s taking a little longer than usual to confirm — your balance will update automatically as soon as it lands, no need to pay again."}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>t("/cart"),children:"Back to cart"}),e.jsx("button",{className:"btn btn--ghost",onClick:g,children:"Done"})]})]}),i==="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:D}),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 ",l.name]}),e.jsxs("p",{className:"muted",children:["Connect your account to buy ",l.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 te({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 ${I(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(k,{className:"pack__credits-ico"}),s.credits]}),e.jsx("span",{className:"pack__label",children:l.name}),e.jsxs("span",{className:"pack__price",children:["$",s.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",l.name]})]},s.id))})}function re({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(k,{className:"ccy-mark"})," ",I(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(ae,{onPaid:r,amountUsd:t.usd}):e.jsx(u.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(se,{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 ae({onPaid:t,amountUsd:s}){const[r,a]=u.useState("4242 4242 4242 4242"),[i,c]=u.useState(!1);function n(){c(!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:i,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:i})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"CVC"}),e.jsx("input",{defaultValue:"123",disabled:i,inputMode:"numeric"})]})]}),e.jsx("button",{className:"btn btn--purple card-form__pay",onClick:n,disabled:i,children:i?"Processing…":`Pay $${s}`})]})}export{de as GetCredits,de 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-BTusn-cp.js";import{d as g,r as v}from"./index-Bn1ikbQg.js";import{C as c}from"./ConstantsUtil-DrbbN8Db.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-B6_3Zs6I.js";import{au as y}from"./NetworkUtil-BI8jZwmc.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-SeURPzoq.js";import{d as g,r as v}from"./index-a9iM5Ppc.js";import{C as c}from"./ConstantsUtil-rB_9qX5U.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-Dhy5L90S.js";import{au as y}from"./NetworkUtil-Cm_KFCNa.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 p,j as e,L as A}from"./react-CQ5qhqs6.js";import{y as Q,D as L,x as S,e as v,c as R,w as F,u as K,o as P}from"./index-BW6d6BbH.js";import{i as W,R as Y,f as G}from"./import-1qZmk-ve.js";import{s as O}from"./wallet-kind-C_qy0E-X.js";import"./ethers-DXxh-eEm.js";import"./buy-BXsYo32e.js";import"./trade-encoding-CgWHvMsc.js";import"./index-CuI-U7nJ.js";import"./mana-rate-DbXjP8PT.js";function B({queue:n,session:I,onClose:g,onDone:h}){const x=E(),c=O(I.providerType),[d,j]=p.useState(()=>n.map(()=>"pending")),[b,C]=p.useState("running"),w=p.useRef(!1);p.useEffect(()=>{if(w.current)return;w.current=!0;let t=!1;return(async()=>{for(let s=0;s<n.length;s++){if(t)return;j(r=>r.map((m,o)=>o===s?"active":m));try{await W(n[s].item,n[s].priceCredits,I),Q("Shop Migrated Listing",{item_id:n[s].item.itemId??n[s].item.oldTradeId??null,contract_address:n[s].item.contractAddress,new_price_credits:n[s].priceCredits,new_price_usd:n[s].priceCredits/10}),t||j(r=>r.map((m,o)=>o===s?"done":m))}catch(r){if(r instanceof Y)L(r,{flow:"import_listing",step:"relist",itemId:n[s].item.itemId??n[s].item.oldTradeId}),t||j(m=>m.map((o,y)=>y===s?"unlisted":o));else{const m=r,o=m.code===4001||/reject|denied|cancel/i.test(m.message??"");o||L(r,{flow:"import_listing",itemId:n[s].item.itemId??n[s].item.oldTradeId}),t||j(y=>y.map((T,a)=>a===s?o?"skipped":"failed":T))}}}t||C("finished")})(),()=>{t=!0}},[]);const u=d.filter(t=>t==="done").length,N=d.findIndex(t=>t==="active"),_=Math.round(d.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function f(){h(),g()}if(b==="finished"){const t=d.filter(r=>r==="skipped"||r==="failed").length,s=d.filter(r=>r==="unlisted").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:u>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[u>0?`${u} ${u===1?"item is":"items are"} now for sale with ${S.name}.`:"No items were listed.",t>0?` ${t} skipped — you can try those again anytime.`:"",s>0?` ${s} ${s===1?"item was":"items were"} taken off the old marketplace but couldn't be re-listed — re-list ${s===1?"it":"them"} from My Assets.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:f,children:"Done"}),s>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/my-assets")},children:"Go to My Assets"}):u>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/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:[c?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",N>=0?`${N+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((t,s)=>e.jsxs("li",{className:`migrate__row migrate__row--${d[s]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:d[s]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",c?"Confirm…":"Adding…"]}):d[s]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):d[s]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):d[s]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):d[s]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:"Removed from the old marketplace but not re-listed — re-list it from My Assets.",children:"Not listed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:c?"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 se(){const{session:n,signIn:I,restore:g}=R(),h=F(),x=n==null?void 0:n.address;p.useEffect(()=>{g()},[g]);const{data:c,isLoading:d}=K({queryKey:["importable",x],queryFn:()=>G(x),enabled:!!x}),[j,b]=p.useState({}),[C,w]=p.useState(new Set),[u,N]=p.useState(null),_=p.useMemo(()=>[...(c==null?void 0:c.creations)??[],...(c==null?void 0:c.owned)??[]],[c]);p.useEffect(()=>{_.length&&b(a=>{const l={...a};for(const i of _)l[i.oldTradeId]==null&&(l[i.oldTradeId]=i.suggestedCredits);return l})},[_]);const f=a=>!C.has(a),t=a=>j[a.oldTradeId]??a.suggestedCredits,s=_.filter(a=>f(a.oldTradeId)),r=s.reduce((a,l)=>a+t(l),0);function m(a,l){const i=l.replace(/[^\d]/g,"");b(k=>({...k,[a]:i===""?0:parseInt(i,10)}))}function o(a){w(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function y(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function T(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["unified-listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),P.success("Your Shop is updated.")}return n?!d&&_.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(A,{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 ",S.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 ",S.nameSingular," = $0.10 · prices rounded up"]}),d?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,l)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},l))}):D.map(a=>{const l=(c==null?void 0:c[a.key])??[];return l.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:a.title}),e.jsx("span",{className:"imp__section-sub",children:a.sub})]}),e.jsx("div",{className:"imp__list",children:l.map(i=>{const k=t(i),M=k!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${f(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:f(i.oldTradeId),onChange:()=>o(i.oldTradeId),"aria-label":`Include ${i.name}`}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||"Item"}),e.jsx("span",{className:"imp-chip",children:i.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:k.toLocaleString(),onChange:$=>m(i.oldTradeId,$.target.value),"aria-label":`Price in ${S.name} for ${i.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(k*.1).toFixed(2)]}),M?e.jsxs("button",{className:"imp-price__reset",onClick:()=>b($=>({...$,[i.oldTradeId]:i.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!f(i.oldTradeId),onClick:()=>N(y([i])),children:"List"})})]},i.oldTradeId)})})]},a.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"})," ",r.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[s.length," item",s.length===1?"":"s"," selected · $",(r*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:s.length===0,onClick:()=>N(y(s)),children:["List all (",s.length,")"]})]})}),u&&n?e.jsx(B,{queue:u,session:n,onClose:()=>N(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:()=>I(),children:"Sign in"})]})}export{se as ImportListings};
1
+ import{a as E,r as p,j as e,L as A}from"./react-iAgwec9M.js";import{z as Q,E as L,y as S,e as v,c as R,w as F,u as K,o as P}from"./index-BJ_QKI7g.js";import{i as W,R as Y,f as G}from"./import-Cicp42pB.js";import{s as O}from"./wallet-kind-g2ENkqJ_.js";import"./ethers-D-4WUfRB.js";import"./buy-DK-hDYib.js";import"./trade-encoding-ELuUTRbi.js";import"./index-CfK4LG22.js";import"./mana-rate-nE0eZdyC.js";function z({queue:n,session:I,onClose:g,onDone:h}){const x=E(),c=O(I.providerType),[d,j]=p.useState(()=>n.map(()=>"pending")),[b,C]=p.useState("running"),w=p.useRef(!1);p.useEffect(()=>{if(w.current)return;w.current=!0;let t=!1;return(async()=>{for(let s=0;s<n.length;s++){if(t)return;j(r=>r.map((m,o)=>o===s?"active":m));try{await W(n[s].item,n[s].priceCredits,I),Q("Shop Migrated Listing",{item_id:n[s].item.itemId??n[s].item.oldTradeId??null,contract_address:n[s].item.contractAddress,new_price_credits:n[s].priceCredits,new_price_usd:n[s].priceCredits/10}),t||j(r=>r.map((m,o)=>o===s?"done":m))}catch(r){if(r instanceof Y)L(r,{flow:"import_listing",step:"relist",itemId:n[s].item.itemId??n[s].item.oldTradeId}),t||j(m=>m.map((o,y)=>y===s?"unlisted":o));else{const m=r,o=m.code===4001||/reject|denied|cancel/i.test(m.message??"");o||L(r,{flow:"import_listing",itemId:n[s].item.itemId??n[s].item.oldTradeId}),t||j(y=>y.map((T,a)=>a===s?o?"skipped":"failed":T))}}}t||C("finished")})(),()=>{t=!0}},[]);const u=d.filter(t=>t==="done").length,N=d.findIndex(t=>t==="active"),_=Math.round(d.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function f(){h(),g()}if(b==="finished"){const t=d.filter(r=>r==="skipped"||r==="failed").length,s=d.filter(r=>r==="unlisted").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:u>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[u>0?`${u} ${u===1?"item is":"items are"} now for sale with ${S.name}.`:"No items were listed.",t>0?` ${t} skipped — you can try those again anytime.`:"",s>0?` ${s} ${s===1?"item was":"items were"} taken off the old marketplace but couldn't be re-listed — re-list ${s===1?"it":"them"} from My Assets.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:f,children:"Done"}),s>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/my-assets")},children:"Go to My Assets"}):u>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/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:[c?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",N>=0?`${N+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((t,s)=>e.jsxs("li",{className:`migrate__row migrate__row--${d[s]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:d[s]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",c?"Confirm…":"Adding…"]}):d[s]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):d[s]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):d[s]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):d[s]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:"Removed from the old marketplace but not re-listed — re-list it from My Assets.",children:"Not listed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:c?"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 B=[{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 se(){const{session:n,signIn:I,restore:g}=R(),h=F(),x=n==null?void 0:n.address;p.useEffect(()=>{g()},[g]);const{data:c,isLoading:d}=K({queryKey:["importable",x],queryFn:()=>G(x),enabled:!!x}),[j,b]=p.useState({}),[C,w]=p.useState(new Set),[u,N]=p.useState(null),_=p.useMemo(()=>[...(c==null?void 0:c.creations)??[],...(c==null?void 0:c.owned)??[]],[c]);p.useEffect(()=>{_.length&&b(a=>{const l={...a};for(const i of _)l[i.oldTradeId]==null&&(l[i.oldTradeId]=i.suggestedCredits);return l})},[_]);const f=a=>!C.has(a),t=a=>j[a.oldTradeId]??a.suggestedCredits,s=_.filter(a=>f(a.oldTradeId)),r=s.reduce((a,l)=>a+t(l),0);function m(a,l){const i=l.replace(/[^\d]/g,"");b(k=>({...k,[a]:i===""?0:parseInt(i,10)}))}function o(a){w(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function y(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function T(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["unified-listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),P.success("Your Shop is updated.")}return n?!d&&_.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(A,{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 ",S.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 ",S.nameSingular," = $0.10 · prices rounded up"]}),d?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,l)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},l))}):B.map(a=>{const l=(c==null?void 0:c[a.key])??[];return l.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:a.title}),e.jsx("span",{className:"imp__section-sub",children:a.sub})]}),e.jsx("div",{className:"imp__list",children:l.map(i=>{const k=t(i),M=k!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${f(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:f(i.oldTradeId),onChange:()=>o(i.oldTradeId),"aria-label":`Include ${i.name}`}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||"Item"}),e.jsx("span",{className:"imp-chip",children:i.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:k.toLocaleString(),onChange:$=>m(i.oldTradeId,$.target.value),"aria-label":`Price in ${S.name} for ${i.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(k*.1).toFixed(2)]}),M?e.jsxs("button",{className:"imp-price__reset",onClick:()=>b($=>({...$,[i.oldTradeId]:i.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!f(i.oldTradeId),onClick:()=>N(y([i])),children:"List"})})]},i.oldTradeId)})})]},a.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"})," ",r.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[s.length," item",s.length===1?"":"s"," selected · $",(r*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:s.length===0,onClick:()=>N(y(s)),children:["List all (",s.length,")"]})]})}),u&&n?e.jsx(z,{queue:u,session:n,onClose:()=>N(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:()=>I(),children:"Sign in"})]})}export{se 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:24px}.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,1045fr) minmax(0,514fr);gap:48px;align-items:start;max-width:1607px;margin:0 auto}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr;gap:24px;max-width:none}}.item-detail__preview{position:relative;aspect-ratio:1045 / 752;border-radius:16px;overflow:hidden;background:var(--media)}@media(max-width:900px){.item-detail__preview{aspect-ratio:1 / 1}}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:16px;left:16px;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:12px;text-transform:uppercase;letter-spacing:.04em;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__preview>.item-preview__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:transparent}.item-preview__spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:item-preview-spin .8s linear infinite}@keyframes item-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.item-preview__spinner{animation-duration:2.4s}}.item-detail__info{display:flex;flex-direction:column;gap:20px}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:28px;font-weight:600;line-height:34px;color:var(--text-2)}.item-detail__fav{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:var(--media);display:grid;place-items:center;color:var(--text-2);cursor:pointer;transition:color .12s ease,background .12s ease}.item-detail__fav:hover{background:var(--line)}.item-detail__fav.is-on{color:var(--dcl-red)}.item-detail__fav .ico-heart{width:18px;height:18px}.item-detail__label{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:-6px}.item-detail__chips .chip{height:24px;padding:0 8px;gap:3px;font-size:12px;border-radius:4px;letter-spacing:.02em;text-transform:uppercase}.item-detail__chip{background:var(--chip);color:var(--text-2)}.item-detail__chip-ico{width:16px;height:16px;color:var(--text-2)}.item-detail__section{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:30px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;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__meta{display:grid;grid-template-columns:1fr 1fr;gap:16px}.item-detail__meta-col{display:flex;flex-direction:column;gap:10px;min-width:0}.item-detail__creator.creator{color:var(--accent);font-size:14px;gap:12px}.item-detail__creator .creator__ava{width:48px;height:48px}.item-detail__creator .creator__ava--letter{font-size:18px}.item-detail__creator .creator__name{color:var(--accent);font-weight:500;text-decoration:underline}.item-detail__creator.creator--link:hover .creator__name{color:var(--brand-violet)}.item-detail__divider{border:0;border-top:1px solid var(--line);margin:4px 0;width:100%}.item-detail__price-block{display:flex;flex-direction:column;gap:8px}.item-detail__price-label{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text)}.item-detail__diamond{width:30px;height:30px;color:var(--brand-violet)}.item-detail__price-value{font-size:30px;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;margin-top:4px}.item-detail__cta{width:100%;height:48px;border-radius:8px;font-size:15px;text-align:center}.item-detail__addcart{width:100%;height:48px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:8px;font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.046em;cursor:pointer;transition:filter .15s ease}.item-detail__addcart:hover:not(:disabled){filter:brightness(1.35)}.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}@media(max-width:900px){.item-detail__title{font-size:20px;line-height:24px}.item-detail__info-head{order:0}.item-detail__chips{order:1}.item-detail__meta{order:2;grid-template-columns:1fr}.item-detail__description{order:3}.item-detail__divider{order:4}.item-detail__price-block{order:5}.item-detail__ctas{order:6}.item-detail__status{order:7}}.collection-carousel{margin-top:64px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:22px;font-weight:700;color:var(--text)}.collection-carousel__viewall{display:inline-flex;align-items:center;gap:4px;background:none;border:0;padding:0;color:var(--accent);font-weight:700;font-size:13px;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__viewall-ico{width:16px;height:16px;transform:rotate(-90deg)}.collection-carousel__viewport{position:relative}.collection-carousel__arrow{position:absolute;top:calc(50% - 22px);transform:translateY(-50%);z-index:3;width:52px;height:52px;border-radius:50%;border:0;background:#fff;color:var(--text);font-size:24px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 16px #16151829;transition:transform .12s ease,box-shadow .12s ease,opacity .12s ease}.collection-carousel__arrow--left{left:-10px}.collection-carousel__arrow--right{right:-10px}.collection-carousel__arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.06);box-shadow:0 8px 20px #16151833}.collection-carousel__arrow:disabled{opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}@media(max-width:900px){.collection-carousel__arrow{display:none}}.collection-carousel__track{display:flex;gap:16px;overflow-x:auto;padding:12px 10px;margin:0 -10px;scroll-snap-type:x proximity;scrollbar-width:none}.collection-carousel__track::-webkit-scrollbar{display:none}.collection-carousel__track>.card{flex:0 0 281px;scroll-snap-align:start}@media(max-width:720px){.collection-carousel__track>.card{flex:0 0 44vw}}.collection-carousel__dots{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:18px}.collection-carousel__dot{width:10px;height:10px;border-radius:50%;border:0;padding:0;background:var(--line-strong);opacity:.5;cursor:pointer;transition:opacity .12s ease,background .12s ease,transform .12s ease}.collection-carousel__dot:hover{opacity:.8}.collection-carousel__dot.is-active{background:var(--accent);opacity:1;transform:scale(1.1)}.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-Bybrl6u1.js","assets/react-iAgwec9M.js","assets/index-BJ_QKI7g.js","assets/ethers-D-4WUfRB.js","assets/index-Ctf6wteV.css","assets/emotion-styled.browser.esm-Cuau_-ln.js","assets/CircularProgress-D2LB2Tot.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r,u as be,b as je,a as ge,L as ye}from"./react-iAgwec9M.js";import{_ as Ne,c as ie,M as we,P as Ie,O as Ce,an as Ae,W as ke,j as L,i as re,ao as Ee,A as Se,m as X,b as ee,v as Le,u as R,ap as Pe,z as D,aq as Te,ar as Re,as as Fe,at as $e,n as Be,au as Me,av as qe,C as We,e as F,aw as te,ax as Oe,x as ze,h as De,q as Ve,s as Ue,F as Ge,G as Ke,H as ae,E as Ye,J as He,D as Je,I as Qe,y as Ze,f as Xe,ay as et,az as tt,K as at}from"./index-BJ_QKI7g.js";import{a as se}from"./buy-DK-hDYib.js";import{g as st,a as it,w as rt,S as nt,G as lt}from"./buy-gasless-BqKKprU3.js";import"./ethers-D-4WUfRB.js";import"./trade-encoding-ELuUTRbi.js";import"./index-CfK4LG22.js";const ct=r.lazy(()=>Ne(()=>import("./index-Bybrl6u1.js").then(a=>a.i),__vite__mapDeps([0,1,2,3,4,5,6])).then(a=>({default:a.EmoteControls})));function dt(a){return e.jsx(r.Suspense,{fallback:null,children:e.jsx(ct,{...a})})}function ot({item:a}){const l=ie(c=>{var n;return(n=c.session)==null?void 0:n.address}),{data:s,isLoading:m}=we(l),w=l&&s?l:"default",_=a.category==="emote",[p,d]=r.useState("avatar"),f=!_&&p==="item",[A,t]=r.useState(!0);r.useEffect(()=>{t(!0)},[a.id,f]);const g=!!l&&!!s,o=g&&Ie(a,Ce(s)),b=Ae(a)[0],I=g&&!o&&!_;return e.jsxs(e.Fragment,{children:[m?null:e.jsx(ke,{id:"shop-item-preview",contractAddress:a.contractAddress,tokenId:a.tokenId??void 0,itemId:a.tokenId?void 0:a.itemId??void 0,profile:f?void 0:o?w:"default",bodyShape:f||o?void 0:b,type:_?void 0:f?L.PreviewType.WEARABLE:L.PreviewType.AVATAR,emote:_||f?void 0:L.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:_?1.5:void 0,wheelStart:_?100:void 0,dev:re.chainId===80002,onLoad:()=>t(!1)},a.id),m||A?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,I&&!f?e.jsxs("p",{className:"item-preview__note",children:["Shown on a ",Ee(b)," body — this item isn’t made for your avatar’s shape."]}):null,_?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(dt,{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:p==="avatar"?"is-active":"","aria-pressed":p==="avatar",onClick:()=>d("avatar"),children:"On avatar"}),e.jsx("button",{type:"button",className:p==="item"?"is-active":"","aria-pressed":p==="item",onClick:()=>d("item"),children:"Item"})]})]})}function mt({title:a,items:l,onViewAll:s}){const m=r.useRef(null),[w,_]=r.useState(1),[p,d]=r.useState(0),[f,A]=r.useState(!0),[t,g]=r.useState(!1),o=r.useCallback(()=>{const c=m.current;if(!c)return;const{scrollLeft:n,scrollWidth:y,clientWidth:v}=c,P=Math.max(1,Math.ceil(y/v));_(P),d(Math.min(P-1,Math.round(n/v))),A(n<=1),g(n+v>=y-1)},[]);if(r.useEffect(()=>{o();const c=m.current;if(c)return c.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",o),()=>{c.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,l.length]),l.length===0)return null;function b(c){const n=m.current;n&&n.scrollBy({left:c*n.clientWidth,behavior:"smooth"})}function I(c){const n=m.current;n&&n.scrollTo({left:c*n.clientWidth,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:a}),s?e.jsxs("button",{className:"collection-carousel__viewall",onClick:s,children:["View all",e.jsx("span",{className:"ico ico-chevron collection-carousel__viewall-ico","aria-hidden":!0})]}):null]}),e.jsxs("div",{className:"collection-carousel__viewport",children:[e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>b(-1),"aria-label":"Scroll left",disabled:f,children:"‹"}),e.jsx("div",{className:"collection-carousel__track",ref:m,children:l.map(c=>e.jsx(Se,{item:c},c.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>b(1),"aria-label":"Scroll right",disabled:t,children:"›"})]}),w>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":"Carousel pages",children:Array.from({length:w}).map((c,n)=>e.jsx("button",{className:`collection-carousel__dot${n===p?" is-active":""}`,"aria-label":`Go to page ${n+1}`,"aria-current":n===p?"true":void 0,onClick:()=>I(n)},n))}):null]})}function ut(a){return Object.values(L.Rarity).includes(a)}function ht(a){return a==="male"?"Male":a==="female"?"Female":a==="unisex"?"Unisex":null}function _t(a){return a.wearableCategory?a.wearableCategory.replace(/_/g," "):a.category==="emote"?"Emote":"Wearable"}function pt(a){const l=a,s=(l.message??"").toLowerCase();return l.code===4001||s.includes("reject")||s.includes("denied")||s.includes("cancel")?"You cancelled the request.":s.includes("insufficient")?`You don't have enough ${Ze.name} — get more first.`:s.includes("no active listing")||s.includes("not for sale")?"This item is not for sale right now.":"Couldn't complete checkout — please try again."}function Nt(){const{contractAddress:a,tokenId:l}=be(),{state:s}=je(),m=ge(),w=X(i=>i.add),_=X(i=>i.items),p=ee(i=>i.toggle),{session:d}=ie(),{data:f,isError:A}=Le(d),[t,g]=r.useState(()=>s!=null&&s.item?{...s.item,tradeId:s.tradeId??s.item.tradeId}:{id:`${a}-${l}`,name:"",creator:"",contractAddress:a??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:re.chainId,thumbnail:"",priceCredits:0,gender:null,tokenId:l??void 0,tradeId:s==null?void 0:s.tradeId}),[o,b]=r.useState(!1),[I,c]=r.useState(null),[n,y]=r.useState(null),{data:v=[],isFetched:P}=R({queryKey:["collection-items",t.contractAddress],enabled:!!t.contractAddress,queryFn:()=>Xe(t.contractAddress,{first:20}).then(i=>i.items)}),{data:$,isLoading:ne}=R({queryKey:["shop-item",t.contractAddress,l],enabled:!(s!=null&&s.item)&&!!t.contractAddress&&!!l,queryFn:()=>et(t.contractAddress,l)});r.useEffect(()=>{$&&g(i=>i.tradeId?i:{...$})},[$]);const[V,le]=r.useState(!1),{data:B=""}=R({queryKey:["item-desc",t.contractAddress,t.itemId],enabled:!!t.contractAddress&&!!t.itemId,staleTime:5*6e4,queryFn:()=>tt(t.contractAddress,t.itemId)});r.useEffect(()=>{if(t.name||v.length===0)return;const i=l&&v.find(u=>u.tokenId===l||u.itemId===l)||v.find(u=>u.contractAddress===t.contractAddress);i&&g(u=>({...i,tradeId:u.tradeId??i.tradeId}))},[v]);const ce=r.useMemo(()=>{const i=new Set,u=[];for(const h of v){if(h.id===t.id||t.itemId&&h.itemId===t.itemId||t.tokenId&&h.tokenId===t.tokenId)continue;const S=`${h.contractAddress}-${h.itemId??h.tokenId??h.id}`;i.has(S)||(i.add(S),u.push(h))}return u},[v,t.id,t.itemId,t.tokenId]),{data:de,isLoading:k}=R({queryKey:["detail-trade",t.id,t.tradeId,t.contractAddress,t.itemId],enabled:!!t.contractAddress,queryFn:async()=>{if(t.tradeId)return t.tradeId;if(t.itemId){const i=await at(t.contractAddress,t.itemId);return(i==null?void 0:i.id)??null}return null}}),N=t.tradeId??de??void 0,j=!!N,oe=Pe({priceCredits:t.priceCredits,compareAtCredits:t.compareAtCredits,saleEndsAt:t.saleEndsAt}),E=r.useMemo(()=>({...t,tradeId:N,id:N??t.id}),[t,N]),M=_.some(i=>i.id===E.id),q=ee(i=>!!i.items[t.id]);r.useEffect(()=>{c(null),y(null)},[t.id]);const U=r.useRef(null);r.useEffect(()=>{!t.name||k||U.current===t.id||(U.current=t.id,D("Shop Viewed Item",{...Te(t),for_sale:j}),Re(t))},[t.id,t.name,k,j]);const T=`${a}/${l}`,G=r.useRef(T);r.useEffect(()=>{G.current!==T&&(G.current=T,s!=null&&s.item&&g({...s.item,tradeId:s.tradeId??s.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[T]);function me(){!j||M||Q||w(E,"item_detail")}async function ue(){var S;if(!j||!N)return;if(!d){y("Sign in to check out.");return}y(null),b(!0);let i,u="authorize",h=!1;try{c(`Buying ${t.name||"item"}…`);const x=await De(N);if(!x)throw new Error("not for sale");if(Ve(x,d.address)){y("You can't buy your own listing."),c(null),b(!1);return}const W=(S=x.received)==null?void 0:S[0],ve=Ue(W==null?void 0:W.amount),{credit:Z,maxCreditedValue:xe}=await Ge(d.identity,ve,N);i=Z.id,u="submit";const O={trade:x,buyer:d.address,signer:d.signer,credits:[Z],maxCreditedValue:xe};let C;if(st())try{C=await it(O),await rt(C),h=!0}catch(z){if(z instanceof nt)h=!0;else if(z instanceof lt)C=await se(O);else throw z}else C=await se(O);i=void 0,D("Shop Completed Purchase",{...Ke([E]),payment_type:"credits",no_crypto_step:h,transaction_hash:C??null}),m("/success",{state:{items:[E],txHash:C}})}catch(x){ae(x)||Ye(x,{flow:"buy",step:u,gasless:h}),i&&He(d.identity,[i]).catch(()=>{}),D(ae(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:u,error_code:Qe(x),value_usd:Je(E.priceCredits)}),y(pt(x)),c(null)}finally{b(!1)}}const K=ut(t.rarity)?t.rarity:L.Rarity.COMMON,Y=ht(t.gender),H=Fe(t),J=$e(t.gender),he=j&&oe,_e="More from this collection",Q=Be(t,d==null?void 0:d.address),pe=j?M?"In cart":k?"Checking…":"Add to cart":"Not for sale",fe=ne||!!t.contractAddress&&!P;return!t.name&&!fe?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:()=>m("/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:()=>m("/assets"),children:"Collectibles"}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:t.name||"Item"})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsx("div",{className:"item-detail__preview",children:t.name?e.jsx(ot,{item:t}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})})}),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:t.name||"Loading…"}),e.jsx("button",{className:`item-detail__fav${q?" is-on":""}`,onClick:()=>p(t),"aria-pressed":q,"aria-label":q?"Remove from favorites":"Add to favorites",children:e.jsx("span",{className:"ico ico-heart","aria-hidden":!0})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:qe(K),color:Me(K)},children:t.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[H?e.jsx("span",{className:`ico ico-${H} item-detail__chip-ico`,"aria-hidden":!0}):null,_t(t)]}),Y?e.jsxs("span",{className:"chip item-detail__chip",children:[J?e.jsx("span",{className:`ico ico-${J} item-detail__chip-ico`,"aria-hidden":!0}):null,Y]}):null]}),B?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:"Description"}),e.jsx("p",{className:`item-detail__desc-text${V?" is-expanded":""}`,children:B}),B.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>le(i=>!i),children:V?"Show less":"Read more"}):null]}):null,t.creator?e.jsx("div",{className:"item-detail__meta",children:e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:"Creator"}),e.jsx(We,{address:t.creator,className:"item-detail__creator",linkToProfile:!0})]})}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsxs("div",{className:"item-detail__price-block",children:[e.jsx("div",{className:"item-detail__price-label",children:"Price"}),j?he?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(F,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:t.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(F,{className:"item-detail__diamond item-detail__diamond--was"}),t.compareAtCredits]}),te(t.compareAtCredits,t.priceCredits)>0?e.jsxs("span",{className:"item-detail__sale-badge",children:["SALE -",te(t.compareAtCredits,t.priceCredits),"%"]}):null,e.jsx(Oe,{endsAt:t.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(F,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:t.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:"Not for sale"}),d?e.jsxs("div",{className:"item-detail__balance muted",children:["Your balance: ",e.jsx(F,{className:"ccy-mark"})," ",ze(f,A)]}):null]}),e.jsx("div",{className:"item-detail__ctas",children:Q?e.jsxs("p",{className:"item-detail__own-note muted",children:["This is your item — manage it in ",e.jsx(ye,{to:"/my-assets",children:"My Assets"}),"."]}):e.jsxs(e.Fragment,{children:[j?e.jsx("button",{className:"btn btn--purple item-detail__cta",onClick:ue,disabled:o||k,children:o?"Buying…":"Buy now"}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:me,disabled:!j||M||k||o,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),pe]})]})}),I?e.jsx("p",{className:"muted item-detail__status",children:I}):null,n?e.jsx("p",{className:"error item-detail__status",children:n}):null]})]}),e.jsx(mt,{title:_e,items:ce,onViewAll:t.contractAddress?()=>m(`/collection/${t.contractAddress}`):void 0})]})}export{Nt as ItemDetail,Nt as default};
@@ -1 +1 @@
1
- import{r as i,j as l}from"./react-CQ5qhqs6.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-iAgwec9M.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 +1 @@
1
- import{a as U,r as d,j as s,L as re}from"./react-CQ5qhqs6.js";import{j as z,i as V,ag as le,w as B,e as q,x as C,p as ee,y as P,o as G,D as W,H as se,c as ce,u as Y,av as oe,h as de,aw as me}from"./index-BW6d6BbH.js";import{f as ue}from"./import-1qZmk-ve.js";import{c as he}from"./buy-BXsYo32e.js";import{a as pe,b as ge,i as be,e as ye,c as xe}from"./trade-encoding-CgWHvMsc.js";import{s as je}from"./wallet-kind-C_qy0E-X.js";import{L as _e}from"./LoadMore-7qZApSeo.js";import{u as fe}from"./useInfiniteGrid-Dvh83G5j.js";import"./ethers-DXxh-eEm.js";import"./mana-rate-DbXjP8PT.js";import"./index-CuI-U7nJ.js";const F=()=>`${V.builderServerUrl}/v1`;function ae(e){return Array.isArray(e)?e:"results"in e&&Array.isArray(e.results)?e.results:"data"in e&&Array.isArray(e.data)?e.data:[]}async function ne(e,i){const n=await le(e,{method:"GET",identity:i,metadata:{}});if(!n.ok)throw new Error(`builder-server ${n.status}: ${await n.text()}`);const c=await n.json();return c.data??c}function Ne(e,i){const n=i-e;return n>0?n:0}function ve(e){var i,n,c,r,l;return((n=(i=e.data)==null?void 0:i.wearable)==null?void 0:n.category)??((r=(c=e.data)==null?void 0:c.emote)==null?void 0:r.category)??((l=e.data)==null?void 0:l.category)??e.type??"wearable"}function J(e){return`${F()}/storage/contents/${e}`}function $(e,i){if(!e)return"";if(/^https?:\/\//.test(e))return e;const n=i==null?void 0:i[e];return n?J(n):/^(ba|Qm)/.test(e)?J(e):""}async function Ie(e,i){try{const n=await fetch(`${F()}/items/${e}/${i}/contents`);if(!n.ok)return{};const c=await n.json();return c.data??c}catch{return{}}}async function ke(e,i,n){const c=$(e.thumbnail,e.contents)||$("thumbnail.png",e.contents);if(c)return c;if(i&&n){const r=await Ie(i,n);return $(e.thumbnail,r)||$("thumbnail.png",r)||$("image.png",r)}return""}async function we(e,i){const n=`${F()}/${e.toLowerCase()}/collections?is_published=true`,c=await ne(n,i);return ae(c).filter(r=>r.is_published&&!!r.contract_address).map(r=>({id:r.id,name:r.name,contractAddress:r.contract_address.toLowerCase(),isPublished:r.is_published,isApproved:r.is_approved,minters:(r.minters??[]).map(l=>l.toLowerCase())}))}async function Ce(e,i){const n=`${F()}/collections/${e.id}/items`,c=await ne(n,i);return(await Promise.all(ae(c).map(async l=>{const v=l.rarity??"common",_=Number(l.total_supply??0)||0;let m=0;try{m=z.Rarity.getMaxSupply(v)}catch{m=0}const f=(l.contract_address??e.contractAddress).toLowerCase(),p=l.blockchain_item_id??"";return{id:l.id,collectionId:e.id,collectionName:e.name,contractAddress:f,blockchainItemId:p,name:l.name,category:ve(l),rarity:v,thumbnail:await ke(l,f,p),type:l.type??"wearable",isPublished:l.is_published??e.isPublished,isApproved:l.is_approved??e.isApproved,totalSupply:_,maxSupply:m,remainingSupply:Ne(_,m),minters:e.minters}}))).filter(Se)}function Se(e){return e.isPublished&&e.isApproved&&e.blockchainItemId!==""&&e.blockchainItemId!=null&&e.remainingSupply>0}async function Ae(e,i){const n=await we(e,i);return(await Promise.all(n.map(async r=>{try{return await Ce(r,i)}catch{return[]}}))).flat()}const Pe=1e3*60*60*24*182;function $e(e){const i=e,n=(i.message??"").toLowerCase();return i.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?"You cancelled the request.":"Couldn't list your item — please try again."}function Le({asset:e,session:i,onClose:n}){const c=B(),r=U(),[l,v]=d.useState("10"),[_,m]=d.useState(null),[f,p]=d.useState(null),[g,k]=d.useState(!1),[j,I]=d.useState(null);async function S(){p(null);const o=Number(l);if(!Number.isInteger(o)||o<=0){p("Enter a whole number of credits");return}k(!0);try{m("Getting your item ready…"),await pe({signer:i.signer,contractAddress:e.contractAddress,chainId:e.chainId}),m("Listing your item…");const N=await ge({signer:i.signer,nft:{contractAddress:e.contractAddress,tokenId:e.tokenId,network:e.network,chainId:e.chainId},usdPrice:o/10,expiresAtMs:Date.now()+Pe});m("Publishing…"),await ee(N,i.identity),m(null),I(o),P("Shop Listed Item",{item_id:e.itemId??e.tokenId??null,contract_address:e.contractAddress,price_credits:o,price_usd:o/10,listing_type:"secondary",is_primary:!1}),G.success(`“${e.name}” is now on sale!`),c.invalidateQueries({queryKey:["my-assets",i.address]})}catch(N){W(N,{flow:"list_secondary"}),P("Shop Listing Failed",{listing_type:"secondary",error_code:se(N)}),p($e(N)),m(null)}finally{k(!1)}}function x(){n(),r(`/item/${e.contractAddress}/${e.tokenId}`)}return j!==null?s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:"It’s on sale! 🎉"}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:["Listed for ",s.jsxs("strong",{children:[s.jsx(q,{className:"ccy-mark"})," ",j]})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,children:"Done"}),s.jsx("button",{className:"btn btn--purple",onClick:x,children:"View in Shop"})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsxs("h2",{className:"modal__title",children:["List “",e.name,"”"]}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Price (",C.name,")"]}),s.jsx("input",{type:"number",min:"1",step:"1",value:l,onChange:o=>v(o.target.value),disabled:g})]}),s.jsxs("p",{className:"muted small",children:["Priced in whole ",C.name," (1 ",C.nameSingular," = $0.10)."]}),_?s.jsx("p",{className:"muted",children:_}):null,f?s.jsx("p",{className:"error",children:f}):null,s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:g,children:"Cancel"}),s.jsx("button",{className:"btn",onClick:S,disabled:g,children:g?"Listing…":"Put on sale"})]})]})})}const Ee=1e3*60*60*24*182;function Me(e){const i=e,n=(i.message??"").toLowerCase();return i.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?"You cancelled the request.":"Couldn't publish your item — please try again."}function qe({item:e,session:i,onClose:n}){const c=B(),r=U(),[l,v]=d.useState("10"),[_,m]=d.useState(null),[f,p]=d.useState(null),[g,k]=d.useState(!1),[j,I]=d.useState(null),[S,x]=d.useState(null),o=V.chainId,N=je(i.providerType);d.useEffect(()=>{let u=!1;return(async()=>{try{const b=await be({contractAddress:e.contractAddress,chainId:o});u||I(b)}catch{u||I(!1)}})(),()=>{u=!0}},[e.contractAddress,o]);async function T(){p(null);const u=Number(l);if(!Number.isInteger(u)||u<=0){p("Enter a whole number of credits");return}k(!0);try{j||(m("Enabling sales for this collection…"),await ye({signer:i.signer,contractAddress:e.contractAddress,chainId:o}),I(!0)),m("Publishing your item…");const b=await xe({signer:i.signer,item:{contractAddress:e.contractAddress,itemId:e.blockchainItemId,network:z.Network.MATIC,chainId:o},usdPrice:u/10,uses:e.remainingSupply,expiresAtMs:Date.now()+Ee});m("Finishing up…"),await ee(b,i.identity),m(null),x(u),P("Shop Listed Item",{item_id:e.blockchainItemId,contract_address:e.contractAddress,price_credits:u,price_usd:u/10,listing_type:"primary",is_primary:!0}),G.success(`“${e.name}” is now on sale!`),c.invalidateQueries({queryKey:["publishable-items"]}),c.invalidateQueries({queryKey:["collection-sale-state"]})}catch(b){W(b,{flow:"list_primary"}),P("Shop Listing Failed",{listing_type:"primary",error_code:se(b)}),p(Me(b)),m(null)}finally{k(!1)}}function O(){n(),r(`/item/${e.contractAddress}/${e.blockchainItemId}`)}const L=g?"Listing…":j===!1?"Enable & put on sale":"Put on sale";return S!==null?s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:"It’s on sale! 🎉"}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:["Listed for ",s.jsxs("strong",{children:[s.jsx(q,{className:"ccy-mark"})," ",S]})," · ",e.remainingSupply.toLocaleString()," available"]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,children:"Done"}),s.jsx("button",{className:"btn btn--purple",onClick:O,children:"View in Shop"})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsxs("h2",{className:"modal__title",children:["Publish “",e.name,"”"]}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsxs("p",{className:"muted small",children:["From your collection “",e.collectionName,"” · ",e.remainingSupply.toLocaleString()," available"]}),s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Price (",C.name,")"]}),s.jsx("input",{type:"number",min:"1",step:"1",value:l,onChange:u=>v(u.target.value),disabled:g})]}),s.jsxs("p",{className:"muted small",children:["Priced in whole ",C.name," (1 ",C.nameSingular," = $0.10)."]}),j===!1&&!g?N?s.jsxs("p",{className:"muted small primary-note",children:["First time selling from “",e.collectionName,"”? It needs a one-time approval, then you’ll confirm the listing — two quick confirmations. After this, listing more items from this collection is a single step."]}):s.jsxs("p",{className:"muted small primary-note",children:["First time selling from “",e.collectionName,"”? Setting it up takes a moment — after that, listing more items from this collection is instant."]}):j===!0&&!g?N?s.jsx("p",{className:"muted small primary-note",children:"This collection is ready — publishing is a single confirmation."}):s.jsx("p",{className:"muted small primary-note",children:"This collection is ready — publishing is instant."}):null,_?s.jsx("p",{className:"muted",children:_}):null,f?s.jsx("p",{className:"error",children:f}):null,s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:g,children:"Cancel"}),s.jsx("button",{className:"btn",onClick:T,disabled:g||j===null,children:j===null?"Checking…":L})]})]})})}const Fe=48;function Te(e){return{id:e.id,name:e.name,creator:"",contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,rarity:e.rarity??"common",network:e.network,chainId:e.chainId,thumbnail:e.image,priceCredits:e.listingPrice??0,gender:null,tokenId:e.tokenId}}function Z(e){return{id:`${e.contractAddress}-${e.blockchainItemId}`,name:e.name,creator:"",contractAddress:e.contractAddress,itemId:e.blockchainItemId,category:e.category,rarity:e.rarity,network:"MATIC",chainId:V.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null}}function He(){const{session:e,error:i,signIn:n,restore:c}=ce(),r=U(),l=B(),[v,_]=d.useState(null),[m,f]=d.useState(null),[p,g]=d.useState(null),[k,j]=d.useState(null);function I(a){const t=a.tokenId??a.itemId??"";!a.contractAddress||!t||r(`/item/${a.contractAddress}/${t}`,{state:{item:a}})}async function S(a,t,h){if(e){j(null),g(h);try{const y=await de(a);await he({trade:y,signer:e.signer}),G.success(`“${t}” is no longer for sale.`),await l.invalidateQueries({queryKey:["my-assets",e.address]}),await l.invalidateQueries({queryKey:["collection-sale-state"]})}catch(y){const E=y,M=(E.message??"").toLowerCase(),X=E.code===4001||M.includes("reject")||M.includes("denied");X||W(y,{flow:"remove-listing",tradeId:a}),j(X?"You cancelled the request.":"Couldn't remove the listing — please try again.")}finally{g(null)}}}d.useEffect(()=>{c()},[c]);const x=e==null?void 0:e.address,{items:o,isLoading:N,error:T,hasNextPage:O,isFetchingNextPage:L,fetchNextPage:u}=fe(["my-assets",x],a=>oe(x,{first:Fe,skip:a}).then(t=>({items:t.assets,total:t.total})),{enabled:!!x}),{data:b}=Y({queryKey:["importable",x],queryFn:()=>ue(x),enabled:!!x}),R=((b==null?void 0:b.creations.length)??0)+((b==null?void 0:b.owned.length)??0),{data:A,isLoading:te,isError:ie}=Y({queryKey:["publishable-items",x],queryFn:()=>Ae(x,e.identity),enabled:!!e,retry:!1}),K=d.useMemo(()=>[...new Set((A??[]).map(a=>a.contractAddress))],[A]),{data:w}=Y({queryKey:["collection-sale-state",x,K],enabled:K.length>0,queryFn:async()=>{const a=await Promise.all(K.map(async h=>[h,await me(h)])),t={};for(const[h,y]of a)for(const[E,M]of Object.entries(y))t[`${h}-${E}`]=M;return t}}),Q=a=>w==null?void 0:w[`${a.contractAddress}-${a.blockchainItemId}`],D=d.useMemo(()=>(A??[]).filter(a=>{var t;return(t=Q(a))==null?void 0:t.isOnSale}),[A,w]),H=d.useMemo(()=>{var t;const a=new Map;for(const h of A??[]){if((t=w==null?void 0:w[`${h.contractAddress}-${h.blockchainItemId}`])!=null&&t.isOnSale)continue;const y=a.get(h.collectionId)??{id:h.collectionId,name:h.collectionName,items:[]};y.items.push(h),a.set(h.collectionId,y)}return[...a.values()]},[A,w]);return e?s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:"My Assets"}),R>0?s.jsxs(re,{className:"import-banner",to:"/import",children:[s.jsx("span",{className:"import-banner__ico","aria-hidden":!0,children:"📦"}),s.jsxs("span",{className:"import-banner__text",children:[s.jsx("strong",{children:"Import your listings"}),s.jsxs("span",{className:"import-banner__sub",children:["You have ",R," item",R===1?"":"s"," for sale elsewhere — bring them into the Shop."]})]}),s.jsx("span",{className:"import-banner__cta",children:"Import"})]}):null,s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:"Items you own"}),s.jsx("p",{className:"myassets__section-sub",children:"Wearables & emotes you’ve bought — resell them in the Shop."})]}),T?s.jsx("p",{className:"error",children:"Couldn’t load your items — please try again."}):null,k?s.jsx("p",{className:"error",children:k}):null,s.jsxs("div",{className:"asset-grid",children:[N?Array.from({length:8}).map((a,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`sk-${t}`)):o.map(a=>s.jsxs("article",{className:"asset-card asset-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":`View ${a.name}`,onClick:()=>I(Te(a))}),s.jsx("div",{className:"asset-card__img",children:a.image?s.jsx("img",{src:a.image,alt:a.name}):null}),s.jsx("div",{className:"asset-card__name",title:a.name,children:a.name}),a.isOnSale?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"asset-card__listed",children:[s.jsxs("span",{className:"asset-card__price",children:[s.jsx(q,{className:"ccy-mark"})," ",a.listingPrice]}),s.jsx("span",{className:"badge",children:"On sale"})]}),s.jsx("button",{className:"btn btn--sm btn--ghost asset-card__remove",disabled:p===a.id||!a.tradeId,onClick:t=>{t.stopPropagation(),a.tradeId&&S(a.tradeId,a.name,a.id)},children:p===a.id?"Removing…":"Remove listing"})]}):s.jsx("button",{className:"btn btn--sm",onClick:t=>{t.stopPropagation(),P("Shop Started Listing",{listing_type:"secondary",item_id:a.itemId??a.tokenId??null}),_(a)},children:"Put on sale"})]},a.id)),L?Array.from({length:4}).map((a,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`msk-${t}`)):null]}),s.jsx(_e,{hasNextPage:O,isFetching:L,onLoadMore:()=>u()}),!N&&o.length===0?s.jsx("p",{className:"muted",children:"No items in your wardrobe yet."}):null]}),s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:"Your creations"}),s.jsxs("p",{className:"myassets__section-sub",children:["Items you made. Put them on sale in the Shop — set a price in ",C.name," and buyers pay with ",C.name,"."]})]}),te?s.jsx("div",{className:"publish-grid",children:Array.from({length:4}).map((a,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`pub-sk-${t}`))}):ie?s.jsx("p",{className:"publish-empty",children:"We couldn’t load your collections right now. Please try again in a moment."}):D.length===0&&H.length===0?s.jsx("p",{className:"publish-empty",children:"You don’t have any items to publish yet."}):s.jsxs(s.Fragment,{children:[D.length>0?s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:"On sale"}),s.jsx("div",{className:"publish-grid",children:D.map(a=>{var t;return s.jsxs("article",{className:"publish-card publish-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":`View ${a.name}`,onClick:()=>I(Z(a))}),s.jsx("div",{className:"publish-card__img",children:a.thumbnail?s.jsx("img",{src:a.thumbnail,alt:a.name}):null}),s.jsx("div",{className:"publish-card__name",title:a.name,children:a.name}),s.jsxs("div",{className:"publish-card__listed",children:[s.jsxs("span",{className:"publish-card__price",children:[s.jsx(q,{className:"ccy-mark"})," ",((t=Q(a))==null?void 0:t.priceCredits)??0]}),s.jsx("span",{className:"badge",children:"On sale"})]}),s.jsx("button",{className:"btn btn--sm btn--ghost publish-card__cta",disabled:p===a.id,onClick:h=>{h.stopPropagation();const y=Q(a);y!=null&&y.tradeId&&S(y.tradeId,a.name,a.id)},children:p===a.id?"Removing…":"Remove listing"})]},`${a.contractAddress}-${a.blockchainItemId}`)})})]}):null,H.map(a=>s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:a.name}),s.jsx("div",{className:"publish-grid",children:a.items.map(t=>s.jsxs("article",{className:"publish-card publish-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":`View ${t.name}`,onClick:()=>I(Z(t))}),s.jsx("div",{className:"publish-card__img",children:t.thumbnail?s.jsx("img",{src:t.thumbnail,alt:t.name}):null}),s.jsx("div",{className:"publish-card__name",title:t.name,children:t.name}),s.jsxs("div",{className:"publish-card__meta",children:[s.jsx("span",{className:"publish-chip publish-chip--rarity",children:t.rarity}),s.jsxs("span",{className:"publish-card__supply",children:[t.remainingSupply.toLocaleString()," available"]})]}),s.jsx("button",{className:"btn btn--sm btn--purple publish-card__cta",onClick:h=>{h.stopPropagation(),P("Shop Started Listing",{listing_type:"primary",item_id:t.blockchainItemId}),f(t)},children:"Put on sale"})]},`${t.contractAddress}-${t.blockchainItemId}`))})]},a.id))]})]}),v?s.jsx(Le,{asset:v,session:e,onClose:()=>_(null)}):null,m?s.jsx(qe,{item:m,session:e,onClose:()=>f(null)}):null]}):s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:"My Assets"}),s.jsx("p",{className:"muted",children:"Sign in to sell your items."}),s.jsx("div",{className:"connect-row",children:s.jsx("button",{className:"btn btn--purple",onClick:()=>n(),children:"Sign in"})}),i?s.jsx("p",{className:"error",children:i}):null]})}export{He as MyAssets};
1
+ import{a as U,r as d,j as s,L as re}from"./react-iAgwec9M.js";import{j as Z,i as V,ah as le,w as B,e as q,y as C,p as ee,z as P,o as G,E as W,I as se,c as ce,u as D,aA as oe,h as de,aB as me}from"./index-BJ_QKI7g.js";import{f as ue}from"./import-Cicp42pB.js";import{c as he}from"./buy-DK-hDYib.js";import{a as pe,b as ge,i as be,e as ye,c as xe}from"./trade-encoding-ELuUTRbi.js";import{s as je}from"./wallet-kind-g2ENkqJ_.js";import{L as _e}from"./LoadMore-8Dx5lULo.js";import{u as fe}from"./useInfiniteGrid-XR5F3f0o.js";import"./ethers-D-4WUfRB.js";import"./mana-rate-nE0eZdyC.js";import"./index-CfK4LG22.js";const F=()=>`${V.builderServerUrl}/v1`;function ae(e){return Array.isArray(e)?e:"results"in e&&Array.isArray(e.results)?e.results:"data"in e&&Array.isArray(e.data)?e.data:[]}async function ne(e,i){const n=await le(e,{method:"GET",identity:i,metadata:{}});if(!n.ok)throw new Error(`builder-server ${n.status}: ${await n.text()}`);const c=await n.json();return c.data??c}function Ne(e,i){const n=i-e;return n>0?n:0}function ve(e){var i,n,c,r,l;return((n=(i=e.data)==null?void 0:i.wearable)==null?void 0:n.category)??((r=(c=e.data)==null?void 0:c.emote)==null?void 0:r.category)??((l=e.data)==null?void 0:l.category)??e.type??"wearable"}function z(e){return`${F()}/storage/contents/${e}`}function $(e,i){if(!e)return"";if(/^https?:\/\//.test(e))return e;const n=i==null?void 0:i[e];return n?z(n):/^(ba|Qm)/.test(e)?z(e):""}async function Ie(e,i){try{const n=await fetch(`${F()}/items/${e}/${i}/contents`);if(!n.ok)return{};const c=await n.json();return c.data??c}catch{return{}}}async function ke(e,i,n){const c=$(e.thumbnail,e.contents)||$("thumbnail.png",e.contents);if(c)return c;if(i&&n){const r=await Ie(i,n);return $(e.thumbnail,r)||$("thumbnail.png",r)||$("image.png",r)}return""}async function we(e,i){const n=`${F()}/${e.toLowerCase()}/collections?is_published=true`,c=await ne(n,i);return ae(c).filter(r=>r.is_published&&!!r.contract_address).map(r=>({id:r.id,name:r.name,contractAddress:r.contract_address.toLowerCase(),isPublished:r.is_published,isApproved:r.is_approved,minters:(r.minters??[]).map(l=>l.toLowerCase())}))}async function Ce(e,i){const n=`${F()}/collections/${e.id}/items`,c=await ne(n,i);return(await Promise.all(ae(c).map(async l=>{const v=l.rarity??"common",_=Number(l.total_supply??0)||0;let m=0;try{m=Z.Rarity.getMaxSupply(v)}catch{m=0}const f=(l.contract_address??e.contractAddress).toLowerCase(),p=l.blockchain_item_id??"";return{id:l.id,collectionId:e.id,collectionName:e.name,contractAddress:f,blockchainItemId:p,name:l.name,category:ve(l),rarity:v,thumbnail:await ke(l,f,p),type:l.type??"wearable",isPublished:l.is_published??e.isPublished,isApproved:l.is_approved??e.isApproved,totalSupply:_,maxSupply:m,remainingSupply:Ne(_,m),minters:e.minters}}))).filter(Se)}function Se(e){return e.isPublished&&e.isApproved&&e.blockchainItemId!==""&&e.blockchainItemId!=null&&e.remainingSupply>0}async function Ae(e,i){const n=await we(e,i);return(await Promise.all(n.map(async r=>{try{return await Ce(r,i)}catch{return[]}}))).flat()}const Pe=1e3*60*60*24*182;function $e(e){const i=e,n=(i.message??"").toLowerCase();return i.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?"You cancelled the request.":"Couldn't list your item — please try again."}function Le({asset:e,session:i,onClose:n}){const c=B(),r=U(),[l,v]=d.useState("10"),[_,m]=d.useState(null),[f,p]=d.useState(null),[g,k]=d.useState(!1),[j,I]=d.useState(null);async function S(){p(null);const o=Number(l);if(!Number.isInteger(o)||o<=0){p("Enter a whole number of credits");return}k(!0);try{m("Getting your item ready…"),await pe({signer:i.signer,contractAddress:e.contractAddress,chainId:e.chainId}),m("Listing your item…");const N=await ge({signer:i.signer,nft:{contractAddress:e.contractAddress,tokenId:e.tokenId,network:e.network,chainId:e.chainId},usdPrice:o/10,expiresAtMs:Date.now()+Pe});m("Publishing…"),await ee(N,i.identity),m(null),I(o),P("Shop Listed Item",{item_id:e.itemId??e.tokenId??null,contract_address:e.contractAddress,price_credits:o,price_usd:o/10,listing_type:"secondary",is_primary:!1}),G.success(`“${e.name}” is now on sale!`),c.invalidateQueries({queryKey:["my-assets",i.address]})}catch(N){W(N,{flow:"list_secondary"}),P("Shop Listing Failed",{listing_type:"secondary",error_code:se(N)}),p($e(N)),m(null)}finally{k(!1)}}function x(){n(),r(`/item/${e.contractAddress}/${e.tokenId}`)}return j!==null?s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:"It’s on sale! 🎉"}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:["Listed for ",s.jsxs("strong",{children:[s.jsx(q,{className:"ccy-mark"})," ",j]})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,children:"Done"}),s.jsx("button",{className:"btn btn--purple",onClick:x,children:"View in Shop"})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsxs("h2",{className:"modal__title",children:["List “",e.name,"”"]}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Price (",C.name,")"]}),s.jsx("input",{type:"number",min:"1",step:"1",value:l,onChange:o=>v(o.target.value),disabled:g})]}),s.jsxs("p",{className:"muted small",children:["Priced in whole ",C.name," (1 ",C.nameSingular," = $0.10)."]}),_?s.jsx("p",{className:"muted",children:_}):null,f?s.jsx("p",{className:"error",children:f}):null,s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:g,children:"Cancel"}),s.jsx("button",{className:"btn",onClick:S,disabled:g,children:g?"Listing…":"Put on sale"})]})]})})}const Ee=1e3*60*60*24*182;function Me(e){const i=e,n=(i.message??"").toLowerCase();return i.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?"You cancelled the request.":"Couldn't publish your item — please try again."}function qe({item:e,session:i,onClose:n}){const c=B(),r=U(),[l,v]=d.useState("10"),[_,m]=d.useState(null),[f,p]=d.useState(null),[g,k]=d.useState(!1),[j,I]=d.useState(null),[S,x]=d.useState(null),o=V.chainId,N=je(i.providerType);d.useEffect(()=>{let u=!1;return(async()=>{try{const b=await be({contractAddress:e.contractAddress,chainId:o});u||I(b)}catch{u||I(!1)}})(),()=>{u=!0}},[e.contractAddress,o]);async function T(){p(null);const u=Number(l);if(!Number.isInteger(u)||u<=0){p("Enter a whole number of credits");return}k(!0);try{j||(m("Enabling sales for this collection…"),await ye({signer:i.signer,contractAddress:e.contractAddress,chainId:o}),I(!0)),m("Publishing your item…");const b=await xe({signer:i.signer,item:{contractAddress:e.contractAddress,itemId:e.blockchainItemId,network:Z.Network.MATIC,chainId:o},usdPrice:u/10,uses:e.remainingSupply,expiresAtMs:Date.now()+Ee});m("Finishing up…"),await ee(b,i.identity),m(null),x(u),P("Shop Listed Item",{item_id:e.blockchainItemId,contract_address:e.contractAddress,price_credits:u,price_usd:u/10,listing_type:"primary",is_primary:!0}),G.success(`“${e.name}” is now on sale!`),c.invalidateQueries({queryKey:["publishable-items"]}),c.invalidateQueries({queryKey:["collection-sale-state"]})}catch(b){W(b,{flow:"list_primary"}),P("Shop Listing Failed",{listing_type:"primary",error_code:se(b)}),p(Me(b)),m(null)}finally{k(!1)}}function O(){n(),r(`/item/${e.contractAddress}/${e.blockchainItemId}`)}const L=g?"Listing…":j===!1?"Enable & put on sale":"Put on sale";return S!==null?s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:"It’s on sale! 🎉"}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:["Listed for ",s.jsxs("strong",{children:[s.jsx(q,{className:"ccy-mark"})," ",S]})," · ",e.remainingSupply.toLocaleString()," available"]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,children:"Done"}),s.jsx("button",{className:"btn btn--purple",onClick:O,children:"View in Shop"})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:s.jsxs("div",{className:"modal",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsxs("h2",{className:"modal__title",children:["Publish “",e.name,"”"]}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsxs("p",{className:"muted small",children:["From your collection “",e.collectionName,"” · ",e.remainingSupply.toLocaleString()," available"]}),s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Price (",C.name,")"]}),s.jsx("input",{type:"number",min:"1",step:"1",value:l,onChange:u=>v(u.target.value),disabled:g})]}),s.jsxs("p",{className:"muted small",children:["Priced in whole ",C.name," (1 ",C.nameSingular," = $0.10)."]}),j===!1&&!g?N?s.jsxs("p",{className:"muted small primary-note",children:["First time selling from “",e.collectionName,"”? It needs a one-time approval, then you’ll confirm the listing — two quick confirmations. After this, listing more items from this collection is a single step."]}):s.jsxs("p",{className:"muted small primary-note",children:["First time selling from “",e.collectionName,"”? Setting it up takes a moment — after that, listing more items from this collection is instant."]}):j===!0&&!g?N?s.jsx("p",{className:"muted small primary-note",children:"This collection is ready — publishing is a single confirmation."}):s.jsx("p",{className:"muted small primary-note",children:"This collection is ready — publishing is instant."}):null,_?s.jsx("p",{className:"muted",children:_}):null,f?s.jsx("p",{className:"error",children:f}):null,s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:g,children:"Cancel"}),s.jsx("button",{className:"btn",onClick:T,disabled:g||j===null,children:j===null?"Checking…":L})]})]})})}const Fe=48;function Te(e){return{id:e.id,name:e.name,creator:"",contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,rarity:e.rarity??"common",network:e.network,chainId:e.chainId,thumbnail:e.image,priceCredits:e.listingPrice??0,gender:null,tokenId:e.tokenId}}function J(e){return{id:`${e.contractAddress}-${e.blockchainItemId}`,name:e.name,creator:"",contractAddress:e.contractAddress,itemId:e.blockchainItemId,category:e.category,rarity:e.rarity,network:"MATIC",chainId:V.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null}}function He(){const{session:e,error:i,signIn:n,restore:c}=ce(),r=U(),l=B(),[v,_]=d.useState(null),[m,f]=d.useState(null),[p,g]=d.useState(null),[k,j]=d.useState(null);function I(a){const t=a.tokenId??a.itemId??"";!a.contractAddress||!t||r(`/item/${a.contractAddress}/${t}`,{state:{item:a}})}async function S(a,t,h){if(e){j(null),g(h);try{const y=await de(a);await he({trade:y,signer:e.signer}),G.success(`“${t}” is no longer for sale.`),await l.invalidateQueries({queryKey:["my-assets",e.address]}),await l.invalidateQueries({queryKey:["collection-sale-state"]})}catch(y){const E=y,M=(E.message??"").toLowerCase(),X=E.code===4001||M.includes("reject")||M.includes("denied");X||W(y,{flow:"remove-listing",tradeId:a}),j(X?"You cancelled the request.":"Couldn't remove the listing — please try again.")}finally{g(null)}}}d.useEffect(()=>{c()},[c]);const x=e==null?void 0:e.address,{items:o,isLoading:N,error:T,hasNextPage:O,isFetchingNextPage:L,fetchNextPage:u}=fe(["my-assets",x],a=>oe(x,{first:Fe,skip:a}).then(t=>({items:t.assets,total:t.total})),{enabled:!!x}),{data:b}=D({queryKey:["importable",x],queryFn:()=>ue(x),enabled:!!x}),R=((b==null?void 0:b.creations.length)??0)+((b==null?void 0:b.owned.length)??0),{data:A,isLoading:te,isError:ie}=D({queryKey:["publishable-items",x],queryFn:()=>Ae(x,e.identity),enabled:!!e,retry:!1}),K=d.useMemo(()=>[...new Set((A??[]).map(a=>a.contractAddress))],[A]),{data:w}=D({queryKey:["collection-sale-state",x,K],enabled:K.length>0,queryFn:async()=>{const a=await Promise.all(K.map(async h=>[h,await me(h)])),t={};for(const[h,y]of a)for(const[E,M]of Object.entries(y))t[`${h}-${E}`]=M;return t}}),Q=a=>w==null?void 0:w[`${a.contractAddress}-${a.blockchainItemId}`],Y=d.useMemo(()=>(A??[]).filter(a=>{var t;return(t=Q(a))==null?void 0:t.isOnSale}),[A,w]),H=d.useMemo(()=>{var t;const a=new Map;for(const h of A??[]){if((t=w==null?void 0:w[`${h.contractAddress}-${h.blockchainItemId}`])!=null&&t.isOnSale)continue;const y=a.get(h.collectionId)??{id:h.collectionId,name:h.collectionName,items:[]};y.items.push(h),a.set(h.collectionId,y)}return[...a.values()]},[A,w]);return e?s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:"My Assets"}),R>0?s.jsxs(re,{className:"import-banner",to:"/import",children:[s.jsx("span",{className:"import-banner__ico","aria-hidden":!0,children:"📦"}),s.jsxs("span",{className:"import-banner__text",children:[s.jsx("strong",{children:"Import your listings"}),s.jsxs("span",{className:"import-banner__sub",children:["You have ",R," item",R===1?"":"s"," for sale elsewhere — bring them into the Shop."]})]}),s.jsx("span",{className:"import-banner__cta",children:"Import"})]}):null,s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:"Items you own"}),s.jsx("p",{className:"myassets__section-sub",children:"Wearables & emotes you’ve bought — resell them in the Shop."})]}),T?s.jsx("p",{className:"error",children:"Couldn’t load your items — please try again."}):null,k?s.jsx("p",{className:"error",children:k}):null,s.jsxs("div",{className:"asset-grid",children:[N?Array.from({length:8}).map((a,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`sk-${t}`)):o.map(a=>s.jsxs("article",{className:"asset-card asset-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":`View ${a.name}`,onClick:()=>I(Te(a))}),s.jsx("div",{className:"asset-card__img",children:a.image?s.jsx("img",{src:a.image,alt:a.name}):null}),s.jsx("div",{className:"asset-card__name",title:a.name,children:a.name}),a.isOnSale?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"asset-card__listed",children:[s.jsxs("span",{className:"asset-card__price",children:[s.jsx(q,{className:"ccy-mark"})," ",a.listingPrice]}),s.jsx("span",{className:"badge",children:"On sale"})]}),s.jsx("button",{className:"btn btn--sm btn--ghost asset-card__remove",disabled:p===a.id||!a.tradeId,onClick:t=>{t.stopPropagation(),a.tradeId&&S(a.tradeId,a.name,a.id)},children:p===a.id?"Removing…":"Remove listing"})]}):s.jsx("button",{className:"btn btn--sm",onClick:t=>{t.stopPropagation(),P("Shop Started Listing",{listing_type:"secondary",item_id:a.itemId??a.tokenId??null}),_(a)},children:"Put on sale"})]},a.id)),L?Array.from({length:4}).map((a,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`msk-${t}`)):null]}),s.jsx(_e,{hasNextPage:O,isFetching:L,onLoadMore:()=>u()}),!N&&o.length===0?s.jsx("p",{className:"muted",children:"No items in your wardrobe yet."}):null]}),s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:"Your creations"}),s.jsxs("p",{className:"myassets__section-sub",children:["Items you made. Put them on sale in the Shop — set a price in ",C.name," and buyers pay with ",C.name,"."]})]}),te?s.jsx("div",{className:"publish-grid",children:Array.from({length:4}).map((a,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`pub-sk-${t}`))}):ie?s.jsx("p",{className:"publish-empty",children:"We couldn’t load your collections right now. Please try again in a moment."}):Y.length===0&&H.length===0?s.jsx("p",{className:"publish-empty",children:"You don’t have any items to publish yet."}):s.jsxs(s.Fragment,{children:[Y.length>0?s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:"On sale"}),s.jsx("div",{className:"publish-grid",children:Y.map(a=>{var t;return s.jsxs("article",{className:"publish-card publish-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":`View ${a.name}`,onClick:()=>I(J(a))}),s.jsx("div",{className:"publish-card__img",children:a.thumbnail?s.jsx("img",{src:a.thumbnail,alt:a.name}):null}),s.jsx("div",{className:"publish-card__name",title:a.name,children:a.name}),s.jsxs("div",{className:"publish-card__listed",children:[s.jsxs("span",{className:"publish-card__price",children:[s.jsx(q,{className:"ccy-mark"})," ",((t=Q(a))==null?void 0:t.priceCredits)??0]}),s.jsx("span",{className:"badge",children:"On sale"})]}),s.jsx("button",{className:"btn btn--sm btn--ghost publish-card__cta",disabled:p===a.id,onClick:h=>{h.stopPropagation();const y=Q(a);y!=null&&y.tradeId&&S(y.tradeId,a.name,a.id)},children:p===a.id?"Removing…":"Remove listing"})]},`${a.contractAddress}-${a.blockchainItemId}`)})})]}):null,H.map(a=>s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:a.name}),s.jsx("div",{className:"publish-grid",children:a.items.map(t=>s.jsxs("article",{className:"publish-card publish-card--link",children:[s.jsx("button",{className:"card-link-overlay","aria-label":`View ${t.name}`,onClick:()=>I(J(t))}),s.jsx("div",{className:"publish-card__img",children:t.thumbnail?s.jsx("img",{src:t.thumbnail,alt:t.name}):null}),s.jsx("div",{className:"publish-card__name",title:t.name,children:t.name}),s.jsxs("div",{className:"publish-card__meta",children:[s.jsx("span",{className:"publish-chip publish-chip--rarity",children:t.rarity}),s.jsxs("span",{className:"publish-card__supply",children:[t.remainingSupply.toLocaleString()," available"]})]}),s.jsx("button",{className:"btn btn--sm btn--purple publish-card__cta",onClick:h=>{h.stopPropagation(),P("Shop Started Listing",{listing_type:"primary",item_id:t.blockchainItemId}),f(t)},children:"Put on sale"})]},`${t.contractAddress}-${t.blockchainItemId}`))})]},a.id))]})]}),v?s.jsx(Le,{asset:v,session:e,onClose:()=>_(null)}):null,m?s.jsx(qe,{item:m,session:e,onClose:()=>f(null)}):null]}):s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:"My Assets"}),s.jsx("p",{className:"muted",children:"Sign in to sell your items."}),s.jsx("div",{className:"connect-row",children:s.jsx("button",{className:"btn btn--purple",onClick:()=>n(),children:"Sign in"})}),i?s.jsx("p",{className:"error",children:i}):null]})}export{He as MyAssets};
@@ -1 +1 @@
1
- import{r as o,j as s,L as n}from"./react-CQ5qhqs6.js";import{b as c,A as l}from"./index-BW6d6BbH.js";import{L as m}from"./LoadMore-7qZApSeo.js";import"./ethers-DXxh-eEm.js";const i=24;function v(){const t=c(e=>Object.values(e.items)),[a,r]=o.useState(i);return t.length===0?s.jsxs("div",{className:"favorites-empty",children:[s.jsx("span",{className:"ico ico-heart favorites-empty__ico","aria-hidden":!0}),s.jsx("p",{className:"favorites-empty__title",children:"No favorites yet"}),s.jsx("p",{className:"muted",children:"Tap the heart on any item to save it here."}),s.jsx(n,{className:"btn btn--purple",to:"/assets",children:"Browse Collectibles"})]}):s.jsxs("section",{className:"favorites",children:[s.jsxs("div",{className:"favorites__head",children:[s.jsx("h1",{children:"My Favorites"}),s.jsxs("span",{className:"favorites__count",children:[t.length," item",t.length>1?"s":""]})]}),s.jsx("div",{className:"grid",children:t.slice(0,a).map(e=>s.jsx(l,{item:e},e.id))}),s.jsx(m,{hasNextPage:a<t.length,isFetching:!1,onLoadMore:()=>r(e=>e+i)})]})}export{v as MyFavorites};
1
+ import{r as o,j as s,L as n}from"./react-iAgwec9M.js";import{b as c,A as l}from"./index-BJ_QKI7g.js";import{L as m}from"./LoadMore-8Dx5lULo.js";import"./ethers-D-4WUfRB.js";const i=24;function v(){const t=c(e=>Object.values(e.items)),[a,r]=o.useState(i);return t.length===0?s.jsxs("div",{className:"favorites-empty",children:[s.jsx("span",{className:"ico ico-heart favorites-empty__ico","aria-hidden":!0}),s.jsx("p",{className:"favorites-empty__title",children:"No favorites yet"}),s.jsx("p",{className:"muted",children:"Tap the heart on any item to save it here."}),s.jsx(n,{className:"btn btn--purple",to:"/assets",children:"Browse Collectibles"})]}):s.jsxs("section",{className:"favorites",children:[s.jsxs("div",{className:"favorites__head",children:[s.jsx("h1",{children:"My Favorites"}),s.jsxs("span",{className:"favorites__count",children:[t.length," item",t.length>1?"s":""]})]}),s.jsx("div",{className:"grid",children:t.slice(0,a).map(e=>s.jsx(l,{item:e},e.id))}),s.jsx(m,{hasNextPage:a<t.length,isFetching:!1,onLoadMore:()=>r(e=>e+i)})]})}export{v as MyFavorites};
@@ -1 +1 @@
1
- import{j as e,L as u}from"./react-CQ5qhqs6.js";import{c as l,d as o,u as m,e as p,g as x}from"./index-BW6d6BbH.js";import{L as _}from"./LoadMore-7qZApSeo.js";import{u as j}from"./useInfiniteGrid-Dvh83G5j.js";import"./ethers-DXxh-eEm.js";const N=24;function g(s){try{return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function f({status:s}){return s==="PENDING"?e.jsx("span",{className:"purchase__badge purchase__badge--pending",children:"Processing"}):e.jsx("span",{className:"purchase__badge purchase__badge--done",children:"Completed"})}function y({purchase:s}){const{data:a}=m({queryKey:["trade-display",s.tradeId],queryFn:()=>x(s.tradeId),enabled:!!s.tradeId,staleTime:3e5}),t=(a==null?void 0:a.name)??"Item",i=(a==null?void 0:a.thumbnail)??"",n=(a==null?void 0:a.tokenId)??(a==null?void 0:a.itemId)??"",d=a!=null&&a.contractAddress&&n?`/item/${a.contractAddress}/${n}`:void 0,c=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"purchase__thumb",children:i?e.jsx("img",{src:i,alt:t}):null}),e.jsxs("div",{className:"purchase__info",children:[e.jsx("div",{className:"purchase__name",title:t,children:t}),e.jsx("div",{className:"muted purchase__date",children:g(s.createdAt)})]}),e.jsx(f,{status:s.status}),e.jsxs("div",{className:"purchase__price",children:[e.jsx(p,{className:"ccy-mark"})," ",s.credits]})]});return d?e.jsx(u,{className:"purchase",to:d,children:c}):e.jsx("div",{className:"purchase",children:c})}function A(){const{session:s}=l(),{items:a,isLoading:t,hasNextPage:i,isFetchingNextPage:n,fetchNextPage:d}=j(["purchases",s==null?void 0:s.address],r=>o(s.address,s.identity,{first:N,skip:r}),{enabled:!!s});if(!s)return e.jsxs("div",{className:"purchases-empty",children:[e.jsx("span",{className:"ico ico-cart purchases-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"purchases-empty__title",children:"Sign in to see your purchases"}),e.jsx("p",{className:"muted",children:"Your order history shows up here once you sign in."})]});const c=a.filter(r=>r.status!=="EXPIRED");return!t&&c.length===0?e.jsxs("div",{className:"purchases-empty",children:[e.jsx("span",{className:"ico ico-cart purchases-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"purchases-empty__title",children:"No purchases yet"}),e.jsx("p",{className:"muted",children:"When you buy something it’ll appear here."}),e.jsx(u,{className:"btn btn--purple",to:"/assets",children:"Browse Collectibles"})]}):e.jsxs("section",{className:"purchases",children:[e.jsxs("div",{className:"purchases__head",children:[e.jsx("h1",{children:"My Purchases"}),t?null:e.jsxs("span",{className:"purchases__count",children:[c.length," order",c.length>1?"s":""]})]}),e.jsx("div",{className:"purchases__list",children:t?Array.from({length:4}).map((r,h)=>e.jsx("div",{className:"purchase purchase--skeleton"},h)):e.jsxs(e.Fragment,{children:[c.map(r=>e.jsx(y,{purchase:r},r.id)),n?Array.from({length:2}).map((r,h)=>e.jsx("div",{className:"purchase purchase--skeleton"},`m-${h}`)):null]})}),e.jsx(_,{hasNextPage:i,isFetching:n,onLoadMore:()=>d()})]})}export{A as MyPurchases};
1
+ import{j as e,L as u}from"./react-iAgwec9M.js";import{c as l,d as o,u as m,e as p,g as x}from"./index-BJ_QKI7g.js";import{L as _}from"./LoadMore-8Dx5lULo.js";import{u as j}from"./useInfiniteGrid-XR5F3f0o.js";import"./ethers-D-4WUfRB.js";const N=24;function g(s){try{return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function f({status:s}){return s==="PENDING"?e.jsx("span",{className:"purchase__badge purchase__badge--pending",children:"Processing"}):e.jsx("span",{className:"purchase__badge purchase__badge--done",children:"Completed"})}function y({purchase:s}){const{data:a}=m({queryKey:["trade-display",s.tradeId],queryFn:()=>x(s.tradeId),enabled:!!s.tradeId,staleTime:3e5}),t=(a==null?void 0:a.name)??"Item",i=(a==null?void 0:a.thumbnail)??"",n=(a==null?void 0:a.tokenId)??(a==null?void 0:a.itemId)??"",d=a!=null&&a.contractAddress&&n?`/item/${a.contractAddress}/${n}`:void 0,c=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"purchase__thumb",children:i?e.jsx("img",{src:i,alt:t}):null}),e.jsxs("div",{className:"purchase__info",children:[e.jsx("div",{className:"purchase__name",title:t,children:t}),e.jsx("div",{className:"muted purchase__date",children:g(s.createdAt)})]}),e.jsx(f,{status:s.status}),e.jsxs("div",{className:"purchase__price",children:[e.jsx(p,{className:"ccy-mark"})," ",s.credits]})]});return d?e.jsx(u,{className:"purchase",to:d,children:c}):e.jsx("div",{className:"purchase",children:c})}function A(){const{session:s}=l(),{items:a,isLoading:t,hasNextPage:i,isFetchingNextPage:n,fetchNextPage:d}=j(["purchases",s==null?void 0:s.address],r=>o(s.address,s.identity,{first:N,skip:r}),{enabled:!!s});if(!s)return e.jsxs("div",{className:"purchases-empty",children:[e.jsx("span",{className:"ico ico-cart purchases-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"purchases-empty__title",children:"Sign in to see your purchases"}),e.jsx("p",{className:"muted",children:"Your order history shows up here once you sign in."})]});const c=a.filter(r=>r.status!=="EXPIRED");return!t&&c.length===0?e.jsxs("div",{className:"purchases-empty",children:[e.jsx("span",{className:"ico ico-cart purchases-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"purchases-empty__title",children:"No purchases yet"}),e.jsx("p",{className:"muted",children:"When you buy something it’ll appear here."}),e.jsx(u,{className:"btn btn--purple",to:"/assets",children:"Browse Collectibles"})]}):e.jsxs("section",{className:"purchases",children:[e.jsxs("div",{className:"purchases__head",children:[e.jsx("h1",{children:"My Purchases"}),t?null:e.jsxs("span",{className:"purchases__count",children:[c.length," order",c.length>1?"s":""]})]}),e.jsx("div",{className:"purchases__list",children:t?Array.from({length:4}).map((r,h)=>e.jsx("div",{className:"purchase purchase--skeleton"},h)):e.jsxs(e.Fragment,{children:[c.map(r=>e.jsx(y,{purchase:r},r.id)),n?Array.from({length:2}).map((r,h)=>e.jsx("div",{className:"purchase purchase--skeleton"},`m-${h}`)):null]})}),e.jsx(_,{hasNextPage:i,isFetching:n,onLoadMore:()=>d()})]})}export{A as MyPurchases};
@@ -1,4 +1,4 @@
1
- import{p as ee}from"./ethers-DXxh-eEm.js";const ae="2.54.1";let T={getDocsUrl:({docsBaseUrl:r,docsPath:e="",docsSlug:t})=>e?`${r??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${ae}`};class o extends Error{constructor(e,t={}){var p;const n=(()=>{var u;return t.cause instanceof o?t.cause.details:(u=t.cause)!=null&&u.message?t.cause.message:t.details})(),a=t.cause instanceof o&&t.cause.docsPath||t.docsPath,s=(p=T.getDocsUrl)==null?void 0:p.call(T,{...t,docsPath:a}),i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...T.version?[`Version: ${T.version}`]:[]].join(`
1
+ import{p as ee}from"./ethers-D-4WUfRB.js";const ae="2.54.1";let T={getDocsUrl:({docsBaseUrl:r,docsPath:e="",docsSlug:t})=>e?`${r??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${ae}`};class o extends Error{constructor(e,t={}){var p;const n=(()=>{var u;return t.cause instanceof o?t.cause.details:(u=t.cause)!=null&&u.message?t.cause.message:t.details})(),a=t.cause instanceof o&&t.cause.docsPath||t.docsPath,s=(p=T.getDocsUrl)==null?void 0:p.call(T,{...t,docsPath:a}),i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...T.version?[`Version: ${T.version}`]:[]].join(`
2
2
  `);super(i,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=ae}walk(e){return se(this,e)}}function se(r,e){return e!=null&&e(r)?r:r&&typeof r=="object"&&"cause"in r&&r.cause!==void 0?se(r.cause,e):e?null:r}class oe extends o{constructor({max:e,min:t,signed:n,size:a,value:s}){super(`Number "${s}" is not in safe ${a?`${a*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class Ke extends o{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class fe extends o{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class me extends o{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function ie(r,{strict:e=!0}={}){return!r||typeof r!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(r):r.startsWith("0x")}function te(r){return ie(r,{strict:!1})?Math.ceil((r.length-2)/2):r.length}function v(r,{dir:e="left"}={}){let t=typeof r=="string"?r.replace("0x",""):r,n=0;for(let a=0;a<t.length-1&&t[e==="left"?a:t.length-a-1].toString()==="0";a++)n++;return t=e==="left"?t.slice(n):t.slice(0,t.length-n),typeof r=="string"?(t.length===1&&e==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}class Ve extends o{constructor({offset:e,position:t,size:n}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class ue extends o{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class Ye extends o{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function g(r,{dir:e,size:t=32}={}){return typeof r=="string"?he(r,{dir:e,size:t}):ye(r,{dir:e,size:t})}function he(r,{dir:e,size:t=32}={}){if(t===null)return r;const n=r.replace("0x","");if(n.length>t*2)throw new ue({size:Math.ceil(n.length/2),targetSize:t,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function ye(r,{dir:e,size:t=32}={}){if(t===null)return r;if(r.length>t)throw new ue({size:r.length,targetSize:t,type:"bytes"});const n=new Uint8Array(t);for(let a=0;a<t;a++){const s=e==="right";n[s?a:t-a-1]=r[s?a:r.length-a-1]}return n}const ge=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Xe(r,e={}){return typeof r=="number"||typeof r=="bigint"?le(r,e):typeof r=="string"?Te(r,e):typeof r=="boolean"?Ee(r,e):ce(r,e)}function Ee(r,e={}){const t=`0x${Number(r)}`;return typeof e.size=="number"?(y(t,{size:e.size}),g(t,{size:e.size})):t}function ce(r,e={}){let t="";for(let a=0;a<r.length;a++)t+=ge[r[a]];const n=`0x${t}`;return typeof e.size=="number"?(y(n,{size:e.size}),g(n,{dir:"right",size:e.size})):n}function le(r,e={}){const{signed:t,size:n}=e,a=BigInt(r);let s;n?t?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof r=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&t?-s-1n:0;if(s&&a>s||a<i){const u=typeof r=="bigint"?"n":"";throw new oe({max:s?`${s}${u}`:void 0,min:`${i}${u}`,signed:t,size:n,value:`${r}${u}`})}const p=`0x${(t&&a<0?(1n<<BigInt(n*8))+BigInt(a):a).toString(16)}`;return n?g(p,{size:n}):p}const Ne=new TextEncoder;function Te(r,e={}){const t=Ne.encode(r);return ce(t,e)}const ve=new TextEncoder;function Je(r,e={}){return typeof r=="number"||typeof r=="bigint"?Oe(r,e):typeof r=="boolean"?we(r,e):ie(r)?O(r,e):Ae(r,e)}function we(r,e={}){const t=new Uint8Array(1);return t[0]=Number(r),typeof e.size=="number"?(y(t,{size:e.size}),g(t,{size:e.size})):t}const m={zero:48,nine:57,A:65,F:70,a:97,f:102};function re(r){if(r>=m.zero&&r<=m.nine)return r-m.zero;if(r>=m.A&&r<=m.F)return r-(m.A-10);if(r>=m.a&&r<=m.f)return r-(m.a-10)}function O(r,e={}){let t=r;e.size&&(y(t,{size:e.size}),t=g(t,{dir:"right",size:e.size}));let n=t.slice(2);n.length%2&&(n=`0${n}`);const a=n.length/2,s=new Uint8Array(a);for(let i=0,p=0;i<a;i++){const u=re(n.charCodeAt(p++)),E=re(n.charCodeAt(p++));if(u===void 0||E===void 0)throw new o(`Invalid byte sequence ("${n[p-2]}${n[p-1]}" in "${n}").`);s[i]=u*16+E}return s}function Oe(r,e){const t=le(r,e);return O(t)}function Ae(r,e={}){const t=ve.encode(r);return typeof e.size=="number"?(y(t,{size:e.size}),g(t,{dir:"right",size:e.size})):t}function y(r,{size:e}){if(te(r)>e)throw new me({givenSize:te(r),maxSize:e})}function Qe(r,e){const t={to:e},n=t.to;return n==="number"?Me(r,t):n==="bigint"?de(r,t):n==="string"?Ce(r,t):n==="boolean"?xe(r,t):O(r,t)}function de(r,e={}){const{signed:t}=e;e.size&&y(r,{size:e.size});const n=BigInt(r);if(!t)return n;const a=(r.length-2)/2,s=(1n<<BigInt(a)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(a*2,"f")}`)-1n}function xe(r,e={}){let t=r;if(e.size&&(y(t,{size:e.size}),t=v(t)),v(t)==="0x00")return!1;if(v(t)==="0x01")return!0;throw new fe(t)}function Me(r,e={}){const t=de(r,e),n=Number(t);if(!Number.isSafeInteger(n))throw new oe({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${t}n`});return n}function Ce(r,e={}){let t=O(r);return e.size&&(y(t,{size:e.size}),t=v(t,{dir:"right"})),new TextDecoder().decode(t)}const Ze={gwei:9,wei:18},Re={ether:-9,wei:9};function Se(r,e){let t=r.toString();const n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(e,"0");let[a,s]=[t.slice(0,t.length-e),t.slice(t.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${a||"0"}${s?`.${s}`:""}`}function w(r,e="wei"){return Se(r,Re[e])}class pe extends o{constructor({cause:e,message:t}={}){var a;const n=(a=t==null?void 0:t.replace("execution reverted: ",""))==null?void 0:a.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(pe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Pe extends o{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${w(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Pe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class _e extends o{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${w(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(_e,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Ie extends o{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(Ie,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class $e extends o{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
3
3
  `),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty($e,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Ue extends o{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Ue,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class De extends o{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
4
4
  `),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(De,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class je extends o{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(je,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Le extends o{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Le,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ze extends o{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ze,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Be extends o{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${w(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${w(n)} gwei`:""}).`].join(`
@@ -1 +1 @@
1
- import{j as t,L as n}from"./react-CQ5qhqs6.js";import{t as o}from"./index-BW6d6BbH.js";import"./ethers-DXxh-eEm.js";function i(){return t.jsxs("div",{className:"notfound",children:[t.jsx("span",{className:"ico ico-cart notfound__ico","aria-hidden":!0}),t.jsx("h1",{className:"notfound__title",children:o("notFound.title")}),t.jsx("p",{className:"muted",children:o("notFound.body")}),t.jsx(n,{className:"btn btn--purple",to:"/assets",children:o("notFound.cta")})]})}export{i as NotFound,i as default};
1
+ import{j as t,L as n}from"./react-iAgwec9M.js";import{t as o}from"./index-BJ_QKI7g.js";import"./ethers-D-4WUfRB.js";function i(){return t.jsxs("div",{className:"notfound",children:[t.jsx("span",{className:"ico ico-cart notfound__ico","aria-hidden":!0}),t.jsx("h1",{className:"notfound__title",children:o("notFound.title")}),t.jsx("p",{className:"muted",children:o("notFound.body")}),t.jsx(n,{className:"btn btn--purple",to:"/assets",children:o("notFound.cta")})]})}export{i as NotFound,i as default};