@dcl/shop 0.1.0-29994103056.commit-191afbc → 0.1.0-29996672089.commit-ce4d282

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 (246) hide show
  1. package/assets/Activity-ji9z26-b.js +243 -0
  2. package/assets/{AnimatedBackground-CwVmQoMy.js → AnimatedBackground-dlJZeXOs.js} +3 -3
  3. package/assets/Assets-DHtvK9gi.js +758 -0
  4. package/assets/{Assets.styles-BmY0qPN-.js → Assets.styles-DBA9HXW7.js} +1 -1
  5. package/assets/Authorizations-BNMCiOdB.js +163 -0
  6. package/assets/Cart-BlShrWP_.js +3 -0
  7. package/assets/{CircularProgress-BmaY3soK.js → CircularProgress-DvTkhDvC.js} +1 -1
  8. package/assets/{Collection-BlMV8rIO.js → Collection-DFIFsgYQ.js} +2 -2
  9. package/assets/CollectionCarousel-DMwkzkYf.js +1 -0
  10. package/assets/{ConstantsUtil-DO6FyoSW.js → ConstantsUtil-CJUlyS7R.js} +1 -1
  11. package/assets/{ContentClient-eS-Purid.js → ContentClient-DtuNqgIp.js} +1 -1
  12. package/assets/{Creator-CVsany2p.js → Creator-BzYX40qE.js} +1 -1
  13. package/assets/{CssVarsProvider-D03-j1T8.js → CssVarsProvider-D82yS8Ds.js} +1 -1
  14. package/assets/{DeploymentBuilder-mzKF7T6P.js → DeploymentBuilder-Bt5zjBVh.js} +1 -1
  15. package/assets/{ErrorNotice-BDH9xoG4.js → ErrorNotice-C7soUjRV.js} +1 -1
  16. package/assets/{ExchangeController-BKklF67w.js → ExchangeController-CiGVwKQf.js} +1 -1
  17. package/assets/{GetCredits-l0W_kkUA.js → GetCredits-eVhxGnMo.js} +1 -1
  18. package/assets/{HelpersUtil-1AJlaO39.js → HelpersUtil-C32FavmO.js} +1 -1
  19. package/assets/{ImportListings-CaC4hXkS.js → ImportListings-BiGwtdUn.js} +2 -2
  20. package/assets/ItemDetail-6dC_vNLF.css +1 -0
  21. package/assets/ItemDetail-DQOBDAhC.js +78 -0
  22. package/assets/{LoadMore-DCZi1YY-.js → LoadMore-BjvEi3Wj.js} +1 -1
  23. package/assets/MarketCheckout-BB0_ss_n.js +3 -0
  24. package/assets/{MyAssets-Gc_o5t9O.js → MyAssets-cbSiEx2B.js} +2 -2
  25. package/assets/{MyFavorites-CTtHG-tK.js → MyFavorites-DxWrJSpf.js} +2 -2
  26. package/assets/{NetworkUtil-BGlQiKvg.js → NetworkUtil-Xp0fNa8X.js} +1 -1
  27. package/assets/{NotFound-0kATSaSv.js → NotFound-Cj4SIl5T.js} +1 -1
  28. package/assets/{PrimaryListModal-QH5JEih2.js → PrimaryListModal-CdZJXblc.js} +1 -1
  29. package/assets/{StoreSettings-D97bWmhq.js → StoreSettings-LdrMcuVr.js} +5 -5
  30. package/assets/Success-BRT1MWds.js +4 -0
  31. package/assets/{SwapController-C8nP5wvc.js → SwapController-CXQ00xts.js} +1 -1
  32. package/assets/{Tooltip-BaUllE5E.js → Tooltip-BZ57TVaP.js} +1 -1
  33. package/assets/TradeService-SfkC7zHZ.js +1 -0
  34. package/assets/{W3MFrameProviderSingleton-B-iMukUt.js → W3MFrameProviderSingleton-B8RM0-JJ.js} +3 -3
  35. package/assets/{WebCryptoP256-BN2oUA6b.js → WebCryptoP256-D_33Dvnx.js} +1 -1
  36. package/assets/authorizations-D44lw00X.js +1 -0
  37. package/assets/{basic-BAZBRGQf.js → basic-CtFzqtOx.js} +1 -1
  38. package/assets/{biconomy-Bnx-4bDS.js → biconomy-BaeM1SCU.js} +1 -1
  39. package/assets/{browser-Cad_aDY9.js → browser-9oFjBwrz.js} +1 -1
  40. package/assets/{browser-ponyfill-CQ0GHmxr.js → browser-ponyfill-DMgE6PM5.js} +1 -1
  41. package/assets/browser-ponyfill-Djb5Py6a.js +1 -0
  42. package/assets/buy-Dszi8UeF.js +1 -0
  43. package/assets/buy-gasless-Nfp6cMbQ.js +1 -0
  44. package/assets/{cart-checkout-CUI-WqEI.js → cart-checkout-Ba3nMBI0.js} +1 -1
  45. package/assets/{categories-BGNx7jfw.js → categories-D0iwhqs_.js} +1 -1
  46. package/assets/{ccip-CPI8_6cL.js → ccip-CaKFUjmD.js} +1 -1
  47. package/assets/{ccip-s5BQ-vNw.js → ccip-DGnj8pvI.js} +1 -1
  48. package/assets/{chains-C1bwVnfj.js → chains-Bzau33xB.js} +1 -1
  49. package/assets/collection-DSysxaCY.js +1 -0
  50. package/assets/{common-yfho93wI.js → common-BaN-pXG4.js} +1 -1
  51. package/assets/{controller-CL9wipr5.js → controller-DqW_a2vQ.js} +2 -2
  52. package/assets/{core-gCo9rRyh.js → core-BfFj7IDN.js} +4 -4
  53. package/assets/{custom-BIAxnPyV.js → custom-CyKMgWLF.js} +1 -1
  54. package/assets/{data-capture-D_IuhqRX.js → data-capture-DyJzM655.js} +1 -1
  55. package/assets/{decimals-B36bI5dA.js → decimals-DaU_ek4_.js} +1 -1
  56. package/assets/decimals-HChuNAkm.js +1 -0
  57. package/assets/{detectExtension-CKplVZ9K.js → detectExtension-C2ped1rb.js} +1 -1
  58. package/assets/{email-BCklj9Js.js → email-B1LVTurO.js} +1 -1
  59. package/assets/{embedded-wallet-B6X4cZQC.js → embedded-wallet-DbH1O4GQ.js} +1 -1
  60. package/assets/{emotion-styled.browser.esm-D40Lt8fm.js → emotion-styled.browser.esm-CMXzhKww.js} +1 -1
  61. package/assets/{engine-skvS20px.js → engine-BNiIRF8k.js} +1 -1
  62. package/assets/{errors-DmdGTuzI.js → errors-DUo56sGG.js} +1 -1
  63. package/assets/estimate-l1-fee-DbEUBk2I.js +1 -0
  64. package/assets/eth_estimateGas-DcV1bi0C.js +1 -0
  65. package/assets/{eth_getStorageAt-C0E8Vng5.js → eth_getStorageAt-CvOhghFe.js} +1 -1
  66. package/assets/eth_getTransactionCount-BNyI69eR.js +1 -0
  67. package/assets/{ethereum-C5kfwN9D.js → ethereum-B_IIMsg0.js} +1 -1
  68. package/assets/{ethers-BIvjmL85.js → ethers-w5dOkonM.js} +1 -1
  69. package/assets/{execute-B_XUV-t5.js → execute-CzNqLgfO.js} +2 -2
  70. package/assets/{extractIPFS-CsawLTu6.js → extractIPFS-mhjpSq1K.js} +1 -1
  71. package/assets/{features-D1q967sn.js → features-D_R5E38-.js} +1 -1
  72. package/assets/{fetchTokenMetadata-Bgs6k1N5.js → fetchTokenMetadata-BZsN957Y.js} +2 -2
  73. package/assets/{fortmatic-DwISA9k4.js → fortmatic-DhmlcDbL.js} +1 -1
  74. package/assets/{get-bytecode-nwWHW248.js → get-bytecode-D38h1G96.js} +1 -1
  75. package/assets/get-ecosystem-wallet-info-BIlu2xkX.js +1 -0
  76. package/assets/{getBalance-D2FG5QKV.js → getBalance-BD5xADMR.js} +2 -2
  77. package/assets/{getInstalledModules-fBSGgSis.js → getInstalledModules-3Q5HYxkN.js} +1 -1
  78. package/assets/getNFT-B7e2uNF-.js +1 -0
  79. package/assets/{getNFT-BHzS5Cs2.js → getNFT-DjEJIHB0.js} +2 -2
  80. package/assets/{getOverlayAlpha-B90Fo_-m.js → getOverlayAlpha-Ho14PJoT.js} +1 -1
  81. package/assets/{hashTypedData-Cetq1UOK.js → hashTypedData-CC4Umz6j.js} +1 -1
  82. package/assets/{hashTypedData-DwlPS8MG.js → hashTypedData-DE2iuKMA.js} +1 -1
  83. package/assets/{import-DLMm_P8-.js → import-BPLVQmln.js} +1 -1
  84. package/assets/{in-app-CL2vGnrW.js → in-app-qD4m50Nn.js} +1 -1
  85. package/assets/{in-app-wallet-calls-CQYLsbwB.js → in-app-wallet-calls-BcFExuty.js} +1 -1
  86. package/assets/{index-DYAXJBpy.js → index--PWwvcNI.js} +1 -1
  87. package/assets/{index-Che81lrU.js → index-0syK5-Ww.js} +1 -1
  88. package/assets/{index-Chep4cKH.js → index-2Q-POj3l.js} +3 -3
  89. package/assets/{index-Ctbl3gOg.js → index-5RDpMwKv.js} +1 -1
  90. package/assets/{index-BptsdzIZ.js → index-Aw0QE_Br.js} +1 -1
  91. package/assets/{index-DcsKpVUb.js → index-B9U21JU-.js} +1 -1
  92. package/assets/{index-BrG8RI5z.js → index-B9n-6xCt.js} +1 -1
  93. package/assets/{index-DOyivP0c.js → index-BAKqn_lj.js} +2 -2
  94. package/assets/{index-D5zi_XmR.js → index-BBLW_jFO.js} +1 -1
  95. package/assets/{index-DAhYJ23_.js → index-BFydxC8W.js} +1 -1
  96. package/assets/{index-CMZ-l1j1.js → index-BGbFLGJH.js} +1 -1
  97. package/assets/{index-CwlKjFOG.js → index-BNa7Mf2M.js} +1 -1
  98. package/assets/{index-BEYHZcex.js → index-BW1vsFdc.js} +1 -1
  99. package/assets/{index-BBg2vZhG.js → index-B_AeYsKa.js} +1 -1
  100. package/assets/{index-CnFuk6fK.js → index-BfnFZQqu.js} +1 -1
  101. package/assets/{index-BXIq_1Tg.js → index-Bi7dtaTz.js} +1 -1
  102. package/assets/{index-Bn-EvtCB.js → index-Bk6ayCIs.js} +1 -1
  103. package/assets/{index-Dzy3N4vA.js → index-BnrQ0KXT.js} +1 -1
  104. package/assets/{index-Cx9CeoZH.js → index-Bt55wXtx.js} +1 -1
  105. package/assets/{index-BywohlL7.js → index-BuXSM1De.js} +1 -1
  106. package/assets/{index-B65D0iv0.js → index-ByOIX4VW.js} +1 -1
  107. package/assets/{index-CVPd9k0D.js → index-C4111GJ-.js} +2 -2
  108. package/assets/{index-DexIqMzn.js → index-C8P6BHpY.js} +3 -3
  109. package/assets/{index-D6Thjy9g.js → index-CA73t5p4.js} +1 -1
  110. package/assets/{index-Zev_LSPI.js → index-CDkTFenk.js} +2 -2
  111. package/assets/index-CGNquv7o.js +289 -0
  112. package/assets/{index-B-wT7-Au.js → index-CPvKfkxC.js} +1 -1
  113. package/assets/{index-C6-1JAkG.js → index-CXMHgbT-.js} +1 -1
  114. package/assets/{index-CrqgaFmq.js → index-Ck1Cgm82.js} +1 -1
  115. package/assets/{index-D2F7-1mk.js → index-Cl3G53Lb.js} +1 -1
  116. package/assets/{index-BGuUm-N-.js → index-CqYbCFw1.js} +1 -1
  117. package/assets/index-CrKaGnrK.css +1 -0
  118. package/assets/{index-C5t2d1JX.js → index-CrhtLjWe.js} +1 -1
  119. package/assets/{index-CHspULa1.js → index-CuA9C-j1.js} +1 -1
  120. package/assets/{index-BedvNbsM.js → index-CwFsoF5e.js} +1 -1
  121. package/assets/{index-DTJ6mS_J.js → index-CwKIaxXt.js} +1 -1
  122. package/assets/{index-B-3QmCY1.js → index-Cx9QgWtN.js} +1 -1
  123. package/assets/{index-C97CPhyL.js → index-D2bdndwX.js} +1 -1
  124. package/assets/{index-K0TqdX33.js → index-D7KDT9M9.js} +1 -1
  125. package/assets/{index-nTA1Tk1a.js → index-DD8leihn.js} +1 -1
  126. package/assets/{index-DjQcD_Sm.js → index-DGOaB47n.js} +1 -1
  127. package/assets/index-DH3Yzbz3.js +1 -0
  128. package/assets/{index-CSRkaTCL.js → index-DRB-gQiu.js} +1 -1
  129. package/assets/{index-ChbyDwUh.js → index-DUx_udvr.js} +1 -1
  130. package/assets/{index-DLJwIINa.js → index-DVl2fB76.js} +1 -1
  131. package/assets/{index-CyrfWYlv.js → index-DWj03ICg.js} +1 -1
  132. package/assets/{index-BZk7RUfM.js → index-D_jFC223.js} +1 -1
  133. package/assets/{index-C0wsNojR.js → index-D_xn82-1.js} +1 -1
  134. package/assets/{index-DnxELmkR.js → index-DcVvVcVQ.js} +1 -1
  135. package/assets/{index-C2te_xAY.js → index-Dg2IevmK.js} +2 -2
  136. package/assets/{index-CjBPO58E.js → index-Dp3Py-Ws.js} +1 -1
  137. package/assets/{index-d3ZKkcaA.js → index-Dv2SQ_eL.js} +1 -1
  138. package/assets/{index-o_m2wFAn.js → index-DxFC7t5T.js} +1 -1
  139. package/assets/{index-C2N-AU8j.js → index-Dzj-nA_x.js} +3 -3
  140. package/assets/index-HN6Rk25C.js +1 -0
  141. package/assets/{index-BkQHYnhC.js → index-I5rJvbQ1.js} +1 -1
  142. package/assets/{index-CWfnhYLp.js → index-OGdy2qbx.js} +1 -1
  143. package/assets/{index-CvIOskBU.js → index-QMzB_9kT.js} +1 -1
  144. package/assets/{index-B6gcmiqs.js → index-VUv3xRHQ.js} +1 -1
  145. package/assets/{index-DyhpH4px.js → index-grzzP9n9.js} +1 -1
  146. package/assets/{index-D3iIxnX6.js → index-hDcHuSsT.js} +1 -1
  147. package/assets/{index-D-i0A7WQ.js → index-hmML8Yn6.js} +2 -2
  148. package/assets/{index-0F8nhLaF.js → index-lVvjFIjk.js} +1 -1
  149. package/assets/{index-uK7qM9c7.js → index-w4_5Aj8T.js} +1 -1
  150. package/assets/{index-CW9ug21x.js → index-yRQsdAyS.js} +3 -3
  151. package/assets/{index-yr9vyS0z.js → index-z9bgkHOn.js} +1 -1
  152. package/assets/{index.es-DnNvUOrT.js → index.es-CMAy1XDw.js} +1 -1
  153. package/assets/{index.es-CZtQ8FVb.js → index.es-CMyspuf3.js} +4 -4
  154. package/assets/{index.es-DlHsAJbI.js → index.es-DLt1eklQ.js} +1 -1
  155. package/assets/{linkAccount-DKoZKguc.js → linkAccount-e50lqdUE.js} +1 -1
  156. package/assets/{localBatchGatewayRequest-DiUucTH0.js → localBatchGatewayRequest-Da4arsJr.js} +1 -1
  157. package/assets/mana-rate-BM11zYcS.js +1 -0
  158. package/assets/{native-t1vLKS11.js → native-BMBZUPnx.js} +1 -1
  159. package/assets/{networks-D5rFr4Uy.js → networks-CP5ZxOS7.js} +1 -1
  160. package/assets/{onramp-RD8o9zW8.js → onramp-DEaPwD93.js} +1 -1
  161. package/assets/{openzeppelin-GzHB2W1P.js → openzeppelin-ubglQWTS.js} +1 -1
  162. package/assets/{ownerOf-Cl_sRHvA.js → ownerOf-dLmWQ3QZ.js} +1 -1
  163. package/assets/{parseNft-CbgJiXpe.js → parseNft-nhS1PzrY.js} +2 -2
  164. package/assets/{parseSignature-DGB4v4W-.js → parseSignature-DIaDPyGA.js} +1 -1
  165. package/assets/{parseSignature-DZazOabU.js → parseSignature-DtIw2rXo.js} +3 -3
  166. package/assets/{passkeys-BDOXnD26.js → passkeys-l4VrwtfF.js} +1 -1
  167. package/assets/{pay-with-exchange-ChCNzNHg.js → pay-with-exchange-yIOka8rX.js} +1 -1
  168. package/assets/{prepare-contract-call-DmYPUPWz.js → prepare-contract-call-aT1l2NVg.js} +1 -1
  169. package/assets/{qr-overlay-BIPzfQds.js → qr-overlay-BC6wsExf.js} +3 -3
  170. package/assets/{react-BrLDncxD.js → react-C51i12iP.js} +1 -1
  171. package/assets/{receive-CsWO80gl.js → receive-DGr9WBJt.js} +1 -1
  172. package/assets/{resolveImplementation-CInkT_I9.js → resolveImplementation-CgWwbjqg.js} +1 -1
  173. package/assets/{rpc-DOR15RcJ.js → rpc-2WnfD84R.js} +1 -1
  174. package/assets/{secp256k1-DUaLgTGJ.js → secp256k1-BzEjkNEy.js} +1 -1
  175. package/assets/{secp256k1-C8pkcGJ3.js → secp256k1-C2nawWfp.js} +1 -1
  176. package/assets/{secp256k1-N7sx_maT.js → secp256k1-C3Ly2cZR.js} +1 -1
  177. package/assets/{send-BEnX8iHn.js → send-DaMmaBKd.js} +1 -1
  178. package/assets/{send-batch-transaction-Cl-WR4dD.js → send-batch-transaction-BJnHeeX4.js} +1 -1
  179. package/assets/{send-eip712-transaction-BnpCutKi.js → send-eip712-transaction-lGbfEAzA.js} +2 -2
  180. package/assets/send-gasless-transaction-GytT3EN0.js +2 -0
  181. package/assets/{send-transaction-BcThrsCr.js → send-transaction-wju-H3Cn.js} +2 -2
  182. package/assets/sendMetaTransaction-CiO3jI6F.js +1 -0
  183. package/assets/{sendRawTransaction-BJLeMhAd.js → sendRawTransaction-B7gRnaFv.js} +3 -3
  184. package/assets/{sentry-DYZXk5O5.js → sentry-DKBoGDXH.js} +1 -1
  185. package/assets/{serializeTransaction-BMgHZkKp.js → serializeTransaction-K8-WLWnl.js} +1 -1
  186. package/assets/{session-proposal-Ds2RY-CA.js → session-proposal-eLNEKDfD.js} +1 -1
  187. package/assets/{session-request-CLTybC5q.js → session-request-D0qpm2ew.js} +2 -2
  188. package/assets/{sha256-DM_yyL1v.js → sha256-BcAs0Y4r.js} +1 -1
  189. package/assets/{signing-Dr9d33yf.js → signing-gBX9gJ32.js} +3 -3
  190. package/assets/{socials-CaYP6kJa.js → socials-CD_j_07F.js} +1 -1
  191. package/assets/{swaps-BHrutsbS.js → swaps-Bzm1G8N4.js} +1 -1
  192. package/assets/{thirdweb-DIAnaqbp.js → thirdweb-DCMx7j1D.js} +3 -3
  193. package/assets/{to-serializable-transaction-DqNZm-Zy.js → to-serializable-transaction-BZAI7BsG.js} +2 -2
  194. package/assets/{totalSupply-DKYveUeg.js → totalSupply-BCBM6uY2.js} +1 -1
  195. package/assets/trade-encoding-2LKm-Goy.js +1 -0
  196. package/assets/{transaction-HL8b44XJ.js → transaction-Db6pntE5.js} +1 -1
  197. package/assets/{transactionReceipt-iA2axmC8.js → transactionReceipt-CRyPQK5a.js} +1 -1
  198. package/assets/{transactions-DAq9dNVo.js → transactions-I7lCf2CM.js} +1 -1
  199. package/assets/useCreditPacks-DYrmYjK5.js +1 -0
  200. package/assets/{useInfiniteGrid-Dh1-HUF4.js → useInfiniteGrid-CDzsfZBu.js} +1 -1
  201. package/assets/useManaRate-BEdT5IGm.js +1 -0
  202. package/assets/{useStore-DBh7zwbY.js → useStore-D1gCXOP_.js} +2 -2
  203. package/assets/{useTheme-ddXkiCRZ.js → useTheme-CUwz5NUH.js} +1 -1
  204. package/assets/useTheme-hvTZJoGa.js +1 -0
  205. package/assets/{utils-5mrprTVL.js → utils-DBnU1jhd.js} +1 -1
  206. package/assets/{verifyHash-C62BfpA_.js → verifyHash-DGsbtWAk.js} +1 -1
  207. package/assets/{w3m-modal-Bxbo8T_Z.js → w3m-modal-C4axQEqk.js} +1 -1
  208. package/assets/{w3m-modal-BT8yrl74.js → w3m-modal-DJ_LdfUD.js} +1 -1
  209. package/assets/{wait-for-tx-receipt-D_og-NhE.js → wait-for-tx-receipt-JPXzoKCu.js} +1 -1
  210. package/assets/{wallets-B72ZtlfA.js → wallets-CkR7yrP_.js} +5 -5
  211. package/assets/{web-connector-DBmok4eN.js → web-connector-HjRYE3VT.js} +3 -3
  212. package/assets/{writeContract-CLiFKioV.js → writeContract-DSPOgOMV.js} +1 -1
  213. package/assets/{zora-sepolia-Bef01XwU.js → zora-sepolia-Bwjy_6bk.js} +1 -1
  214. package/assets/{zoraTestnet-Bfnpd26p.js → zoraTestnet-2TguyOvD.js} +1 -1
  215. package/index.html +11 -11
  216. package/package.json +2 -2
  217. package/assets/Assets-DqZw3BZv.js +0 -758
  218. package/assets/Authorizations-BxmoVEl_.js +0 -163
  219. package/assets/Cart-DA1J5Be_.js +0 -3
  220. package/assets/CollectionCarousel-B2cDWt_o.js +0 -1
  221. package/assets/ItemDetail-BiAHzfHh.css +0 -1
  222. package/assets/ItemDetail-DHaOvIrD.js +0 -78
  223. package/assets/MarketCheckout-BrvEzX8j.js +0 -3
  224. package/assets/MyPurchases-DLOdIHUA.js +0 -200
  225. package/assets/Success-DRMy6BRe.js +0 -4
  226. package/assets/TradeService-ZNznSjPX.js +0 -1
  227. package/assets/authorizations-QONJAQC4.js +0 -1
  228. package/assets/browser-ponyfill-vZOvKb_B.js +0 -1
  229. package/assets/buy-CE5I6jg2.js +0 -1
  230. package/assets/buy-gasless-DPcBjPtZ.js +0 -1
  231. package/assets/collection-Bm8Org8q.js +0 -1
  232. package/assets/decimals-BPDUTKfa.js +0 -1
  233. package/assets/estimate-l1-fee-J0AI4VGA.js +0 -1
  234. package/assets/eth_estimateGas-BeErQaun.js +0 -1
  235. package/assets/eth_getTransactionCount-kFIWL36y.js +0 -1
  236. package/assets/get-ecosystem-wallet-info-BRMexyn8.js +0 -1
  237. package/assets/getNFT-DrLPmHpk.js +0 -1
  238. package/assets/index-Bw9Y53F1.css +0 -1
  239. package/assets/index-CD_HpB6P.js +0 -1
  240. package/assets/index-DaOu_NHP.js +0 -289
  241. package/assets/mana-rate-BX_VjspN.js +0 -1
  242. package/assets/send-gasless-transaction-CGxm_r0E.js +0 -2
  243. package/assets/sendMetaTransaction-iOoE_Tw3.js +0 -1
  244. package/assets/trade-encoding-DqhxC9n7.js +0 -1
  245. package/assets/useCreditPacks-CV1PhThV.js +0 -1
  246. package/assets/useTheme--bd6Ub02.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as y,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c as ne}from"./categories-BGNx7jfw.js";import{T as se}from"./Tooltip-BaUllE5E.js";import{F as e,s as o,I as m,t as s,G as re,C as v}from"./index-DaOu_NHP.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
