@dcl/shop 0.8.1-31008797734.commit-eb2f6cb → 0.8.1-31011914733.commit-0303b0f

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 (234) hide show
  1. package/_assets/{Activity-CapGczIs.js → Activity-DGqf6vtH.js} +5 -5
  2. package/_assets/{AnimatedBackground-1lH1wjHQ.js → AnimatedBackground-DYvwYlNX.js} +2 -2
  3. package/_assets/Assets-BIhyhEpJ.js +801 -0
  4. package/_assets/{Assets.styles-Bt-s2_ut.js → Assets.styles-BEwmRTV4.js} +1 -1
  5. package/_assets/{Authorizations-C49I-wsa.js → Authorizations-CgtzIHfa.js} +3 -3
  6. package/_assets/{Cart-R0jc0Mtq.js → Cart-k3bkiglX.js} +3 -3
  7. package/_assets/{CircularProgress-oGVz5EPN.js → CircularProgress-B7QTjxqg.js} +3 -3
  8. package/_assets/{Collection-BRryMeDA.js → Collection-CIBOTqpS.js} +10 -10
  9. package/_assets/{CollectionCarousel-DeIZf2z7.js → CollectionCarousel-aBELR_tf.js} +14 -14
  10. package/_assets/{ConstantsUtil-Di3dRDAF.js → ConstantsUtil-BkhvNc68.js} +1 -1
  11. package/_assets/{ContentClient-CRr9ZuRH.js → ContentClient-CGWTGqN4.js} +1 -1
  12. package/_assets/Creator-DXbJoM5n.js +306 -0
  13. package/_assets/{DeploymentBuilder-DYNbIRzZ.js → DeploymentBuilder-CFls_09j.js} +1 -1
  14. package/_assets/{ErrorNotice-CaJ4BfpX.js → ErrorNotice-8bHn1hfP.js} +1 -1
  15. package/_assets/{ExchangeController-ylaSPIVN.js → ExchangeController-BV3dQlup.js} +1 -1
  16. package/_assets/{Faq-BlN_im0Z.js → Faq-DNu30-Jv.js} +1 -1
  17. package/_assets/{GetCredits-Bq109qIo.js → GetCredits-9vsaKO2k.js} +19 -19
  18. package/_assets/{Grow-AdrGqCKp.js → Grow-OxzXVVhg.js} +1 -1
  19. package/_assets/{HelpersUtil-DYRUV4ir.js → HelpersUtil-NjrztWi6.js} +1 -1
  20. package/_assets/{ItemDetail-CqPBV2Z6.js → ItemDetail-tYnpUH4x.js} +13 -13
  21. package/_assets/LazyEmoteControls-BW-FF_VV.js +2 -0
  22. package/_assets/{LoadMore-DcFUIXjj.js → LoadMore-CwQ5CTJq.js} +1 -1
  23. package/_assets/{ManaPricingBanner.styles-BO0m_Umj.js → ManaPricingBanner.styles-Bc06axQv.js} +1 -1
  24. package/_assets/{MyAssets-BmFw49q2.js → MyAssets-B0Mjtokt.js} +1 -1
  25. package/_assets/{MyFavorites-6RxzTIj2.js → MyFavorites-Cw_mmcDj.js} +2 -2
  26. package/_assets/{NetworkUtil-EoWQDMpU.js → NetworkUtil-CO-1nCx-.js} +1 -1
  27. package/_assets/{NotFound-B5SrDziU.js → NotFound-An1qy2HJ.js} +1 -1
  28. package/_assets/{NotificationsBell-Da1N_v4W.js → NotificationsBell-DQLaaXFc.js} +1 -1
  29. package/_assets/{OutfitDetail-C9xS5y3b.js → OutfitDetail-BsbdpKHB.js} +15 -15
  30. package/_assets/{OutfitPreview-BavGOcGw.js → OutfitPreview-zqj27b-1.js} +2 -2
  31. package/_assets/{OutfitStudio-DvHI7hY9.js → OutfitStudio-BF3ZInz5.js} +15 -15
  32. package/_assets/{StoreSettings-D59hqgX9.js → StoreSettings-Dsw9PcCY.js} +9 -9
  33. package/_assets/{Success-BgPzwWQz.js → Success-DzSr1ZKs.js} +10 -10
  34. package/_assets/{SwapController-DDxe_vs9.js → SwapController-c0ZMV7-y.js} +1 -1
  35. package/_assets/{Tooltip-DNaztCta.js → Tooltip-AFYoHds5.js} +2 -2
  36. package/_assets/{TradeService-CYH4QAmr.js → TradeService-K7nSBrHI.js} +1 -1
  37. package/_assets/{W3MFrameProviderSingleton-CpPJKj3w.js → W3MFrameProviderSingleton-BvhBpuKR.js} +3 -3
  38. package/_assets/{WebCryptoP256-C2RAff-9.js → WebCryptoP256-uR3swvrR.js} +1 -1
  39. package/_assets/authorizations-D4wI085M.js +1 -0
  40. package/_assets/{basic-CdcRV_KC.js → basic-BPisXakk.js} +1 -1
  41. package/_assets/{biconomy-CJTRSa73.js → biconomy-CvHs_GN7.js} +1 -1
  42. package/_assets/{browser-CqsLPmeb.js → browser-DrmA6_0y.js} +1 -1
  43. package/_assets/{browser-ponyfill-I5CKtKME.js → browser-ponyfill-fSxUcg6c.js} +1 -1
  44. package/_assets/{builder-DvCRptIy.js → builder-CkJrDc5k.js} +1 -1
  45. package/_assets/buy-BeDHfPC-.js +1 -0
  46. package/_assets/{buy-gasless-BfGxYXhk.js → buy-gasless-DINFD15F.js} +1 -1
  47. package/_assets/{categories-BipVdfM3.js → categories-kKk2jGpz.js} +13 -7
  48. package/_assets/{ccip-B45ZUnTU.js → ccip-74NajMIb.js} +1 -1
  49. package/_assets/{ccip-DaSXseHx.js → ccip-Umb7T-xD.js} +1 -1
  50. package/_assets/{chains-DPlhC0Sw.js → chains-BqVOrxrG.js} +1 -1
  51. package/_assets/{collectionPage.styles-cfpY_oN5.js → collectionPage.styles-tZrmrhPT.js} +4 -4
  52. package/_assets/{common-CNwVQ4p9.js → common-CkYiP-7J.js} +1 -1
  53. package/_assets/{controller-lZ2UgMCg.js → controller-DGdZ6Mn-.js} +2 -2
  54. package/_assets/{core-BaJayjCH.js → core-CNlDVTsP.js} +4 -4
  55. package/_assets/{createSvgIcon-DF7XmQgC.js → createSvgIcon-Ce14xVZm.js} +4 -4
  56. package/_assets/{custom-DHI2SWZb.js → custom-Dv8Lo1kL.js} +1 -1
  57. package/_assets/{data-capture-DRojwyQm.js → data-capture-5ClKTSe8.js} +1 -1
  58. package/_assets/decimals-DO67KSdi.js +1 -0
  59. package/_assets/{decimals-B3pg7hp8.js → decimals-DyjR4aoq.js} +1 -1
  60. package/_assets/{detectExtension-DEjVJeUh.js → detectExtension-DWfhzRDC.js} +1 -1
  61. package/_assets/{disposePreview-B96DpOZy.js → disposePreview-flulL6RX.js} +1 -1
  62. package/_assets/{email-DbjLMCR0.js → email-CiIvohkt.js} +1 -1
  63. package/_assets/{embedded-wallet-s2SLkWS-.js → embedded-wallet-Cv54Jked.js} +1 -1
  64. package/_assets/{emotion-styled.browser.esm-BvuB9FLv.js → emotion-styled.browser.esm-BDjD0BzD.js} +1 -1
  65. package/_assets/{engine-C8CwR5vD.js → engine-BSj9q-aH.js} +1 -1
  66. package/_assets/errors-COaDYYX2.js +1 -0
  67. package/_assets/estimate-l1-fee-6I-Z51za.js +1 -0
  68. package/_assets/eth_estimateGas-CZdRIIy4.js +1 -0
  69. package/_assets/{eth_getStorageAt-BUYdIAYw.js → eth_getStorageAt-C4Yqzc5m.js} +1 -1
  70. package/_assets/eth_getTransactionCount-W_BA_-db.js +1 -0
  71. package/_assets/{ethereum-CliiIOgc.js → ethereum-DFU7Vz3W.js} +1 -1
  72. package/_assets/{ethers-DejfrZ8i.js → ethers-lk3HAbPB.js} +1 -1
  73. package/_assets/{execute-DfFT0VMF.js → execute-B6hfBxSa.js} +2 -2
  74. package/_assets/{extractIPFS-CUaS-9Rs.js → extractIPFS-DzfSqAlh.js} +1 -1
  75. package/_assets/{features-B4j4EiIm.js → features-BJpZyJij.js} +1 -1
  76. package/_assets/{fetchTokenMetadata-JvX58EZZ.js → fetchTokenMetadata-ARrwD89L.js} +2 -2
  77. package/_assets/{field.styles-DT9c-jpk.js → field.styles-BjYlzCrg.js} +1 -1
  78. package/_assets/{fortmatic-EI5cNLV0.js → fortmatic-9W3d2zrH.js} +1 -1
  79. package/_assets/{get-bytecode-knYex1Eu.js → get-bytecode-BsB9WanS.js} +1 -1
  80. package/_assets/get-ecosystem-wallet-info-9HmWzdfL.js +1 -0
  81. package/_assets/{getBalance-C7PDKGyV.js → getBalance-32RCC6W6.js} +2 -2
  82. package/_assets/{getInstalledModules-tywfzr6y.js → getInstalledModules-BE5-ES5I.js} +1 -1
  83. package/_assets/{getNFT-unPO0gFo.js → getNFT-Bdzdl0tm.js} +2 -2
  84. package/_assets/getNFT-Bvh35NBt.js +1 -0
  85. package/_assets/{grid.styles--OULZO8_.js → grid.styles-C5FdGoZt.js} +1 -1
  86. package/_assets/{hashTypedData-BFsuXzQL.js → hashTypedData-C1J-Yu5X.js} +1 -1
  87. package/_assets/{hashTypedData-kUbQfEXm.js → hashTypedData-Cd2jo0fu.js} +1 -1
  88. package/_assets/{in-app-DWfmO8Q_.js → in-app-B12bHXEw.js} +1 -1
  89. package/_assets/{in-app-wallet-calls-8wNNNyL8.js → in-app-wallet-calls-C6NnLiF5.js} +1 -1
  90. package/_assets/{index-CO7DPL5n.js → index--Ye27Vx_.js} +1 -1
  91. package/_assets/{index-B21P_cdc.js → index-0XvBS5zv.js} +1 -1
  92. package/_assets/index-3QPqSkja.js +1 -0
  93. package/_assets/{index-CSlo2BeJ.js → index-7vaOJntM.js} +1 -1
  94. package/_assets/{index-DKNHcW37.js → index-9Q-G51o6.js} +1 -1
  95. package/_assets/{index-BpqWJGbO.js → index-B01yzeQ8.js} +1 -1
  96. package/_assets/{index-gtKOmjie.js → index-B0AXM_VY.js} +1 -1
  97. package/_assets/{index-L36hhrTC.js → index-B0Nj1Xpe.js} +1 -1
  98. package/_assets/{index-CHeOAb8t.js → index-B984MHyM.js} +1 -1
  99. package/_assets/{index-DEixw9nt.js → index-B9aOPYnq.js} +2 -2
  100. package/_assets/{index-D4g9OvJl.js → index-BFBo1N5P.js} +1 -1
  101. package/_assets/{index-B5V2Mfv7.js → index-BHNHvbUP.js} +1 -1
  102. package/_assets/{index-DrfYWb8y.js → index-BQE4xPAY.js} +1 -1
  103. package/_assets/{index-BSytKqYf.js → index-BRh_MAtG.js} +1 -1
  104. package/_assets/{index-iKntYXVT.js → index-BXgz5CqZ.js} +1 -1
  105. package/_assets/{index-DWj4wDAA.js → index-Bbo2skmn.js} +1 -1
  106. package/_assets/{index-C33PRPh0.js → index-BhB231bL.js} +1 -1
  107. package/_assets/{index-DzC2inVj.js → index-BhKN5EIF.js} +2 -2
  108. package/_assets/{index-B88q9WNj.js → index-Bl9A4aCY.js} +1 -1
  109. package/_assets/{index-DwGUnOIf.js → index-BngbLeyt.js} +2 -2
  110. package/_assets/{index-C9dJz7_C.js → index-BrlzlDYY.js} +1 -1
  111. package/_assets/{index-Cv1Bu0gQ.js → index-BsSKIwHD.js} +1 -1
  112. package/_assets/{index-CTpdUOYC.js → index-BzcwOGk4.js} +1 -1
  113. package/_assets/{index-CgsHuxXG.js → index-C3FbBJ0B.js} +1 -1
  114. package/_assets/{index-BLkWo_Go.js → index-C4hDSOGl.js} +1 -1
  115. package/_assets/{index-CRSZ3s2j.js → index-CC-AzsUH.js} +1 -1
  116. package/_assets/{index-DftqIOqz.js → index-CC3KVZ-C.js} +1 -1
  117. package/_assets/{index-Dqvb_KIH.js → index-CEmq93Ky.js} +1 -1
  118. package/_assets/{index-DI-3MKLG.js → index-CJEkcTww.js} +1 -1
  119. package/_assets/{index-k4pqNBN1.js → index-CJlYjYNZ.js} +3 -3
  120. package/_assets/{index-CyKbrkx3.js → index-CK9g-jse.js} +1 -1
  121. package/_assets/{index-Br42MJqt.js → index-CMpfBNnD.js} +1 -1
  122. package/_assets/{index-CJxN46d5.js → index-CN92MtoS.js} +1 -1
  123. package/_assets/{index-SoZBe0_y.js → index-CO7GzJir.js} +1 -1
  124. package/_assets/{index-ZfyGtYO-.js → index-CVHBMZma.js} +8 -8
  125. package/_assets/{index-t7HoEVst.js → index-CWqCDmmG.js} +1 -1
  126. package/_assets/{index-ChoD4sDT.js → index-CpJZJukx.js} +2 -2
  127. package/_assets/{index-IMydr643.js → index-CsM5PUdn.js} +2 -2
  128. package/_assets/{index-CFZPZumX.js → index-Cx6dOZTN.js} +3 -3
  129. package/_assets/{index-Bx-jvfF5.js → index-CxfuGaDv.js} +1 -1
  130. package/_assets/{index-B_JiruyT.js → index-CydESP8d.js} +1 -1
  131. package/_assets/{index-CzdGMX6J.js → index-D1hB2lFW.js} +1 -1
  132. package/_assets/{index-z4ApZl83.js → index-D2_T8MLY.js} +1 -1
  133. package/_assets/{index-oi06tQTW.js → index-D4N_qlW4.js} +1 -1
  134. package/_assets/{index-B30SuUvk.js → index-DIELA4su.js} +1 -1
  135. package/_assets/{index-9X8Ovbfy.js → index-DM4ZKIDP.js} +1 -1
  136. package/_assets/{index-G6kG-9qx.js → index-DRT-S6qO.js} +1 -1
  137. package/_assets/{index-LvIL_l-n.js → index-DX4C1Af8.js} +1 -1
  138. package/_assets/{index-B6GXvxon.js → index-Do3GSrTN.js} +3 -3
  139. package/_assets/{index-ukEGQ13w.js → index-DpSVgnb5.js} +1 -1
  140. package/_assets/{index-BdDjhXGr.js → index-DygpMJS7.js} +3 -3
  141. package/_assets/{index-CzMPXy_5.js → index-Dyrrv-jJ.js} +1 -1
  142. package/_assets/{index-BkMwrTJ3.js → index-DzGUGKu8.js} +1 -1
  143. package/_assets/{index-BaUjL_QW.js → index-Fivnn7mf.js} +1 -1
  144. package/_assets/{index-Dfv984cL.js → index-KJ7hHQUO.js} +1 -1
  145. package/_assets/{index-Bmwk_FdV.js → index-KoOOqA3z.js} +1 -1
  146. package/_assets/{index-BX2ff1lz.js → index-V7aSbkHg.js} +317 -317
  147. package/_assets/{index-BL4gRYk8.js → index-Y8dCmAYo.js} +1 -1
  148. package/_assets/{index-jlroLVaQ.js → index-aXb_PvXT.js} +1 -1
  149. package/_assets/{index-D9iz0e2C.js → index-dixEk7jd.js} +1 -1
  150. package/_assets/{index-Ct7WFTlN.js → index-f74S-M7s.js} +1 -1
  151. package/_assets/{index-D2BcAgcM.js → index-s_bfhZ6F.js} +1 -1
  152. package/_assets/{index-u7rLkjFo.js → index-srBAWpfF.js} +1 -1
  153. package/_assets/{index-B5dmZpx0.js → index-xl5neHLR.js} +1 -1
  154. package/_assets/{index.es-BQKIKl0W.js → index.es-B_wTHOdN.js} +1 -1
  155. package/_assets/{index.es-q4rveQRm.js → index.es-BzqwSDFf.js} +4 -4
  156. package/_assets/{index.es-DQ3AciL_.js → index.es-DrfFlp1M.js} +1 -1
  157. package/_assets/{index.es-BfIGmWDo.js → index.es-sJaJm3UW.js} +1 -1
  158. package/_assets/{linkAccount-BodpWbRq.js → linkAccount-CNeA4_rd.js} +1 -1
  159. package/_assets/{localBatchGatewayRequest-CAHKJ55d.js → localBatchGatewayRequest-Ca5n5qCv.js} +1 -1
  160. package/_assets/{native-DfrS-44q.js → native-D1Bt7nPF.js} +1 -1
  161. package/_assets/{networks-DS2vXM8O.js → networks-iVGk0JJM.js} +1 -1
  162. package/_assets/{onramp-mbiOwW7h.js → onramp-C4kGKm8k.js} +1 -1
  163. package/_assets/{openzeppelin-BQFFlT7c.js → openzeppelin-Cq0U5Yj-.js} +1 -1
  164. package/_assets/{ownerOf-Dw2VC0ue.js → ownerOf-CSle-7WO.js} +1 -1
  165. package/_assets/parseNft-DxFyV4vL.js +2 -0
  166. package/_assets/{parseSignature-Ch9ppofj.js → parseSignature-CGjLk_wy.js} +3 -3
  167. package/_assets/{parseSignature-D0_O5-co.js → parseSignature-COtTJutO.js} +1 -1
  168. package/_assets/{passkeys-DRknHpBt.js → passkeys-DaKZKc5X.js} +1 -1
  169. package/_assets/{pay-with-exchange-Dn_V8cBw.js → pay-with-exchange-C9uv-ieY.js} +1 -1
  170. package/_assets/{prepare-contract-call-BnXbUbQT.js → prepare-contract-call-Nm9e1q7x.js} +1 -1
  171. package/_assets/{qr-overlay-DbswS99M.js → qr-overlay-CQQySlBn.js} +3 -3
  172. package/_assets/{react-DehiWSvs.js → react-OEOSdkUk.js} +1 -1
  173. package/_assets/{receive-oTJ8Y5Fv.js → receive-BBhp5SjJ.js} +1 -1
  174. package/_assets/{resolveImplementation-LBp3vWrw.js → resolveImplementation-BhoUOPQQ.js} +1 -1
  175. package/_assets/{rpc-BnQU2Nrx.js → rpc-DTh3KIva.js} +1 -1
  176. package/_assets/{secp256k1-C_L-TT77.js → secp256k1-D3oKlH7Y.js} +1 -1
  177. package/_assets/{secp256k1-BkFY1jqh.js → secp256k1-DDJ2_Bsx.js} +1 -1
  178. package/_assets/{secp256k1-BWXLazAv.js → secp256k1-DbjmQrSL.js} +1 -1
  179. package/_assets/{send-BPCyi9TB.js → send-B38BS5L-.js} +1 -1
  180. package/_assets/{send-batch-transaction-mY-UiFOT.js → send-batch-transaction-CKNSzTrU.js} +1 -1
  181. package/_assets/{send-eip712-transaction-DRfPDTLF.js → send-eip712-transaction-CQkqFshV.js} +2 -2
  182. package/_assets/send-gasless-transaction-0E-pHV_D.js +2 -0
  183. package/_assets/{send-transaction-DCAhhidV.js → send-transaction-DUvtCNaC.js} +2 -2
  184. package/_assets/{sendMetaTransaction-DtQHFBj2.js → sendMetaTransaction-BUU2XPaW.js} +1 -1
  185. package/_assets/{sendRawTransaction-_EHuG-5K.js → sendRawTransaction-DSl2j5Tv.js} +3 -3
  186. package/_assets/{sentry-973sfbO9.js → sentry-B60WY-np.js} +1 -1
  187. package/_assets/{serializeTransaction-CIlFTvLD.js → serializeTransaction-GOaI2-vB.js} +1 -1
  188. package/_assets/{session-proposal-Kaq1rakL.js → session-proposal-B31UMpQa.js} +1 -1
  189. package/_assets/{session-request-Bhg3VOB_.js → session-request-CXbKG_CB.js} +2 -2
  190. package/_assets/{sha256--PXCNFKm.js → sha256-B3W1x8Ou.js} +1 -1
  191. package/_assets/{signing-A5julnDu.js → signing-Bzt09eMi.js} +3 -3
  192. package/_assets/{socials-DtoQHgT-.js → socials-CNNRzT2N.js} +1 -1
  193. package/_assets/{styled-B_wXmJ0m.js → styled-f0hxr1BX.js} +2 -2
  194. package/_assets/{swaps-BovUfBzi.js → swaps-Dm6opnzM.js} +1 -1
  195. package/_assets/{thirdweb-B9JJ0CvC.js → thirdweb-BsryIfzq.js} +3 -3
  196. package/_assets/{to-serializable-transaction-Y_vwOVtu.js → to-serializable-transaction-CspH4HXW.js} +2 -2
  197. package/_assets/{totalSupply-DEpB2B-R.js → totalSupply-BfIXxtR1.js} +1 -1
  198. package/_assets/{transaction-BRB0QRZP.js → transaction-C7nbuBwl.js} +1 -1
  199. package/_assets/{transactionReceipt-B9cYMakC.js → transactionReceipt-LkdfOGrW.js} +1 -1
  200. package/_assets/{transactions-CyD4useP.js → transactions-CHt9afcL.js} +1 -1
  201. package/_assets/{useCreditPacks-CDKB1mCH.js → useCreditPacks-DW-oKsgc.js} +1 -1
  202. package/_assets/useImportable-4rP-UQqs.js +1 -0
  203. package/_assets/{useInfiniteGrid-LaB4F8oP.js → useInfiniteGrid-Cjl-Omaq.js} +1 -1
  204. package/_assets/useTheme-Dh6eiJOj.js +1 -0
  205. package/_assets/useUrlFilters-DABDXRpV.js +1 -0
  206. package/_assets/{utils-B9hEgCzc.js → utils-BkRfOA0C.js} +1 -1
  207. package/_assets/{verifyHash-CkHXeOHN.js → verifyHash--XBApVq4.js} +1 -1
  208. package/_assets/{w3m-modal-C7ksBSKz.js → w3m-modal-cc9RBS7W.js} +1 -1
  209. package/_assets/{w3m-modal-BQ-Br_Vq.js → w3m-modal-dINBeQa2.js} +1 -1
  210. package/_assets/{wait-for-tx-receipt-Cs1Rwwd_.js → wait-for-tx-receipt-CW92WmOA.js} +1 -1
  211. package/_assets/{wallets-DUO7Hcth.js → wallets-DgijLpqw.js} +5 -5
  212. package/_assets/{web-connector-Dqtd76KB.js → web-connector-C3GRXbj_.js} +3 -3
  213. package/_assets/{writeContract-XtplIyls.js → writeContract-B4uhDk93.js} +1 -1
  214. package/_assets/{zora-sepolia-Dv22rzxP.js → zora-sepolia-DOetv30E.js} +1 -1
  215. package/_assets/{zoraTestnet-BDLSoP78.js → zoraTestnet-CXJJv6qS.js} +1 -1
  216. package/index.html +11 -11
  217. package/package.json +2 -2
  218. package/_assets/Assets-DhP8-4kD.js +0 -801
  219. package/_assets/Creator-bjXQ5uOB.js +0 -306
  220. package/_assets/LazyEmoteControls-CxMqk8Wm.js +0 -2
  221. package/_assets/authorizations-C14hLxR0.js +0 -1
  222. package/_assets/buy-BlM_W6kI.js +0 -1
  223. package/_assets/decimals-BpjIyOut.js +0 -1
  224. package/_assets/errors-CkpBP_qL.js +0 -1
  225. package/_assets/estimate-l1-fee-sC2wMHxF.js +0 -1
  226. package/_assets/eth_estimateGas-BmR_JMy9.js +0 -1
  227. package/_assets/eth_getTransactionCount-riJ8hG2K.js +0 -1
  228. package/_assets/get-ecosystem-wallet-info-p-wvOd7m.js +0 -1
  229. package/_assets/getNFT-CeUHNQkH.js +0 -1
  230. package/_assets/index-CcbRdBPP.js +0 -1
  231. package/_assets/parseNft-nX_I3xp0.js +0 -2
  232. package/_assets/send-gasless-transaction-CQvMS02f.js +0 -2
  233. package/_assets/useImportable-DeC43rHX.js +0 -1
  234. package/_assets/useTheme-B1VaWl6j.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-BipVdfM3.js";import{n as c,T as le}from"./Tooltip-DNaztCta.js";import{t as e,s as o,I as g,b as s,af as ce,C as v}from"./index-BX2ff1lz.js";const de=o.div`
