@dcl/shop 0.1.0-29820315471.commit-e34db25 → 0.1.0-29820418604.commit-45fc148

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 (175) hide show
  1. package/assets/{AnimatedBackground-DQ46urVV.js → AnimatedBackground-CLVd407x.js} +3 -3
  2. package/assets/{Assets-5wZu90xj.js → Assets-CeamphU4.js} +1 -1
  3. package/assets/Cart-CpqxTUEQ.js +3 -0
  4. package/assets/{CircularProgress-CfcEerVP.js → CircularProgress-pGkqbXc8.js} +5 -5
  5. package/assets/{Collection-Bi7w1GKJ.js → Collection-Djh5yx-V.js} +1 -1
  6. package/assets/{CollectionCarousel-Bu8qPKKJ.js → CollectionCarousel-D-AQXiSI.js} +1 -1
  7. package/assets/{Creator-B13Gi9z4.js → Creator-eej8kLdE.js} +1 -1
  8. package/assets/{CssVarsProvider-CvtfLfCd.js → CssVarsProvider-wQmSi_2B.js} +3 -3
  9. package/assets/{ExchangeController-B9D_7PXu.js → ExchangeController-xwl8Mauh.js} +1 -1
  10. package/assets/GetCredits-BarLHOMT.js +1 -0
  11. package/assets/{HelpersUtil-CNtn9Kzj.js → HelpersUtil-CtK6l89Q.js} +1 -1
  12. package/assets/{ImportListings-hNp1sEuT.js → ImportListings-D0cnF4v2.js} +1 -1
  13. package/assets/ItemDetail-DKATNTJH.js +29 -0
  14. package/assets/{LoadMore-CwKrPv19.js → LoadMore-CUcfUpuY.js} +1 -1
  15. package/assets/{MarketCheckout-D-VQDb7F.js → MarketCheckout-CUVL7ePz.js} +1 -1
  16. package/assets/MyAssets-DZ21drOF.js +7 -0
  17. package/assets/{MyFavorites-CdAcz-wK.js → MyFavorites-CcpfBMUQ.js} +1 -1
  18. package/assets/{MyPurchases-Bw8Lb-63.js → MyPurchases-DrCQpnOc.js} +1 -1
  19. package/assets/{NotFound-C3wbCG4q.js → NotFound-Bib2meoR.js} +1 -1
  20. package/assets/{StoreSettings-BhJ4tKkZ.js → StoreSettings-BdWy5pLg.js} +2 -2
  21. package/assets/{Success-CiXoIPVr.js → Success-DoHr_e0L.js} +2 -2
  22. package/assets/{SwapController-53Vi_fXW.js → SwapController-NRXxMYwH.js} +1 -1
  23. package/assets/{TradeService-C8gY38rG.js → TradeService-Ci94LS1z.js} +1 -1
  24. package/assets/{W3MFrameProviderSingleton-CaYG210l.js → W3MFrameProviderSingleton-DC5YSqzl.js} +3 -3
  25. package/assets/{WebCryptoP256-DtgFm5FB.js → WebCryptoP256-CObxbTd2.js} +1 -1
  26. package/assets/{basic-Ch9NQwrH.js → basic-B4Dxarc6.js} +1 -1
  27. package/assets/{biconomy-TNDCvsRI.js → biconomy-4lG-30OY.js} +1 -1
  28. package/assets/{buy-BPkraJ17.js → buy-D-vBFkG6.js} +1 -1
  29. package/assets/{buy-gasless-uVyAhlxN.js → buy-gasless-BGON-kY0.js} +1 -1
  30. package/assets/{cart-checkout-Co7t_k8J.js → cart-checkout-BCBPBbFe.js} +1 -1
  31. package/assets/{categories-pY-U0UXm.js → categories-C4HyTLUC.js} +1 -1
  32. package/assets/{ccip-scmwpqQC.js → ccip-B6_7LF7S.js} +1 -1
  33. package/assets/{ccip-BAHa2VFa.js → ccip-PshQmxYU.js} +1 -1
  34. package/assets/{collection-BdgBOuhz.js → collection-WFDCerhK.js} +1 -1
  35. package/assets/{controller-DGvMtERc.js → controller-Bld6UUhD.js} +2 -2
  36. package/assets/{core-DflkIDmd.js → core-D3jzt6RC.js} +4 -4
  37. package/assets/{custom-DclbkPm_.js → custom-BQ1uOClq.js} +1 -1
  38. package/assets/{data-capture-D7FmI-WY.js → data-capture-CxB5Hizu.js} +1 -1
  39. package/assets/{decimals-Cd90iC1A.js → decimals-BaxHo7kp.js} +1 -1
  40. package/assets/{decimals-B34hEReu.js → decimals-G1SKj7ht.js} +1 -1
  41. package/assets/{detectExtension-BCqIz4gv.js → detectExtension-Cx9Ff7Bn.js} +1 -1
  42. package/assets/{email-B6HsCs0u.js → email-CiACGjjn.js} +1 -1
  43. package/assets/{embedded-wallet-cye2mSzK.js → embedded-wallet-BEct5rXi.js} +1 -1
  44. package/assets/emotion-styled.browser.esm-CfHtORSh.js +1 -0
  45. package/assets/{engine-CMumcr4T.js → engine-BnuPVhdn.js} +1 -1
  46. package/assets/{errors-qUwGIanA.js → errors-fv83sI_L.js} +1 -1
  47. package/assets/{estimate-l1-fee-DebL8v3Z.js → estimate-l1-fee-DcaMKCM5.js} +1 -1
  48. package/assets/{eth_estimateGas-2pKUTcbV.js → eth_estimateGas-DsaLLOsg.js} +1 -1
  49. package/assets/{eth_getStorageAt-CFTZVftG.js → eth_getStorageAt-BOEHlFPR.js} +1 -1
  50. package/assets/{eth_getTransactionCount-39Gh8JUo.js → eth_getTransactionCount-BAMNiMAi.js} +1 -1
  51. package/assets/{extractIPFS-PVH2EVQE.js → extractIPFS-CU6BCutm.js} +1 -1
  52. package/assets/{features-D9Taji2F.js → features-DAf222uj.js} +1 -1
  53. package/assets/{fetchTokenMetadata-DM2B3NZz.js → fetchTokenMetadata-6BMd1rXE.js} +2 -2
  54. package/assets/{get-ecosystem-wallet-info-kEbf8Llc.js → get-ecosystem-wallet-info-BUdWoGAu.js} +1 -1
  55. package/assets/{getBalance-B4GGi_h8.js → getBalance-BkD4yHvZ.js} +1 -1
  56. package/assets/{getInstalledModules-W39oQBw8.js → getInstalledModules-kilR2NiC.js} +1 -1
  57. package/assets/{getNFT-_ore7rdY.js → getNFT-CG0EByli.js} +2 -2
  58. package/assets/{getNFT-COMLY0k-.js → getNFT-DsaU7OtJ.js} +1 -1
  59. package/assets/{getOverlayAlpha-BX66SxOu.js → getOverlayAlpha-Bem9pjlW.js} +1 -1
  60. package/assets/{hashTypedData-C9Vn70Lp.js → hashTypedData-BbixXf0N.js} +1 -1
  61. package/assets/{hashTypedData-CxL0SEsX.js → hashTypedData-dr6mz0oK.js} +1 -1
  62. package/assets/{import-C7kEB_S5.js → import-Dnrd3Gn7.js} +1 -1
  63. package/assets/{in-app-wallet-calls-Dv5D-qmW.js → in-app-wallet-calls-DSLZE4sI.js} +1 -1
  64. package/assets/{index-BdsoQlUk.js → index-4F2JbvKd.js} +1 -1
  65. package/assets/{index-VhulZp0_.js → index-B2q3D1lR.js} +1 -1
  66. package/assets/{index-CF-ZZ_LW.js → index-BD7WiVfO.js} +1 -1
  67. package/assets/{index-CkezkMvS.js → index-BElm_Aqs.js} +2 -2
  68. package/assets/{index-DuRVCvRc.js → index-BKSzZVMV.js} +1 -1
  69. package/assets/{index-BznxuYKb.js → index-BMIGlv_0.js} +1 -1
  70. package/assets/{index-nyWvMhrR.js → index-BSGkpOHC.js} +1 -1
  71. package/assets/{index-txCoS8XJ.js → index-BUA7Fo9c.js} +1 -1
  72. package/assets/{index-BmTc8K12.js → index-BWzLtPgA.js} +1 -1
  73. package/assets/{index-DEN3gLrI.js → index-BZn-NUpA.js} +1 -1
  74. package/assets/{index-C-PXxORu.js → index-BdBKp-gy.js} +1 -1
  75. package/assets/{index-Tvwwbs5L.js → index-BdC3pzaB.js} +1 -1
  76. package/assets/{index-CcSs3xun.js → index-Bhvth4PE.js} +1 -1
  77. package/assets/{index-BhokrOsa.js → index-BnXCD78m.js} +1 -1
  78. package/assets/{index-xAQNqr4T.js → index-BvsXWKoe.js} +1 -1
  79. package/assets/{index-DCPsmlPD.js → index-ByFxL6ea.js} +1 -1
  80. package/assets/{index-D1hhOo8i.js → index-C-tV2998.js} +1 -1
  81. package/assets/{index-CigjJrdx.js → index-C6phI6Xb.js} +1 -1
  82. package/assets/{index-d4x-ttpO.js → index-CAAtcdsn.js} +10 -10
  83. package/assets/{index-D5DA5XrX.js → index-CAu040IR.js} +1 -1
  84. package/assets/{index-CzWl3qk_.js → index-CFR1oUCh.js} +1 -1
  85. package/assets/{index-BPURGbOI.js → index-CFbKC0wF.js} +2 -2
  86. package/assets/{index-BXG5dCKJ.js → index-CLRDpRJ0.js} +1 -1
  87. package/assets/{index-CTJrkNxC.js → index-CLs-5OTo.js} +1 -1
  88. package/assets/{index-vqW6dFQp.js → index-CQbwl1Yh.js} +2 -2
  89. package/assets/{index-D9VTjnkt.js → index-CUwqmyAE.js} +1 -1
  90. package/assets/{index-BHvu7he_.js → index-CW-V6qwJ.js} +1 -1
  91. package/assets/{index-B1ztebBZ.js → index-Cd-ELKZF.js} +1 -1
  92. package/assets/{index-BNabonCc.js → index-CiLCqE0-.js} +1 -1
  93. package/assets/{index-sBxcn5Yg.js → index-D-nBPOn3.js} +1 -1
  94. package/assets/{index-BZ2A41zN.js → index-D8JS2oIs.js} +1 -1
  95. package/assets/{index-3j2VRNSj.js → index-DBkoTlqr.js} +2 -2
  96. package/assets/{index-BoB0Y302.js → index-DC_sK6HG.js} +1 -1
  97. package/assets/{index-I594L5Wd.js → index-DF0VFAJK.js} +1 -1
  98. package/assets/{index-CFcehHl6.js → index-DGZmaPQV.js} +1 -1
  99. package/assets/{index-B6A_pOmU.js → index-DKeIDnI0.js} +1 -1
  100. package/assets/{index-BvjAr8nY.js → index-DN6MO7gI.js} +1 -1
  101. package/assets/{index-BbQ0ahsR.css → index-DPHDecnV.css} +1 -1
  102. package/assets/{index-Dc1jVnMf.js → index-DfxDdXux.js} +3 -3
  103. package/assets/{index-BB3seE1H.js → index-DhkXiUFl.js} +1 -1
  104. package/assets/{index--KLajle8.js → index-DmHcRWCn.js} +1 -1
  105. package/assets/{index-DTSgeQ5D.js → index-H_uGpjuP.js} +1 -1
  106. package/assets/{index-W7cyhQOk.js → index-IVWbWFyL.js} +1 -1
  107. package/assets/{index-DpRVy6UQ.js → index-L10sBItl.js} +1 -1
  108. package/assets/{index-CobH2y5K.js → index-LjtWVpTQ.js} +1 -1
  109. package/assets/{index-boL29_Yj.js → index-SopsxUjz.js} +1 -1
  110. package/assets/{index-BtOJu30H.js → index-TtcxtMr2.js} +1 -1
  111. package/assets/{index-CcFuTBt3.js → index-UYXDkjPb.js} +1 -1
  112. package/assets/{index-Bbub8cs6.js → index-a_jQVeYW.js} +3 -3
  113. package/assets/{index-DXDtFVPs.js → index-poWb9pgr.js} +1 -1
  114. package/assets/{index-CUImhRoy.js → index-xCs0crJs.js} +1 -1
  115. package/assets/{index-DbYRql_-.js → index-xldgn9I8.js} +1 -1
  116. package/assets/{index.es-DHRIRbEx.js → index.es-BqrOK7eY.js} +1 -1
  117. package/assets/{index.es-Dzc3VMLo.js → index.es-Db7EjNIB.js} +1 -1
  118. package/assets/{index.es-CX7mxtcH.js → index.es-VDMDPGEf.js} +4 -4
  119. package/assets/{localBatchGatewayRequest-DPQULVCl.js → localBatchGatewayRequest-CTitzrQj.js} +1 -1
  120. package/assets/{mana-rate-BWFOkvpC.js → mana-rate-B9WM_wra.js} +1 -1
  121. package/assets/{networks-h2z6LNz5.js → networks-DaswSlZt.js} +1 -1
  122. package/assets/{onramp-DkkFwfD-.js → onramp-xkeXvCaA.js} +1 -1
  123. package/assets/{openzeppelin-Dt8oZ76u.js → openzeppelin-Cvvs9IJh.js} +1 -1
  124. package/assets/{ownerOf-D61ptJju.js → ownerOf-CoLVd6Bo.js} +1 -1
  125. package/assets/{parseNft-DF9_xc-W.js → parseNft-CXI7pMpx.js} +2 -2
  126. package/assets/{parseSignature-CoN-flwV.js → parseSignature-DYZh-ocN.js} +3 -3
  127. package/assets/{parseSignature-BGy6ebQm.js → parseSignature-F_ud8fII.js} +1 -1
  128. package/assets/{pay-with-exchange-CrvAas-k.js → pay-with-exchange-DvxmW09T.js} +1 -1
  129. package/assets/{qr-overlay-_AYDDd2P.js → qr-overlay-BBvKBjTt.js} +1 -1
  130. package/assets/{receive-BikF2OCK.js → receive-DswDLHVt.js} +1 -1
  131. package/assets/{resolveImplementation-CyERb8Bt.js → resolveImplementation-BNT1AXUm.js} +1 -1
  132. package/assets/{rpc-Bj2mehcE.js → rpc-KT1pZ07O.js} +1 -1
  133. package/assets/{secp256k1-4S_gx5U_.js → secp256k1-B9LFhz8-.js} +1 -1
  134. package/assets/{secp256k1-BwiABSKe.js → secp256k1-CaLQACD2.js} +1 -1
  135. package/assets/{secp256k1-BlXhQE61.js → secp256k1-sH0IQLpr.js} +1 -1
  136. package/assets/{send-B7leZ2sF.js → send-DMQpd0xN.js} +1 -1
  137. package/assets/{send-batch-transaction-NCJfUQmg.js → send-batch-transaction-Bjx4TPU7.js} +1 -1
  138. package/assets/{send-eip712-transaction-DyB2yZtW.js → send-eip712-transaction-Bhyo5mJD.js} +2 -2
  139. package/assets/{send-gasless-transaction-DxbiAsWR.js → send-gasless-transaction-X-ayhziV.js} +2 -2
  140. package/assets/{sendRawTransaction-CXnui5Km.js → sendRawTransaction-BWFwBY9N.js} +3 -3
  141. package/assets/{serializeTransaction-BA8Lx_h7.js → serializeTransaction-BiJ9trpW.js} +1 -1
  142. package/assets/{session-proposal-ZPunDXaI.js → session-proposal-DF0C5j1r.js} +1 -1
  143. package/assets/{session-request-D_b2ouvA.js → session-request-DkiybRpS.js} +2 -2
  144. package/assets/{sha256-D2Fo41ck.js → sha256-D19Qvf5p.js} +1 -1
  145. package/assets/{signing-CP2v_dlr.js → signing-B7Xgt3VD.js} +4 -4
  146. package/assets/{socials-xqF7U9Yn.js → socials-D3OOLxHa.js} +1 -1
  147. package/assets/{swaps-B3ujQJZz.js → swaps-UK0-24rq.js} +1 -1
  148. package/assets/{thirdweb-B7ea2PEt.js → thirdweb-BlBLiS5O.js} +3 -3
  149. package/assets/{totalSupply-D22_m4j2.js → totalSupply-CuciM66j.js} +1 -1
  150. package/assets/{trade-encoding-cvcruSuW.js → trade-encoding-Dr2besxr.js} +1 -1
  151. package/assets/{transactionReceipt-9wnHZrRL.js → transactionReceipt-D_l0_P3M.js} +1 -1
  152. package/assets/{transactions-Nu8-9WNT.js → transactions-HpO-uP9c.js} +1 -1
  153. package/assets/useCreditPacks-jF-_aYkt.js +1 -0
  154. package/assets/{useInfiniteGrid-ClIfwXAY.js → useInfiniteGrid-DmEa4Rj6.js} +1 -1
  155. package/assets/{useStore-BPgnQXlK.js → useStore-BDGgQjbV.js} +1 -1
  156. package/assets/useTheme-DR6D7MpO.js +1 -0
  157. package/assets/useTheme-DpFmSKCC.js +1 -0
  158. package/assets/{verifyHash-DMHtO2BR.js → verifyHash-CFbVV67B.js} +1 -1
  159. package/assets/{w3m-modal-wqk18fis.js → w3m-modal-DG3fBPEn.js} +1 -1
  160. package/assets/{w3m-modal-Cx_nmtny.js → w3m-modal-o13KrB6a.js} +1 -1
  161. package/assets/{wait-for-tx-receipt-BPkFazzP.js → wait-for-tx-receipt-CEcDL_4s.js} +1 -1
  162. package/assets/{wallets-CmM_4Vm-.js → wallets-Bxi0qfe_.js} +6 -6
  163. package/assets/{web-connector-B01y8d6Z.js → web-connector-Djulx7DD.js} +3 -3
  164. package/assets/{writeContract-BTRFLrl9.js → writeContract-ld1yjWET.js} +1 -1
  165. package/assets/{zoraTestnet-Bq4RAmQw.js → zoraTestnet-DuoJupX5.js} +1 -1
  166. package/index.html +11 -11
  167. package/package.json +2 -2
  168. package/assets/Cart-DDgcOTzw.js +0 -3
  169. package/assets/GetCredits-C3rj35ez.js +0 -1
  170. package/assets/ItemDetail-BqrPvIRT.js +0 -29
  171. package/assets/MyAssets-CzmZ_l10.js +0 -7
  172. package/assets/emotion-styled.browser.esm-B-hzcBrK.js +0 -1
  173. package/assets/payments-DEbBixXM.js +0 -1
  174. package/assets/useTheme-BwxUDr5G.js +0 -1
  175. package/assets/useTheme-HWLX9NSW.js +0 -1