1
+ import{r as y,j as t}from"./react-C51i12iP.js";import{R as z,a as oe,C as ie,c as ne}from"./categories-D0iwhqs_.js";import{T as se}from"./Tooltip-BZ57TVaP.js";import{F as e,s as o,I as m,t as s,G as re,e as v}from"./index-CGNquv7o.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -0,0 +1,163 @@
1
+ import{j as t,L,r as N}from"./react-C51i12iP.js";import{s,B as q,F as e,N as B,m as D,t as i,u as F,v as G,I as m,C as H,o as I,b as Q,p as K,J as z,E as M,H as j}from"./index-CGNquv7o.js";import{b as W,c as J,s as O,d as P}from"./authorizations-D44lw00X.js";import{f as X}from"./errors-DUo56sGG.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-w5dOkonM.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";const U=B`
2
+ to { transform: rotate(360deg); }
3
+ `,V=s.section`
4
+ width: 100%;
5
+ min-width: 0;
6
+ max-width: 760px;
7
+ `,Y=s.div`
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 6px;
11
+ margin-bottom: 24px;
12
+ `,Z=s.h1`
13
+ font-family: ${e.font.sans};
14
+ margin: 0;
15
+ `,_=s.p`
16
+ color: ${e.colors.muted};
17
+ font-size: 14px;
18
+ margin: 0;
19
+ max-width: 60ch;
20
+ `,w=s.div`
21
+ margin-bottom: 28px;
22
+ `,b=s.h2`
23
+ font-family: ${e.font.sans};
24
+ font-size: 15px;
25
+ font-weight: 700;
26
+ color: ${e.colors.text};
27
+ margin: 0 0 10px;
28
+ `,v=s.div`
29
+ display: flex;
30
+ flex-direction: column;
31
+ gap: 12px;
32
+ `,tt=s.div`
33
+ display: grid;
34
+ grid-template-columns: 44px 1fr auto;
35
+ align-items: center;
36
+ gap: 14px;
37
+ padding: 14px 18px;
38
+ background: ${e.colors.white};
39
+ border: 1px solid ${e.colors.line};
40
+ border-radius: 16px;
41
+
42
+ ${e.media.down("mobile")} {
43
+ grid-template-columns: 44px 1fr;
44
+ grid-row-gap: 10px;
45
+ }
46
+ `,it=s.div`
47
+ width: 44px;
48
+ height: 44px;
49
+ border-radius: 10px;
50
+ background: ${e.colors.media};
51
+ overflow: hidden;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ color: ${e.colors.muted2};
56
+
57
+ img {
58
+ width: 100%;
59
+ height: 100%;
60
+ object-fit: contain;
61
+ }
62
+ `,ot=s.div`
63
+ min-width: 0;
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: 3px;
67
+ `,et=s.span`
68
+ font-weight: 700;
69
+ color: ${e.colors.text};
70
+ white-space: nowrap;
71
+ overflow: hidden;
72
+ text-overflow: ellipsis;
73
+ `,st=s.span`
74
+ font-size: 13px;
75
+ color: ${e.colors.muted};
76
+ `,at=s.span`
77
+ font-size: 12px;
78
+ font-weight: 700;
79
+ color: ${e.colors.muted2};
80
+
81
+ &[data-active='true'] {
82
+ color: ${e.colors.okStrong};
83
+ }
84
+ `,nt=s.div`
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 10px;
88
+ justify-self: end;
89
+
90
+ ${e.media.down("mobile")} {
91
+ grid-column: 1 / -1;
92
+ justify-self: start;
93
+ }
94
+ `,rt=s.button`
95
+ position: relative;
96
+ width: 46px;
97
+ height: 26px;
98
+ flex: 0 0 auto;
99
+ border-radius: ${e.radius.pill};
100
+ border: none;
101
+ background: ${e.colors.gray4};
102
+ cursor: pointer;
103
+ transition: background 0.15s;
104
+ padding: 0;
105
+
106
+ &::after {
107
+ content: '';
108
+ position: absolute;
109
+ top: 3px;
110
+ left: 3px;
111
+ width: 20px;
112
+ height: 20px;
113
+ border-radius: 50%;
114
+ background: ${e.colors.white};
115
+ transition: transform 0.15s;
116
+ }
117
+
118
+ &[data-active='true'] {
119
+ background: ${e.colors.accent};
120
+ }
121
+ &[data-active='true']::after {
122
+ transform: translateX(20px);
123
+ }
124
+
125
+ &:disabled {
126
+ cursor: default;
127
+ opacity: 0.6;
128
+ }
129
+
130
+ &:focus-visible {
131
+ outline: 2px solid ${e.colors.accent};
132
+ outline-offset: 2px;
133
+ }
134
+ `,ct=s.span`
135
+ width: 16px;
136
+ height: 16px;
137
+ border-radius: 50%;
138
+ border: 2px solid ${e.colors.gray4};
139
+ border-top-color: ${e.colors.accent};
140
+ animation: ${U} 0.7s linear infinite;
141
+
142
+ @media (prefers-reduced-motion: reduce) {
143
+ animation: none;
144
+ }
145
+ `,$=s.p`
146
+ color: ${e.colors.muted};
147
+ font-size: 14px;
148
+ margin: 0;
149
+ `,k=s.div`
150
+ display: flex;
151
+ flex-direction: column;
152
+ align-items: center;
153
+ gap: 8px;
154
+ text-align: center;
155
+ padding: 90px 20px;
156
+ min-height: 50vh;
157
+ `,C=s.p`
158
+ font-size: 22px;
159
+ font-weight: 700;
160
+ margin: 6px 0 0;
161
+ `,A=s(q)`
162
+ margin-top: 12px;
163
+ `;function T({descriptor:o,owner:r,signer:d,name:a,description:n,image:c,icon:h}){const u=Q(),[g,f]=N.useState(!1),{data:l,isLoading:x,refetch:E}=I({queryKey:["authorization",o.id,r],queryFn:()=>P(o,r),staleTime:3e4});async function S(){if(g||x)return;const p=!l;f(!0);try{await O({auth:o,signer:d,active:p}),await E(),u.setQueryData(["authorization",o.id,r],p),z.success(p?i("authorizations.toastActivated",{name:a}):i("authorizations.toastDeactivated",{name:a}))}catch(y){M(y,{flow:"authorizations",step:p?"grant":"revoke"}),z.error(X(y,i("authorizations.errorGeneric")))}finally{f(!1)}}const R=x?i("authorizations.checking"):l?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(tt,{"data-testid":`authorization-${o.id}`,"data-active":!!l,children:[t.jsx(it,{children:c?t.jsx("img",{src:c,alt:""}):h}),t.jsxs(ot,{children:[t.jsx(et,{title:a,children:a}),t.jsx(st,{children:n})]}),t.jsxs(nt,{children:[t.jsx(at,{"data-active":!!l,children:R}),g?t.jsx(ct,{"aria-label":i("authorizations.working")}):t.jsx(rt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!l,role:"switch","aria-checked":!!l,"aria-label":l?i("authorizations.deactivateAria",{name:a}):i("authorizations.activateAria",{name:a}),disabled:x,onClick:()=>void S()})]})]})}function lt(o){return I({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[r,d]=await Promise.all([j(o,{category:"wearable",first:96}),j(o,{category:"emote",first:96})]),a=new Map;for(const n of[...r.assets,...d.assets]){const c=n.contractAddress.toLowerCase();a.has(c)||a.set(c,n)}return[...a.values()]}})}function jt(){D({title:i("authorizations.title"),noindex:!0});const{session:o,signIn:r}=F(),d=K.chainId,a=G(o==null?void 0:o.providerType),{data:n,isLoading:c}=lt(a?o==null?void 0:o.address:void 0);if(!o)return t.jsxs(k,{children:[t.jsx(m,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(C,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")}),t.jsx(A,{variant:"purple",onClick:()=>r(),children:i("storeSettings.signIn")})]});if(!a)return t.jsxs(k,{children:[t.jsx(m,{name:"check",size:40,color:"var(--ok)"}),t.jsx(C,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(A,{as:L,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const h=W(d);return t.jsxs(V,{children:[t.jsxs(Y,{children:[t.jsx(Z,{children:i("authorizations.title")}),t.jsx(_,{children:i("authorizations.intro")})]}),t.jsxs(w,{children:[t.jsx(b,{children:i("authorizations.buyingTitle")}),t.jsx(v,{children:t.jsx(T,{descriptor:h,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(H,{className:"ccy-mark"})})})]}),t.jsxs(w,{children:[t.jsx(b,{children:i("authorizations.sellingTitle")}),c?t.jsx($,{children:i("authorizations.checking")}):n&&n.length>0?t.jsx(v,{children:n.map(u=>t.jsx(T,{descriptor:J(u.contractAddress,d),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(m,{name:"pen",size:18})},u.contractAddress))}):t.jsx($,{children:i("authorizations.sellingEmpty")})]})]})}export{jt as Authorizations};
@@ -0,0 +1,3 @@
1
+ import{j as e,r as h,u as qe,a as Fe,L as te}from"./react-C51i12iP.js";import{t,C as q,x as V,m as Ae,ad as v,n as me,u as Be,o as Le,a as Ue,b as We,I as T,w as $e,v as ze,j as D,aj as _e,ak as Ke,E as W,s as Qe,B as Oe,e as Ge,h as He,c as ye,al as De,l as pe,k as Je,am as Ve}from"./index-CGNquv7o.js";import{W as Ye,C as Xe,t as Ze,a as es,s as be}from"./CollectionCarousel-DMwkzkYf.js";import{a as ge}from"./buy-Dszi8UeF.js";import{a as ss,w as ts,S as as,G as cs}from"./buy-gasless-Nfp6cMbQ.js";import{R as J,r as rs}from"./cart-checkout-Ba3nMBI0.js";import{g as ns}from"./authorizations-D44lw00X.js";import{u as is,M as ls,c as os}from"./useCreditPacks-DYrmYjK5.js";import{l as ds}from"./loader-logo-BzY9EKdC.js";import{i as us,a as hs}from"./errors-DUo56sGG.js";import{E as ms}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-w5dOkonM.js";import"./intl-CBcMB1D2.js";import"./address-DrURAr9O.js";import"./trade-encoding-2LKm-Goy.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";const _s="https://cdn.decentraland.org/@dcl/shop/0.1.0-29996672089.commit-ce4d282/assets/buy-error-22UunaPC.png";function ys(c){const{phase:n,balanceCredits:u,onClose:m}=c,N=n==="processing",w=n==="error"?t("cartCheckout.errorTitle"):n==="nofunds"?t("cartCheckout.titleNoFunds"):t("cartCheckout.titleBuy"),S=n==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:N?void 0:m,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${S?" 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:w}),!N&&e.jsx("button",{className:"buy-modal__x",onClick:m,"aria-label":t("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:n==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(q,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:V(u)})]})]}),n==="processing"&&e.jsx(ps,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),n==="nofunds"&&e.jsx(bs,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:m}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:_s,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:t("cartCheckout.errorHeadline")})," ",t("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:m,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:c.onRetry??m,children:t("cartCheckout.tryAgain")})]})]})]})]})}function ps({stage:c,step:n,total:u,isSelfCustody:m}){const N=c==="reserving",w=u>0?Math.min(100,Math.round(n/u*100)):0,S=c==="awaiting-signature"?m?t("buyModal.confirmToContinue"):t("buyModal.completingTransaction"):c==="settling"?t("buyModal.completingTransaction"):t("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:ds,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:S}),N?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 buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function bs({lines:c,shortfallCredits:n,packs:u,selectedPack:m,onSelectPack:N,onBuyPacks:w,onCancel:S}){const C=u.find(a=>a.id===m),Y=c.reduce((a,g)=>a+(g.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(Ye,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,n)})})," ",t("buyModal.warningToPurchase",{count:Y})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:c.map(a=>{const g=a.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:a.item.thumbnail?e.jsx("img",{src:a.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:a.item.name,children:[a.item.name||t("buyModal.itemFallback"),g>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:t("cartCheckout.qty",{count:g})}):null]}),a.item.creator?e.jsx(Xe,{address:a.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(q,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:V(a.priceCredits*g)})]})]})]},a.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(a=>{const g=a.id===m;return e.jsxs("button",{className:`buy-modal__pack${g?" buy-modal__pack--on":""}`,onClick:()=>N(a.id),children:[e.jsx(q,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:V(a.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",a.usd.toFixed(2),")"]})]},a.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(q,{className:"buy-modal__total-ico"}),e.jsx("span",{children:V((C==null?void 0:C.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((C==null?void 0:C.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:S,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:t("buyModal.buy")})]})]})}const gs=Qe(Oe)`
2
+ margin-top: 12px;
3
+ `;function fe(c){if(us(c))return t("errors.rejected");const n=(c.message??"").toLowerCase();return n.includes("insufficient")?t("cart.error.insufficient",{currency:Ge.name}):n.includes("no active listing")||n.includes("your own listing")?t("cart.error.listingChanged"):t("marketCheckout.error.generic")}const fs=12e4;function xs(c){const n=[];return c.unavailable.length&&n.push(t("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&n.push(t("cart.drop.own",{count:c.own.length})),t("cart.drop.removed",{items:n.join(` ${t("cart.drop.and")} `)})}const xe=c=>c.reduce((n,u)=>n+u.priceCredits*u.quantity,0),ks=c=>c.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function $s(){Ae({title:t("nav.cart"),noindex:!0});const c=v(s=>s.items),n=v(s=>s.remove),u=v(s=>s.increment),m=v(s=>s.decrement),N=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),C=me(s=>s.items),Y=me(s=>s.toggle),{session:a,signIn:g}=Be(),$=is().packs.slice(0,ls);h.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ke=c.some(s=>s.category!=="emote"),{data:X}=Le({queryKey:["upsell-listings"],queryFn:()=>Ve({first:40}),staleTime:6e4}),{data:F}=Ue(a),z=We(),K=qe(),{state:M}=Fe(),[ae,A]=h.useState(null),[je,B]=h.useState(null),[ce,Q]=h.useState(null),[ve,E]=h.useState(!1),[f,L]=h.useState(null),re=h.useRef(0),[o,k]=h.useState(null),[Z,ne]=h.useState(""),ee=h.useRef(null),Ne=c.reduce((s,r)=>s+r.priceCredits*r.quantity,0),ie=c.reduce((s,r)=>s+r.quantity,0),Ce=f?f.liveTotalCredits:Ne,we=new Set(c.map(s=>s.id)),le=((X==null?void 0:X.items)??[]).filter(s=>!we.has(s.id)).slice(0,12),Se=new Map(f==null?void 0:f.buyable.map(s=>[s.item.id,s])),O=(F==null?void 0:F.credits)??0,Me=Ke;function G(s){s(),L(null),Q(null),B(null)}function Ee(){k(null),E(!1)}function oe(s){const r=xe(s),i=Math.max(0,r-O),y=$.find(d=>d.credits>=i)??$[$.length-1];ne(y.id),D("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:r,credits_balance:O,shortfall:i}),k({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:i}),E(!1)}async function Ie(s){if(!a||s.length===0)return;const r=ks(s),i=r.map(l=>({...l.item,priceCredits:l.priceCredits})),y=s.map(l=>({...l.item,priceCredits:l.priceCredits,quantity:l.quantity})),d=[];let j="authorize",H=!1;k({phase:"processing",stage:"reserving",step:1,total:r.length});try{const l=[];for(let x=0;x<r.length;x++){const R=r[x];k({phase:"processing",stage:"reserving",step:x+1,total:r.length});try{const{credit:_,maxCreditedValue:se}=await He(a.identity,R.usdCents,R.trade.id);d.push(_.id),l.push({trade:R.trade,credits:[_],maxCreditedValue:se})}catch(_){if(hs(_)){if(d.length){try{await ye(a.identity,d)}catch(se){W(se,{flow:"cart_checkout",step:"release"})}z.invalidateQueries({queryKey:["usd-balance"]})}oe(s);return}throw _}}j="submit";const p=()=>k({phase:"processing",stage:"settling",step:r.length,total:r.length});k({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});let b=[];if(ns())try{b=await ss({purchases:l,buyer:a.address,signer:a.signer,onSigned:p});const R=(await Promise.allSettled(b.map(_=>ts(_)))).flatMap(_=>_.status==="rejected"?[_.reason]:[]);if(R.length&&!R.some(_=>_ instanceof as))throw R[0];H=!0}catch(x){if(!(x instanceof cs))throw x;b=await ge({purchases:l,buyer:a.address,signer:a.signer,onSigned:p})}else b=await ge({purchases:l,buyer:a.address,signer:a.signer});s.forEach(x=>n(x.item.id)),L(null),D("Shop Completed Purchase",{...De(i),payment_type:"credits",no_crypto_step:H,transaction_hash:b[0]??null}),z.invalidateQueries({queryKey:["usd-balance"]});const P=ee.current;ee.current=null,k(null),E(!1);const Te={items:y,txHash:b[0]??void 0,settled:!0,...P?{creditsAdded:P}:{}};K("/success",{state:Te,replace:!0})}catch(l){if(pe(l)||W(l,{flow:"cart_checkout",step:j,cart_size:s.length}),D(pe(l)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:Je(l),value_usd:_e(i.reduce((p,b)=>p+b.priceCredits,0)),cart_size:r.length}),d.length){try{await ye(a.identity,d)}catch(p){W(p,{flow:"cart_checkout",step:"release"})}z.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:fe(l)})}}function de(s){const r=xe(s);if(F!=null&&F.credits<r){oe(s);return}Ie(s)}async function U(){if(!a){be({type:"cart-checkout"}),g();return}const s=v.getState().items;if(s.length===0)return;B(null),Q(null),E(!0);const r=s.reduce((i,y)=>i+y.priceCredits*y.quantity,0);D("Shop Started Checkout",{cart_size:s.length,cart_value_credits:r,cart_value_usd:_e(r),has_sufficient_credits:O>=r});try{A(t("cart.status.reviewing"));const i=await rs(s,a.address,Me),y=[...i.unavailable,...i.own];if(y.length&&(y.forEach(d=>n(d.id)),Q(xs(i))),i.buyable.length===0){B(t("cart.error.noneAvailable")),L(null),A(null);return}if(i.orderChanged){L(i),re.current=Date.now(),A(null);return}A(null),de(i.buyable)}catch(i){W(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),B(fe(i)),A(null)}finally{E(!1)}}async function Pe(){if(f){if(!a){be({type:"cart-checkout"}),g();return}if(Date.now()-re.current>fs){L(null),Q(null),await U();return}B(null),de(f.buyable)}}async function Re(){if(Z){try{sessionStorage.setItem(J,JSON.stringify(v.getState().items))}catch{}E(!0);try{const s=await os(Z,a?{address:a.address,identity:a.identity}:void 0);if(s.url){window.location.href=s.url;return}K("/credits")}catch(s){try{sessionStorage.removeItem(J)}catch{}W(s,{flow:"cart_buy_credits"}),k({phase:"error",message:t("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const ue=h.useRef(!1);h.useEffect(()=>{if(!a||ue.current||!Ze("cart-checkout"))return;ue.current=!0;const s=setTimeout(()=>void U(),0);return()=>clearTimeout(s)},[a]);const he=h.useRef(!1);h.useEffect(()=>{if(!(M!=null&&M.resumeCheckout)||he.current)return;he.current=!0,ee.current=M.creditsAdded??null;try{const r=sessionStorage.getItem(J);if(r){sessionStorage.removeItem(J);const i=JSON.parse(r);Array.isArray(i)&&i.length&&w(i)}}catch{}z.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void U(),0);return()=>clearTimeout(s)},[M==null?void 0:M.resumeCheckout]);const I=ve||(o==null?void 0:o.phase)==="processing";return c.length===0&&!o?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(T,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:t("cart.empty.title")}),e.jsx("p",{className:"muted",children:t("cart.empty.body")}),e.jsx(gs,{as:te,to:"/assets",variant:"purple",children:t("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>K(-1),type:"button",children:[e.jsx(T,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>K(-1),type:"button","aria-label":t("cart.goBack"),children:e.jsx(T,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:t("cart.panelTitle",{count:ie})}),ke?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:I,children:[e.jsx(T,{name:"fitting-room"}),t("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:c.map(s=>{const r=Se.get(s.id),i=r?r.priceCredits:s.priceCredits,y=!!r&&r.priceCredits!==s.priceCredits,d=!s.tokenId,j=s.quantity,H=typeof s.available=="number"&&j>=s.available,l=i*j,p=!!C[s.id],b=s.tokenId??s.itemId,P=s.contractAddress&&b?`/item/${s.contractAddress}/${b}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[P?e.jsx(te,{className:"checkout__thumb-link",to:P,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:[P?e.jsx(te,{className:"checkout__name",to:P,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($e,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[d?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>G(()=>m(s.id)),disabled:I||j<=1,"aria-label":t("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:j}),e.jsx("button",{className:"checkout__step",onClick:()=>G(()=>u(s.id)),disabled:I||H,"aria-label":t("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(q,{className:"checkout__price-ico"})," ",l,y?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*j}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${p?" is-on":""}`,onClick:()=>Y(s),"aria-label":p?t("cart.removeFromFavorites",{name:s.name}):t("cart.addToFavorites",{name:s.name}),title:p?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(T,{name:p?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>G(()=>n(s.id)),disabled:I,"aria-label":t("cart.remove",{name:s.name}),title:t("cart.removeTitle"),children:e.jsx(T,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>G(N),disabled:I,children:t("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:t("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:t("cart.totalItems",{count:ie})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(q,{className:"checkout__total-ico"})," ",Ce]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(f?Pe():U()),disabled:I,children:I?t("cart.working"):f?t("marketCheckout.confirmPurchase"):t("assetCard.buyNow")}),a?null:e.jsx("p",{className:"muted checkout__msg",children:t("cart.signInHint")}),f?e.jsx("p",{className:"muted checkout__msg",children:t("cart.priceChanged")}):null,ce?e.jsx("p",{className:"muted checkout__msg",children:ce}):null,ae?e.jsx("p",{className:"muted checkout__msg",children:ae}):null,e.jsx(ms,{message:je,className:"checkout__msg"})]})]})]})]}),le.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(es,{title:t("cart.youMightAlsoLike"),items:le})}):null,o?e.jsx(ys,{phase:o.phase,balanceCredits:O,onClose:Ee,stage:o.phase==="processing"?o.stage:void 0,step:o.phase==="processing"?o.step:void 0,total:o.phase==="processing"?o.total:void 0,isSelfCustody:ze(a==null?void 0:a.providerType),lines:o.phase==="nofunds"?o.lines:void 0,shortfallCredits:o.phase==="nofunds"?o.shortfall:void 0,packs:$,selectedPack:Z,onSelectPack:ne,onBuyPacks:()=>void Re(),message:o.phase==="error"?o.message:void 0,onRetry:()=>void U()}):null]})}export{$s as Cart};
@@ -1,4 +1,4 @@
1
- import{O as N,P as U,Q as w,R as z,S as o,U as E,V as c,W as I,X as g,Y as D,N as R}from"./index-DaOu_NHP.js";import{r as W,j as v}from"./react-BrLDncxD.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,V=R(P||(P=l`
1
+ import{O as N,P as U,Q as w,R as z,S as o,U as E,V as c,W as I,X as g,Y as D,N as R}from"./index-CGNquv7o.js";import{r as W,j as v}from"./react-C51i12iP.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,V=R(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as p,d as Q,a as Y}from"./react-BrLDncxD.js";import{F as N,s as v,al as Z,I as J,t,c as V,E as W,m as X,u as ee,A as ae,ap as te,C as re,aq as se}from"./index-DaOu_NHP.js";import{E as oe}from"./ErrorNotice-BDH9xoG4.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-Bm8Org8q.js";import{u as de}from"./useStore-DBh7zwbY.js";import{s as E}from"./address-DrURAr9O.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-BGNx7jfw.js";import{L as xe}from"./LoadMore-DCZi1YY-.js";import{u as he}from"./useInfiniteGrid-Dh1-HUF4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-BIvjmL85.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
1
+ import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{F as N,s as v,ap as Z,I as J,t,p as V,E as W,o as X,m as ee,A as ae,aq as te,e as re,ar as se}from"./index-CGNquv7o.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DSysxaCY.js";import{u as de}from"./useStore-D1gCXOP_.js";import{s as E}from"./address-DrURAr9O.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-D0iwhqs_.js";import{L as xe}from"./LoadMore-BjvEi3Wj.js";import{u as he}from"./useInfiniteGrid-CDzsfZBu.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-w5dOkonM.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
2
2
  position: relative;
3
3
  border-radius: ${N.radius.card};
4
4
  overflow: hidden;
@@ -42,4 +42,4 @@ import{j as e,r as p,d as Q,a as Y}from"./react-BrLDncxD.js";import{F as N,s as
42
42
  padding: 24px 16px;
43
43
  font-size: 26px;
44
44
  }
45
- `;function ye({name:r,creator:a}){const{data:i}=de(a),n=(i==null?void 0:i.cover)||ie;return e.jsxs(be,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(ve,{children:[e.jsx(fe,{src:n,alt:"",loading:"eager"}),e.jsx(je,{"aria-hidden":!0})]}),e.jsx(Ne,{"data-testid":"collection-hero-title",children:r})]})}function Ce({address:r}){var h,c;const{data:a}=Z(r),[i,n]=p.useState(!1);if(!r)return null;const l=(a==null?void 0:a.name)||E(r),u=(c=(h=a==null?void 0:a.avatar)==null?void 0:h.snapshots)==null?void 0:c.face256,g=`${V.profileUrl}/${r}`,x=ce(ne({name:a==null?void 0:a.name,hasClaimedName:a==null?void 0:a.hasClaimedName,ethAddress:(a==null?void 0:a.ethAddress)??r}));async function d(){try{await navigator.clipboard.writeText(r),n(!0),window.setTimeout(()=>n(!1),1500)}catch(f){W(f,{flow:"copy_creator_address"})}}return e.jsxs("div",{className:"creator-card","data-testid":"creator-card",children:[u?e.jsx("img",{className:"creator-card__ava",src:u,alt:"",loading:"eager",style:{backgroundColor:x}}):e.jsx("span",{className:"creator-card__ava creator-card__ava--ph","aria-hidden":!0,style:{backgroundColor:x}}),e.jsx("h2",{className:"creator-card__name",title:l,children:l}),e.jsxs("button",{type:"button",className:"creator-card__account",onClick:()=>void d(),title:i?t("collection.copied"):t("collection.copyAddress"),"aria-label":i?t("collection.copied"):t("collection.copyAddress"),children:[e.jsx("span",{className:"creator-card__account-text",children:E(r)}),e.jsx(J,{name:"copy",size:16})]}),e.jsx("a",{className:"creator-card__view","data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:t("collection.viewProfile")})]})}const _e=48;function Le(){var T;const{contractAddress:r}=Q(),a=Y(),[i,n]=p.useState("wearable"),[l,u]=p.useState(null),[g,x]=p.useState([]),[d,h]=p.useState(""),[c,f]=p.useState(""),[C,$]=p.useState("newest"),_=d&&!Number.isNaN(Number(d))?Number(d):void 0,w=c&&!Number.isNaN(Number(c))?Number(c):void 0,I=l?ge[l]:void 0,z=(F.find(s=>s.key===C)??F[0]).server,S={category:i,rarities:g.length?g:void 0,wearableCategories:I,minPriceCredits:_,maxPriceCredits:w,sortBy:z},{items:b,total:B,isLoading:j,error:A,hasNextPage:L,isFetchingNextPage:P,fetchNextPage:U}=he(["collection-page",r,S],s=>te(r,{...S,first:_e,skip:s}),{enabled:!!r}),{data:o}=X({queryKey:["collection-meta",r],queryFn:()=>se(r),enabled:!!r,staleTime:5*6e4}),k=(o==null?void 0:o.name)||t("collection.fallbackTitle");ee({title:o==null?void 0:o.name,description:o!=null&&o.name?t("seo.collection.description",{name:o.name}):void 0});const M=(o==null?void 0:o.creator)||((T=b[0])==null?void 0:T.creator);function q(s){n(s),u(null)}function G(s){x(m=>m.includes(s)?m.filter(O=>O!==s):[...m,s])}function H(){n("wearable"),u(null),x([]),h(""),f("")}const y=!!(_||w),K=y?`${d||"0"}–${c||"∞"}`:t("filter.price"),D=i!=="wearable"||!!l||g.length>0||y;return e.jsxs("div",{className:"collection-page","data-testid":"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":t("collection.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>a("/assets"),children:t("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:k})]}),e.jsx(ye,{name:k,creator:M}),e.jsxs("div",{className:"browse browse--sidebar collection-page__browse","data-testid":"browse",children:[e.jsxs("aside",{className:"browse__sidebar","data-testid":"browse-sidebar",children:[e.jsx(Ce,{address:M}),e.jsx(me,{category:i,subCategory:l,onCategory:q,onSub:u,title:t("collection.category"),flat:!0})]}),e.jsxs("div",{className:"browse__main",children:[!j&&b.length>0?e.jsx(le,{items:b,source:"collection"}):null,e.jsx(pe,{rarities:g,onToggleRarity:G,sort:C,onSort:$,total:B,loading:j,anyActive:D,onClear:H,renderTrailing:s=>e.jsx(ue,{panelKey:"price",label:K,active:y,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":t("collection.priceMin"),placeholder:t("collection.priceMinPlaceholder"),value:d,onChange:m=>h(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("collection.priceMax"),placeholder:t("collection.priceMaxPlaceholder"),value:c,onChange:m=>f(m.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:t("collection.priceHint",{currency:re.name})})]})})}),A?e.jsx(oe,{message:t("collection.error")}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:j?e.jsx(R,{count:15}):e.jsxs(e.Fragment,{children:[b.map(s=>e.jsx(ae,{item:s},s.id)),P?e.jsx(R,{count:6}):null]})}),e.jsx(xe,{hasNextPage:L,isFetching:P,onLoadMore:()=>void U()}),!j&&!A&&b.length===0?e.jsx("p",{className:"muted",children:t("collection.empty")}):null]})]})]})}export{Le as Collection,Le as default};
45
+ `;function ye({name:r,creator:a}){const{data:i}=de(a),n=(i==null?void 0:i.cover)||ie;return e.jsxs(be,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(ve,{children:[e.jsx(fe,{src:n,alt:"",loading:"eager"}),e.jsx(je,{"aria-hidden":!0})]}),e.jsx(Ne,{"data-testid":"collection-hero-title",children:r})]})}function _e({address:r}){var h,c;const{data:a}=Z(r),[i,n]=p.useState(!1);if(!r)return null;const l=(a==null?void 0:a.name)||E(r),u=(c=(h=a==null?void 0:a.avatar)==null?void 0:h.snapshots)==null?void 0:c.face256,g=`${V.profileUrl}/${r}`,x=ce(ne({name:a==null?void 0:a.name,hasClaimedName:a==null?void 0:a.hasClaimedName,ethAddress:(a==null?void 0:a.ethAddress)??r}));async function d(){try{await navigator.clipboard.writeText(r),n(!0),window.setTimeout(()=>n(!1),1500)}catch(f){W(f,{flow:"copy_creator_address"})}}return e.jsxs("div",{className:"creator-card","data-testid":"creator-card",children:[u?e.jsx("img",{className:"creator-card__ava",src:u,alt:"",loading:"eager",style:{backgroundColor:x}}):e.jsx("span",{className:"creator-card__ava creator-card__ava--ph","aria-hidden":!0,style:{backgroundColor:x}}),e.jsx("h2",{className:"creator-card__name",title:l,children:l}),e.jsxs("button",{type:"button",className:"creator-card__account",onClick:()=>void d(),title:i?t("collection.copied"):t("collection.copyAddress"),"aria-label":i?t("collection.copied"):t("collection.copyAddress"),children:[e.jsx("span",{className:"creator-card__account-text",children:E(r)}),e.jsx(J,{name:"copy",size:16})]}),e.jsx("a",{className:"creator-card__view","data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:t("collection.viewProfile")})]})}const Ce=48;function Le(){var T;const{contractAddress:r}=Q(),a=Y(),[i,n]=p.useState("wearable"),[l,u]=p.useState(null),[g,x]=p.useState([]),[d,h]=p.useState(""),[c,f]=p.useState(""),[_,$]=p.useState("newest"),C=d&&!Number.isNaN(Number(d))?Number(d):void 0,w=c&&!Number.isNaN(Number(c))?Number(c):void 0,I=l?ge[l]:void 0,z=(F.find(s=>s.key===_)??F[0]).server,S={category:i,rarities:g.length?g:void 0,wearableCategories:I,minPriceCredits:C,maxPriceCredits:w,sortBy:z},{items:b,total:B,isLoading:j,error:A,hasNextPage:L,isFetchingNextPage:P,fetchNextPage:U}=he(["collection-page",r,S],s=>te(r,{...S,first:Ce,skip:s}),{enabled:!!r}),{data:o}=X({queryKey:["collection-meta",r],queryFn:()=>se(r),enabled:!!r,staleTime:5*6e4}),k=(o==null?void 0:o.name)||t("collection.fallbackTitle");ee({title:o==null?void 0:o.name,description:o!=null&&o.name?t("seo.collection.description",{name:o.name}):void 0});const M=(o==null?void 0:o.creator)||((T=b[0])==null?void 0:T.creator);function q(s){n(s),u(null)}function G(s){x(m=>m.includes(s)?m.filter(O=>O!==s):[...m,s])}function H(){n("wearable"),u(null),x([]),h(""),f("")}const y=!!(C||w),K=y?`${d||"0"}–${c||"∞"}`:t("filter.price"),D=i!=="wearable"||!!l||g.length>0||y;return e.jsxs("div",{className:"collection-page","data-testid":"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":t("collection.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>a("/assets"),children:t("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:k})]}),e.jsx(ye,{name:k,creator:M}),e.jsxs("div",{className:"browse browse--sidebar collection-page__browse","data-testid":"browse",children:[e.jsxs("aside",{className:"browse__sidebar","data-testid":"browse-sidebar",children:[e.jsx(_e,{address:M}),e.jsx(me,{category:i,subCategory:l,onCategory:q,onSub:u,title:t("collection.category"),flat:!0})]}),e.jsxs("div",{className:"browse__main",children:[!j&&b.length>0?e.jsx(le,{items:b,source:"collection"}):null,e.jsx(pe,{rarities:g,onToggleRarity:G,sort:_,onSort:$,total:B,loading:j,anyActive:D,onClear:H,renderTrailing:s=>e.jsx(ue,{panelKey:"price",label:K,active:y,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":t("collection.priceMin"),placeholder:t("collection.priceMinPlaceholder"),value:d,onChange:m=>h(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("collection.priceMax"),placeholder:t("collection.priceMaxPlaceholder"),value:c,onChange:m=>f(m.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:t("collection.priceHint",{currency:re.name})})]})})}),A?e.jsx(oe,{message:t("collection.error")}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:j?e.jsx(R,{count:15}):e.jsxs(e.Fragment,{children:[b.map(s=>e.jsx(ae,{item:s},s.id)),P?e.jsx(R,{count:6}):null]})}),e.jsx(xe,{hasNextPage:L,isFetching:P,onLoadMore:()=>void U()}),!j&&!A&&b.length===0?e.jsx("p",{className:"muted",children:t("collection.empty")}):null]})]})]})}export{Le as Collection,Le as default};
@@ -0,0 +1 @@
1
+ import{j as e,r as l}from"./react-C51i12iP.js";import{ap as C,G as N,t as i,I as E,as as x,A as S}from"./index-CGNquv7o.js";import{s as A}from"./address-DrURAr9O.js";const h="shop:resume_after_signin",I=900*1e3;function R(a){try{sessionStorage.setItem(h,JSON.stringify({...a,at:Date.now()}))}catch{}}function P(a){let o;try{o=sessionStorage.getItem(h)}catch{return null}if(!o)return null;try{sessionStorage.removeItem(h)}catch{}let r;try{r=JSON.parse(o)}catch{return null}return!r||r.type!==a||typeof r.at!="number"||Date.now()-r.at>I?null:r.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:r.path}}function z({address:a,className:o}){const{data:r}=C(a),c=r!=null&&r.name?N(r.name):A(a);return e.jsx("div",{className:o,children:i("search.byCreator",{name:c})})}function B({className:a}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:a,children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"#691fa9",strokeWidth:"1.8"}),e.jsx("path",{d:"M12 7v6",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"16.5",r:"1.1",fill:"#691fa9"})]})}function D({title:a,items:o,onViewAll:r}){const c=l.useRef(null),[d,g]=l.useState(1),[m,v]=l.useState(0),[j,k]=l.useState(!0),[w,y]=l.useState(!1),n=l.useCallback(()=>{const s=c.current;if(!s)return;const{scrollLeft:t,scrollWidth:_,clientWidth:u}=s,p=Math.max(1,Math.ceil(_/u));g(p),v(Math.min(p-1,Math.round(t/u))),k(t<=1),y(t+u>=_-1)},[]);if(l.useEffect(()=>{n();const s=c.current;if(s)return s.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{s.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[n,o.length]),o.length===0)return null;function f(s){const t=c.current;t&&t.scrollBy({left:s*t.clientWidth,behavior:"smooth"})}function b(s){const t=c.current;t&&t.scrollTo({left:s*t.clientWidth,behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:a}),r?e.jsxs("button",{className:"collection-carousel__viewall",onClick:r,children:[i("collectionCarousel.viewAll"),e.jsx(E,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),e.jsxs("div",{className:"collection-carousel__viewport",children:[e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>f(-1),"aria-label":i("collectionCarousel.scrollLeft"),disabled:j,children:e.jsx("img",{src:x,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:c,children:o.map(s=>e.jsx(S,{item:s},s.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>f(1),"aria-label":i("collectionCarousel.scrollRight"),disabled:w,children:e.jsx("img",{src:x,alt:"","aria-hidden":!0})})]}),d>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":i("collectionCarousel.pages"),children:Array.from({length:d}).map((s,t)=>e.jsx("button",{className:`collection-carousel__dot${t===m?" is-active":""}`,"aria-label":i("collectionCarousel.goToPage",{page:t+1}),"aria-current":t===m?"true":void 0,onClick:()=>b(t)},t))}):null]})}export{z as C,B as W,D as a,R as s,P as t};
@@ -1 +1 @@
1
- import{p as t}from"./sentry-DYZXk5O5.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
1
+ import{p as t}from"./sentry-DKBoGDXH.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
@@ -1 +1 @@
1
- import{g as ee}from"./react-BrLDncxD.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-CSRkaTCL.js";import{p as N}from"./sentry-DYZXk5O5.js";import{r as ne}from"./browser-ponyfill-CQ0GHmxr.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
1
+ import{g as ee}from"./react-C51i12iP.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-DRB-gQiu.js";import{p as N}from"./sentry-DKBoGDXH.js";import{r as ne}from"./browser-ponyfill-DMgE6PM5.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
@@ -1 +1 @@
1
- import{a as K,j as e,L as re,d as se,b as te,r as j}from"./react-BrLDncxD.js";import{ar as oe,as as ce,h as le,t as a,at as E,B as ne,al as D,d as ie,I,c as de,u as me,A as ue,ak as he,au as ge,C as xe}from"./index-DaOu_NHP.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-Bm8Org8q.js";import{u as be,L as fe}from"./useStore-DBh7zwbY.js";import{s as O}from"./address-DrURAr9O.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-BGNx7jfw.js";import{L as B}from"./LoadMore-DCZi1YY-.js";import{u as R}from"./useInfiniteGrid-Dh1-HUF4.js";import{E as T}from"./ErrorNotice-BDH9xoG4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-BIvjmL85.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function Se({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const ye={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:ye[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(Se,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,z]=j.useState("newest"),S=d&&!Number.isNaN(Number(d))?Number(d):void 0,y=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:S,maxPriceCredits:y,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(S||y),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
1
+ import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-C51i12iP.js";import{at as oe,au as ce,w as le,t as a,av as E,B as ne,ap as D,u as ie,I,p as de,m as me,A as ue,am as he,aw as ge,e as xe}from"./index-CGNquv7o.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-DSysxaCY.js";import{u as be,L as fe}from"./useStore-D1gCXOP_.js";import{s as O}from"./address-DrURAr9O.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-D0iwhqs_.js";import{L as B}from"./LoadMore-BjvEi3Wj.js";import{u as R}from"./useInfiniteGrid-CDzsfZBu.js";import{E as T}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-w5dOkonM.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function Se({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const ye={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:ye[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(Se,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,z]=j.useState("newest"),S=d&&!Number.isNaN(Number(d))?Number(d):void 0,y=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:S,maxPriceCredits:y,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(S||y),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
@@ -1,4 +1,4 @@
1
- import{b9 as U,ba as Ue,S as C,bb as qe,bc as Ye,a0 as Qe,bd as Je,aY as Xe,R as W,b1 as K,b0 as Te,be as a,bf as Ze,bg as Le,T as et,b7 as tt}from"./index-DaOu_NHP.js";import{R as rt,g as ot}from"./getOverlayAlpha-B90Fo_-m.js";import{j as T,r as y}from"./react-BrLDncxD.js";import{u as nt,a as Be}from"./useTheme-ddXkiCRZ.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
1
+ import{be as U,bf as Ue,S as C,bg as qe,bh as Ye,a0 as Qe,bi as Je,aC as Xe,R as W,aH as K,aG as Te,bj as a,bk as Ze,bl as Le,T as et,aN as tt}from"./index-CGNquv7o.js";import{R as rt,g as ot}from"./getOverlayAlpha-Ho14PJoT.js";import{j as T,r as y}from"./react-C51i12iP.js";import{u as nt,a as Be}from"./useTheme-CUwz5NUH.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
2
2
  try {
3
3
  var mode = localStorage.getItem('${s}') || '${o}';
4
4
  var colorScheme = '';
@@ -1,3 +1,3 @@
1
- import{g as M}from"./react-BrLDncxD.js";import{r as O}from"./index-CSRkaTCL.js";import{r as _}from"./dcl-schemas-BICTSpB5.js";function C(u,w){for(var m=0;m<w.length;m++){const f=w[m];if(typeof f!="string"&&!Array.isArray(f)){for(const h in f)if(h!=="default"&&!(h in u)){const v=Object.getOwnPropertyDescriptor(f,h);v&&Object.defineProperty(u,h,v.get?v:{enumerable:!0,get:()=>f[h]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var d={},F;function P(){if(F)return d;F=1,Object.defineProperty(d,"__esModule",{value:!0}),d.getHashesByKey=d.buildEntityWithoutNewFiles=d.buildEntity=d.buildEntityAndFile=void 0;const u=O(),w=_();async function m({type:n,pointers:t,timestamp:e,content:a,metadata:r}){var i;if(t.length===0)throw new Error("All entities must have at least one pointer.");const l={version:"v3",type:n,pointers:t,timestamp:e,content:a,metadata:r};if(a){const s=new Set;for(const b of a){const E=b.file.toLowerCase();if(s.has(E))throw new Error(`Error creating the deployable entity: Decentraland's file system is case insensitive, the file ${JSON.stringify(b.file)} is repeated`);s.add(E)}}const c=new TextEncoder().encode(JSON.stringify(l)),o={id:await(0,u.hashV1)(c),...l};if(!w.Entity.validate(o))throw new Error(`Generated entity is not valid:
1
+ import{g as M}from"./react-C51i12iP.js";import{r as O}from"./index-DRB-gQiu.js";import{r as _}from"./dcl-schemas-BICTSpB5.js";function C(u,w){for(var m=0;m<w.length;m++){const f=w[m];if(typeof f!="string"&&!Array.isArray(f)){for(const h in f)if(h!=="default"&&!(h in u)){const v=Object.getOwnPropertyDescriptor(f,h);v&&Object.defineProperty(u,h,v.get?v:{enumerable:!0,get:()=>f[h]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var d={},F;function P(){if(F)return d;F=1,Object.defineProperty(d,"__esModule",{value:!0}),d.getHashesByKey=d.buildEntityWithoutNewFiles=d.buildEntity=d.buildEntityAndFile=void 0;const u=O(),w=_();async function m({type:n,pointers:t,timestamp:e,content:a,metadata:r}){var i;if(t.length===0)throw new Error("All entities must have at least one pointer.");const l={version:"v3",type:n,pointers:t,timestamp:e,content:a,metadata:r};if(a){const s=new Set;for(const b of a){const E=b.file.toLowerCase();if(s.has(E))throw new Error(`Error creating the deployable entity: Decentraland's file system is case insensitive, the file ${JSON.stringify(b.file)} is repeated`);s.add(E)}}const c=new TextEncoder().encode(JSON.stringify(l)),o={id:await(0,u.hashV1)(c),...l};if(!w.Entity.validate(o))throw new Error(`Generated entity is not valid:
2
2
  `+((i=w.Entity.validate.errors)===null||i===void 0?void 0:i.map(s=>s.message).join(`
3
3
  `)));return{entity:o,entityFile:c}}d.buildEntityAndFile=m;async function f({type:n,pointers:t,files:e,metadata:a,timestamp:r}){const i=Array.from(e||[]).map(([o,s])=>({key:o,content:s})),l=await Promise.all(i.map(async({key:o,content:s})=>({key:o,content:s,hash:await(0,u.hashV1)(s)}))),c=new Map(l.map(({hash:o,key:s})=>[s,o])),y=new Map(l.map(({hash:o,content:s})=>[o,s]));return v(n,t,{hashesByKey:c,filesByHash:y,metadata:a,timestamp:r})}d.buildEntity=f;async function h(n,{contentUrl:t,type:e,pointers:a,hashesByKey:r,metadata:i,timestamp:l}){const c=r??i?p(i):void 0;if(c&&A(e,c)){const y=await D(n,t,c),o=await H(y,i);return f({type:e,pointers:a,files:y,metadata:o,timestamp:l})}return v(e,a,{hashesByKey:r,metadata:i,timestamp:l})}d.buildEntityWithoutNewFiles=h;async function v(n,t,e){if(t.length===0)throw new Error("All entities must have at least one pointer.");const a=e!=null&&e.hashesByKey?e==null?void 0:e.hashesByKey:new Map,r=Array.from(a.entries()).map(([o,s])=>({file:o,hash:s})),i=e!=null&&e.timestamp?e==null?void 0:e.timestamp:Date.now(),{entity:l,entityFile:c}=await m({type:n,pointers:t,timestamp:i,content:r,metadata:e==null?void 0:e.metadata}),y=e!=null&&e.filesByHash?e.filesByHash:new Map;return y.set(l.id,c),{files:y,entityId:l.id}}function A(n,t){return n===w.EntityType.PROFILE&&Array.from(t).some(([,e])=>e.toLowerCase().startsWith("qm"))}async function g(n,t){const a=await(await n.fetch(t)).arrayBuffer();return new Uint8Array(a)}async function D(n,t,e){const a=e.get("body.png"),r=e.get("face256.png"),i=new URL(`${t}/contents/${a}`).toString(),l=new URL(`${t}/contents/${r}`).toString(),[c,y]=await Promise.all([g(n,i),g(n,l)]);return new Map([["body.png",c],["face256.png",y]])}async function H(n,t){return t&&(t.avatars=await Promise.all(t.avatars.map(async e=>{const a={face256:"",body:""},r=n.get("face256.png");r&&(a.face256=await(0,u.hashV1)(r));const i=n.get("body.png");return i&&(a.body=await(0,u.hashV1)(i)),e.avatar.snapshots=a,e})),t)}function p(n){const t=n.avatars[0];if(t.avatar.snapshots)return new Map([["body.png",t.avatar.snapshots.body],["face256.png",t.avatar.snapshots.face256]])}return d.getHashesByKey=p,d}var B=P();const N=M(B),I=C({__proto__:null,default:N},[B]);export{I as D};
@@ -1 +1 @@
1
- import{j as r}from"./react-BrLDncxD.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("svg",{className:"error-notice__ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M12 2 1 21h22L12 2zm0 6a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1zm0 8.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"})}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-C51i12iP.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("svg",{className:"error-notice__ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M12 2 1 21h22L12 2zm0 6a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1zm0 8.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"})}),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-B-iMukUt.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Chep4cKH.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-B8RM0-JJ.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-2Q-POj3l.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1 +1 @@
1
- import{a as $,b as q,r as i,j as e}from"./react-BrLDncxD.js";import{u as H,t as s,d as Q,o as V,x as g,C as d,E as P,y as I,g as W,r as z}from"./index-DaOu_NHP.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-CUI-WqEI.js";import{l as J}from"./loader-logo-BzY9EKdC.js";import{u as Z,p as X,c as ee,i as se}from"./useCreditPacks-CV1PhThV.js";import{C as te}from"./CircularProgress-BmaY3soK.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-BIvjmL85.js";import"./intl-CBcMB1D2.js";const j="https://cdn.decentraland.org/@dcl/shop/0.1.0-29994103056.commit-191afbc/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29994103056.commit-191afbc/assets/credit-coin-CmcTCd5i.webp",ae="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",x=se()?"mock":"stripe",ce={pack_5:j,pack_10:j,pack_25:j,pack_50:j},ne="https://docs.decentraland.org";function M(l){const r=l;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function je(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const l=$(),{session:r,signIn:m}=Q(),n=V(),[N,w]=q(),{packs:F,isLoading:T}=Z(),[p,o]=i.useState("select"),[c,E]=i.useState(null),[R,L]=i.useState(null),[U,h]=i.useState(null),[K,f]=i.useState(!1),b=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=b.current)==null?void 0:t.abort()},[]);const A=i.useCallback(()=>{w(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[w]),y=i.useCallback(async t=>{o("processing");const a=new AbortController;b.current=a;try{const u=await X(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const _=u.creditsGranted??(c==null?void 0:c.credits)??0;L(_>0?_:null),o("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:_>0?_:null,provider:x}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){const k={resumeCheckout:!0,..._>0?{creditsAdded:_}:{}};l("/cart",{state:k});return}}catch{}try{const k=sessionStorage.getItem(G);if(k){sessionStorage.removeItem(G);const C=JSON.parse(k),B=C.tokenId??C.itemId;if(C.contractAddress&&B){l(`/item/${C.contractAddress}/${B}`,{state:{item:C,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),o("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),h(u.error??s("getCredits.errorGrant",{currency:d.name})),o("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),h(M(u)),o("error")}},[c,r,n,l]),O=i.useCallback(async t=>{if(!r){m();return}h(null),f(!1),E(t),o(x==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:x});try{const a=await ee(t.id,{address:r.address,identity:r.identity});if(a.mock)y(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:x}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),h(M(a)),o("error")}},[r,m,y]),v=i.useRef(!1);i.useEffect(()=>{if(v.current)return;const t=N.get("order");if(N.get("canceled")!=null){v.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:x}),A(),f(!0),o("select");return}t&&(o("processing"),r&&(v.current=!0,A(),y(t)))},[N,r]);function S(){var t;(t=b.current)==null||t.abort(),o("select"),E(null),L(null),h(null),f(!1)}const Y=p==="select";return e.jsxs("div",{className:"getcredits",children:[Y&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("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"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:J,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:s("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"})]})]})]}),p==="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:ae,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),R!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:R,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:S,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("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:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:S,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:S,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:l,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:l.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??j,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{je as GetCredits,je as default};
1
+ import{u as $,b as q,r as i,j as e}from"./react-C51i12iP.js";import{m as H,t as s,u as Q,b as V,j as g,e as d,E as P,k as I,C as W,f as z}from"./index-CGNquv7o.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-Ba3nMBI0.js";import{l as J}from"./loader-logo-BzY9EKdC.js";import{u as Z,p as X,c as ee,i as se}from"./useCreditPacks-DYrmYjK5.js";import{C as te}from"./CircularProgress-DvTkhDvC.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-w5dOkonM.js";import"./intl-CBcMB1D2.js";const j="https://cdn.decentraland.org/@dcl/shop/0.1.0-29996672089.commit-ce4d282/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29996672089.commit-ce4d282/assets/credit-coin-CmcTCd5i.webp",ce="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",x=se()?"mock":"stripe",ae={pack_5:j,pack_10:j,pack_25:j,pack_50:j},ne="https://docs.decentraland.org";function M(l){const r=l;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function je(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const l=$(),{session:r,signIn:m}=Q(),n=V(),[N,w]=q(),{packs:F,isLoading:T}=Z(),[p,o]=i.useState("select"),[a,E]=i.useState(null),[R,L]=i.useState(null),[U,h]=i.useState(null),[K,f]=i.useState(!1),b=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=b.current)==null?void 0:t.abort()},[]);const A=i.useCallback(()=>{w(t=>{const c=new URLSearchParams(t);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[w]),y=i.useCallback(async t=>{o("processing");const c=new AbortController;b.current=c;try{const u=await X(t,{signal:c.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const _=u.creditsGranted??(a==null?void 0:a.credits)??0;L(_>0?_:null),o("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(a==null?void 0:a.usd)??null,credits:_>0?_:null,provider:x}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){const k={resumeCheckout:!0,..._>0?{creditsAdded:_}:{}};l("/cart",{state:k});return}}catch{}try{const k=sessionStorage.getItem(G);if(k){sessionStorage.removeItem(G);const C=JSON.parse(k),B=C.tokenId??C.itemId;if(C.contractAddress&&B){l(`/item/${C.contractAddress}/${B}`,{state:{item:C,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),o("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),h(u.error??s("getCredits.errorGrant",{currency:d.name})),o("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(a==null?void 0:a.usd)??null}),h(M(u)),o("error")}},[a,r,n,l]),O=i.useCallback(async t=>{if(!r){m();return}h(null),f(!1),E(t),o(x==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:x});try{const c=await ee(t.id,{address:r.address,identity:r.identity});if(c.mock)y(c.orderId);else if(c.url)g("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){P(c,{flow:"get_credits",step:"checkout",provider:x}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(c),pack_usd:t.usd}),h(M(c)),o("error")}},[r,m,y]),v=i.useRef(!1);i.useEffect(()=>{if(v.current)return;const t=N.get("order");if(N.get("canceled")!=null){v.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:x}),A(),f(!0),o("select");return}t&&(o("processing"),r&&(v.current=!0,A(),y(t)))},[N,r]);function S(){var t;(t=b.current)==null||t.abort(),o("select"),E(null),L(null),h(null),f(!1)}const Y=p==="select";return e.jsxs("div",{className:"getcredits",children:[Y&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("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"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:J,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:s("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"})]})]})]}),p==="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:ce,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),R!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:R,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:S,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("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:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:S,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:S,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:l,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:l.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ae[n.id]??j,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{je as GetCredits,je 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-DnxELmkR.js";import{d as g,r as v}from"./index-Chep4cKH.js";import{C as c}from"./ConstantsUtil-DO6FyoSW.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-B-iMukUt.js";import{au as y}from"./NetworkUtil-BGlQiKvg.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-DcVvVcVQ.js";import{d as g,r as v}from"./index-2Q-POj3l.js";import{C as c}from"./ConstantsUtil-CJUlyS7R.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-B8RM0-JJ.js";import{au as y}from"./NetworkUtil-Xp0fNa8X.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;