@dcl/shop 0.1.0-30546268577.commit-51c9020 → 0.1.0-30565861644.commit-86fa62d

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 (173) hide show
  1. package/assets/{Activity-CjSEeiSV.js → Activity-YIu0M1Kf.js} +4 -4
  2. package/assets/{AnimatedBackground-BTiUO6oZ.js → AnimatedBackground-BrxVl8X0.js} +1 -1
  3. package/assets/{Assets-BakwJdNE.js → Assets-Dwlho6_C.js} +2 -2
  4. package/assets/{Assets.styles-DPfy47Yz.js → Assets.styles-CfTWTkg9.js} +1 -1
  5. package/assets/{Authorizations-_yZR7wlJ.js → Authorizations-BMPo5lsC.js} +1 -1
  6. package/assets/{Cart-NESueVBd.js → Cart-DS3i-ZcL.js} +62 -62
  7. package/assets/{CircularProgress-B838AFJT.js → CircularProgress-BrgD7rFE.js} +1 -1
  8. package/assets/{Collection-BPHP1zi6.js → Collection-wJlJYfNj.js} +1 -1
  9. package/assets/{CollectionCarousel-CipJZ4Jp.js → CollectionCarousel-Bns794gp.js} +1 -1
  10. package/assets/{Creator-iyC-uTI8.js → Creator-Bz4Ol9VJ.js} +2 -2
  11. package/assets/{ErrorNotice-BDPNfqx0.js → ErrorNotice-Z0D8os9s.js} +1 -1
  12. package/assets/{ExchangeController-CVMU9e-y.js → ExchangeController-DWJqUlaQ.js} +1 -1
  13. package/assets/{GetCredits-CCPnCpLE.js → GetCredits-DaqSIDEt.js} +7 -7
  14. package/assets/{HelpersUtil-CLRWW-JG.js → HelpersUtil-BmEt66tk.js} +1 -1
  15. package/assets/{ImportListings-kvaDCP0o.js → ImportListings-tR_OXub1.js} +6 -6
  16. package/assets/{ItemDetail-Bli253Mg.js → ItemDetail-n9hpow28.js} +197 -197
  17. package/assets/{LoadMore-Bg1WdJa_.js → LoadMore-DI4Wyn-C.js} +1 -1
  18. package/assets/{MenuList-DyNPpfN8.js → MenuList-CYC3zRYf.js} +1 -1
  19. package/assets/{MyAssets-BQi5bsrn.js → MyAssets-CRBhFPGQ.js} +1 -1
  20. package/assets/{MyFavorites-jnBBqCpp.js → MyFavorites-B6grtRZj.js} +44 -17
  21. package/assets/{NotFound-BXC5nxMj.js → NotFound-0L1xj8db.js} +1 -1
  22. package/assets/{NotificationsBell-HKxgY3NU.js → NotificationsBell-B5Q9EIqa.js} +1 -1
  23. package/assets/{StoreSettings-DF4mEasf.js → StoreSettings-CUyzwheq.js} +1 -1
  24. package/assets/{Success-B-8PxhyV.js → Success-DXPvtMrB.js} +1 -1
  25. package/assets/{SwapController-DdH70j30.js → SwapController-CP6wYtUi.js} +1 -1
  26. package/assets/{Tooltip-Nt-DyBD0.js → Tooltip-BbHzoPIy.js} +1 -1
  27. package/assets/{TradeService-CL3q5o0U.js → TradeService-CbR5e6j8.js} +1 -1
  28. package/assets/{W3MFrameProviderSingleton-Bum-DrEQ.js → W3MFrameProviderSingleton-CAciSeGb.js} +3 -3
  29. package/assets/{WebCryptoP256-CyVP2wWt.js → WebCryptoP256-BJObUJ75.js} +1 -1
  30. package/assets/{authorizations-CRss4Km2.js → authorizations-B6wWjXdQ.js} +1 -1
  31. package/assets/{basic-DHCLMBzG.js → basic-PrtqXBMx.js} +1 -1
  32. package/assets/{biconomy-D3-_U8ud.js → biconomy-CXoNqd-Z.js} +1 -1
  33. package/assets/{browseLayout.styles-B9TM0sjQ.js → browseLayout.styles-B_NNL83E.js} +8 -8
  34. package/assets/{builder-B_9KaS-W.js → builder-DJzcrQAM.js} +1 -1
  35. package/assets/{buy-CQDvi-Z2.js → buy-D3hY4JG8.js} +1 -1
  36. package/assets/{buy-gasless-D0882Rr8.js → buy-gasless-CmOMFX1L.js} +1 -1
  37. package/assets/{categories-B6c_VHlD.js → categories-CX6i4K78.js} +1 -1
  38. package/assets/{ccip-tmXFoKyG.js → ccip-Dd-dexDO.js} +1 -1
  39. package/assets/{ccip-W9GWssu_.js → ccip-w3FPfxqw.js} +1 -1
  40. package/assets/{clsx-DvvcJE_g.js → clsx-BRGjhjlu.js} +2 -2
  41. package/assets/{controller-DIzv_zYO.js → controller-DwX-jKZc.js} +2 -2
  42. package/assets/{core-D28BQIc2.js → core-D2eU58P9.js} +4 -4
  43. package/assets/{createSvgIcon-CWSm-SRl.js → createSvgIcon-BVcvIe2E.js} +2 -2
  44. package/assets/{custom-DZpHgkVB.js → custom-C8kunAUg.js} +1 -1
  45. package/assets/{data-capture-pK_Tv-hz.js → data-capture-5SXe7x0r.js} +1 -1
  46. package/assets/{email-CtVQSJFe.js → email-Bn0Sv8j4.js} +1 -1
  47. package/assets/{embedded-wallet-ZDQSZ5fJ.js → embedded-wallet-C8c_78Uv.js} +1 -1
  48. package/assets/{emotion-styled.browser.esm-ObtTAShi.js → emotion-styled.browser.esm-3ejjGoWk.js} +1 -1
  49. package/assets/{engine-CZ-Hi_lm.js → engine-CNGw5SdF.js} +1 -1
  50. package/assets/{errors-Bq2Mu6G5.js → errors-BYKPLdNJ.js} +1 -1
  51. package/assets/{estimate-l1-fee-nbXW8n0n.js → estimate-l1-fee-BrG1mArn.js} +1 -1
  52. package/assets/{execute-Dn81thV4.js → execute-BuBESW09.js} +2 -2
  53. package/assets/{features-Cd8utqE-.js → features-DJEePSdY.js} +1 -1
  54. package/assets/{fetchTokenMetadata-C6h4HQcG.js → fetchTokenMetadata-DbJ4fJYd.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-BJFL8Ls9.js → get-ecosystem-wallet-info-BVDQHXZz.js} +1 -1
  56. package/assets/{getBalance--wLYv_Wi.js → getBalance-Dwa97iHq.js} +1 -1
  57. package/assets/{getNFT-DuSw54F-.js → getNFT-8vTqe5mx.js} +1 -1
  58. package/assets/{getNFT-a1Nf-Yxw.js → getNFT-KnOGHpCx.js} +1 -1
  59. package/assets/{getThemeProps-ClN2Fv_K.js → getThemeProps-BkCaIJdf.js} +1 -1
  60. package/assets/{grid.styles-DxJ1n2rK.js → grid.styles-Cflo-ZKg.js} +1 -1
  61. package/assets/{hashTypedData-BtiwfEFc.js → hashTypedData-ByA_PXdL.js} +1 -1
  62. package/assets/{hashTypedData-D_etcs5u.js → hashTypedData-zHAZUnlP.js} +1 -1
  63. package/assets/{import-CYD98Dph.js → import-Da_I6gAZ.js} +1 -1
  64. package/assets/{in-app-3OV_nmgG.js → in-app-DAfU34Xj.js} +1 -1
  65. package/assets/{in-app-wallet-calls-VcctZRek.js → in-app-wallet-calls-C8MSEj6u.js} +1 -1
  66. package/assets/{index-B8KoR7hy.js → index-1YMH7MTk.js} +1 -1
  67. package/assets/{index-DifXdg7h.js → index-Azrqm6Av.js} +1 -1
  68. package/assets/{index-BXrG6gz_.js → index-B6EsaBwe.js} +1 -1
  69. package/assets/{index-C1A_3mRS.js → index-BBHWbqVq.js} +1 -1
  70. package/assets/{index-D7eID9fV.js → index-BCGTwY9C.js} +1 -1
  71. package/assets/{index-o9-JIK9h.js → index-BFQ3WGPq.js} +1 -1
  72. package/assets/{index-CHPRaB-Z.js → index-BKmu2o-E.js} +1 -1
  73. package/assets/{index-9rhkaWrx.js → index-BOei64ey.js} +1 -1
  74. package/assets/{index-B6-ez4HU.js → index-BRBJXQFj.js} +3 -3
  75. package/assets/{index-DrNdDAUt.js → index-BkQsw_6m.js} +1 -1
  76. package/assets/{index-B5xVJZSj.js → index-BnWc8jyR.js} +1 -1
  77. package/assets/index-BnbwrW-6.js +2815 -0
  78. package/assets/{index-D_Cr3ySt.js → index-Bvsc2jDb.js} +1 -1
  79. package/assets/{index-CwxgWYVj.js → index-BzmmiLep.js} +1 -1
  80. package/assets/{index-CQK1zDT_.js → index-CGd-1UpW.js} +1 -1
  81. package/assets/{index-EP1NKxUH.js → index-CRiWMT-r.js} +1 -1
  82. package/assets/{index-Big9wV9m.js → index-CSAUfzci.js} +1 -1
  83. package/assets/{index-BAeAH5ly.js → index-CVY0sxwP.js} +1 -1
  84. package/assets/{index-D5SkK98O.js → index-CfiHgp7t.js} +2 -2
  85. package/assets/{index-C2ozFumj.js → index-CgmlJw-S.js} +1 -1
  86. package/assets/{index-CKfkRfuc.js → index-CkqeusMi.js} +1 -1
  87. package/assets/{index-B9JrHlPn.js → index-CkshIr8A.js} +1 -1
  88. package/assets/{index-Bc6CsYH5.js → index-CkzcSx5U.js} +1 -1
  89. package/assets/{index-D2jvGNN0.js → index-CuYL-Baw.js} +2 -2
  90. package/assets/{index-C5WX4daB.js → index-CvD8tr1x.js} +1 -1
  91. package/assets/{index-BbB-EGIL.js → index-CzKTIGRh.js} +2 -2
  92. package/assets/{index-uVZf2hjB.js → index-D34PBlHH.js} +1 -1
  93. package/assets/{index-D3byoEP7.js → index-DHNHHzGW.js} +1 -1
  94. package/assets/{index-b_M0YiWv.js → index-DJk-Gyy6.js} +1 -1
  95. package/assets/{index-BQr6Gfsp.js → index-DMlJeY00.js} +1 -1
  96. package/assets/{index-pRcoDIl4.js → index-DQwfF15K.js} +1 -1
  97. package/assets/{index-LUHXTqk6.js → index-DTtN3FMo.js} +1 -1
  98. package/assets/{index-Dw57E0gA.js → index-DTvh0ZYF.js} +1 -1
  99. package/assets/{index-B_LIxJKB.js → index-DWsuciPI.js} +1 -1
  100. package/assets/{index-iWo5bwxy.js → index-DX8GIl1w.js} +2 -2
  101. package/assets/{index-Bzfa0XEQ.js → index-Ddw9OYjW.js} +1 -1
  102. package/assets/{index-D2kMWo74.js → index-DeUn3r_V.js} +1 -1
  103. package/assets/{index-ChIdc3F1.js → index-DhHGVFYf.js} +1 -1
  104. package/assets/{index-CVlJa6t_.js → index-DiUDVsbw.js} +3 -3
  105. package/assets/{index-DkEIacBh.js → index-Dl_EomMH.js} +1 -1
  106. package/assets/{index-Fc-0pErb.js → index-Dla9ohqE.js} +2 -2
  107. package/assets/{index-DFxWOBf7.js → index-Dltarl5j.js} +1 -1
  108. package/assets/{index-9ijpZr49.js → index-DmUPrDg1.js} +1 -1
  109. package/assets/{index-BWmQWw6Q.js → index-I6AhOucd.js} +1 -1
  110. package/assets/{index-C_jjojzc.js → index-IEBvb9g0.js} +1 -1
  111. package/assets/{index-CFKKYXej.js → index-Kl09Ztwk.js} +1 -1
  112. package/assets/{index-C4pQJ4un.js → index-MBO4iF-x.js} +1 -1
  113. package/assets/{index-ZpNI2gFx.js → index-MmxQtN7S.js} +1 -1
  114. package/assets/{index-BWzFwNSL.js → index-Q9aqPNo3.js} +1 -1
  115. package/assets/{index-D4TqGnX3.js → index-SG2QR9w5.js} +3 -3
  116. package/assets/{index-qo50HoTd.js → index-vQ_2c6zv.js} +1 -1
  117. package/assets/{index.es-C7AM-hAJ.js → index.es-1Eex98-c.js} +1 -1
  118. package/assets/{index.es-DeL8MDY5.js → index.es-8mJw4ztI.js} +1 -1
  119. package/assets/{index.es-Dm_DN_o8.js → index.es-Dcl8xzFM.js} +4 -4
  120. package/assets/{localBatchGatewayRequest-D_Kxo5IY.js → localBatchGatewayRequest-DLZcpxp5.js} +1 -1
  121. package/assets/{mana-convert-CTsR_3Ej.js → mana-convert-Bc7WVBn5.js} +1 -1
  122. package/assets/{mana-rate-C115gAGh.js → mana-rate-CFfqtCHS.js} +1 -1
  123. package/assets/{networks-_4OAhcxm.js → networks-C9v8SYzv.js} +1 -1
  124. package/assets/{onramp-CSUyuOLB.js → onramp-vHeI0Bdi.js} +1 -1
  125. package/assets/{openzeppelin-CRfl-P-Y.js → openzeppelin-yMR9b1FL.js} +1 -1
  126. package/assets/{parseNft-NH_oxr1p.js → parseNft-DOgBlFyM.js} +2 -2
  127. package/assets/{parseSignature-BKPTd0Wp.js → parseSignature-B_BQDXEi.js} +1 -1
  128. package/assets/{parseSignature-Dv5iREVh.js → parseSignature-CCtT275H.js} +3 -3
  129. package/assets/{passkeys-BOKQqJLG.js → passkeys-DC9ui3MW.js} +1 -1
  130. package/assets/{pay-with-exchange-Dqf9Unk5.js → pay-with-exchange-DzS3VV5h.js} +1 -1
  131. package/assets/{qr-overlay-BBzE6d4w.js → qr-overlay-DBMFsWbT.js} +1 -1
  132. package/assets/{receive-DTcWvXo9.js → receive-DL6eap6Y.js} +1 -1
  133. package/assets/{resolveImplementation-B4run9SA.js → resolveImplementation-CbIwAEHk.js} +1 -1
  134. package/assets/{rpc-BkTOb0Ae.js → rpc-4rFMN8E0.js} +1 -1
  135. package/assets/{secp256k1-D40VegOp.js → secp256k1-7K_lKgAG.js} +1 -1
  136. package/assets/{secp256k1-BKV5oKjd.js → secp256k1-CJEeTac_.js} +1 -1
  137. package/assets/{secp256k1-sDtHKyKa.js → secp256k1-Cc-OBcqq.js} +1 -1
  138. package/assets/{send-oN3YL-hJ.js → send-LziflfC8.js} +1 -1
  139. package/assets/{send-batch-transaction-D3IxN4nk.js → send-batch-transaction-cPuMc9MS.js} +1 -1
  140. package/assets/{send-eip712-transaction-Ceey9vq_.js → send-eip712-transaction-DrVlY4sm.js} +2 -2
  141. package/assets/{send-gasless-transaction-BksJzQiD.js → send-gasless-transaction-C7GQuNPZ.js} +2 -2
  142. package/assets/{send-transaction-B73fhwe5.js → send-transaction-DsHae-07.js} +2 -2
  143. package/assets/{sendMetaTransaction-BqrdflYy.js → sendMetaTransaction-DVALeVb8.js} +1 -1
  144. package/assets/{sendRawTransaction-CGYbLnZb.js → sendRawTransaction-BwoXNrfy.js} +3 -3
  145. package/assets/{serializeTransaction-D5Cac03m.js → serializeTransaction-HjwgZYgE.js} +1 -1
  146. package/assets/{session-proposal-CVgUeAZW.js → session-proposal-D2B7jyYw.js} +1 -1
  147. package/assets/{session-request-Di3dSSrI.js → session-request-qG7jHYd4.js} +2 -2
  148. package/assets/{signing-Bdc9gWZa.js → signing-2d-SxI7E.js} +3 -3
  149. package/assets/{socials-CmTeJTYn.js → socials-C5lHDsWb.js} +1 -1
  150. package/assets/{swaps-Wtea2NAu.js → swaps-D-FCeao1.js} +1 -1
  151. package/assets/{thirdweb-CERMcOXb.js → thirdweb-BzCYZVQU.js} +3 -3
  152. package/assets/{to-serializable-transaction-DdX40tW9.js → to-serializable-transaction-mtITaKz7.js} +2 -2
  153. package/assets/{trade-encoding-BoHXvOIc.js → trade-encoding-ZhCceq00.js} +1 -1
  154. package/assets/{transactionReceipt-ibp-LAsQ.js → transactionReceipt-C0Zt7siR.js} +1 -1
  155. package/assets/{transactions-CIBv0IDn.js → transactions-3oKW7X2A.js} +1 -1
  156. package/assets/{useCreditPacks-Erm2XH9O.js → useCreditPacks-DTZSsQrR.js} +1 -1
  157. package/assets/{useInfiniteGrid-D2N-648g.js → useInfiniteGrid-DxkPmxZ9.js} +1 -1
  158. package/assets/useManaRate-DJlj41tJ.js +1 -0
  159. package/assets/{useSecondarySales-i_ahcBp1.js → useSecondarySales-uafEfAWN.js} +1 -1
  160. package/assets/{useStore-qQrt-8mX.js → useStore-HaFF1p2U.js} +1 -1
  161. package/assets/{useTheme-DbdTKy8O.js → useTheme-DVLL-c1A.js} +1 -1
  162. package/assets/{verifyHash-SsYbACTo.js → verifyHash-DR9pCFUe.js} +1 -1
  163. package/assets/{w3m-modal-C6arh-dP.js → w3m-modal-B4U6A0YE.js} +1 -1
  164. package/assets/{w3m-modal-U9w4vwW2.js → w3m-modal-CaY0gxk7.js} +1 -1
  165. package/assets/{wait-for-tx-receipt-BeQkCkwD.js → wait-for-tx-receipt-BDXxYIXq.js} +1 -1
  166. package/assets/{wallets-CkbfkMFt.js → wallets-Y1872Ad0.js} +5 -5
  167. package/assets/{web-connector-mK5WyzBm.js → web-connector-CYEfuYp5.js} +3 -3
  168. package/assets/{writeContract-CzlvCXqK.js → writeContract-DrFAVNON.js} +1 -1
  169. package/assets/{zoraTestnet-uirxtXVm.js → zoraTestnet-CZflXjbY.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/assets/index-Wf8RWpZ6.js +0 -2815
  173. package/assets/useManaRate-DAS3C4zo.js +0 -1
@@ -1,4 +1,4 @@
1
- import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,az as we,aA as R,aB as _,s as a,aC as je,G as ve,aD as Ce,e as t,aE as W,B as ye,H as q,af as J,n as $e,ag as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,ay as Le,aF as Ae}from"./index-Wf8RWpZ6.js";import{d as Me,g as ze,a as Fe,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as He,e as Ge,f as Ue}from"./browseLayout.styles-B9TM0sjQ.js";import{u as De,L as Ke}from"./useStore-qQrt-8mX.js";import{c as H,a as Oe,F as Ve,d as Ye,P as Ze,e as qe,H as Je,S as Qe}from"./categories-B6c_VHlD.js";import{L as G}from"./LoadMore-Bg1WdJa_.js";import{u as U}from"./useInfiniteGrid-D2N-648g.js";import{E as D}from"./ErrorNotice-BDPNfqx0.js";import{G as K}from"./grid.styles-DxJ1n2rK.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=Z,et=a.article`
1
+ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,aA as we,aB as R,aC as _,s as a,aD as je,G as ve,aE as Ce,e as t,aF as W,B as ye,H as q,af as J,n as $e,ag as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,az as Le,aG as Ae}from"./index-BnbwrW-6.js";import{d as Me,g as ze,a as Fe,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as Ge,e as He,f as Ue}from"./browseLayout.styles-B_NNL83E.js";import{u as De,L as Ke}from"./useStore-HaFF1p2U.js";import{c as G,a as Oe,F as Ve,d as Ye,P as Ze,e as qe,H as Je,S as Qe}from"./categories-CX6i4K78.js";import{L as H}from"./LoadMore-DI4Wyn-C.js";import{u as U}from"./useInfiniteGrid-DxkPmxZ9.js";import{E as D}from"./ErrorNotice-Z0D8os9s.js";import{G as K}from"./grid.styles-Cflo-ZKg.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=Z,et=a.article`
2
2
  height: 300px;
