@dcl/shop 0.1.0-29941568358.commit-de47e56 → 0.1.0-29942574523.commit-573f25e

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 (228) hide show
  1. package/assets/{AnimatedBackground-cMeJUDnS.js → AnimatedBackground-CzCwcFdY.js} +1 -1
  2. package/assets/{Assets-D4bmQvg2.js → Assets-BTdyC00C.js} +15 -15
  3. package/assets/{Assets.styles-JIZQe0rQ.js → Assets.styles-eeqx94WS.js} +6 -6
  4. package/assets/{Authorizations-Bxum5Ckz.js → Authorizations-BZhmfDD4.js} +3 -3
  5. package/assets/Cart-BicSZMzV.js +3 -0
  6. package/assets/{CircularProgress-DVvK_YYJ.js → CircularProgress-BivMeg1W.js} +4 -4
  7. package/assets/{Collection-CCeBHPqN.js → Collection-DQAOAaC9.js} +1 -1
  8. package/assets/{CollectionCarousel-CfEwak3h.js → CollectionCarousel-D_udpdxX.js} +1 -1
  9. package/assets/{ConstantsUtil-CPwpahR3.js → ConstantsUtil-DO6FyoSW.js} +1 -1
  10. package/assets/{ContentClient-DWUTshFt.js → ContentClient-Xp597FfN.js} +1 -1
  11. package/assets/Creator-X75Qvpr4.js +1 -0
  12. package/assets/{CssVarsProvider-CaTQjQty.js → CssVarsProvider-C0ny30E-.js} +3 -3
  13. package/assets/{DeploymentBuilder-BeZK0qfR.js → DeploymentBuilder-Ba-Y42wz.js} +1 -1
  14. package/assets/{ErrorNotice-DDr3KjIH.js → ErrorNotice-BDH9xoG4.js} +1 -1
  15. package/assets/{ExchangeController-ZePEIh3m.js → ExchangeController-D0l6M3tj.js} +1 -1
  16. package/assets/{GetCredits-BcaMNIRG.js → GetCredits-CMdoboQp.js} +1 -1
  17. package/assets/{HelpersUtil-CRTK_83W.js → HelpersUtil-hamZLlhX.js} +1 -1
  18. package/assets/{ImportListings-9YfzHduB.js → ImportListings-BFIpuuBM.js} +1 -1
  19. package/assets/ItemDetail-C0Sm18Me.js +78 -0
  20. package/assets/{LoadMore-BK9c312B.js → LoadMore-BLy9p9ul.js} +1 -1
  21. package/assets/{MarketCheckout-BxM5rUvM.js → MarketCheckout-DSl7Bl-M.js} +2 -2
  22. package/assets/{MyAssets-BA5zCiVR.js → MyAssets-UFPrjPwu.js} +8 -8
  23. package/assets/{MyFavorites-DWjt5m8Z.js → MyFavorites-Dul-WC6l.js} +1 -1
  24. package/assets/{MyPurchases--MUfwO_U.js → MyPurchases-DI0zzNTZ.js} +1 -1
  25. package/assets/{NetworkUtil-CM7JZPbs.js → NetworkUtil-BGlQiKvg.js} +1 -1
  26. package/assets/{NotFound-DVZ9W5Hr.js → NotFound-Bdg_iIpB.js} +1 -1
  27. package/assets/PrimaryListModal-CnlMOkG5.js +1 -0
  28. package/assets/{StoreSettings-CpeZPPkb.js → StoreSettings-2cViRT0c.js} +8 -8
  29. package/assets/Success-D9l7pr2K.js +4 -0
  30. package/assets/{SwapController-BH4rWo6P.js → SwapController-DKBIcDPA.js} +1 -1
  31. package/assets/{Tooltip-zazDSBbm.js → Tooltip-DJ7HtAmB.js} +1 -1
  32. package/assets/{TradeService-IuqYxWb8.js → TradeService-BpWgN8zg.js} +1 -1
  33. package/assets/{W3MFrameProviderSingleton-CFGfbV9-.js → W3MFrameProviderSingleton-B40OWK0h.js} +3 -3
  34. package/assets/{WebCryptoP256-ByM1YcL4.js → WebCryptoP256-Ccr1DsYO.js} +1 -1
  35. package/assets/{authorizations-CsduRV0X.js → authorizations-sU14ILrd.js} +1 -1
  36. package/assets/{basic-BMJtBJ3f.js → basic-DaSuNoEa.js} +1 -1
  37. package/assets/{biconomy-WqxLiteU.js → biconomy-DmmBzkXG.js} +1 -1
  38. package/assets/{browser-7Z6Tx7yC.js → browser-Cad_aDY9.js} +1 -1
  39. package/assets/{browser-ponyfill-C_hn4Jen.js → browser-ponyfill-CQ0GHmxr.js} +1 -1
  40. package/assets/browser-ponyfill-vZOvKb_B.js +1 -0
  41. package/assets/{buy-CN2rC9a0.js → buy-BRLq1STf.js} +1 -1
  42. package/assets/{buy-gasless-iZXsoGZN.js → buy-gasless-hR2bH0iR.js} +1 -1
  43. package/assets/{cart-checkout-CLMqKMCz.js → cart-checkout-CifIjL1z.js} +1 -1
  44. package/assets/{categories-D7_Qudaw.js → categories-BPU8ySTe.js} +5 -5
  45. package/assets/{ccip-DLXgNS3N.js → ccip-C1DhAmlP.js} +1 -1
  46. package/assets/{ccip-Be5Dn1Zo.js → ccip-pv6qu637.js} +1 -1
  47. package/assets/{chains-DOpzCPsr.js → chains-C1bwVnfj.js} +1 -1
  48. package/assets/{collection-DbmjhyjW.js → collection-DhudRI2A.js} +1 -1
  49. package/assets/{common-BO9A6Obt.js → common-yfho93wI.js} +1 -1
  50. package/assets/{controller-CDv5xjYs.js → controller-DBPpBNi9.js} +2 -2
  51. package/assets/{core-B1vdvz8J.js → core-CftjJZSY.js} +4 -4
  52. package/assets/{custom-3-JWbHeB.js → custom-CLjHEVcz.js} +1 -1
  53. package/assets/{data-capture-B9u0j-_M.js → data-capture-ClKTWWBL.js} +1 -1
  54. package/assets/{decimals-z4vOxece.js → decimals-B36bI5dA.js} +1 -1
  55. package/assets/decimals-BPDUTKfa.js +1 -0
  56. package/assets/{detectExtension-Cvy4AYwr.js → detectExtension-CKplVZ9K.js} +1 -1
  57. package/assets/{email-Bu0wLP5a.js → email-Dx9BSTtw.js} +1 -1
  58. package/assets/{embedded-wallet-DALUv36Z.js → embedded-wallet-CCKNmFwm.js} +1 -1
  59. package/assets/emotion-styled.browser.esm-B6FBNgF3.js +1 -0
  60. package/assets/{engine-COZjF6GN.js → engine-1UaDNb6s.js} +1 -1
  61. package/assets/{errors-BuvqNt2H.js → errors-DKFg2ql0.js} +1 -1
  62. package/assets/estimate-l1-fee-cQM6_GVS.js +1 -0
  63. package/assets/eth_estimateGas-BeErQaun.js +1 -0
  64. package/assets/{eth_getStorageAt-CqeWdstl.js → eth_getStorageAt-C0E8Vng5.js} +1 -1
  65. package/assets/eth_getTransactionCount-kFIWL36y.js +1 -0
  66. package/assets/{ethereum-C3MAoMFC.js → ethereum-C5kfwN9D.js} +1 -1
  67. package/assets/{ethers-Dpp9c5As.js → ethers-CLB2z3On.js} +1 -1
  68. package/assets/{execute-DVE3v1AF.js → execute-BuVfiwvM.js} +2 -2
  69. package/assets/{extractIPFS-HvQvYdM-.js → extractIPFS-CsawLTu6.js} +1 -1
  70. package/assets/{features-CqkOcXXU.js → features-ieqkL6m1.js} +1 -1
  71. package/assets/{fetchTokenMetadata-CZAPbDmS.js → fetchTokenMetadata-D8OWz4cP.js} +2 -2
  72. package/assets/{fortmatic-udOxQk4J.js → fortmatic-DwISA9k4.js} +1 -1
  73. package/assets/{get-bytecode-mfFuNYuc.js → get-bytecode-nwWHW248.js} +1 -1
  74. package/assets/get-ecosystem-wallet-info-LZLHBFVZ.js +1 -0
  75. package/assets/{getBalance-BawNMn6h.js → getBalance-Ck1YHbUL.js} +2 -2
  76. package/assets/{getInstalledModules-BNHlcIGs.js → getInstalledModules-fBSGgSis.js} +1 -1
  77. package/assets/{getNFT-BnfoPCmO.js → getNFT-DYxVn0Et.js} +2 -2
  78. package/assets/getNFT-DnYNAiji.js +1 -0
  79. package/assets/{getOverlayAlpha-DAstUi74.js → getOverlayAlpha-Jb_9sPPd.js} +1 -1
  80. package/assets/{hashTypedData-Cb3dj8Vj.js → hashTypedData-BHOeb4kN.js} +1 -1
  81. package/assets/{hashTypedData-CKhs32SE.js → hashTypedData-Bqz6FRnB.js} +1 -1
  82. package/assets/{import-D2QUSpyp.js → import-CyzZeEcP.js} +1 -1
  83. package/assets/{in-app-wallet-calls-Df8xMcoL.js → in-app-wallet-calls-BJRqCE4k.js} +1 -1
  84. package/assets/{in-app-Dy6198Ub.js → in-app-yMA-tvKO.js} +1 -1
  85. package/assets/{index-D8me2ig5.js → index-0C8jHF02.js} +1 -1
  86. package/assets/{index-BsI3EWcy.js → index-0Z5nkscP.js} +1 -1
  87. package/assets/{index-DoaLV6gK.js → index-3c-o1deN.js} +1 -1
  88. package/assets/{index-BhfJUYAQ.js → index-B2VkMi-_.js} +1 -1
  89. package/assets/{index-CEhWolV_.js → index-B55KertC.js} +1 -1
  90. package/assets/{index-kbFINusp.js → index-B6Hb0r15.js} +1 -1
  91. package/assets/{index-4DPFDe86.js → index-B7YJ2-NC.js} +1 -1
  92. package/assets/{index-DIGUl9iX.js → index-B8PSEU0f.js} +1 -1
  93. package/assets/{index-CRSMETpm.js → index-BEKwTyL9.js} +1 -1
  94. package/assets/{index-cjI3Jxw7.js → index-BEOJi3Jo.js} +1 -1
  95. package/assets/{index-85kWMWjg.js → index-BLpc0PAw.js} +2 -2
  96. package/assets/{index-V1lpWoC-.js → index-BUzglYPe.js} +1 -1
  97. package/assets/{index-Ct22HWuE.js → index-BVjayAtf.js} +1 -1
  98. package/assets/{index-BCWp_6cV.js → index-B_fPkyQt.js} +1 -1
  99. package/assets/{index-BmlDboHr.js → index-Bc63dzBj.js} +3 -3
  100. package/assets/{index-DPTvpJzS.js → index-BgMPhDEY.js} +1 -1
  101. package/assets/{index-Bi4zgWjQ.js → index-BlKccc7B.js} +2 -2
  102. package/assets/{index-CjTTlJEo.js → index-Bn-EvtCB.js} +1 -1
  103. package/assets/{index-B4Jw07i3.js → index-Bxu_HZv7.js} +1 -1
  104. package/assets/{index-DgYBZU4A.js → index-C0MEN305.js} +1 -1
  105. package/assets/{index-BRKyx7oU.js → index-CCr2J09y.js} +2 -2
  106. package/assets/index-CD_HpB6P.js +1 -0
  107. package/assets/{index-V0hMC6mZ.js → index-CJ4mXolB.js} +21 -21
  108. package/assets/{index-D0xvd_Dp.js → index-CO9CUrPm.js} +2 -2
  109. package/assets/{index-rFCcyY0H.js → index-CVG4mg1H.js} +1 -1
  110. package/assets/{index-CaOpng6c.js → index-CWcMLN9O.js} +1 -1
  111. package/assets/{index-Tfh0IyJl.js → index-Cenx9VIL.js} +1 -1
  112. package/assets/{index-C2-W1jZ1.js → index-Chx72aoA.js} +1 -1
  113. package/assets/{index-Cq0eRfqs.js → index-CjBPO58E.js} +1 -1
  114. package/assets/{index-DJVoIGkn.js → index-CnFuk6fK.js} +1 -1
  115. package/assets/{index-FFhK2B90.js → index-CqYieDft.js} +1 -1
  116. package/assets/{index-BA2L6eSl.css → index-CqYr0ABc.css} +1 -1
  117. package/assets/{index-CIfdS8Db.js → index-CstoEHiD.js} +1 -1
  118. package/assets/{index-BpbWCyB4.js → index-CvIOskBU.js} +1 -1
  119. package/assets/{index-B83hIo9e.js → index-D0tMQ_oG.js} +1 -1
  120. package/assets/{index-DP9-yadx.js → index-D18uHh6f.js} +1 -1
  121. package/assets/{index-BPKqBTdV.js → index-DHzasbYL.js} +1 -1
  122. package/assets/{index-B0SpA1TA.js → index-DJEb_i4T.js} +1 -1
  123. package/assets/{index-sN6H-jhd.js → index-DM6cwvvh.js} +1 -1
  124. package/assets/{index-BcuysZka.js → index-DPjEYQhJ.js} +1 -1
  125. package/assets/{index-uTPBgRyq.js → index-DPm2T7me.js} +3 -3
  126. package/assets/{index-Cz1Suly9.js → index-DSbcS8Gm.js} +1 -1
  127. package/assets/{index-BRNsIe3m.js → index-Dc1nvyn9.js} +1 -1
  128. package/assets/{index-DtYBJNaS.js → index-DdAgdwh_.js} +1 -1
  129. package/assets/{index-BlBcCTXj.js → index-Df4qngsG.js} +1 -1
  130. package/assets/{index-CbxN7Krq.js → index-Dil5ESgb.js} +1 -1
  131. package/assets/{index-CQbgtHPx.js → index-DjQcD_Sm.js} +1 -1
  132. package/assets/{index-BDN6djsw.js → index-Dszgr0BR.js} +1 -1
  133. package/assets/{index-DIpMchso.js → index-DwFc8v1Z.js} +1 -1
  134. package/assets/{index-BItUV6PM.js → index-Dx4oKUoK.js} +1 -1
  135. package/assets/{index-DoxUiIoZ.js → index-KyO7a8ne.js} +3 -3
  136. package/assets/{index-CXgtaw1w.js → index-LMkzNUyd.js} +1 -1
  137. package/assets/{index-BIulqLQL.js → index-LQPmlKJw.js} +1 -1
  138. package/assets/{index-CNpvozfL.js → index-O1MAeCt1.js} +1 -1
  139. package/assets/{index-D_Osq35D.js → index-Wkl8TG1w.js} +1 -1
  140. package/assets/{index-C2ZtkYpB.js → index-WrHr3vKs.js} +2 -2
  141. package/assets/{index-CIHaBruC.js → index-YX1mo09T.js} +1 -1
  142. package/assets/{index-cA2ARKGJ.js → index-a_8ZLAR0.js} +1 -1
  143. package/assets/{index-CJRmkopy.js → index-fvb_2ePt.js} +2 -2
  144. package/assets/{index-DPp2bhUs.js → index-mc7xea6T.js} +1 -1
  145. package/assets/{index-Cnmgw5PF.js → index-nmCuLAGG.js} +1 -1
  146. package/assets/{index-CPs7rZSr.js → index-riVFlKIa.js} +1 -1
  147. package/assets/{index-DlvbN_Av.js → index-uESxdvPf.js} +1 -1
  148. package/assets/{index-HRvlJsjj.js → index-xFOezD9a.js} +1 -1
  149. package/assets/{index-BzcxFNUz.js → index-zfsFyt-v.js} +1 -1
  150. package/assets/{index.es-C7FJOZk9.js → index.es-B-uJmNhd.js} +1 -1
  151. package/assets/{index.es-DLc2fyYi.js → index.es-CP2cNM9F.js} +1 -1
  152. package/assets/{index.es-BqAU2pak.js → index.es-Dy8PEmK4.js} +4 -4
  153. package/assets/{linkAccount-Coo42zCf.js → linkAccount-DKoZKguc.js} +1 -1
  154. package/assets/{localBatchGatewayRequest-aE453fG9.js → localBatchGatewayRequest-Dg8trW1f.js} +1 -1
  155. package/assets/{mana-rate-CFrZfrxV.js → mana-rate-DtQ8WpoI.js} +1 -1
  156. package/assets/{native-0dhyeu0o.js → native-t1vLKS11.js} +1 -1
  157. package/assets/{networks-DYw-qqg1.js → networks-BaSDToU0.js} +1 -1
  158. package/assets/{onramp-Dv5XffT1.js → onramp-D6REu-OE.js} +1 -1
  159. package/assets/{openzeppelin-DY9zonpF.js → openzeppelin-DsZ0ZpWh.js} +1 -1
  160. package/assets/{ownerOf-DZ5adWxQ.js → ownerOf-Cl_sRHvA.js} +1 -1
  161. package/assets/{parseNft-BoqFzz1w.js → parseNft-BrwItloF.js} +2 -2
  162. package/assets/{parseSignature-DLqUl44D.js → parseSignature-C67g8Ikn.js} +1 -1
  163. package/assets/{parseSignature-_8ci0C1c.js → parseSignature-CtBPNsAi.js} +3 -3
  164. package/assets/{passkeys-9jKCllXJ.js → passkeys-CkVvpC6F.js} +1 -1
  165. package/assets/{pay-with-exchange-q2w3TOV5.js → pay-with-exchange-DDftQXGa.js} +1 -1
  166. package/assets/{prepare-contract-call-C3igYCn_.js → prepare-contract-call-DmYPUPWz.js} +1 -1
  167. package/assets/{qr-overlay-kE0-Tb5Q.js → qr-overlay-CHyDfEfF.js} +3 -3
  168. package/assets/{react-BMZSDQJw.js → react-BrLDncxD.js} +1 -1
  169. package/assets/{receive-BlDcpWqy.js → receive-BqeMp3_k.js} +1 -1
  170. package/assets/{resolveImplementation-u5UN_seG.js → resolveImplementation-D6GNwvZn.js} +1 -1
  171. package/assets/{rpc-hzBSsIuq.js → rpc-D1wZc4pd.js} +1 -1
  172. package/assets/{secp256k1-DogjvjtS.js → secp256k1-Cu8gqKOi.js} +1 -1
  173. package/assets/{secp256k1-CIm5iUJu.js → secp256k1-DKdkwurr.js} +1 -1
  174. package/assets/{secp256k1-D_XLFIAD.js → secp256k1-tM-HU4Wb.js} +1 -1
  175. package/assets/{send-33Lvo35v.js → send-C5LlTSZw.js} +1 -1
  176. package/assets/{send-batch-transaction-DxqLfBgo.js → send-batch-transaction-2M20mpyd.js} +1 -1
  177. package/assets/{send-eip712-transaction-BWi3gkm3.js → send-eip712-transaction-DxCA-Uwd.js} +2 -2
  178. package/assets/send-gasless-transaction-VjwN2uQK.js +2 -0
  179. package/assets/{send-transaction-DN1HyeTa.js → send-transaction-Bb0Q9hmN.js} +2 -2
  180. package/assets/{sendRawTransaction-DqtJOwfz.js → sendRawTransaction-CED77ONZ.js} +3 -3
  181. package/assets/{sentry-8SzFotJj.js → sentry-DYZXk5O5.js} +1 -1
  182. package/assets/{serializeTransaction-DOUpHqmp.js → serializeTransaction-7yAEy3FU.js} +1 -1
  183. package/assets/{session-proposal-BtkIO7cP.js → session-proposal-DGrkZ9Ix.js} +1 -1
  184. package/assets/{session-request-lsymM3l6.js → session-request-Dg8cFRll.js} +2 -2
  185. package/assets/{sha256-CDuVPJMW.js → sha256-DM_yyL1v.js} +1 -1
  186. package/assets/{signing-Bskb_x4I.js → signing-DuUwyfpZ.js} +3 -3
  187. package/assets/{socials-BrDjbXdD.js → socials-cbGvEEpM.js} +1 -1
  188. package/assets/{swaps-BcWPrBSV.js → swaps-EURvYFti.js} +1 -1
  189. package/assets/{thirdweb-Cpf8EN89.js → thirdweb-D4Tt3SPK.js} +3 -3
  190. package/assets/{to-serializable-transaction-gyjNAfk6.js → to-serializable-transaction-Dh5bAtyQ.js} +2 -2
  191. package/assets/{totalSupply-qMyfSB-2.js → totalSupply-DKYveUeg.js} +1 -1
  192. package/assets/{trade-encoding-vTSEXgN1.js → trade-encoding-0IFZ39Tk.js} +1 -1
  193. package/assets/{transaction-DiMmwD2W.js → transaction-HL8b44XJ.js} +1 -1
  194. package/assets/{transactionReceipt-Bum6hzjL.js → transactionReceipt-DIw9ApVw.js} +1 -1
  195. package/assets/{transactions-D-Z-vxC7.js → transactions-xAqHSp91.js} +1 -1
  196. package/assets/{useCreditPacks-BJp5mEnq.js → useCreditPacks-DO-uyk4N.js} +1 -1
  197. package/assets/{useInfiniteGrid-COXciuKu.js → useInfiniteGrid-BbeLTVdN.js} +1 -1
  198. package/assets/{useStore-cTXMZhwG.js → useStore-PWA7dbNJ.js} +2 -2
  199. package/assets/{useTheme-DmdtRbZb.js → useTheme-BHtz4hyG.js} +1 -1
  200. package/assets/useTheme-Ciqd957r.js +1 -0
  201. package/assets/{utils-DLyVQGg1.js → utils-5mrprTVL.js} +1 -1
  202. package/assets/{verifyHash-DOsO5RNA.js → verifyHash-sv4aRvH_.js} +1 -1
  203. package/assets/{w3m-modal-D1Pu_W_3.js → w3m-modal-BoTSPCYe.js} +1 -1
  204. package/assets/{w3m-modal-oBw-UuhI.js → w3m-modal-D1RMqW5z.js} +1 -1
  205. package/assets/{wait-for-tx-receipt-BYt5Gcy_.js → wait-for-tx-receipt-CnoUxMtV.js} +1 -1
  206. package/assets/{wallets-uu9PjeR0.js → wallets-Cuqbvnoy.js} +5 -5
  207. package/assets/{web-connector-Vwf5Urnw.js → web-connector-0FomZsHS.js} +3 -3
  208. package/assets/{writeContract-iaip-T2H.js → writeContract-Bicvfabo.js} +1 -1
  209. package/assets/{zora-sepolia-sSAsjV_j.js → zora-sepolia-Bef01XwU.js} +1 -1
  210. package/assets/{zoraTestnet-EJHbKpn0.js → zoraTestnet-4QPNkDlh.js} +1 -1
  211. package/index.html +11 -11
  212. package/package.json +2 -2
  213. package/assets/Cart-pFVN5ROM.js +0 -3
  214. package/assets/Creator-DyLgE_Lq.js +0 -1
  215. package/assets/ItemDetail-BSqp8w-l.js +0 -78
  216. package/assets/PrimaryListModal-CQHoY5iG.js +0 -1
  217. package/assets/Success-CxrAGNmd.js +0 -98
  218. package/assets/browser-ponyfill-iWQHRc9C.js +0 -1
  219. package/assets/decimals-8h3d0d0Q.js +0 -1
  220. package/assets/emotion-styled.browser.esm-rI_2ZiJm.js +0 -1
  221. package/assets/estimate-l1-fee-y9SYh7nZ.js +0 -1
  222. package/assets/eth_estimateGas-BhQqpdnq.js +0 -1
  223. package/assets/eth_getTransactionCount-Ca9PbmYY.js +0 -1
  224. package/assets/get-ecosystem-wallet-info-CSMzgHAT.js +0 -1
  225. package/assets/getNFT-yjjewJwo.js +0 -1
  226. package/assets/index-BsYYLNpm.js +0 -1
  227. package/assets/send-gasless-transaction-CC-pEfDw.js +0 -2
  228. package/assets/useTheme-Cv3anIxV.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-BrLDncxD.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o as Qe,k as Ze,a3 as Xe,s,y as t,g as Te,h as Ye,j as ze,am as Ie,J as et,t as o,I as z,l as B,n as pe,q as D,r as tt,v as nt,u as Ne,z as st,A as K,aA as ot,aB as it}from"./index-V0hMC6mZ.js";import{r as rt,a as at,m as Ae}from"./mana-rate-CFrZfrxV.js";import{u as _e,M as lt}from"./MarketCheckout-BxM5rUvM.js";import{g as ct,h as dt,i as ft,j as pt,k as ut,C as xt,l as ht,o as mt,m as gt,n as bt,M as yt}from"./Assets.styles-JIZQe0rQ.js";import{d as ue,R as wt,F as jt,S as xe,b as vt}from"./categories-D7_Qudaw.js";import{L as $t}from"./LoadMore-BK9c312B.js";import{u as Ct}from"./useInfiniteGrid-COXciuKu.js";import{E as kt}from"./ErrorNotice-DDr3KjIH.js";import{d as St}from"./dcl-schemas-BICTSpB5.js";import{u as Rt,G as Et,w as Tt,S as zt}from"./buy-gasless-iZXsoGZN.js";import{s as It}from"./buy-CN2rC9a0.js";import{h as Nt}from"./trade-encoding-vTSEXgN1.js";import{f as At}from"./errors-BuvqNt2H.js";import{J as _t,C as Pt,B as ne}from"./ethers-Dpp9c5As.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-8SzFotJj.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-zazDSBbm.js";import"./authorizations-CsduRV0X.js";function J(n){const i=n.source??"item",f=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${i}:${f}`}const W="100000000000000000000",Pe=2,V=15,Bt=/^[a-zA-Z0-9]+$/;function he(n){const i=n.trim();return i.length===0?{ok:!1,reason:"empty"}:Bt.test(i)?i.length<Pe?{ok:!1,reason:"too-short"}:i.length>V?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Ft(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,V)}const Wt=["function available(string _subdomain) view returns (bool)"],me={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Ht(){return F.chainId===St.ChainId.MATIC_MAINNET?me.mainnet:me.sepolia}async function Ut(n,i={}){var d;const{rpc:f,address:u}=Ht(),l=new _t(f),c=new Pt(u,Wt,l);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const x=await c.available(n);if((d=i.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const Ot="https://app.across.to/api";class Me extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function qt(n){return at(W,n)}async function Gt(n,i,f={}){var d;const u=f.chainId??F.chainId,l=f.provider??"across",c=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${u}&provider=${l}`,x=await Xe(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let a;try{a=(d=await x.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Me:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function Dt(n,i){const f=ne.from(n.availableAmount),l=ne.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:Nt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:W}}async function Vt(n,i={}){const f=Ot,u=i.intervalMs??1e4,l=i.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const d=await fetch(`${f}/deposit/status?originChainId=137&depositTxHash=${n}`);if(d.ok){const a=await d.json(),m=(a.status??"pending").toLowerCase(),w=a.fillTx??a.fillTxnRef??null,y=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:y};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:y}}}catch{}x<l-1&&await new Promise(d=>setTimeout(d,u))}return c}async function Kt(n){const{name:i,identity:f,signer:u}=n,l=n.chainId??F.chainId,c=n.provider??"across",x=(n.beneficiary??await u.getAddress()).toLowerCase();let d=null,a=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:c});try{const m=await rt(l),w=qt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await Gt(f,i,{chainId:l,provider:c});console.info("[names] step 2/6 route fetched",{target:y.externalCall.target,selector:y.externalCall.selector,provider:y.provider,quoteId:y.quoteId});const j=await Qe(f,w);if(d=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ne.from(j.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(j.credit,y);let h;try{h=await Rt({chainId:l,buyer:x,signer:u,args:C})}catch(b){if(!(b instanceof Et))throw b;h=await It(l,C,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:h}),await Tt(h),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:h}),c==="across"){const b=await Vt(h,n.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:h};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:h,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:h}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:i,buyer:x,originConfirmed:a}),m instanceof zt)return{status:"pending",originTxHash:m.txHash};throw d&&!a&&await Ze(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(At(m,"Couldn't register the name. Please try again.",{sale:!0}))}}const Jt=s.div`
1
+ import{a as Ke,r as p,j as e,b as Qe}from"./react-BrLDncxD.js";import{c as F,w as Ze,q as Je,a6 as Xe,s,F as t,d as Te,n as Ye,o as ze,j as Ie,e as et,t as o,I as z,h as B,v as pe,x as D,y as tt,z as nt,u as Ne,G as st,A as K,au as ot,av as it}from"./index-CJ4mXolB.js";import{r as rt,a as at,m as _e}from"./mana-rate-DtQ8WpoI.js";import{u as Ae,M as lt}from"./MarketCheckout-DSl7Bl-M.js";import{g as ct,h as dt,i as ft,j as pt,k as ut,C as xt,l as ht,o as mt,m as gt,n as bt,M as yt}from"./Assets.styles-eeqx94WS.js";import{d as ue,R as wt,F as vt,S as xe,b as jt}from"./categories-BPU8ySTe.js";import{L as $t}from"./LoadMore-BLy9p9ul.js";import{u as Ct}from"./useInfiniteGrid-BbeLTVdN.js";import{E as kt}from"./ErrorNotice-BDH9xoG4.js";import{d as St}from"./dcl-schemas-BICTSpB5.js";import{u as Rt,G as Et,w as Tt,S as zt}from"./buy-gasless-hR2bH0iR.js";import{s as It}from"./buy-BRLq1STf.js";import{h as Nt}from"./trade-encoding-0IFZ39Tk.js";import{f as _t}from"./errors-DKFg2ql0.js";import{J as At,C as Pt,B as ne}from"./ethers-CLB2z3On.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-DYZXk5O5.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-DJ7HtAmB.js";import"./authorizations-sU14ILrd.js";function Q(n){const i=n.source??"item",f=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${i}:${f}`}const W="100000000000000000000",Pe=2,V=15,Bt=/^[a-zA-Z0-9]+$/;function he(n){const i=n.trim();return i.length===0?{ok:!1,reason:"empty"}:Bt.test(i)?i.length<Pe?{ok:!1,reason:"too-short"}:i.length>V?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Ft(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,V)}const Wt=["function available(string _subdomain) view returns (bool)"],me={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Ht(){return F.chainId===St.ChainId.MATIC_MAINNET?me.mainnet:me.sepolia}async function Ut(n,i={}){var d;const{rpc:f,address:u}=Ht(),l=new At(f),c=new Pt(u,Wt,l);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const x=await c.available(n);if((d=i.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const Ot="https://app.across.to/api";class Me extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Gt(n){return at(W,n)}async function qt(n,i,f={}){var d;const u=f.chainId??F.chainId,l=f.provider??"across",c=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${u}&provider=${l}`,x=await Xe(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let a;try{a=(d=await x.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Me:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function Dt(n,i){const f=ne.from(n.availableAmount),l=ne.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:Nt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:W}}async function Vt(n,i={}){const f=Ot,u=i.intervalMs??1e4,l=i.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const d=await fetch(`${f}/deposit/status?originChainId=137&depositTxHash=${n}`);if(d.ok){const a=await d.json(),m=(a.status??"pending").toLowerCase(),w=a.fillTx??a.fillTxnRef??null,y=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:y};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:y}}}catch{}x<l-1&&await new Promise(d=>setTimeout(d,u))}return c}async function Kt(n){const{name:i,identity:f,signer:u}=n,l=n.chainId??F.chainId,c=n.provider??"across",x=(n.beneficiary??await u.getAddress()).toLowerCase();let d=null,a=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:c});try{const m=await rt(l),w=Gt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await qt(f,i,{chainId:l,provider:c});console.info("[names] step 2/6 route fetched",{target:y.externalCall.target,selector:y.externalCall.selector,provider:y.provider,quoteId:y.quoteId});const v=await Ze(f,w);if(d=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),ne.from(v.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(v.credit,y);let h;try{h=await Rt({chainId:l,buyer:x,signer:u,args:C})}catch(b){if(!(b instanceof Et))throw b;h=await It(l,C,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:h}),await Tt(h),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:h}),c==="across"){const b=await Vt(h,n.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:h};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:h,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:h}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:i,buyer:x,originConfirmed:a}),m instanceof zt)return{status:"pending",originTxHash:m.txHash};throw d&&!a&&await Je(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(_t(m,"Couldn't register the name. Please try again.",{sale:!0}))}}const Qt=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -7,7 +7,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
7
7
  justify-content: center;
8
8
  padding: 16px;
9
9
  background: rgba(22, 21, 24, 0.55);
10
- `,Qt=s.div`
10
+ `,Zt=s.div`
11
11
  width: 560px;
12
12
  max-width: 100%;
13
13
  max-height: 92vh;
@@ -69,11 +69,11 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
69
69
  height: 16px;
70
70
  color: ${t.colors.brandViolet};
71
71
  }
72
- `,je=s.hr`
72
+ `,ve=s.hr`
73
73
  border: 0;
74
74
  border-top: 1px solid ${t.colors.line};
75
75
  margin: 16px 0;
76
- `,ve=s.div`
76
+ `,je=s.div`
77
77
  display: flex;
78
78
  align-items: center;
79
79
  gap: 16px;
@@ -127,7 +127,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
127
127
  height: 22px;
128
128
  color: ${t.colors.brandViolet};
129
129
  }
130
- `,Zt=s.div`
130
+ `,Jt=s.div`
131
131
  margin-top: 16px;
132
132
  padding: 16px;
133
133
  border-radius: 12px;
@@ -366,10 +366,10 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
366
366
  flex: none;
367
367
  color: ${t.colors.dclRed};
368
368
  }
369
- `;function bn({name:n,priceCredits:i,onClose:f}){const{session:u}=Te(),{data:l,isError:c}=Ye(u),x=ze(),d=Ke(),[a,m]=p.useState("confirm"),[w,y]=p.useState(""),[j,C]=p.useState(null),h=p.useRef(!1),b=w.trim().toLowerCase()===n.toLowerCase(),v=a==="completing",S=i!=null?Ie(i):"—";p.useEffect(()=>{const g=N=>{N.key==="Escape"&&!v&&f()};document.addEventListener("keydown",g);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=H}},[v,f]);async function k(){if(!(!u||!b||h.current)){h.current=!0,m("completing"),C(null);try{await Kt({name:n,identity:u.identity,signer:u.signer}),D("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),x.invalidateQueries({queryKey:["usd-balance"]}),m("success")}catch(g){D(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),C((g==null?void 0:g.message)||o("names.errorGeneric")),m("error")}finally{h.current=!1}}}const I=a!=="success",R=et(u==null?void 0:u.providerType);return e.jsx(Jt,{onClick:v?void 0:f,role:"presentation",children:e.jsxs(Qt,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[I&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:a==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(ye,{onClick:f,disabled:v,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(je,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ve,{children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(z,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ee,{onClick:()=>m("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Zt,{children:[e.jsx(Xt,{children:o("names.confirmTitle")}),e.jsx(Yt,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${yn(n)}</b>`})}}),e.jsxs(en,{children:[e.jsx(tn,{"aria-hidden":!0,children:"@"}),e.jsx(nn,{value:w,onChange:g=>y(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(sn,{children:".dcl.eth"})]})]}),e.jsx(Ee,{onClick:()=>void k(),disabled:!b||!u,children:o("names.buyCta")})]})]}),a==="completing"&&e.jsxs(on,{children:[e.jsx(rn,{src:Mt,alt:"",width:56,height:56}),e.jsx(an,{children:R?o("names.confirming"):o("names.completing")}),e.jsxs(ln,{children:[e.jsx(cn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(dn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:o("names.successHeaderTitle")}),e.jsx(ye,{onClick:f,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(je,{}),e.jsxs(fn,{children:[e.jsx(pn,{"aria-hidden":!0,children:e.jsx(z,{name:"check"})}),e.jsxs(un,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(ve,{style:{marginTop:20},children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),e.jsxs(xn,{children:[e.jsx(hn,{onClick:()=>{f(),d("/my-assets")},children:o("names.myItems")}),e.jsx(mn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function yn(n){return n.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const wn=s.div`
369
+ `;function bn({name:n,priceCredits:i,onClose:f}){const{session:u}=Te(),{data:l,isError:c}=Ye(u),x=ze(),d=Ke(),[a,m]=p.useState("confirm"),[w,y]=p.useState(""),[v,C]=p.useState(null),h=p.useRef(!1),b=w.trim().toLowerCase()===n.toLowerCase(),j=a==="completing",S=i!=null?Ie(i):"—";p.useEffect(()=>{const g=N=>{N.key==="Escape"&&!j&&f()};document.addEventListener("keydown",g);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=H}},[j,f]);async function k(){if(!(!u||!b||h.current)){h.current=!0,m("completing"),C(null);try{await Kt({name:n,identity:u.identity,signer:u.signer}),D("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),x.invalidateQueries({queryKey:["usd-balance"]}),m("success")}catch(g){D(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),C((g==null?void 0:g.message)||o("names.errorGeneric")),m("error")}finally{h.current=!1}}}const I=a!=="success",R=et(u==null?void 0:u.providerType);return e.jsx(Qt,{onClick:j?void 0:f,role:"presentation",children:e.jsxs(Zt,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[I&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:a==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(ye,{onClick:f,disabled:j,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(je,{children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(z,{name:"info","aria-hidden":!0}),e.jsx("span",{children:v})]}),e.jsx(Ee,{onClick:()=>m("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Jt,{children:[e.jsx(Xt,{children:o("names.confirmTitle")}),e.jsx(Yt,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${yn(n)}</b>`})}}),e.jsxs(en,{children:[e.jsx(tn,{"aria-hidden":!0,children:"@"}),e.jsx(nn,{value:w,onChange:g=>y(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(sn,{children:".dcl.eth"})]})]}),e.jsx(Ee,{onClick:()=>void k(),disabled:!b||!u,children:o("names.buyCta")})]})]}),a==="completing"&&e.jsxs(on,{children:[e.jsx(rn,{src:Mt,alt:"",width:56,height:56}),e.jsx(an,{children:R?o("names.confirming"):o("names.completing")}),e.jsxs(ln,{children:[e.jsx(cn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(dn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:o("names.successHeaderTitle")}),e.jsx(ye,{onClick:f,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(ve,{}),e.jsxs(fn,{children:[e.jsx(pn,{"aria-hidden":!0,children:e.jsx(z,{name:"check"})}),e.jsxs(un,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(je,{style:{marginTop:20},children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),e.jsxs(xn,{children:[e.jsx(hn,{onClick:()=>{f(),d("/my-assets")},children:o("names.myItems")}),e.jsx(mn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function yn(n){return n.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const wn=s.div`
370
370
  width: 100%;
371
371
  min-width: 0;
372
- `,jn=s.nav`
372
+ `,vn=s.nav`
373
373
  display: flex;
374
374
  align-items: center;
375
375
  gap: 6px;
@@ -378,7 +378,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
378
378
  font-size: 12px;
379
379
  line-height: 1;
380
380
  color: ${t.colors.muted};
381
- `,vn=s.button`
381
+ `,jn=s.button`
382
382
  border: 0;
383
383
  background: none;
384
384
  padding: 0;
@@ -491,7 +491,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
491
491
  ${t.media.down("mobile")} {
492
492
  font-size: 16px;
493
493
  }
494
- `,An=s.div`
494
+ `,_n=s.div`
495
495
  position: absolute;
496
496
  top: calc(100% + 8px);
497
497
  left: 0;
@@ -516,7 +516,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
516
516
  align-items: flex-start;
517
517
  flex-wrap: wrap;
518
518
  }
519
- `,_n=s.a`
519
+ `,An=s.a`
520
520
  display: inline-flex;
521
521
  align-items: center;
522
522
  gap: 2px;
@@ -645,7 +645,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
645
645
  width: 16px;
646
646
  height: 16px;
647
647
  }
648
- `,Q=s.div`
648
+ `,Z=s.div`
649
649
  display: flex;
650
650
  align-items: center;
651
651
  gap: 8px;
@@ -686,7 +686,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
686
686
  ${t.media.down("mobile")} {
687
687
  font-size: 22px;
688
688
  }
689
- `,qn=s.div`
689
+ `,Gn=s.div`
690
690
  display: flex;
691
691
  gap: 48px;
692
692
  align-items: stretch;
@@ -695,7 +695,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
695
695
  flex-direction: column;
696
696
  gap: 24px;
697
697
  }
698
- `,Z=s.article`
698
+ `,J=s.article`
699
699
  flex: 1 0 0;
700
700
  min-width: 0;
701
701
  display: flex;
@@ -723,7 +723,7 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
723
723
  font-size: 14px;
724
724
  line-height: 1.57;
725
725
  color: ${t.colors.text};
726
- `,Gn=s.a`
726
+ `,qn=s.a`
727
727
  display: inline-flex;
728
728
  align-items: center;
729
729
  gap: 4px;
@@ -755,4 +755,4 @@ import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o a
755
755
  clip: rect(0, 0, 0, 0);
756
756
  white-space: nowrap;
757
757
  border: 0;
758
- `,Kn="https://docs.decentraland.org/creator/worlds/about/";function Jn(n){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function Qn({onBack:n}){Ne({title:o("seo.names.title"),description:o("seo.names.description")});const{session:i,signIn:f}=Te(),{data:u}=_e(),l=u?Ae(W,u):null,[c,x]=p.useState(""),[d,a]=p.useState("idle"),[m,w]=p.useState(!1),y=p.useRef(null),[j,C]=p.useState(void 0);p.useLayoutEffect(()=>{y.current&&C(y.current.offsetWidth)},[c]),p.useEffect(()=>{if(!he(c).ok){a(c.length===0?"idle":"invalid");return}a("checking");const I=new AbortController,R=setTimeout(()=>{(async()=>{try{const g=await Ut(c,{signal:I.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(R),I.abort()}},[c]);const h=he(c),b=h.ok&&(d==="available"||d==="error");function v(){if(b){if(!i){f();return}w(!0)}}const S=e.jsxs(e.Fragment,{children:[o("names.claim"),l!=null?e.jsxs(Hn,{children:[e.jsx(B,{}),Ie(l)]}):null]});return e.jsxs(wn,{"data-testid":"names-page",children:[e.jsxs(jn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(vn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx($n,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Cn,{children:[e.jsxs(kn,{children:[e.jsxs(Sn,{children:[e.jsx(Rn,{children:o("names.heroTitle")}),e.jsx(En,{children:o("names.heroSubtitle")})]}),e.jsxs(Tn,{children:[e.jsxs(zn,{children:[e.jsxs(In,{invalid:d==="taken",children:[e.jsxs(Pn,{children:[e.jsx(Mn,{"aria-hidden":!0,children:"@"}),e.jsx(Ln,{value:c,onChange:k=>x(Ft(k.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:V,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Nn,{ref:y,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(Bn,{children:o("names.suffix")})]}),c.length>0?e.jsxs(Fn,{"aria-hidden":!0,children:[c.length,"/",V]}):null,e.jsx(Le,{onClick:v,disabled:!b,"data-testid":"names-claim",children:S})]}),d==="taken"?e.jsxs(An,{role:"status","data-testid":"names-taken",children:[e.jsx(z,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(_n,{href:Jn(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(z,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Wn,{onClick:v,disabled:!b,children:S}),d==="checking"?e.jsx(Q,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):d==="error"?e.jsx(Q,{tone:"muted",role:"status",children:o("names.checkError")}):d==="invalid"&&!h.ok&&h.reason==="too-short"?e.jsx(Q,{tone:"muted",role:"status",children:o("names.tooShort",{min:Pe})}):null,e.jsx(Vn,{role:"status","aria-live":"polite",children:d==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(Un,{children:[e.jsx(On,{children:o("names.whyTitle")}),e.jsxs(qn,{children:[e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsx(Y,{children:e.jsx(ee,{children:o("names.why1")})})]}),e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why2")}),e.jsxs(Gn,{href:Kn,target:"_blank",rel:"noopener noreferrer",children:[o("names.why2Link"),e.jsx(z,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why3")}),e.jsx(Dn,{children:o("names.why3Link")})]})]})]})]})]}),m?e.jsx(bn,{name:c,priceCredits:l,onClose:()=>w(!1)}):null]})}const te=48;function Zn(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function ws(){const[n]=Je(),i=(n.get("q")??"").trim().toLowerCase(),f=ze(),u=(n.get("q")??"").trim();Ne({title:u?o("seo.collectibles.searchTitle",{query:u}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[l,c]=p.useState("wearable"),[x,d]=p.useState(null),[a,m]=p.useState([]),[w,y]=p.useState(""),[j,C]=p.useState(""),[h,b]=p.useState("on_sale"),[v,S]=p.useState(!1),[k,I]=p.useState("newest"),[R,g]=p.useState(!1),[H,N]=p.useState(null);p.useEffect(()=>{if(!R)return;const r=L=>{L.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const $=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=$}},[R]);const U=h==="on_sale",A=w&&!Number.isNaN(Number(w))?Number(w):void 0,_=j&&!Number.isNaN(Number(j))?Number(j):void 0,se=x?vt[x]:void 0,oe=(ue.find(r=>r.key===k)??ue[0]).server,ie={category:l,rarities:a.length?a:void 0,wearableCategories:se,minPriceCredits:A,maxPriceCredits:_,search:i||void 0,sortBy:oe,isSmart:v||void 0,onSale:!0},re={category:l,rarities:a.length?a:void 0,wearableCategories:se,search:i||void 0,sortBy:oe,isWearableSmart:v||void 0,isOnSale:h==="not_for_sale"?!1:void 0},{items:P,total:ae,isLoading:E,isPlaceholderData:T,error:Be,hasNextPage:Fe,isFetchingNextPage:le,fetchNextPage:We}=Ct(U?["unified-listings",ie]:["catalog-items",re],r=>U?ot({...ie,first:te,skip:r}):it({...re,first:te,skip:r}),{enabled:l!=="names"}),O=ae,He=E||T,Ue=E?15:Math.min(Math.max(P.length,1),te),{data:q,isError:Oe}=_e(),qe=r=>q&&r.manaWei?Ae(r.manaWei,q):null,ce=p.useRef(null);p.useEffect(()=>{E||T||!i||ce.current===i||(ce.current=i,D("Shop Searched",{query:i,result_count:O}))},[i,E,T,O]);const G=p.useRef("__init__");p.useEffect(()=>{if(E||T)return;const r=JSON.stringify({category:l,subCategory:x,rarities:a,min:A,max:_,sort:k,status:h,smart:v});if(G.current==="__init__"||G.current===r){G.current=r;return}G.current=r,D("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:a,min_price_credits:A??null,max_price_credits:_??null,status:h,smart:v,sort:k},result_count:O})},[l,x,a,A,_,k,h,v,E,T,O]);function de(r){c(r),d(null)}function fe(r){m($=>$.includes(r)?$.filter(L=>L!==r):[...$,r])}function Ge(){c("wearable"),d(null),m([]),y(""),C(""),b("on_sale"),S(!1)}function De(r){const $=P.find(L=>L.id===r.id);$&&$.source==="legacy"&&$.manaWei&&N(Zn($))}function Ve(){f.invalidateQueries({queryKey:["unified-listings"]})}const M=[];(A!=null||_!=null)&&M.push({key:"price",label:o("filter.price"),onRemove:()=>{y(""),C("")}});for(const r of wt)a.includes(r)&&M.push({key:`rarity-${r}`,label:st(r),onRemove:()=>fe(r)});return v&&M.push({key:"smart",label:o("filter.smart"),onRemove:()=>S(!1)}),h!=="on_sale"&&M.push({key:"status",label:h==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ct,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(dt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ft,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(ut,{children:o("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(mt,{category:l,subCategory:x,onCategory:de,onSub:d,priceMin:w,priceMax:j,onPriceMin:y,onPriceMax:C,rarities:a,onToggleRarity:fe,status:h,onStatus:b,smart:v,onSmart:S})}),e.jsx(gt,{children:e.jsx(bt,{type:"button",onClick:()=>g(!1),children:o("assets.showItems")})})]})]}),e.jsx(yt,{children:l==="names"?e.jsx(Qn,{onBack:()=>de("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:k,onSort:I,total:ae,loading:E||T,query:i,onOpenFilters:()=>g(!0),chips:M,onClearChips:Ge}),Oe&&U&&P.some(r=>r.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,Be?e.jsx(kt,{message:o("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:He?e.jsx(xe,{count:Ue}):e.jsxs(e.Fragment,{children:[P.map(r=>{if(!U)return e.jsx(K,{item:r,mode:"view"},J(r));const $=r;return $.source==="legacy"?e.jsx(K,{item:$,mode:"market",marketPriceCredits:qe($),onBuyNow:De},J(r)):e.jsx(K,{item:r},J(r))}),le?e.jsx(xe,{count:6}):null]})}),e.jsx($t,{hasNextPage:Fe,isFetching:le,onLoadMore:()=>void We()}),!E&&!T&&P.length===0?e.jsx("p",{className:"muted",children:o("assets.noItems")}):null]})}),H&&q?e.jsx(lt,{listing:H,rate:q,onClose:()=>N(null),onSold:()=>{N(null),Ve()}}):null]})}export{ws as Assets};
758
+ `,Kn="https://docs.decentraland.org/creator/worlds/about/";function Qn(n){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function Zn({onBack:n}){Ne({title:o("seo.names.title"),description:o("seo.names.description")});const{session:i,signIn:f}=Te(),{data:u}=Ae(),l=u?_e(W,u):null,[c,x]=p.useState(""),[d,a]=p.useState("idle"),[m,w]=p.useState(!1),y=p.useRef(null),[v,C]=p.useState(void 0);p.useLayoutEffect(()=>{y.current&&C(y.current.offsetWidth)},[c]),p.useEffect(()=>{if(!he(c).ok){a(c.length===0?"idle":"invalid");return}a("checking");const I=new AbortController,R=setTimeout(()=>{(async()=>{try{const g=await Ut(c,{signal:I.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(R),I.abort()}},[c]);const h=he(c),b=h.ok&&(d==="available"||d==="error");function j(){if(b){if(!i){f();return}w(!0)}}const S=e.jsxs(e.Fragment,{children:[o("names.claim"),l!=null?e.jsxs(Hn,{children:[e.jsx(B,{}),Ie(l)]}):null]});return e.jsxs(wn,{"data-testid":"names-page",children:[e.jsxs(vn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(jn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx($n,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Cn,{children:[e.jsxs(kn,{children:[e.jsxs(Sn,{children:[e.jsx(Rn,{children:o("names.heroTitle")}),e.jsx(En,{children:o("names.heroSubtitle")})]}),e.jsxs(Tn,{children:[e.jsxs(zn,{children:[e.jsxs(In,{invalid:d==="taken",children:[e.jsxs(Pn,{children:[e.jsx(Mn,{"aria-hidden":!0,children:"@"}),e.jsx(Ln,{value:c,onChange:k=>x(Ft(k.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:V,style:{width:v!=null?`${v}px`:void 0}}),e.jsx(Nn,{ref:y,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(Bn,{children:o("names.suffix")})]}),c.length>0?e.jsxs(Fn,{"aria-hidden":!0,children:[c.length,"/",V]}):null,e.jsx(Le,{onClick:j,disabled:!b,"data-testid":"names-claim",children:S})]}),d==="taken"?e.jsxs(_n,{role:"status","data-testid":"names-taken",children:[e.jsx(z,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(An,{href:Qn(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(z,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Wn,{onClick:j,disabled:!b,children:S}),d==="checking"?e.jsx(Z,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):d==="error"?e.jsx(Z,{tone:"muted",role:"status",children:o("names.checkError")}):d==="invalid"&&!h.ok&&h.reason==="too-short"?e.jsx(Z,{tone:"muted",role:"status",children:o("names.tooShort",{min:Pe})}):null,e.jsx(Vn,{role:"status","aria-live":"polite",children:d==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(Un,{children:[e.jsx(On,{children:o("names.whyTitle")}),e.jsxs(Gn,{children:[e.jsxs(J,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsx(Y,{children:e.jsx(ee,{children:o("names.why1")})})]}),e.jsxs(J,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why2")}),e.jsxs(qn,{href:Kn,target:"_blank",rel:"noopener noreferrer",children:[o("names.why2Link"),e.jsx(z,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(J,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why3")}),e.jsx(Dn,{children:o("names.why3Link")})]})]})]})]})]}),m?e.jsx(bn,{name:c,priceCredits:l,onClose:()=>w(!1)}):null]})}const te=48;function Jn(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function ws(){const[n]=Qe(),i=(n.get("q")??"").trim().toLowerCase(),f=ze(),u=(n.get("q")??"").trim();Ne({title:u?o("seo.collectibles.searchTitle",{query:u}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[l,c]=p.useState("wearable"),[x,d]=p.useState(null),[a,m]=p.useState([]),[w,y]=p.useState(""),[v,C]=p.useState(""),[h,b]=p.useState("on_sale"),[j,S]=p.useState(!1),[k,I]=p.useState("newest"),[R,g]=p.useState(!1),[H,N]=p.useState(null);p.useEffect(()=>{if(!R)return;const r=L=>{L.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const $=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=$}},[R]);const U=h==="on_sale",_=w&&!Number.isNaN(Number(w))?Number(w):void 0,A=v&&!Number.isNaN(Number(v))?Number(v):void 0,se=x?jt[x]:void 0,oe=(ue.find(r=>r.key===k)??ue[0]).server,ie={category:l,rarities:a.length?a:void 0,wearableCategories:se,minPriceCredits:_,maxPriceCredits:A,search:i||void 0,sortBy:oe,isSmart:j||void 0,onSale:!0},re={category:l,rarities:a.length?a:void 0,wearableCategories:se,search:i||void 0,sortBy:oe,isWearableSmart:j||void 0,isOnSale:h==="not_for_sale"?!1:void 0},{items:P,total:ae,isLoading:E,isPlaceholderData:T,error:Be,hasNextPage:Fe,isFetchingNextPage:le,fetchNextPage:We}=Ct(U?["unified-listings",ie]:["catalog-items",re],r=>U?ot({...ie,first:te,skip:r}):it({...re,first:te,skip:r}),{enabled:l!=="names"}),O=ae,He=E||T,Ue=E?15:Math.min(Math.max(P.length,1),te),{data:G,isError:Oe}=Ae(),Ge=r=>G&&r.manaWei?_e(r.manaWei,G):null,ce=p.useRef(null);p.useEffect(()=>{E||T||!i||ce.current===i||(ce.current=i,D("Shop Searched",{query:i,result_count:O}))},[i,E,T,O]);const q=p.useRef("__init__");p.useEffect(()=>{if(E||T)return;const r=JSON.stringify({category:l,subCategory:x,rarities:a,min:_,max:A,sort:k,status:h,smart:j});if(q.current==="__init__"||q.current===r){q.current=r;return}q.current=r,D("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:a,min_price_credits:_??null,max_price_credits:A??null,status:h,smart:j,sort:k},result_count:O})},[l,x,a,_,A,k,h,j,E,T,O]);function de(r){c(r),d(null)}function fe(r){m($=>$.includes(r)?$.filter(L=>L!==r):[...$,r])}function qe(){c("wearable"),d(null),m([]),y(""),C(""),b("on_sale"),S(!1)}function De(r){const $=P.find(L=>L.id===r.id);$&&$.source==="legacy"&&$.manaWei&&N(Jn($))}function Ve(){f.invalidateQueries({queryKey:["unified-listings"]})}const M=[];(_!=null||A!=null)&&M.push({key:"price",label:o("filter.price"),onRemove:()=>{y(""),C("")}});for(const r of wt)a.includes(r)&&M.push({key:`rarity-${r}`,label:st(r),onRemove:()=>fe(r)});return j&&M.push({key:"smart",label:o("filter.smart"),onRemove:()=>S(!1)}),h!=="on_sale"&&M.push({key:"status",label:h==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ct,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(dt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ft,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(ut,{children:o("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(mt,{category:l,subCategory:x,onCategory:de,onSub:d,priceMin:w,priceMax:v,onPriceMin:y,onPriceMax:C,rarities:a,onToggleRarity:fe,status:h,onStatus:b,smart:j,onSmart:S})}),e.jsx(gt,{children:e.jsx(bt,{type:"button",onClick:()=>g(!1),children:o("assets.showItems")})})]})]}),e.jsx(yt,{children:l==="names"?e.jsx(Zn,{onBack:()=>de("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(vt,{sort:k,onSort:I,total:ae,loading:E||T,query:i,onOpenFilters:()=>g(!0),chips:M,onClearChips:qe}),Oe&&U&&P.some(r=>r.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,Be?e.jsx(kt,{message:o("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:He?e.jsx(xe,{count:Ue}):e.jsxs(e.Fragment,{children:[P.map(r=>{if(!U)return e.jsx(K,{item:r,mode:"view"},Q(r));const $=r;return $.source==="legacy"?e.jsx(K,{item:$,mode:"market",marketPriceCredits:Ge($),onBuyNow:De},Q(r)):e.jsx(K,{item:r},Q(r))}),le?e.jsx(xe,{count:6}):null]})}),e.jsx($t,{hasNextPage:Fe,isFetching:le,onLoadMore:()=>void We()}),!E&&!T&&P.length===0?e.jsx("p",{className:"muted",children:o("assets.noItems")}):null]})}),H&&G?e.jsx(lt,{listing:H,rate:G,onClose:()=>N(null),onSold:()=>{N(null),Ve()}}):null]})}export{ws as Assets};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c as se}from"./categories-D7_Qudaw.js";import{T as ne}from"./Tooltip-zazDSBbm.js";import{y as e,s as o,I as u,t as n,z as re,C as v}from"./index-V0hMC6mZ.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
1
+ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c as se}from"./categories-BPU8ySTe.js";import{T as ne}from"./Tooltip-DJ7HtAmB.js";import{F as e,s as o,I as u,t as n,G as re,C as v}from"./index-CJ4mXolB.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;
@@ -367,7 +367,7 @@ import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
367
367
  height: 18px;
368
368
  left: ${({on:i})=>i?"calc(100% - 18px)":"2px"};
369
369
  }
370
- `,d=1e5;function De(i){var l;for(const h of ie){const p=(l=h.subs)==null?void 0:l.find(r=>r.key===i);if(p)return n(p.labelKey)}return i}function k({title:i,open:l,onToggle:h,summary:p,desktopStatic:r,headerTestId:x,headerAria:m,children:f}){const g=t.jsx(se,{up:l,size:24,color:"var(--text)"});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:r,onClick:h,"aria-expanded":l,"aria-label":m,"data-testid":x,children:[t.jsx(de,{children:i}),r?t.jsx(pe,{children:g}):g]}),!l&&p?t.jsx(xe,{desktopHidden:r,children:p}):null,t.jsx(he,{open:l,desktopStatic:r,children:t.jsx(ge,{children:f})})]})}function Ye({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:r,priceMax:x,onPriceMin:m,onPriceMax:f,rarities:g,onToggleRarity:E,status:S,onStatus:_,smart:b,onSmart:L}){const[M,O]=$.useState(!0),[Y,B]=$.useState(!0),[K,W]=$.useState(!1),[G,U]=$.useState(!0),R=r&&!Number.isNaN(Number(r))?Number(r):void 0,C=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=C!=null?Math.min(C,d):d,V=w/d*100,X=y/d*100;function q(s){const a=Math.min(s,y);m(a<=0?"":String(a))}function J(s){const a=Math.max(s,w);f(a>=d?"":String(a))}const Q=l?De(l):i!=="wearable"?n(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||C!=null?`${r||"0"}-${x||"∞"}`:"",ee=z.filter(s=>g.includes(s)).map(re).join(", "),te=S==="on_sale"?n("filter.onSale"):S==="not_for_sale"?n("filter.notForSale"):"";return t.jsxs(ae,{children:[t.jsx(k,{title:n("assets.category"),open:M,onToggle:()=>O(s=>!s),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:h,onSub:p})}),t.jsx(j,{}),t.jsxs(k,{title:n("filter.price"),open:Y,onToggle:()=>B(s=>!s),summary:Z,desktopStatic:!0,children:[t.jsxs(ue,{children:[t.jsxs(T,{children:[t.jsx(N,{children:n("assets.min")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.minPriceAria"),placeholder:"0",value:r,onChange:s=>m(s.target.value)})]})]}),t.jsx(me,{children:n("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(N,{children:n("assets.max")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.maxPriceAria"),placeholder:"0",value:x,onChange:s=>f(s.target.value)})]})]})]}),t.jsxs(fe,{children:[t.jsx(be,{"aria-hidden":!0}),t.jsx(we,{minPct:V,maxPct:X,"aria-hidden":!0}),t.jsx(A,{type:"range",min:0,max:d,value:w,"aria-label":n("assets.minPriceSliderAria"),onChange:s=>q(Number(s.target.value))}),t.jsx(A,{type:"range",min:0,max:d,value:y,"aria-label":n("assets.maxPriceSliderAria"),onChange:s=>J(Number(s.target.value))})]}),t.jsxs(ye,{children:[t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(j,{}),t.jsx(k,{title:n("assets.rarity"),open:K,onToggle:()=>W(s=>!s),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx($e,{"data-testid":"rarity-filter",children:z.map(s=>{const a=g.includes(s);return t.jsxs(ve,{type:"button",selected:a,"aria-pressed":a,onClick:()=>E(s),"data-testid":"rarity-filter-check",children:[t.jsx(je,{color:e.rarities[s],children:a?t.jsx(ke,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:a,children:s})]},s)})})}),t.jsx(j,{}),t.jsx(k,{title:n("filter.status"),open:G,onToggle:()=>U(s=>!s),summary:te,children:[["all",n("filter.statusAll")],["on_sale",n("filter.onSale")],["not_for_sale",n("filter.notForSale")]].map(([s,a])=>t.jsxs(Re,{children:[t.jsx(Ce,{type:"radio",name:"shop-status",checked:S===s,onChange:()=>_(s)}),t.jsx(ze,{children:a})]},s))}),t.jsx(j,{}),t.jsxs(Te,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{name:"smart","aria-hidden":!0}),t.jsx(Fe,{children:n("filter.smart")}),t.jsx(ne,{content:n("filter.smartHint"),placement:"bottom",children:t.jsx(Ie,{name:"info",role:"img","aria-label":n("filter.smartHint"),tabIndex:0})})]}),t.jsx(Ae,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":n("filter.smart"),onClick:()=>L(!b),children:t.jsx(He,{on:b})})]})]})}const Be=o.div`
370
+ `,d=1e5;function De(i){var l;for(const h of ie){const p=(l=h.subs)==null?void 0:l.find(r=>r.key===i);if(p)return n(p.labelKey)}return i}function k({title:i,open:l,onToggle:h,summary:p,desktopStatic:r,headerTestId:x,headerAria:m,children:f}){const g=t.jsx(se,{up:l,size:24,color:"var(--text)"});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:r,onClick:h,"aria-expanded":l,"aria-label":m,"data-testid":x,children:[t.jsx(de,{children:i}),r?t.jsx(pe,{children:g}):g]}),!l&&p?t.jsx(xe,{desktopHidden:r,children:p}):null,t.jsx(he,{open:l,desktopStatic:r,children:t.jsx(ge,{children:f})})]})}function Ye({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:r,priceMax:x,onPriceMin:m,onPriceMax:f,rarities:g,onToggleRarity:E,status:S,onStatus:_,smart:b,onSmart:L}){const[M,O]=$.useState(!0),[Y,B]=$.useState(!0),[G,K]=$.useState(!1),[W,U]=$.useState(!0),R=r&&!Number.isNaN(Number(r))?Number(r):void 0,C=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=C!=null?Math.min(C,d):d,V=w/d*100,X=y/d*100;function q(s){const a=Math.min(s,y);m(a<=0?"":String(a))}function J(s){const a=Math.max(s,w);f(a>=d?"":String(a))}const Q=l?De(l):i!=="wearable"?n(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||C!=null?`${r||"0"}-${x||"∞"}`:"",ee=z.filter(s=>g.includes(s)).map(re).join(", "),te=S==="on_sale"?n("filter.onSale"):S==="not_for_sale"?n("filter.notForSale"):"";return t.jsxs(ae,{children:[t.jsx(k,{title:n("assets.category"),open:M,onToggle:()=>O(s=>!s),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:h,onSub:p})}),t.jsx(j,{}),t.jsxs(k,{title:n("filter.price"),open:Y,onToggle:()=>B(s=>!s),summary:Z,desktopStatic:!0,children:[t.jsxs(ue,{children:[t.jsxs(T,{children:[t.jsx(N,{children:n("assets.min")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.minPriceAria"),placeholder:"0",value:r,onChange:s=>m(s.target.value)})]})]}),t.jsx(me,{children:n("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(N,{children:n("assets.max")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.maxPriceAria"),placeholder:"0",value:x,onChange:s=>f(s.target.value)})]})]})]}),t.jsxs(fe,{children:[t.jsx(be,{"aria-hidden":!0}),t.jsx(we,{minPct:V,maxPct:X,"aria-hidden":!0}),t.jsx(A,{type:"range",min:0,max:d,value:w,"aria-label":n("assets.minPriceSliderAria"),onChange:s=>q(Number(s.target.value))}),t.jsx(A,{type:"range",min:0,max:d,value:y,"aria-label":n("assets.maxPriceSliderAria"),onChange:s=>J(Number(s.target.value))})]}),t.jsxs(ye,{children:[t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(j,{}),t.jsx(k,{title:n("assets.rarity"),open:G,onToggle:()=>K(s=>!s),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx($e,{"data-testid":"rarity-filter",children:z.map(s=>{const a=g.includes(s);return t.jsxs(ve,{type:"button",selected:a,"aria-pressed":a,onClick:()=>E(s),"data-testid":"rarity-filter-check",children:[t.jsx(je,{color:e.rarities[s],children:a?t.jsx(ke,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:a,children:s})]},s)})})}),t.jsx(j,{}),t.jsx(k,{title:n("filter.status"),open:W,onToggle:()=>U(s=>!s),summary:te,children:[["all",n("filter.statusAll")],["on_sale",n("filter.onSale")],["not_for_sale",n("filter.notForSale")]].map(([s,a])=>t.jsxs(Re,{children:[t.jsx(Ce,{type:"radio",name:"shop-status",checked:S===s,onChange:()=>_(s)}),t.jsx(ze,{children:a})]},s))}),t.jsx(j,{}),t.jsxs(Te,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{name:"smart","aria-hidden":!0}),t.jsx(Fe,{children:n("filter.smart")}),t.jsx(ne,{content:n("filter.smartHint"),placement:"bottom",children:t.jsx(Ie,{name:"info",role:"img","aria-label":n("filter.smartHint"),tabIndex:0})})]}),t.jsx(Ae,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":n("filter.smart"),onClick:()=>L(!b),children:t.jsx(He,{on:b})})]})]})}const Be=o.div`
371
371
  position: relative;
372
372
  display: flex;
373
373
  gap: 32px;
@@ -376,14 +376,14 @@ import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
376
376
  ${e.media.down("lg")} {
377
377
  display: block;
378
378
  }
379
- `,Ke=o.div`
379
+ `,Ge=o.div`
380
380
  flex: 1;
381
381
  min-width: 0;
382
382
 
383
383
  ${e.media.down("lg")} {
384
384
  width: 100%;
385
385
  }
386
- `,We=o.aside`
386
+ `,Ke=o.aside`
387
387
  flex: none;
388
388
  width: 265px;
389
389
 
@@ -455,7 +455,7 @@ import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
455
455
  visibility: visible;
456
456
  }
457
457
  }
458
- `,Ge=o.div`
458
+ `,We=o.div`
459
459
  ${e.media.down("lg")} {
460
460
  flex: 1;
461
461
  min-height: 0;
@@ -544,4 +544,4 @@ import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
544
544
  outline: 2px solid ${e.colors.accent};
545
545
  outline-offset: 2px;
546
546
  }
547
- `;export{qe as C,j as D,k as F,Ke as M,$e as R,Re as S,ve as a,je as b,ke as c,Se as d,Ce as e,ze as f,Be as g,Ue as h,We as i,Ve as j,Xe as k,Ge as l,Je as m,Qe as n,Ye as o};
547
+ `;export{qe as C,j as D,k as F,Ge as M,$e as R,Re as S,ve as a,je as b,ke as c,Se as d,Ce as e,ze as f,Be as g,Ue as h,Ke as i,Ve as j,Xe as k,We as l,Je as m,Qe as n,Ye as o};
@@ -1,4 +1,4 @@
1
- import{j as t,L as R,r as D}from"./react-BMZSDQJw.js";import{s as a,B as L,y as e,H as q,u as B,t as i,g as N,J as F,I as x,l as G,e as A,j as H,c as Q,E as y,x as K,D as z}from"./index-V0hMC6mZ.js";import{g as M,a as W,s as J,b as O}from"./authorizations-CsduRV0X.js";import{f as P}from"./errors-BuvqNt2H.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const X=q`
1
+ import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as q,F as e,M as B,u as D,t as i,d as N,e as F,I as x,h as G,m as A,o as H,c as M,J as y,E as Q,H as z}from"./index-CJ4mXolB.js";import{g as K,a as W,s as J,b as O}from"./authorizations-sU14ILrd.js";import{f as P}from"./errors-DKFg2ql0.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const X=B`
2
2
  to { transform: rotate(360deg); }
3
3
  `,U=a.section`
4
4
  width: 100%;
@@ -158,6 +158,6 @@ import{j as t,L as R,r as D}from"./react-BMZSDQJw.js";import{s as a,B as L,y as
158
158
  font-size: 22px;
159
159
  font-weight: 700;
160
160
  margin: 6px 0 0;
161
- `,ct=a(L)`
161
+ `,ct=a(q)`
162
162
  margin-top: 12px;
163
- `;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=D.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){K(f,{flow:"authorizations",step:h?"grant":"revoke"}),y.error(P(f,i("authorizations.errorGeneric")))}finally{g(!1)}}const S=p?i("authorizations.checking"):c?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(_,{"data-testid":`authorization-${o.id}`,"data-active":!!c,children:[t.jsx(tt,{children:r?t.jsx("img",{src:r,alt:""}):u}),t.jsxs(it,{children:[t.jsx(ot,{title:s,children:s}),t.jsx(et,{children:d})]}),t.jsxs(st,{children:[t.jsx(at,{"data-active":!!c,children:S}),m?t.jsx(rt,{"aria-label":i("authorizations.working")}):t.jsx(nt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?i("authorizations.deactivateAria",{name:s}):i("authorizations.activateAria",{name:s}),disabled:p,onClick:()=>void I()})]})]})}function lt(o){return A({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[n,l]=await Promise.all([z(o,{category:"wearable",first:96}),z(o,{category:"emote",first:96})]),s=new Map;for(const d of[...n.assets,...l.assets]){const r=d.contractAddress.toLowerCase();s.has(r)||s.set(r,d)}return[...s.values()]}})}function zt(){B({title:i("authorizations.title"),noindex:!0});const{session:o}=N(),n=Q.chainId,l=F(o==null?void 0:o.providerType),{data:s,isLoading:d}=lt(l?o==null?void 0:o.address:void 0);if(!o)return t.jsxs($,{children:[t.jsx(x,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(k,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")})]});if(!l)return t.jsxs($,{children:[t.jsx(x,{name:"check",size:40,color:"var(--ok)"}),t.jsx(k,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(ct,{as:R,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const r=M(n);return t.jsxs(U,{children:[t.jsxs(V,{children:[t.jsx(Y,{children:i("authorizations.title")}),t.jsx(Z,{children:i("authorizations.intro")})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.buyingTitle")}),t.jsx(b,{children:t.jsx(C,{descriptor:r,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.sellingTitle")}),d?t.jsx(v,{children:i("authorizations.checking")}):s&&s.length>0?t.jsx(b,{children:s.map(u=>t.jsx(C,{descriptor:W(u.contractAddress,n),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(x,{name:"pen",size:18})},u.contractAddress))}):t.jsx(v,{children:i("authorizations.sellingEmpty")})]})]})}export{zt as Authorizations};
163
+ `;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=L.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){Q(f,{flow:"authorizations",step:h?"grant":"revoke"}),y.error(P(f,i("authorizations.errorGeneric")))}finally{g(!1)}}const S=p?i("authorizations.checking"):c?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(_,{"data-testid":`authorization-${o.id}`,"data-active":!!c,children:[t.jsx(tt,{children:r?t.jsx("img",{src:r,alt:""}):u}),t.jsxs(it,{children:[t.jsx(ot,{title:s,children:s}),t.jsx(et,{children:d})]}),t.jsxs(st,{children:[t.jsx(at,{"data-active":!!c,children:S}),m?t.jsx(rt,{"aria-label":i("authorizations.working")}):t.jsx(nt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?i("authorizations.deactivateAria",{name:s}):i("authorizations.activateAria",{name:s}),disabled:p,onClick:()=>void I()})]})]})}function lt(o){return A({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[n,l]=await Promise.all([z(o,{category:"wearable",first:96}),z(o,{category:"emote",first:96})]),s=new Map;for(const d of[...n.assets,...l.assets]){const r=d.contractAddress.toLowerCase();s.has(r)||s.set(r,d)}return[...s.values()]}})}function zt(){D({title:i("authorizations.title"),noindex:!0});const{session:o}=N(),n=M.chainId,l=F(o==null?void 0:o.providerType),{data:s,isLoading:d}=lt(l?o==null?void 0:o.address:void 0);if(!o)return t.jsxs($,{children:[t.jsx(x,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(k,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")})]});if(!l)return t.jsxs($,{children:[t.jsx(x,{name:"check",size:40,color:"var(--ok)"}),t.jsx(k,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(ct,{as:R,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const r=K(n);return t.jsxs(U,{children:[t.jsxs(V,{children:[t.jsx(Y,{children:i("authorizations.title")}),t.jsx(Z,{children:i("authorizations.intro")})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.buyingTitle")}),t.jsx(b,{children:t.jsx(C,{descriptor:r,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.sellingTitle")}),d?t.jsx(v,{children:i("authorizations.checking")}):s&&s.length>0?t.jsx(b,{children:s.map(u=>t.jsx(C,{descriptor:W(u.contractAddress,n),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(x,{name:"pen",size:18})},u.contractAddress))}):t.jsx(v,{children:i("authorizations.sellingEmpty")})]})]})}export{zt as Authorizations};
@@ -0,0 +1,3 @@
1
+ import{j as e,r as f,a as Me,u as Ee,L as Z}from"./react-BrLDncxD.js";import{t as a,h as L,j as H,u as Pe,af as v,a as le,d as qe,m as Te,n as Ie,o as Le,I,g as Fe,e as Be,x as G,ah as de,ai as Re,E as A,s as Ae,B as Ue,C as We,w as ze,q as ue,aj as $e,z as he,y as Qe,ak as Ke}from"./index-CJ4mXolB.js";import{a as me}from"./buy-BRLq1STf.js";import{g as Oe,a as Ge,w as De,S as He,G as Je}from"./buy-gasless-hR2bH0iR.js";import{R as D,r as Ve}from"./cart-checkout-CifIjL1z.js";import{u as Ye,c as Xe}from"./useCreditPacks-DO-uyk4N.js";import{l as Ze}from"./loader-logo-BzY9EKdC.js";import{i as es,a as ss}from"./errors-DKFg2ql0.js";import{E as as}from"./ErrorNotice-BDH9xoG4.js";import{C as ts}from"./CollectionCarousel-D_udpdxX.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./authorizations-sU14ILrd.js";import"./index-HN6Rk25C.js";import"./trade-encoding-0IFZ39Tk.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/buy-error-22UunaPC.png";function cs(r){const{phase:n,balanceCredits:h,onClose:m}=r,C=n==="processing",w=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),S=n==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?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}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:m,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:n==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(L,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:H(h)})]})]}),n==="processing"&&e.jsx(ns,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(is,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.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:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:m,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??m,children:a("cartCheckout.tryAgain")})]})]})]})]})}function ns({stage:r,step:n,total:h,isSelfCustody:m}){const C=r==="reserving",w=h>0?Math.min(100,Math.round(n/h*100)):0,S=r==="awaiting-signature"?m?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:Ze,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:S}),C?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}%`}})}),h>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",h]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function is({lines:r,shortfallCredits:n,packs:h,selectedPack:m,onSelectPack:C,onBuyPacks:w,onCancel:S}){const N=h.find(t=>t.id===m),J=r.reduce((t,_)=>t+(_.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,n)})})," ",a("buyModal.warningToPurchase",{count:J})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const _=t.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:t.item.thumbnail?e.jsx("img",{src:t.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:t.item.name,children:[t.item.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),t.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:t.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(L,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:H(t.priceCredits*_)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:h.map(t=>{const _=t.id===m;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>C(t.id),children:[e.jsx(L,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:H(t.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",t.usd.toFixed(2),")"]})]},t.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(L,{className:"buy-modal__total-ico"}),e.jsx("span",{children:H((N==null?void 0:N.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((N==null?void 0:N.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:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}const os=Ae(Ue)`
2
+ margin-top: 12px;
3
+ `;function _e(r){if(es(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:We.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ls=12e4;function ds(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const ye=r=>r.reduce((n,h)=>n+h.priceCredits*h.quantity,0),us=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function Es(){Pe({title:a("nav.cart"),noindex:!0});const r=v(s=>s.items),n=v(s=>s.remove),h=v(s=>s.increment),m=v(s=>s.decrement),C=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),N=le(s=>s.items),J=le(s=>s.toggle),{session:t}=qe(),_=Ye().packs.slice(0,3);f.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=r.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:F}=Ie(t),U=Le(),W=Me(),{state:T}=Ee(),[ee,B]=f.useState(null),[be,M]=f.useState(null),[se,z]=f.useState(null),[ge,E]=f.useState(!1),[x,R]=f.useState(null),ae=f.useRef(0),[l,k]=f.useState(null),[Y,te]=f.useState(""),fe=r.reduce((s,c)=>s+c.priceCredits*c.quantity,0),re=r.reduce((s,c)=>s+c.quantity,0),xe=x?x.liveTotalCredits:fe,ke=new Set(r.map(s=>s.id)),ce=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),je=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),$=(F==null?void 0:F.credits)??0,ve=Re;function Q(s){s(),R(null),z(null),M(null)}function Ce(){k(null),E(!1)}function ne(s){const c=ye(s),i=Math.max(0,c-$),p=_.find(d=>d.credits>=i)??_[_.length-1];te(p.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:$,shortfall:i}),k({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:i}),E(!1)}async function Ne(s){if(!t||s.length===0)return;const c=us(s),i=c.map(o=>({...o.item,priceCredits:o.priceCredits})),p=s.map(o=>({...o.item,priceCredits:o.priceCredits,quantity:o.quantity})),d=[];let j="authorize",O=!1;k({phase:"processing",stage:"reserving",step:1,total:c.length});try{const o=[];for(let u=0;u<c.length;u++){const q=c[u];k({phase:"processing",stage:"reserving",step:u+1,total:c.length});try{const{credit:y,maxCreditedValue:X}=await ze(t.identity,q.usdCents,q.trade.id);d.push(y.id),o.push({trade:q.trade,credits:[y],maxCreditedValue:X})}catch(y){if(ss(y)){if(d.length){try{await ue(t.identity,d)}catch(X){A(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw y}}j="submit";const b=()=>k({phase:"processing",stage:"settling",step:c.length,total:c.length});k({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let g=[];if(Oe())try{g=await Ge({purchases:o,buyer:t.address,signer:t.signer,onSigned:b});const q=(await Promise.allSettled(g.map(y=>De(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(q.length&&!q.some(y=>y instanceof He))throw q[0];O=!0}catch(u){if(!(u instanceof Je))throw u;g=await me({purchases:o,buyer:t.address,signer:t.signer,onSigned:b})}else g=await me({purchases:o,buyer:t.address,signer:t.signer});s.forEach(u=>n(u.item.id)),R(null),G("Shop Completed Purchase",{...$e(i),payment_type:"credits",no_crypto_step:O,transaction_hash:g[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),k(null),E(!1),W("/success",{state:{items:p,txHash:g[0]??void 0,settled:!0},replace:!0})}catch(o){if(he(o)||A(o,{flow:"cart_checkout",step:j,cart_size:s.length}),G(he(o)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:Qe(o),value_usd:de(i.reduce((b,g)=>b+g.priceCredits,0)),cart_size:c.length}),d.length){try{await ue(t.identity,d)}catch(b){A(b,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:_e(o)})}}function ie(s){const c=ye(s);if(F!=null&&F.credits<c){ne(s);return}Ne(s)}async function K(){if(!t){M(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length===0)return;M(null),z(null),E(!0);const c=s.reduce((i,p)=>i+p.priceCredits*p.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:de(c),has_sufficient_credits:$>=c});try{B(a("cart.status.reviewing"));const i=await Ve(s,t.address,ve),p=[...i.unavailable,...i.own];if(p.length&&(p.forEach(d=>n(d.id)),z(ds(i))),i.buyable.length===0){M(a("cart.error.noneAvailable")),R(null),B(null);return}if(i.orderChanged){R(i),ae.current=Date.now(),B(null);return}B(null),ie(i.buyable)}catch(i){A(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),M(_e(i)),B(null)}finally{E(!1)}}async function we(){if(x){if(!t){M(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>ls){R(null),z(null),await K();return}M(null),ie(x.buyable)}}async function Se(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(v.getState().items))}catch{}E(!0);try{const s=await Xe(Y,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}W("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}A(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const oe=f.useRef(!1);f.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||oe.current)return;oe.current=!0;try{const c=sessionStorage.getItem(D);if(c){sessionStorage.removeItem(D);const i=JSON.parse(c);Array.isArray(i)&&i.length&&w(i)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void K(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const P=ge||(l==null?void 0:l.phase)==="processing";return r.length===0&&!l?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(I,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(os,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>W(-1),type:"button",children:[e.jsx(I,{name:"arrow-left"}),a("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:()=>W(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(I,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:re})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:P,children:[e.jsx(I,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=je.get(s.id),i=c?c.priceCredits:s.priceCredits,p=!!c&&c.priceCredits!==s.priceCredits,d=!s.tokenId,j=s.quantity,O=typeof s.available=="number"&&j>=s.available,o=i*j,b=!!N[s.id],g=s.tokenId??s.itemId,u=s.contractAddress&&g?`/item/${s.contractAddress}/${g}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[u?e.jsx(Z,{className:"checkout__thumb-link",to:u,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:[u?e.jsx(Z,{className:"checkout__name",to:u,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(Fe,{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:()=>Q(()=>m(s.id)),disabled:P||j<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:j}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>h(s.id)),disabled:P||O,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(L,{className:"checkout__price-ico"})," ",o,p?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${b?" is-on":""}`,onClick:()=>J(s),"aria-label":b?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:b?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(I,{name:b?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>n(s.id)),disabled:P,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(I,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>Q(C),disabled:P,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:re})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(L,{className:"checkout__total-ico"})," ",xe]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(x?we():K()),disabled:P,children:P?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),x?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(as,{message:be,className:"checkout__msg"})]})]})]})]}),ce.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ts,{title:a("cart.youMightAlsoLike"),items:ce})}):null,l?e.jsx(cs,{phase:l.phase,balanceCredits:$,onClose:Ce,stage:l.phase==="processing"?l.stage:void 0,step:l.phase==="processing"?l.step:void 0,total:l.phase==="processing"?l.total:void 0,isSelfCustody:Be(t==null?void 0:t.providerType),lines:l.phase==="nofunds"?l.lines:void 0,shortfallCredits:l.phase==="nofunds"?l.shortfall:void 0,packs:_,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Se(),message:l.phase==="error"?l.message:void 0,onRetry:()=>void K()}):null]})}export{Es as Cart};
@@ -1,4 +1,4 @@
1
- import{K as N,L as U,M as w,N as z,O as o,P as E,Q as c,R as I,S as g,U as D,H as M}from"./index-V0hMC6mZ.js";import{r as K,j as v}from"./react-BMZSDQJw.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
1
+ import{N,O as U,P as w,Q as z,R as o,S as E,U as c,V as I,W as g,X as D,M}from"./index-CJ4mXolB.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=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -21,8 +21,8 @@ import{K as N,L as U,M as w,N as z,O as o,P as E,Q as c,R as I,S as g,U as D,H a
21
21
  stroke-dasharray: 100px, 200px;
22
22
  stroke-dashoffset: -125px;
23
23
  }
24
- `)),G=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${c(a)}`],svg:["svg"],circle:["circle",`circle${c(s)}`,d&&"circleDisableShrink"]};return I(u,F,e)},H=g("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${c(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(b||(b=l`
24
+ `)),G=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${c(a)}`],svg:["svg"],circle:["circle",`circle${c(s)}`,d&&"circleDisableShrink"]};return I(u,F,e)},L=g("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${c(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(b||(b=l`
25
25
  animation: ${0} 1.4s linear infinite;
26
- `),W)),O=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Q=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
26
+ `),V)),O=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Q=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
27
27
  animation: ${0} 1.4s ease-in-out infinite;
28
- `),B)),q=K.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,L),n=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=G(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(H,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(O,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(Q,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{q as C};
28
+ `),B)),q=W.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,K),n=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=G(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(L,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(O,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(Q,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{q as C};
@@ -1,4 +1,4 @@
1
- import{j as e,r as p,d as Q,u as Y}from"./react-BMZSDQJw.js";import{y as N,s as v,ac as Z,I as J,t,c as V,x as W,e as X,u as ee,A as ae,au as te,C as re,av as se}from"./index-V0hMC6mZ.js";import{E as oe}from"./ErrorNotice-DDr3KjIH.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DbmjhyjW.js";import{u as de}from"./useStore-cTXMZhwG.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-D7_Qudaw.js";import{L as xe}from"./LoadMore-BK9c312B.js";import{u as he}from"./useInfiniteGrid-COXciuKu.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
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,an as Z,I as J,t,c as V,E as W,m as X,u as ee,A as ae,ao as te,C as re,ap as se}from"./index-CJ4mXolB.js";import{E as oe}from"./ErrorNotice-BDH9xoG4.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DhudRI2A.js";import{u as de}from"./useStore-PWA7dbNJ.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-BPU8ySTe.js";import{L as xe}from"./LoadMore-BLy9p9ul.js";import{u as he}from"./useInfiniteGrid-BbeLTVdN.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.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;
@@ -1 +1 @@
1
- import{r as o,j as t}from"./react-BMZSDQJw.js";import{t as s,I as k,G as f,A as N}from"./index-V0hMC6mZ.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
1
+ import{r as o,j as t}from"./react-BrLDncxD.js";import{t as s,I as k,L as f,A as N}from"./index-CJ4mXolB.js";function A({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{A as C};
@@ -1 +1 @@
1
- import{p as t}from"./sentry-8SzFotJj.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-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 +1 @@
1
- import{g as ee}from"./react-BMZSDQJw.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-V1lpWoC-.js";import{p as N}from"./sentry-8SzFotJj.js";import{r as ne}from"./browser-ponyfill-C_hn4Jen.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-BrLDncxD.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-BUzglYPe.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};
@@ -0,0 +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{aq as oe,ar as ce,g as le,t as a,as as E,B as ne,an as D,d as ie,I,c as de,u as me,A as ue,ak as he,at as ge,C as xe}from"./index-CJ4mXolB.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-DhudRI2A.js";import{u as be,L as fe}from"./useStore-PWA7dbNJ.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-BPU8ySTe.js";import{L as B}from"./LoadMore-BLy9p9ul.js";import{u as R}from"./useInfiniteGrid-BbeLTVdN.js";import{E as T}from"./ErrorNotice-BDH9xoG4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.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:q,isFetchingNextPage:F,fetchNextPage:W}=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 Z(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:Z,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:q,isFetching:F,onLoadMore:()=>void W()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};