1
+ import{r as $,j as t}from"./react-OEOSdkUk.js";import{R as T,C as se,a as ae,b as re}from"./categories-kKk2jGpz.js";import{n as c,T as le}from"./Tooltip-AFYoHds5.js";import{t as e,s as o,I as g,b as s,ai as ce,C as v}from"./index-V7aSbkHg.js";const de=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,o as D,q as F,b as e,k as G,v as O,I as z,w as B,n as w,x as K,c as Q,y as H,z as A,A as X,D as Z,E}from"./index-BX2ff1lz.js";import{e as J,f as U,d as V,h as Y,s as tt,b as it}from"./authorizations-C14hLxR0.js";import{f as et}from"./builder-DvCRptIy.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-CkpBP_qL.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DtQHFBj2.js";const nt=D`
1
+ import{j as i,L as _,r as F}from"./react-OEOSdkUk.js";import{s as n,B as G,t as a,w as D,x as P,b as e,o as W,y as O,I as z,z as B,v as w,A as K,c as H,D as Q,E as A,F as X,G as Z,H as E}from"./index-V7aSbkHg.js";import{c as J,d as U,b as V,e as Y,s as tt,a as it}from"./authorizations-D4wI085M.js";import{f as et}from"./builder-CkJrDc5k.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-COaDYYX2.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BUU2XPaW.js";const nt=D`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=D`
4
4
  to { background-position: -200% 0; }
@@ -181,6 +181,6 @@ import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as
181
181
  font-size: 22px;
182
182
  font-weight: 700;
183
183
  margin: 6px 0 0;
184
- `,M=n(W)`
184
+ `,M=n(G)`
185
185
  margin-top: 12px;
186
- `;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=P.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const q=m?e("authorizations.checking"):u?e("authorizations.active"):e("authorizations.inactive");return i.jsxs(ut,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[i.jsx(pt,{children:l?i.jsx("img",{src:l,alt:""}):p}),i.jsxs(mt,{children:[i.jsx(gt,{title:o,children:o}),i.jsx(xt,{children:c})]}),i.jsxs(yt,{children:[i.jsx(ft,{"data-active":!!u,children:q}),h?i.jsx(zt,{"aria-label":e("authorizations.working")}):i.jsx(bt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?e("authorizations.deactivateAria",{name:o}):e("authorizations.activateAria",{name:o}),disabled:m,onClick:()=>void g()})]})]})}const f=500,R=10,wt=f*R;async function N(t,s){const r=await E(t,{category:s,first:f}),o=Math.min(Math.ceil(r.total/f),R),c=await Promise.all(Array.from({length:Math.max(0,o-1)},(l,p)=>E(t,{category:s,first:f,skip:(p+1)*f})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>wt}}function vt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([N(t,"wearable"),N(t,"emote")]),o=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return{collections:[...o.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function kt(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:Z})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const o=H(t);return o===t?e("authorizations.collectionFallback"):o}function $t(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await et(t,s),o=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return[...o.values()]}})}function _t(){F({title:e("authorizations.title"),noindex:!0});const{session:t,signIn:s}=G(),r=Q.chainId,o=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=vt(o?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=kt(!!o&&!!(t!=null&&t.address)),{data:h,isLoading:y}=$t(o?t==null?void 0:t.address:void 0,o?t==null?void 0:t.identity:void 0);if(!t)return i.jsxs(S,{children:[i.jsx(z,{name:"info",size:40,color:a.colors.muted2}),i.jsx(L,{children:e("authorizations.signInTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),i.jsx(M,{variant:"purple",onClick:()=>s(),children:e("storeSettings.signIn")})]});if(!o)return i.jsxs(S,{children:[i.jsx(z,{name:"check",size:40,color:a.colors.ok}),i.jsx(L,{children:e("authorizations.managedTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),i.jsx(M,{as:_,to:"/items",variant:"purple",children:e("authorizations.managedCta")})]});const u=J(r),m=U(r);return i.jsxs(rt,{children:[i.jsxs(ct,{children:[i.jsx(lt,{children:e("authorizations.title")}),i.jsx(dt,{children:e("authorizations.intro")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.buyingTitle")}),i.jsxs(x,{children:[i.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:i.jsx(B,{className:"ccy-mark"})}),i.jsx(j,{descriptor:m,owner:t.address,signer:t.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:i.jsx(ht,{src:ot,alt:"","aria-hidden":!0})})]})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.sellingTitle")}),c!=null&&c.truncated?i.jsx(jt,{"data-testid":"authorizations-selling-truncated",children:e("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):c&&c.collections.length>0?i.jsx(x,{children:c.collections.map(d=>i.jsx(j,{descriptor:V(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:e("authorizations.sellingDesc"),image:d.image,icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.sellingEmpty")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.mintingTitle")}),y?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):h&&h.length>0?i.jsx(x,{children:h.map(d=>i.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.mintingEmpty")})]})]})}export{_t as Authorizations};
186
+ `;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=F.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const q=m?e("authorizations.checking"):u?e("authorizations.active"):e("authorizations.inactive");return i.jsxs(ut,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[i.jsx(pt,{children:l?i.jsx("img",{src:l,alt:""}):p}),i.jsxs(mt,{children:[i.jsx(gt,{title:o,children:o}),i.jsx(xt,{children:c})]}),i.jsxs(yt,{children:[i.jsx(ft,{"data-active":!!u,children:q}),h?i.jsx(zt,{"aria-label":e("authorizations.working")}):i.jsx(bt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?e("authorizations.deactivateAria",{name:o}):e("authorizations.activateAria",{name:o}),disabled:m,onClick:()=>void g()})]})]})}const f=500,R=10,wt=f*R;async function N(t,s){const r=await E(t,{category:s,first:f}),o=Math.min(Math.ceil(r.total/f),R),c=await Promise.all(Array.from({length:Math.max(0,o-1)},(l,p)=>E(t,{category:s,first:f,skip:(p+1)*f})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>wt}}function vt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([N(t,"wearable"),N(t,"emote")]),o=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return{collections:[...o.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function kt(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:Z})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const o=Q(t);return o===t?e("authorizations.collectionFallback"):o}function $t(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await et(t,s),o=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return[...o.values()]}})}function _t(){P({title:e("authorizations.title"),noindex:!0});const{session:t,signIn:s}=W(),r=H.chainId,o=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=vt(o?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=kt(!!o&&!!(t!=null&&t.address)),{data:h,isLoading:y}=$t(o?t==null?void 0:t.address:void 0,o?t==null?void 0:t.identity:void 0);if(!t)return i.jsxs(S,{children:[i.jsx(z,{name:"info",size:40,color:a.colors.muted2}),i.jsx(L,{children:e("authorizations.signInTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),i.jsx(M,{variant:"purple",onClick:()=>s(),children:e("storeSettings.signIn")})]});if(!o)return i.jsxs(S,{children:[i.jsx(z,{name:"check",size:40,color:a.colors.ok}),i.jsx(L,{children:e("authorizations.managedTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),i.jsx(M,{as:_,to:"/items",variant:"purple",children:e("authorizations.managedCta")})]});const u=J(r),m=U(r);return i.jsxs(rt,{children:[i.jsxs(ct,{children:[i.jsx(lt,{children:e("authorizations.title")}),i.jsx(dt,{children:e("authorizations.intro")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.buyingTitle")}),i.jsxs(x,{children:[i.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:i.jsx(B,{className:"ccy-mark"})}),i.jsx(j,{descriptor:m,owner:t.address,signer:t.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:i.jsx(ht,{src:ot,alt:"","aria-hidden":!0})})]})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.sellingTitle")}),c!=null&&c.truncated?i.jsx(jt,{"data-testid":"authorizations-selling-truncated",children:e("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):c&&c.collections.length>0?i.jsx(x,{children:c.collections.map(d=>i.jsx(j,{descriptor:V(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:e("authorizations.sellingDesc"),image:d.image,icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.sellingEmpty")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.mintingTitle")}),y?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):h&&h.length>0?i.jsx(x,{children:h.map(d=>i.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.mintingEmpty")})]})]})}export{_t as Authorizations};
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,d as Zt,b as ea}from"./react-DehiWSvs.js";import{t as le,s as i,b as a,az as de,b5 as ta,ay as aa,I as H,w as St,ae as Ke,q as sa,P as Q,ag as ot,k as na,l as ia,n as ra,b6 as oa,x as ca,b7 as da,ah as la,b8 as ua,b9 as ct,ba as ha,bb as pa,v as ga,bc as dt,R as G,bd as lt,be as xa,A as ae,r as ma,c as ut,bf as fa,C as ya,bg as ht,bh as Re,bi as ba,bj as fe,bk as ye,bl as pt,g as be,d as va,e as Be,bm as wa}from"./index-BX2ff1lz.js";import{M as Ca,S as ja,C as ka,H as Sa,a as $a,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as $t,m as Ea,g as qa,h as Ra,i as Ba,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Da,y as Ya,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-DeIZf2z7.js";import{p as us,q as hs,b as ps,t as gs,j as xs,A as ms}from"./authorizations-C14hLxR0.js";import{g as fs,j as We}from"./buy-BlM_W6kI.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-BfGxYXhk.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-CDKB1mCH.js";import{i as Ss,a as $s}from"./errors-CkpBP_qL.js";import{E as Ms}from"./ErrorNotice-CaJ4BfpX.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DtQHFBj2.js";const{colors:se,radius:Ts}=le,Is=i.div`
1
+ import{j as e,L as Se,r as P,e as Zt,d as ea}from"./react-OEOSdkUk.js";import{t as le,s as i,b as a,aD as de,b9 as ta,aC as aa,I as H,z as St,ah as Ke,x as sa,S as Q,aj as ot,o as na,q as ia,v as ra,ba as oa,A as ca,bb as da,ak as la,bc as ua,bd as ct,be as ha,bf as pa,y as ga,bg as dt,V as G,bh as lt,bi as xa,F as ae,r as ma,c as ut,bj as fa,C as ya,bk as ht,bl as Be,bm as ba,bn as fe,bo as ye,bp as pt,g as be,f as va,h as Re,bq as wa}from"./index-V7aSbkHg.js";import{M as Ca,S as ja,C as ka,H as Sa,a as $a,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as $t,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Da,y as Ya,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-aBELR_tf.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-D4wI085M.js";import{g as fs,j as We}from"./buy-BeDHfPC-.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-DINFD15F.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-DW-oKsgc.js";import{i as Ss,a as $s}from"./errors-COaDYYX2.js";import{E as Ms}from"./ErrorNotice-8bHn1hfP.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BUU2XPaW.js";const{colors:se,radius:Ts}=le,Is=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,d as Zt,b as ea}from"./react-DehiWSvs.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,qs="https://cdn.decentraland.org/@dcl/shop/0.8.1-31008797734.commit-eb2f6cb/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":Y||void 0,children:[e.jsxs(Sa,{children:[e.jsxs($a,{children:[e.jsx(Ma,{children:D}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx($t,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Bs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ba,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Bs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),D?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Da,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ya,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
61
+ `,qs="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":Y||void 0,children:[e.jsxs(Sa,{children:[e.jsxs($a,{children:[e.jsx(Ma,{children:D}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx($t,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),D?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Da,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ya,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
62
62
  max-width: 1510px;
63
63
  margin: 0 auto;
64
64
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,d as Zt,b as ea}from"./react-DehiWSvs.js";import{t
692
692
  & section {
693
693
  margin-top: 0;
694
694
  }
695
- `;function Fe(o){if(Ss(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:ya.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const An=12e4;function En(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const Le=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),Ce=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Gn(){sa({title:a("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=na(),qt=ia(),ue=ws().packs.slice(0,Cs);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(t=>t.category!=="emote"),{data:$e}=ra({queryKey:["upsell-listings"],queryFn:()=>wa({first:40}),staleTime:6e4}),{data:S}=oa(n),v=ca(),ee=Zt(),{state:J}=ea(),[Bt,ie]=P.useState(null),[Ue,he]=P.useState(null),[_t,R]=P.useState(!1),[B,O]=P.useState(null),Ne=P.useRef(0),[g,j]=P.useState(null),{data:pe}=da(n),{data:re}=la(!0),[Me,Qe]=P.useState(""),oe=P.useRef(null),He=ua(o),Oe=t=>dt(He[t.id]),Te=o.filter(Oe),Ie=o.length>0&&Te.length===0,Wt=Te.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Ft=o.reduce((t,s)=>t+s.quantity,0),Lt=Te.reduce((t,s)=>t+s.quantity,0),Ve=B?B.liveTotalCredits:Wt,Kt=new Set(o.map(t=>t.id)),Ge=(($e==null?void 0:$e.items)??[]).filter(t=>!Kt.has(t.id)).slice(0,12),Ut=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),ge=(S==null?void 0:S.credits)??0,Pe=Ve*10,Nt=re?ct(Pe,re):0n,ce=_e({priceCents:Pe,priceManaWei:Nt,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),Qt=t=>t.some(s=>s.acquisition==="store"),ze=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ht=xa,Ot=t=>fa(t.contractAddress,String(t.itemId));function xe(t){t(),O(null),he(null),ie(null)}function Vt(){j(null),R(!1)}function De(t){const s=Le(t),d=Math.max(0,s-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Qe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),R(!1)}async function Ae(t){if(!n||t.length===0)return;const s=Ce(t),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,$=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let m=0;m<s.length;m++){const p=s[m];j({phase:"processing",stage:"reserving",step:m+1,total:s.length});try{const M=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await ht(n.identity,p.usdCents,M,C);u.push({salt:N.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[N],maxCreditedValue:X,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(t);return}throw M}}h="submit";const x=fs(y).length,k=m=>x>1?{current:m,total:x}:void 0,F=(m,p)=>j({phase:"processing",stage:m,step:s.length,total:s.length,signatures:k(p)}),K=m=>m<x?F("awaiting-signature",m+1):F("settling",x);F("awaiting-signature",1);let f=[];if(us())try{const m=new Map;f=await ys({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(x),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const p=await Promise.allSettled(f.map(C=>bs(C)));p.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(qe=>$.add(qe)),E.push(f[N])):C.reason instanceof bt||X.forEach(qe=>_.add(qe))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof bt))throw M[0];q=!0}catch(m){if(!(m instanceof vs)||!ba(n.providerType))throw m;f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>$.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}else f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(p=>w.add(p)),onSettled:({txHash:m,salts:p})=>{p.forEach(M=>$.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(p=>_.add(p))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...fe(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),yt(v);const b=oe.current;oe.current=null,j(null),R(!1);const U={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};ee("/success",{state:U,replace:!0})}catch(y){ye(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const x=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:F}=vt({reservations:u,spent:x,settled:$}),K=d.filter(b=>F.includes(b.id)),f=d.filter(b=>!F.includes(b.id));if(G(ye(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,U)=>b+U.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(b=>l(b)),O(null),yt(v),G("Shop Completed Purchase",{...fe(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),R(!1);return}j({phase:"error",message:Fe(y)})}}function Ye(t,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),R(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Je(t,s){ye(t)||ae(t,{flow:s,step:"submit"}),G(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:Fe(t)}),R(!1)}async function Gt(t,s){const d=be(Be.MANAToken,s),c=be(Be.CreditsManager,s);await xs({auth:{kind:ms.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>ma(ut.chainId),staleTime:6e4})}catch{return}}async function Dt(t){const s=Ce(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await Xe():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(t,s){const d=Le(t),{totalCents:c,manaWei:u}=await Dt(t),h=_e({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),w=Qt(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){Ae(t);return}const{spender:$,chainId:_}=et(s,t);await tt($,_,()=>s==="mana"?void at(t):void st(t,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),R(!1);return}if(S!=null&&S.credits<d){De(t);return}Ae(t)}function Yt(t){return _e({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n})}const[Ee,me]=P.useState(null);function et(t,s){const d=ze(s)[0].trade;return{spender:t==="mana"?be(va(d.contract),d.chainId).address:be(Be.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(t,s,d){const c=hs(s,t),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){R(!1),me({auth:c,run:d});return}d()}function Jt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){Ae(s);return}const{spender:u,chainId:h}=et(t,s);tt(u,h,()=>t==="mana"?void at(s):void st(s,d,c))}async function at(t){if(!n||t.length===0)return;const s=Ce(t),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await cs({trades:ze(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...fe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(c,h)}catch(h){Je(h,"buy_cart_mana")}}async function st(t,s,d){if(!n||t.length===0)return;const c=Ce(t),u=c.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),w=ds(c.map(x=>x.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((x,k)=>x+k,0),_=ls(Math.max(0,s-$),s,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=ze(c),k=[];for(let f=0;f<x.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:x.length});const U=x[f].item,{credit:m,maxCreditedValue:p}=await ht(n.identity,b,x[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:m.id,itemId:U.id}),k.push({kind:"trade",trade:x[f].trade,credits:[m],maxCreditedValue:p})}x.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Gt(n.signer,x[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await We({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(b=>q.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(h,K)}catch(x){const{toRelease:k}=vt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(x,"buy_cart_combined")}}async function te(t){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.getState().items.filter(Oe);if(s.length===0)return;ie(null),he(null),R(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:lt(d),has_sufficient_credits:ge>=d});try{const c=await js(s,n.address,Ht,await Xe(),Ot),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(En(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ne.current=Date.now();return}await Ze(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{R(!1)}}async function nt(){if(B){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),he(null),await te();return}ie(null),Ze(B.buyable)}}async function Xt(){if(Me){try{sessionStorage.setItem(ve,JSON.stringify(Q.getState().items))}catch{}R(!0);try{const t=await ks(Me,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(ve)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{R(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ns("cart-checkout"))return;it.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=J.creditsAdded??null;try{const s=sessionStorage.getItem(ve);if(s){sessionStorage.removeItem(ve);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=_t||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?e.jsx(wt,{children:e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ks,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Us,{children:[e.jsx(Ns,{children:a("cart.empty.title")}),e.jsx(Qs,{children:a("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(wt,{children:[e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Os,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Vs,{children:a("cart.panelTitle",{count:Ft})}),Rt?e.jsxs(Gs,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(Pt,{children:[e.jsx(Ds,{children:o.map(t=>{const s=Ut.get(t.id),d=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,$=d*h,_=ha(t),E=!!_&&!!A[_],q=pa(t),y=He[t.id],x=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Ys,{"data-unavailable":x||void 0,children:[e.jsxs(Js,{"data-thumb":!0,children:[q?e.jsx(Xs,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Zs,{"data-check":!0,"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(en,{children:[e.jsxs(tn,{"data-desc":!0,children:[q?e.jsx(sn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(an,{title:t.name,children:t.name}),t.creator?e.jsx(nn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(mn,{"data-testid":"cart-creator-tag",children:[e.jsx(fn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(rn,{children:x?e.jsxs(e.Fragment,{children:[e.jsxs(pn,{children:[e.jsx(gn,{name:"warning-fill",size:24}),k]}),q?e.jsx(xn,{to:q,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(on,{children:[e.jsx(kt,{onClick:()=>xe(()=>z(t.id)),disabled:V||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.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(cn,{children:h}),e.jsx(kt,{onClick:()=>xe(()=>I(t.id)),disabled:V||w,"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(dn,{children:[e.jsx(ln,{})," ",$,c?e.jsx(un,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(hn,{children:[_?e.jsx(yn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:E?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(bn,{onClick:()=>xe(()=>l(t.id)),disabled:V,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(vn,{children:e.jsx("button",{className:"link",onClick:()=>xe(W),disabled:V,children:a("cart.clearCart")})})]})]}),e.jsxs(wn,{children:[e.jsx(Cn,{children:a("cart.purchaseSummary")}),e.jsxs(jn,{children:[e.jsxs(kn,{children:[e.jsx(Sn,{children:a("cart.totalItems",{count:Lt})}),e.jsx(Mn,{children:e.jsxs($n,{children:[e.jsx(Tn,{})," ",Ve]})})]}),ce.options.length>0||ce.manaShortfall?e.jsx($t,{options:ce.options,totalCents:Pe,shortfall:ce.manaShortfall,showCreditsAmount:!1,creditsLabel:B?a("marketCheckout.confirmPurchase"):ce.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:V||Ie,onPay:t=>void(B?nt():te(t))}):e.jsx(In,{onClick:()=>void(B?nt():te()),disabled:V||Ie,children:V?a("cart.working"):B?a("marketCheckout.confirmPurchase"):a("cart.checkout")}),Ie?e.jsx(we,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(we,{className:"muted",children:a("cart.signInHint")}),B?e.jsx(we,{className:"muted",children:a("cart.priceChanged")}):null,Ue?e.jsx(we,{className:"muted",children:Ue}):null,e.jsx(Pn,{message:Bt})]})]})]})]}),Ge.length>0?e.jsx(zn,{children:e.jsx(is,{title:a("cart.youMightAlsoLike"),items:Ge})}):null,Ee&&n?e.jsx(rs,{auth:Ee.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:os,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ee;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Rs,{phase:g.phase,balanceCredits:ge,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Yt(g).options:void 0,onPay:Jt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?Le(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:ue,selectedPack:Me,onSelectPack:Qe,onBuyPacks:()=>void Xt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void te()}):null]})}export{Gn as Cart};
695
+ `;function Fe(o){if(Ss(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:ya.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const An=12e4;function En(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const Le=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),Ce=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Gn(){sa({title:a("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=na(),qt=ia(),ue=ws().packs.slice(0,Cs);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:$e}=ra({queryKey:["upsell-listings"],queryFn:()=>wa({first:40}),staleTime:6e4}),{data:S}=oa(n),v=ca(),ee=Zt(),{state:J}=ea(),[Rt,ie]=P.useState(null),[Ue,he]=P.useState(null),[_t,B]=P.useState(!1),[R,O]=P.useState(null),Ne=P.useRef(0),[g,j]=P.useState(null),{data:pe}=da(n),{data:re}=la(!0),[Me,Qe]=P.useState(""),oe=P.useRef(null),He=ua(o),Oe=t=>dt(He[t.id]),Te=o.filter(Oe),Ie=o.length>0&&Te.length===0,Wt=Te.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Ft=o.reduce((t,s)=>t+s.quantity,0),Lt=Te.reduce((t,s)=>t+s.quantity,0),Ve=R?R.liveTotalCredits:Wt,Kt=new Set(o.map(t=>t.id)),Ge=(($e==null?void 0:$e.items)??[]).filter(t=>!Kt.has(t.id)).slice(0,12),Ut=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=(S==null?void 0:S.credits)??0,Pe=Ve*10,Nt=re?ct(Pe,re):0n,ce=_e({priceCents:Pe,priceManaWei:Nt,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),Qt=t=>t.some(s=>s.acquisition==="store"),ze=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ht=xa,Ot=t=>fa(t.contractAddress,String(t.itemId));function xe(t){t(),O(null),he(null),ie(null)}function Vt(){j(null),B(!1)}function De(t){const s=Le(t),d=Math.max(0,s-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Qe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ae(t){if(!n||t.length===0)return;const s=Ce(t),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,$=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let m=0;m<s.length;m++){const p=s[m];j({phase:"processing",stage:"reserving",step:m+1,total:s.length});try{const M=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await ht(n.identity,p.usdCents,M,C);u.push({salt:N.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[N],maxCreditedValue:X,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await Be(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(t);return}throw M}}h="submit";const x=fs(y).length,k=m=>x>1?{current:m,total:x}:void 0,F=(m,p)=>j({phase:"processing",stage:m,step:s.length,total:s.length,signatures:k(p)}),K=m=>m<x?F("awaiting-signature",m+1):F("settling",x);F("awaiting-signature",1);let f=[];if(us())try{const m=new Map;f=await ys({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(x),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const p=await Promise.allSettled(f.map(C=>bs(C)));p.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(qe=>$.add(qe)),E.push(f[N])):C.reason instanceof bt||X.forEach(qe=>_.add(qe))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof bt))throw M[0];q=!0}catch(m){if(!(m instanceof vs)||!ba(n.providerType))throw m;f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>$.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}else f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(p=>w.add(p)),onSettled:({txHash:m,salts:p})=>{p.forEach(M=>$.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(p=>_.add(p))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...fe(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),yt(v);const b=oe.current;oe.current=null,j(null),B(!1);const U={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};ee("/success",{state:U,replace:!0})}catch(y){ye(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const x=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:F}=vt({reservations:u,spent:x,settled:$}),K=d.filter(b=>F.includes(b.id)),f=d.filter(b=>!F.includes(b.id));if(G(ye(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,U)=>b+U.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await Be(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(b=>l(b)),O(null),yt(v),G("Shop Completed Purchase",{...fe(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Fe(y)})}}function Ye(t,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Je(t,s){ye(t)||ae(t,{flow:s,step:"submit"}),G(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:Fe(t)}),B(!1)}async function Gt(t,s){const d=be(Re.MANAToken,s),c=be(Re.CreditsManager,s);await xs({auth:{kind:ms.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>ma(ut.chainId),staleTime:6e4})}catch{return}}async function Dt(t){const s=Ce(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await Xe():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(t,s){const d=Le(t),{totalCents:c,manaWei:u}=await Dt(t),h=_e({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),w=Qt(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){Ae(t);return}const{spender:$,chainId:_}=et(s,t);await tt($,_,()=>s==="mana"?void at(t):void st(t,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if(S!=null&&S.credits<d){De(t);return}Ae(t)}function Yt(t){return _e({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n})}const[Ee,me]=P.useState(null);function et(t,s){const d=ze(s)[0].trade;return{spender:t==="mana"?be(va(d.contract),d.chainId).address:be(Re.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(t,s,d){const c=hs(s,t),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){B(!1),me({auth:c,run:d});return}d()}function Jt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){Ae(s);return}const{spender:u,chainId:h}=et(t,s);tt(u,h,()=>t==="mana"?void at(s):void st(s,d,c))}async function at(t){if(!n||t.length===0)return;const s=Ce(t),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await cs({trades:ze(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...fe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(c,h)}catch(h){Je(h,"buy_cart_mana")}}async function st(t,s,d){if(!n||t.length===0)return;const c=Ce(t),u=c.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),w=ds(c.map(x=>x.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((x,k)=>x+k,0),_=ls(Math.max(0,s-$),s,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=ze(c),k=[];for(let f=0;f<x.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:x.length});const U=x[f].item,{credit:m,maxCreditedValue:p}=await ht(n.identity,b,x[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:m.id,itemId:U.id}),k.push({kind:"trade",trade:x[f].trade,credits:[m],maxCreditedValue:p})}x.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Gt(n.signer,x[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await We({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(b=>q.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(h,K)}catch(x){const{toRelease:k}=vt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Be(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(x,"buy_cart_combined")}}async function te(t){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.getState().items.filter(Oe);if(s.length===0)return;ie(null),he(null),B(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:lt(d),has_sufficient_credits:ge>=d});try{const c=await js(s,n.address,Ht,await Xe(),Ot),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(En(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ne.current=Date.now();return}await Ze(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{B(!1)}}async function nt(){if(R){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),he(null),await te();return}ie(null),Ze(R.buyable)}}async function Xt(){if(Me){try{sessionStorage.setItem(ve,JSON.stringify(Q.getState().items))}catch{}B(!0);try{const t=await ks(Me,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(ve)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ns("cart-checkout"))return;it.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=J.creditsAdded??null;try{const s=sessionStorage.getItem(ve);if(s){sessionStorage.removeItem(ve);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=_t||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?e.jsx(wt,{children:e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ks,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Us,{children:[e.jsx(Ns,{children:a("cart.empty.title")}),e.jsx(Qs,{children:a("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(wt,{children:[e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Os,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Vs,{children:a("cart.panelTitle",{count:Ft})}),Bt?e.jsxs(Gs,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(Pt,{children:[e.jsx(Ds,{children:o.map(t=>{const s=Ut.get(t.id),d=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,$=d*h,_=ha(t),E=!!_&&!!A[_],q=pa(t),y=He[t.id],x=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Ys,{"data-unavailable":x||void 0,children:[e.jsxs(Js,{"data-thumb":!0,children:[q?e.jsx(Xs,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Zs,{"data-check":!0,"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(en,{children:[e.jsxs(tn,{"data-desc":!0,children:[q?e.jsx(sn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(an,{title:t.name,children:t.name}),t.creator?e.jsx(nn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(mn,{"data-testid":"cart-creator-tag",children:[e.jsx(fn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(rn,{children:x?e.jsxs(e.Fragment,{children:[e.jsxs(pn,{children:[e.jsx(gn,{name:"warning-fill",size:24}),k]}),q?e.jsx(xn,{to:q,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(on,{children:[e.jsx(kt,{onClick:()=>xe(()=>z(t.id)),disabled:V||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.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(cn,{children:h}),e.jsx(kt,{onClick:()=>xe(()=>I(t.id)),disabled:V||w,"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(dn,{children:[e.jsx(ln,{})," ",$,c?e.jsx(un,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(hn,{children:[_?e.jsx(yn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:E?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(bn,{onClick:()=>xe(()=>l(t.id)),disabled:V,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(vn,{children:e.jsx("button",{className:"link",onClick:()=>xe(W),disabled:V,children:a("cart.clearCart")})})]})]}),e.jsxs(wn,{children:[e.jsx(Cn,{children:a("cart.purchaseSummary")}),e.jsxs(jn,{children:[e.jsxs(kn,{children:[e.jsx(Sn,{children:a("cart.totalItems",{count:Lt})}),e.jsx(Mn,{children:e.jsxs($n,{children:[e.jsx(Tn,{})," ",Ve]})})]}),ce.options.length>0||ce.manaShortfall?e.jsx($t,{options:ce.options,totalCents:Pe,shortfall:ce.manaShortfall,showCreditsAmount:!1,creditsLabel:R?a("marketCheckout.confirmPurchase"):ce.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:V||Ie,onPay:t=>void(R?nt():te(t))}):e.jsx(In,{onClick:()=>void(R?nt():te()),disabled:V||Ie,children:V?a("cart.working"):R?a("marketCheckout.confirmPurchase"):a("cart.checkout")}),Ie?e.jsx(we,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(we,{className:"muted",children:a("cart.signInHint")}),R?e.jsx(we,{className:"muted",children:a("cart.priceChanged")}):null,Ue?e.jsx(we,{className:"muted",children:Ue}):null,e.jsx(Pn,{message:Rt})]})]})]})]}),Ge.length>0?e.jsx(zn,{children:e.jsx(is,{title:a("cart.youMightAlsoLike"),items:Ge})}):null,Ee&&n?e.jsx(rs,{auth:Ee.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:os,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ee;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Bs,{phase:g.phase,balanceCredits:ge,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Yt(g).options:void 0,onPay:Jt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?Le(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:ue,selectedPack:Me,onSelectPack:Qe,onBuyPacks:()=>void Xt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void te()}):null]})}export{Gn as Cart};
@@ -1,4 +1,4 @@
1
- import{aa as N,ab as U,ac as o,ad as n,ae as D,o as M}from"./index-BX2ff1lz.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-B_wXmJ0m.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,B=M(P||(P=l`
1
+ import{ad as N,ae as w,af as o,ag as n,ah as D,w as M}from"./index-V7aSbkHg.js";import{r as U,j as g}from"./react-OEOSdkUk.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-f0hxr1BX.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -21,8 +21,8 @@ import{aa as N,ab as U,ac as o,ad as n,ae as D,o as M}from"./index-BX2ff1lz.js";
21
21
  stroke-dasharray: 100px, 200px;
22
22
  stroke-dashoffset: -125px;
23
23
  }
24
- `)),L=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,m={root:["root",s,`color${n(t)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(m,K,e)},V=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(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(S||(S=l`
24
+ `)),L=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,m={root:["root",s,`color${n(a)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(m,K,e)},V=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(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(S||(S=l`
25
25
  animation: ${0} 1.4s linear infinite;
26
26
  `),B)),Z=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),q=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(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
- `),G)),Q=w.forwardRef(function(e,s){const t=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=t,j=U(t,W),c=o({},t,{color:m,disableShrink:R,size:u,thickness:i,value:p,variant:k}),f=L(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((a-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 g.jsx(V,o({className:I(f.root,d),style:o({width:u,height:u},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(Z,{className:f.svg,ownerState:c,viewBox:`${a/2} ${a/2} ${a} ${a}`,children:g.jsx(q,{className:f.circle,style:h,ownerState:c,cx:a,cy:a,r:(a-i)/2,fill:"none",strokeWidth:i})})}))});export{Q as C};
28
+ `),G)),Q=U.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:f=0,variant:k="indeterminate"}=a,j=w(a,W),c=o({},a,{color:m,disableShrink:R,size:u,thickness:i,value:f,variant:k}),p=L(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(f),h.strokeDashoffset=`${((100-f)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(V,o({className:I(p.root,d),style:o({width:u,height:u},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(Z,{className:p.svg,ownerState:c,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:g.jsx(q,{className:p.circle,style:h,ownerState:c,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 h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn as ee,V as te,y as z,bo as ae,bp as oe,I as ie,b as a,c as re,A as se,n as ne,q as ce,C as le,aj as F,ak as de,bq as pe,br as xe}from"./index-BX2ff1lz.js";import{E as me}from"./ErrorNotice-CaJ4BfpX.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-cfpY_oN5.js";import{S as L,C as je,F as ye,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-BipVdfM3.js";import{L as Ae}from"./LoadMore-DcFUIXjj.js";import{u as Pe}from"./useInfiniteGrid-LaB4F8oP.js";import{G as Se}from"./grid.styles--OULZO8_.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";const Me=s.section`
1
+ import{j as e,r as h,a as J,e as X}from"./react-OEOSdkUk.js";import{t as b,s,br as ee,Y as te,D as T,bs as ae,bt as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,am as z,an as de,bu as pe,bv as xe}from"./index-V7aSbkHg.js";import{E as me}from"./ErrorNotice-8bHn1hfP.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-tZrmrhPT.js";import{S as L,C as je,F as ye,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-kKk2jGpz.js";import{L as Pe}from"./LoadMore-CwQ5CTJq.js";import{u as Se}from"./useInfiniteGrid-Cjl-Omaq.js";import{G as Ae}from"./grid.styles-C5FdGoZt.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const Me=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -15,16 +15,16 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn
15
15
  position: absolute;
16
16
  inset: 0;
17
17
  z-index: 0;
18
- `,Re=s.img`
18
+ `,Fe=s.img`
19
19
  width: 100%;
20
20
  height: 100%;
21
21
  object-fit: cover;
22
22
  display: block;
23
- `,Te=s.div`
23
+ `,Re=s.div`
24
24
  position: absolute;
25
25
  inset: 0;
26
26
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
27
- `,ze=s.h1`
27
+ `,Te=s.h1`
28
28
  position: relative;
29
29
  z-index: 1;
30
30
  margin: 0;
@@ -42,7 +42,7 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn
42
42
  padding: 24px 16px;
43
43
  font-size: 26px;
44
44
  }
45
- `;function Fe({name:o,creator:t}){const{data:n}=ee(t),d=(n==null?void 0:n.cover)||he;return e.jsxs(Me,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Re,{src:d,alt:"",loading:"eager"}),e.jsx(Te,{"aria-hidden":!0})]}),e.jsx(ze,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:I}=b,Le=s.div`
45
+ `;function ze({name:o,creator:t}){const{data:n}=ee(t),d=(n==null?void 0:n.cover)||he;return e.jsxs(Me,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Fe,{src:d,alt:"",loading:"eager"}),e.jsx(Re,{"aria-hidden":!0})]}),e.jsx(Te,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:I}=b,Le=s.div`
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  align-items: center;
@@ -116,7 +116,7 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn
116
116
  background: ${c.accent};
117
117
  color: ${c.white};
118
118
  }
119
- `;function _e({address:o}){var v,l;const{data:t}=te(o),[n,d]=h.useState(!1);if(!o)return null;const p=(t==null?void 0:t.name)||z(o),u=(l=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:l.face256,g=`${re.profileUrl}/${o}`,f=ae(oe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??o}));async function x(){try{await navigator.clipboard.writeText(o),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){se(y,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"data-testid":"creator-card",children:[u?e.jsx(B,{src:u,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsx(Be,{title:p,children:p}),e.jsxs(Ie,{type:"button",onClick:()=>void x(),title:n?a("collection.copied"):a("collection.copyAddress"),"aria-label":n?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:z(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(We,{"data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:qe,media:$}=b,Ge=s.div`
119
+ `;function _e({address:o}){var v,l;const{data:t}=te(o),[n,d]=h.useState(!1);if(!o)return null;const p=(t==null?void 0:t.name)||T(o),u=(l=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:l.face256,g=`${re.profileUrl}/${o}`,f=ae(oe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??o}));async function x(){try{await navigator.clipboard.writeText(o),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){se(y,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"data-testid":"creator-card",children:[u?e.jsx(B,{src:u,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsx(Be,{title:p,children:p}),e.jsxs(Ie,{type:"button",onClick:()=>void x(),title:n?a("collection.copied"):a("collection.copyAddress"),"aria-label":n?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:T(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(We,{"data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:Ge,media:$}=b,He=s.div`
120
120
  position: relative;
121
121
  display: flex;
122
122
  gap: 32px;
@@ -125,14 +125,14 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn
125
125
  ${$.maxWidth("lg")} {
126
126
  display: block;
127
127
  }
128
- `,He=s.div`
128
+ `,Ue=s.div`
129
129
  flex: 1;
130
130
  min-width: 0;
131
131
 
132
132
  ${$.maxWidth("lg")} {
133
133
  width: 100%;
134
134
  }
135
- `,Ue=s.aside`
135
+ `,Ye=s.aside`
136
136
  flex: none;
137
137
  width: 265px;
138
138
 
@@ -146,7 +146,7 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn
146
146
  width: 100%;
147
147
  max-height: 88vh;
148
148
  border-radius: 16px 16px 0 0;
149
- background: ${qe.white};
149
+ background: ${Ge.white};
150
150
  padding: 0 16px;
151
151
  overflow-y: auto;
152
152
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
@@ -159,4 +159,4 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bn
159
159
  visibility: visible;
160
160
  }
161
161
  }
162
- `,Ye=48;function it(){var T;const{contractAddress:o}=J(),t=X(),[n,d]=h.useState("wearable"),[p,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[l,y]=h.useState(""),[k,W]=h.useState("newest"),N=x&&!Number.isNaN(Number(x))?Number(x):void 0,A=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,q=(L.find(i=>i.key===k)??L[0]).server,P={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:A,sortBy:q},{items:j,total:G,isLoading:C,error:S,hasNextPage:H,isFetchingNextPage:M,isFetchNextPageError:U,fetchNextPage:Y}=Pe(["collection-page",o,P],i=>pe(o,{...P,first:Ye,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),E=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const R=(r==null?void 0:r.creator)||((T=j[0])==null?void 0:T.creator);function K(i){d(i),u(null)}function V(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function D(){d("wearable"),u(null),f([]),v(""),y("")}const w=!!(N||A),O=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),Q=n!=="wearable"||!!p||g.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:E})]}),e.jsx(Fe,{name:E,creator:R}),e.jsxs(Ge,{"data-testid":"browse",children:[e.jsxs(Ue,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:R}),e.jsx(je,{category:n,subCategory:p,onCategory:K,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(He,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(ye,{rarities:g,onToggleRarity:V,sort:k,onSort:W,total:G,loading:C,anyActive:Q,onClear:D,renderTrailing:i=>e.jsx(Ce,{panelKey:"price",label:O,active:w,panel:i,children:e.jsxs(we,{"data-variant":"price",children:[e.jsxs($e,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:m=>v(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:l,onChange:m=>y(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:le.name})})]})})}),S?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Se,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[j.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(F,{count:6}):null]})}),e.jsx(Ae,{hasNextPage:H,isFetching:M,isError:U,onLoadMore:()=>void Y()}),!C&&!S&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{it as Collection,it as default};
162
+ `,qe=48;function it(){var R;const{contractAddress:o}=J(),t=X(),[n,d]=h.useState("wearable"),[p,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[l,y]=h.useState(""),[k,W]=h.useState("newest"),N=x&&!Number.isNaN(Number(x))?Number(x):void 0,P=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,G=(L.find(i=>i.key===k)??L[0]).server,S={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:P,sortBy:G},{items:j,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:Y,fetchNextPage:q}=Se(["collection-page",o,S],i=>pe(o,{...S,first:qe,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),E=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const F=(r==null?void 0:r.creator)||((R=j[0])==null?void 0:R.creator);function D(i){d(i),u(null)}function K(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function O(){d("wearable"),u(null),f([]),v(""),y("")}const w=!!(N||P),Q=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),V=n!=="wearable"||!!p||g.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:E})]}),e.jsx(ze,{name:E,creator:F}),e.jsxs(He,{"data-testid":"browse",children:[e.jsxs(Ye,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:F}),e.jsx(je,{category:n,subCategory:p,onCategory:D,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(Ue,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(ye,{rarities:g,onToggleRarity:K,sort:k,onSort:W,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(Ce,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs(we,{"data-variant":"price",children:[e.jsxs($e,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:m=>v(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:l,onChange:m=>y(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Ae,{"data-testid":"grid",children:C?e.jsx(z,{count:15}):e.jsxs(e.Fragment,{children:[j.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(z,{count:6}):null]})}),e.jsx(Pe,{hasNextPage:U,isFetching:M,isError:Y,onLoadMore:()=>void q()}),!C&&!A&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{it as Collection,it as default};
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as k,az as j,bQ as C,C as G,o as Y,I as Q,A as X,g as W,e as B,d as Z,a2 as q,bU as F,ak as J}from"./index-BX2ff1lz.js";import{s as ee,j as U,A as H,g as K,r as te,m as ne,n as ae,o as ie,k as oe}from"./authorizations-C14hLxR0.js";import{i as se}from"./errors-CkpBP_qL.js";import{E as re}from"./ErrorNotice-CaJ4BfpX.js";import{l as ce,m as de,n as le}from"./buy-BlM_W6kI.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-DtQHFBj2.js";import{I as xe,C as ge}from"./ethers-DejfrZ8i.js";const R="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
1
+ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as k,aD as j,bU as C,C as Y,w as G,I as Q,F as X,g as W,h as B,f as Z,ap as q,a5 as J,bY as F,an as ee}from"./index-V7aSbkHg.js";import{s as te,f as U,A as H,g as D,r as ne,m as ae,i as ie,j as oe}from"./authorizations-D4wI085M.js";import{i as se}from"./errors-COaDYYX2.js";import{E as re}from"./ErrorNotice-8bHn1hfP.js";import{l as ce,m as de,n as le}from"./buy-BeDHfPC-.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-BUU2XPaW.js";import{I as xe,C as ge}from"./ethers-lk3HAbPB.js";const R="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -109,7 +109,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
109
109
  line-height: 1.4;
110
110
  color: ${o.colors.muted};
111
111
  text-align: center;
112
- `;function xt({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:l,creditsLabel:c,shortfall:p,showCreditsAmount:x=!0}){return t.jsxs(we,{children:[a.map(u=>u.method==="credits"?t.jsxs(ve,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??f("buyModal.buy")}),x?t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))})]}):null]},"credits"):u.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))}),t.jsx($e,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)}),t.jsx(ke,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx(Ce,{"data-testid":"mana-shortfall-note",children:f("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:G.name})})]}):null,l?t.jsx(je,{"data-testid":"mana-rate-note",children:l}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function gt(a,n){const i=(s,...l)=>void a.invalidateQueries({queryKey:n?[s,...l]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const ze=Y`
112
+ `;function xt({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:l,creditsLabel:c,shortfall:p,showCreditsAmount:x=!0}){return t.jsxs(we,{children:[a.map(u=>u.method==="credits"?t.jsxs(ve,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??f("buyModal.buy")}),x?t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))})]}):null]},"credits"):u.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))}),t.jsx($e,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)}),t.jsx(ke,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx(Ce,{"data-testid":"mana-shortfall-note",children:f("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:Y.name})})]}):null,l?t.jsx(je,{"data-testid":"mana-rate-note",children:l}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function gt(a,n){const i=(s,...l)=>void a.invalidateQueries({queryKey:n?[s,...l]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const ze=G`
113
113
  to { transform: rotate(360deg); }
114
114
  `,Me=e.div`
115
115
  position: fixed;
@@ -248,7 +248,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
248
248
  outline: 2px solid ${o.colors.accent};
249
249
  outline-offset: 2px;
250
250
  }
251
- `,Ke=e.button`
251
+ `,De=e.button`
252
252
  flex: 1 1 0;
253
253
  display: inline-flex;
254
254
  align-items: center;
@@ -278,7 +278,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
278
278
  outline: 2px solid ${o.colors.accent};
279
279
  outline-offset: 2px;
280
280
  }
281
- `,De=e.span`
281
+ `,Ke=e.span`
282
282
  width: 16px;
283
283
  height: 16px;
284
284
  border-radius: 50%;
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function ft({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await ee({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Me,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function mt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(K.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=te(),$=ne(s.provider,m),h=await pe($,m,d,p,{serverURL:K.relayerUrl});return l==null||l(),await ae(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function bt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function wt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:He}=o,vt=e.div`
292
+ `;function ft({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await te({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Me,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(De,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function mt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(D.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=ne(),$=ae(s.provider,m),h=await pe($,m,d,p,{serverURL:D.relayerUrl});return l==null||l(),await ie(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof oe)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await q(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function bt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function wt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:He}=o,vt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${He.overlay};
@@ -422,7 +422,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
422
422
  color: ${r.text};
423
423
  overflow: hidden;
424
424
  text-overflow: ellipsis;
425
- `,Lt=e(q)`
425
+ `,Lt=e(J)`
426
426
  font-size: 10px;
427
427
  line-height: 1.43;
428
428
  color: ${r.muted};
@@ -440,7 +440,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
440
440
  width: 24px;
441
441
  height: 24px;
442
442
  background: ${r.text2};
443
- `,Kt=e.div`
443
+ `,Dt=e.div`
444
444
  display: flex;
445
445
  align-items: center;
446
446
  gap: 8px;
@@ -448,7 +448,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
448
448
  background: rgba(255, 162, 90, 0.3);
449
449
  border-radius: ${V.btn};
450
450
  padding: 12px 8px;
451
- `,Dt=e.p`
451
+ `,Kt=e.p`
452
452
  margin: 0;
453
453
  font-size: 14px;
454
454
  line-height: 1.334;
@@ -494,14 +494,14 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
494
494
  justify-content: space-between;
495
495
  border-top: 1px solid ${r.gray4};
496
496
  padding-top: 12px;
497
- `,Gt=e.div`
497
+ `,Yt=e.div`
498
498
  display: flex;
499
499
  align-items: center;
500
500
  gap: 8px;
501
501
  font-size: 24px;
502
502
  font-weight: 700;
503
503
  color: ${r.text};
504
- `,Yt=e(k)`
504
+ `,Gt=e(k)`
505
505
  width: 30px;
506
506
  height: 30px;
507
507
  background: ${r.text};
@@ -676,7 +676,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
676
676
  font-size: 22px;
677
677
  font-weight: 700;
678
678
  color: ${I.text};
679
- `,Ge=e.button`
679
+ `,Ye=e.button`
680
680
  display: inline-flex;
681
681
  align-items: center;
682
682
  gap: 4px;
@@ -694,11 +694,11 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
694
694
  &:hover {
695
695
  text-decoration: underline;
696
696
  }
697
- `,Ye=e(Q)`
697
+ `,Ge=e(Q)`
698
698
  transform: rotate(-90deg);
699
699
  `,Xe=e.div`
700
700
  position: relative;
701
- `,D=e.button`
701
+ `,K=e.button`
702
702
  position: absolute;
703
703
  top: 112px;
704
704
  transform: translateY(-50%);
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
801
801
  opacity: 1;
802
802
  transform: scale(1.1);
803
803
  }
804
- `;function dn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:L,clientWidth:S}=h,P=Math.max(1,Math.ceil(L/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=L-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(D,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(J,{item:h},h.id))}),t.jsx(D,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{z as $,Nt as A,At as B,$t as C,_t as D,Ot as E,Vt as F,Gt as G,jt as H,Yt as I,Xt as J,lt as K,Jt as L,vt as M,dt as N,dn as O,xt as P,ft as Q,T as R,kt as S,zt as T,ct as U,gt as V,Kt as W,Mt as X,Qe as Y,pt as Z,be as _,Ct as a,rn as a0,cn as a1,mt as a2,ht as a3,bt as a4,yt as b,Wt as c,It as d,St as e,Tt as f,en as g,tn as h,nn as i,Zt as j,qt as k,an as l,ut as m,on as n,sn as o,wt as p,Dt as q,Et as r,Bt as s,Rt as t,Lt as u,Pt as v,Ft as w,Qt as x,Ut as y,Ht as z};
804
+ `;function dn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:L,clientWidth:S}=h,P=Math.max(1,Math.ceil(L/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=L-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ye,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ge,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(K,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(ee,{item:h},h.id))}),t.jsx(K,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{z as $,Nt as A,At as B,$t as C,_t as D,Ot as E,Vt as F,Yt as G,jt as H,Gt as I,Xt as J,lt as K,Jt as L,vt as M,dt as N,dn as O,xt as P,ft as Q,T as R,kt as S,zt as T,ct as U,gt as V,Dt as W,Mt as X,Qe as Y,pt as Z,be as _,Ct as a,rn as a0,cn as a1,mt as a2,ht as a3,bt as a4,yt as b,Wt as c,It as d,St as e,Tt as f,en as g,tn as h,nn as i,Zt as j,qt as k,an as l,ut as m,on as n,sn as o,wt as p,Kt as q,Et as r,Bt as s,Rt as t,Lt as u,Pt as v,Ft as w,Qt as x,Ut as y,Ht as z};
@@ -1 +1 @@
1
- import{p as t}from"./sentry-973sfbO9.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-B60WY-np.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 z}from"./react-DehiWSvs.js";import{r as W}from"./index-BkMwrTJ3.js";function Y(o,f){for(var S=0;S<f.length;S++){const P=f[S];if(typeof P!="string"&&!Array.isArray(P)){for(const h in P)if(h!=="default"&&!(h in o)){const m=Object.getOwnPropertyDescriptor(P,h);m&&Object.defineProperty(o,h,m.get?m:{enumerable:!0,get:()=>P[h]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var O={},L={},D={},U={},H;function G(){if(H)return U;H=1,Object.defineProperty(U,"__esModule",{value:!0}),U.createFetchComponent=P;const o=new Set([400,401,403,404]),f=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]);async function S(h,m,y){var $;const{timeout:g,retryDelay:d,abortController:F}=y,q=F.signal;let M=y.attempts,w,A;do{w=void 0,A=void 0;let C=null;try{g&&(C=setTimeout(()=>F.abort(),g)),--M,w=await fetch(h,m)}catch(n){A=n}finally{C&&clearTimeout(C)}if(w&&(w.ok||o.has(w.status))||q.aborted||M===0)break;w&&await(($=w.body)==null?void 0:$.cancel().catch(()=>{})),await new Promise(n=>setTimeout(n,d))}while(!0);if(q.aborted)throw new Error("Request aborted (timed out)");if(!w)throw A;return w}function P(h){const m=h==null?void 0:h.defaultHeaders;async function y(g,d){const{timeout:F,method:q="GET",retryDelay:M=0,abortController:w,attempts:A,...$}={...h==null?void 0:h.defaultFetcherOptions,...d},C=w||new AbortController,n=f.has(q.toUpperCase())?A??1:1,e={...$,method:q,signal:C.signal};return m&&(e.headers={...m,...$.headers||{}}),S(g,e,{timeout:F,retryDelay:M,attempts:n,abortController:C})}return{fetch:y}}return U}var Q;function X(){return Q||(Q=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var f=G();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return f.createFetchComponent}})})(D)),D}const J="0.0.0-development",K={version:J};var V;function Z(){return V||(V=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const f=X(),S=K;function P(){return S.version}o.getCurrentVersion=P;function h(n,e,i=""){for(const r in n){if(!n.hasOwnProperty(r)||n[r]===null||n[r]===void 0)continue;const t=i?`${i}[${r}]`:r;n[r]instanceof Date?e.append(t,n[r].toISOString()):n[r]instanceof Array?n[r].forEach((a,s)=>{const c=`${t}[${s}]`;h(a,e,c)}):typeof n[r]=="object"?h(n[r],e,t):e.append(t,n[r].toString())}return e}o.addModelToFormData=h;function m(n){return Array.from(new Set(n))}o.MAX_URL_LENGTH=2048;async function y({baseUrl:n,path:e,queryParams:i,fetcher:r,uniqueBy:t,options:a}){r=r||(0,f.createFetchComponent)();const s=q({baseUrl:n,path:e,queryParams:i}),c=new Map;for(const u of s)(await(await r.fetch(u,{...a,headers:{"Content-Type":"application/json"}})).json()).forEach(E=>c.set(t?E[t]:c.size,E));return Array.from(c.values())}o.splitAndFetch=y;const g=7;async function d({baseUrl:n,path:e,queryParams:i,elementsProperty:r,uniqueBy:t,options:a,fetcher:s}){s=s||(0,f.createFetchComponent)();const u=q({baseUrl:n,path:e,queryParams:i,reservedParams:new Map([["offset",g]])}),b=new Map;let E=!1;for(let v=0;v<u.length&&!E;v++){let l=u[v];for(;l&&!E;)try{const p=(await s.fetch(l,a)).json();p[r].forEach(j=>b.set(j[t],j));const _=p.pagination.next;l=_?new URL(_,l).toString():void 0}catch{E=!0}}return Array.from(b.values())}o.splitAndFetchPaginated=d;function F({queryParams:n,baseUrl:e,path:i,reservedParams:r}){const t="name"in n?new Map([[n.name,n.values]]):n;if(t.size===0)return[new C(e+i,t,r)];const s=Array.from(t.entries()).map(([l,p])=>[l,m(p)]).sort(([l,p],[T,_])=>p.length-_.length),c=new C(e+i,new Map,r);for(let l=0;l<s.length-1;l++){const[p,T]=s[l];if(!c.canSetParams(p,T))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.");c.setParams(p,T)}let u=C.clone(c);const[b,E]=s[s.length-1],v=[];for(const l of E)u.canAddParam(b,l)||(v.push(u),u=C.clone(c)),u.addParam(b,l);return v.push(u),v}o.splitValuesIntoManyQueryBuilders=F;function q(n){return F(n).map(i=>i.toString())}o.splitValuesIntoManyQueries=q;function M(n){if(!n)return new Map;const e=Object.entries(n).filter(([i,r])=>!!r).map(([i,r])=>{const t=i.endsWith("s")?i.slice(0,-1):i;let a;if(Array.isArray(r))a=[...r].filter(A).map(s=>`${s}`);else if(A(r))a=[`${r}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[t,a]}).filter(([i,r])=>r.length>0);return new Map(e)}o.convertFiltersToQueryParams=M;function w(n,e){const i={...n==null?void 0:n.headers,...e==null?void 0:e.headers};return{...n,...e,headers:i}}o.mergeRequestOptions=w;function A(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function $(n){return n=n.trim(),!n.startsWith("https://")&&!n.startsWith("http://")&&(n="https://"+n),n.endsWith("/")&&(n=n.slice(0,-1)),n}o.sanitizeUrl=$;class C{constructor(e,i=new Map,r=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=r,this.length=this.calculateUrlLength(i,r)}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 r=this.queryParams.get(e),t=r||[];return t.push(i),this.queryParams.set(e,t),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const r=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(r,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(r=>`${r}`)),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[r,t]of this.queryParams)for(const a of t)i?e+=`&${r}=${a}`:(e+=`?${r}=${a}`,i=!0);return e}calculateUrlLength(e,i){let r=this.baseUrl.length;for(const[t,a]of i)this.queryParams.has(t)||(r+=t.length+2+a);for(const[t,a]of e)r+=this.calculateAddedLength(t,a);return r}static clone(e){return new C(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,r)=>i+r.length,0)}}o.QueryBuilder=C})(L)),L}var R={},I;function x(){if(I)return R;I=1,Object.defineProperty(R,"__esModule",{value:!0}),R.retry=void 0;async function o(f,S,P,h){for(;P>0;)try{return await S()}catch(m){if(P--,P>0)console.info(`Failed to ${f}. Still have ${P} attempt/s left. Will try again in ${h}`),await new Promise(y=>setTimeout(y,h));else throw m}throw new Error("Please specify more than one attempt for the retry function")}return R.retry=o,R}var N;function ee(){if(N)return O;N=1,Object.defineProperty(O,"__esModule",{value:!0}),O.createContentClient=O.downloadContent=void 0;const o=W(),f=Z(),S=x();async function P(m,y,g,d){const{attempts:F=3,retryDelay:q=500}=d||{},M=d!=null&&d.timeout?{timeout:d.timeout}:{};return(0,S.retry)(`fetch file with hash ${g} from ${y}`,async()=>{const w=await m.fetch(`${y}/${g}`,M),A=new Uint8Array(await w.arrayBuffer());if(!(d!=null&&d.avoidChecks)&&(g.startsWith("Qm")?await(0,o.hashV0)(A):await(0,o.hashV1)(A))!==g)throw new Error(`Failed to fetch file with hash ${g} from ${y}`);return A},F,q)}O.downloadContent=P;function h(m){const{fetcher:y,logger:g}=m,d=(0,f.sanitizeUrl)(m.url),F=m==null?void 0:m.parallelConfig;async function q(t,a,s){const c=new AbortController,u=c.signal,b=(0,f.mergeRequestOptions)(s,{signal:u});return new Promise(async E=>{let v=t.length;const l=()=>{v--,v===0&&E([])},p=T=>T&&Array.isArray(T)&&T.length>0?(c.abort(),E(T),!0):!1;t.forEach(async T=>{try{const _=(0,f.sanitizeUrl)(T),j=await y.fetch(`${_}${a}`,b);if(u.aborted){l();return}const k=await j.json();p(k)||l()}catch(_){u.aborted||g==null||g.warn(`Failed to fetch from ${T}:`,_),l()}})})}async function M(t,a,s){const u=(await Promise.allSettled(t.map(async l=>{try{const p=(0,f.sanitizeUrl)(l);return await(await y.fetch(`${p}${a}`,s)).json()}catch(p){return g==null||g.warn(`Failed to fetch from ${l}:`,p),[]}}))).filter(l=>l.status==="fulfilled").map(l=>l.value||[]),b=u.flatMap(l=>l),E=u.filter(l=>l.length===0).length,v=new Map;return b.forEach(l=>{(!v.has(l.id)||l.timestamp>v.get(l.id).timestamp)&&v.set(l.id,l)}),{entities:Array.from(v.values()),emptyResults:E}}async function w(t,a){const s=new FormData;s.append("entityId",t.entityId),(0,f.addModelToFormData)(t.authChain,s,"authChain");const c=await i(Array.from(t.files.keys()),a);for(const[u,b]of t.files)(!c.has(u)||u===t.entityId)&&s.append(u,new Blob([b]),u);return s}async function A(t,a){const s=await w(t,a),c=(0,f.mergeRequestOptions)(a||{},{body:s,method:"POST"});return await y.fetch(`${d}/entities`,c)}async function $(t,a){if(t.length===0)return Promise.reject("You must set at least one pointer.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:t}),method:"POST",headers:{"Content-Type":"application/json"}});return(await y.fetch(`${d}/entities/active`,s)).json()}async function C(t,a){if(t.length===0)return Promise.reject("You must set at least one id.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({ids:t}),method:"POST",headers:{"Content-Type":"application/json"}}),c=(a==null?void 0:a.parallel)||F;return c!=null&&c.urls&&(c==null?void 0:c.urls.length)>0?q([d,...c.urls],"/entities/active",s):(await y.fetch(`${d}/entities/active`,s)).json()}async function n(t,a){const s=await C([t],a);return s.length===0?Promise.reject(`Failed to find an entity with id '${t}'.`):s[0]}function e(t,a){return t.length===0?Promise.reject("You must set at least one cid."):(0,f.splitAndFetch)({fetcher:y,options:a,baseUrl:d,path:"/available-content",queryParams:{name:"cid",values:t},uniqueBy:"cid"})}async function i(t,a){const c=(await e(t,a)).filter(u=>u.available).map(({cid:u})=>u);return new Set(c)}async function r(t,a){const s=(a==null?void 0:a.parallel)||F;if(!(s!=null&&s.urls)||s.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const c=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:[t]}),method:"POST",headers:{"Content-Type":"application/json"}}),u=[d,...s.urls],{entities:b,emptyResults:E}=await M(u,"/entities/active",c);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const v=Math.max(...b.map(_=>_.timestamp)),l=b.filter(_=>_.timestamp===v),p=b.filter(_=>_.timestamp<v);return{isConsistent:p.length===0&&E===0,upToDateEntities:l.length>0?l:void 0,outdatedEntities:p.length>0?p:void 0}}return{buildEntityFormDataForDeployment:w,fetchEntitiesByPointers:$,fetchEntitiesByIds:C,fetchEntityById:n,downloadContent:(t,a)=>P(y,d+"/contents",t,a),deploy:A,isContentAvailable:e,checkPointerConsistency:r}}return O.createContentClient=h,O}var B=ee();const te=z(B),ae=Y({__proto__:null,default:te},[B]);export{ae as C};
1
+ import{g as z}from"./react-OEOSdkUk.js";import{r as W}from"./index-DzGUGKu8.js";function Y(o,f){for(var S=0;S<f.length;S++){const P=f[S];if(typeof P!="string"&&!Array.isArray(P)){for(const h in P)if(h!=="default"&&!(h in o)){const m=Object.getOwnPropertyDescriptor(P,h);m&&Object.defineProperty(o,h,m.get?m:{enumerable:!0,get:()=>P[h]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var O={},L={},D={},U={},H;function G(){if(H)return U;H=1,Object.defineProperty(U,"__esModule",{value:!0}),U.createFetchComponent=P;const o=new Set([400,401,403,404]),f=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]);async function S(h,m,y){var $;const{timeout:g,retryDelay:d,abortController:F}=y,q=F.signal;let M=y.attempts,w,A;do{w=void 0,A=void 0;let C=null;try{g&&(C=setTimeout(()=>F.abort(),g)),--M,w=await fetch(h,m)}catch(n){A=n}finally{C&&clearTimeout(C)}if(w&&(w.ok||o.has(w.status))||q.aborted||M===0)break;w&&await(($=w.body)==null?void 0:$.cancel().catch(()=>{})),await new Promise(n=>setTimeout(n,d))}while(!0);if(q.aborted)throw new Error("Request aborted (timed out)");if(!w)throw A;return w}function P(h){const m=h==null?void 0:h.defaultHeaders;async function y(g,d){const{timeout:F,method:q="GET",retryDelay:M=0,abortController:w,attempts:A,...$}={...h==null?void 0:h.defaultFetcherOptions,...d},C=w||new AbortController,n=f.has(q.toUpperCase())?A??1:1,e={...$,method:q,signal:C.signal};return m&&(e.headers={...m,...$.headers||{}}),S(g,e,{timeout:F,retryDelay:M,attempts:n,abortController:C})}return{fetch:y}}return U}var Q;function X(){return Q||(Q=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var f=G();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return f.createFetchComponent}})})(D)),D}const J="0.0.0-development",K={version:J};var V;function Z(){return V||(V=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const f=X(),S=K;function P(){return S.version}o.getCurrentVersion=P;function h(n,e,i=""){for(const r in n){if(!n.hasOwnProperty(r)||n[r]===null||n[r]===void 0)continue;const t=i?`${i}[${r}]`:r;n[r]instanceof Date?e.append(t,n[r].toISOString()):n[r]instanceof Array?n[r].forEach((a,s)=>{const c=`${t}[${s}]`;h(a,e,c)}):typeof n[r]=="object"?h(n[r],e,t):e.append(t,n[r].toString())}return e}o.addModelToFormData=h;function m(n){return Array.from(new Set(n))}o.MAX_URL_LENGTH=2048;async function y({baseUrl:n,path:e,queryParams:i,fetcher:r,uniqueBy:t,options:a}){r=r||(0,f.createFetchComponent)();const s=q({baseUrl:n,path:e,queryParams:i}),c=new Map;for(const u of s)(await(await r.fetch(u,{...a,headers:{"Content-Type":"application/json"}})).json()).forEach(E=>c.set(t?E[t]:c.size,E));return Array.from(c.values())}o.splitAndFetch=y;const g=7;async function d({baseUrl:n,path:e,queryParams:i,elementsProperty:r,uniqueBy:t,options:a,fetcher:s}){s=s||(0,f.createFetchComponent)();const u=q({baseUrl:n,path:e,queryParams:i,reservedParams:new Map([["offset",g]])}),b=new Map;let E=!1;for(let v=0;v<u.length&&!E;v++){let l=u[v];for(;l&&!E;)try{const p=(await s.fetch(l,a)).json();p[r].forEach(j=>b.set(j[t],j));const _=p.pagination.next;l=_?new URL(_,l).toString():void 0}catch{E=!0}}return Array.from(b.values())}o.splitAndFetchPaginated=d;function F({queryParams:n,baseUrl:e,path:i,reservedParams:r}){const t="name"in n?new Map([[n.name,n.values]]):n;if(t.size===0)return[new C(e+i,t,r)];const s=Array.from(t.entries()).map(([l,p])=>[l,m(p)]).sort(([l,p],[T,_])=>p.length-_.length),c=new C(e+i,new Map,r);for(let l=0;l<s.length-1;l++){const[p,T]=s[l];if(!c.canSetParams(p,T))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.");c.setParams(p,T)}let u=C.clone(c);const[b,E]=s[s.length-1],v=[];for(const l of E)u.canAddParam(b,l)||(v.push(u),u=C.clone(c)),u.addParam(b,l);return v.push(u),v}o.splitValuesIntoManyQueryBuilders=F;function q(n){return F(n).map(i=>i.toString())}o.splitValuesIntoManyQueries=q;function M(n){if(!n)return new Map;const e=Object.entries(n).filter(([i,r])=>!!r).map(([i,r])=>{const t=i.endsWith("s")?i.slice(0,-1):i;let a;if(Array.isArray(r))a=[...r].filter(A).map(s=>`${s}`);else if(A(r))a=[`${r}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[t,a]}).filter(([i,r])=>r.length>0);return new Map(e)}o.convertFiltersToQueryParams=M;function w(n,e){const i={...n==null?void 0:n.headers,...e==null?void 0:e.headers};return{...n,...e,headers:i}}o.mergeRequestOptions=w;function A(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function $(n){return n=n.trim(),!n.startsWith("https://")&&!n.startsWith("http://")&&(n="https://"+n),n.endsWith("/")&&(n=n.slice(0,-1)),n}o.sanitizeUrl=$;class C{constructor(e,i=new Map,r=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=r,this.length=this.calculateUrlLength(i,r)}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 r=this.queryParams.get(e),t=r||[];return t.push(i),this.queryParams.set(e,t),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const r=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(r,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(r=>`${r}`)),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[r,t]of this.queryParams)for(const a of t)i?e+=`&${r}=${a}`:(e+=`?${r}=${a}`,i=!0);return e}calculateUrlLength(e,i){let r=this.baseUrl.length;for(const[t,a]of i)this.queryParams.has(t)||(r+=t.length+2+a);for(const[t,a]of e)r+=this.calculateAddedLength(t,a);return r}static clone(e){return new C(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,r)=>i+r.length,0)}}o.QueryBuilder=C})(L)),L}var R={},I;function x(){if(I)return R;I=1,Object.defineProperty(R,"__esModule",{value:!0}),R.retry=void 0;async function o(f,S,P,h){for(;P>0;)try{return await S()}catch(m){if(P--,P>0)console.info(`Failed to ${f}. Still have ${P} attempt/s left. Will try again in ${h}`),await new Promise(y=>setTimeout(y,h));else throw m}throw new Error("Please specify more than one attempt for the retry function")}return R.retry=o,R}var N;function ee(){if(N)return O;N=1,Object.defineProperty(O,"__esModule",{value:!0}),O.createContentClient=O.downloadContent=void 0;const o=W(),f=Z(),S=x();async function P(m,y,g,d){const{attempts:F=3,retryDelay:q=500}=d||{},M=d!=null&&d.timeout?{timeout:d.timeout}:{};return(0,S.retry)(`fetch file with hash ${g} from ${y}`,async()=>{const w=await m.fetch(`${y}/${g}`,M),A=new Uint8Array(await w.arrayBuffer());if(!(d!=null&&d.avoidChecks)&&(g.startsWith("Qm")?await(0,o.hashV0)(A):await(0,o.hashV1)(A))!==g)throw new Error(`Failed to fetch file with hash ${g} from ${y}`);return A},F,q)}O.downloadContent=P;function h(m){const{fetcher:y,logger:g}=m,d=(0,f.sanitizeUrl)(m.url),F=m==null?void 0:m.parallelConfig;async function q(t,a,s){const c=new AbortController,u=c.signal,b=(0,f.mergeRequestOptions)(s,{signal:u});return new Promise(async E=>{let v=t.length;const l=()=>{v--,v===0&&E([])},p=T=>T&&Array.isArray(T)&&T.length>0?(c.abort(),E(T),!0):!1;t.forEach(async T=>{try{const _=(0,f.sanitizeUrl)(T),j=await y.fetch(`${_}${a}`,b);if(u.aborted){l();return}const k=await j.json();p(k)||l()}catch(_){u.aborted||g==null||g.warn(`Failed to fetch from ${T}:`,_),l()}})})}async function M(t,a,s){const u=(await Promise.allSettled(t.map(async l=>{try{const p=(0,f.sanitizeUrl)(l);return await(await y.fetch(`${p}${a}`,s)).json()}catch(p){return g==null||g.warn(`Failed to fetch from ${l}:`,p),[]}}))).filter(l=>l.status==="fulfilled").map(l=>l.value||[]),b=u.flatMap(l=>l),E=u.filter(l=>l.length===0).length,v=new Map;return b.forEach(l=>{(!v.has(l.id)||l.timestamp>v.get(l.id).timestamp)&&v.set(l.id,l)}),{entities:Array.from(v.values()),emptyResults:E}}async function w(t,a){const s=new FormData;s.append("entityId",t.entityId),(0,f.addModelToFormData)(t.authChain,s,"authChain");const c=await i(Array.from(t.files.keys()),a);for(const[u,b]of t.files)(!c.has(u)||u===t.entityId)&&s.append(u,new Blob([b]),u);return s}async function A(t,a){const s=await w(t,a),c=(0,f.mergeRequestOptions)(a||{},{body:s,method:"POST"});return await y.fetch(`${d}/entities`,c)}async function $(t,a){if(t.length===0)return Promise.reject("You must set at least one pointer.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:t}),method:"POST",headers:{"Content-Type":"application/json"}});return(await y.fetch(`${d}/entities/active`,s)).json()}async function C(t,a){if(t.length===0)return Promise.reject("You must set at least one id.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({ids:t}),method:"POST",headers:{"Content-Type":"application/json"}}),c=(a==null?void 0:a.parallel)||F;return c!=null&&c.urls&&(c==null?void 0:c.urls.length)>0?q([d,...c.urls],"/entities/active",s):(await y.fetch(`${d}/entities/active`,s)).json()}async function n(t,a){const s=await C([t],a);return s.length===0?Promise.reject(`Failed to find an entity with id '${t}'.`):s[0]}function e(t,a){return t.length===0?Promise.reject("You must set at least one cid."):(0,f.splitAndFetch)({fetcher:y,options:a,baseUrl:d,path:"/available-content",queryParams:{name:"cid",values:t},uniqueBy:"cid"})}async function i(t,a){const c=(await e(t,a)).filter(u=>u.available).map(({cid:u})=>u);return new Set(c)}async function r(t,a){const s=(a==null?void 0:a.parallel)||F;if(!(s!=null&&s.urls)||s.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const c=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:[t]}),method:"POST",headers:{"Content-Type":"application/json"}}),u=[d,...s.urls],{entities:b,emptyResults:E}=await M(u,"/entities/active",c);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const v=Math.max(...b.map(_=>_.timestamp)),l=b.filter(_=>_.timestamp===v),p=b.filter(_=>_.timestamp<v);return{isConsistent:p.length===0&&E===0,upToDateEntities:l.length>0?l:void 0,outdatedEntities:p.length>0?p:void 0}}return{buildEntityFormDataForDeployment:w,fetchEntitiesByPointers:$,fetchEntitiesByIds:C,fetchEntityById:n,downloadContent:(t,a)=>P(y,d+"/contents",t,a),deploy:A,isContentAvailable:e,checkPointerConsistency:r}}return O.createContentClient=h,O}var B=ee();const te=z(B),ae=Y({__proto__:null,default:te},[B]);export{ae as C};