package/index.html CHANGED
@@ -16,10 +16,10 @@
16
16
  <link rel="canonical" href="https://shop.decentraland.org/" />
17
17
 
18
18
  <!-- Favicon: the Decentraland mark (same as the marketplace). -->
19
- <link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/favicon.ico" sizes="16x16 32x32 48x48" />
20
- <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/apple-touch-icon.png" />
19
+ <link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/favicon.ico" sizes="16x16 32x32 48x48" />
20
+ <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/apple-touch-icon.png" />
21
21
  <meta name="apple-mobile-web-app-title" content="DCL Shop" />
22
- <link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/site.webmanifest" />
22
+ <link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/site.webmanifest" />
23
23
 
24
24
  <!-- Open Graph -->
25
25
  <meta property="og:type" content="website" />
@@ -48,7 +48,7 @@
48
48
  <meta name="twitter:image:alt" content="Decentraland Shop — wearables and emotes for your avatar" />
49
49
 
50
50
  <!-- Sitemap -->
51
- <link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/sitemap.xml" />
51
+ <link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/sitemap.xml" />
52
52
 
53
53
  <!-- Warm the 3D preview / fonts -->
54
54
  <link rel="preconnect" href="https://fonts.googleapis.com" />
@@ -60,13 +60,13 @@
60
60
  <link rel="preconnect" href="https://wearable-preview.decentraland.org" />
61
61
  <link rel="preconnect" href="https://peer.decentraland.zone" crossorigin />
62
62
  <link rel="preconnect" href="https://peer.decentraland.org" crossorigin />
63
- <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/index-d4x-ttpO.js"></script>
64
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/react-yytiy0wi.js">
65
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/dcl-schemas-BICTSpB5.js">
66
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/sentry-BPJvc5GU.js">
67
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/ethers-w2AslR0v.js">
68
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/intl-CBcMB1D2.js">
69
- <link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/index-BbQ0ahsR.css">
63
+ <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/index-CAAtcdsn.js"></script>
64
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/react-yytiy0wi.js">
65
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/dcl-schemas-BICTSpB5.js">
66
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/sentry-BPJvc5GU.js">
67
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/ethers-w2AslR0v.js">
68
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/intl-CBcMB1D2.js">
69
+ <link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/index-DPHDecnV.css">
70
70
  </head>
71
71
  <body>
72
72
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/shop",
3
- "version": "0.1.0-29820315471.commit-e34db25",
3
+ "version": "0.1.0-29820418604.commit-45fc148",
4
4
  "main": "index.js",