3
3
  background: ${m.bg};
4
4
  border-radius: ${X.card};
@@ -303,4 +303,4 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=ze(Fe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(gt,{"aria-label":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Ht(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=J(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,z=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(H.find(o=>o.key===A)??H[0]).server,F={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:z,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",F],o=>Le({...F,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||z),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(He,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Ze,{"data-variant":"price",children:[e.jsxs(qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(Je,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Ht as Creator,Ht as default};
306
+ `,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=ze(Fe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(gt,{"aria-label":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Gt(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=J(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,z=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(G.find(o=>o.key===A)??G[0]).server,F={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:z,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",F],o=>Le({...F,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||z),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(Ge,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(He,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(H,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Ze,{"data-variant":"price",children:[e.jsxs(qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(Je,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(H,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Gt as Creator,Gt as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-vyZjIDcS.js";import{I as i}from"./index-Wf8RWpZ6.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-vyZjIDcS.js";import{I as i}from"./index-BnbwrW-6.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-Bum-DrEQ.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-CVlJa6t_.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-CAciSeGb.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DiUDVsbw.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,4 +1,4 @@
1
- import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as he,E as ge,aq as g,ao as fe,l as G,ax as U,I as ee,aj as N,z as te,aP as me}from"./index-Wf8RWpZ6.js";import{R as H}from"./resume-buy-Bf0zIH7y.js";import{u as be,p as we,R as ye,c as ke,i as Ce}from"./useCreditPacks-Erm2XH9O.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-CTsR_3Ej.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/pack-coins-BDh1ZDbh.webp",ie="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/pack-stacks-D-V2jSHW.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/credit-coin-CmcTCd5i.webp",$e="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",ve="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Se=i.div`
1
+ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as he,E as ge,ar as g,ap as fe,l as G,ay as U,I as ee,aj as N,z as te,aQ as me}from"./index-BnbwrW-6.js";import{R as H}from"./resume-buy-Bf0zIH7y.js";import{u as be,p as we,R as ye,c as ke,i as Ce}from"./useCreditPacks-DTZSsQrR.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-Bc7WVBn5.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/pack-coins-BDh1ZDbh.webp",ie="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/pack-stacks-D-V2jSHW.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/credit-coin-CmcTCd5i.webp",$e="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",ve="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Se=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -380,7 +380,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
380
380
  font-size: 16px;
381
381
  line-height: 1.4;
382
382
  color: rgba(255, 255, 255, 0.88);
383
- `,qe=E`
383
+ `,Qe=E`
384
384
  0%, 100% {
385
385
  transform: scale(1);
386
386
  opacity: 1;
@@ -400,12 +400,12 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
400
400
  `,ne=i.img`
401
401
  width: 61px;
402
402
  height: 61px;
403
- animation: ${qe} 1.2s ease-in-out infinite;
403
+ animation: ${Qe} 1.2s ease-in-out infinite;
404
404
 
405
405
  @media (prefers-reduced-motion: reduce) {
406
406
  animation: none;
407
407
  }
408
- `,Qe=i(ne)`
408
+ `,qe=i(ne)`
409
409
  width: 72px;
410
410
  height: 72px;
411
411
  `,Ze=i.div`
@@ -604,7 +604,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
604
604
  outline: 2px solid ${e.colors.accent};
605
605
  outline-offset: 2px;
606
606
  }
607
- `,q=i.div`
607
+ `,Q=i.div`
608
608
  display: flex;
609
609
  flex-direction: column;
610
610
  align-items: center;
@@ -623,7 +623,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
623
623
  &[data-tone='error'] {
624
624
  color: ${e.colors.err};
625
625
  }
626
- `,Q=i.div`
626
+ `,q=i.div`
627
627
  display: flex;
628
628
  gap: 12px;
629
629
  margin-top: 16px;
@@ -631,4 +631,4 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
631
631
  margin: 0;
632
632
  font-family: ${e.font.sans};
633
633
  color: ${e.colors.err};
634
- `,C=Ce()?"mock":"stripe",Z=[S,S,ie,re],mt={pack_5:S,pack_10:S,pack_25:ie,pack_50:re};function se(a,s){return mt[a.id]??Z[s%Z.length]}function bt(a,s){return a.artUrl??se(a,s)}const wt="https://docs.decentraland.org";function J(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function zt(){var I;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=pe(),{session:s,signIn:f}=he(),d=ge(),[m,j]=xe(),{packs:b,isLoading:oe}=be(),[u,x]=l.useState("select"),[c,T]=l.useState(null),[$,F]=l.useState(null),ae=($!=null?(I=b.find(n=>n.credits===$))==null?void 0:I.artUrl:void 0)??je,[de,y]=l.useState(null),[ce,P]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const L=l.useCallback(()=>{j(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[j]),_=l.useCallback(async n=>{x("processing");const o=new AbortController;R.current=o;try{const h=await we(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(h.status==="credited"){const w=h.creditsGranted??(c==null?void 0:c.credits)??0;F(w>0?w:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const v={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:v});return}}catch{}try{const v=sessionStorage.getItem(H);if(v){sessionStorage.removeItem(H);const W=JSON.parse(v),M=fe(W);if(M){a(M,{state:{item:W,resumeBuy:!0}});return}}}catch{}}else h.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),y(h.error??r("getCredits.errorGrant",{currency:p.name})),x("error"))}catch(h){G(h,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(h),pack_usd:(c==null?void 0:c.usd)??null}),y(J(h)),x("error")}},[c,s,d,a]),le=l.useCallback(async n=>{if(!s){f();return}y(null),P(!1),T(n),x(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:C});try{const o=await ke(n.id,{address:s.address,identity:s.identity});if(o.mock)_(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(o),pack_usd:n.usd}),y(J(o)),x("error")}},[s,f,_]),z=l.useRef(!1);l.useEffect(()=>{if(z.current)return;const n=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:C}),L(),P(!0),x("select");return}n&&(x("processing"),s&&(z.current=!0,L(),_(n)))},[m,s]);function A(){var n;(n=R.current)==null||n.abort(),x("select"),T(null),F(null),y(null),P(!1)}return t.jsxs(Se,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Pe,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(_e,{$hidden:u==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Be,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Te,{href:wt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ee,{name:"link-out"})]})]})]}),ce&&t.jsx(Fe,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(yt,{packs:b,loading:oe,onSelect:n=>void le(n)})]}),u==="redirecting"&&t.jsxs(Ye,{role:"status","aria-live":"polite",children:[t.jsx(Qe,{src:N,alt:"",width:72,height:72}),t.jsx(Ve,{children:r("getCredits.redirecting")})]})]}),u==="processing"&&t.jsxs(Xe,{role:"status","aria-live":"polite",children:[t.jsx(ne,{src:N,alt:"",width:61,height:61}),t.jsxs(Ze,{children:[t.jsxs(Je,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(et,{"aria-hidden":!0,children:[t.jsx(it,{children:t.jsx(rt,{})}),t.jsx(nt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(ot,{children:[t.jsx(at,{src:$e,alt:"",width:60,height:60}),t.jsxs(dt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),$!=null&&t.jsx(ct,{children:t.jsxs(lt,{children:[t.jsx(pt,{src:ae,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(te,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:$,currency:p.name})})," ",t.jsx(ht,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(gt,{children:[t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(q,{role:"status","aria-live":"polite",children:[t.jsx(X,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Oe,{children:r("getCredits.pendingBody")}),t.jsxs(Q,{children:[t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.done")})]})]}),u==="error"&&t.jsxs(q,{role:"alert",children:[t.jsx(X,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(ft,{children:de}),t.jsx(Q,{children:t.jsx(k,{onClick:A,children:r("getCredits.tryAgain")})})]})]})}function yt({packs:a,loading:s,onSelect:f}){return s?t.jsx(D,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(d=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsx(V,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(De,{})]},d))}):t.jsx(D,{children:a.map((d,m)=>t.jsxs(O,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>f(d),"aria-label":r("getCredits.packAria",{amount:me(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Le,{children:[t.jsx(ee,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(V,{children:[t.jsxs(Ie,{children:[t.jsx(te,{}),t.jsx(We,{children:d.credits})]}),t.jsx(Me,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:bt(d,m),alt:"",loading:"lazy",width:507,height:507,onError:j=>{const b=j.currentTarget;b.dataset.artFallback||(b.dataset.artFallback="done",b.src=se(d,m))}})})]}),t.jsxs(Ue,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{zt as GetCredits,zt as default};
634
+ `,C=Ce()?"mock":"stripe",Z=[S,S,ie,re],mt={pack_5:S,pack_10:S,pack_25:ie,pack_50:re};function se(a,s){return mt[a.id]??Z[s%Z.length]}function bt(a,s){return a.artUrl??se(a,s)}const wt="https://docs.decentraland.org";function J(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function zt(){var I;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=pe(),{session:s,signIn:f}=he(),d=ge(),[m,j]=xe(),{packs:b,isLoading:oe}=be(),[u,x]=l.useState("select"),[c,T]=l.useState(null),[$,F]=l.useState(null),ae=($!=null?(I=b.find(n=>n.credits===$))==null?void 0:I.artUrl:void 0)??je,[de,y]=l.useState(null),[ce,P]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const L=l.useCallback(()=>{j(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[j]),_=l.useCallback(async n=>{x("processing");const o=new AbortController;R.current=o;try{const h=await we(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(h.status==="credited"){const w=h.creditsGranted??(c==null?void 0:c.credits)??0;F(w>0?w:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const v={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:v});return}}catch{}try{const v=sessionStorage.getItem(H);if(v){sessionStorage.removeItem(H);const W=JSON.parse(v),M=fe(W);if(M){a(M,{state:{item:W,resumeBuy:!0}});return}}}catch{}}else h.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),y(h.error??r("getCredits.errorGrant",{currency:p.name})),x("error"))}catch(h){G(h,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(h),pack_usd:(c==null?void 0:c.usd)??null}),y(J(h)),x("error")}},[c,s,d,a]),le=l.useCallback(async n=>{if(!s){f();return}y(null),P(!1),T(n),x(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:C});try{const o=await ke(n.id,{address:s.address,identity:s.identity});if(o.mock)_(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(o),pack_usd:n.usd}),y(J(o)),x("error")}},[s,f,_]),z=l.useRef(!1);l.useEffect(()=>{if(z.current)return;const n=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:C}),L(),P(!0),x("select");return}n&&(x("processing"),s&&(z.current=!0,L(),_(n)))},[m,s]);function A(){var n;(n=R.current)==null||n.abort(),x("select"),T(null),F(null),y(null),P(!1)}return t.jsxs(Se,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Pe,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(_e,{$hidden:u==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Be,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Te,{href:wt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ee,{name:"link-out"})]})]})]}),ce&&t.jsx(Fe,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(yt,{packs:b,loading:oe,onSelect:n=>void le(n)})]}),u==="redirecting"&&t.jsxs(Ye,{role:"status","aria-live":"polite",children:[t.jsx(qe,{src:N,alt:"",width:72,height:72}),t.jsx(Ve,{children:r("getCredits.redirecting")})]})]}),u==="processing"&&t.jsxs(Xe,{role:"status","aria-live":"polite",children:[t.jsx(ne,{src:N,alt:"",width:61,height:61}),t.jsxs(Ze,{children:[t.jsxs(Je,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(et,{"aria-hidden":!0,children:[t.jsx(it,{children:t.jsx(rt,{})}),t.jsx(nt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(ot,{children:[t.jsx(at,{src:$e,alt:"",width:60,height:60}),t.jsxs(dt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),$!=null&&t.jsx(ct,{children:t.jsxs(lt,{children:[t.jsx(pt,{src:ae,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(te,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:$,currency:p.name})})," ",t.jsx(ht,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(gt,{children:[t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(X,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Oe,{children:r("getCredits.pendingBody")}),t.jsxs(q,{children:[t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.done")})]})]}),u==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(X,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(ft,{children:de}),t.jsx(q,{children:t.jsx(k,{onClick:A,children:r("getCredits.tryAgain")})})]})]})}function yt({packs:a,loading:s,onSelect:f}){return s?t.jsx(D,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(d=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsx(V,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(De,{})]},d))}):t.jsx(D,{children:a.map((d,m)=>t.jsxs(O,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>f(d),"aria-label":r("getCredits.packAria",{amount:me(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Le,{children:[t.jsx(ee,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(V,{children:[t.jsxs(Ie,{children:[t.jsx(te,{}),t.jsx(We,{children:d.credits})]}),t.jsx(Me,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:bt(d,m),alt:"",loading:"lazy",width:507,height:507,onError:j=>{const b=j.currentTarget;b.dataset.artFallback||(b.dataset.artFallback="done",b.src=se(d,m))}})})]}),t.jsxs(Ue,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{zt as GetCredits,zt as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-9ijpZr49.js";import{d as g,r as v}from"./index-CVlJa6t_.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-Bum-DrEQ.js";import{au as y}from"./NetworkUtil-HlUKXKcF.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-DmUPrDg1.js";import{d as g,r as v}from"./index-DiUDVsbw.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CAciSeGb.js";import{au as y}from"./NetworkUtil-HlUKXKcF.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as R,B as I,z,aq as ne,aO as K,l as W,m as re,n as oe,E as ae,u as de,F as ce}from"./index-Wf8RWpZ6.js";import{i as le,R as pe,f as ge}from"./import-CYD98Dph.js";import{u as xe}from"./useSecondarySales-i_ahcBp1.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-CQDvi-Z2.js";import"./authorizations-CRss4Km2.js";import"./sendMetaTransaction-BqrdflYy.js";import"./trade-encoding-BoHXvOIc.js";import"./mana-rate-C115gAGh.js";import"./mana-convert-CTsR_3Ej.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
1
+ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as R,B as I,z,ar as ne,aP as K,l as W,m as re,n as oe,E as ae,u as de,F as ce}from"./index-BnbwrW-6.js";import{i as le,R as pe,f as ge}from"./import-Da_I6gAZ.js";import{u as xe}from"./useSecondarySales-uafEfAWN.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-D3hY4JG8.js";import"./authorizations-B6wWjXdQ.js";import"./sendMetaTransaction-DVALeVb8.js";import"./trade-encoding-ZhCceq00.js";import"./mana-rate-CFfqtCHS.js";import"./mana-convert-Bc7WVBn5.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
2
2
  0% {
3
3
  transform: scale(0);
4
4
  opacity: 0;
@@ -179,7 +179,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
179
179
  font-size: 12px;
180
180
  `,Ne=t.p`
181
181
  margin: 12px 0 0;
182
- `;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,Q]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,F)=>F===a?f?"skipped":"failed":B))}}}n||Q("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,E=g.findIndex(n=>n==="active"),N=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(A==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:R.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",E>=0?i("migrate.progressCount",{current:E+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${N}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ee,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ne,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Re,radius:Ae}=S,D="@media (max-width: 620px)",G=t.div`
182
+ `;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,P]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,Q)=>Q===a?f?"skipped":"failed":B))}}}n||P("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,E=g.findIndex(n=>n==="active"),N=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(A==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:R.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",E>=0?i("migrate.progressCount",{current:E+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${N}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ee,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ne,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Re,radius:Ae}=S,D="@media (max-width: 620px)",G=t.div`
183
183
  max-width: 520px;
184
184
  margin: 0 auto;
185
185
  text-align: center;
@@ -196,13 +196,13 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
196
196
  margin: 4px 0 0;
197
197
  `,V=t(I)`
198
198
  margin-top: 10px;
199
- `,Qe=t.div`
199
+ `,Pe=t.div`
200
200
  max-width: 860px;
201
201
  margin: 0 auto;
202
202
  padding-bottom: 120px;
203
- `,Fe=t.header`
203
+ `,Qe=t.header`
204
204
  margin-bottom: 18px;
205
- `,Pe=t.span`
205
+ `,Fe=t.span`
206
206
  display: inline-block;
207
207
  font-size: 12px;
208
208
  font-weight: 700;
@@ -444,4 +444,4 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
444
444
  flex: 1 1 auto;
445
445
  `,xt=t(I)`
446
446
  padding: 13px 24px;
447
- `,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[Q,k]=h.useState({}),[$,E]=h.useState(new Set),[N,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>Q[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){E(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function F(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Qe,{children:[e.jsxs(Fe,{children:[e.jsx(Pe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:R.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:R.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):A.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:P=>f(s.oldTradeId,P.target.value),"aria-label":i("importListings.priceAria",{currency:R.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(P=>({...P,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),N&&o?e.jsx(Be,{queue:N,session:o,onClose:()=>L(null),onDone:F}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};
447
+ `,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[P,k]=h.useState({}),[$,E]=h.useState(new Set),[N,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>P[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){E(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function Q(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Pe,{children:[e.jsxs(Qe,{children:[e.jsx(Fe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:R.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:R.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):A.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:F=>f(s.oldTradeId,F.target.value),"aria-label":i("importListings.priceAria",{currency:R.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(F=>({...F,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),N&&o?e.jsx(Be,{queue:N,session:o,onClose:()=>L(null),onDone:Q}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};