5
5
  "author": "Decentraland",
6
6
  "license": "Apache-2.0",
@@ -8,5 +8,5 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/decentraland/shop.git"
10
10
  },
11
- "commit": "e34db2560c89ec4964fc6bf022fb2018941c5ec2"
11
+ "commit": "45fc1481b0ec94b64fb7f9cc99fb621352c695b7"
12
12
  }
@@ -1,3 +0,0 @@
1
- import{j as e,r as x,a as Se,b as Ie,L as Z}from"./react-yytiy0wi.js";import{t as a,C as S,a8 as R,a as qe,a9 as N,c as ie,d as Le,g as Pe,o as Ee,u as Te,I as L,aa as Be,b as O,ab as de,ac as Fe,D as A,s as Ae,B as Re,j as We,k as Ue,w as ze,q as ue,ad as Ke,y as he,x as Qe,ae as $e}from"./index-d4x-ttpO.js";import{a as me}from"./buy-BPkraJ17.js";import{g as Oe,a as De,w as Ge,S as Je,G as Ve}from"./buy-gasless-uVyAhlxN.js";import{R as D,r as Ye}from"./cart-checkout-Co7t_k8J.js";import{C as He,c as Xe}from"./payments-DEbBixXM.js";import{E as be}from"./ErrorNotice-CKeOu_Oi.js";import{i as Ze,a as es}from"./errors-qUwGIanA.js";import{C as ss}from"./CollectionCarousel-Bu8qPKKJ.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-cvcruSuW.js";import"./index-HN6Rk25C.js";function as(t){const{phase:r,balanceCredits:b,onClose:l}=t,j=r==="processing",P=r!=="complete",E=r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),k=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:j?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${k?" buy-modal__card--tall":""}`,children:[P&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:E}),!j&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(S,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:R(b)})]})]}),r==="processing"&&e.jsx(ts,{step:t.step??1,total:t.total??1}),r==="nofunds"&&e.jsx(cs,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(rs,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(be,{message:t.message}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:l,children:a("buyModal.close")})})]})]})]})}function ts({step:t,total:r}){return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:a("buyModal.completingTransaction")}),e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})}),e.jsxs("span",{className:"cart-checkout__step",children:[t,"/",r]})]})]})}function cs({lines:t,shortfallCredits:r,packs:b,selectedPack:l,onSelectPack:j,onBuyPacks:P,onCancel:E}){const k=b.find(c=>c.id===l),J=t.reduce((c,g)=>c+(g.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:J})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const g=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),g>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:g})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(S,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:R(c.priceCredits*g)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:b.map(c=>{const g=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${g?" buy-modal__pack--on":""}`,onClick:()=>j(c.id),children:[e.jsx(S,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:R(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(S,{className:"buy-modal__total-ico"}),e.jsx("span",{children:R((k==null?void 0:k.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((k==null?void 0:k.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:E,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:P,children:a("buyModal.buy")})]})]})}function rs({purchased:t,onMyAssets:r,onTryInWorld:b}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(l=>{const j=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),j>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:j})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(S,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:R(l.priceCredits*j)})]})]},l.id)})})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:b,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const ns=Ae(Re)`
2
- margin-top: 12px;
3
- `;function _e(t){if(Ze(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const os=12e4,G=He.slice(0,3),ls=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function is(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}const ye=t=>t.reduce((r,b)=>r+b.priceCredits*b.quantity,0),ds=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function ws(){qe({title:a("nav.cart"),noindex:!0});const t=N(s=>s.items),r=N(s=>s.remove),b=N(s=>s.increment),l=N(s=>s.decrement),j=N(s=>s.clear),P=N(s=>s.restore),E=N(s=>s.setFittingOpen),k=ie(s=>s.items),J=ie(s=>s.toggle),{session:c}=Le();x.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const g=t.some(s=>s.category!=="emote"),{data:V}=Pe({queryKey:["upsell-listings"],queryFn:()=>$e({first:40}),staleTime:6e4}),{data:T}=Ee(c),W=Te(),U=Se(),{state:I}=Ie(),[ee,B]=x.useState(null),[pe,C]=x.useState(null),[se,z]=x.useState(null),[xe,q]=x.useState(!1),[f,F]=x.useState(null),ae=x.useRef(0),[d,w]=x.useState(null),[Y,te]=x.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ke=f?f.liveTotalCredits:je,fe=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!fe.has(s.id)).slice(0,12),ge=new Map(f==null?void 0:f.buyable.map(s=>[s.item.id,s])),K=(T==null?void 0:T.credits)??0,ve=Fe;function Q(s){s(),F(null),z(null),C(null)}function Ne(){w(null),q(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-K),p=G.find(u=>u.credits>=o)??G[G.length-1];te(p.id),O("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:K,shortfall:o}),w({phase:"nofunds",lines:s.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:o}),q(!1)}async function Ce(s){if(!c||s.length===0)return;const n=ds(s),o=n.map(i=>({...i.item,priceCredits:i.priceCredits})),p=s.map(i=>({...i.item,priceCredits:i.priceCredits,quantity:i.quantity})),u=[];let v="authorize",$=!1;w({phase:"processing",step:1,total:n.length});try{const i=[];for(let h=0;h<n.length;h++){const _=n[h];w({phase:"processing",step:h+1,total:n.length});try{const{credit:y,maxCreditedValue:X}=await ze(c.identity,_.usdCents,_.trade.id);u.push(y.id),i.push({trade:_.trade,credits:[y],maxCreditedValue:X})}catch(y){if(es(y)){if(u.length){try{await ue(c.identity,u)}catch(X){A(X,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw y}}v="submit";let m=[];if(Oe())try{m=await De({purchases:i,buyer:c.address,signer:c.signer});const _=(await Promise.allSettled(m.map(y=>Ge(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(_.length&&!_.some(y=>y instanceof Je))throw _[0];$=!0}catch(h){if(!(h instanceof Ve))throw h;m=await me({purchases:i,buyer:c.address,signer:c.signer})}else m=await me({purchases:i,buyer:c.address,signer:c.signer});s.forEach(h=>r(h.item.id)),F(null),O("Shop Completed Purchase",{...Ke(o),payment_type:"credits",no_crypto_step:$,transaction_hash:m[0]??null}),W.invalidateQueries({queryKey:["usd-balance"]}),w({phase:"complete",purchased:p})}catch(i){if(he(i)||A(i,{flow:"cart_checkout",step:v,cart_size:s.length}),O(he(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Qe(i),value_usd:de(o.reduce((m,h)=>m+h.priceCredits,0)),cart_size:n.length}),u.length){try{await ue(c.identity,u)}catch(m){A(m,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}w({phase:"error",message:_e(i)})}}function oe(s){const n=ye(s);if(T!=null&&T.credits<n){ne(s);return}Ce(s)}async function H(){if(!c){C(a("buyModal.signInToCheckout"));return}const s=N.getState().items;if(s.length===0)return;C(null),z(null),q(!0);const n=s.reduce((o,p)=>o+p.priceCredits*p.quantity,0);O("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:K>=n});try{B(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),p=[...o.unavailable,...o.own];if(p.length&&(p.forEach(u=>r(u.id)),z(is(o))),o.buyable.length===0){C(a("cart.error.noneAvailable")),F(null),B(null);return}if(o.orderChanged){F(o),ae.current=Date.now(),B(null);return}B(null),oe(o.buyable)}catch(o){A(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),C(_e(o)),B(null)}finally{q(!1)}}async function we(){if(f){if(!c){C(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>os){F(null),z(null),await H();return}C(null),oe(f.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(N.getState().items))}catch{}q(!0);try{const s=await Xe(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}U("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}A(s,{flow:"cart_buy_credits"}),w({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const le=x.useRef(!1);x.useEffect(()=>{if(!(I!=null&&I.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&P(o)}}catch{}W.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void H(),0);return()=>clearTimeout(s)},[I==null?void 0:I.resumeCheckout]);const M=xe||(d==null?void 0:d.phase)==="processing";return t.length===0&&!d?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(L,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ns,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>U(-1),type:"button",children:[e.jsx(L,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("section",{className:"checkout__panel",children:[e.jsxs("div",{className:"checkout__panel-head",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(L,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),g?e.jsxs("button",{className:"checkout__fitting",onClick:()=>E(!0),disabled:M,children:[e.jsx(L,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=ge.get(s.id),o=n?n.priceCredits:s.priceCredits,p=!!n&&n.priceCredits!==s.priceCredits,u=!s.tokenId,v=s.quantity,$=typeof s.available=="number"&&v>=s.available,i=o*v,m=!!k[s.id],h=s.tokenId??s.itemId,_=s.contractAddress&&h?`/item/${s.contractAddress}/${h}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(Z,{className:"checkout__thumb-link",to:_,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(Z,{className:"checkout__name",to:_,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[u?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>l(s.id)),disabled:M||v<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:v}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>b(s.id)),disabled:M||$,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(S,{className:"checkout__price-ico"})," ",i,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*v}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${m?" is-on":""}`,onClick:()=>J(s),"aria-label":m?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:m?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(L,{name:m?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>r(s.id)),disabled:M,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(L,{name:"trash",size:24})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>Q(j),disabled:M,children:a("cart.clearCart")}),null]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(S,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(f?we():H()),disabled:M,children:M?a("cart.working"):f?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),f?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(be,{message:pe,className:"checkout__msg"})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:re})}):null,d?e.jsx(as,{phase:d.phase,balanceCredits:K,onClose:Ne,step:d.phase==="processing"?d.step:void 0,total:d.phase==="processing"?d.total:void 0,lines:d.phase==="nofunds"?d.lines:void 0,shortfallCredits:d.phase==="nofunds"?d.shortfall:void 0,packs:G,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:d.phase==="complete"?d.purchased:void 0,onMyAssets:()=>U("/assets?tab=mine"),onTryInWorld:()=>window.open(ls,"_blank","noopener"),message:d.phase==="error"?d.message:void 0}):null]})}export{ws as Cart};
@@ -1 +0,0 @@
1
- import{a as T,u as D,r as a,j as e}from"./react-yytiy0wi.js";import{a as V,t,d as O,u as K,b as u,k as n,D as A,x as L,C as Y,r as $}from"./index-d4x-ttpO.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as q}from"./cart-checkout-Co7t_k8J.js";import{p as Q,c as W,i as z,C as J}from"./payments-DEbBixXM.js";import{C as X}from"./CircularProgress-CfcEerVP.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const C="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/pack-chips--HnOpf5U.webp",ee="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/credit-coin-CmcTCd5i.webp",se="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg%20width='61'%20height='61'%20viewBox='0%200%2061%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.5%2061C47.3447%2061%2061%2047.3447%2061%2030.5C61%2013.6553%2047.3447%200%2030.5%200C13.6553%200%200%2013.6553%200%2030.5C0%2047.3447%2013.6553%2061%2030.5%2061Z'%20fill='url(%23gc_paint0)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2001%2054.8997C17.2935%2058.7274%2023.6375%2060.9997%2030.5%2060.9997C37.3625%2060.9997%2043.7065%2058.7274%2048.8%2054.8997H12.2001Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.10013%2048.7997C7.83863%2051.1024%209.89738%2053.1612%2012.2001%2054.8997H48.8001C51.1029%2053.1612%2053.1616%2051.1024%2054.9001%2048.7997H6.10013Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2042.6998H2.5468C3.4923%2044.8805%204.69705%2046.924%206.10005%2048.7997H40.9311V42.6998H40.9158Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6094%2019.8247V42.6997H40.6719L21.6094%2019.8247Z'%20fill='url(%23gc_paint1)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.5468%2042.6997H21.6093V19.8248L2.5468%2042.6997Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2032.025V48.8H54.9L40.9158%2032.025Z'%20fill='url(%23gc_paint2)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9467%2048.8H40.9157V32.025L26.9467%2048.8Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2027.4497C45.127%2027.4497%2048.5408%2024.0359%2048.5408%2019.8247C48.5408%2015.6136%2045.127%2012.1998%2040.9158%2012.1998C36.7046%2012.1998%2033.2908%2015.6136%2033.2908%2019.8247C33.2908%2024.0359%2036.7046%2027.4497%2040.9158%2027.4497Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6092%2015.2497C23.7148%2015.2497%2025.4217%2013.5428%2025.4217%2011.4372C25.4217%209.33166%2023.7148%207.62475%2021.6092%207.62475C19.5036%207.62475%2017.7967%209.33166%2017.7967%2011.4372C17.7967%2013.5428%2019.5036%2015.2497%2021.6092%2015.2497Z'%20fill='%23FFC95B'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='gc_paint0'%20x1='30.5'%20y1='-12.6335'%20x2='-12.6335'%20y2='30.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint1'%20x1='21.6029'%20y1='19.8247'%20x2='21.6029'%20y2='42.6997'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint2'%20x1='40.9111'%20y1='32.025'%20x2='40.9111'%20y2='48.8'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",_=z()?"mock":"stripe",re={pack_5:C,pack_10:C,pack_25:C,pack_50:C},ce="https://docs.decentraland.org";function I(l){const s=l;if((s==null?void 0:s.name)==="AbortError")return t("getCredits.errorCanceled");const p=((s==null?void 0:s.message)??"").toLowerCase();return p.includes("sign in")?t("getCredits.errorSignIn",{currency:n.name}):p.includes("timed out")?t("getCredits.errorTimeout",{currency:n.name}):t("getCredits.errorGeneric")}function _e(){V({title:t("nav.getCredits",{currency:n.name}),noindex:!0});const l=T(),{session:s,signIn:p}=O(),f=K(),[v,S]=D(),[g,d]=a.useState("select"),[i,w]=a.useState(null),[F,E]=a.useState(null),[P,m]=a.useState(null),[H,j]=a.useState(!1),N=a.useRef(null);a.useEffect(()=>()=>{var r;return(r=N.current)==null?void 0:r.abort()},[]);const B=a.useCallback(()=>{S(r=>{const c=new URLSearchParams(r);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[S]),y=a.useCallback(async r=>{d("processing");const c=new AbortController;N.current=c;try{const o=await Q(r,{signal:c.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(o.status==="credited"){const x=o.creditsGranted??(i==null?void 0:i.credits)??0;E(x>0?x:null),d("success"),u("Shop Completed Buy Credits",{order_id:r,pack_usd:(i==null?void 0:i.usd)??null,credits:x>0?x:null,provider:_}),f.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(q)){l("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const R=sessionStorage.getItem(G);if(R){sessionStorage.removeItem(G);const h=JSON.parse(R),M=h.tokenId??h.itemId;if(h.contractAddress&&M){l(`/item/${h.contractAddress}/${M}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else o.status==="pending"?(u("Shop Buy Credits Pending",{step:"grant",pack_usd:(i==null?void 0:i.usd)??null}),f.invalidateQueries({queryKey:["usd-balance"]}),d("pending")):(u("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(i==null?void 0:i.usd)??null}),m(o.error??t("getCredits.errorGrant",{currency:n.name})),d("error"))}catch(o){A(o,{flow:"get_credits",step:"grant",order_id:r}),u("Shop Buy Credits Failed",{step:"grant",error_code:L(o),pack_usd:(i==null?void 0:i.usd)??null}),m(I(o)),d("error")}},[i,s,f,l]),U=a.useCallback(async r=>{if(!s){p();return}m(null),j(!1),w(r),d(_==="mock"?"processing":"redirecting"),u("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:_});try{const c=await W(r.id,{address:s.address,identity:s.identity});if(c.mock)y(c.orderId);else if(c.url)u("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){A(c,{flow:"get_credits",step:"checkout",provider:_}),u("Shop Buy Credits Failed",{step:"checkout",error_code:L(c),pack_usd:r.usd}),m(I(c)),d("error")}},[s,p,y]),b=a.useRef(!1);a.useEffect(()=>{if(b.current)return;const r=v.get("order");if(v.get("canceled")!=null){b.current=!0,u("Shop Buy Credits Cancelled",{order_id:r,provider:_}),B(),j(!0),d("select");return}r&&(d("processing"),s&&(b.current=!0,B(),y(r)))},[v,s]);function k(){var r;(r=N.current)==null||r.abort(),d("select"),w(null),E(null),m(null),j(!1)}const Z=g==="select";return e.jsxs("div",{className:"getcredits",children:[Z&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:t("getCredits.title",{currency:n.name})}),e.jsxs("p",{className:"getcredits__sub",children:[t("getCredits.subtitle",{currency:n.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ce,target:"_blank",rel:"noreferrer",children:[t("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),g==="select"&&e.jsxs(e.Fragment,{children:[H&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:t("getCredits.canceledNote")}),e.jsx(ie,{onSelect:r=>void U(r)})]}),g==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(X,{size:32}),e.jsx("p",{className:"muted",children:t("getCredits.redirecting")})]}),g==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:te,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:t("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),g==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:se,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:t("getCredits.successTitle")})," ",t("getCredits.successBody",{currency:n.name})]})]}),F!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:ee,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(Y,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:t("getCredits.creditsAmount",{credits:F,currency:n.name})})," ",e.jsx("span",{className:"gc-credits__added",children:t("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:k,children:t("getCredits.buyMore",{currency:n.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:t("getCredits.startShopping")})]})]}),g==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.pendingTitle",{currency:n.name})}),e.jsx("p",{className:"muted",children:t("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:t("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:k,children:t("getCredits.done")})]})]}),g==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:P}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:k,children:t("getCredits.tryAgain")})})]})]})}function ie({onSelect:l}){return e.jsx("div",{className:"packs",children:J.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>l(s),"aria-label":t("getCredits.packAria",{amount:$(s.credits),usd:s.usd}),children:[s.bestValue&&e.jsx("span",{className:"pack__badge",children:t("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:t("getCredits.creditsAmount",{credits:s.credits,currency:n.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:re[s.id]??C,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",s.usd.toFixed(2)]})})]})]},s.id))})}export{_e as GetCredits,_e as default};
@@ -1,29 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DEN3gLrI.js","assets/react-yytiy0wi.js","assets/dcl-schemas-BICTSpB5.js","assets/index-d4x-ttpO.js","assets/sentry-BPJvc5GU.js","assets/ethers-w2AslR0v.js","assets/intl-CBcMB1D2.js","assets/index-BbQ0ahsR.css","assets/emotion-styled.browser.esm-B-hzcBrK.js","assets/useTheme-HWLX9NSW.js","assets/CircularProgress-CfcEerVP.js","assets/index-vqW6dFQp.js","assets/useTheme-BwxUDr5G.js","assets/CssVarsProvider-CvtfLfCd.js","assets/getOverlayAlpha-BX66SxOu.js","assets/index-D1hhOo8i.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
2
- import{a as re,r as m,j as e,d as $e,b as qe,L as Ve}from"./react-yytiy0wi.js";import{d as le,o as We,u as ze,t as s,ac as Oe,l as Ke,m as Ue,w as Qe,q as X,b as K,x as xe,y as te,ad as Ge,D as ye,C as A,a8 as ee,_ as ie,ag as He,aj as Ye,ai as Je,az as Ze,am as Xe,j as Ae,aA as ea,af as Me,s as de,aB as aa,aC as sa,aD as ta,aE as ia,a9 as ve,c as je,g as O,aF as ra,aG as la,aH as da,aI as na,aJ as ca,ao as oa,a as ma,I as q,aK as ua,aL as _a,aM as ha,aa as pa,aN as fe,aO as ba,B as Se,ar as xa,aP as ya,aQ as va,as as ja,aR as fa}from"./index-d4x-ttpO.js";import{d as W}from"./dcl-schemas-BICTSpB5.js";import{b as ge}from"./buy-BPkraJ17.js";import{g as ga,b as Na,w as wa,S as Ca,G as ka}from"./buy-gasless-uVyAhlxN.js";import{C as Ia,c as Aa}from"./payments-DEbBixXM.js";import{R as Ne}from"./resume-buy-Bf0zIH7y.js";import{a as Ma,f as we}from"./errors-qUwGIanA.js";import{E as Sa}from"./ErrorNotice-CKeOu_Oi.js";import{C as Pa}from"./CircularProgress-CfcEerVP.js";import{u as Ea,M as Fa}from"./MarketCheckout-D-VQDb7F.js";import{s as La}from"./address-DrURAr9O.js";import{C as Da}from"./CollectionCarousel-Bu8qPKKJ.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-cvcruSuW.js";import"./index-HN6Rk25C.js";import"./mana-rate-BWFOkvpC.js";const V=Ia.slice(0,3);function Ta({item:r,onClose:c,resume:t=!1}){var k,H;const{session:o}=le(),{data:d}=We(o),p=ze(),y=re(),[u,l]=m.useState("loading"),[v,a]=m.useState(null),[j,S]=m.useState(""),[f,L]=m.useState(r.priceCredits),[w,N]=m.useState(null),g=m.useRef(null),z=(w==null?void 0:w.credits)??f,C=(d==null?void 0:d.credits)??0;m.useEffect(()=>{let n=!1;if(!o){l("error"),a(s("buyModal.signInToCheckout"));return}const x=_=>{const h=_-((d==null?void 0:d.credits)??0),b=V.find(I=>I.credits>=h)??V[V.length-1];S(b.id),K("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,h)}),l("nofunds")};return(async()=>{var _,h;try{const b=await Oe(r);if(!b)throw new Error("not for sale");if(Ke(b,o.address))throw new Error("You can't buy your own listing.");const I=Ue((h=(_=b.received)==null?void 0:_[0])==null?void 0:h.amount);if(!Number.isFinite(I)||I<=0)throw new Error("price unavailable");const R=Math.ceil(I/10);if(n)return;if(L(R),d!=null&&d.credits<R){x(R);return}try{const{credit:P,maxCreditedValue:D,usdCents:$}=await Qe(o.identity,I,b.id);if(n){X(o.identity,[P.id]).catch(()=>{});return}g.current=P.id;const T=Math.ceil($/10);L(T);const Y={trade:b,credit:P,maxCreditedValue:D,usdCents:$,credits:T};N(Y),t?U(Y):l("ready")}catch(P){if(n)return;if(Ma(P)){x(R);return}throw P}}catch(b){if(n)return;K(te(b)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:xe(b)}),l("error"),a(we(b,s("buyModal.error.generic"),{sale:!0}))}})(),()=>{n=!0,g.current&&o&&(X(o.identity,[g.current]).catch(()=>{}),g.current=null)}},[]);async function U(n=w){if(!o||!n)return;l("processing"),a(null);let x=!1;try{const _={trade:n.trade,buyer:o.address,signer:o.signer,credits:[n.credit],maxCreditedValue:n.maxCreditedValue};let h;if(ga())try{h=await Na(_),await wa(h),x=!0}catch(b){if(b instanceof Ca)x=!0;else if(b instanceof ka)h=await ge(_);else throw b}else h=await ge(_);g.current=null,K("Shop Completed Purchase",{...Ge([r]),payment_type:"credits",no_crypto_step:x,transaction_hash:h??null}),p.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){te(_)||ye(_,{flow:"buy",step:"submit",gasless:x}),X(o.identity,[n.credit.id]).catch(()=>{}),g.current=null,K(te(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:xe(_)}),p.invalidateQueries({queryKey:["usd-balance"]}),a(we(_,s("buyModal.error.generic"),{sale:!0})),l("error")}}async function Q(){if(!(!j||!o)){try{sessionStorage.setItem(Ne,JSON.stringify(r))}catch{}w&&X(o.identity,[w.credit.id]).catch(()=>{}),g.current=null,l("loading");try{const n=await Aa(j,{address:o.address,identity:o.identity});if(n.url){window.location.href=n.url;return}y("/credits")}catch(n){ye(n,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ne)}catch{}a(s("buyModal.error.creditsCheckout")),l("error")}}}const G=u==="processing",B=u==="complete"?s("buyModal.titleComplete"):u==="nofunds"?s("buyModal.titleNoFunds"):s("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":s("buyModal.dialogAria",{name:r.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:G?void 0:c,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${u==="processing"||u==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:B}),!G&&e.jsx("button",{className:"buy-modal__x",onClick:c,"aria-label":s("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:u==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(A,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ee(C)})]})]}),u==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(Pa,{size:44})}),u==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Sa,{message:v}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:c,children:s("buyModal.close")})})]}),u==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,z-C)})})," ",s("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(Ce,{item:r,priceCredits:z}),e.jsx("div",{className:"buy-modal__packs",children:V.map(n=>{const x=n.credits,_=n.id===j;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>S(n.id),children:[e.jsx(A,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ee(x)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(A,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ee(((k=V.find(n=>n.id===j))==null?void 0:k.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((H=V.find(n=>n.id===j))==null?void 0:H.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:c,children:s("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void Q(),children:s("buyModal.buy")})]})]}),u==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ce,{item:r,priceCredits:z}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void U(),children:s("buyModal.buy")})})]}),u==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:t?s("buyModal.completingPurchase"):s("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),u==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:s("getCredits.successTitle")})," ",s("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>y("/assets?tab=mine"),children:s("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:c,children:[s("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function Ce({item:r,priceCredits:c}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:r.name,children:r.name||s("buyModal.itemFallback")}),r.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:s("search.byCreator",{name:r.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(A,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ee(c)})]})]})]})}const Ba=m.lazy(async()=>{const[{EmoteControls:r},{Experimental_CssVarsProvider:c},{light:t}]=await Promise.all([ie(()=>import("./index-DEN3gLrI.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ie(()=>import("./index-vqW6dFQp.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ie(()=>import("./index-D1hhOo8i.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:o=>e.jsx(c,{theme:t,children:e.jsx(r,{...o})})}});function Ra(r){return e.jsx(m.Suspense,{fallback:null,children:e.jsx(Ba,{...r})})}function $a({item:r}){const c=le(N=>{var g;return(g=N.session)==null?void 0:g.address}),{data:t,isLoading:o}=He(c),d=c&&t?c:"default",p=r.category==="emote",[y,u]=m.useState("item"),l=!p&&y==="item",v=l||!o,[a,j]=m.useState(!0);m.useEffect(()=>{j(!0)},[r.id,l]);const S=!!c&&!!t,f=S&&Ye(r,Je(t)),L=Ze(r)[0],w=S&&!f&&!p;return e.jsxs(e.Fragment,{children:[v?e.jsx(Xe,{id:"shop-item-preview",contractAddress:r.contractAddress,tokenId:r.tokenId??void 0,itemId:r.tokenId?void 0:r.itemId??void 0,profile:l?void 0:f?d:"default",bodyShape:l||f?void 0:L,type:p?void 0:l?W.PreviewType.WEARABLE:W.PreviewType.AVATAR,emote:p||l?void 0:W.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:p?1.5:void 0,wheelStart:p?100:void 0,dev:Ae.chainId===80002,onLoad:()=>j(!1)}):null,!v||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,w&&!l?e.jsx("p",{className:"item-preview__note",children:s("itemPreview.shownOnBody",{shape:ea(L)})}):null,p?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(Ra,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":s("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:y==="avatar"?"is-active":"","aria-pressed":y==="avatar","aria-label":s("itemPreview.onAvatar"),onClick:()=>u("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:y==="item"?"is-active":"","aria-pressed":y==="item","aria-label":s("itemPreview.item"),onClick:()=>u("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.item")})]})]})]})}const qa=de(aa)`
3
- display: flex;
4
- flex-direction: column;
5
- overflow: hidden;
6
- gap: 1px;
7
- background: ${Me.colors.lineStrong};
8
- `;function Va({contractAddress:r,name:c,items:t,className:o}){const d=re();if(!r||!c)return null;const p=(t??[]).map(l=>l.thumbnail).filter(l=>!!l).slice(0,4),y=p.slice(0,2),u=p.slice(2,4);return e.jsxs(sa,{as:"button","data-link":!0,className:o,"data-testid":"creator",onClick:l=>{l.stopPropagation(),d(`/collection/${r}`)},children:[p.length>0?e.jsxs(qa,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${u.length===0?" collection-collage__row--full":""}`,children:y.map((l,v)=>e.jsx("img",{src:l,alt:""},v))}),u.length>0?e.jsx("span",{className:"collection-collage__row",children:u.map((l,v)=>e.jsx("img",{src:l,alt:""},v))}):null]}):null,e.jsx(ta,{"data-testid":"creator-name",children:ia(c)})]})}const Wa=de(Se)`
9
- margin-top: 6px;
10
- `,ke=de(Se)`
11
- && {
12
- width: 100%;
13
- height: 48px;
14
- font-size: 15px;
15
- font-weight: 600;
16
- letter-spacing: 0.46px;
17
- display: flex;
18
- align-items: center;
19
- justify-content: center;
20
- gap: 8px;
21
- }
22
-
23
- ${Me.media.down("lg")} {
24
- .item-detail__ctas--dual && {
25
- flex: 1 1 auto;
26
- width: auto;
27
- }
28
- }
29
- `;function za(r){return Object.values(W.Rarity).includes(r)}function Oa(r){return r==="male"?s("itemDetail.genderMale"):r==="female"?s("itemDetail.genderFemale"):r==="unisex"?s("itemDetail.genderUnisex"):null}function Ie(r){return r.wearableCategory?r.wearableCategory.replace(/_/g," "):r.category==="emote"?s("itemDetail.categoryEmote"):s("itemDetail.categoryWearable")}function ms(){var pe;const{contractAddress:r,tokenId:c}=$e(),{state:t}=qe(),o=re(),d=!!(t!=null&&t.market),p=(t==null?void 0:t.marketPriceCredits)??null,y=ve(i=>i.add),u=ve(i=>i.items),l=je(i=>i.toggle),{session:v}=le(),[a,j]=m.useState(()=>t!=null&&t.item?{...t.item,tradeId:t.tradeId??t.item.tradeId}:{id:`${r}-${c}`,name:"",creator:"",contractAddress:r??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:Ae.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:c??void 0,tradeId:t==null?void 0:t.tradeId}),[S,f]=m.useState(!1),[L,w]=m.useState(!!(t!=null&&t.resumeBuy));m.useEffect(()=>{t!=null&&t.resumeBuy&&f(!0)},[t==null?void 0:t.resumeBuy]);const{data:N=[],isFetched:g}=O({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>xa(a.contractAddress,{first:20}).then(i=>i.items)}),z=a.available==null&&!a.tokenId,{data:C,isLoading:U}=O({queryKey:["shop-item",a.contractAddress,c],enabled:!d&&!!a.contractAddress&&!!c&&(!(t!=null&&t.item)||z),queryFn:()=>ya(a.contractAddress,c)});m.useEffect(()=>{C&&j(i=>i.tradeId?i.available!=null&&i.wearableCategory?i:{...i,available:i.available??C.available,wearableCategory:i.wearableCategory??C.wearableCategory}:{...C})},[C]);const[Q,G]=m.useState(!1),{data:B=""}=O({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>va(a.contractAddress,a.itemId)}),{data:k}=O({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>ja(a.contractAddress)});m.useEffect(()=>{if(a.name||C||N.length===0)return;const i=c&&N.find(M=>M.tokenId===c||M.itemId===c)||N.find(M=>M.contractAddress===a.contractAddress);i&&j(M=>({...i,tradeId:M.tradeId??i.tradeId}))},[N,C]);const H=m.useMemo(()=>{const i=new Set,M=[];for(const F of N){if(F.id===a.id||a.itemId&&F.itemId===a.itemId||a.tokenId&&F.tokenId===a.tokenId)continue;const be=`${F.contractAddress}-${F.itemId??F.tokenId??F.id}`;i.has(be)||(i.add(be),M.push(F))}return M},[N,a.id,a.itemId,a.tokenId]),{data:n,isLoading:x}=O({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const i=await fa(a.contractAddress,a.itemId);return(i==null?void 0:i.id)??null}return null}}),_=a.tradeId??n??void 0,h=!!_,{data:b}=Ea(d),I=m.useMemo(()=>{if(!d||!(t!=null&&t.item))return null;const i=t.item;return i.manaWei?{tradeId:i.tradeId??i.id,listingType:"primary",contractAddress:i.contractAddress,itemId:i.itemId??"",name:i.name,thumbnail:i.thumbnail,rarity:i.rarity,category:i.category,wearableCategory:i.wearableCategory??null,creator:i.creator,manaWei:i.manaWei,available:1,network:i.network,chainId:i.chainId,createdAt:0}:null},[d,t==null?void 0:t.item]),R=d&&p!=null&&!!b&&!!I,P=ra({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),D=m.useMemo(()=>({...a,tradeId:_,id:_??a.id}),[a,_]),$=u.some(i=>i.id===D.id),T=!D.tokenId,Y=((pe=u.find(i=>i.id===D.id))==null?void 0:pe.quantity)??0,ae=T&&typeof a.available=="number"&&Y>=a.available,E=je(i=>!!i.items[a.id]),ne=m.useRef(null);m.useEffect(()=>{!a.name||x||ne.current===a.id||(ne.current=a.id,K("Shop Viewed Item",{...la(a),for_sale:h}),da(a))},[a.id,a.name,x,h]);const J=`${r}/${c}`,ce=m.useRef(J);m.useEffect(()=>{ce.current!==J&&(ce.current=J,t!=null&&t.item&&j({...t.item,tradeId:t.tradeId??t.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[J]);function Pe(){!h||Z||x||!T&&$||ae||y(D,"item_detail")}const se=za(a.rarity)?a.rarity:W.Rarity.COMMON,oe=Oa(a.gender),me=na(a),ue=ca(a.gender),Ee=h&&P,Fe=s("itemDetail.moreFromCollection"),Z=oa(a,v==null?void 0:v.address),_e=h?x?s("itemDetail.checking"):ae?s("itemDetail.maxInCart"):!T&&$?s("assetCard.inCart"):s("assetCard.addToCart"):s("itemDetail.notForSale"),Le=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!d,De=!Z&&h&&!d,Te=d||!Z,Be=U||!!a.contractAddress&&!g,he=!a.name&&!Be,Re=/^https?:\/\//i.test(a.thumbnail);return ma(he?{title:s("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:B||s("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ie(a),creator:La(a.creator)}),image:Re?a.thumbnail:void 0,type:"product"}:{}),he?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(q,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:s("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:s("itemDetail.notAvailableBody")}),e.jsx(Wa,{variant:"purple",onClick:()=>o("/assets"),children:s("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":s("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>o("/assets"),children:s("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||s("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx($a,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${E?" is-on":""}`,onClick:()=>l(a),"aria-pressed":E,"aria-label":E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(q,{name:E?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${E?" is-on":""}`,onClick:()=>l(a),"aria-pressed":E,"aria-label":E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(q,{name:E?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:ha(se),color:_a(se)},title:ua(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[me?e.jsx(q,{name:me,size:18,color:"var(--text-2)"}):null,Ie(a)]}),oe?e.jsxs("span",{className:"chip item-detail__chip",children:[ue?e.jsx(q,{name:ue,size:18,color:"var(--text-2)"}):null,oe]}):null]}),B?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${Q?" is-expanded":""}`,children:B}),B.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>G(i=>!i),children:Q?s("itemDetail.showLess"):s("itemDetail.readMore")}):null]}):null,a.creator||k!=null&&k.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.creator")}),e.jsx(pa,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,k!=null&&k.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.collection")}),e.jsx(Va,{contractAddress:a.contractAddress,name:k.name,items:N,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.price")}),d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:p==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(A,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:p})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:s("assetCard.marketPrice")})]}):h?Ee?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(A,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(A,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),fe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:s("assetCard.saleWithDiscount",{pct:fe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(ba,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(A,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:s("itemDetail.notForSale")})]}),Le?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",W.Rarity.getMaxSupply(se).toLocaleString()]})]}):null]})}),e.jsx("div",{className:`item-detail__ctas${Te?" item-detail__ctas--buttons":""}${De?" item-detail__ctas--dual":""}`,children:d?e.jsxs(ke,{variant:"purple",onClick:()=>f(!0),disabled:!R,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),p!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(A,{className:"item-detail__cta-diamond"}),p]}):null]}):Z?e.jsxs("p",{className:"item-detail__own-note muted",children:[s("itemDetail.ownItemPrefix")," ",e.jsx(Ve,{to:"/my-assets",children:s("nav.myAssets")}),s("itemDetail.ownItemSuffix")]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(ke,{variant:"purple",onClick:()=>f(!0),disabled:x,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(A,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Pe,disabled:!h||x||(T?ae:$),"aria-label":_e,children:[e.jsx(q,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:_e})]})]})})]}):e.jsx(Ka,{})})]}),e.jsx(Da,{title:Fe,items:H,onViewAll:a.contractAddress?()=>o(`/collection/${a.contractAddress}`):void 0}),S&&d&&I&&b?e.jsx(Fa,{listing:I,rate:b,onClose:()=>f(!1),onSold:()=>f(!1)}):S&&!d?e.jsx(Ta,{item:D,resume:L,onClose:()=>{f(!1),w(!1)}}):null]})}function Ka(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{ms as ItemDetail,ms as default};
@@ -1,7 +0,0 @@
1
- import{a as G,r as m,j as e,L as us}from"./react-yytiy0wi.js";import{j as z,F as hs,u as H,t as a,C as O,B as f,k as L,p as ts,b as P,a7 as X,D as J,x as rs,a as ps,d as ys,g as D,at as gs,s as ns,i as bs,au as xs}from"./index-d4x-ttpO.js";import{f as js}from"./import-C7kEB_S5.js";import{d as is}from"./dcl-schemas-BICTSpB5.js";import{c as _s}from"./buy-BPkraJ17.js";import{a as fs,b as Ns,i as vs,e as Is,c as As}from"./trade-encoding-cvcruSuW.js";import{f as ls}from"./errors-qUwGIanA.js";import{E}from"./ErrorNotice-CKeOu_Oi.js";import{s as ks}from"./wallet-kind-B9P1TeIH.js";import{L as Ss}from"./LoadMore-CwKrPv19.js";import{u as Cs}from"./useInfiniteGrid-ClIfwXAY.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./mana-rate-BWFOkvpC.js";import"./index-HN6Rk25C.js";const K=()=>`${z.builderServerUrl}/v1`;function cs(s){return Array.isArray(s)?s:"results"in s&&Array.isArray(s.results)?s.results:"data"in s&&Array.isArray(s.data)?s.data:[]}async function os(s,i){const n=await hs(s,{method:"GET",identity:i,metadata:{}});if(!n.ok)throw new Error(`builder-server ${n.status}: ${await n.text()}`);const o=await n.json();return o.data??o}function ws(s,i){const n=i-s;return n>0?n:0}function Ls(s){var i,n,o,l,c;return((n=(i=s.data)==null?void 0:i.wearable)==null?void 0:n.category)??((l=(o=s.data)==null?void 0:o.emote)==null?void 0:l.category)??((c=s.data)==null?void 0:c.category)??s.type??"wearable"}function ss(s){return`${K()}/storage/contents/${s}`}function $(s,i){if(!s)return"";if(/^https?:\/\//.test(s))return s;const n=i==null?void 0:i[s];return n?ss(n):/^(ba|Qm)/.test(s)?ss(s):""}async function Ms(s,i){try{const n=await fetch(`${K()}/items/${s}/${i}/contents`);if(!n.ok)return{};const o=await n.json();return o.data??o}catch{return{}}}async function Ps(s,i,n){const o=$(s.thumbnail,s.contents)||$("thumbnail.png",s.contents);if(o)return o;if(i&&n){const l=await Ms(i,n);return $(s.thumbnail,l)||$("thumbnail.png",l)||$("image.png",l)}return""}async function $s(s,i){const n=`${K()}/${s.toLowerCase()}/collections?is_published=true`,o=await os(n,i);return cs(o).filter(l=>l.is_published&&!!l.contract_address).map(l=>({id:l.id,name:l.name,contractAddress:l.contract_address.toLowerCase(),isPublished:l.is_published,isApproved:l.is_approved,minters:(l.minters??[]).map(c=>c.toLowerCase())}))}async function Es(s,i){const n=`${K()}/collections/${s.id}/items`,o=await os(n,i);return(await Promise.all(cs(o).map(async c=>{const I=c.rarity??"common",N=Number(c.total_supply??0)||0;let u;try{u=is.Rarity.getMaxSupply(I)}catch{u=0}const A=(c.contract_address??s.contractAddress).toLowerCase(),y=c.blockchain_item_id??"";return{id:c.id,collectionId:s.id,collectionName:s.name,contractAddress:A,blockchainItemId:y,name:c.name,category:Ls(c),rarity:I,thumbnail:await Ps(c,A,y),type:c.type??"wearable",isPublished:c.is_published??s.isPublished,isApproved:c.is_approved??s.isApproved,totalSupply:N,maxSupply:u,remainingSupply:ws(N,u),minters:s.minters}}))).filter(Ts)}function Ts(s){return s.isPublished&&s.isApproved&&s.blockchainItemId!==""&&s.blockchainItemId!=null&&s.remainingSupply>0}async function Fs(s,i){const n=await $s(s,i);return(await Promise.all(n.map(async l=>{try{return await Es(l,i)}catch{return[]}}))).flat()}const qs=1e3*60*60*24*182;function Os({asset:s,session:i,onClose:n}){const o=H(),l=G(),[c,I]=m.useState("10"),[N,u]=m.useState(null),[A,y]=m.useState(null),[g,C]=m.useState(!1),[_,k]=m.useState(null);async function w(){y(null);const d=Number(c);if(!Number.isInteger(d)||d<=0){y(a("sellModal.errorWholeNumber"));return}C(!0);try{u(a("sellModal.statusPreparing")),await fs({signer:i.signer,contractAddress:s.contractAddress,chainId:s.chainId}),u(a("sellModal.statusListing"));const v=await Ns({signer:i.signer,nft:{contractAddress:s.contractAddress,tokenId:s.tokenId,network:s.network,chainId:s.chainId},usdPrice:d/10,expiresAtMs:Date.now()+qs});u(a("sellModal.statusPublishing")),await ts(v,i.identity),u(null),k(d),P("Shop Listed Item",{item_id:s.itemId??s.tokenId??null,contract_address:s.contractAddress,price_credits:d,price_usd:d/10,listing_type:"secondary",is_primary:!1}),X.success(a("sellModal.toastOnSale",{name:s.name})),o.invalidateQueries({queryKey:["my-assets",i.address]})}catch(v){J(v,{flow:"list_secondary"}),P("Shop Listing Failed",{listing_type:"secondary",error_code:rs(v)}),y(ls(v,a("sellModal.errorGeneric"))),u(null)}finally{C(!1)}}function j(){n(),l(`/item/${s.contractAddress}/${s.tokenId}`)}return _!==null?e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal modal--success",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:a("sellModal.successTitle")}),s.image?e.jsx("img",{className:"modal__img",src:s.image,alt:s.name}):null,e.jsx("p",{className:"modal-success__name",children:s.name}),e.jsxs("p",{className:"muted small",children:[a("sellModal.listedFor")," ",e.jsxs("strong",{children:[e.jsx(O,{className:"ccy-mark"})," ",_]})]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(f,{variant:"ghost",onClick:n,children:a("getCredits.done")}),e.jsx(f,{variant:"purple",onClick:j,children:a("sellModal.viewInShop")})]})]})}):e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal","data-testid":"modal",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("h2",{className:"modal__title",children:a("sellModal.listTitle",{name:s.name})}),s.image?e.jsx("img",{className:"modal__img",src:s.image,alt:s.name}):null,e.jsxs("label",{className:"field",children:[e.jsx("span",{children:a("sellModal.priceLabel",{currency:L.name})}),e.jsx("input",{type:"number",min:"1",step:"1",value:c,onChange:d=>I(d.target.value),disabled:g})]}),e.jsx("p",{className:"muted small",children:a("sellModal.pricedInWhole",{currency:L.name,currencySingular:L.nameSingular})}),N?e.jsx("p",{className:"muted",children:N}):null,e.jsx(E,{message:A}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(f,{variant:"ghost",onClick:n,disabled:g,children:a("sellModal.cancel")}),e.jsx(f,{onClick:()=>void w(),disabled:g,children:g?a("sellModal.listing"):a("sellModal.putOnSale")})]})]})})}const Ks=1e3*60*60*24*182;function Qs({item:s,session:i,onClose:n}){const o=H(),l=G(),[c,I]=m.useState("10"),[N,u]=m.useState(null),[A,y]=m.useState(null),[g,C]=m.useState(!1),[_,k]=m.useState(null),[w,j]=m.useState(null),d=z.chainId,v=ks(i.providerType);m.useEffect(()=>{let h=!1;return(async()=>{try{const b=await vs({contractAddress:s.contractAddress,chainId:d});h||k(b)}catch{h||k(!1)}})(),()=>{h=!0}},[s.contractAddress,d]);async function Q(){y(null);const h=Number(c);if(!Number.isInteger(h)||h<=0){y(a("primaryList.errorWholeNumber"));return}C(!0);try{_||(u(a("primaryList.statusEnabling")),await Is({signer:i.signer,contractAddress:s.contractAddress,chainId:d}),k(!0)),u(a("primaryList.statusPublishing"));const b=await As({signer:i.signer,item:{contractAddress:s.contractAddress,itemId:s.blockchainItemId,network:is.Network.MATIC,chainId:d},usdPrice:h/10,uses:s.remainingSupply,expiresAtMs:Date.now()+Ks});u(a("primaryList.statusFinishing")),await ts(b,i.identity),u(null),j(h),P("Shop Listed Item",{item_id:s.blockchainItemId,contract_address:s.contractAddress,price_credits:h,price_usd:h/10,listing_type:"primary",is_primary:!0}),X.success(a("primaryList.toastOnSale",{name:s.name})),o.invalidateQueries({queryKey:["publishable-items"]}),o.invalidateQueries({queryKey:["collection-sale-state"]})}catch(b){J(b,{flow:"list_primary"}),P("Shop Listing Failed",{listing_type:"primary",error_code:rs(b)}),y(ls(b,a("primaryList.errorGeneric"))),u(null)}finally{C(!1)}}function B(){n(),l(`/item/${s.contractAddress}/${s.blockchainItemId}`)}const T=g?a("primaryList.listing"):_===!1?a("primaryList.enableAndPutOnSale"):a("primaryList.putOnSale");return w!==null?e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal modal--success",onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:a("primaryList.successTitle")}),s.thumbnail?e.jsx("img",{className:"modal__img",src:s.thumbnail,alt:s.name}):null,e.jsx("p",{className:"modal-success__name",children:s.name}),e.jsxs("p",{className:"muted small",children:[a("primaryList.listedFor")," ",e.jsxs("strong",{children:[e.jsx(O,{className:"ccy-mark"})," ",w]})," ",a("primaryList.dotAvailable",{count:s.remainingSupply})]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(f,{variant:"ghost",onClick:n,children:a("getCredits.done")}),e.jsx(f,{variant:"purple",onClick:B,children:a("primaryList.viewInShop")})]})]})}):e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal","data-testid":"modal",onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("h2",{className:"modal__title",children:a("primaryList.publishTitle",{name:s.name})}),s.thumbnail?e.jsx("img",{className:"modal__img",src:s.thumbnail,alt:s.name}):null,e.jsx("p",{className:"muted small",children:a("primaryList.fromCollection",{collectionName:s.collectionName,count:s.remainingSupply})}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:a("primaryList.priceLabel",{currency:L.name})}),e.jsx("input",{type:"number",min:"1",step:"1",value:c,onChange:h=>I(h.target.value),disabled:g})]}),e.jsx("p",{className:"muted small",children:a("primaryList.pricedInWhole",{currency:L.name,currencySingular:L.nameSingular})}),_===!1&&!g?v?e.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeConfirm",{collectionName:s.collectionName})}):e.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeManaged",{collectionName:s.collectionName})}):_===!0&&!g?v?e.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyConfirm")}):e.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyManaged")}):null,N?e.jsx("p",{className:"muted",children:N}):null,e.jsx(E,{message:A}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(f,{variant:"ghost",onClick:n,disabled:g,children:a("primaryList.cancel")}),e.jsx(f,{onClick:()=>void Q(),disabled:g||_===null,children:_===null?a("primaryList.checking"):T})]})]})})}const Bs=ns(f)`
2
- margin-top: 8px;
3
- width: 100%;
4
- `,es=ns(f)`
5
- margin-top: auto;
6
- width: 100%;
7
- `,Rs=48;function Us(s){return{id:s.id,name:s.name,creator:"",contractAddress:s.contractAddress,itemId:s.itemId,category:s.category,rarity:s.rarity??"common",network:s.network,chainId:s.chainId,thumbnail:s.image,priceCredits:s.listingPrice??0,gender:null,isSmart:!1,tokenId:s.tokenId}}function as(s){return{id:`${s.contractAddress}-${s.blockchainItemId}`,name:s.name,creator:"",contractAddress:s.contractAddress,itemId:s.blockchainItemId,category:s.category,rarity:s.rarity,network:"MATIC",chainId:z.chainId,thumbnail:s.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function ie(){ps({title:a("nav.myAssets"),noindex:!0});const{session:s,error:i,signIn:n,restore:o}=ys(),l=G(),c=H(),[I,N]=m.useState(null),[u,A]=m.useState(null),[y,g]=m.useState(null),[C,_]=m.useState(null);function k(t){const r=t.tokenId??t.itemId??"";!t.contractAddress||!r||l(`/item/${t.contractAddress}/${r}`,{state:{item:t}})}async function w(t,r,p){if(s){_(null),g(p);try{const x=await bs(t);await _s({trade:x,signer:s.signer}),X.success(a("myAssets.removedFromSale",{name:r})),await c.invalidateQueries({queryKey:["my-assets",s.address]}),await c.invalidateQueries({queryKey:["collection-sale-state"]})}catch(x){const F=x,q=(F.message??"").toLowerCase(),Z=F.code===4001||q.includes("reject")||q.includes("denied");Z||J(x,{flow:"remove-listing",tradeId:t}),_(Z?a("getCredits.errorCanceled"):a("myAssets.removeListingError"))}finally{g(null)}}}m.useEffect(()=>{o()},[o]);const j=s==null?void 0:s.address,{items:d,isLoading:v,error:Q,hasNextPage:B,isFetchingNextPage:T,fetchNextPage:h}=Cs(["my-assets",j],t=>gs(j,{first:Rs,skip:t}).then(r=>({items:r.assets,total:r.total})),{enabled:!!j}),{data:b}=D({queryKey:["importable",j],queryFn:()=>js(j),enabled:!!j}),V=((b==null?void 0:b.creations.length)??0)+((b==null?void 0:b.owned.length)??0),{data:M,isLoading:ds,isError:ms}=D({queryKey:["publishable-items",j],queryFn:()=>Fs(j,s.identity),enabled:!!s,retry:!1}),R=m.useMemo(()=>[...new Set((M??[]).map(t=>t.contractAddress))],[M]),{data:S}=D({queryKey:["collection-sale-state",j,R],enabled:R.length>0,queryFn:async()=>{const t=await Promise.all(R.map(async p=>[p,await xs(p)])),r={};for(const[p,x]of t)for(const[F,q]of Object.entries(x))r[`${p}-${F}`]=q;return r}}),U=t=>S==null?void 0:S[`${t.contractAddress}-${t.blockchainItemId}`],W=m.useMemo(()=>(M??[]).filter(t=>{var r;return(r=U(t))==null?void 0:r.isOnSale}),[M,S]),Y=m.useMemo(()=>{var r;const t=new Map;for(const p of M??[]){if((r=S==null?void 0:S[`${p.contractAddress}-${p.blockchainItemId}`])!=null&&r.isOnSale)continue;const x=t.get(p.collectionId)??{id:p.collectionId,name:p.collectionName,items:[]};x.items.push(p),t.set(p.collectionId,x)}return[...t.values()]},[M,S]);return s?e.jsxs("section",{className:"myassets",children:[e.jsx("h1",{children:a("nav.myAssets")}),V>0?e.jsxs(us,{className:"import-banner",to:"/import",children:[e.jsx("span",{className:"import-banner__ico","aria-hidden":!0,children:"📦"}),e.jsxs("span",{className:"import-banner__text",children:[e.jsx("strong",{children:a("myAssets.importTitle")}),e.jsx("span",{className:"import-banner__sub",children:a("myAssets.importSub",{count:V})})]}),e.jsx("span",{className:"import-banner__cta",children:a("myAssets.import")})]}):null,e.jsxs("div",{className:"myassets__section",children:[e.jsxs("div",{className:"myassets__section-head",children:[e.jsx("h2",{className:"myassets__section-title",children:a("myAssets.ownedTitle")}),e.jsx("p",{className:"myassets__section-sub",children:a("myAssets.ownedSub")})]}),Q?e.jsx(E,{message:a("myAssets.ownedError")}):null,e.jsx(E,{message:C}),e.jsxs("div",{className:"asset-grid",children:[v?Array.from({length:8}).map((t,r)=>e.jsx("div",{className:"asset-card asset-card--skeleton"},`sk-${r}`)):d.map(t=>e.jsxs("article",{className:"asset-card asset-card--link",children:[e.jsx("button",{className:"card-link-overlay","aria-label":a("myAssets.viewItem",{name:t.name}),onClick:()=>k(Us(t))}),e.jsx("div",{className:"asset-card__img",children:t.image?e.jsx("img",{src:t.image,alt:t.name}):null}),e.jsx("div",{className:"asset-card__name",title:t.name,children:t.name}),t.isOnSale?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"asset-card__listed",children:[e.jsxs("span",{className:"asset-card__price",children:[e.jsx(O,{className:"ccy-mark"})," ",t.listingPrice]}),e.jsx("span",{className:"badge",children:a("myAssets.onSale")})]}),e.jsx(Bs,{size:"sm",variant:"ghost",disabled:y===t.id||!t.tradeId,onClick:r=>{r.stopPropagation(),t.tradeId&&w(t.tradeId,t.name,t.id)},children:y===t.id?a("myAssets.removing"):a("myAssets.removeListing")})]}):e.jsx(f,{size:"sm",onClick:r=>{r.stopPropagation(),P("Shop Started Listing",{listing_type:"secondary",item_id:t.itemId??t.tokenId??null}),N(t)},children:a("myAssets.putOnSale")})]},t.id)),T?Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"asset-card asset-card--skeleton"},`msk-${r}`)):null]}),e.jsx(Ss,{hasNextPage:B,isFetching:T,onLoadMore:()=>void h()}),!v&&d.length===0?e.jsx("p",{className:"muted",children:a("myAssets.ownedEmpty")}):null]}),e.jsxs("div",{className:"myassets__section",children:[e.jsxs("div",{className:"myassets__section-head",children:[e.jsx("h2",{className:"myassets__section-title",children:a("myAssets.creationsTitle")}),e.jsx("p",{className:"myassets__section-sub",children:a("myAssets.creationsSub",{currency:L.name})})]}),ds?e.jsx("div",{className:"publish-grid",children:Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"asset-card asset-card--skeleton"},`pub-sk-${r}`))}):ms?e.jsx("p",{className:"publish-empty",children:a("myAssets.collectionsError")}):W.length===0&&Y.length===0?e.jsx("p",{className:"publish-empty",children:a("myAssets.nothingToPublish")}):e.jsxs(e.Fragment,{children:[W.length>0?e.jsxs("div",{className:"creations-collection",children:[e.jsx("h3",{className:"creations-collection__name",children:a("myAssets.onSale")}),e.jsx("div",{className:"publish-grid",children:W.map(t=>{var r;return e.jsxs("article",{className:"publish-card publish-card--link",children:[e.jsx("button",{className:"card-link-overlay","aria-label":a("myAssets.viewItem",{name:t.name}),onClick:()=>k(as(t))}),e.jsx("div",{className:"publish-card__img",children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}),e.jsx("div",{className:"publish-card__name",title:t.name,children:t.name}),e.jsxs("div",{className:"publish-card__listed",children:[e.jsxs("span",{className:"publish-card__price",children:[e.jsx(O,{className:"ccy-mark"})," ",((r=U(t))==null?void 0:r.priceCredits)??0]}),e.jsx("span",{className:"badge",children:a("myAssets.onSale")})]}),e.jsx(es,{size:"sm",variant:"ghost",disabled:y===t.id,onClick:p=>{p.stopPropagation();const x=U(t);x!=null&&x.tradeId&&w(x.tradeId,t.name,t.id)},children:y===t.id?a("myAssets.removing"):a("myAssets.removeListing")})]},`${t.contractAddress}-${t.blockchainItemId}`)})})]}):null,Y.map(t=>e.jsxs("div",{className:"creations-collection",children:[e.jsx("h3",{className:"creations-collection__name",children:t.name}),e.jsx("div",{className:"publish-grid",children:t.items.map(r=>e.jsxs("article",{className:"publish-card publish-card--link",children:[e.jsx("button",{className:"card-link-overlay","aria-label":a("myAssets.viewItem",{name:r.name}),onClick:()=>k(as(r))}),e.jsx("div",{className:"publish-card__img",children:r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:r.name}):null}),e.jsx("div",{className:"publish-card__name",title:r.name,children:r.name}),e.jsxs("div",{className:"publish-card__meta",children:[e.jsx("span",{className:"publish-chip publish-chip--rarity",children:r.rarity}),e.jsx("span",{className:"publish-card__supply",children:a("myAssets.available",{count:r.remainingSupply})})]}),e.jsx(es,{size:"sm",variant:"purple",onClick:p=>{p.stopPropagation(),P("Shop Started Listing",{listing_type:"primary",item_id:r.blockchainItemId}),A(r)},children:a("myAssets.putOnSale")})]},`${r.contractAddress}-${r.blockchainItemId}`))})]},t.id))]})]}),I?e.jsx(Os,{asset:I,session:s,onClose:()=>N(null)}):null,u?e.jsx(Qs,{item:u,session:s,onClose:()=>A(null)}):null]}):e.jsxs("section",{className:"myassets",children:[e.jsx("h1",{children:a("nav.myAssets")}),e.jsx("p",{className:"muted",children:a("myAssets.signInPrompt")}),e.jsx("div",{className:"connect-row",children:e.jsx(f,{variant:"purple",onClick:()=>n(),children:a("storeSettings.signIn")})}),e.jsx(E,{message:i})]})}export{ie as MyAssets};
@@ -1 +0,0 @@
1
- import{M as z,U as I,V as j,W as q,X as A,Y as D,Z as G,$ as R,a0 as U}from"./index-d4x-ttpO.js";import{r as c}from"./react-yytiy0wi.js";var V=I,W=function(e){return e!=="theme"},E=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?V:W},O=function(e,t,s){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(d){return e.__emotion_forwardProp(d)&&i(d)}:i}return typeof r!="function"&&s&&(r=e.__emotion_forwardProp),r},M=function(e){var t=e.cache,s=e.serialized,r=e.isStringTag;return G(t,s,r),R(function(){return U(t,s,r)}),null},X=function o(e,t){var s=e.__emotion_real===e,r=s&&e.__emotion_base||e,i,d;t!==void 0&&(i=t.label,d=t.target);var b=O(e,t,s),w=b||E(r),_=!w("as");return function(){var m=arguments,l=s&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(i!==void 0&&l.push("label:"+i+";"),m[0]==null||m[0].raw===void 0)l.push.apply(l,m);else{var S=m[0];l.push(S[0]);for(var x=m.length,p=1;p<x;p++)l.push(m[p],S[p])}var n=j(function(a,u,v){var P=_&&a.as||r,f="",F=[],h=a;if(a.theme==null){h={};for(var C in a)h[C]=a[C];h.theme=c.useContext(q)}typeof a.className=="string"?f=A(u.registered,F,a.className):a.className!=null&&(f=a.className+" ");var N=D(l.concat(F),u.registered,h);f+=u.key+"-"+N.name,d!==void 0&&(f+=" "+d);var k=_&&b===void 0?E(P):w,g={};for(var y in a)_&&y==="as"||k(y)&&(g[y]=a[y]);return g.className=f,v&&(g.ref=v),c.createElement(c.Fragment,null,c.createElement(M,{cache:u,serialized:N,isStringTag:typeof P=="string"}),c.createElement(P,g))});return n.displayName=i!==void 0?i:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",n.defaultProps=e.defaultProps,n.__emotion_real=n,n.__emotion_base=r,n.__emotion_styles=l,n.__emotion_forwardProp=b,Object.defineProperty(n,"toString",{value:function(){return"."+d}}),n.withComponent=function(a,u){var v=o(a,z({},t,u,{shouldForwardProp:O(n,u,!0)}));return v.apply(void 0,l)},n}},Y=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],T=X.bind(null);Y.forEach(function(o){T[o]=T(o)});export{T as n};
@@ -1 +0,0 @@
1
- import{F as f,j as c,G as h}from"./index-d4x-ttpO.js";function w(){return c.creditsServerUrl}async function E(t,e){const r=await f(`${w()}/credits/checkout`,{method:"POST",identity:e,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:n,url:s}=await r.json();return{orderId:n,url:s,mock:!1}}async function y(t,e,r={}){const{intervalMs:n=1500,timeoutMs:s=6e4,signal:o}=r,d=Date.now()+s;for(;;){if(o!=null&&o.aborted)throw new DOMException("Aborted","AbortError");const u=await p(t,e,o);if(u.status!=="processing")return u;if(Date.now()>d)return{status:"pending"};await _(n,o)}}async function p(t,e,r){const n=await f(`${w()}/credits/orders/${t}`,{method:"GET",identity:e,metadata:{},signal:r});if(!n.ok)throw new Error(`order status ${n.status}`);return n.json()}function _(t,e){return new Promise((r,n)=>{const s=setTimeout(r,t);e==null||e.addEventListener("abort",()=>{clearTimeout(s),n(new DOMException("Aborted","AbortError"))})})}const C=.1,P=[{id:"pack_5",usd:5,credits:i(5)},{id:"pack_10",usd:10,credits:i(10)},{id:"pack_25",usd:25,credits:i(25),bestValue:!0},{id:"pack_50",usd:50,credits:i(50)}];function i(t){return Math.round(t/C)}function l(t){return P.find(e=>e.id===t)}const a="mock_cs_",S=new Set([80002,11155111,1337,31337]);function k(){const t=!c.stripePublishableKey;if(t&&!S.has(c.chainId))throw new Error(`Stripe publishable key is missing on chainId=${c.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 g(t,e){const r=l(t);if(!r)throw new Error("Unknown pack");if(k())return $(r);if(!(e!=null&&e.identity))throw new Error("Sign in to get credits.");return E(t,e.identity)}async function I(t,e={}){const{intervalMs:r,timeoutMs:n,signal:s,identity:o}=e;if(k()||t.startsWith(a))return b(t,e);if(!o)throw new Error("Sign in to get credits.");return y(t,o,{intervalMs:r,timeoutMs:n,signal:s})}function $(t){const e=`${a}${t.id}_${Date.now()}`;return m(400).then(()=>({orderId:e,clientSecret:`${a}${t.id}`,mock:!0}))}async function b(t,e={}){await m(e.intervalMs??900);const r=t.replace(a,"").replace(/_\d+$/,""),n=l(r),s=(n==null?void 0:n.credits)??0;if(e.address&&n)try{const o=await h(e.address,Math.round(n.usd*100));return{status:"credited",creditsGranted:s,newBalance:o.credits}}catch(o){return{status:"failed",error:o.message}}return{status:"credited",creditsGranted:s,newBalance:s}}function m(t,e){return new Promise((r,n)=>{setTimeout(r,t)})}export{P as C,g as c,k as i,I as p};
@@ -1 +0,0 @@
1
- import"./react-yytiy0wi.js";import{T as m,n as t}from"./index-d4x-ttpO.js";import{u as o}from"./useTheme-HWLX9NSW.js";function a(){const e=o(t);return e[m]||e}export{a as u};
@@ -1 +0,0 @@
1
- import{r as n}from"./react-yytiy0wi.js";import{W as r,a1 as s}from"./index-d4x-ttpO.js";function o(e){return Object.keys(e).length===0}function m(e=null){const t=n.useContext(r);return!t||o(t)?e:t}const u=s();function h(e=u){return m(e)}export{m as a,h as u};